From 31bd29fc7bbf63916c6b849c31737a10be19a630 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Tue, 13 Aug 2024 16:51:31 +0800 Subject: [PATCH 1/3] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BFbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 efd905924..74363958b 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 @@ -62,10 +62,9 @@ From bc7c0c7d6a39c44f301a47443c9eea6380e2ec4b Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Tue, 13 Aug 2024 17:14:54 +0800 Subject: [PATCH 2/3] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BFbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/TrunklineCarsLoadServiceImpl.java | 178 +++++++++++++++++- .../impl/WarehouseTrayTypeServiceImpl.java | 5 + 2 files changed, 181 insertions(+), 2 deletions(-) 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 c77040f3a..4b463a25b 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 @@ -1102,7 +1102,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl carsLoadScanEntityList = trunklineCarsLoadScanService.list(queryWrapper); if(CollUtil.isNotEmpty(carsLoadScanEntityList)){ @@ -8487,6 +8488,179 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("waybill_no", waybillNo) + .eq("load_id", loadId) + .eq("final_node_id", warehouseId) + .eq("order_code", orderCode); + TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.getOne(queryWrapper); + if (Objects.isNull(carsLoadScanEntity)) { + log.warn("#############unloadZero: 零担信息不存在 waybillNo={} order_code={} loadId={} finalNodeId={}", waybillNo, orderCode, loadId, warehouseId); + return R.fail(405, "零担信息不存在"); + } + + Integer isAbnormal = 0; + Integer num = carsLoadScanEntity.getNum(); + Long fromWarehouseId = carsLoadScanEntity.getFromWarehouseId(); + Long waybillId = carsLoadScanEntity.getWaybillId(); + String scanCode = carsLoadScanEntity.getScanCode(); + Long loadScanId = carsLoadScanEntity.getId(); + if (enterNun > num) { + log.warn("#############unloadZero: 零担信息卸车数量大于装车件数 enterNun={} num={}", enterNun, num); + return R.fail(405, "零担信息卸车数量大于装车件数"); + } + + carsLoadScanEntity.setUnloadNum(enterNun); + carsLoadScanEntity.setUnloadNodeId(warehouseId); + carsLoadScanEntity.setUnloadNodeName(warehouseName); + carsLoadScanEntity.setUnloadAbnormal(0); + carsLoadScanEntity.setScanStatus("2"); + carsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName()); + carsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName()); + carsLoadScanEntity.setUnloadTime(new Date()); + carsLoadScanEntity.setUnloadTrayName(unloadTrayName); + carsLoadScanEntity.setUnloadTrayCode(unloadTrayCode); + trunklineCarsLoadScanService.updateById(carsLoadScanEntity); + + trunklineCarsUnloadLogService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNo, orderCode, + scanCode, enterNun, 2, 1, isAbnormal, trayId, trayCode, trayName, fromWarehouseId, loadScanId, remark); + + if (unbindTray == 1) { + if (!StringUtil.isBlank(trayCode)) { + trayTypeClient.deleteZeroOrderByTrayCode(orderCode, trayCode, fromWarehouseId, "干线卸车零担解托"); + } + } + + DistributionStockArticleEntity newStockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); + if (Objects.isNull(newStockArticleEntity)) { + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, fromWarehouseId); + newStockArticleEntity = new DistributionStockArticleEntity(); + BeanUtil.copy(stockArticleEntity, newStockArticleEntity); + newStockArticleEntity.setId(null); + newStockArticleEntity.setOrderReceiveStatus("20"); + newStockArticleEntity.setOrderStatus("10"); + newStockArticleEntity.setHandQuantity(enterNun); + newStockArticleEntity.setIncomingNum(enterNun); + newStockArticleEntity.setWarehouse(basicdataWarehouseEntity.getName()); + newStockArticleEntity.setWarehouseId(basicdataWarehouseEntity.getId()); + newStockArticleEntity.setCarsLoadNum(0); + Long orderId = distributionStockArticleClient.addData(newStockArticleEntity); + if (orderId != 0) { + List parcelListEntityList = distributionParcelListClient.findEntityListByOrderCode(orderCode, fromWarehouseId); + List ls = new ArrayList<>(); + for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) { + DistributionParcelListEntity newParcelListEntity = new DistributionParcelListEntity(); + BeanUtil.copy(parcelListEntity, newParcelListEntity); + newParcelListEntity.setId(null); + newParcelListEntity.setWarehouseId(warehouseId); + newParcelListEntity.setWarehouse(warehouseName); + newParcelListEntity.setStockArticleId(orderId); + Long acceptWarehouseId = parcelListEntity.getAcceptWarehouseId(); + if(warehouseId.equals(acceptWarehouseId)){ + newParcelListEntity.setIsTransfer(0); + }else{ + newParcelListEntity.setIsTransfer(1); + } + Long orderPackageId = distributionParcelListClient.addReturnId(newParcelListEntity); + + DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity(); + parcelNumberEntity.setStockArticleId(orderId); + parcelNumberEntity.setParcelListId(orderPackageId); + parcelNumberEntity.setQuantity(newParcelListEntity.getQuantity()); + parcelNumberEntity.setHandQuantity(0); + parcelNumberEntity.setDeliveryQuantity(0); + parcelNumberEntity.setSigninQuantity(0); + parcelNumberEntity.setOutboundQuantity(0); + parcelNumberEntity.setWarehouseId(warehouseId); + ls.add(parcelNumberEntity); + } + distributionParcelNumberClient.addBatch(ls); + } + } else { + Integer handQuantity = newStockArticleEntity.getHandQuantity() + enterNun; + Integer incomingNum = newStockArticleEntity.getIncomingNum() + enterNun; + Integer totalNumber = newStockArticleEntity.getTotalNumber(); + + if (incomingNum.equals(totalNumber)) { + if (handQuantity.equals(totalNumber)) { + newStockArticleEntity.setOrderStatus("20"); + } else { + newStockArticleEntity.setOrderStatus("30"); + } + newStockArticleEntity.setOrderReceiveStatus("30"); + } else { + if (incomingNum.equals(handQuantity)) { + newStockArticleEntity.setOrderStatus("10"); + } else { + newStockArticleEntity.setOrderStatus("30"); + } + newStockArticleEntity.setOrderReceiveStatus("20"); + } + newStockArticleEntity.setHandQuantity(handQuantity); + newStockArticleEntity.setIncomingNum(incomingNum); + + distributionStockArticleClient.saveOrUpdate(newStockArticleEntity); + } + + updateNumByLoadId(loadId); + +// JSONObject jsonObject = trunklineCarsLoadScanService.findUnloadNumAudio(loadId,warehouseId); +// Integer totalUnloadNum = jsonObject.getInteger("totalUnloadNum"); +// Integer abnormalUnloadNum = jsonObject.getInteger("abnormalUnloadNum"); +// StringBuilder audio = new StringBuilder(); +// audio.append("卸车").append(totalUnloadNum).append("件"); +// if(!Objects.isNull(abnormalUnloadNum) && !abnormalUnloadNum.equals(0)){ +// audio.append("异常卸车").append(abnormalUnloadNum).append("件"); +// } + return Resp.scanSuccess("卸车成功", audio.toString()); + } + + public R unloadZeroNoXz(Long loadId, String waybillNo, Integer enterNun, Long warehouseId, Integer unbindTray, String trayCode, String orderCode, String remark) { log.info("#############unloadZero: 卸车零担"); @@ -8761,7 +8935,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl Date: Tue, 13 Aug 2024 17:18:12 +0800 Subject: [PATCH 3/3] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BFbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trunkline/service/impl/TrunklineCarsLoadServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4b463a25b..b67e3494b 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 @@ -8657,7 +8657,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl