|
|
|
@ -2622,9 +2622,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
//查询出配送任务的基本信息
|
|
|
|
|
DistributionDeliveryListEntity deliveryListEntity = this.getById(deliveryListDTO.getId()); |
|
|
|
|
Long deliveryListEntityId = deliveryListEntity.getId(); |
|
|
|
|
if (deliveryListEntity.getDeliveryStatus().equals(DeliveryStatusConstant.peisongzhong.getValue())) { |
|
|
|
|
return R.fail("正在配送中..."); |
|
|
|
|
} |
|
|
|
|
// if (deliveryListEntity.getDeliveryStatus().equals(DeliveryStatusConstant.peisongzhong.getValue())) {
|
|
|
|
|
// return R.fail("正在配送中...");
|
|
|
|
|
// }
|
|
|
|
|
if (deliveryListEntity.getDeliveryStatus().equals(DeliveryStatusConstant.yiwancheng.getValue())) { |
|
|
|
|
return R.fail("配送已完成..."); |
|
|
|
|
} |
|
|
|
@ -2697,6 +2697,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
AtomicInteger deliveryPackageTotal = new AtomicInteger(); |
|
|
|
|
Date reservationDate = new Date(); |
|
|
|
|
newClient.forEach((k, v) -> { |
|
|
|
|
|
|
|
|
|
HashSet<String> orderNumber = new HashSet<>(); |
|
|
|
|
//运单号
|
|
|
|
|
// HashSet<String> waybillNo = new HashSet<>();
|
|
|
|
@ -2973,10 +2974,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
.eq(DistributionSignforEntity::getReservationId, reservationEntity.getId()) |
|
|
|
|
.eq(DistributionSignforEntity::getDeliveryId, deliveryListEntity.getId()) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){ |
|
|
|
|
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId()); |
|
|
|
|
throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询出该预约下的订单信息
|
|
|
|
|
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleMapper.selectList(Wrappers.<DistributionReservationStockarticleEntity>query().lambda().eq(DistributionReservationStockarticleEntity::getReservationId, reservationEntity.getId()).ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())); |
|
|
|
@ -3023,6 +3021,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
//此订单包件数量统计
|
|
|
|
|
AtomicInteger orderPackageNum = new AtomicInteger(); |
|
|
|
|
if (Func.isEmpty(oldOrder.get(s.getId()))) { |
|
|
|
|
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){ |
|
|
|
|
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId()); |
|
|
|
|
throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单"); |
|
|
|
|
} |
|
|
|
|
DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity(); |
|
|
|
|
if (s.getIsZero().equals(IsOrNoConstant.no.getValue())) { |
|
|
|
|
//新增订单
|
|
|
|
@ -3155,6 +3157,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (Func.isNotEmpty(packageListInfo)) { |
|
|
|
|
packageListInfo.forEach(p -> { |
|
|
|
|
if (Func.isEmpty(oldPackageList.get(p.getId()))) { |
|
|
|
|
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){ |
|
|
|
|
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId()); |
|
|
|
|
throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单"); |
|
|
|
|
} |
|
|
|
|
//为该订单新增了包件
|
|
|
|
|
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity(); |
|
|
|
|
reservationPackageEntity.setReservationId(reservationEntity.getId()); |
|
|
|
@ -3173,6 +3179,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
}); |
|
|
|
|
//进行取消包件的数据清理
|
|
|
|
|
oldPackageList.forEach((a, b) -> { |
|
|
|
|
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){ |
|
|
|
|
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId()); |
|
|
|
|
throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单"); |
|
|
|
|
} |
|
|
|
|
DistributionReservationPackageEntity reservationPackageEntity = b.get(0); |
|
|
|
|
reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue()); |
|
|
|
|
distributionReservationPackageService.updateById(reservationPackageEntity); |
|
|
|
@ -3268,6 +3278,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
}); |
|
|
|
|
if (Func.isNotEmpty(oldOrder)) { |
|
|
|
|
oldOrder.forEach((m, n) -> { |
|
|
|
|
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){ |
|
|
|
|
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId()); |
|
|
|
|
throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单"); |
|
|
|
|
} |
|
|
|
|
DistributionReservationStockarticleEntity reservationStockarticleEntity = n.get(0); |
|
|
|
|
if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) { |
|
|
|
|
List<DistributionReservationPackageEntity> reservationPackageEntityList = distributionReservationPackageMapper.selectList(Wrappers.<DistributionReservationPackageEntity>query().lambda().eq(DistributionReservationPackageEntity::getReservationId, reservationEntity.getId()).eq(DistributionReservationPackageEntity::getStockArticleId, reservationStockarticleEntity.getStockArticleId())); |
|
|
|
|