From 9ea5d7af7fc06e77ca0a69f065dab5b9cb6c31c3 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Wed, 5 Jun 2024 23:17:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=B8=8D=E6=89=93=E5=8D=B0=E5=85=A5=E5=8F=82=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionBusinessPreOrderAppController.java | 2 +- .../appcontroller/DistributionSignforAppController.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBusinessPreOrderAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBusinessPreOrderAppController.java index 65e04017a..53e3d0d7f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBusinessPreOrderAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBusinessPreOrderAppController.java @@ -40,7 +40,7 @@ public class DistributionBusinessPreOrderAppController { @ResponseBody @PostMapping("/scanOrderPackageCode") @ApiOperationSupport(order = 1) - public Resp scanOrderPackageCode(@RequestBody BusinessSanDTO businessSanDTO){ + public R scanOrderPackageCode(@RequestBody BusinessSanDTO businessSanDTO){ Resp resp = null; try { diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java index 7a7713732..5d77ba11d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java @@ -194,7 +194,7 @@ public class DistributionSignforAppController { */ @PostMapping("/positioning") @ApiOperationSupport(order = 2) - public Resp positioning(@Valid @RequestBody DistributionSignforEntity distributionSignfor) { + public R positioning(@Valid @RequestBody DistributionSignforEntity distributionSignfor) { Resp msg = distributionSignforService.positioning(distributionSignfor); return msg; } @@ -205,7 +205,7 @@ public class DistributionSignforAppController { */ @PostMapping("/signingMessage") @ApiOperationSupport(order = 2) - public Resp signingMessage(@Valid @RequestBody DistributionSignforEntity distributionSignfor) { + public R signingMessage(@Valid @RequestBody DistributionSignforEntity distributionSignfor) { Resp msg = distributionSignforService.positioning(distributionSignfor); return msg; } From 8a4630d8e144cbfd64abe5e059ea0d375cd70e62 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Wed, 5 Jun 2024 23:29:37 +0800 Subject: [PATCH 2/3] =?UTF-8?q?1.=E9=87=8D=E5=A4=8D=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=8C=85=E4=BB=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistributionDeliveryListServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 2041cc106..329549ebd 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -877,7 +877,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl Date: Wed, 5 Jun 2024 23:31:16 +0800 Subject: [PATCH 3/3] =?UTF-8?q?1.=E5=90=8E=E5=8F=B0=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E8=80=81=E7=B3=BB=E7=BB=9F=E6=89=98=E7=9B=98?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/WarehouseTrayTypeApiController.java | 76 +++++++++++++------ 1 file changed, 52 insertions(+), 24 deletions(-) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java index f9b76f6ed..dec3c47a1 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java @@ -4,10 +4,13 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.basicdata.entity.BasicdataTrayEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; +import com.logpm.basicdata.feign.IBasicdataTrayClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.warehouse.dto.TrayTypeDTO; import com.logpm.warehouse.dto.ZeroOrderVO; +import com.logpm.warehouse.service.IWarehouseTaryAllocationService; import com.logpm.warehouse.service.IWarehouseTrayTypeService; import com.logpm.warehouse.vo.OrderDetailVO; import com.logpm.warehouse.vo.TrayTypeDataListVO; @@ -36,6 +39,8 @@ public class WarehouseTrayTypeApiController { private final IWarehouseTrayTypeService warehouseTrayTypeService; private final IBasicdataWarehouseClient warehouseClient; + private final IWarehouseTaryAllocationService taryAllocationService; + private final IBasicdataTrayClient trayClient; //----------------------订单分拣-------------------------------- @ResponseBody @@ -1367,37 +1372,60 @@ public class WarehouseTrayTypeApiController { for (String trayCode : trayCodes) { log.info(method+"当前同步的托盘 trayCode={}",trayCode); + + BasicdataTrayEntity trayEntity = trayClient.getTrayByTrayCode(trayCode); + if(Objects.isNull(trayEntity)){ + log.warn(method+"托盘信息不存在 trayCode={}",trayCode); + continue; + } + Long trayId = trayEntity.getId(); + + Long allcationId = taryAllocationService.getAllocationIdByTrayId(trayId); + if(!Objects.isNull(allcationId)){ + log.warn(method+"托盘已上架 trayCode={}",trayCode); + continue; + } + R trayData = warehouseTrayTypeService.findTrayData(trayCode, myCurrentWarehouse.getId()); + int total = 0; Object data = trayData.getData(); - String s = JSONObject.toJSONString(data); - JSONObject jsonObject = JSONObject.parseObject(s); - JSONArray packageList = jsonObject.getJSONArray("packageList"); - JSONArray zeroOrderList = jsonObject.getJSONArray("zeroOrderList"); - JSONArray stockOrderList = jsonObject.getJSONArray("stockOrderList"); - int packageSize = packageList.size(); - int zeroSize = zeroOrderList.size(); - int stockSize = stockOrderList.size(); - int total = packageSize+zeroSize+stockSize; + if(!Objects.isNull(data)){ + String s = JSONObject.toJSONString(data); + JSONObject jsonObject = JSONObject.parseObject(s); + JSONArray packageList = jsonObject.getJSONArray("packageList"); + JSONArray zeroOrderList = jsonObject.getJSONArray("zeroOrderList"); + JSONArray stockOrderList = jsonObject.getJSONArray("stockOrderList"); + int packageSize = packageList.size(); + int zeroSize = zeroOrderList.size(); + int stockSize = stockOrderList.size(); + total = packageSize+zeroSize+stockSize; + } R syncOldTrayData = warehouseTrayTypeService.findSyncOldTrayData(trayCode, myCurrentWarehouse.getId()); Object data1 = syncOldTrayData.getData(); - String s1 = JSONObject.toJSONString(data1); - JSONObject jsonObject1 = JSONObject.parseObject(s1); - JSONArray packageList1 = jsonObject1.getJSONArray("packageList"); - String trayType1 = jsonObject1.getString("trayType"); - String trayCode1 = jsonObject1.getString("trayCode"); - int size = packageList1.size(); - if(total >= size){ - log.warn(method+"新系统打托数量大于等于老系统 trayCode={} 不同步",trayCode); - continue; - } - List orderPackageCodes = new ArrayList<>(); - for (int i = 0; i < size; i++){ - JSONObject jsonObject2 = packageList1.getJSONObject(i); - orderPackageCodes.add(jsonObject2.getString("orderPackageCode")); + if(!Objects.isNull(data1)){ + String s1 = JSONObject.toJSONString(data1); + JSONObject jsonObject1 = JSONObject.parseObject(s1); + JSONArray packageList1 = jsonObject1.getJSONArray("packageList"); + String trayType1 = jsonObject1.getString("trayType"); + String trayCode1 = jsonObject1.getString("trayCode"); + int size = packageList1.size(); + if(total >= size){ + log.warn(method+"新系统打托数量大于等于老系统 trayCode={} 不同步",trayCode); + continue; + } + List orderPackageCodes = new ArrayList<>(); + for (int i = 0; i < size; i++){ + JSONObject jsonObject2 = packageList1.getJSONObject(i); + orderPackageCodes.add(jsonObject2.getString("orderPackageCode")); + } + if(!orderPackageCodes.isEmpty()){ + warehouseTrayTypeService.syncOldTrayData(trayCode1,trayType1,orderPackageCodes,myCurrentWarehouse.getId(),"同步老系统打托"); + } } - warehouseTrayTypeService.syncOldTrayData(trayCode1,trayType1,orderPackageCodes,myCurrentWarehouse.getId(),"同步老系统打托"); + + } return R.success("处理完成");