|
|
@@ -15,6 +15,7 @@ import com.hz.pm.api.common.enumeration.CommonEnum; |
|
|
|
import com.hz.pm.api.common.enumeration.ProjectProcessType; |
|
|
|
import com.hz.pm.api.common.helper.UserInfoHelper; |
|
|
|
import com.hz.pm.api.common.model.constant.TypeReferenceConst; |
|
|
|
import com.hz.pm.api.common.statemachine.event.ProjectStateChangeEvent; |
|
|
|
import com.hz.pm.api.common.util.ExcelDownUtil; |
|
|
|
import com.hz.pm.api.common.util.ExcelExportStyle; |
|
|
|
import com.hz.pm.api.external.model.enumeration.MhUnitTypeEnum; |
|
|
@@ -23,18 +24,23 @@ 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.ProjectDraftVO; |
|
|
|
import com.hz.pm.api.projectdeclared.service.IProjectDraftService; |
|
|
|
import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil; |
|
|
|
import com.hz.pm.api.projectlib.helper.ProjectManageUtil; |
|
|
|
import com.hz.pm.api.projectlib.manage.ProjectLibManage; |
|
|
|
import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO; |
|
|
|
import com.hz.pm.api.projectlib.model.dto.ProjectDTO; |
|
|
|
import com.hz.pm.api.projectlib.model.dto.ProjectPaymentPlanDTO; |
|
|
|
import com.hz.pm.api.projectlib.model.entity.MhProject; |
|
|
|
import com.hz.pm.api.projectlib.model.entity.Project; |
|
|
|
import com.hz.pm.api.projectlib.model.entity.ProjectApplication; |
|
|
|
import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange; |
|
|
|
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum; |
|
|
|
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.IMhProjectService; |
|
|
|
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; |
|
|
@@ -63,10 +69,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.IOException; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
@@ -92,6 +95,8 @@ public class DeclaredProjectManage { |
|
|
|
private final NoticeManage noticeManage; |
|
|
|
private final UserInfoHelper userInfoHelper; |
|
|
|
private final MhUnitCache mhUnitCache; |
|
|
|
private final IMhProjectService mhProjectService; |
|
|
|
private final IProjectStatusChangeService projectStatusChangeService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 新项目 启动实例 |
|
|
@@ -401,4 +406,59 @@ public class DeclaredProjectManage { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void initStateChangeRecord() { |
|
|
|
List<MhProject> projects = mhProjectService.list(); |
|
|
|
for (MhProject project : projects) { |
|
|
|
if (project.getProjectCode() == null) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
Project proj = projectService.getProjectByCode(project.getProjectCode()); |
|
|
|
if (proj == null) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
projectStatusChangeService.remove(Wrappers.lambdaQuery(ProjectStatusChange.class) |
|
|
|
.in(ProjectStatusChange::getEvent, |
|
|
|
ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT, |
|
|
|
ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS, |
|
|
|
ProjectStateChangeEvent.PROJECT_REVIEW_SUBMIT, |
|
|
|
ProjectStateChangeEvent.PROJECT_REVIEW_PASS) |
|
|
|
.eq(ProjectStatusChange::getProjectCode, project.getProjectCode())); |
|
|
|
List<ProjectStatusChange> changes = new ArrayList<>(); |
|
|
|
changes.add(new ProjectStatusChange() {{ |
|
|
|
setAfterStatus(ProjectStatus.ON_COMPLIANCE_REVIEW.getCode()); |
|
|
|
setBeforeStatus(ProjectStatus.TO_BE_DECLARED.getCode()); |
|
|
|
setEvent(ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT.name()); |
|
|
|
setCreateOn(proj.getCreateOn()); |
|
|
|
setProjectCode(project.getProjectCode()); |
|
|
|
setProjectId(ProjectIdCodeCacheUtil.newest(project.getProjectCode())); |
|
|
|
}}); |
|
|
|
changes.add(new ProjectStatusChange() {{ |
|
|
|
setAfterStatus(ProjectStatus.WITHOUT_PROJECT_REVIEW.getCode()); |
|
|
|
setBeforeStatus(ProjectStatus.ON_COMPLIANCE_REVIEW.getCode()); |
|
|
|
setEvent(ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS.name()); |
|
|
|
setCreateOn(proj.getCreateOn().plusMinutes(1)); |
|
|
|
setProjectCode(project.getProjectCode()); |
|
|
|
setProjectId(ProjectIdCodeCacheUtil.newest(project.getProjectCode())); |
|
|
|
}}); |
|
|
|
changes.add(new ProjectStatusChange() {{ |
|
|
|
setAfterStatus(ProjectStatus.ON_PROJECT_REVIEW.getCode()); |
|
|
|
setBeforeStatus(ProjectStatus.WITHOUT_PROJECT_REVIEW.getCode()); |
|
|
|
setEvent(ProjectStateChangeEvent.PROJECT_REVIEW_SUBMIT.name()); |
|
|
|
setCreateOn(proj.getCreateOn().plusMinutes(2)); |
|
|
|
setProjectCode(project.getProjectCode()); |
|
|
|
setProjectId(ProjectIdCodeCacheUtil.newest(project.getProjectCode())); |
|
|
|
}}); |
|
|
|
changes.add(new ProjectStatusChange() {{ |
|
|
|
setAfterStatus(ProjectStatus.ON_ANNUAL_PLAN.getCode()); |
|
|
|
setBeforeStatus(ProjectStatus.ON_PROJECT_REVIEW.getCode()); |
|
|
|
setEvent(ProjectStateChangeEvent.PROJECT_REVIEW_PASS.name()); |
|
|
|
setCreateOn(proj.getCreateOn().plusMinutes(3)); |
|
|
|
setProjectCode(project.getProjectCode()); |
|
|
|
setProjectId(ProjectIdCodeCacheUtil.newest(project.getProjectCode())); |
|
|
|
}}); |
|
|
|
projectStatusChangeService.saveBatch(changes); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |