|
|
|
@ -3294,15 +3294,56 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} else { |
|
|
|
|
b = distributionDeliveryTripartiteService.update(new UpdateWrapper<DistributionDeliveryTripartiteEntity>().lambda() |
|
|
|
|
.eq(DistributionDeliveryTripartiteEntity::getId, loadingId) |
|
|
|
|
.set(DistributionDeliveryTripartiteEntity::getDepartureTime, format) |
|
|
|
|
.set(DistributionDeliveryTripartiteEntity::getDepartureTime,format) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//修改主表状态
|
|
|
|
|
distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue()); |
|
|
|
|
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 提示装车件数
|
|
|
|
|
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 |
|
|
|
|