根据运营商id查询配置信息
This commit is contained in:
parent
a10381f383
commit
cc26a5163d
@ -45,39 +45,16 @@ public class EbikeCarrierConfigurationController {
|
|||||||
return JsonResult.success();
|
return JsonResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据主键删除。
|
|
||||||
*
|
|
||||||
* @param configurationId 主键
|
|
||||||
* @return {@code true} 删除成功,{@code false} 删除失败
|
|
||||||
*/
|
|
||||||
@GetMapping("remove")
|
|
||||||
public JsonResult<?> remove(@RequestParam("configurationId") Long configurationId) {
|
|
||||||
carrierConfigurationService.removeById(configurationId);
|
|
||||||
return JsonResult.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据主键更新。
|
* 根据运营商id查询配置信息
|
||||||
*
|
*
|
||||||
* @param dto 配置实体类信息
|
* @param operatorId 运营商id
|
||||||
* @return {@code true} 更新成功,{@code false} 更新失败
|
|
||||||
*/
|
|
||||||
@PostMapping("update")
|
|
||||||
public JsonResult<?> update(@RequestBody @Validated EbikeUpdateConfigurationDto dto) {
|
|
||||||
carrierConfigurationService.updateConfiguration(dto);
|
|
||||||
return JsonResult.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据主键id查询
|
|
||||||
*
|
|
||||||
* @param configurationId 主键id
|
|
||||||
* @return 配置信息
|
* @return 配置信息
|
||||||
*/
|
*/
|
||||||
@GetMapping("getById")
|
@GetMapping("getByOperatorId")
|
||||||
public JsonResult<?> getById(@RequestParam("configurationId") Long configurationId) {
|
public JsonResult<?> getByOperatorId(@RequestParam("operatorId") Long operatorId) {
|
||||||
EbikeCarrierConfiguration result = carrierConfigurationService.getById(configurationId);
|
EbikeCarrierConfiguration result = carrierConfigurationService.getConfigurationByOperationId(operatorId);
|
||||||
return JsonResult.success(result);
|
return JsonResult.success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,13 +28,6 @@ public interface EbikeCarrierConfigurationService extends IService<EbikeCarrierC
|
|||||||
*/
|
*/
|
||||||
void saveConfiguration(EbikeSaveConfigurationDto dto);
|
void saveConfiguration(EbikeSaveConfigurationDto dto);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据主键更新
|
|
||||||
*
|
|
||||||
* @param dto 配置项参数
|
|
||||||
*/
|
|
||||||
void updateConfiguration(EbikeUpdateConfigurationDto dto);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据运营商id查询电话
|
* 根据运营商id查询电话
|
||||||
* @param operatorId 运营商id
|
* @param operatorId 运营商id
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
package com.cdzy.operations.service.impl;
|
package com.cdzy.operations.service.impl;
|
||||||
|
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import com.cdzy.common.ex.EbikeException;
|
|
||||||
import com.cdzy.operations.mapper.EbikeCarrierConfigurationMapper;
|
import com.cdzy.operations.mapper.EbikeCarrierConfigurationMapper;
|
||||||
import com.cdzy.operations.model.dto.EbikeSaveConfigurationDto;
|
import com.cdzy.operations.model.dto.EbikeSaveConfigurationDto;
|
||||||
import com.cdzy.operations.model.dto.EbikeUpdateConfigurationDto;
|
|
||||||
import com.cdzy.operations.model.entity.EbikeCarrierConfiguration;
|
import com.cdzy.operations.model.entity.EbikeCarrierConfiguration;
|
||||||
import com.cdzy.operations.service.EbikeCarrierConfigurationService;
|
import com.cdzy.operations.service.EbikeCarrierConfigurationService;
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
@ -71,23 +69,6 @@ public class EbikeCarrierConfigurationServiceImpl extends ServiceImpl<EbikeCarri
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
|
||||||
@Override
|
|
||||||
public void updateConfiguration(EbikeUpdateConfigurationDto dto) {
|
|
||||||
QueryWrapper queryWrapper = QueryWrapper.create()
|
|
||||||
.select(EBIKE_CARRIER_CONFIGURATION.ALL_COLUMNS)
|
|
||||||
.where(EBIKE_CARRIER_CONFIGURATION.CONFIGURATION_ID.eq(dto.getConfigurationId()));
|
|
||||||
EbikeCarrierConfiguration configuration = this.mapper.selectOneByQuery(queryWrapper);
|
|
||||||
if (Objects.isNull(configuration)) {
|
|
||||||
throw new EbikeException("配置项不存在");
|
|
||||||
}
|
|
||||||
configuration.setDispatchDuration(dto.getDispatchDuration());
|
|
||||||
configuration.setRideDuration(dto.getRideDuration());
|
|
||||||
configuration.setInspectionIntervalDuration(dto.getInspectionIntervalDuration());
|
|
||||||
configuration.setOperatorPhone(dto.getOperatorPhone());
|
|
||||||
this.mapper.update(configuration);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPhoneByOperatorId(Long operatorId) {
|
public String getPhoneByOperatorId(Long operatorId) {
|
||||||
QueryWrapper queryWrapper = QueryWrapper.create()
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user