From 7958d726c6613532a30715eefac7a709b7f60c00 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Wed, 28 Aug 2024 11:30:02 +0800 Subject: [PATCH] =?UTF-8?q?modify:=201.=20=E7=AB=8B=E9=A1=B9=E5=A4=87?= =?UTF-8?q?=E6=A1=88=E9=80=9A=E8=BF=87=E9=98=B6=E6=AE=B5=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=A0=81=E4=BF=AE=E6=94=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projectlib/helper/ProjectChangeStopHelper.java | 4 +- .../projectlib/manage/DeclaredRecordManage.java | 11 +--- .../model/enumeration/status/ProjectStatus.java | 70 ++++++++++------------ 3 files changed, 35 insertions(+), 50 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectChangeStopHelper.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectChangeStopHelper.java index 5fb5420..d02a649 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectChangeStopHelper.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/helper/ProjectChangeStopHelper.java @@ -110,7 +110,7 @@ public class ProjectChangeStopHelper { .build(); projectStatusChangeService.save(projectStatusChange); project.setStatus(status.getCode()); - project.setStage(status.getStage().getCode()); + project.setStage(status.getStage()); projectService.updateById(project); List purchases = purchaseService.listByProjectId(project.getId()); List purchaseStatusChanges = CollUtils.convert(purchases, @@ -163,7 +163,7 @@ public class ProjectChangeStopHelper { .build()); Integer currStatus = change.getBeforeStatus(); projectWrapper.set(Project::getStatus, currStatus); - projectWrapper.set(Project::getStage, ProjectStatus.getNoNull(currStatus).getStage().getCode()); + projectWrapper.set(Project::getStage, ProjectStatus.getNoNull(currStatus).getStage()); projectService.update(projectWrapper); List purchases = purchaseService.listByProjectId(projectId); if (!purchases.isEmpty()) { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/DeclaredRecordManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/DeclaredRecordManage.java index 734bd85..5c63512 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/DeclaredRecordManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/DeclaredRecordManage.java @@ -250,14 +250,9 @@ public class DeclaredRecordManage { item.setReviewAmount(w.getReviewAmount()); item.setApprovedAmount(w.getApprovalAmount()); item.setCreateTime(w.getCreateOn()); - ProjectStatus projectStatus = getDeclaredRecordStatus(w.getStatus()); - item.setStatus(projectStatus.getCode()); - if (projectStatus.equals(ProjectStatus.DECLARED_APPROVED_RECORD_PASSED)) { - // 特殊处理 - item.setStage(ProjectStatus.PROJECT_APPROVED.getCode()); - } else { - item.setStage(projectStatus.getStageCode()); - } + ProjectStatus status = getDeclaredRecordStatus(w.getStatus()); + item.setStatus(status.getCode()); + item.setStage(status.getStage()); return item; }).collect(Collectors.toList()); return PageVo.of(data, page.getTotal()); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/ProjectStatus.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/ProjectStatus.java index 0b178dc..c9f46f0 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/ProjectStatus.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/ProjectStatus.java @@ -23,82 +23,72 @@ public enum ProjectStatus implements IStatus { /** * 项目阶段:未立项 */ - NOT_APPROVED(10000, "未立项"), - TO_BE_DECLARED(10015, "待申报"), + NOT_APPROVED(10000, "未立项", 10000), + TO_BE_DECLARED(10015, "待申报", 10000), /** * 合规性审查 */ - ON_COMPLIANCE_REVIEW(10030, "合规性审查中"), - COMPLIANCE_REVIEW_FAILED(10031, "合规性审查不通过"), + ON_COMPLIANCE_REVIEW(10030, "合规性审查中", 10000), + COMPLIANCE_REVIEW_FAILED(10031, "合规性审查不通过", 10000), /** * 项目评审 */ - WITHOUT_PROJECT_REVIEW(10040, "待项目评审"), - ON_PROJECT_REVIEW(10041, "项目评审中"), - PROJECT_REVIEW_FAILED(10042, "项目评审不通过"), + WITHOUT_PROJECT_REVIEW(10040, "待项目评审", 10000), + ON_PROJECT_REVIEW(10041, "项目评审中", 10000), + PROJECT_REVIEW_FAILED(10042, "项目评审不通过", 10000), - ON_ANNUAL_PLAN(10010, "年度计划中"), + ON_ANNUAL_PLAN(10010, "年度计划中", 10000), /** * 信产项目备案 */ - DECLARED_APPROVED_TO_BE_RECORD(10022, "待立项备案"), - DECLARED_APPROVED_RECORD_AUDITING(10023, "立项备案审核中"), - DECLARED_APPROVED_RECORD_FAILED(10024, "立项备案审核不通过"), - DECLARED_APPROVED_RECORD_PASSED(10025, "立项备案审核通过"), + DECLARED_APPROVED_TO_BE_RECORD(10022, "待立项备案", 10000), + DECLARED_APPROVED_RECORD_AUDITING(10023, "立项备案审核中", 10000), + DECLARED_APPROVED_RECORD_FAILED(10024, "立项备案审核不通过", 10000), + DECLARED_APPROVED_RECORD_PASSED(10025, "立项备案审核通过", 20000), /** * 项目阶段:已立项 */ - PROJECT_APPROVED(20000, "已立项"), - TO_BE_PURCHASED(20001, "待采购"), - ON_PURCHASING(20007, "采购中"), + PROJECT_APPROVED(20000, "已立项", 20000), + TO_BE_PURCHASED(20001, "待采购", 20000), + ON_PURCHASING(20007, "采购中", 20000), - ON_ADAPTING(20010, "适配改造中"), + ON_ADAPTING(20010, "适配改造中", 20000), - TO_BE_FIRST_INSPECTED(20008, "待上传初验材料"), - ON_PILOT_RUNNING(20009, "试运行中"), + TO_BE_FIRST_INSPECTED(20008, "待上传初验材料", 20000), + ON_PILOT_RUNNING(20009, "试运行中", 20000), - ON_FINALLY_INSPECTED(20004, "终验审核中"), - FINALLY_INSPECTED_FAILED(20005, "终验审核不通过"), + ON_FINALLY_INSPECTED(20004, "终验审核中", 20000), + FINALLY_INSPECTED_FAILED(20005, "终验审核不通过", 20000), /** * 项目终止 */ - STOPPED(40000, "项目终止"), - ON_STOPPED_APPLY(40001, "项目终止中"), - STOPPED_PASSED(40002, "项目终止"), + STOPPED(40000, "项目终止", 40000), + ON_STOPPED_APPLY(40001, "项目终止中", 40000), + STOPPED_PASSED(40002, "项目终止", 40000), /** * 项目变更 */ - CHANGE(50000, "项目变更"), - ON_CHANGE_APPLY(50001, "项目变更中"), + CHANGE(50000, "项目变更", 50000), + ON_CHANGE_APPLY(50001, "项目变更中", 50000), /** * 项目阶段:已归档 */ - ARCHIVED(30000, "已归档"), - ACCEPTED(30001, "已验收"); + ARCHIVED(30000, "已归档", 30000), + ACCEPTED(30001, "已验收", 30000); private final Integer code; private final String desc; + private final Integer stage; - /** - * 项目阶段增量 - */ - private static final Integer STAGE_INCR = 10000; - - - public ProjectStatus getStage() { - int stageCode = this.getCode() - this.getCode() % STAGE_INCR; - return getNoNull(stageCode); - } - - public Integer getStageCode() { - return getStage().getCode(); + public boolean isStage() { + return this.getCode().equals(this.getStage()); } public static String getDesc(Integer code) {