|
|
|
@ -3211,7 +3211,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(s.getOrderCode(), myCurrentWarehouse.getId()); |
|
|
|
|
} else { |
|
|
|
|
//该客户下增加零担订单
|
|
|
|
|
List<DistributionParcelNumberVO> parcelNumberVOS = s.getParcelNumberVOS(); |
|
|
|
@ -3263,6 +3262,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(s.getOrderCode(), myCurrentWarehouse.getId()); |
|
|
|
|
reservationStockarticleEntity.setReservationId(reservationEntity.getId()); |
|
|
|
|
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.zengjia.getValue()); |
|
|
|
|
reservationStockarticleEntity.setIsHaveData(s.getIsHaveData()); |
|
|
|
@ -3394,6 +3394,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
BigDecimal yuanlaiNum = new BigDecimal(distributionReservationZeroPackageEntity.getQuantity().toString()); |
|
|
|
|
BigDecimal xiugaiNum = new BigDecimal(pn.getReservationNum().toString()); |
|
|
|
|
BigDecimal num = dongjieNum.add(xiugaiNum).subtract(yuanlaiNum); |
|
|
|
|
if (Objects.equals(num.intValue(),yuanlaiNum.intValue()) ){ |
|
|
|
|
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update().lambda() |
|
|
|
|
.eq(DistributionParcelListEntity::getId,parcelNumberEntity.getParcelListId()) |
|
|
|
|
.set(DistributionParcelListEntity::getOrderPackageReservationStatus,OrderPackageReservationStatusConstant.yiyueyue.getValue()) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
parcelNumberEntity.setDeliveryQuantity(num.intValue()); |
|
|
|
|
distributionReservationZeroPackageEntity.setQuantity(pn.getReservationNum()); |
|
|
|
|
distributionParcelNumberService.updateById(parcelNumberEntity); |
|
|
|
@ -3414,6 +3420,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
reservationZeroPackageEntity.setCategoryName(pn.getFirsts()); |
|
|
|
|
reservationZeroPackageEntity.setRealityQuantity(0); |
|
|
|
|
distributionReservationZeroPackageService.save(reservationZeroPackageEntity); |
|
|
|
|
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update().lambda() |
|
|
|
|
.eq(DistributionParcelListEntity::getId,parcelNumberEntity.getParcelListId()) |
|
|
|
|
.set(DistributionParcelListEntity::getOrderPackageReservationStatus,OrderPackageReservationStatusConstant.yiyueyue.getValue()) |
|
|
|
|
); |
|
|
|
|
parcelNumberEntity.setDeliveryQuantity(parcelNumberEntity.getDeliveryQuantity() + pn.getReservationNum()); |
|
|
|
|
distributionParcelNumberService.updateById(parcelNumberEntity); |
|
|
|
|
packageNum.getAndAdd(reservationZeroPackageEntity.getQuantity()); |
|
|
|
@ -3442,12 +3452,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//进行预约订单中间信息的修改
|
|
|
|
|
reservationStockarticleEntity.setReservationNum(packageNum.get()); |
|
|
|
|
distributionReservationStockarticleService.updateById(reservationStockarticleEntity); |
|
|
|
|
//预约订单上的包件数量维护
|
|
|
|
|
packageTotal.getAndAdd(reservationStockarticleEntity.getReservationNum()); |
|
|
|
|
//维护订单
|
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(s.getOrderCode(), myCurrentWarehouse.getId()); |
|
|
|
|
} |
|
|
|
|
if (!packageLockIds.isEmpty()) { |
|
|
|
|
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode()); |
|
|
|
@ -3490,17 +3501,25 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
//对零担订单进行移除
|
|
|
|
|
//零担
|
|
|
|
|
List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda().eq(DistributionReservationZeroPackageEntity::getReservationId, reservationEntity.getId()).eq(DistributionReservationZeroPackageEntity::getStockArticleId, reservationStockarticleEntity.getStockArticleId()).ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())); |
|
|
|
|
reservationZeroPackageEntityList.forEach(rzp -> { |
|
|
|
|
for (DistributionReservationZeroPackageEntity rzp : reservationZeroPackageEntityList) { |
|
|
|
|
rzp.setZeroPackageStatus(ReservationPackageStatusConstant.quxiao.getValue()); |
|
|
|
|
distributionReservationZeroPackageService.updateById(rzp); |
|
|
|
|
DistributionParcelNumberEntity parcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda().eq(DistributionParcelNumberEntity::getParcelListId, rzp.getParcelListId())); |
|
|
|
|
if (Func.isNotEmpty(parcelNumberEntity)) { |
|
|
|
|
// parcelNumberEntity.setHandQuantity(parcelNumberEntity.getHandQuantity() + rzp.getQuantity());
|
|
|
|
|
parcelNumberEntity.setDeliveryQuantity(parcelNumberEntity.getDeliveryQuantity() - rzp.getQuantity()); |
|
|
|
|
int totalOutbound = parcelNumberEntity.getDeliveryQuantity() + parcelNumberEntity.getOutboundQuantity(); |
|
|
|
|
if (!Objects.equals(totalOutbound,parcelNumberEntity.getQuantity())){ |
|
|
|
|
//进行零担包件状态维护
|
|
|
|
|
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update().lambda() |
|
|
|
|
.eq(DistributionParcelListEntity::getId,parcelNumberEntity.getParcelListId()) |
|
|
|
|
.set(DistributionParcelListEntity::getOrderPackageReservationStatus,OrderPackageReservationStatusConstant.daiyuyue.getValue()) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
distributionParcelNumberService.updateById(parcelNumberEntity); |
|
|
|
|
distributionAsyncService.checkZeroStockArticleReservationStatus(parcelNumberEntity); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
log.error("###########################reservation_stockaticle的isZeroz字段维护错误,reservation_stockarticleID:{}", reservationStockarticleEntity.getId()); |
|
|
|
|
throw new RuntimeException("服务器正忙..."); |
|
|
|
@ -3564,6 +3583,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (Func.isNotEmpty(parcelNumberEntity)) { |
|
|
|
|
// parcelNumberEntity.setHandQuantity(parcelNumberEntity.getHandQuantity() + rzp.getQuantity());
|
|
|
|
|
parcelNumberEntity.setDeliveryQuantity(parcelNumberEntity.getDeliveryQuantity() - rzp.getQuantity()); |
|
|
|
|
int totalOutbound = parcelNumberEntity.getDeliveryQuantity() + parcelNumberEntity.getOutboundQuantity(); |
|
|
|
|
if (!Objects.equals(totalOutbound,parcelNumberEntity.getQuantity())){ |
|
|
|
|
//进行零担包件状态维护
|
|
|
|
|
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update().lambda() |
|
|
|
|
.eq(DistributionParcelListEntity::getId,parcelNumberEntity.getParcelListId()) |
|
|
|
|
.set(DistributionParcelListEntity::getOrderPackageReservationStatus,OrderPackageReservationStatusConstant.daiyuyue.getValue()) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
distributionParcelNumberService.updateById(parcelNumberEntity); |
|
|
|
|
distributionAsyncService.checkZeroStockArticleReservationStatus(parcelNumberEntity); |
|
|
|
|
} |
|
|
|
@ -3649,6 +3676,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
deliveryListEntity.setTaskTime(deliveryListDTO.getTaskTime()); |
|
|
|
|
//对配送进行更改
|
|
|
|
|
this.updateById(deliveryListEntity); |
|
|
|
|
//对修改计划下的所有包件进行维护
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // 执行发送推送
|
|
|
|
@ -5662,24 +5691,28 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R getDeliveryZeroOrderDetail(Long deliveryId, Long orderId) { |
|
|
|
|
public List<DistributionParcelNumberVO> getDeliveryZeroOrderDetail(Long deliveryId, Long orderId) { |
|
|
|
|
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() |
|
|
|
|
.eq(DistributionLoadscanEntity::getDeliveryId, deliveryId) |
|
|
|
|
.eq(DistributionLoadscanEntity::getOrderId, orderId) |
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (!Func.isEmpty(loadscanEntityList)){ |
|
|
|
|
return R.fail("此订单已进行装车操作,请滞留后编辑"); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
List<DistributionParcelNumberVO> zeroOrderDetail = distributionStockArticleService.getZeroOrderDetail(orderId); |
|
|
|
|
List<DistributionParcelNumberVO> parcelNumberVOS = baseMapper.selectDeliveryZeroOrderDetail(orderId, deliveryId); |
|
|
|
|
Map<Long, DistributionParcelNumberVO> reservationNum = parcelNumberVOS.stream().collect(Collectors.toMap(DistributionParcelNumberVO::getParcelListId, Function.identity(), (k1, k2) -> k2)); |
|
|
|
|
zeroOrderDetail.forEach(z -> { |
|
|
|
|
Integer integer = 0; |
|
|
|
|
if (Func.isNotEmpty(reservationNum.get(z.getParcelListId()))) { |
|
|
|
|
integer = reservationNum.get(z.getParcelListId()).getReservationNum(); |
|
|
|
|
z.setReservationNum(reservationNum.get(z.getParcelListId()).getReservationNum()); |
|
|
|
|
} |
|
|
|
|
int quantity = z.getHandQuantity() - z.getDeliveryQuantity() + integer; |
|
|
|
|
z.setNumber(quantity); |
|
|
|
|
}); |
|
|
|
|
return R.data(zeroOrderDetail); |
|
|
|
|
return zeroOrderDetail; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|