@@ -158,6 +158,9 @@ public interface ProjectDeclareConst { | |||||
class Number { | class Number { | ||||
public static final BigDecimal DECLARE_AMOUNT_JUDGEMENT = BigDecimal.valueOf(1000); | 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 COUNTRY_BUILD_LEVEL = 1; | ||||
public static final Integer PROVINCE_BUILD_LEVEL = 2; | public static final Integer PROVINCE_BUILD_LEVEL = 2; | ||||
public static final Integer PROVINCE_SELF_BUILD_LEVEL = 3; | public static final Integer PROVINCE_SELF_BUILD_LEVEL = 3; | ||||
@@ -1,5 +1,6 @@ | |||||
package com.ningdatech.pmapi.common.statemachine.action; | 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.constant.StateMachineConst; | ||||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | ||||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | 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) { | private void preDeclareChoice(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) { | ||||
Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class); | Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class); | ||||
log.info("预审申报事件之前,项目的状态为:{}"+project.getStatus()); | 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()); | project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()); | ||||
}else { | }else { | ||||
project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode()); | project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode()); | ||||
@@ -49,7 +51,8 @@ public class ProjectDeclareChoiceAction implements Action<ProjectStatusEnum, Pro | |||||
private void preWithDrawChoice(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) { | private void preWithDrawChoice(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) { | ||||
Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class); | Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class); | ||||
log.info("预审中撤回事件之前,项目的状态为:{}"+project.getStatus()); | 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()); | project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode()); | ||||
}else { | }else { | ||||
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); | project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); | ||||
@@ -1,5 +1,6 @@ | |||||
package com.ningdatech.pmapi.common.statemachine.factory; | 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.constant.StateMachineConst; | ||||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | ||||
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; | ||||
@@ -23,7 +24,8 @@ public class ProjectDeclareGuardFactory { | |||||
public boolean evaluate(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> context) { | public boolean evaluate(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> context) { | ||||
Project project = context.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class); | Project project = context.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class); | ||||
// 判断申报项目是否是市级项目,且申报金额是否大于等于1000万元 | // 判断申报项目是否是市级项目,且申报金额是否大于等于1000万元 | ||||
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project)){ | |||||
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project, | |||||
ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)){ | |||||
return true; | return true; | ||||
} | } | ||||
return false; | return false; | ||||
@@ -20,6 +20,7 @@ import org.springframework.statemachine.persist.StateMachinePersister; | |||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import javax.annotation.Resource; | import javax.annotation.Resource; | ||||
import java.math.BigDecimal; | |||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.Objects; | import java.util.Objects; | ||||
@@ -101,8 +102,8 @@ public class StateMachineUtils { | |||||
* @author CMM | * @author CMM | ||||
* @since 2023/02/07 17:13 | * @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) { | if (flag > 0 || flag == 0) { | ||||
return true; | return true; | ||||
} | } | ||||
@@ -7,6 +7,10 @@ import java.util.*; | |||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
import com.google.common.collect.Lists; | 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.apache.commons.lang3.StringUtils; | ||||
import org.checkerframework.checker.nullness.qual.Nullable; | import org.checkerframework.checker.nullness.qual.Nullable; | ||||
import org.flowable.engine.HistoryService; | import org.flowable.engine.HistoryService; | ||||
@@ -74,6 +78,10 @@ public class HandlerManage { | |||||
private final NoticeManage noticeManage; | private final NoticeManage noticeManage; | ||||
private final DeclaredProjectManage declaredProjectManage; | private final DeclaredProjectManage declaredProjectManage; | ||||
private final FileService fileService; | |||||
private final IJoinReviewProvincialBureauService joinReviewProvincialBureauService; | |||||
/** | /** | ||||
* 审核通过后 所处理的逻辑 | * 审核通过后 所处理的逻辑 | ||||
* @param declaredProject | * @param declaredProject | ||||
@@ -127,6 +135,21 @@ public class HandlerManage { | |||||
// 当前项目状态是单位内部审核中 | // 当前项目状态是单位内部审核中 | ||||
case UNDER_INTERNAL_AUDIT: | 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 DEPARTMENT_JOINT_REVIEW: | ||||
// 当前项目状态是方案评审中 | // 当前项目状态是方案评审中 | ||||
case SCHEME_UNDER_REVIEW: | case SCHEME_UNDER_REVIEW: | ||||