|
|
|
@ -2773,6 +2773,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
distributionReservationMapper.insert(reservationEntity); |
|
|
|
|
//新增一个客户
|
|
|
|
|
v.forEach(s -> { |
|
|
|
|
List<Long> packageLockIds = new ArrayList<>(); |
|
|
|
|
//预约单数据填充
|
|
|
|
|
if (Func.isNotEmpty(s.getMallName())) { |
|
|
|
|
mallName.add(s.getMallName()); |
|
|
|
@ -2841,7 +2842,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
dp.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue()); |
|
|
|
|
distributionParcelListService.updateById(dp); |
|
|
|
|
distributionAsyncService.checkStockArticleReservationStatus(dp); |
|
|
|
|
|
|
|
|
|
packageLockIds.add(dp.getId()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
|
|
|
|
@ -2861,6 +2862,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
distributionReservationPackageService.save(reservationPackageEntity); |
|
|
|
|
p.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue()); |
|
|
|
|
distributionParcelListService.updateById(p); |
|
|
|
|
packageLockIds.add(p.getId()); |
|
|
|
|
//这里根据包件进行订单状态的改变
|
|
|
|
|
// distributionAsyncService.checkStockArticleReservationStatus(p);
|
|
|
|
|
}); |
|
|
|
@ -2888,6 +2890,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
distributionParcelNumberService.updateById(p); |
|
|
|
|
orderPackageNum.getAndAdd(distributionReservationZeroPackageEntity.getQuantity()); |
|
|
|
|
distributionAsyncService.checkZeroStockArticleReservationStatus(Func.copy(p, DistributionParcelNumberEntity.class)); |
|
|
|
|
packageLockIds.add(p.getParcelListId()); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
@ -2908,6 +2912,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
distributionParcelNumberService.updateById(l); |
|
|
|
|
orderPackageNum.getAndAdd(distributionReservationZeroPackageEntity.getQuantity()); |
|
|
|
|
distributionAsyncService.checkZeroStockArticleReservationStatus(Func.copy(l, DistributionParcelNumberEntity.class)); |
|
|
|
|
packageLockIds.add(l.getParcelListId()); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
log.error("###########################零担订单查询品类错误,订单ID:{}", s.getId()); |
|
|
|
@ -2926,6 +2932,18 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
distributionReservationStockarticleService.save(reservationStockarticleEntity); |
|
|
|
|
packageTotal.getAndAdd(reservationStockarticleEntity.getReservationNum()); |
|
|
|
|
orderTotal.getAndIncrement(); |
|
|
|
|
//添加缓存
|
|
|
|
|
if (!packageLockIds.isEmpty()){ |
|
|
|
|
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode()); |
|
|
|
|
if (Func.isNotEmpty(a)){ |
|
|
|
|
boolean flag = a.stream().anyMatch(f -> packageLockIds.contains(f)); |
|
|
|
|
if (flag){ |
|
|
|
|
throw new RuntimeException(s.getOrderCode()+"正在操作,请刷新后尝试"); |
|
|
|
|
}else { |
|
|
|
|
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode(),packageLockIds,5*60L); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
// -----------------------客户收货信息完善-------------------------
|
|
|
|
|
reservationEntity.setConsignee(String.join(",", consigneeName)); |
|
|
|
@ -2979,6 +2997,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleMapper.selectList(Wrappers.<DistributionReservationStockarticleEntity>query().lambda().eq(DistributionReservationStockarticleEntity::getReservationId, reservationEntity.getId()).ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())); |
|
|
|
|
Map<Long, List<DistributionReservationStockarticleEntity>> oldOrder = reservationStockarticleEntityList.stream().collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getStockArticleId)); |
|
|
|
|
v.forEach(s -> { |
|
|
|
|
List<Long> packageLockIds = new ArrayList<>(); |
|
|
|
|
orderTotal.getAndIncrement(); |
|
|
|
|
//预约单数据填充
|
|
|
|
|
if (Func.isNotEmpty(s.getMallName())) { |
|
|
|
@ -3040,6 +3059,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
distributionReservationPackageService.save(reservationPackageEntity); |
|
|
|
|
p.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue()); |
|
|
|
|
distributionParcelListService.updateById(p); |
|
|
|
|
packageLockIds.add(p.getId()); |
|
|
|
|
//这里根据包件进行订单状态的改变
|
|
|
|
|
// distributionAsyncService.checkStockArticleReservationStatus(p);
|
|
|
|
|
}); |
|
|
|
@ -3070,6 +3090,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
dp.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue()); |
|
|
|
|
distributionParcelListService.updateById(dp); |
|
|
|
|
distributionAsyncService.checkStockArticleReservationStatus(dp); |
|
|
|
|
packageLockIds.add(dp.getId()); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
|
|
|
|
@ -3101,7 +3123,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
distributionParcelNumberService.updateById(p); |
|
|
|
|
orderPackageNum.getAndAdd(distributionReservationZeroPackageEntity.getQuantity()); |
|
|
|
|
distributionAsyncService.checkZeroStockArticleReservationStatus(Func.copy(p, DistributionParcelNumberEntity.class)); |
|
|
|
|
|
|
|
|
|
packageLockIds.add(p.getParcelListId()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
@ -3122,6 +3144,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
distributionParcelNumberService.updateById(l); |
|
|
|
|
orderPackageNum.getAndAdd(distributionReservationZeroPackageEntity.getQuantity()); |
|
|
|
|
distributionAsyncService.checkZeroStockArticleReservationStatus(Func.copy(l, DistributionParcelNumberEntity.class)); |
|
|
|
|
packageLockIds.add(l.getParcelListId()); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
log.error("###########################零担订单查询品类错误,订单ID:{}", s.getId()); |
|
|
|
@ -3177,6 +3201,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
reservationPackageEntity.setParceListId(p.getId()); |
|
|
|
|
distributionReservationPackageService.save(reservationPackageEntity); |
|
|
|
|
distributionAsyncService.checkStockArticleReservationStatus(p); |
|
|
|
|
packageLockIds.add(p.getId()); |
|
|
|
|
} else { |
|
|
|
|
//依然存在包件,
|
|
|
|
|
oldPackageList.remove(p.getId()); |
|
|
|
@ -3197,6 +3222,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(reservationPackageEntity.getParceListId()); |
|
|
|
|
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue()); |
|
|
|
|
distributionParcelListService.updateById(parcelListEntity); |
|
|
|
|
if (Func.isNotEmpty(bladeRedis.get("warehouseId:"+myCurrentWarehouse.getId()+"orderCode:"+parcelListEntity.getOrderCode()))){ |
|
|
|
|
List<Long> ids = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + parcelListEntity.getOrderCode()); |
|
|
|
|
int indexOf = ids.indexOf(parcelListEntity.getId()); |
|
|
|
|
if (indexOf>0){ |
|
|
|
|
ids.remove(indexOf); |
|
|
|
|
bladeRedis.set("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + parcelListEntity.getOrderCode(),ids); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// distributionAsyncService.checkStockArticleReservationStatus(parcelListEntity);
|
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
@ -3282,6 +3315,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
//预约订单上的包件数量维护
|
|
|
|
|
packageTotal.getAndAdd(reservationStockarticleEntity.getReservationNum()); |
|
|
|
|
} |
|
|
|
|
if (!packageLockIds.isEmpty()){ |
|
|
|
|
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode()); |
|
|
|
|
if (Func.isNotEmpty(a)){ |
|
|
|
|
boolean flag = a.stream().anyMatch(f -> packageLockIds.contains(f)); |
|
|
|
|
if (flag){ |
|
|
|
|
throw new RuntimeException(s.getOrderCode()+"正在操作,请刷新后尝试"); |
|
|
|
|
}else { |
|
|
|
|
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode(),packageLockIds,5*60L); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if (Func.isNotEmpty(oldOrder)) { |
|
|
|
|
oldOrder.forEach((m, n) -> { |
|
|
|
@ -3322,6 +3366,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(n.get(0).getStockArticleId()); |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(), myCurrentWarehouse.getId()); |
|
|
|
|
bladeRedis.del("warehouseId:"+myCurrentWarehouse.getId()+"orderCode:"+stockArticleEntity.getOrderCode()); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
//重新维护预约信息
|
|
|
|
|