From f993f50d67eb596d562c103ce80b58f3c2d2ed4b Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 2 Sep 2024 15:51:47 +0800 Subject: [PATCH] =?UTF-8?q?modify:=201.=20=E9=A1=B9=E7=9B=AE=E7=94=B3?= =?UTF-8?q?=E6=8A=A5=E5=88=97=E8=A1=A8=E3=80=81=E8=AF=84=E5=AE=A1=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=9F=A5=E8=AF=A2=E6=8C=89=E7=85=A7=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DeclaredProjectController.java | 7 ++++ .../controller/ProjectReviewController.java | 7 ++++ .../manage/DeclaredProjectManage.java | 33 +++++++++++++++++- .../manage/ProjectReviewManage.java | 40 ++++++++++++++++++++++ .../model/vo/DeclaredProgressStatisticsVO.java | 29 ++++++++++++++++ .../model/vo/ReviewProgressStatisticsVO.java | 30 ++++++++++++++++ 6 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/DeclaredProgressStatisticsVO.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/ReviewProgressStatisticsVO.java diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/DeclaredProjectController.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/DeclaredProjectController.java index 0cea211..15b390b 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/DeclaredProjectController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/DeclaredProjectController.java @@ -6,6 +6,7 @@ import com.hz.pm.api.projectdeclared.model.dto.DeclaredProjectListParamDTO; import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; import com.hz.pm.api.projectdeclared.model.dto.ProjectDraftSaveDTO; import com.hz.pm.api.projectdeclared.model.enumerization.ProjectDraftTypeEnum; +import com.hz.pm.api.projectdeclared.model.vo.DeclaredProgressStatisticsVO; import com.hz.pm.api.projectdeclared.model.vo.ProjectDraftVO; import com.hz.pm.api.projectlib.model.req.ProjectListReq; import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; @@ -44,6 +45,12 @@ public class DeclaredProjectController { return declaredProjectManage.projectLibList(req); } + @GetMapping("/progressStatistics") + @ApiOperation("项目申报进度统计") + public DeclaredProgressStatisticsVO progressStatistics(@ModelAttribute ProjectListReq req) { + return declaredProjectManage.declaredProgressStatistics(req); + } + @ApiOperation(value = "申报项目草稿箱列表", notes = "申报项目草稿箱列表") @GetMapping("/draft") public PageVo draft(@ModelAttribute DeclaredProjectListParamDTO params) { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ProjectReviewController.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ProjectReviewController.java index 60da2fa..89c38f5 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ProjectReviewController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/ProjectReviewController.java @@ -3,6 +3,7 @@ package com.hz.pm.api.projectdeclared.controller; import com.hz.pm.api.meeting.entity.dto.ProjectReviewResultDTO; import com.hz.pm.api.projectdeclared.manage.ProjectReviewManage; import com.hz.pm.api.projectdeclared.model.req.ProjectReviewApplyReq; +import com.hz.pm.api.projectdeclared.model.vo.ReviewProgressStatisticsVO; import com.hz.pm.api.projectlib.model.req.ProjectListReq; import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; import com.ningdatech.basic.model.PageVo; @@ -47,4 +48,10 @@ public class ProjectReviewController { return projectReviewManage.pageReviewProject(req); } + @GetMapping("/progressStatistics") + @ApiOperation("评审项目进度统计") + public ReviewProgressStatisticsVO progressStatistics(ProjectListReq req) { + return projectReviewManage.reviewProjectProgressStatistics(req); + } + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DeclaredProjectManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DeclaredProjectManage.java index 87ad223..ec5f548 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DeclaredProjectManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DeclaredProjectManage.java @@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Assert; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.hz.pm.api.common.enumeration.BoolDisplayEnum; import com.hz.pm.api.common.enumeration.CommonEnum; import com.hz.pm.api.common.enumeration.ProjectProcessType; import com.hz.pm.api.common.helper.UserInfoHelper; @@ -28,6 +27,7 @@ import com.hz.pm.api.external.model.enumeration.MhUnitTypeEnum; import com.hz.pm.api.projectdeclared.model.dto.*; import com.hz.pm.api.projectdeclared.model.entity.ProjectDraft; import com.hz.pm.api.projectdeclared.model.enumerization.ProjectDraftTypeEnum; +import com.hz.pm.api.projectdeclared.model.vo.DeclaredProgressStatisticsVO; import com.hz.pm.api.projectdeclared.model.vo.ProjectDraftVO; import com.hz.pm.api.projectdeclared.service.IProjectDraftService; import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil; @@ -347,6 +347,37 @@ public class DeclaredProjectManage { return draft.getId(); } + + public DeclaredProgressStatisticsVO declaredProgressStatistics(ProjectListReq req) { + req.setStatus(null); + UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); + LambdaQueryWrapper query = ProjectManageUtil.projectQuery(req); + // 当非预审申报的时候 是自己单位 当是预审申报的时候 要主管单位 + if (!projectQueryPermission(query, user, req.getDeclaredUnitId())) { + return null; + } + query.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) + .eq(Project::getNewest, Boolean.TRUE) + .select(Project::getStatus, Project::getId); + List projects = projectService.list(query); + Map countMap = CollUtils.groupCount(projects, w -> { + if (!ProjectStatus.TO_BE_DECLARED.eq(w.getStatus()) + && !ProjectStatus.COMPLIANCE_REVIEW_FAILED.eq(w.getStatus()) + && !ProjectStatus.ON_COMPLIANCE_REVIEW.eq(w.getStatus()) + && !ProjectStatus.CHANGE.eq(w.getStage())) { + return ProjectStatus.COMPLIANCE_REVIEW_PASSED; + } + return ProjectStatus.getNoNull(w.getStatus()); + }); + DeclaredProgressStatisticsVO stat = new DeclaredProgressStatisticsVO(); + stat.setTotalCount(projects.size()); + stat.setAuditCount(countMap.getOrDefault(ProjectStatus.ON_COMPLIANCE_REVIEW, 0L)); + stat.setFailedCount(countMap.getOrDefault(ProjectStatus.COMPLIANCE_REVIEW_FAILED, 0L)); + stat.setPassedCount(countMap.getOrDefault(ProjectStatus.COMPLIANCE_REVIEW_PASSED, 0L)); + return stat; + } + + /** * 项目列表 * diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectReviewManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectReviewManage.java index abd668f..096edd9 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectReviewManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectReviewManage.java @@ -15,6 +15,7 @@ import com.hz.pm.api.datascope.utils.DataScopeUtil; import com.hz.pm.api.meeting.entity.dto.ProjectReviewResultDTO; import com.hz.pm.api.projectdeclared.model.entity.ProjectReview; import com.hz.pm.api.projectdeclared.model.req.ProjectReviewApplyReq; +import com.hz.pm.api.projectdeclared.model.vo.ReviewProgressStatisticsVO; import com.hz.pm.api.projectdeclared.service.IProjectReviewService; import com.hz.pm.api.projectlib.helper.ProjectManageUtil; import com.hz.pm.api.projectlib.model.entity.Project; @@ -126,6 +127,45 @@ public class ProjectReviewManage { * @param req \ * @return \ */ + public ReviewProgressStatisticsVO reviewProjectProgressStatistics(ProjectListReq req) { + UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); + LambdaQueryWrapper query = ProjectManageUtil.initQuery(); + if (!projectQueryPermission(query, user, req.getDeclaredUnitId())) { + return null; + } + req.setStatus(null); + ProjectManageUtil.projectQuery(query, req); + query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + + " and npsc.event = {0}", ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS) + .ne(Project::getStage, ProjectStatus.STOPPED.getCode()) + .eq(Project::getNewest, Boolean.TRUE) + .select(Project::getStatus, Project::getId); + List projects = projectService.list(query); + Map countMap = CollUtils.groupCount(projects, w -> { + if (!ProjectStatus.PROJECT_REVIEW_FAILED.eq(w.getStatus()) + && !ProjectStatus.COMPLIANCE_REVIEW_PASSED.eq(w.getStatus()) + && !ProjectStatus.WITHOUT_PROJECT_REVIEW.eq(w.getStatus()) + && !ProjectStatus.ON_PROJECT_REVIEW.eq(w.getStatus()) + && !ProjectStatus.CHANGE.eq(w.getStage())) { + return ProjectStatus.PROJECT_REVIEW_PASSED; + } + return ProjectStatus.getNoNull(w.getStatus()); + }); + return ReviewProgressStatisticsVO.builder() + .totalCount(projects.size()) + .todoCount(countMap.getOrDefault(ProjectStatus.WITHOUT_PROJECT_REVIEW, 0L)) + .auditCount(countMap.getOrDefault(ProjectStatus.ON_PROJECT_REVIEW, 0L)) + .passedCount(countMap.getOrDefault(ProjectStatus.COMPLIANCE_REVIEW_PASSED, 0L)) + .failedCount(countMap.getOrDefault(ProjectStatus.PROJECT_REVIEW_FAILED, 0L)) + .build(); + } + + /** + * 项目列表 + * + * @param req \ + * @return \ + */ public PageVo pageReviewProject(ProjectListReq req) { UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); LambdaQueryWrapper query = ProjectManageUtil.initQuery(); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/DeclaredProgressStatisticsVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/DeclaredProgressStatisticsVO.java new file mode 100644 index 0000000..c95c2fb --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/DeclaredProgressStatisticsVO.java @@ -0,0 +1,29 @@ +package com.hz.pm.api.projectdeclared.model.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + *

+ * DeclaredProgressStatisticsVO + *

+ * + * @author WendyYang + * @since 15:23 2024/9/2 + */ +@Data +public class DeclaredProgressStatisticsVO { + + @ApiModelProperty("总数") + private Integer totalCount; + + @ApiModelProperty("待审核") + private Long auditCount; + + @ApiModelProperty("已通过") + private Long passedCount; + + @ApiModelProperty("未通过") + private Long failedCount; + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/ReviewProgressStatisticsVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/ReviewProgressStatisticsVO.java new file mode 100644 index 0000000..e1f609e --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/ReviewProgressStatisticsVO.java @@ -0,0 +1,30 @@ +package com.hz.pm.api.projectdeclared.model.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; + +/** + *

+ * ProjectReviewProgressStatisticsVO + *

+ * + * @author WendyYang + * @since 15:34 2024/9/2 + */ +@Data +@Builder +public class ReviewProgressStatisticsVO { + + @ApiModelProperty("总数") + private Integer totalCount; + @ApiModelProperty("待提交") + private Long todoCount; + @ApiModelProperty("审核中") + private Long auditCount; + @ApiModelProperty("已通过") + private Long passedCount; + @ApiModelProperty("未通过") + private Long failedCount; + +}