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 5f0698bfc..b6fb302fe 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 @@ -1327,11 +1327,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl orderList, Long id) { + //收集需要进行订单维护的数据 //查询已有的数据 List list = distrilbutionBillStockService.list(Wrappers.query().lambda() .eq(DistrilbutionBillStockEntity::getBillLadingId, id) - .apply("order_status in ( 1,2)") - .or(wp -> wp.eq(DistrilbutionBillStockEntity::getBillLadingId, id).apply("order_status in ( 1,2)")) + .apply("order_status in ( 1,3)") + .or(wp -> wp.eq(DistrilbutionBillStockEntity::getBillLadingId, id).apply("order_status in ( 1,3)")) ); List deList = new ArrayList<>(); list.forEach(i -> { @@ -1356,7 +1357,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl sStock = new ArrayList<>(); //取消 - + List cancelOrderIds = new ArrayList<>(); //删除提货订单状态 deList.forEach(i -> { //查询数据是否已备货 @@ -1370,6 +1371,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl distributionStockArticleEntities = distributionStockArticleService.listByIds(cancelOrderIds); + if (Func.isEmpty(distributionStockArticleEntities)){ + log.info("#####################查询订单失败,orderIds:{}",cancelOrderIds); + } + String orderCodes = distributionStockArticleEntities.stream().map(DistributionStockArticleEntity::getOrderCode).collect(Collectors.joining(",")); + List collect = distributionStockArticleEntities.stream().map(DistributionStockArticleEntity::getWarehouseId).distinct().collect(Collectors.toList()); + if (collect.isEmpty()){ + log.info("#####################订单列表warehouseId字段缺失,orderIds:{}",cancelOrderIds); + return false; + } + if (collect.size()>1){ + log.info("#####################自提操作多个仓库订单,orderIds:{}",cancelOrderIds); + return false; + } + distributionStockArticleService.maintenanceOrderInfo(orderCodes,collect.get(0)); + } return true; }