From a84047148db0ecad521a49860f7e79e6114a0bab Mon Sep 17 00:00:00 2001 From: wangzhijiang <12345678> Date: Mon, 9 May 2022 10:23:34 +0800 Subject: [PATCH] update --- .../ProjectLawsInventoryEOController.java | 2 +- .../enums/DesignComplianceStatusEnum.java | 53 ++++++++++++++++++ .../project/enums/ReviewResultEnum.java | 56 +++++++++++++++++++ .../IProjectLawsInventoryEOService.java | 2 +- .../ProjectLawsInventoryEOServiceImpl.java | 11 ++-- .../ProjectTaskInventoryEOServiceImpl.java | 42 +++++++++++++- 6 files changed, 157 insertions(+), 9 deletions(-) create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/DesignComplianceStatusEnum.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ReviewResultEnum.java diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLawsInventoryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLawsInventoryEOController.java index 65145cb74..b92dd93bb 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLawsInventoryEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLawsInventoryEOController.java @@ -237,7 +237,7 @@ public class ProjectLawsInventoryEOController extends JeroController queryProjectLawsInventoryInfoById(@RequestParam Map params) { - JSONObject result = projectLawsInventoryEOService.queryProjectLawsInventoryInfoById(params); + ProjectLawsInventoryEO result = projectLawsInventoryEOService.queryProjectLawsInventoryInfoById(params); return Result.OK(result); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/DesignComplianceStatusEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/DesignComplianceStatusEnum.java new file mode 100644 index 000000000..57d8f8b8b --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/DesignComplianceStatusEnum.java @@ -0,0 +1,53 @@ +package com.jero.modules.project.enums; + +import com.jero.common.constant.enums.CutEnum; +import org.apache.commons.lang.StringUtils; + +/** + * 设计符合性确认流程状态枚举类 + */ +public enum DesignComplianceStatusEnum { + TO_SUBMIT("待提交","to submit"), + TO_REVIEW("待审查","to review"), + REVIEW_COMPLETED("审查完成","review completed"), + ; + + + String name; + String value; + + private DesignComplianceStatusEnum(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static String getTextByValue(String value,String cut) { + DesignComplianceStatusEnum[] values = values(); + for (DesignComplianceStatusEnum designComplianceStatusEnum : values) { + if (designComplianceStatusEnum.value.equals(value)) { + if(StringUtils.equals(cut, CutEnum.CN.getValue())){ + return designComplianceStatusEnum.name; + }else { + return designComplianceStatusEnum.value; + } + } + } + return null; + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ReviewResultEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ReviewResultEnum.java new file mode 100644 index 000000000..e94ebd815 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ReviewResultEnum.java @@ -0,0 +1,56 @@ +package com.jero.modules.project.enums; + +import com.alibaba.druid.util.StringUtils; +import com.jero.common.constant.enums.CutEnum; + +/** + * 审查结果枚举类 + */ +public enum ReviewResultEnum { + TO_BE_CONFIRMED("待确认","to be confirmed"), + CONFORMITY("符合","conformity"), + INCONFORMITY("不符合","inconformity"), + TO_TRACK("待追踪","to track"), + UNINVOLVED("不涉及","uninvolved"), + TERMINATION_OF_TASK("任务终止","termination of task") + ; + + + String name; + String value; + + private ReviewResultEnum(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static String getTextByValue(String value,String cut) { + ReviewResultEnum[] values = values(); + for (ReviewResultEnum reviewResultEnum : values) { + if (reviewResultEnum.value.equals(value)) { + if(StringUtils.equals(cut, CutEnum.CN.getValue())){ + return reviewResultEnum.name; + }else { + return reviewResultEnum.value; + } + } + } + return null; + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java index 7a9a73770..cad641f9a 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java @@ -89,7 +89,7 @@ public interface IProjectLawsInventoryEOService extends IService processCall(JSONObject jsonObject); - JSONObject queryProjectLawsInventoryInfoById(Map params); + ProjectLawsInventoryEO queryProjectLawsInventoryInfoById(Map params); void copyInfoByIds(String ids); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java index 276559890..aeb408d2e 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java @@ -1121,9 +1121,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl params) { + public ProjectLawsInventoryEO queryProjectLawsInventoryInfoById(Map params) { - JSONObject result = new JSONObject(); String id = (String) params.get("id"); if(StringUtils.isEmpty(id)){ throw new JeroBootException("id不能为空"); @@ -1139,8 +1138,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl designMap = new HashMap<>(); designMap.put("designDeliverableType",projectLawsInventoryEOList.get(0).getDesignDeliverableType()); @@ -1165,11 +1164,11 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl result,String cut){ + if(CollectionUtils.isNotEmpty(result)){ + for (ProjectTaskInventoryEO projectTaskInventoryEO : result) { + if(StringUtils.isNotEmpty(projectTaskInventoryEO.getDesignStatus())){ + String textByValue = DesignComplianceStatusEnum.getTextByValue(projectTaskInventoryEO.getDesignStatus(), cut); + projectTaskInventoryEO.setDesignStatus(textByValue); + } + if(StringUtils.isNotEmpty(projectTaskInventoryEO.getDesignFlowTaskStatus())){ + String textByValue = ReviewResultEnum.getTextByValue(projectTaskInventoryEO.getDesignFlowTaskStatus(), cut); + projectTaskInventoryEO.setDesignFlowTaskStatus(textByValue); + } + + if(StringUtils.isNotEmpty(projectTaskInventoryEO.getPrehomoStatus())){ + String textByValue = DesignComplianceStatusEnum.getTextByValue(projectTaskInventoryEO.getPrehomoStatus(), cut); + projectTaskInventoryEO.setPrehomoStatus(textByValue); + } + if(StringUtils.isNotEmpty(projectTaskInventoryEO.getPrehomoFlowTaskStatus())){ + String textByValue = ReviewResultEnum.getTextByValue(projectTaskInventoryEO.getPrehomoFlowTaskStatus(), cut); + projectTaskInventoryEO.setPrehomoFlowTaskStatus(textByValue); + } + + if(StringUtils.isNotEmpty(projectTaskInventoryEO.getVerifyStatus())){ + String textByValue = DesignComplianceStatusEnum.getTextByValue(projectTaskInventoryEO.getVerifyStatus(), cut); + projectTaskInventoryEO.setVerifyStatus(textByValue); + } + if(StringUtils.isNotEmpty(projectTaskInventoryEO.getVerifyFlowTaskStatus())){ + String textByValue = ReviewResultEnum.getTextByValue(projectTaskInventoryEO.getVerifyFlowTaskStatus(), cut); + projectTaskInventoryEO.setVerifyFlowTaskStatus(textByValue); + } + } + } + } }