|
|
|
@ -232,7 +232,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
distributionReservationPackageEntity.setReservationId(reservationId); |
|
|
|
|
distributionReservationPackageEntity.setParceListId(p.getId()); |
|
|
|
|
distributionReservationPackageEntity.setStockArticleId(s.getId()); |
|
|
|
|
distributionReservationPackageEntity.setPacketBarCode(p.getPacketBarCode()); |
|
|
|
|
distributionReservationPackageEntity.setPacketBarCode(p.getOrderPackageCode()); |
|
|
|
|
//维护订单下包件信息
|
|
|
|
|
distributionReservationPackageService.save(distributionReservationPackageEntity); |
|
|
|
|
//此时订单下的所有包件都处于预约状态,可用数为0
|
|
|
|
@ -261,7 +261,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
distributionReservationStockarticleEntity.setReservationNum(packageNum.get()); |
|
|
|
|
//订单无数据源,不需要进行包件信息维护
|
|
|
|
|
//修改订单状态为已预约
|
|
|
|
|
s.setOrderStatus(ServiceConstant.ORDER_STATE_ALREADY_RESERVATION); |
|
|
|
|
// s.setOrderStatus(ServiceConstant.ORDER_STATE_ALREADY_RESERVATION);
|
|
|
|
|
s.setReservationStatus(30+"");// TODO 需要根据订单预约的包件数量是否等于订单总包件数量,存入 部分预约和已预约的状态值
|
|
|
|
|
stockArticleCount.getAndAdd(s.getReservationNum()); |
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = Func.copy(s, DistributionStockArticleEntity.class); |
|
|
|
|
// if (stockArticleEntity.getStoreId()==-1){
|
|
|
|
@ -281,7 +282,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
// }
|
|
|
|
|
distributionStockArticleService.updateById(s); |
|
|
|
|
//拼接订单自编号
|
|
|
|
|
arrayList.add(s.getOrderSelfNumbering()); |
|
|
|
|
arrayList.add(s.getOrderCode()); |
|
|
|
|
//拼接服务号
|
|
|
|
|
serviceNumber.add(s.getServiceNumber()); |
|
|
|
|
// //订单增值服务费
|
|
|
|
@ -312,7 +313,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
i.setQuantityOccupied(quantityOccupied+i.getReservationNum()); |
|
|
|
|
distributionStockListService.updateById(i); |
|
|
|
|
Long stocklistId = i.getId(); |
|
|
|
|
arrayList.add(i.getOrderSelfNumbering()); |
|
|
|
|
arrayList.add(i.getOrderCode()); |
|
|
|
|
DistributionReservationStocklistEntity distributionReservationStocklistEntity = new DistributionReservationStocklistEntity(); |
|
|
|
|
distributionReservationStocklistEntity.setReservationId(reservationId); |
|
|
|
|
distributionReservationStocklistEntity.setStocklistId(stocklistId); |
|
|
|
@ -560,7 +561,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
//拼接订单编号
|
|
|
|
|
orderIds.append(stockArticleEntity.getId()).append(","); |
|
|
|
|
//拼接订单自编号
|
|
|
|
|
hashSet.add(stockArticleEntity.getOrderSelfNumbering()); |
|
|
|
|
hashSet.add(stockArticleEntity.getOrderCode()); |
|
|
|
|
//存在数据来源,维护订单、包件和配送的关系
|
|
|
|
|
if (stockArticleEntity.getHandQuantity() > r.getReservationNum()) { |
|
|
|
|
//这里表示订单下的包件没有进行全部配送
|
|
|
|
@ -578,7 +579,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
reservationStocklistEntityList.forEach(l -> { |
|
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListService.getById(l.getStocklistId()); |
|
|
|
|
stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - l.getReservationNum()); |
|
|
|
|
hashSet.add(stockListEntity.getOrderSelfNumbering()); |
|
|
|
|
hashSet.add(stockListEntity.getOrderCode()); |
|
|
|
|
stockListId.append(stockListEntity.getId()).append(","); |
|
|
|
|
//这里需要将库存品信息和配送进行信息绑定
|
|
|
|
|
DistributionLoadscaninvnEntity loadscaninvnEntity = new DistributionLoadscaninvnEntity(); |
|
|
|
@ -651,7 +652,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
distributionDeliveryListEntity.setCustomersNumber(reservationIds.split(",").length); |
|
|
|
|
distributionDeliveryListEntity.setOrderNumber(orderNum.get()); |
|
|
|
|
distributionDeliveryListEntity.setType(ServiceConstant.DELIVERY_TYPE_CUSTOMER); |
|
|
|
|
distributionDeliveryListEntity.setOrderSelfNumbering(String.join(",", hashSet)); |
|
|
|
|
distributionDeliveryListEntity.setOrderCode(String.join(",", hashSet)); |
|
|
|
|
if (orderIds.length() > 1) { |
|
|
|
|
distributionDeliveryListEntity.setOrderId(orderIds.deleteCharAt(orderIds.length() - 1).toString()); |
|
|
|
|
} |
|
|
|
@ -775,7 +776,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
packageNum.getAndIncrement(); |
|
|
|
|
DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity(); |
|
|
|
|
distributionReservationPackageEntity.setReservationId(distributionReservationDTO.getId()); |
|
|
|
|
distributionReservationPackageEntity.setPacketBarCode(p.getPacketBarCode()); |
|
|
|
|
distributionReservationPackageEntity.setPacketBarCode(p.getOrderPackageCode()); |
|
|
|
|
distributionReservationPackageEntity.setParceListId(p.getId()); |
|
|
|
|
distributionReservationPackageEntity.setStockArticleId(s.getId()); |
|
|
|
|
//维护订单下包件信息
|
|
|
|
@ -791,7 +792,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
distributionReservationPackageEntity.setReservationId(distributionReservationDTO.getId()); |
|
|
|
|
distributionReservationPackageEntity.setParceListId(p.getId()); |
|
|
|
|
distributionReservationPackageEntity.setStockArticleId(s.getId()); |
|
|
|
|
distributionReservationPackageEntity.setPacketBarCode(p.getPacketBarCode()); |
|
|
|
|
distributionReservationPackageEntity.setPacketBarCode(p.getOrderPackageCode()); |
|
|
|
|
distributionReservationPackageService.save(distributionReservationPackageEntity); |
|
|
|
|
}); |
|
|
|
|
s.setAvailableQuantity(s.getAvailableQuantity() - s.getReservationNum()); |
|
|
|
@ -811,7 +812,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
initTotal.getAndAccumulate(new BigDecimal(s.getStorageFee().toString()), BigDecimal::add); |
|
|
|
|
//协商费用
|
|
|
|
|
initTotal.getAndAccumulate(new BigDecimal(s.getRate().toString()), BigDecimal::add); |
|
|
|
|
hashSet.add(s.getOrderSelfNumbering()); |
|
|
|
|
hashSet.add(s.getOrderCode()); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
List<DistributionStockListDTO> inventoryList = distributionReservationDTO.getInventoryList(); |
|
|
|
@ -828,7 +829,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
distributionReservationStocklistEntity.setReservationNum(i.getReservationNum()); |
|
|
|
|
distributionReservationStocklistEntity.setStocklistId(i.getId()); |
|
|
|
|
distributionReservationStocklistService.save(distributionReservationStocklistEntity); |
|
|
|
|
hashSet.add(i.getOrderSelfNumbering()); |
|
|
|
|
hashSet.add(i.getOrderCode()); |
|
|
|
|
stockListNum.getAndAdd(distributionReservationStocklistEntity.getReservationNum()); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -945,14 +946,14 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
//维护订单数据,订单状态直接变更未待配送
|
|
|
|
|
stockArticleEntity.setOrderStatus(ServiceConstant.ORDER_STATE_WAIT_DELIVERY); |
|
|
|
|
distributionStockArticleService.updateById(stockArticleEntity); |
|
|
|
|
orderSelfNumbering.append(stockArticleEntity.getOrderSelfNumbering()).append(","); |
|
|
|
|
orderSelfNumbering.append(stockArticleEntity.getOrderCode()).append(","); |
|
|
|
|
//订单数量累加
|
|
|
|
|
AtomicInteger packageCount = new AtomicInteger(); |
|
|
|
|
//订单存在数据源,维护订单包件信息
|
|
|
|
|
//维护预约和订单关系
|
|
|
|
|
DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity(); |
|
|
|
|
List<DistributionParcelListEntity> packageList = a.getPackageList(); |
|
|
|
|
if (a.getPackageList().size() == 0) { |
|
|
|
|
if (Objects.isNull(packageList) || packageList.size() == 0) { |
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>(); |
|
|
|
|
//这里就是默认添加订单下的所有包件
|
|
|
|
|
map.put("stockArticleId", stockArticleEntity.getId()); |
|
|
|
@ -964,7 +965,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity(); |
|
|
|
|
reservationPackageEntity.setReservationId(reservationEntity.getId()); |
|
|
|
|
reservationPackageEntity.setStockArticleId(stockArticleEntity.getId()); |
|
|
|
|
reservationPackageEntity.setPacketBarCode(p.getPacketBarCode()); |
|
|
|
|
reservationPackageEntity.setPacketBarCode(p.getOrderPackageCode()); |
|
|
|
|
reservationPackageEntity.setParceListId(p.getId()); |
|
|
|
|
distributionReservationPackageService.save(reservationPackageEntity); |
|
|
|
|
}); |
|
|
|
@ -974,7 +975,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
packageCount.getAndAdd(p.getQuantity()); |
|
|
|
|
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity(); |
|
|
|
|
reservationPackageEntity.setReservationId(reservationEntity.getId()); |
|
|
|
|
reservationPackageEntity.setPacketBarCode(p.getPacketBarCode()); |
|
|
|
|
reservationPackageEntity.setPacketBarCode(p.getOrderPackageCode()); |
|
|
|
|
reservationPackageEntity.setStockArticleId(stockArticleEntity.getId()); |
|
|
|
|
reservationPackageEntity.setParceListId(p.getId()); |
|
|
|
|
distributionReservationPackageService.save(reservationPackageEntity); |
|
|
|
@ -1058,7 +1059,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
// distributionDeliveryListEntity.setLoadingTeamName(stockup.getLoaderName());
|
|
|
|
|
// distributionDeliveryListEntity.setLoadingTeamId(stockup.getLoaderId());
|
|
|
|
|
// distributionDeliveryListEntity.setLeadTime(stockup.getStockupDate());
|
|
|
|
|
distributionDeliveryListEntity.setOrderSelfNumbering(orderSelfNumbering.deleteCharAt(orderSelfNumbering.length() - 1).toString()); |
|
|
|
|
distributionDeliveryListEntity.setOrderCode(orderSelfNumbering.deleteCharAt(orderSelfNumbering.length() - 1).toString()); |
|
|
|
|
distributionDeliveryListEntity.setOrderNumber(orderTotal.get()); |
|
|
|
|
distributionDeliveryListEntity.setDeliveryNumber(packageTotal.get()); |
|
|
|
|
distributionDeliveryListEntity.setCustomersNumber(clientNum.get()); |
|
|
|
|