fix:调拨不走整单

This commit is contained in:
zhaoyf
2026-11-05 18:55:59 +08:00
parent c48c15914e
commit 8dccde9a2a
2 changed files with 1 additions and 52 deletions

View File

@@ -385,44 +385,6 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
throw new BadRequestException("下推失败,单据状态已更新请刷新重新推送");
}
});
// if (disList.size() < pmDemandDtos.size()) {
// String collect = pmDemandDtos.stream()
// .map(PmDemandDto::getWorkOrder)
// .filter(workOrder -> disList.stream()
// .noneMatch(i -> Objects.equals(i.getWork_order(), workOrder)))
// .collect(Collectors.joining(","));
// throw new BadRequestException("下推失败,单据" + collect + "状态不为已分配不能下推");
// }
// List<PmDemand> allWorkDemand = this.list(new LambdaQueryWrapper<PmDemand>()
// .in(PmDemand::getWork_order, pmDemandDtos.stream()
// .map(PmDemandDto::getWorkOrder)
// .distinct()
// .collect(Collectors.toList()))
// .ne(PmDemand::getStatus, DemandStatus.FINISH.getValue())
// .ne(PmDemand::getIs_deleted, 1));
// if (pmDemandDtos.size() < allWorkDemand.size()) {
// // 统计 allWorkDemand 中每个工单的数量
// Map<String, Long> sourceCountMap = allWorkDemand.stream()
// .collect(Collectors.groupingBy(PmDemand::getWork_order, Collectors.counting()));
//
// // 统计 pmDemandDtos 中每个工单的数量
// Map<String, Long> targetCountMap = pmDemandDtos.stream()
// .collect(Collectors.groupingBy(PmDemandDto::getWorkOrder, Collectors.counting()));
//
// // 找出数量不一致的工单
// String collect = sourceCountMap.entrySet().stream()
// .filter(entry -> {
// Long targetCount = targetCountMap.getOrDefault(entry.getKey(), 0L);
// return !entry.getValue().equals(targetCount);
// })
// .map(Map.Entry::getKey)
// .collect(Collectors.joining(","));
// pmDemandDtos.forEach(item -> {
// if (collect.contains(item.getWorkOrder())) {
// item.setWorkOrder(item.getWorkOrder() + item.getPriority());
// }
// });
// }
// 一次性分成两组
Param zdStorParam = iSysParamService.findByCode(EXTConstant.ZD_STOR_SET);
List ZD_STOR_SET;
@@ -452,18 +414,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
//判断是否存在其他工单的数据是则保存
for (String workOrder : groupByWorkOrder.keySet()) {
final List<PmDemandDto> demandDtos = groupByWorkOrder.get(workOrder);
// inventory_dis 是 json 列,不能用 SQL IN 直接比对;
// 先按工单取出未删除的分配仓库,解析后判断是否全部属于中鼎仓库
// final List<PmDemand> orderDemands = this.list(new LambdaQueryWrapper<PmDemand>()
// .eq(PmDemand::getWork_order, workOrder)
// .ne(PmDemand::getIs_deleted, 1)
// .select(PmDemand::getInventory_dis));
// final long orderCount = orderDemands.stream()
// .filter(d -> ZD_STOR_SET.contains(resolveInventoryWarehouse(d.getInventory_dis())))
// .count();
// if (orderCount > demandDtos.size()){
// throw new BadRequestException("工单"+workOrder+"下推中鼎失败,存在未勾选的单子");
// }
List<PmDemandDto> zd = new ArrayList<>();
List<AddInvParam> addInvParams = new ArrayList<>();
List<InFinishParam> inFinishParams = new ArrayList<>();

View File

@@ -121,7 +121,6 @@ public class SapDealLLDBBillPmDeamndCallBack implements CallbackStrategy {
return;
}
one.setAssign_qty(param.getAssign_qty());
if (one.getAssign_qty().intValue() >= one.getQty().intValue()) {
one.setStatus(DemandStatus.FINISH.getValue());
final String now = DateUtil.now();
final List<IOStorInvDisDto> disSet = ioStorInvDisMapper.queryOutBillDisDtl(
@@ -160,7 +159,6 @@ public class SapDealLLDBBillPmDeamndCallBack implements CallbackStrategy {
log.error("DealLLDBBillPmDeamndCallBack#pmDemandCallback error:{}", ex.getMessage());
}
iPmStockReturnService.save(stockReturn);
}
this.iPmDemandService.updateById(one);
}
/**