|
|
@@ -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.vo.ProjectLibListItemVO; |
|
|
|
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.sys.manage.NoticeManage; |
|
|
|
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.stream.Collectors; |
|
|
|
|
|
|
|
import static com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS; |
|
|
|
|
|
|
|
/** |
|
|
|
* <p> |
|
|
|
* DeclaredProjectManage |
|
|
@@ -96,6 +99,7 @@ public class DeclaredProjectManage { |
|
|
|
private final NoticeManage noticeManage; |
|
|
|
private final UserInfoHelper userInfoHelper; |
|
|
|
private final MhUnitCache mhUnitCache; |
|
|
|
private final IProjectStatusChangeService projectStatusChangeService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 新项目 启动实例 |
|
|
@@ -374,23 +378,19 @@ public class DeclaredProjectManage { |
|
|
|
query.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) |
|
|
|
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()) |
|
|
|
.eq(Project::getNewest, Boolean.TRUE) |
|
|
|
.select(Project::getStatus, Project::getId); |
|
|
|
.select(Project::getStatus, Project::getProjectCode, Project::getStage); |
|
|
|
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(); |
|
|
|
stat.setTotalCount(projects.size()); |
|
|
|
stat.setTodoCount(countMap.getOrDefault(ProjectStatus.TO_BE_DECLARED, 0L)); |
|
|
|
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)); |
|
|
|
if (!projects.isEmpty()) { |
|
|
|
List<String> projectCodes = CollUtils.fieldList(projects, Project::getProjectCode); |
|
|
|
stat.setPassedCount(projectStatusChangeService.count(projectCodes, COMPLIANCE_REVIEW_PASS)); |
|
|
|
} |
|
|
|
return stat; |
|
|
|
} |
|
|
|
|
|
|
@@ -413,7 +413,7 @@ public class DeclaredProjectManage { |
|
|
|
if (status != null) { |
|
|
|
if (ProjectStatus.COMPLIANCE_REVIEW_PASSED.eq(status)) { |
|
|
|
query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + |
|
|
|
" and npsc.event = {0}", ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS); |
|
|
|
" and npsc.event = {0}", COMPLIANCE_REVIEW_PASS); |
|
|
|
} else { |
|
|
|
query.eq(Project::getStatus, status); |
|
|
|
} |
|
|
@@ -429,8 +429,8 @@ public class DeclaredProjectManage { |
|
|
|
ProjectLibListItemVO item = BeanUtil.copyProperties(w, ProjectLibListItemVO.class); |
|
|
|
item.setDeclaredAmount(w.getDeclareAmount()); |
|
|
|
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())) { |
|
|
|
item.setStatus(ProjectStatus.COMPLIANCE_REVIEW_PASSED.getCode()); |
|
|
|
} |
|
|
|