diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java index dbad3e52..bfda9a44 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java @@ -264,10 +264,14 @@ public class EbomApi extends BaseApi { @GetMapping("editDetail") @ApiOperation("编辑物料列表") - public ResultVO editDetail(@RequestParam("bomRowId") Long bomRowId) { + public ResultVO editDetail(@RequestParam("bomRowId") Long bomRowId,@RequestParam("projectType") String projectType) { + + if(Objects.isNull(bomRowId)){ + VUtils.isTure(true ).throwMessage("bomRowId不能为空"); + } ResultVO resultVO = new ResultVO(); - resultVO.setData(bomNewEbomParentService.editDetail(bomRowId)); + resultVO.setData(bomNewEbomParentService.editDetail(bomRowId,projectType)); return resultVO; } 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 3434bd46..0f9c48fe 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 @@ -499,6 +499,16 @@ public class BomNewEbomParentService extends ServiceImpl list) throws ExecutionException, InterruptedException { + CheckEBomException checkEBomException = new CheckEBomException(list); + checkEBomException.initException(); + + //保存异常 + saveException(checkEBomException); + + + } /** * 检查 并保存异常信息 */ @@ -511,11 +521,12 @@ public class BomNewEbomParentService extends ServiceImpl childList=getBomTree(bomRowId); CheckEBomException checkEBomException = new CheckEBomException(childList); // System.out.println(JSON.toJSONString(checkEBomException.getAllBomDetail())); - checkEBomException.initException("projectType"); + checkEBomException.initException(); //错误状态包含在checkStatus内有异常抛出 checkEBomException.checkContainExcept(checkStatus); //筛选bomRowId()>0 说明有bom,更新只到parent这层,无bom不需要更新 @@ -1090,12 +1101,13 @@ public class BomNewEbomParentService extends ServiceImpl childList=dto.getDatas(); - checkAndSaveEBomException(dto.getParent().getBomRowId()); - - + if( dto.getParent().getRootIs()==null || dto.getParent().getRootIs()==0) { + childList.add(dto.getParent()); + } + checkAndSaveEBomException(childList); ThreadUtil.execAsync(() -> computeLevelNumAndRootState()); - return true; } @@ -1258,6 +1275,11 @@ public class BomNewEbomParentService extends ServiceImpl allBom = Convert.convert(new TypeReference>() { }, eBomEdit.childEntities); + BomNewEbomParentVO parent = Convert.convert( BomNewEbomParentVO .class + , eBomEdit.parentEntities.get(0)); + + if(dto.getParent().getRootIs()==null || dto.getParent().getRootIs()==0) { + allBom.add(parent); + } CheckEBomException checkEBomException = new CheckEBomException(allBom); - checkEBomException.initException("material", "materialTexture", "projectType"); - checkEBomException.checkContainExcept(checkStatus); - } if (CollectionUtil.isNotEmpty(eBomEdit.parentEntities)) { @@ -1283,12 +1308,18 @@ public class BomNewEbomParentService extends ServiceImpl childList= dto.getDatas(); + + if(dto.getParent().getRootIs()==null || dto.getParent().getRootIs()==0) { + childList.add(dto.getParent()); + } - checkAndSaveEBomException(dto.getParent().getBomRowId()); + + checkAndSaveEBomException(childList); // ebomChildService.getBaseMapper().updateEBomMaterialUse(); ThreadUtil.execAsync(() -> computeLevelNumAndRootState()); return true; @@ -1308,8 +1339,8 @@ public class BomNewEbomParentService extends ServiceImpl delTagList = new ArrayList<>(); - CheckEBomException checkEBomException = new CheckEBomException(delList); - checkEBomException.initException("material", "materialTexture", "projectType"); +// CheckEBomException checkEBomException = new CheckEBomException(delList); +// checkEBomException.initException(); //原始bom不正常 List s1List = delList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource()) && !Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList()); @@ -1342,10 +1373,8 @@ public class BomNewEbomParentService extends ServiceImpl changeMaterial(BomNewEBomChangeDTO dto) { - CheckEBomException.checkMaterialNoInMain(dto.getDatas()); - List checkBom = new ArrayList<>(); List tmp1=dto.getDatas().stream().filter(item->Objects.nonNull(item.getRowId()) && item.getRowId()>0).collect(Collectors.toList()); @@ -1366,6 +1395,9 @@ public class BomNewEbomParentService extends ServiceImpl