소스 검색

Merge remote-tracking branch 'origin/master'

master
WendyYang 1 년 전
부모
커밋
52708b9d2b
5개의 변경된 파일37개의 추가작업 그리고 5개의 파일을 삭제
  1. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/constant/ProjectDeclareConst.java
  2. +5
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareChoiceAction.java
  3. +3
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/factory/ProjectDeclareGuardFactory.java
  4. +3
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/StateMachineUtils.java
  5. +23
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/constant/ProjectDeclareConst.java 파일 보기

@@ -158,6 +158,9 @@ public interface ProjectDeclareConst {
class Number {
public static final BigDecimal DECLARE_AMOUNT_JUDGEMENT = BigDecimal.valueOf(1000);

//区县是500万
public static final BigDecimal DECLARE_COUNTY_AMOUNT_JUDGEMENT = BigDecimal.valueOf(500);

public static final Integer COUNTRY_BUILD_LEVEL = 1;
public static final Integer PROVINCE_BUILD_LEVEL = 2;
public static final Integer PROVINCE_SELF_BUILD_LEVEL = 3;


+ 5
- 2
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareChoiceAction.java 파일 보기

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.common.statemachine.action;

import com.ningdatech.pmapi.common.constant.ProjectDeclareConst;
import com.ningdatech.pmapi.common.constant.StateMachineConst;
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils;
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
@@ -39,7 +40,8 @@ public class ProjectDeclareChoiceAction implements Action<ProjectStatusEnum, Pro
private void preDeclareChoice(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) {
Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class);
log.info("预审申报事件之前,项目的状态为:{}"+project.getStatus());
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project)){
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project,
ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)){
project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode());
}else {
project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode());
@@ -49,7 +51,8 @@ public class ProjectDeclareChoiceAction implements Action<ProjectStatusEnum, Pro
private void preWithDrawChoice(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) {
Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class);
log.info("预审中撤回事件之前,项目的状态为:{}"+project.getStatus());
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project)){
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project,
ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)){
project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode());
}else {
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());


+ 3
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/factory/ProjectDeclareGuardFactory.java 파일 보기

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.common.statemachine.factory;

import com.ningdatech.pmapi.common.constant.ProjectDeclareConst;
import com.ningdatech.pmapi.common.constant.StateMachineConst;
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils;
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
@@ -23,7 +24,8 @@ public class ProjectDeclareGuardFactory {
public boolean evaluate(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> context) {
Project project = context.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class);
// 判断申报项目是否是市级项目,且申报金额是否大于等于1000万元
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project)){
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project,
ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)){
return true;
}
return false;


+ 3
- 2
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/StateMachineUtils.java 파일 보기

@@ -20,6 +20,7 @@ import org.springframework.statemachine.persist.StateMachinePersister;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Objects;

@@ -101,8 +102,8 @@ public class StateMachineUtils {
* @author CMM
* @since 2023/02/07 17:13
*/
public static boolean judgeDeclareAmount(Project project) {
int flag = project.getDeclareAmount().compareTo(ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT);
public static boolean judgeDeclareAmount(Project project, BigDecimal targetAmount) {
int flag = project.getDeclareAmount().compareTo(targetAmount);
if (flag > 0 || flag == 0) {
return true;
}


+ 23
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java 파일 보기

@@ -7,6 +7,10 @@ import java.util.*;
import java.util.stream.Collectors;

import com.google.common.collect.Lists;
import com.ningdatech.file.service.FileService;
import com.ningdatech.pmapi.common.constant.ProjectDeclareConst;
import com.ningdatech.pmapi.projectdeclared.converter.ApplicationConverter;
import com.ningdatech.pmapi.provincial.service.IJoinReviewProvincialBureauService;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.flowable.engine.HistoryService;
@@ -74,6 +78,10 @@ public class HandlerManage {
private final NoticeManage noticeManage;
private final DeclaredProjectManage declaredProjectManage;

private final FileService fileService;

private final IJoinReviewProvincialBureauService joinReviewProvincialBureauService;

/**
* 审核通过后 所处理的逻辑
* @param declaredProject
@@ -127,6 +135,21 @@ public class HandlerManage {
// 当前项目状态是单位内部审核中
case UNDER_INTERNAL_AUDIT:
// 当前项目状态是部门联审中
//如果是 区县 并且 500万及以上要推送省局重大项目
if(!StateMachineUtils.isCityProject(declaredProject) &&
StateMachineUtils.judgeDeclareAmount(declaredProject,
ProjectDeclareConst.Number.DECLARE_COUNTY_AMOUNT_JUDGEMENT) ){
try{
List<ProjectApplication> applications = projectApplicationService
.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId,declaredProject.getId()));
joinReviewProvincialBureauService.pushImportProject(
ApplicationConverter.convertProject(declaredProject,applications,fileService));
}catch (Exception e){
log.info("区县推送省级联审失败[{}],{}", declaredProject.getProjectName() ,e.getMessage());
log.error("区县推送省级联审失败:" + e);
}
}
case DEPARTMENT_JOINT_REVIEW:
// 当前项目状态是方案评审中
case SCHEME_UNDER_REVIEW:


불러오는 중...
취소
저장