From 9a0604dd994138db85f05ae645119f96d9f6ba34 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Tue, 4 Jun 2024 09:12:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?1.=E4=B8=8A=E6=9E=B6=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 22f596e547153474e91f03b3cfd991c10809ca62) --- .../warehouse/service/impl/WarehouseTrayTypeServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 908314712..e19676aa6 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 @@ -2412,7 +2412,10 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl { From 744bef8fc658a221f1cf16d24a665ec731f51535 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Tue, 4 Jun 2024 09:25:12 +0800 Subject: [PATCH 2/3] =?UTF-8?q?1.=E8=87=AA=E6=8F=90=E7=AD=BE=E6=94=B6?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 060a827606a88e6fa26e001316ce8aa9e234d124) --- .../DistrilbutionBillLadingServiceImpl.java | 148 +++++++++--------- 1 file changed, 77 insertions(+), 71 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java index d98790833..34c888edd 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java @@ -3305,84 +3305,90 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelListIds = new HashSet<>(); - for (int i = 0; i < split.length; i++) { - String s = split[i]; - //查询是不是上传图片 - List list1 = distributionPrintService.list(Wrappers.query().lambda() - .eq(DistributionPrintEntity::getBillLadingId, s) - ); - if (list1.isEmpty()) { - throw new ServiceException("请上传签收图片!!"); - } - int count = (int) list1.stream().filter(ii -> "1".equals(ii.getGenre().toString())).count(); - int count1 = (int) list1.stream().filter(ii -> "2".equals(ii.getGenre().toString())).count(); - int count2 = (int) list1.stream().filter(ii -> "3".equals(ii.getGenre().toString())).count(); - if (count1 < 1 || count < 1 || count2 < 1) { - throw new ServiceException("请上传完整签收图片!!"); - } - //修改提货状态 - DistrilbutionBillLadingEntity billLadingEntity = new DistrilbutionBillLadingEntity(); - billLadingEntity.setConditions(BillLadingStatusConstant.yiqianshou.getValue()); - billLadingEntity.setId(Long.parseLong(s)); - this.updateById(billLadingEntity); - //完成备货状态 - distributionStockupInfoService.maintenanceStockUp(Long.parseLong(s), 2); - //查询自提单是否完成扫描 - Integer integer = this.selectBillLadingPlanNum(Long.parseLong(s)); - List ladingScanEntities = distributionBillLadingScanService.list(Wrappers.query().lambda() - .eq(DistributionBillLadingScanEntity::getBillLadingId, Long.parseLong(s)) - .eq(DistributionBillLadingScanEntity::getMaterialType, "2") - ); - if (Func.isNotEmpty(ladingScanEntities)) { - int sum = ladingScanEntities.stream().mapToInt(DistributionBillLadingScanEntity::getQuantity).sum(); - if (integer != sum) { - //存在资源释放操作 - distributionAsyncService.releaseBillLadingResource(Long.parseLong(s), myCurrentWarehouse.getId()); + try{ + for (int i = 0; i < split.length; i++) { + String s = split[i]; + //查询是不是上传图片 + List list1 = distributionPrintService.list(Wrappers.query().lambda() + .eq(DistributionPrintEntity::getBillLadingId, s) + ); + if (list1.isEmpty()) { + throw new ServiceException("请上传签收图片!!"); } - parcelListIds.addAll(ladingScanEntities.stream().map(DistributionBillLadingScanEntity::getParcelListId).collect(Collectors.toSet())); - for (DistributionBillLadingScanEntity ladingScanEntity : ladingScanEntities) { - // 签收发送消息到工厂 - pushFactoryOrderData(myCurrentWarehouse.getId(), ladingScanEntity.getParcelListId().toString(), ladingScanEntity.getOrderSelfNumbering()); + int count = (int) list1.stream().filter(ii -> "1".equals(ii.getGenre().toString())).count(); + int count1 = (int) list1.stream().filter(ii -> "2".equals(ii.getGenre().toString())).count(); + int count2 = (int) list1.stream().filter(ii -> "3".equals(ii.getGenre().toString())).count(); + if (count1 < 1 || count < 1 || count2 < 1) { + throw new ServiceException("请上传完整签收图片!!"); + } + //修改提货状态 + DistrilbutionBillLadingEntity billLadingEntity = new DistrilbutionBillLadingEntity(); + billLadingEntity.setConditions(BillLadingStatusConstant.yiqianshou.getValue()); + billLadingEntity.setId(Long.parseLong(s)); + this.updateById(billLadingEntity); + //完成备货状态 + distributionStockupInfoService.maintenanceStockUp(Long.parseLong(s), 2); + //查询自提单是否完成扫描 + Integer integer = this.selectBillLadingPlanNum(Long.parseLong(s)); + List ladingScanEntities = distributionBillLadingScanService.list(Wrappers.query().lambda() + .eq(DistributionBillLadingScanEntity::getBillLadingId, Long.parseLong(s)) + .eq(DistributionBillLadingScanEntity::getMaterialType, "2") + ); + if (Func.isNotEmpty(ladingScanEntities)) { + int sum = ladingScanEntities.stream().mapToInt(DistributionBillLadingScanEntity::getQuantity).sum(); + if (integer != sum) { + //存在资源释放操作 + distributionAsyncService.releaseBillLadingResource(Long.parseLong(s), myCurrentWarehouse.getId()); + } + parcelListIds.addAll(ladingScanEntities.stream().map(DistributionBillLadingScanEntity::getParcelListId).collect(Collectors.toSet())); + for (DistributionBillLadingScanEntity ladingScanEntity : ladingScanEntities) { + // 签收发送消息到工厂 + pushFactoryOrderData(myCurrentWarehouse.getId(), ladingScanEntity.getParcelListId().toString(), ladingScanEntity.getOrderSelfNumbering()); + } + } else { + distributionAsyncService.releaseBillLadingResource(Long.parseLong(s), myCurrentWarehouse.getId()); } - } else { - distributionAsyncService.releaseBillLadingResource(Long.parseLong(s), myCurrentWarehouse.getId()); - } - //修改订单状态 - List list = distrilbutionBillStockService.list(Wrappers.query().lambda() - .eq(DistrilbutionBillStockEntity::getBillLadingId, s) - .apply("order_status in ( '1' , '3')") + //修改订单状态 + List list = distrilbutionBillStockService.list(Wrappers.query().lambda() + .eq(DistrilbutionBillStockEntity::getBillLadingId, s) + .apply("order_status in ( '1' , '3')") // .or(ew -> ew.eq(DistrilbutionBillStockEntity::getBillLadingId, s).apply(DistrilbutionBillStockEntity::getOrderStatus, "2")) - ); - if (!list.isEmpty()) { - list.forEach(li -> { - DistributionStockArticleEntity stockArticleEntity = new DistributionStockArticleEntity(); - stockArticleEntity.setId(li.getStockArticleId()); + ); + if (!list.isEmpty()) { + list.forEach(li -> { + DistributionStockArticleEntity stockArticleEntity = new DistributionStockArticleEntity(); + stockArticleEntity.setId(li.getStockArticleId()); - List list2 = distributionParcelListService.list(Wrappers.query().lambda() - .eq(DistributionParcelListEntity::getStockArticleId, li.getStockArticleId()) - .apply("order_package_status != 70 ") - ); - if (list2.isEmpty()) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue()); - } else { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); - } - //回退包件数据 - Integer i1 = updatePack(li.getStockArticleId(), Long.valueOf(s)); - if (i1 > 0) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); - } - distributionStockArticleService.updateById(stockArticleEntity); - }); - } - //处理库存品签收数据 - updateStock(s); + List list2 = distributionParcelListService.list(Wrappers.query().lambda() + .eq(DistributionParcelListEntity::getStockArticleId, li.getStockArticleId()) + .apply("order_package_status != 70 ") + ); + if (list2.isEmpty()) { + stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue()); + } else { + stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); + } + //回退包件数据 + Integer i1 = updatePack(li.getStockArticleId(), Long.valueOf(s)); + if (i1 > 0) { + stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); + } + distributionStockArticleService.updateById(stockArticleEntity); + }); + } + //处理库存品签收数据 + updateStock(s); - // 回传老系统自提数据 - sendOldSystem(Long.parseLong(s)); + // 回传老系统自提数据 + sendOldSystem(Long.parseLong(s)); + } + }catch (Exception e){ + log.error(">>>>>",e); + return false; } + // 回传工厂数据 sendFactory(myCurrentWarehouse, parcelListIds); @@ -3467,7 +3473,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl Date: Tue, 4 Jun 2024 09:53:53 +0800 Subject: [PATCH 3/3] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E8=87=AA=E6=8F=90?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistrilbutionBillLadingServiceImpl.java | 41 +++++++------------ 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java index d98790833..a78348955 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java @@ -3512,7 +3512,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl scanEntityList = new ArrayList<>(); AtomicReference num = new AtomicReference<>(0); if (ObjectUtils.isNotNull(list) && !list.isEmpty()) { //签收记录 @@ -3523,41 +3522,29 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl iterator = list.iterator(); while (iterator.hasNext()) { DistrilbutionBillPackageEntity next = iterator.next(); - boolean b = list1.stream().anyMatch(q -> q.getParcelListId().equals(next.getParceListId())); - if (b) { - //删除包件 - iterator.remove(); + if(ObjectUtils.isNotNull(next.getParceListId())){ + boolean b = list1.stream().anyMatch(q -> { + + if(ObjectUtils.isNotNull(q.getParcelListId())){ + return q.getParcelListId().equals(next.getParceListId()); + } + return false; + }); + if (b) { + //删除包件 + iterator.remove(); + } } - } - //添加包件签收记录 -// list.stream().forEach(i ->{ -// distributionParcelListService.lambdaUpdate() -// .set(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue()) -// .eq(DistributionParcelListEntity::getId, i); -// DistributionBillLadingScanEntity billLadingScan = new DistributionBillLadingScanEntity(); -// billLadingScan.setMaterialType("2"); -// billLadingScan.setScanType(2); -// billLadingScan.setParcelListId(i.getParceListId()); -// billLadingScan.setStockArticleId(i.getStockArticleId()); -// billLadingScan.setBillLadingId(billId); -// billLadingScan.setPacketBarCode( i.getPacketBarCode()); -// billLadingScan.setQuantity(i.getPacketNumber()); -// scanEntityList.add(billLadingScan); -// }); + } //回退包件信息 - list.stream().forEach(i -> { + list.forEach(i -> { DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); parcelListEntity.setId(i.getParceListId()); parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue()); distributionParcelListService.updateById(parcelListEntity); num.getAndSet(num.get() + 1); }); - - -// if(!scanEntityList.isEmpty()){ -// distributionBillLadingScanService.saveBatch(scanEntityList); -// } } return num.get(); }