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 d656043f..2c3d1da6 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 @@ -260,8 +260,7 @@ public class EbomApi extends BaseApi { dto.setRevertUserName(SessionUtil.getUserName()); dto.setUserCode(SessionUtil.getUserCode()); bomNewEbomParentService.revertDesign(dto); - //更新-待复核根节点 - bomNewEbomParentService.getBaseMapper().updateRootForWaitReview(); + return ResultVO.success(true); @@ -367,7 +366,7 @@ public class EbomApi extends BaseApi { checkDeleteRule(dto); bomNewEbomParentService.deleteBomChild(dto.getDelDatas()); BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto); - bomNewEbomParentService.getBaseMapper().updateRootForWaitReview(); + return ResultVO.success(temporary); } @@ -378,7 +377,7 @@ public class EbomApi extends BaseApi { checkDeleteRule(dto); bomNewEbomParentService.deleteBomChild(dto.getDelDatas()); BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto); - bomNewEbomParentService.getBaseMapper().updateRootForWaitReview(); + // bomNewEbomParentService.getBaseMapper().updateRootForWaitReview(); return ResultVO.success(temporary); } 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 174df938..4022db9a 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 @@ -1174,7 +1174,8 @@ public class BomNewEbomParentService extends ServiceImpl computeLevelNumAndRootState()); + if (eBomEdit.isRootForWaitReview()) { + this.getBaseMapper().updateRootForWaitReview(); + } + + + + BomNewEbomParentVO retParentVO = Convert.convert(BomNewEbomParentVO.class, eBomEdit.getParentEntity()); retParentVO.setBomRowId(retParentVO.getRowId()); @@ -1713,7 +1723,9 @@ public class BomNewEbomParentService extends ServiceImpl parentEntities; @Getter private BomNewEbomParentEntity parentEntity; + @Getter + private boolean isRootForWaitReview=false; public List childEntities; @@ -78,9 +80,16 @@ public class EBomEdit { parent.setEditStatus(EbomEditStatusEnum.HANDLER_CREATED.getValue()); parent.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); + boolean isTechnician= SpringUtil.getBean(UserRoleService.class).technician(); + parent.setStatus(isTechnician? EBomStatusEnum.CHECKED.getValue() : EBomStatusEnum.WAIT_CHECK.getValue()); + parent.setCreatedJob(isTechnician? UserJobEnum.ENGINEER.getValue() : UserJobEnum.DESIGNER.getValue()); - parent.setStatus(SpringUtil.getBean(UserRoleService.class).technician() ? EBomStatusEnum.CHECKED.getValue() : EBomStatusEnum.WAIT_CHECK.getValue()); - parent.setCreatedJob(SpringUtil.getBean(UserRoleService.class).technician() ? UserJobEnum.ENGINEER.getValue() : UserJobEnum.DESIGNER.getValue()); + //工艺人不用更新 + if(isTechnician){ + isRootForWaitReview=false; + }else{ + isRootForWaitReview=true; + } parent.setCreatedTime(LocalDateTime.now()); parent.setModifyTime(LocalDateTime.now()); @@ -125,12 +134,12 @@ public class EBomEdit { }); - if (Objects.equals(createDTO.getOpType(), EbomEditStatusEnum.HANDLER_FINISHED.getValue())) { - //工艺人员 - if (roleList.contains(EBomConstant.TECHNICIAN)) { - parentEntity.setStatus(EBomStatusEnum.CHECKED.getValue()); - } - } +// if (Objects.equals(createDTO.getOpType(), EbomEditStatusEnum.HANDLER_FINISHED.getValue())) { +// //工艺人员 +// if (roleList.contains(EBomConstant.TECHNICIAN)) { +// parentEntity.setStatus(EBomStatusEnum.CHECKED.getValue()); +// } +// } childEntities.addAll(updateOrCreateChild(createDTO)); @@ -293,6 +302,7 @@ public class EBomEdit { //rowId is null 必定是未入库作为根 if (dto.getParent().getRowId() == null || dto.getParent().getRowId().longValue() == 0) { createRootBom(dto); + return; }