|
|
|
@ -9,7 +9,6 @@ import com.logpm.trunkline.dto.TrunklineCarsLoadDTO;
|
|
|
|
|
import com.logpm.trunkline.dto.TrunklineCarsLoadLineDTO; |
|
|
|
|
import com.logpm.trunkline.dto.TrunklineCarsOrderDTO; |
|
|
|
|
import com.logpm.trunkline.service.ITrunklineCarsLoadService; |
|
|
|
|
import com.logpm.trunkline.vo.TrunklineCarsLoadLineVO; |
|
|
|
|
import com.logpm.trunkline.vo.TrunklineCarsLoadVO; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
@ -156,8 +155,16 @@ public class CarsLoadController {
|
|
|
|
|
String method = "############updateCarsLoadBasicData: "; |
|
|
|
|
log.info(method+"请求参数{}",carsLoadDTO); |
|
|
|
|
Long loadId = carsLoadDTO.getId();//配载计划id
|
|
|
|
|
String loadingType = carsLoadDTO.getLoadingType();//装车方式 1=手动装车,2=扫描装车
|
|
|
|
|
BigDecimal countTransportCost = carsLoadDTO.getCountTransportCost();//合计运费
|
|
|
|
|
Long driverId = carsLoadDTO.getDriverId(); |
|
|
|
|
Long assistantId = carsLoadDTO.getAssistantId(); |
|
|
|
|
String driverName = carsLoadDTO.getDriverName(); |
|
|
|
|
String driverMobile = carsLoadDTO.getDriverMobile(); |
|
|
|
|
Long carId = carsLoadDTO.getCarId(); |
|
|
|
|
String chargeType = carsLoadDTO.getChargeType(); |
|
|
|
|
String carNumber = carsLoadDTO.getCarNumber(); |
|
|
|
|
String remark = carsLoadDTO.getRemark(); |
|
|
|
|
String loadType = carsLoadDTO.getLoadType(); |
|
|
|
|
|
|
|
|
|
try{ |
|
|
|
|
|
|
|
|
|
//当前登录人选择的仓库
|
|
|
|
@ -172,19 +179,42 @@ public class CarsLoadController {
|
|
|
|
|
return R.fail(400,"配载id为空"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(StringUtil.isBlank(loadingType)){ |
|
|
|
|
log.warn(method+"装车类型为空 loadingType={}",loadingType); |
|
|
|
|
return R.fail(400,"装车类型为空"); |
|
|
|
|
if(Objects.isNull(assistantId)){ |
|
|
|
|
log.warn(method+"副驾id为空 assistantId={}",assistantId); |
|
|
|
|
return R.fail(400,"副驾id为空"); |
|
|
|
|
} |
|
|
|
|
if(!"1".equals(loadingType) && !"2".equals(loadingType)){ |
|
|
|
|
log.warn(method+"装车类型值不正确 loadingType={}",loadingType); |
|
|
|
|
return R.fail(400,"装车类型值不正确"); |
|
|
|
|
|
|
|
|
|
if(Objects.isNull(driverId)){ |
|
|
|
|
log.warn(method+"司机id为空 driverId={}",driverId); |
|
|
|
|
return R.fail(400,"司机id为空"); |
|
|
|
|
} |
|
|
|
|
if(Objects.isNull(countTransportCost)){ |
|
|
|
|
log.warn(method+"合计运费为空 countTransportCost={}",countTransportCost); |
|
|
|
|
return R.fail(400,"合计运费为空"); |
|
|
|
|
|
|
|
|
|
if(StringUtil.isBlank(driverName)){ |
|
|
|
|
log.warn(method+"司机名称为空 driverName={}",driverName); |
|
|
|
|
return R.fail(400,"司机名称为空"); |
|
|
|
|
} |
|
|
|
|
if(StringUtil.isBlank(driverMobile)){ |
|
|
|
|
log.warn(method+"司机电话为空 driverMobile={}",driverMobile); |
|
|
|
|
return R.fail(400,"司机电话为空"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(Objects.isNull(carId)){ |
|
|
|
|
log.warn(method+"车辆id为空 carId={}",carId); |
|
|
|
|
return R.fail(400,"车辆id为空"); |
|
|
|
|
} |
|
|
|
|
if(StringUtil.isBlank(chargeType)){ |
|
|
|
|
log.warn(method+"分摊方式为空 chargeType={}",chargeType); |
|
|
|
|
return R.fail(400,"分摊方式为空"); |
|
|
|
|
} |
|
|
|
|
if(StringUtil.isBlank(carNumber)){ |
|
|
|
|
log.warn(method+"车牌号为空 carNumber={}",carNumber); |
|
|
|
|
return R.fail(400,"车牌号为空"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(StringUtil.isBlank(loadType)){ |
|
|
|
|
log.warn(method+"配载类型为空 loadType={}",loadType); |
|
|
|
|
return R.fail(400,"配载类型为空"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return carsLoadService.updateCarsLoadBasicData(carsLoadDTO,myCurrentWarehouse.getId()); |
|
|
|
|
}catch (CustomerException e){ |
|
|
|
@ -1032,9 +1062,23 @@ public class CarsLoadController {
|
|
|
|
|
@PostMapping("/updateLoadFeeByNodeId") |
|
|
|
|
@ApiOperationSupport(order = 1) |
|
|
|
|
@ApiOperation(value = "更新配载计划节点费用信息", notes = "传入loadCarsDTO") |
|
|
|
|
public R updateLoadFeeByNodeId(@RequestBody TrunklineCarsLoadLineVO carsLoadLineVO) { |
|
|
|
|
public R updateLoadFeeByNodeId(@RequestBody TrunklineCarsLoadDTO carsLoadDTO) { |
|
|
|
|
String method = "############updateLoadFeeByNodeId: "; |
|
|
|
|
log.info(method + "请求参数{}", carsLoadLineVO); |
|
|
|
|
log.info(method + "请求参数{}", carsLoadDTO); |
|
|
|
|
|
|
|
|
|
Long loadId = carsLoadDTO.getId();//配载计划id
|
|
|
|
|
Long carId = carsLoadDTO.getCarId(); |
|
|
|
|
String carNumber = carsLoadDTO.getCarNumber(); |
|
|
|
|
Long driverId = carsLoadDTO.getDriverId(); |
|
|
|
|
Long assistantId = carsLoadDTO.getAssistantId(); |
|
|
|
|
String driverName = carsLoadDTO.getDriverName(); |
|
|
|
|
String driverMobile = carsLoadDTO.getDriverMobile(); |
|
|
|
|
String loadingType = carsLoadDTO.getLoadingType(); |
|
|
|
|
String chargeType = carsLoadDTO.getChargeType(); |
|
|
|
|
String loadType = carsLoadDTO.getLoadType(); |
|
|
|
|
BigDecimal countTransportCost = carsLoadDTO.getCountTransportCost(); |
|
|
|
|
List<TrunklineCarsLoadLineDTO> carsLoadLineList = carsLoadDTO.getCarsLoadLineList(); |
|
|
|
|
|
|
|
|
|
try{ |
|
|
|
|
//当前登录人选择的仓库
|
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
@ -1042,7 +1086,58 @@ public class CarsLoadController {
|
|
|
|
|
log.warn(method + "仓库信息为空 myCurrentWarehouse={}", myCurrentWarehouse); |
|
|
|
|
return R.fail(405, "仓库信息为空"); |
|
|
|
|
} |
|
|
|
|
return carsLoadService.updateLoadFeeByNodeId(carsLoadLineVO); |
|
|
|
|
|
|
|
|
|
if(Objects.isNull(loadId)){ |
|
|
|
|
log.warn(method+"配载id为空 loadId={}",loadId); |
|
|
|
|
return R.fail(400,"配载id为空"); |
|
|
|
|
} |
|
|
|
|
if(Objects.isNull(countTransportCost)){ |
|
|
|
|
log.warn(method+"合计费用为空 countTransportCost={}",countTransportCost); |
|
|
|
|
return R.fail(400,"合计费用为空"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(Objects.isNull(driverId)){ |
|
|
|
|
log.warn(method+"司机id为空 driverId={}",driverId); |
|
|
|
|
return R.fail(400,"司机id为空"); |
|
|
|
|
} |
|
|
|
|
if(StringUtil.isBlank(loadingType)){ |
|
|
|
|
log.warn(method+"装车方式为空 loadingType={}",loadingType); |
|
|
|
|
return R.fail(400,"装车方式为空"); |
|
|
|
|
} |
|
|
|
|
if(StringUtil.isBlank(driverName)){ |
|
|
|
|
log.warn(method+"司机名称为空 driverName={}",driverName); |
|
|
|
|
return R.fail(400,"司机名称为空"); |
|
|
|
|
} |
|
|
|
|
if(StringUtil.isBlank(driverMobile)){ |
|
|
|
|
log.warn(method+"司机电话为空 driverMobile={}",driverMobile); |
|
|
|
|
return R.fail(400,"司机电话为空"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(Objects.isNull(carId)){ |
|
|
|
|
log.warn(method+"车辆id为空 carId={}",carId); |
|
|
|
|
return R.fail(400,"车辆id为空"); |
|
|
|
|
} |
|
|
|
|
if(StringUtil.isBlank(chargeType)){ |
|
|
|
|
log.warn(method+"分摊方式为空 chargeType={}",chargeType); |
|
|
|
|
return R.fail(400,"分摊方式为空"); |
|
|
|
|
} |
|
|
|
|
if(StringUtil.isBlank(carNumber)){ |
|
|
|
|
log.warn(method+"车牌号为空 carNumber={}",carNumber); |
|
|
|
|
return R.fail(400,"车牌号为空"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(StringUtil.isBlank(loadType)){ |
|
|
|
|
log.warn(method+"配载类型为空 loadType={}",loadType); |
|
|
|
|
return R.fail(400,"配载类型为空"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(Objects.isNull(carsLoadLineList) || carsLoadLineList.size() == 0){ |
|
|
|
|
log.warn(method+"节点信息为空 carsLoadLineList={}",carsLoadLineList); |
|
|
|
|
return R.fail(400,"节点信息为空"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return carsLoadService.updateLoadFeeByNodeId(carsLoadDTO,myCurrentWarehouse.getId()); |
|
|
|
|
}catch (CustomerException e){ |
|
|
|
|
log.error(e.message,e); |
|
|
|
|
return R.fail(e.code,e.message); |
|
|
|
|