diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceDetailMapper.xml b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceDetailMapper.xml index dea7fb324..dda09f871 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceDetailMapper.xml +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceDetailMapper.xml @@ -76,14 +76,19 @@ diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml index 13289126a..5eff98160 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml @@ -54,8 +54,7 @@ left join `ht_order_count` i on `o`.order_code = i.orderSelfNum where 1=1 AND `i`.`delete_time` = '0' - and `i`.warehouse_id = 30 - and `o`.is_update = 0 + and `i`.warehouse_id = #{oldWarehouseId} AND t.orderSelfNum = #{param} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java index 368a26110..f86ba053c 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java @@ -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 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); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml index a29c4f920..6629b6928 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml @@ -21,6 +21,7 @@ ltcl.start_time startTime, ltcl.create_user_name createUserName, ltcl.create_time createTime, + ltcl.now_warehouse_id nowWarehouseId, sum(ltcll.now_transport_cost) nowTransportCost, sum(ltcll.oil_cost) oilCost, sum(ltcll.back_transport_cost) backTransportCost, @@ -54,7 +55,8 @@ ltcl.start_warehouse_name, ltcl.end_warehouse_names, ltcl.arrive_time, - ltcl.start_time + ltcl.start_time, + ltcl.now_warehouse_id @@ -76,6 +78,7 @@ ltcl.start_time startTime, ltcl.create_user_name createUserName, ltcl.create_time createTime, + ltcl.now_warehouse_id nowWarehouseId, sum(ltcll.now_transport_cost) nowTransportCost, sum(ltcll.oil_cost) oilCost, sum(ltcll.back_transport_cost) backTransportCost, @@ -139,9 +142,9 @@ where ldsa.is_deleted = 0 and ldpl.order_package_status in ('20','30') and ldpl.is_deleted = 0 - + and concat(ldsa.order_code,',',ldpl.waybill_number) not in - + #{item} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java index 4e5e4ddf3..3677bfbbf 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java @@ -25,4 +25,6 @@ public interface TrunklineCarsOrderMapper extends BaseMapper findLoadScanPackageWithOrder(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId); void deleteByCarsOrderId(@Param("carsOrderId") Long carsOrderId); + + List findUseOrderWaybilllList(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml index c63a931d8..b954f22a5 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml @@ -94,4 +94,11 @@ where id = #{carsOrderId} + + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java index 36a7cc648..3881a35ea 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java @@ -5,7 +5,6 @@ import com.logpm.trunkline.dto.LoadCarsDTO; import com.logpm.trunkline.dto.TrunklineCarsLoadDTO; import com.logpm.trunkline.entity.TrunklineCarsLoadEntity; import com.logpm.trunkline.vo.TripartiteTransferVO; -import com.logpm.trunkline.vo.TrunklineCarsLoadLineVO; import com.logpm.trunkline.vo.TrunklineCarsLoadVO; import org.springblade.core.mp.base.BaseService; import org.springblade.core.tool.api.R; @@ -110,7 +109,7 @@ public interface ITrunklineCarsLoadService extends BaseService findUnloadZeroList(Long loadId, Long warehouseId); List findLoadScanPackageWithOrder(Long loadId, Long warehouseId); + + List findUseOrderWaybilllList(Long loadId, Long warehouseId); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index bc2b95d17..c7ea61102 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -894,17 +894,29 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl page = new Page<>(); page.setCurrent(loadCarsDTO.getPageNum()); page.setSize(loadCarsDTO.getPageSize()); - + Long loadId = loadCarsDTO.getLoadId(); + Long warehouseId = loadCarsDTO.getWarehouseId(); + if(!Objects.isNull(loadId)){ + List orderCodes = trunklineCarsOrderService.findUseOrderWaybilllList(loadId,warehouseId); + if(!Objects.isNull(orderCodes) && orderCodes.size() > 0){ + loadCarsDTO.setOrderCodes(orderCodes); + } + } IPage pageList = baseMapper.findAllOrderList(page,loadCarsDTO); return R.data(pageList); } @@ -1810,11 +1829,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl carsLoadLineList = carsLoadDTO.getCarsLoadLineList(); + for (TrunklineCarsLoadLineDTO carsLoadLineDTO : carsLoadLineList) { + Long loadCarsLineId = carsLoadLineDTO.getId(); + TrunklineCarsLoadLineEntity loadLineEntity = trunklineCarsLoadLineService.getById(loadCarsLineId); + loadLineEntity.setNowTransportCost(carsLoadLineDTO.getNowTransportCost()); + loadLineEntity.setOilCost(carsLoadLineDTO.getOilCost()); + loadLineEntity.setBackTransportCost(carsLoadLineDTO.getBackTransportCost()); + loadLineEntity.setReachTransportCost(carsLoadLineDTO.getReachTransportCost()); + loadLineEntity.setWholeCarInfoCost(carsLoadLineDTO.getWholeCarInfoCost()); + loadLineEntity.setWholeCarInsuranceCost(carsLoadLineDTO.getWholeCarInsuranceCost()); + loadLineEntity.setWholeCarGroundCost(carsLoadLineDTO.getWholeCarGroundCost()); + loadLineEntity.setHairWholeCost(carsLoadLineDTO.getHairWholeCost()); + loadLineEntity.setHairWholeOtherCost(carsLoadLineDTO.getHairWholeOtherCost()); + loadLineEntity.setUnloadCost(carsLoadLineDTO.getUnloadCost()); + loadLineEntity.setUnloadOtherCost(carsLoadLineDTO.getUnloadOtherCost()); + loadLineEntity.setFuel(carsLoadLineDTO.getFuel()); + loadLineEntity.setTollFee(carsLoadLineDTO.getTollFee()); + trunklineCarsLoadLineService.updateById(loadLineEntity); + } + return R.success("修改成功"); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java index a9d00b4ad..b6b14aac9 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java @@ -52,4 +52,9 @@ public class TrunklineCarsOrderEntityServiceImpl extends BaseServiceImpl findUseOrderWaybilllList(Long loadId, Long warehouseId) { + return baseMapper.findUseOrderWaybilllList(loadId,warehouseId); + } + }