From 3e252b73b9cda2b8f1046ae757e2717bdf260306 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Tue, 14 May 2024 11:27:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E6=8F=90=E6=8E=A8=E9=80=81=E8=80=81?= =?UTF-8?q?=E7=B3=BB=E7=BB=9FBUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/DistrilbutionBillLadingMapper.xml | 2 +- .../DistributionDeliveryListServiceImpl.java | 29 ++++++------ .../impl/DistributionSignforServiceImpl.java | 46 ++++++++----------- 3 files changed, 36 insertions(+), 41 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml index 8d5ec4e8d..54299a035 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml @@ -832,7 +832,7 @@ IFNULL(SUM(ldbls.quantity),0) AS actual_plan, IFNULL(SUM(ldbls.quantity),0) AS delivery, IFNULL(SUM(ldbls.quantity),0) AS sign, - (SELECT GROUP_CONCAT(site) FROM logpm_distribution_print WHERE bill_lading_id = ldbl.id GROUP BY bill_lading_id) + (SELECT GROUP_CONCAT(site) FROM logpm_distribution_print WHERE bill_lading_id = ldbl.id GROUP BY bill_lading_id) AS image FROM logpm_distrilbution_bill_lading AS ldbl LEFT JOIN logpm_distribution_bill_lading_scan AS ldbls ON ldbls.bill_lading_id = ldbl.id AND ldbls.is_deleted = 0 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 9c704d1c3..a0c329244 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 @@ -595,20 +595,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl abnormalEntities = distributionLoadscanAbnormalService.list(Wrappers.query().lambda() - .eq(DistributionLoadscanAbnormalEntity::getPackageCode, distrilbutionloadingscanDTO.getBarcode()) - ); - if (!abnormalEntities.isEmpty()) { - //判断异常是否属于自身 - boolean flag = abnormalEntities.stream().allMatch(a -> !distributionDeliveryListEntity.getId().equals(a.getDeliveryListId()) || !distrilbutionloadingscanDTO.getReservationId().equals(a.getReservationId())); - if (flag){ - //该异常属于其他车次 - String collect = abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getTrainNumber).collect(Collectors.joining(",")); - log.info("包件已在其他车次存在异常 >>>>当前车次:{},其他车次:{}",distributionDeliveryListEntity.getTrainNumber(),collect); - return Resp.scanFail("包件已在其他车次存在异常", "包件已在其他车次存在异常"); - } - } //异步确认包条扫描信息 // distributionAsyncService.changeOrderSignforStatus(distrilbutionloadingscanDTO.getBarcode()); List packageLockIds = new ArrayList<>(); @@ -657,6 +644,22 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl abnormalEntities = distributionLoadscanAbnormalService.list(Wrappers.query().lambda() + .eq(DistributionLoadscanAbnormalEntity::getPackageCode, distrilbutionloadingscanDTO.getBarcode()) + .eq(DistributionLoadscanAbnormalEntity::getPackageId, parcelList.getId()) + ); + + if (!abnormalEntities.isEmpty()) { + //判断异常是否属于自身 + boolean flag = abnormalEntities.stream().allMatch(a -> !distributionDeliveryListEntity.getId().equals(a.getDeliveryListId()) || !distrilbutionloadingscanDTO.getReservationId().equals(a.getReservationId())); + if (flag){ + //该异常属于其他车次 + String collect = abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getTrainNumber).collect(Collectors.joining(",")); + log.info("包件已在其他车次存在异常 >>>>当前车次:{},其他车次:{}",distributionDeliveryListEntity.getTrainNumber(),collect); + return Resp.scanFail("包件已在其他车次存在异常", "包件已在其他车次存在异常"); + } + } + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index ce8506380..bdd45f70d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -2424,34 +2424,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl abnormalEntities = distributionLoadscanAbnormalService.list(Wrappers.query().lambda() - .eq(DistributionLoadscanAbnormalEntity::getPackageCode, distrilbutionloadingscanDTO.getBarcode()) -// .eq(DistributionLoadscanAbnormalEntity::getAuditingStatus, 1) - //修改 状态 - ); - if (!abnormalEntities.isEmpty()) { - //判断此包件的异常是否是当前扫描车次和客户 - //首先判断存在异常是否不属于当前车次和客户 - boolean flag = abnormalEntities.stream().allMatch(a -> !deliveryListEntity.getId().equals(a.getDeliveryListId()) || !distrilbutionloadingscanDTO.getReservationId().equals(a.getReservationId())); - if (flag){ - //该异常属于其他车次 - String collect = abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getTrainNumber).collect(Collectors.joining(",")); - log.info("包件已在其他车次存在异常 >>>>当前车次:{},其他车次:{}",deliveryListEntity.getTrainNumber(),collect); - return Resp.scanFail("包件已在其他车次存在异常", "包件已在其他车次存在异常"); - } - //判断具体的装车信息 - - -// boolean flag = abnormalEntities.stream().filter(f->f.getAuditingStatus() == 1).allMatch(a -> deliveryListEntity.getId().equals(a.getDeliveryListId()) && distrilbutionloadingscanDTO.getReservationId().equals(a.getReservationId())); -// if (flag){ -// //存在异常 进行异常签收还是异常装车区分 -// return Resp.scanFail("包件已存在异常", "包件已存在异常"); -// } -// String collect = abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getTrainNumber).collect(Collectors.joining(",")); -// log.info("包件已在其他车次存在异常 >>>>当前车次:{},其他车次:{}",deliveryListEntity.getTrainNumber(),collect); -// return Resp.scanFail("包件已在其他车次存在异常", "包件已在其他车次存在异常"); - } if (Func.isNotEmpty(list)) { //满足条件此码必定为库存品 //判断该库存品是否属于当前客户 @@ -2466,6 +2439,25 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl collect = parcelListEntityList.stream().filter(p -> p.getOrderPackageCode().equals(distrilbutionloadingscanDTO.getBarcode())).collect(Collectors.toList()); if (Func.isNotEmpty(collect) && collect.size() == 1) { + List abnormalEntities = distributionLoadscanAbnormalService.list(Wrappers.query().lambda() + .eq(DistributionLoadscanAbnormalEntity::getPackageCode, distrilbutionloadingscanDTO.getBarcode()) + .eq(DistributionLoadscanAbnormalEntity::getPackageId, collect.get(0).getId()) + //修改 状态 + ); + if (!abnormalEntities.isEmpty()) { + //判断此包件的异常是否是当前扫描车次和客户 + //首先判断存在异常是否不属于当前车次和客户 + boolean flag = abnormalEntities.stream().allMatch(a -> !deliveryListEntity.getId().equals(a.getDeliveryListId()) || !distrilbutionloadingscanDTO.getReservationId().equals(a.getReservationId())); + if (flag){ + //该异常属于其他车次 + String info = abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getTrainNumber).collect(Collectors.joining(",")); + log.info("包件已在其他车次存在异常 >>>>当前车次:{},其他车次:{}",deliveryListEntity.getTrainNumber(),info); + return Resp.scanFail("包件已在其他车次存在异常", "包件已在其他车次存在异常"); + } + //判断具体的装车信息 + } + + //存在则查询该包件是否进行装车 DistributionLoadscanEntity loadscanEntity = distributionLoadscanMapper.selectOne(Wrappers.query().lambda() .ne(DistributionLoadscanEntity::getScanStatus, 1)