|
|
|
@ -222,53 +222,8 @@ public class StockOrderServiceImpl implements StockOrderService {
|
|
|
|
|
不是预验收单据,则正常扣减库存,回滚业务单据状态
|
|
|
|
|
*/
|
|
|
|
|
if (isPreInOrder(orderEntity)) {
|
|
|
|
|
|
|
|
|
|
invPreInProductDetailDao.deleteByOrderId(orderEntity.getId());
|
|
|
|
|
invPreInProductDao.deleteByOrderIdFk(orderEntity.getId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询预验收库库存详情
|
|
|
|
|
// FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
|
|
|
|
|
// filterInvProductDetailRequest.setOrderIdFk(orderEntity.getId());
|
|
|
|
|
// List<InvProductDetailEntity> invProductDetailEntities = invPreInProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
|
|
|
|
|
// List<InvProductEntity> invPreInProductList = new ArrayList<>();
|
|
|
|
|
// for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
|
|
|
|
|
// FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest();
|
|
|
|
|
// filterInvProductRequest.setRelIdFk(invProductDetailEntity.getProductIdFk());
|
|
|
|
|
// filterInvProductRequest.setSupId(invProductDetailEntity.getSupId());
|
|
|
|
|
// filterInvProductRequest.setInvWarehouseCode(invProductDetailEntity.getInvWarehouseCode());
|
|
|
|
|
// filterInvProductRequest.setInvStorageCode(invProductDetailEntity.getInvStorageCode());
|
|
|
|
|
// if (StrUtil.isBlank(invProductDetailEntity.getBatchNo())) {
|
|
|
|
|
// filterInvProductRequest.setBatchNo("empty");
|
|
|
|
|
// } else {
|
|
|
|
|
// filterInvProductRequest.setBatchNo(invProductDetailEntity.getBatchNo());
|
|
|
|
|
// }
|
|
|
|
|
// List<InvProductEntity> invProductEntities = invPreInProductDao.filterInvProduct(filterInvProductRequest);
|
|
|
|
|
// if (CollUtil.isNotEmpty(invProductEntities) && invProductEntities.size() > 0) {
|
|
|
|
|
// InvProductEntity invProductEntity = invProductEntities.get(0);
|
|
|
|
|
// calculateInvCount(invProductEntity, invProductDetailEntity);
|
|
|
|
|
// invPreInProductList.add(invProductEntity);
|
|
|
|
|
// } else {
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// //删除库存详情
|
|
|
|
|
// invPreInProductDetailDao.deleteByOrderId(orderEntity.getId());
|
|
|
|
|
// //更新库存
|
|
|
|
|
// for (InvProductEntity invProductEntity : invPreInProductList) {
|
|
|
|
|
// //查询库存码详情,如果库存码详情为空,则删除此库存
|
|
|
|
|
// FilterInvProductDetailRequest detailParams = new FilterInvProductDetailRequest();
|
|
|
|
|
// detailParams.setBatchNo(invProductEntity.getBatchNo());
|
|
|
|
|
// detailParams.setInvCodes(Collections.singletonList(invProductEntity.getInvStorageCode()));
|
|
|
|
|
// detailParams.setProductIdFk(invProductEntity.getRelIdFk());
|
|
|
|
|
// int count = invPreInProductDetailDao.statCount(detailParams);
|
|
|
|
|
// if (count == 0) {
|
|
|
|
|
// //如果库存码详情为空,则删除此库存
|
|
|
|
|
// invPreInProductDao.deleteById(String.valueOf(invProductEntity.getId()));
|
|
|
|
|
// } else {
|
|
|
|
|
// invPreInProductDao.updateInvProduct(invProductEntity);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
} else {
|
|
|
|
|
//非预验收单据库存,正常扣减库存
|
|
|
|
|
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
|
|
|
|
|