diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java index 52bb87e2a..bbc637787 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java @@ -178,8 +178,9 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl loadingPackage = new HashMap<>(); - if (ord.getIsHaveData().equals(ServiceConstant.ORDER_HAVE_DATA)){ + if (ord.getIsZero().equals("0")){ List parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, ord.getId()); if (Func.isNotEmpty(orderInfo.get(ord.getId()))){ loadingPackage = orderInfo.get(ord.getId()).stream().collect(Collectors.toMap(DistributionLoadscanEntity::getPackageId, Function.identity(), (k1, k2) -> k2)); @@ -218,7 +219,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl distributionAppStockArticleVOS = new ArrayList<>(); // // distributionAppStockArticleVOS = baseMapper.selectDistributionAppDeliveryOrderPage(page, distributionAppDeliveryListDTO); 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 a166be078..628d91edf 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 @@ -3294,15 +3294,56 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl().lambda() .eq(DistributionDeliveryTripartiteEntity::getId, loadingId) - .set(DistributionDeliveryTripartiteEntity::getDepartureTime, format) + .set(DistributionDeliveryTripartiteEntity::getDepartureTime,format) ); } //修改主表状态 distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue()); baseMapper.updateById(distributionDeliveryListEntity); + //查询配送计划的所有预约总数 + List reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId()); +// reservationEntityList.stream().collect(Collectors.reducing(0,DistributionReservationEntity::getReservationNum,Integer::sum)); + StringBuilder builder = new StringBuilder(); + AtomicInteger planCount= new AtomicInteger(); + reservationEntityList.forEach(r->{ + planCount.getAndAdd(r.getReservationNum()+r.getReservationStockListNum()); + }); + if (planCount.get()!=0){ + builder.append("计划"+planCount.get()+"件"); + } //TODO 提示装车件数 - return R.status(b); + Integer loadingCount = new Integer(0); + //查询配送任务的计划订单装车数 + Integer packageLoadingNum = distributionLoadscanMapper.statisticsLoadingNum(distrilbutionloadingscanDTO.getDeliveryId()); + if (packageLoadingNum!=0){ + builder.append("装车"+packageLoadingNum+"件"); + } + Integer inventoryLoadingNum = 0 ; + if (distributionDeliveryListEntity.getType().equals(DistributionTypeConstant.shipie.getValue())){ + inventoryLoadingNum = distributionLoadscaninvnMapper.statisticsLoadingNum(distrilbutionloadingscanDTO.getDeliveryId()); + if (inventoryLoadingNum!= 0 ){ + loadingCount += inventoryLoadingNum; + } + } + if (planCount.get() - loadingCount > 0){ + builder.append("未装"+(planCount.get() - packageLoadingNum - inventoryLoadingNum)+"件"); + } + loadingCount += packageLoadingNum; + //统计该配送任务的库存品装车数 + Integer abnormalPackageLoadingNum = distributionLoadscanMapper.statisticsAbnormalLoadingNum(distrilbutionloadingscanDTO.getDeliveryId()); + if (abnormalPackageLoadingNum != 0 ){ + loadingCount += abnormalPackageLoadingNum; + builder.append("异常"+abnormalPackageLoadingNum+"件"); + } + +// builder.append("共计装车"+loadingCount+"件"); + +// if (planCount.get() == loadingCount && abnormalPackageLoadingNum == 0){ +// return R.status(b); +// }else if (abnormalPackageLoadingNum != 0){ +// } + return Resp.scanFail("发车成功",builder.toString()); } @Override