Просмотр исходного кода

立项批复修复

tags/24080901
WendyYang 7 месяцев назад
Родитель
Сommit
0f435e05b2
1 измененных файлов: 39 добавлений и 40 удалений
  1. +39
    -40
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/ProjectApprovalHandle.java

+ 39
- 40
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/stage/ProjectApprovalHandle.java Просмотреть файл

@@ -13,9 +13,9 @@ import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.service.IProjectInstService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.projectlib.service.IProjectStatusChangeService;
import com.hz.pm.api.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import com.wflow.workflow.enums.ProcessStatusEnum;
import com.wflow.workflow.enums.StepStatusEnum;
import com.wflow.workflow.service.ProcessInstanceService;
import lombok.RequiredArgsConstructor;
@@ -39,7 +39,6 @@ public class ProjectApprovalHandle extends AbstractProcessHandle {
private final IProjectService projectService;
private final IProjectInstService projectInstService;
private final ProcessInstanceService processInstanceService;
private final BuildUserUtils buildUserUtils;

@Override
public ProcessNode getProcessNode() {
@@ -51,52 +50,52 @@ public class ProjectApprovalHandle extends AbstractProcessHandle {
ProcessDetailVO detail = new ProcessDetailVO();
detail.setProcessName(getProcessNode().getName());
ctx.getProcessDetails().add(detail);
//查出历史版本的 所有项目ID
Project project = ctx.getProject();
Integer status = project.getStatus();
if (Objects.isNull(status)) {
return;
}
// 项目状态为待立项批复之前的状态
if (status < ProjectStatusEnum.TO_BE_APPROVED.getCode()
&& status < ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD.getCode()) {
if (status == null || (status < ProjectStatusEnum.TO_BE_APPROVED.getCode()
&& status < ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD.getCode())) {
detail.setStepStatus(StepStatusEnum.NOT_START);
return;
}
List<Long> projectIds = projectService.allVersionProjectIds(project.getProjectCode());
// 当前项目状态为待立项批复
if (ProjectStatusEnum.TO_BE_APPROVED.eq(status)
|| ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD.eq(status)
|| ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING.eq(status)) {
// 根据建设方案评审通过的时间获取
final List<ProjectStateChangeEvent> events = Arrays.asList(ProjectStateChangeEvent.PLAN_REVIEW_PASS,
ProjectStateChangeEvent.DECLARED_RECORD_SUBMIT,
ProjectStateChangeEvent.DECLARED_RECORD_RESUBMIT);
ProjectStatusChange projectStatusChange = projectStatusChangeService.getLastOne(projectIds, events);
if (projectStatusChange != null) {
detail.setFinishTime(projectStatusChange.getCreateOn());
}
detail.setStepStatus(StepStatusEnum.ON_GOING);
} else {
// 取 状态机 改变状态时间
final List<ProjectStateChangeEvent> events = Arrays.asList(ProjectStateChangeEvent.PLAN_REVIEW_PASS,
ProjectStateChangeEvent.DECLARED_RECORD_FAILED,
ProjectStateChangeEvent.DECLARED_RECORD_PASS);
ProjectStatusChange projectStatusChange = projectStatusChangeService.getLastOne(projectIds, events);
if (Objects.nonNull(projectStatusChange)) {
detail.setFinishTime(projectStatusChange.getCreateOn());
detail.setStepStatus(StepStatusEnum.COMPLETED);
ProjectInst inst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIds)
.eq(ProjectInst::getInstType, InstTypeEnum.DECLARED_RECORD.getCode())
.orderByDesc(ProjectInst::getCreateOn)
.last(BizConst.LIMIT_1));
if (inst != null) {
ProcessProgressVo instDetail = processInstanceService.getProgressInstanceDetail(null, inst.getInstCode());
detail.setProcessProgressVo(instDetail);
List<Long> projectIds = projectService.allVersionProjectIds(project.getProjectCode());
// 当前项目状态为待立项批复
if (ProjectStatusEnum.TO_BE_APPROVED.eq(status)
|| ProjectStatusEnum.DECLARED_APPROVED_TO_BE_RECORD.eq(status)
|| ProjectStatusEnum.DECLARED_APPROVED_RECORD_AUDITING.eq(status)) {
// 根据建设方案评审通过的时间获取
final List<ProjectStateChangeEvent> events = Arrays.asList(ProjectStateChangeEvent.PLAN_REVIEW_PASS,
ProjectStateChangeEvent.DECLARED_RECORD_SUBMIT,
ProjectStateChangeEvent.DECLARED_RECORD_RESUBMIT);
ProjectStatusChange projectStatusChange = projectStatusChangeService.getLastOne(projectIds, events);
if (projectStatusChange != null) {
detail.setFinishTime(projectStatusChange.getCreateOn());
}
detail.setStepStatus(StepStatusEnum.ON_GOING);
} else {
// 取 状态机 改变状态时间
final List<ProjectStateChangeEvent> events = Arrays.asList(ProjectStateChangeEvent.PLAN_REVIEW_PASS,
ProjectStateChangeEvent.DECLARED_RECORD_FAILED,
ProjectStateChangeEvent.DECLARED_RECORD_PASS);
ProjectStatusChange projectStatusChange = projectStatusChangeService.getLastOne(projectIds, events);
if (Objects.nonNull(projectStatusChange)) {
detail.setFinishTime(projectStatusChange.getCreateOn());
detail.setStepStatus(StepStatusEnum.COMPLETED);
ProjectInst inst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIds)
.eq(ProjectInst::getInstType, InstTypeEnum.DECLARED_RECORD.getCode())
.orderByDesc(ProjectInst::getCreateOn)
.last(BizConst.LIMIT_1));
if (inst != null) {
ProcessProgressVo instDetail = processInstanceService.getProgressInstanceDetail(null, inst.getInstCode());
detail.setProcessProgressVo(instDetail);
if (ProcessStatusEnum.BE_REJECTED.getDesc().equals(instDetail.getStatus())) {
detail.setStepStatus(StepStatusEnum.REJECTED);
}
}
}
}
}
ctx.setPreStepStatus(detail.getStepStatus());
}

@Override


Загрузка…
Отмена
Сохранить