@@ -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<ProjectDraftVO> draft(@ModelAttribute DeclaredProjectListParamDTO params) { | |||
@@ -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); | |||
} | |||
} |
@@ -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<Project> 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<Project> projects = projectService.list(query); | |||
Map<ProjectStatus, Long> 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; | |||
} | |||
/** | |||
* 项目列表 | |||
* | |||
@@ -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<Project> 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<Project> projects = projectService.list(query); | |||
Map<ProjectStatus, Long> 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<ProjectLibListItemVO> pageReviewProject(ProjectListReq req) { | |||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | |||
LambdaQueryWrapper<Project> query = ProjectManageUtil.initQuery(); | |||
@@ -0,0 +1,29 @@ | |||
package com.hz.pm.api.projectdeclared.model.vo; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
/** | |||
* <p> | |||
* DeclaredProgressStatisticsVO | |||
* </p> | |||
* | |||
* @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; | |||
} |
@@ -0,0 +1,30 @@ | |||
package com.hz.pm.api.projectdeclared.model.vo; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Builder; | |||
import lombok.Data; | |||
/** | |||
* <p> | |||
* ProjectReviewProgressStatisticsVO | |||
* </p> | |||
* | |||
* @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; | |||
} |