Browse Source

发车播报件数

training
kilo 1 year ago
parent
commit
48931d002c
  1. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java
  2. 45
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

20
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java

@ -178,8 +178,9 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
DistributionAppStockArticleVO distributionAppStockArticleVO = new DistributionAppStockArticleVO(); DistributionAppStockArticleVO distributionAppStockArticleVO = new DistributionAppStockArticleVO();
distributionAppStockArticleVO.setOrderCode(ord.getOrderCode()); distributionAppStockArticleVO.setOrderCode(ord.getOrderCode());
distributionAppStockArticleVO.setReservationNum(ord.getReservationNum()); distributionAppStockArticleVO.setReservationNum(ord.getReservationNum());
distributionAppStockArticleVO.setIsZero(ord.getIsZero());
Map<Long, DistributionLoadscanEntity> loadingPackage = new HashMap<>(); Map<Long, DistributionLoadscanEntity> loadingPackage = new HashMap<>();
if (ord.getIsHaveData().equals(ServiceConstant.ORDER_HAVE_DATA)){ if (ord.getIsZero().equals("0")){
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, ord.getId()); List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, ord.getId());
if (Func.isNotEmpty(orderInfo.get(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)); 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<Distrib
ks.add(appParcelListVO); ks.add(appParcelListVO);
}); });
distributionAppStockArticleVO.setIsHaveAbnormalPackage(1); distributionAppStockArticleVO.setIsHaveAbnormalPackage(1);
distributionAppStockArticleVO.setIsHaveAbnormalPackageName("异常"); distributionAppStockArticleVO.setIsHaveAbnormalPackageName("部分异常");
} }
distributionAppStockArticleVO.setDistributionAppParcelListVOS(ks); distributionAppStockArticleVO.setDistributionAppParcelListVOS(ks);
distributionAppStockArticleVO.setLoadingNub(loadingNum.get()); distributionAppStockArticleVO.setLoadingNub(loadingNum.get());
@ -256,27 +257,18 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
parcelListVO.setIsScan("异常"); parcelListVO.setIsScan("异常");
loadingNum.getAndAdd(parcelListEntity.getQuantity()); loadingNum.getAndAdd(parcelListEntity.getQuantity());
distributionAppParcelListVOS.add(parcelListVO); distributionAppParcelListVOS.add(parcelListVO);
} }
appStockArticleVO.setIsZero(stockArticleEntity.getIsZero());
appStockArticleVO.setLoadingNub(loadingNum.get()); appStockArticleVO.setLoadingNub(loadingNum.get());
appStockArticleVO.setIsHaveAbnormalPackage(2);
appStockArticleVO.setIsHaveAbnormalPackageName("整单异常");
appStockArticleVO.setDistributionAppParcelListVOS(distributionAppParcelListVOS); appStockArticleVO.setDistributionAppParcelListVOS(distributionAppParcelListVOS);
appStockArticleVO.setReservationNum(0); appStockArticleVO.setReservationNum(0);
distributionAppStockArticleVOS.add(appStockArticleVO); distributionAppStockArticleVOS.add(appStockArticleVO);
}); });
} }
// packageListByReservationId.stream().collect(Collectors.groupingBy()) // packageListByReservationId.stream().collect(Collectors.groupingBy())
// List<DistributionAppStockArticleVO> distributionAppStockArticleVOS = new ArrayList<>(); // List<DistributionAppStockArticleVO> distributionAppStockArticleVOS = new ArrayList<>();
// //
// distributionAppStockArticleVOS = baseMapper.selectDistributionAppDeliveryOrderPage(page, distributionAppDeliveryListDTO); // distributionAppStockArticleVOS = baseMapper.selectDistributionAppDeliveryOrderPage(page, distributionAppDeliveryListDTO);

45
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -3294,15 +3294,56 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
} else { } else {
b = distributionDeliveryTripartiteService.update(new UpdateWrapper<DistributionDeliveryTripartiteEntity>().lambda() b = distributionDeliveryTripartiteService.update(new UpdateWrapper<DistributionDeliveryTripartiteEntity>().lambda()
.eq(DistributionDeliveryTripartiteEntity::getId, loadingId) .eq(DistributionDeliveryTripartiteEntity::getId, loadingId)
.set(DistributionDeliveryTripartiteEntity::getDepartureTime, format) .set(DistributionDeliveryTripartiteEntity::getDepartureTime,format)
); );
} }
//修改主表状态 //修改主表状态
distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue()); distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue());
baseMapper.updateById(distributionDeliveryListEntity); baseMapper.updateById(distributionDeliveryListEntity);
//查询配送计划的所有预约总数
List<DistributionReservationEntity> 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 提示装车件数 //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 @Override

Loading…
Cancel
Save