Browse Source

预约详情查看零担订单、预约详情零担订单包件呈现

training
kilo 1 year ago
parent
commit
c31b9a093c
  1. 92
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

92
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -241,22 +241,76 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//3、查询预约单下的库存品信息列表
DistributionReservationEntity reservationEntity = this.getById(reservationId);
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、查询预约单下的订单列表信息
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);
});
}else {
log.error("######################预约订单信息缺失,reservationID为:{}",reservationEntity.getId());
}
reservationVO.setStockArticleList(distributionStockArticleVOS);
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
@Transactional
public R insertReservation(DistributionReservationDTO distributionReservationDTO) {
@ -2312,7 +2366,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
@Override
public R<?> getReservationPackageList(Long reservationId) {
if (Func.isNotEmpty(reservationId)) {
if (Func.isEmpty(reservationId)) {
log.error("参数异常reservationId+{" + reservationId + "}");
return R.fail("服务器正忙!!");
}
@ -2330,7 +2384,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
if (Func.isNotEmpty(reservationPackageEntityList)){
reservationPackageEntityList.forEach(rp->{
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 {
log.error("####################此预约下订单查询包件信息错误,订单ID为:{}",rs.getStockArticleId());
@ -2342,11 +2398,11 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()));
if (Func.isNotEmpty(reservationZeroPackageEntities)){
reservationZeroPackageEntities.forEach(rp->{
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(rp.getParcelListId());
DistributionParcelListVO distributionParcelListVO = DistributionParcelListWrapper.build().entityVO(parcelListEntity);
distributionParcelListVO.setReservationNum(rp.getQuantity());
distributionParcelListVOS.add(distributionParcelListVO);
});
}else {
log.error("####################此预约下零担订单查询品类信息错误,订单ID为:{}",rs.getStockArticleId());
}

Loading…
Cancel
Save