refactor(in-produce-order): 优化入库生产订单子项处理逻辑
- 移除原有的子项过滤和处理流程 - 直接对父项设置齐套标记 - 统一处理物料扫描类型的必扫标识设置 - 简化数据结构处理逻辑 - 提升代码可读性和维护性
This commit is contained in:
parent
92a756d19e
commit
4b9c5b540c
|
|
@ -430,19 +430,23 @@ public class InProduceOrderController extends BaseController {
|
|||
datas = new ArrayList<>();
|
||||
list.stream().filter(it -> Objects.equals(it.getParentId(), 0L))
|
||||
.forEach(it -> {
|
||||
List<InProduceOrderItemVO> children = list.stream()
|
||||
.filter(child -> Objects.equals(child.getParentId(), it.getId()))
|
||||
.toList();
|
||||
// List<InProduceOrderItemVO> children = list.stream()
|
||||
// .filter(child -> Objects.equals(child.getParentId(), it.getId()))
|
||||
// .toList();
|
||||
Integer type = bomService.getScanType(it.getMaterialNo());
|
||||
children.forEach(child -> {
|
||||
child.setNum(NumberUtil.multiply(child.getNum(), it.getNum()));
|
||||
child.setQiTao(false);
|
||||
// children.forEach(child -> {
|
||||
// child.setNum(NumberUtil.multiply(child.getNum(), it.getNum()));
|
||||
// child.setQiTao(false);
|
||||
// if (Objects.equals(type, 0)) {
|
||||
// child.setMustScan(false);
|
||||
// }
|
||||
// });
|
||||
// datas.addAll(children);
|
||||
it.setQiTao(bomService.isQiTao(it.getMaterialNo()));
|
||||
if (Objects.equals(type, 0)) {
|
||||
child.setMustScan(false);
|
||||
it.setMustScan(false);
|
||||
}
|
||||
});
|
||||
datas.addAll(children);
|
||||
});
|
||||
} else {
|
||||
datas = list;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue