Browse Source

项目申报修改

tags/24080901
WendyYang 6 months ago
parent
commit
0d8a50a2bf
3 changed files with 75 additions and 8 deletions
  1. +6
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/DeclaredProjectController.java
  2. +5
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DeclaredProjectHelper.java
  3. +64
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DeclaredProjectManage.java

+ 6
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/DeclaredProjectController.java View File

@@ -98,4 +98,10 @@ public class DeclaredProjectController {
ExcelDownUtil.downXls(response, req, declaredProjectManage::exportList);
}

@ApiOperation(value = "初始化状态变更记录", hidden = true)
@GetMapping("/initStateChangeRecord")
public void initStateChangeRecord() {
declaredProjectManage.initStateChangeRecord();
}

}

+ 5
- 4
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DeclaredProjectHelper.java View File

@@ -2,6 +2,7 @@ package com.hz.pm.api.projectdeclared.manage;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -105,10 +106,10 @@ public class DeclaredProjectHelper {
BigDecimal haveAmount = projectInfo.getDeclareHaveAmount();
BigDecimal otherAmount = projectInfo.getDeclareOtherAmount();
return govSuperFinanceAmount
.add(govOwnFinanceAmount)
.add(bankLendingAmount)
.add(haveAmount)
.add(otherAmount);
.add(ObjectUtil.defaultIfNull(govOwnFinanceAmount, BigDecimal.ZERO))
.add(ObjectUtil.defaultIfNull(bankLendingAmount, BigDecimal.ZERO))
.add(ObjectUtil.defaultIfNull(haveAmount, BigDecimal.ZERO))
.add(ObjectUtil.defaultIfNull(otherAmount, BigDecimal.ZERO));
}

public ProcessInstanceUserDto buildUser(UserFullInfoDTO user) {


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

@@ -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);
}
}

}

Loading…
Cancel
Save