From a850d8ba8f3ea4c16b09b8362e972a0e1f933d99 Mon Sep 17 00:00:00 2001
From: PigBaoBei <2739175034@qq.com>
Date: Tue, 18 Jun 2024 17:31:16 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=88=A4=E5=AE=9A=E4=BF=AE?=
=?UTF-8?q?=E5=A4=8D=E3=80=81=E6=97=A5=E5=BF=97=E6=8E=92=E5=BA=8F=E4=BF=AE?=
=?UTF-8?q?=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mapper/BasicdataClientMapper.xml | 2 +-
.../impl/BasicdataClientServiceImpl.java | 8 ++-
.../mapper/DistributionParcelListMapper.xml | 4 +-
.../DistributionDeliveryListServiceImpl.java | 72 ++++++++++---------
4 files changed, 46 insertions(+), 40 deletions(-)
diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml
index 86e3db6e9..32955d339 100644
--- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml
+++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml
@@ -169,7 +169,7 @@
DESC
diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
index f598016cf..675564f65 100644
--- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
+++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
@@ -196,10 +196,12 @@ public class BasicdataClientServiceImpl extends BaseServiceImplquery().lambda().eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()).eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId()));
List reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
- boolean shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shipie.getValue()));
- if (Func.isEmpty(parcelListEntity)) {
- return Resp.scanFail("无包件信息", "无包件信息");
- }
- DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId());
- if (shangpeiFlag) {
- List reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList());
- //查看是否存在满足条件的预约单
- //存在多个,操作人指定具体客户即可
- if (!reservationEntities.isEmpty()) {
- if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())) {
- log.info("异常装车未指定客户");
- return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车");
- }
- return R.fail(5000, "异常装车");
-// return Resp.scanFail("装车失败","程序出错,请联系彪桑");
- } else {
- if (parcelListEntity.getConditions() == 2) {
- return Resp.scanFail("此包件不是订制品", "此包件不是订制品");
-
- } else {
- return Resp.scanFail("窜货", "窜货");
- }
+ if (!reservationEntityList.isEmpty()){
+ boolean shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shipie.getValue()));
+ if (Func.isEmpty(parcelListEntity)) {
+ return Resp.scanFail("无包件信息", "无包件信息");
}
- } else {
-
- shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shangpei.getValue()));
+ DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId());
if (shangpeiFlag) {
- List reservationEntities = reservationEntityList.stream().filter(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList());
- //查询是否满足商配异常装车
+ List reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList());
+ //查看是否存在满足条件的预约单
boolean flag = reservationEntities.stream().anyMatch(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName()));
- if (flag){
- return R.fail(5000, "异常装车");
- }else {
- if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())){
+ //存在多个,操作人指定具体客户即可
+ if (!reservationEntities.isEmpty() && flag) {
+ if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())) {
+ log.info("异常装车未指定客户");
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车");
- }else {
+ }
+ return R.fail(5000, "异常装车");
+// return Resp.scanFail("装车失败","程序出错,请联系彪桑");
+ } else {
+ if (parcelListEntity.getConditions() == 2) {
+ return Resp.scanFail("此包件不是订制品", "此包件不是订制品");
+
+ } else {
return Resp.scanFail("窜货", "窜货");
}
}
} else {
- log.error("配送计划预约类型错误:{}", reservationEntityList);
+ shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shangpei.getValue()));
+ if (shangpeiFlag) {
+ List reservationEntities = reservationEntityList.stream().filter(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList());
+ //查询是否满足商配异常装车
+ boolean flag = reservationEntities.stream().anyMatch(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName()));
+ if (flag){
+ return R.fail(5000, "异常装车");
+
+ }else {
+ if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())){
+ return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车");
+ }else {
+ return Resp.scanFail("窜货", "窜货");
+ }
+ }
+ } else {
+ log.error("配送计划预约类型错误:{}", reservationEntityList);
+ }
}
}
+
log.info("异常装车判定成功>>>>>>packageCode:{},reservationId:{}", distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getReservationId());
}
} else if (distrilbutionloadingscanDTO.getType() == 2) {