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 a6bfc228..42995f0f 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 @@ -377,6 +377,7 @@ public class EbomApi extends BaseApi { @ApiOperation("提交") @LogRecord(success = "Ebom-提交,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret}}", bizNo = "{{#dto.parent.rowId}}",type = "Ebom-提交") public ResultVO submit(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException { + return ResultVO.success(bomNewEbomParentService.submit(dto)); } 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 fcb2b05b..28452346 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 @@ -114,18 +114,18 @@ public class BomNewEbomParentService extends ServiceImpl materialBoms = this.lambdaQuery().eq(BomNewEbomParentEntity::getMaterialNo,materialNo).eq(BomNewEbomParentEntity::getLastVersionIs, 1) - .ne(BomNewEbomParentEntity::getStatus,EBomStatusEnum.PUBLISHED.getValue()).list(); - if(query.getDataType().equals(0) && CollUtil.isEmpty(materialBoms) ){ + List materialBoms = this.lambdaQuery().eq(BomNewEbomParentEntity::getMaterialNo, materialNo).eq(BomNewEbomParentEntity::getLastVersionIs, 1) + .ne(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue()).list(); + if (query.getDataType().equals(0) && CollUtil.isEmpty(materialBoms)) { return returnResult; } - List materialNos=new ArrayList<>(); + List materialNos = new ArrayList<>(); List parentMaterialByMaterialNo = getParentMaterialByMaterialNo(materialNo, !userRoleService.technician()).stream().collect(Collectors.toList()); materialNos.add(materialNo); materialNos.addAll(parentMaterialByMaterialNo); if (CollUtil.isNotEmpty(materialNos)) { List parents = this.getBaseMapper().getParentForMaterialNoSeach(materialNos, query.getDataType()); - List childs = this.getBaseMapper().getChildForMaterialNoSeach(materialNos, materialNo,query.getDataType()); + List childs = this.getBaseMapper().getChildForMaterialNoSeach(materialNos, materialNo, query.getDataType()); List data = new ArrayList<>(); data.addAll(parents); data.addAll(childs); @@ -687,10 +687,10 @@ public class BomNewEbomParentService extends ServiceImpl bomTree = getBomTree(bomRowId); - VUtils.isTure(CollUtil.isEmpty(bomTree)).throwMessage("该BOM不存在下级,无需转换:"+ bomRowId.toString()); + VUtils.isTure(CollUtil.isEmpty(bomTree)).throwMessage("该BOM不存在下级,无需转换:" + bomRowId.toString()); parent.setBomRowId(parent.getRowId()); parent.setChildBomRowId(parent.getRowId()); parent.setParentRowId(0L); @@ -757,13 +757,13 @@ public class BomNewEbomParentService extends ServiceImpl0?0:1); - ebomParent.setUserRootIs(userRootIs>0?0:1); + ebomParent.setRootIs(rootIs > 0 ? 0 : 1); + ebomParent.setUserRootIs(userRootIs > 0 ? 0 : 1); this.updateById(ebomParent); @@ -921,8 +921,8 @@ public class BomNewEbomParentService extends ServiceImpl()); - }else{ + } else { BomNewEbomParentEntity parent = this.getBaseMapper().selectById(bomRowId); parentVO = Convert.convert(BomNewEbomParentVO.class, parent); @@ -1520,6 +1520,17 @@ public class BomNewEbomParentService extends ServiceImpl computeLevelNumAndRootState()); - BomNewEbomParentVO retParentVO= Convert.convert(BomNewEbomParentVO.class,eBomEdit.getParentEntity()); + BomNewEbomParentVO retParentVO = Convert.convert(BomNewEbomParentVO.class, eBomEdit.getParentEntity()); retParentVO.setBomRowId(retParentVO.getRowId()); return retParentVO; @@ -1561,6 +1572,15 @@ public class BomNewEbomParentService extends ServiceImpl delTagList = new ArrayList<>(); List okList = delList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource()) - && Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList()); + && Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList()); - if(CollUtil.isNotEmpty(okList)){ - throw new NflgBusinessException(STATE.Error,"从原始Bom导入的数据,数据没有异常的情况下,不可以删除"); + if (CollUtil.isNotEmpty(okList)) { + throw new NflgBusinessException(STATE.Error, "从原始Bom导入的数据,数据没有异常的情况下,不可以删除"); }