From 6c777bcbbbc298715fb5b6698642b11ce4d1de0b Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 24 Jun 2024 12:41:17 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=90=8C=E6=AD=A5=E8=80=81?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=89=98=E7=9B=98=E6=95=B0=E6=8D=AE=E7=9A=84?= =?UTF-8?q?=E6=95=88=E7=8E=87=202.=E6=8B=89=E5=8F=96=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=8F=AF=E4=BB=A5=E6=8C=89=E7=85=A7=E8=BF=90?= =?UTF-8?q?=E5=8D=95=E6=8B=89=E5=8F=96=203.=E4=BF=AE=E5=A4=8D=E5=B9=B2?= =?UTF-8?q?=E7=BA=BFbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oldproject/feign/IAdvanceClient.java | 3 ++ .../feign/IAdvanceClientFallbackFactory.java | 5 ++++ .../com/logpm/patch/dto/SyncInventoryDTO.java | 1 + .../trunkline/vo/CarsLoadWaybillInfoVO.java | 1 + .../logpm/oldproject/feign/AdvanceClient.java | 5 ++++ .../oldproject/mapper/AdvanceMapper.java | 2 ++ .../logpm/oldproject/mapper/AdvanceMapper.xml | 7 +++++ .../oldproject/service/IAdvanceService.java | 2 ++ .../service/impl/AdvanceServiceImpl.java | 5 ++++ .../controller/SyncOrderInfoController.java | 29 ++++++++++++++++--- .../mapper/TrunklineCarsOrderMapper.xml | 1 + .../impl/TrunklineCarsLoadServiceImpl.java | 8 ++--- .../impl/WarehouseTrayTypeServiceImpl.java | 25 ++++++++++++++-- 13 files changed, 83 insertions(+), 11 deletions(-) diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java index 30caad6c9..701af6358 100644 --- a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java @@ -100,4 +100,7 @@ public interface IAdvanceClient { @PostMapping(API_PREFIX + "/findListByAdvanceIds") List findListByAdvanceIds(@RequestBody List advanceIds); + + @PostMapping(API_PREFIX + "/findListByWaybillNo") + List findListByWaybillNo(@RequestParam String waybillNo); } diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClientFallbackFactory.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClientFallbackFactory.java index 25042612e..c9c0c05c8 100644 --- a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClientFallbackFactory.java +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClientFallbackFactory.java @@ -60,6 +60,11 @@ public class IAdvanceClientFallbackFactory implements FallbackFactory findListByAdvanceIds(List advanceIds) { return null; } + + @Override + public List findListByWaybillNo(String waybillNo) { + return null; + } }; } } diff --git a/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/dto/SyncInventoryDTO.java b/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/dto/SyncInventoryDTO.java index e44b80013..b8b7ca250 100644 --- a/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/dto/SyncInventoryDTO.java +++ b/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/dto/SyncInventoryDTO.java @@ -15,5 +15,6 @@ public class SyncInventoryDTO implements Serializable { private Long warehouseId; private String orderCodes; + private Integer syncType; } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadWaybillInfoVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadWaybillInfoVO.java index 14a8a8700..cf6a8e124 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadWaybillInfoVO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadWaybillInfoVO.java @@ -15,6 +15,7 @@ public class CarsLoadWaybillInfoVO implements Serializable { private Date createTime; private String destination; private String destinationWarehouseName; + private Integer checkStatus; private String shipper; private String shipperName; private String consignee; diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java index 7b7b08755..6aa30181a 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java @@ -112,4 +112,9 @@ public class AdvanceClient implements IAdvanceClient { return list; } + + @Override + public List findListByWaybillNo(String waybillNo) { + return service.findListByWaybillNo(waybillNo); + } } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java index f403eef3d..4de5b4b07 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java @@ -54,4 +54,6 @@ public interface AdvanceMapper { List getAdvanceList(@Param("orderSelfNum") String orderSelfNum); List findListByAdvanceIds(@Param("advanceIds") List advanceIds); + + List findListByWaybillNo(@Param("waybillNo") String waybillNo); } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml index 5d45bcf57..5de72e1e8 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml @@ -82,4 +82,11 @@ + + diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java index 572881bd6..79353faa3 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java @@ -54,4 +54,6 @@ public interface IAdvanceService { List getAdvanceList(String orderSelfNum); List findListByAdvanceIds(List advanceIds); + + List findListByWaybillNo(String waybillNo); } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java index 60735b8fe..3bc887d09 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java @@ -87,4 +87,9 @@ public class AdvanceServiceImpl implements IAdvanceService { public List findListByAdvanceIds(List advanceIds) { return advanceMapper.findListByAdvanceIds(advanceIds); } + + @Override + public List findListByWaybillNo(String waybillNo) { + return advanceMapper.findListByWaybillNo(waybillNo); + } } diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/controller/SyncOrderInfoController.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/controller/SyncOrderInfoController.java index b05f020a9..24d49eb23 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/controller/SyncOrderInfoController.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/controller/SyncOrderInfoController.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; +import com.logpm.oldproject.feign.IAdvanceClient; import com.logpm.patch.dto.SyncInventoryDTO; import com.logpm.patch.entity.SyncInventoryEntity; import com.logpm.patch.service.ISyncOrderInfoService; @@ -30,6 +31,7 @@ public class SyncOrderInfoController { private final IBasicdataWarehouseClient warehouseClient; private final ISyncOrderInfoService syncOrderInfoService; + private final IAdvanceClient advanceClient; @ResponseBody @PostMapping("/syncOrder") @@ -40,6 +42,7 @@ public class SyncOrderInfoController { try{ String orderCodes = syncInventoryDTO.getOrderCodes(); + Integer syncType = syncInventoryDTO.getSyncType();//1订单 2 运单 if(StringUtil.isBlank(orderCodes)){ log.warn(method+"订单号不能为空 orderCodes={}",orderCodes); @@ -51,16 +54,34 @@ public class SyncOrderInfoController { log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(403,"仓库信息为空"); } + + if(Objects.isNull(syncType)){ + log.warn(method+"数据类型不能为空 syncType={}",syncType); + return R.fail(403,"数据类型不能为空"); + } + + Long warehouseId = myCurrentWarehouse.getId(); log.info(method+" warehouseId={} oldWarehouseId={}",warehouseId,myCurrentWarehouse.getOldId()); BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(warehouseId); log.info(method+" warehouseId={} oldWarehouseId={}",warehouseId,entityWarehouseId.getOldId()); - - String[] split = orderCodes.split(","); - - List orderCodeList = new ArrayList<>(Arrays.asList(split)); + List orderCodeList = new ArrayList<>(); + if(syncType.equals(1)){ + //订单 + String[] split = orderCodes.split(","); + List list = Arrays.asList(split); + orderCodeList.addAll(list); + }else if(syncType.equals(2)){ + //运单 + List list = advanceClient.findListByWaybillNo(orderCodes); + orderCodeList.addAll(list); + }else{ + log.warn(method+"数据类型不正确 syncType={}",syncType); + return R.fail(403,"数据类型不正确"); + } + log.info(method+"当前处理的订单 orderCodeList={}",orderCodeList); syncOrderInfoService.handleData(orderCodeList,entityWarehouseId.getOldId(),warehouseId,null,null); 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 f4bc5f94d..f71407b4d 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,6 +109,7 @@ wb.create_time createTime, wb.destination destination, wb.destination_warehouse_name destinationWarehouseName, + IF(wb.check_user_id IS NULL , 0,1) checkStatus, wb.shipper shipper, wb.shipper_name shipperName, wb.consignee consignee, 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 ed9290579..2c86a838b 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 @@ -2911,17 +2911,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl carsLoadOrderInfoList = trunklineCarsOrderService.findCarsLoadOrderInfoList(loadId, waybillNo); +// List carsLoadOrderInfoList = trunklineCarsOrderService.findCarsLoadOrderInfoList(loadId, waybillNo); -// List carsLoadOrderInfoListPlan = trunklineCarsOrderService.findCarsLoadOrderInfoListPlan(loadId, waybillNo); + List carsLoadOrderInfoListPlan = trunklineCarsOrderService.findCarsLoadOrderInfoListPlan(loadId, waybillNo); - carsLoadOrderInfoList.forEach(carsLoadOrderInfoVO -> { + carsLoadOrderInfoListPlan.forEach(carsLoadOrderInfoVO -> { carsLoadOrderInfoVO.setUnloadIncome(carsLoadOrderInfoVO.getUnloadIncome().setScale(2, BigDecimal.ROUND_HALF_UP)); carsLoadOrderInfoVO.setOrderFreight(carsLoadOrderInfoVO.getOrderFreight().setScale(2, BigDecimal.ROUND_HALF_UP)); }); - carsLoadWaybillInfoVO.setCarsLoadOrderInfoList(carsLoadOrderInfoList); + carsLoadWaybillInfoVO.setCarsLoadOrderInfoList(carsLoadOrderInfoListPlan); // carsLoadWaybillInfoVO.setCarsLoadOrderInfoListPlan(carsLoadOrderInfoListPlan); TrunklineCostShareRecordEntity costShareRecordEntity = trunklineCostShareRecordService.findTotalUnloadNumByLoadAndWaybillNo(loadId, waybillNo); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java index 94fc2c747..a5b567e06 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java @@ -3922,10 +3922,29 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO); + if(parcelListEntityList.isEmpty()){ + log.warn("##############syncOldTrayData: 包件数据不存在"); + return R.fail(405,"没有可以同步的包件"); } + + DistributionParcelListEntity parcelListEntity = parcelListEntityList.get(0); + String orderCode = parcelListEntity.getOrderCode(); + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findByOrderSelfNum(orderCode, warehouseId); + Long trayId = trayEntity.getId(); + + WarehouseTrayTypeEntity trayTypeEntity = saveTrayTypeByOrderPackageCode(trayType, trayCode, trayId, parcelListEntity, stockArticleEntity, warehouseId); + + orderScanOrderPackageCodeList(trayTypeEntity, parcelListEntityList, warehouseId,"同步老系统托盘数据"); + //批量打托 +// for (String orderPackageCode : orderPackageCodes) { +// orderScanOrderPackageCode(trayType,trayCode,orderPackageCode,warehouseId,remark); +// } return R.success("打托成功"); }