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) {