|
|
|
@ -202,9 +202,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
//获取新增预约信息的编号
|
|
|
|
|
Long reservationId = reservationEntity.getId(); |
|
|
|
|
//货区订单列表信息
|
|
|
|
|
List<DistributionStockArticleEntity> stockArticleList = distributionReservationDTO.getStockArticleList(); |
|
|
|
|
List<DistributionStockArticleDTO> stockArticleList = distributionReservationDTO.getStockArticleList(); |
|
|
|
|
//获取库存品列表信息
|
|
|
|
|
List<DistributionStockListEntity> inventoryList = distributionReservationDTO.getInventoryList(); |
|
|
|
|
List<DistributionStockListDTO> inventoryList = distributionReservationDTO.getInventoryList(); |
|
|
|
|
//订单数量统计
|
|
|
|
|
AtomicInteger stockArticleCount = new AtomicInteger(); |
|
|
|
|
|
|
|
|
@ -252,6 +252,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
distributionReservationPackageMapper.insert(distributionReservationPackageEntity); |
|
|
|
|
packageNum.getAndAdd(p.getQuantity()); |
|
|
|
|
p.setOrderPackageStatus(ServiceConstant.PACKAGE_STATUS_RESERVATION); |
|
|
|
|
// p.setBrandId(p.getBrandId());
|
|
|
|
|
distributionParcelListService.updateById(p); |
|
|
|
|
}); |
|
|
|
|
//设置订单可用数量为
|
|
|
|
@ -262,6 +263,22 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
//修改订单状态为已预约
|
|
|
|
|
s.setOrderStatus(ServiceConstant.ORDER_STATE_ALREADY_RESERVATION); |
|
|
|
|
stockArticleCount.getAndAdd(s.getReservationNum()); |
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = Func.copy(s, DistributionStockArticleEntity.class); |
|
|
|
|
// if (stockArticleEntity.getStoreId()==-1){
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// if (stockArticleEntity.getMallId()==-1){
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// if (stockArticleEntity.getFee().equals(-1)){
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// if (stockArticleEntity.getStoreId()==-1){
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// if (stockArticleEntity.getStoreId()==-1){
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
distributionStockArticleService.updateById(s); |
|
|
|
|
//拼接订单自编号
|
|
|
|
|
arrayList.add(s.getOrderSelfNumbering()); |
|
|
|
@ -742,13 +759,13 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
AtomicReference<BigDecimal> initTotal = new AtomicReference<>(BigDecimal.ZERO); |
|
|
|
|
//订单自编号拼接
|
|
|
|
|
HashSet<String> hashSet = new HashSet<>(); |
|
|
|
|
List<DistributionStockArticleEntity> stockArticleList = distributionReservationDTO.getStockArticleList(); |
|
|
|
|
List<DistributionStockArticleDTO> stockArticleList = distributionReservationDTO.getStockArticleList(); |
|
|
|
|
if (!Func.isEmpty(stockArticleList)) { |
|
|
|
|
//这里判断修改内容是否存在订单信息,如果存在则进行中间表数据的重新插入
|
|
|
|
|
stockArticleList.forEach(s -> { |
|
|
|
|
List<DistributionParcelListEntity> packageList = s.getPackageList(); |
|
|
|
|
AtomicInteger packageNum = new AtomicInteger(); |
|
|
|
|
if (packageList.size() == 0) { |
|
|
|
|
if (Func.isEmpty(packageList)) { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("stockArticleId", s.getId()); |
|
|
|
|
QueryWrapper<DistributionParcelListEntity> qw = Condition.getQueryWrapper(map, DistributionParcelListEntity.class); |
|
|
|
@ -787,7 +804,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
distributionReservationStockarticleEntity.setReservationId(distributionReservationEntity.getId()); |
|
|
|
|
distributionReservationStockarticleService.save(distributionReservationStockarticleEntity); |
|
|
|
|
packageCount.getAndAdd(distributionReservationStockarticleEntity.getReservationNum()); |
|
|
|
|
|
|
|
|
|
//统计订单包件数量
|
|
|
|
|
//订单到付费用
|
|
|
|
|
initTotal.getAndAccumulate(new BigDecimal(s.getCollectFee().toString()), BigDecimal::add); |
|
|
|
@ -798,7 +814,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
hashSet.add(s.getOrderSelfNumbering()); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
List<DistributionStockListEntity> inventoryList = distributionReservationDTO.getInventoryList(); |
|
|
|
|
List<DistributionStockListDTO> inventoryList = distributionReservationDTO.getInventoryList(); |
|
|
|
|
AtomicInteger stockListNum = new AtomicInteger(); |
|
|
|
|
if (!Func.isEmpty(inventoryList)) { |
|
|
|
|
//重新构建预约和库存之间的关系
|
|
|
|
@ -1125,4 +1141,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
|
|
|
|
|
public Integer getReservationNumByReservationIdAndStockListId(Long reservationId, Long stockListId) { |
|
|
|
|
return baseMapper.getReservationNumByReservationIdAndStockListId(reservationId,stockListId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R<?> getReservationStockListInfo(String reservationId) { |
|
|
|
|
List<DistributionStockListEntity> stockListEntityList = baseMapper.getReservationStockListInfo(reservationId); |
|
|
|
|
return R.data(stockListEntityList); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|