diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java index 0d31d17d9..6fa85f923 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java @@ -227,4 +227,7 @@ public interface IDistributionParcelListClient { @PostMapping(API_PREFIX + "/findListByStockArticleIds") List findListByStockArticleIds(@RequestBody List orderIdList); + + @GetMapping(API_PREFIX + "/updateWaybillIdByWaybillNo") + void updateWaybillIdByWaybillNo(@RequestParam Long waybillId, @RequestParam String waybillNo); } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadOrderInfoVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadOrderInfoVO.java index e088db4ff..c0dfda215 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadOrderInfoVO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadOrderInfoVO.java @@ -17,6 +17,7 @@ public class CarsLoadOrderInfoVO implements Serializable { private BigDecimal unloadIncome; private BigDecimal costZhang; private BigDecimal costPiece; + private BigDecimal income; private BigDecimal weight; private BigDecimal volume; private BigDecimal orderFreight; diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java index 5cc5c5a15..25ab5b12e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java @@ -535,4 +535,9 @@ public class DistributionParcelListClient implements IDistributionParcelListClie public List findListByStockArticleIds(List orderIdList) { return distributionParcelListService.findListByStockArticleIds(orderIdList); } + + @Override + public void updateWaybillIdByWaybillNo(Long waybillId, String waybillNo) { + distributionParcelListService.updateWaybillIdByWaybillNo(waybillId,waybillNo); + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java index 856639143..89e26f500 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java @@ -306,4 +306,5 @@ public interface DistributionParcelListMapper extends BaseMapper findListByStockArticleIds(@Param("orderIdList") List orderIdList); + void updateWaybillIdByWaybillNo(@Param("waybillId") Long waybillId, @Param("waybillNo") String waybillNo); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml index 8afeef52c..49b12682d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml @@ -1915,4 +1915,11 @@ + + update logpm_distribution_parcel_list + set waybill_id = #{waybillId} + where waybill_number = #{waybillNo} + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java index e9a2e4a25..b8832827b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java @@ -260,4 +260,6 @@ public interface IDistributionParcelListService extends BaseService findListByStockArticleIds(List orderIdList); + + void updateWaybillIdByWaybillNo(Long waybillId, String waybillNo); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java index 053ef44a7..cdc07db12 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java @@ -1369,6 +1369,11 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl syncWaybillInfo(String param) { + log.info("############syncWaybillInfo: 同步运单信息 开始"); + List waybillJSONs = warehouseMappingDataService.findAllWaybillNo(); + + waybillJSONs.forEach(waybillJSON -> { + + Long id = waybillJSON.getLong("id"); + String waybillNo = waybillJSON.getStr("waybillNo"); + + syncOrderInfoService.syncWaybillInfo(waybillNo); + + warehouseMappingDataService.updateStatusById(id,1); + }); + + log.info("############syncWaybillInfo: 同步运单信息 完成"); + + return ReturnT.SUCCESS; + } + } diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java index d2a2bb587..65c6f5d66 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java @@ -130,5 +130,9 @@ public interface WarehouseMappingDataMapper { * @param remarks */ void updateClearSignforRemarks(@Param("singnforId")Long id,@Param("remarks") String remarks); + + List findAllWaybillNo(); + + void updateStatusById(@Param("id") Long id, @Param("status") int status); } diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml index e9b6b11e4..d0df3b2b6 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml @@ -424,4 +424,18 @@ and ldsl.id is not null + + + + update sync_old_waybill_info + set status = #{status} + where id = #{id} + + + diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncOrderInfoService.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncOrderInfoService.java index ab8fdc6b6..2e7f892e0 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncOrderInfoService.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncOrderInfoService.java @@ -30,4 +30,6 @@ public interface ISyncOrderInfoService { void dealWithPackageUpdown(String orderPackageCode, Long allocationId,Long warehouseId); void clearOrderPackageDownAndDelTray(String orderPackageCode, Long warehouseId); + + void syncWaybillInfo(String waybillNo); } diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java index 390d86299..3e10832c6 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java @@ -112,4 +112,7 @@ public interface IWarehouseMappingDataService { List findStockAllocationInfo(); + List findAllWaybillNo(); + + void updateStatusById(Long id, int status); } diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java index 39f291204..f0c1203fc 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java @@ -370,6 +370,23 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService { warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCode,warehouseId,"系统下架解托"); } + @Override + public void syncWaybillInfo(String waybillNo) { + + saveWaybillEntity(waybillNo); + + WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo); + + if(!Objects.isNull(warehouseWaybillEntity)){ + + Long waybillId = warehouseWaybillEntity.getId(); + //把包件上是这个运单号的没有运单id的加上 + distributionParcelListClient.updateWaybillIdByWaybillNo(waybillId,waybillNo); + + } + + } + @Transactional(rollbackFor = Exception.class) @Override diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java index 8fe26b650..bfa136608 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java @@ -265,4 +265,14 @@ public class WarehouseMappingDataServiceImpl implements IWarehouseMappingDataSer public List findStockAllocationInfo() { return warehouseMappingDataMapper.findStockAllocationInfo(); } + + @Override + public List findAllWaybillNo() { + return warehouseMappingDataMapper.findAllWaybillNo(); + } + + @Override + public void updateStatusById(Long id, int status) { + warehouseMappingDataMapper.updateStatusById(id,status); + } } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml index 126d13cc3..7f5530a59 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml @@ -964,7 +964,7 @@ and final_node_id = #{warehouseId} - select id carsLoadScanId, scan_code orderPackageCode, num num, 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 f2956c837..0e8a7f3e2 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 @@ -109,7 +109,7 @@ wb.create_time createTime, wb.destination destination, wb.destination_warehouse_name destinationWarehouseName, - IF(wb.check_user_id = NULL , 0,1) checkStatus, + IF(wb.check_user_id is null , 0,1) checkStatus, wb.shipper shipper, wb.shipper_name shipperName, wb.consignee consignee, @@ -178,11 +178,15 @@ IFNULL(lww.total_freight/lww.total_count*ltco.unload_num,0) unloadIncome, IFNULL(lww.total_freight/lww.total_count*ltco.plan_num,0) orderLineCost, ltwo.total_number orderNum, - sum(IF(ltcls.scan_status = '3',ltcls.num,0)) signNum + sum(IF(ltcls.scan_status = '3',ltcls.num,0)) signNum, + sum(ltcsr.cost_piece) costPiece, + sum(ltcsr.cost_zhang) costZhang, + sum(ltcsr.income) income from logpm_trunkline_cars_order ltco - left join logpm_trunkline_cars_load_scan ltcls on ltcls.waybill_no = ltco.waybill_no and ltcls.order_code = ltco.order_code - left join logpm_trunkline_waybill_order ltwo on ltwo.order_code = ltco.order_code and ltwo.waybill_no = ltco.waybill_no and ltwo.is_deleted = 0 - left join logpm_warehouse_waybill lww on lww.waybill_no = ltwo.waybill_no + left join logpm_trunkline_cars_load_scan ltcls on ltcls.waybill_no = ltco.waybill_no and ltcls.order_code = ltco.order_code + left join logpm_trunkline_waybill_order ltwo on ltwo.order_code = ltco.order_code and ltwo.waybill_no = ltco.waybill_no and ltwo.is_deleted = 0 + left join logpm_warehouse_waybill lww on lww.waybill_no = ltwo.waybill_no + left join logpm_trunkline_cost_share_record ltcsr on ltco.load_id = ltcsr.load_id and ltco.waybill_no = ltcsr.waybill_no and ltco.order_code = ltcsr.order_code and ltcls.scan_code = ltcsr.product_code where ltco.load_id = #{loadId} and ltco.waybill_no = #{waybillNo} group by ltco.order_code diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCostShareRecordMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCostShareRecordMapper.xml index c65016e51..53bcafbd7 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCostShareRecordMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCostShareRecordMapper.xml @@ -12,7 +12,7 @@ diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java index b90f50bfb..482e5be83 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java @@ -285,6 +285,11 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { BigDecimal countTransportCost = carsLoadEntity.getCountTransportCost(); Integer totalUnloadNum = trunklineCostShareRecordService.findTotalUnloadNumByLoad(loadId); + if(totalUnloadNum.equals(0)){ + log.warn("###############costShareZhang: 分摊件数为0"); + throw new CustomerException(405,"分摊件数为0"); + } + //计算单件成本 BigDecimal costPiece = countTransportCost.divide(new BigDecimal(totalUnloadNum),2, RoundingMode.HALF_UP); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java index 5dd3b6cc9..53cfac3ab 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java @@ -4626,7 +4626,6 @@ public class OpenOrderServiceImpl implements IOpenOrderService { distributionStockArticleEntity.setIncomingNum(warehouseWaybill.getStockCount()); //零担订单默认齐套 distributionStockArticleEntity.setCompleteSet(2); - distributionStockArticleEntity.setBrand(warehouseWaybill.getBrand()); distributionStockArticleEntity.setResource("零担");