|
|
@ -241,22 +241,76 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
//3、查询预约单下的库存品信息列表
|
|
|
|
//3、查询预约单下的库存品信息列表
|
|
|
|
DistributionReservationEntity reservationEntity = this.getById(reservationId); |
|
|
|
DistributionReservationEntity reservationEntity = this.getById(reservationId); |
|
|
|
DistributionReservationVO reservationVO = DistributionReservationWrapper.build().entityVO(reservationEntity); |
|
|
|
DistributionReservationVO reservationVO = DistributionReservationWrapper.build().entityVO(reservationEntity); |
|
|
|
|
|
|
|
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleService.list(Wrappers.<DistributionReservationStockarticleEntity>query().lambda() |
|
|
|
|
|
|
|
.eq(DistributionReservationStockarticleEntity::getReservationId, reservationEntity.getId()) |
|
|
|
|
|
|
|
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())); |
|
|
|
|
|
|
|
ArrayList<DistributionStockArticleVO> distributionStockArticleVOS = new ArrayList<>(); |
|
|
|
|
|
|
|
if (Func.isNotEmpty(reservationStockarticleEntityList)) { |
|
|
|
|
|
|
|
reservationStockarticleEntityList.forEach(rs -> { |
|
|
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(rs.getStockArticleId()); |
|
|
|
|
|
|
|
DistributionStockArticleVO distributionStockArticleVO = DistributionStockArticleWrapper.build().entityVO(stockArticleEntity); |
|
|
|
|
|
|
|
if (rs.getIsZero().equals(IsOrNoConstant.no.getValue())) { |
|
|
|
|
|
|
|
List<DistributionReservationPackageEntity> reservationPackageEntityList = distributionReservationPackageService.list(Wrappers.<DistributionReservationPackageEntity>query().lambda() |
|
|
|
|
|
|
|
.eq(DistributionReservationPackageEntity::getReservationId, reservationEntity.getId()) |
|
|
|
|
|
|
|
.eq(DistributionReservationPackageEntity::getStockArticleId, rs.getStockArticleId()) |
|
|
|
|
|
|
|
.ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())); |
|
|
|
|
|
|
|
if (Func.isNotEmpty(reservationPackageEntityList)) { |
|
|
|
|
|
|
|
ArrayList<DistributionParcelListVO> distributionParcelListVOS = new ArrayList<>(); |
|
|
|
|
|
|
|
reservationPackageEntityList.forEach(rp -> { |
|
|
|
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(rp.getParceListId()); |
|
|
|
|
|
|
|
DistributionParcelListVO parcelListVOS = DistributionParcelListWrapper.build().entityVO(parcelListEntity); |
|
|
|
|
|
|
|
parcelListVOS.setQuantity(parcelListEntity.getQuantity()); |
|
|
|
|
|
|
|
distributionParcelListVOS.add(parcelListVOS); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
distributionStockArticleVO.setPackageList(distributionParcelListVOS); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
log.error("预约下订单包件信息缺失,订单ID为:{}",rs.getStockArticleId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if (rs.getIsZero().equals(IsOrNoConstant.yes.getValue())) { |
|
|
|
|
|
|
|
List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda() |
|
|
|
|
|
|
|
.eq(DistributionReservationZeroPackageEntity::getReservationId, reservationEntity.getId()) |
|
|
|
|
|
|
|
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, rs.getStockArticleId()) |
|
|
|
|
|
|
|
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())); |
|
|
|
|
|
|
|
if (Func.isNotEmpty(reservationZeroPackageEntityList)) { |
|
|
|
|
|
|
|
ArrayList<DistributionParcelListVO> distributionParcelListVOS = new ArrayList<>(); |
|
|
|
|
|
|
|
reservationZeroPackageEntityList.forEach(rzp -> { |
|
|
|
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(rzp.getParcelListId()); |
|
|
|
|
|
|
|
DistributionParcelListVO parcelListVOS = DistributionParcelListWrapper.build().entityVO(parcelListEntity); |
|
|
|
|
|
|
|
parcelListVOS.setQuantity(rzp.getQuantity()); |
|
|
|
|
|
|
|
distributionParcelListVOS.add(parcelListVOS); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
distributionStockArticleVO.setPackageList(distributionParcelListVOS); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
log.error("#######################预约下订单包件信息缺失,订单ID为:{}",rs.getStockArticleId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
log.error("####################预约订单中间表isZero字段缺失,reservation_stockArticle的ID为:{}",rs.getId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
distributionStockArticleVOS.add(distributionStockArticleVO); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
//1、查询预约单下的订单列表信息
|
|
|
|
}else { |
|
|
|
List<DistributionStockArticleEntity> stockArticleEntityList = distributionReservationMapper.getStockArticleList(reservationId); |
|
|
|
log.error("######################预约订单信息缺失,reservationID为:{}",reservationEntity.getId()); |
|
|
|
List<DistributionStockArticleVO> stockArticleVOS = DistributionStockArticleWrapper.build().listVO(stockArticleEntityList); |
|
|
|
} |
|
|
|
stockArticleVOS.forEach(s -> { |
|
|
|
reservationVO.setStockArticleList(distributionStockArticleVOS); |
|
|
|
//查询出这个订单在这个预约计划的选择情况
|
|
|
|
|
|
|
|
List<DistributionParcelListEntity> packageEntityList = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, s.getId()); |
|
|
|
|
|
|
|
// List<DistributionParcelListVO> packageList = distributionReservationPackageService.getStockArticlePackageList(packageEntityList);
|
|
|
|
|
|
|
|
List<DistributionParcelListVO> parcelListVOS = DistributionParcelListWrapper.build().listVO(packageEntityList); |
|
|
|
|
|
|
|
s.setPackageList(parcelListVOS); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
reservationVO.setStockArticleList(stockArticleVOS); |
|
|
|
|
|
|
|
return R.data(reservationVO); |
|
|
|
return R.data(reservationVO); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //1、查询预约单下的订单列表信息
|
|
|
|
|
|
|
|
// List<DistributionStockArticleEntity> stockArticleEntityList = distributionReservationMapper.getStockArticleList(reservationId);
|
|
|
|
|
|
|
|
// List<DistributionStockArticleVO> stockArticleVOS = DistributionStockArticleWrapper.build().listVO(stockArticleEntityList);
|
|
|
|
|
|
|
|
// stockArticleVOS.forEach(s -> {
|
|
|
|
|
|
|
|
// //查询出这个订单在这个预约计划的选择情况
|
|
|
|
|
|
|
|
// List<DistributionParcelListEntity> packageEntityList = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, s.getId());
|
|
|
|
|
|
|
|
//// List<DistributionParcelListVO> packageList = distributionReservationPackageService.getStockArticlePackageList(packageEntityList);
|
|
|
|
|
|
|
|
// List<DistributionParcelListVO> parcelListVOS = DistributionParcelListWrapper.build().listVO(packageEntityList);
|
|
|
|
|
|
|
|
// s.setPackageList(parcelListVOS);
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// reservationVO.setStockArticleList(stockArticleVOS);
|
|
|
|
|
|
|
|
// return R.data(reservationVO);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
@Transactional |
|
|
|
public R insertReservation(DistributionReservationDTO distributionReservationDTO) { |
|
|
|
public R insertReservation(DistributionReservationDTO distributionReservationDTO) { |
|
|
@ -2312,7 +2366,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R<?> getReservationPackageList(Long reservationId) { |
|
|
|
public R<?> getReservationPackageList(Long reservationId) { |
|
|
|
if (Func.isNotEmpty(reservationId)) { |
|
|
|
if (Func.isEmpty(reservationId)) { |
|
|
|
log.error("参数异常reservationId+{" + reservationId + "}"); |
|
|
|
log.error("参数异常reservationId+{" + reservationId + "}"); |
|
|
|
return R.fail("服务器正忙!!"); |
|
|
|
return R.fail("服务器正忙!!"); |
|
|
|
} |
|
|
|
} |
|
|
@ -2330,7 +2384,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
if (Func.isNotEmpty(reservationPackageEntityList)){ |
|
|
|
if (Func.isNotEmpty(reservationPackageEntityList)){ |
|
|
|
reservationPackageEntityList.forEach(rp->{ |
|
|
|
reservationPackageEntityList.forEach(rp->{ |
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(rp.getParceListId()); |
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(rp.getParceListId()); |
|
|
|
distributionParcelListVOS.add(DistributionParcelListWrapper.build().entityVO(parcelListEntity)); |
|
|
|
DistributionParcelListVO distributionParcelListVO = DistributionParcelListWrapper.build().entityVO(parcelListEntity); |
|
|
|
|
|
|
|
distributionParcelListVO.setReservationNum(parcelListEntity.getQuantity()); |
|
|
|
|
|
|
|
distributionParcelListVOS.add(distributionParcelListVO); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
log.error("####################此预约下订单查询包件信息错误,订单ID为:{}",rs.getStockArticleId()); |
|
|
|
log.error("####################此预约下订单查询包件信息错误,订单ID为:{}",rs.getStockArticleId()); |
|
|
@ -2342,11 +2398,11 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())); |
|
|
|
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())); |
|
|
|
if (Func.isNotEmpty(reservationZeroPackageEntities)){ |
|
|
|
if (Func.isNotEmpty(reservationZeroPackageEntities)){ |
|
|
|
reservationZeroPackageEntities.forEach(rp->{ |
|
|
|
reservationZeroPackageEntities.forEach(rp->{ |
|
|
|
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(rp.getParcelListId()); |
|
|
|
|
|
|
|
DistributionParcelListVO distributionParcelListVO = DistributionParcelListWrapper.build().entityVO(parcelListEntity); |
|
|
|
|
|
|
|
distributionParcelListVO.setReservationNum(rp.getQuantity()); |
|
|
|
|
|
|
|
distributionParcelListVOS.add(distributionParcelListVO); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
}else { |
|
|
|
log.error("####################此预约下零担订单查询品类信息错误,订单ID为:{}",rs.getStockArticleId()); |
|
|
|
log.error("####################此预约下零担订单查询品类信息错误,订单ID为:{}",rs.getStockArticleId()); |
|
|
|
} |
|
|
|
} |
|
|
|