fix: 修复一个bug

This commit is contained in:
曹鹏飞 2024-04-16 15:30:24 +08:00
parent e7f7b4c15c
commit 50fd8f6e9a
1 changed files with 10 additions and 3 deletions

View File

@ -691,9 +691,16 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
&& params.getData().stream().anyMatch(u -> u.getProductionFactoryCode().equals(EBomConstant.XIAN_TAO_FACTORY_CODE_1020)))
.throwMessage("仙桃工厂(1020)下的子级必须也是仙桃");
if( params.getSetSubNode().equals(0) ){
return saveAllocationFactory(params.getData());
}else {
if (params.getSetSubNode().equals(0)) {
params.getData().forEach(k -> {
if (k.getProductionFactoryCode().equals(EBomConstant.MAIN_FACTORY_CODE_1010)
&& CollUtil.isNotEmpty(k.getAllParentRowIds())) {
//设置所有父级节点为1010
pbomChildService.setParentFactoryCode1010(k.getAllParentRowIds());
}
});
return saveAllocationFactory(params.getData());
} else {
params.getData().forEach(k -> {
AllocationFactoryBomQuery query = new AllocationFactoryBomQuery();
query.setBomRowId(k.getBomRowId());