Browse Source

feat:

1. 合规性审查通过修改;
tags/24112201
WendyYang 1 month ago
parent
commit
5de51c107d
3 changed files with 27 additions and 18 deletions
  1. +14
    -14
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DeclaredProjectManage.java
  2. +2
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectReviewManage.java
  3. +11
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/IProjectStatusChangeService.java

+ 14
- 14
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DeclaredProjectManage.java View File

@@ -42,6 +42,7 @@ import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus;
import com.hz.pm.api.projectlib.model.req.ProjectListReq; import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO;
import com.hz.pm.api.projectlib.service.IProjectService; import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.projectlib.service.IProjectStatusChangeService;
import com.hz.pm.api.staging.enums.MsgTypeEnum; import com.hz.pm.api.staging.enums.MsgTypeEnum;
import com.hz.pm.api.sys.manage.NoticeManage; import com.hz.pm.api.sys.manage.NoticeManage;
import com.hz.pm.api.sys.manage.ProcessModelManage; import com.hz.pm.api.sys.manage.ProcessModelManage;
@@ -74,6 +75,8 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.BiConsumer; import java.util.function.BiConsumer;
import java.util.stream.Collectors; import java.util.stream.Collectors;


import static com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS;

/** /**
* <p> * <p>
* DeclaredProjectManage * DeclaredProjectManage
@@ -96,6 +99,7 @@ public class DeclaredProjectManage {
private final NoticeManage noticeManage; private final NoticeManage noticeManage;
private final UserInfoHelper userInfoHelper; private final UserInfoHelper userInfoHelper;
private final MhUnitCache mhUnitCache; private final MhUnitCache mhUnitCache;
private final IProjectStatusChangeService projectStatusChangeService;


/** /**
* 新项目 启动实例 * 新项目 启动实例
@@ -374,23 +378,19 @@ public class DeclaredProjectManage {
query.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) query.ne(Project::getStage, ProjectStatus.STOPPED.getCode())
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()) .ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode())
.eq(Project::getNewest, Boolean.TRUE) .eq(Project::getNewest, Boolean.TRUE)
.select(Project::getStatus, Project::getId);
.select(Project::getStatus, Project::getProjectCode, Project::getStage);
List<Project> projects = projectService.list(query); 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());
});
Map<ProjectStatus, Long> countMap = CollUtils.groupCount(projects,
w -> ProjectStatus.getNoNull(w.getStatus()));
DeclaredProgressStatisticsVO stat = new DeclaredProgressStatisticsVO(); DeclaredProgressStatisticsVO stat = new DeclaredProgressStatisticsVO();
stat.setTotalCount(projects.size()); stat.setTotalCount(projects.size());
stat.setTodoCount(countMap.getOrDefault(ProjectStatus.TO_BE_DECLARED, 0L)); stat.setTodoCount(countMap.getOrDefault(ProjectStatus.TO_BE_DECLARED, 0L));
stat.setAuditCount(countMap.getOrDefault(ProjectStatus.ON_COMPLIANCE_REVIEW, 0L)); stat.setAuditCount(countMap.getOrDefault(ProjectStatus.ON_COMPLIANCE_REVIEW, 0L));
stat.setFailedCount(countMap.getOrDefault(ProjectStatus.COMPLIANCE_REVIEW_FAILED, 0L)); stat.setFailedCount(countMap.getOrDefault(ProjectStatus.COMPLIANCE_REVIEW_FAILED, 0L));
stat.setPassedCount(countMap.getOrDefault(ProjectStatus.COMPLIANCE_REVIEW_PASSED, 0L));
if (!projects.isEmpty()) {
List<String> projectCodes = CollUtils.fieldList(projects, Project::getProjectCode);
stat.setPassedCount(projectStatusChangeService.count(projectCodes, COMPLIANCE_REVIEW_PASS));
}
return stat; return stat;
} }


@@ -413,7 +413,7 @@ public class DeclaredProjectManage {
if (status != null) { if (status != null) {
if (ProjectStatus.COMPLIANCE_REVIEW_PASSED.eq(status)) { if (ProjectStatus.COMPLIANCE_REVIEW_PASSED.eq(status)) {
query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE +
" and npsc.event = {0}", ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS);
" and npsc.event = {0}", COMPLIANCE_REVIEW_PASS);
} else { } else {
query.eq(Project::getStatus, status); query.eq(Project::getStatus, status);
} }
@@ -429,8 +429,8 @@ public class DeclaredProjectManage {
ProjectLibListItemVO item = BeanUtil.copyProperties(w, ProjectLibListItemVO.class); ProjectLibListItemVO item = BeanUtil.copyProperties(w, ProjectLibListItemVO.class);
item.setDeclaredAmount(w.getDeclareAmount()); item.setDeclaredAmount(w.getDeclareAmount());
if (!ProjectStatus.TO_BE_DECLARED.eq(w.getStatus()) if (!ProjectStatus.TO_BE_DECLARED.eq(w.getStatus())
&& ProjectStatus.COMPLIANCE_REVIEW_FAILED.eq(w.getStatus())
&& ProjectStatus.ON_COMPLIANCE_REVIEW.eq(w.getStatus())
&& !ProjectStatus.COMPLIANCE_REVIEW_FAILED.eq(w.getStatus())
&& !ProjectStatus.ON_COMPLIANCE_REVIEW.eq(w.getStatus())
&& !ProjectStatus.CHANGE.eq(w.getStage())) { && !ProjectStatus.CHANGE.eq(w.getStage())) {
item.setStatus(ProjectStatus.COMPLIANCE_REVIEW_PASSED.getCode()); item.setStatus(ProjectStatus.COMPLIANCE_REVIEW_PASSED.getCode());
} }


+ 2
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectReviewManage.java View File

@@ -287,6 +287,8 @@ public class ProjectReviewManage {
} else if (ProjectStatus.EXPERT_REVIEW_FAILED.eq(status)) { } else if (ProjectStatus.EXPERT_REVIEW_FAILED.eq(status)) {
query.in(Project::getStatus, ProjectStatus.EXPERT_REVIEW_FAILED.getCode(), query.in(Project::getStatus, ProjectStatus.EXPERT_REVIEW_FAILED.getCode(),
ProjectStatus.EXPERT_REVIEW_AFTER_MODIFY.getCode()); ProjectStatus.EXPERT_REVIEW_AFTER_MODIFY.getCode());
} else {
query.eq(Project::getStatus, status);
} }
} else { } else {
query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE +


+ 11
- 4
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/IProjectStatusChangeService.java View File

@@ -1,7 +1,9 @@
package com.hz.pm.api.projectlib.service; package com.hz.pm.api.projectlib.service;


import cn.hutool.core.map.MapUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.hz.pm.api.common.model.constant.BizConst; import com.hz.pm.api.common.model.constant.BizConst;
@@ -10,10 +12,7 @@ import com.hz.pm.api.common.util.BizUtils;
import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange; import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange;
import com.ningdatech.basic.util.CollUtils; import com.ningdatech.basic.util.CollUtils;


import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.*;


/** /**
* <p> * <p>
@@ -89,4 +88,12 @@ public interface IProjectStatusChangeService extends IService<ProjectStatusChang
Comparator.comparing(ProjectStatusChange::getCreateOn).reversed()); Comparator.comparing(ProjectStatusChange::getCreateOn).reversed());
} }


default long count(Collection<String> projectCodes, ProjectStateChangeEvent event) {
QueryWrapper<ProjectStatusChange> query = Wrappers.query();
query.select("count(distinct project_code) cnt")
.in("project_code", projectCodes)
.eq("event", event);
return MapUtil.getLong(getMap(query), "cnt");
}

} }

Loading…
Cancel
Save