|
|
@ -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) { |
|
|
@ -1726,7 +1780,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
if (Func.isNotEmpty(s.getServiceNumber())){ |
|
|
|
if (Func.isNotEmpty(s.getServiceNumber())){ |
|
|
|
serviceNumber.add(s.getServiceNumber()); |
|
|
|
serviceNumber.add(s.getServiceNumber()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity(); |
|
|
|
DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity(); |
|
|
|
AtomicInteger reservationOrderNum = new AtomicInteger(); |
|
|
|
AtomicInteger reservationOrderNum = new AtomicInteger(); |
|
|
|
if (s.getIsZero().equals(IsOrNoConstant.no.getValue())){ |
|
|
|
if (s.getIsZero().equals(IsOrNoConstant.no.getValue())){ |
|
|
@ -2130,6 +2183,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, rs.getStockArticleId()) |
|
|
|
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, rs.getStockArticleId()) |
|
|
|
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())); |
|
|
|
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())); |
|
|
|
reservationZeroPackageEntityList.forEach(rzp->{ |
|
|
|
reservationZeroPackageEntityList.forEach(rzp->{ |
|
|
|
|
|
|
|
rzp.setZeroPackageStatus(ReservationPackageStatusConstant.quxiao.getValue()); |
|
|
|
|
|
|
|
distributionReservationZeroPackageService.updateById(rzp); |
|
|
|
DistributionParcelNumberEntity parcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda() |
|
|
|
DistributionParcelNumberEntity parcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda() |
|
|
|
.eq(DistributionParcelNumberEntity::getParcelListId, rzp.getParcelListId())); |
|
|
|
.eq(DistributionParcelNumberEntity::getParcelListId, rzp.getParcelListId())); |
|
|
|
if (Func.isNotEmpty(parcelNumberEntity)){ |
|
|
|
if (Func.isNotEmpty(parcelNumberEntity)){ |
|
|
@ -2167,7 +2222,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
distributionReservationPackageMapper.deleteReservationPackage(reservationEntity.getId()); |
|
|
|
distributionReservationPackageMapper.deleteReservationPackage(reservationEntity.getId()); |
|
|
|
distributionReservationZeroPackageMapper.deleteByReservationId(reservationEntity.getId()); |
|
|
|
distributionReservationZeroPackageMapper.deleteByReservationId(reservationEntity.getId()); |
|
|
|
distributionReservationMapper.deleteByReservationId(reservationEntity.getId()); |
|
|
|
distributionReservationMapper.deleteByReservationId(reservationEntity.getId()); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
//该预约计划存在备货任务
|
|
|
|
//该预约计划存在备货任务
|
|
|
|
//查询备货任务
|
|
|
|
//查询备货任务
|
|
|
|
DistributionStockupEntity stockupEntity = distributionStockupMapper.selectById(distributionStockupInfoEntities.get(0).getStockupId()); |
|
|
|
DistributionStockupEntity stockupEntity = distributionStockupMapper.selectById(distributionStockupInfoEntities.get(0).getStockupId()); |
|
|
@ -2185,6 +2240,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
} |
|
|
|
} |
|
|
|
//这里直接进行物理删除即可,但是在删除前需要将数据状态进行维护
|
|
|
|
//这里直接进行物理删除即可,但是在删除前需要将数据状态进行维护
|
|
|
|
//处理预约的包件信息
|
|
|
|
//处理预约的包件信息
|
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
reservationEntity.setReservationStatus(ReservationStatusConstant.yiquexiao.getValue()); |
|
|
|
|
|
|
|
this.updateById(reservationEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
log.error("###################预约备货任务数据异常,备货任务ID:{}",distributionStockupInfoEntities.get(0).getStockupId()); |
|
|
|
log.error("###################预约备货任务数据异常,备货任务ID:{}",distributionStockupInfoEntities.get(0).getStockupId()); |
|
|
@ -2312,7 +2370,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 +2388,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 +2402,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()); |
|
|
|
} |
|
|
|
} |
|
|
|