diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java index 2ef8c2cc..905b0c8d 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java @@ -1026,13 +1026,13 @@ public class BomNewEbomParentService extends ServiceImpl !p.getMaterialDesc().contains("电控系统") && !eBomToPBom.getPBomChildResult().stream().map(BomNewPbomChildEntity::getParentRowId).collect(Collectors.toList()).contains(p.getRowId()) ) .collect(Collectors.toList()); if(!emptyChildParentList.isEmpty()){ - rList = emptyChildParentList.stream().map(BomNewPbomParentEntity::getMaterialNo).distinct() - .map(m -> { - OperationErrorMsgVO oem = new OperationErrorMsgVO(); - oem.setPrimaryKey(m); - oem.msg = String.format("物料%s因下级全部是F项,仅保存EBOM,未生成PBOM数据",m); - return oem; - }).collect(Collectors.toList()); +// rList = emptyChildParentList.stream().map(BomNewPbomParentEntity::getMaterialNo).distinct() +// .map(m -> { +// OperationErrorMsgVO oem = new OperationErrorMsgVO(); +// oem.setPrimaryKey(m); +// oem.msg = String.format("物料%s因下级全部是F项,仅保存EBOM,未生成PBOM数据",m); +// return oem; +// }).collect(Collectors.toList()); eBomToPBom.getPBomParentResult().removeAll(emptyChildParentList); } } @@ -1180,6 +1180,15 @@ public class BomNewEbomParentService extends ServiceImpl pbomParent = eBomToPBom.getPBomParentResult().stream().filter(p -> (p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("直发")) || (p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("制作"))).collect(Collectors.toList()); + + if(!pbomParent.isEmpty()){ + String m = pbomParent.stream().map(BomNewPbomParentEntity::getMaterialNo).distinct().collect(Collectors.joining(",")); + OperationErrorMsgVO oem = new OperationErrorMsgVO(); + oem.setPrimaryKey(m); + oem.msg = String.format("物料%s因属于电控系统直发包或制作包,仅保存EBOM,未生成PBOM数据。",m); + rList.add(oem); + } + eBomToPBom.getPBomParentResult().removeAll(pbomParent); //2、删掉pbom 子级的数据 List pbomChild = eBomToPBom.getPBomChildResult().stream() @@ -1188,16 +1197,16 @@ public class BomNewEbomParentService extends ServiceImpl emptyChildParentList = eBomToPBom.getPBomParentResult().stream() - .filter(p -> !eBomToPBom.getPBomChildResult().stream().map(BomNewPbomChildEntity::getParentRowId).collect(Collectors.toList()).contains(p.getRowId()) ) + .filter(p -> !p.getMaterialDesc().contains("电控系统") && !eBomToPBom.getPBomChildResult().stream().map(BomNewPbomChildEntity::getParentRowId).collect(Collectors.toList()).contains(p.getRowId()) ) .collect(Collectors.toList()); if(!emptyChildParentList.isEmpty()){ - rList = emptyChildParentList.stream().map(BomNewPbomParentEntity::getMaterialNo).distinct() - .map(m -> { - OperationErrorMsgVO oem = new OperationErrorMsgVO(); - oem.setPrimaryKey(m); - oem.msg = String.format("物料%s因下级全部是F项,仅保存EBOM,未生成PBOM数据",m); - return oem; - }).collect(Collectors.toList()); +// rList = emptyChildParentList.stream().map(BomNewPbomParentEntity::getMaterialNo).distinct() +// .map(m -> { +// OperationErrorMsgVO oem = new OperationErrorMsgVO(); +// oem.setPrimaryKey(m); +// oem.msg = String.format("物料%s因下级全部是F项,仅保存EBOM,未生成PBOM数据",m); +// return oem; +// }).collect(Collectors.toList()); eBomToPBom.getPBomParentResult().removeAll(emptyChildParentList); }