Browse Source

项目 兼容 推送

tags/24080901
PoffyZhang 1 year ago
parent
commit
f5a1839dfe
16 changed files with 81 additions and 51 deletions
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java
  3. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java
  4. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java
  5. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java
  6. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java
  7. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java
  8. +1
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java
  9. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java
  10. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java
  11. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java
  12. +7
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/gov/utils/ProjectConvertUtil.java
  13. +35
    -32
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectStatusEnum.java
  14. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/ProcessEndListener.java
  15. +25
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCollectionTask.java
  16. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJNBuilder.java View File

@@ -269,7 +269,7 @@ public class ProjectDeclareStateMachineJNBuilder implements ProjectDeclareStateM

@Override
public StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> read(Project contextObj) {
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.getValue(contextObj.getStatus()),
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.match(contextObj.getStatus()),
null, null, null, null, RegionContant.LS_JN_CODE);
return result;
}


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineJYBuilder.java View File

@@ -270,7 +270,7 @@ public class ProjectDeclareStateMachineJYBuilder implements ProjectDeclareStateM

@Override
public StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> read(Project contextObj) {
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.getValue(contextObj.getStatus()),
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.match(contextObj.getStatus()),
null, null, null, null, RegionContant.LS_JY_CODE);
return result;
}


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineKFQBuilder.java View File

@@ -270,7 +270,7 @@ public class ProjectDeclareStateMachineKFQBuilder implements ProjectDeclareState

@Override
public StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> read(Project contextObj) {
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.getValue(contextObj.getStatus()),
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.match(contextObj.getStatus()),
null, null, null, null, RegionContant.LS_KFQ_CODE);
return result;
}


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLDBuilder.java View File

@@ -270,7 +270,7 @@ public class ProjectDeclareStateMachineLDBuilder implements ProjectDeclareStateM

@Override
public StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> read(Project contextObj) {
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.getValue(contextObj.getStatus()),
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.match(contextObj.getStatus()),
null, null, null, null, RegionContant.LS_LD_CODE);
return result;
}


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineLQBuilder.java View File

@@ -271,7 +271,7 @@ public class ProjectDeclareStateMachineLQBuilder implements ProjectDeclareStateM

@Override
public StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> read(Project contextObj) {
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.getValue(contextObj.getStatus()),
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.match(contextObj.getStatus()),
null, null, null, null, RegionContant.LS_LQ_CODE);
return result;
}


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQTBuilder.java View File

@@ -270,7 +270,7 @@ public class ProjectDeclareStateMachineQTBuilder implements ProjectDeclareStateM

@Override
public StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> read(Project contextObj) {
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.getValue(contextObj.getStatus()),
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.match(contextObj.getStatus()),
null, null, null, null, RegionContant.LS_QT_CODE);
return result;
}


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineQYBuilder.java View File

@@ -270,7 +270,7 @@ public class ProjectDeclareStateMachineQYBuilder implements ProjectDeclareStateM

@Override
public StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> read(Project contextObj) {
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.getValue(contextObj.getStatus()),
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.match(contextObj.getStatus()),
null, null, null, null, RegionContant.LS_QY_CODE);
return result;
}


+ 1
- 2
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSBJBuilder.java View File

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

import com.ningdatech.pmapi.common.enumeration.CommonEnum;
import com.ningdatech.pmapi.common.statemachine.action.ProjectDeclareChoiceAction;
import com.ningdatech.pmapi.common.statemachine.contants.RegionContant;
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
@@ -271,7 +270,7 @@ public class ProjectDeclareStateMachineSBJBuilder implements ProjectDeclareState

@Override
public StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> read(Project contextObj) {
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.getValue(contextObj.getStatus()),
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.match(contextObj.getStatus()),
null, null, null, null, RegionContant.LS_SBJ_CODE);
return result;
}


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSCBuilder.java View File

@@ -280,7 +280,7 @@ public class ProjectDeclareStateMachineSCBuilder implements ProjectDeclareStateM

@Override
public StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> read(Project contextObj) {
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.getValue(contextObj.getStatus()),
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.match(contextObj.getStatus()),
null, null, null, null, RegionContant.LS_SC_CODE);
return result;
}


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineSYBuilder.java View File

@@ -270,7 +270,7 @@ public class ProjectDeclareStateMachineSYBuilder implements ProjectDeclareStateM

@Override
public StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> read(Project contextObj) {
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.getValue(contextObj.getStatus()),
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.match(contextObj.getStatus()),
null, null, null, null, RegionContant.LS_SY_CODE);
return result;
}


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineYHBuilder.java View File

@@ -270,7 +270,7 @@ public class ProjectDeclareStateMachineYHBuilder implements ProjectDeclareStateM

@Override
public StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> read(Project contextObj) {
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.getValue(contextObj.getStatus()),
StateMachineContext<ProjectStatusEnum, ProjectStatusChangeEvent> result = new DefaultStateMachineContext(ProjectStatusEnum.match(contextObj.getStatus()),
null, null, null, null, RegionContant.LS_YH_CODE);
return result;
}


+ 7
- 2
pmapi/src/main/java/com/ningdatech/pmapi/gov/utils/ProjectConvertUtil.java View File

@@ -12,6 +12,7 @@ import com.ningdatech.pmapi.gov.model.vo.*;
import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO;
import com.ningdatech.pmapi.projectdeclared.model.vo.PaymentPlanVO;
import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeNewEnum;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectApplicationVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO;
@@ -93,8 +94,12 @@ public class ProjectConvertUtil {
baseinfo.setBaseProvManDeprt(project.getHigherSuperOrg());
baseinfo.setBaseProvManDepartDing(project.getHigherSuperOrgCode());
baseinfo.setBaseProvManDeprtType(project.getBaseProvManDeprtType());
// TODO 缺少状态映射
// baseinfo.setBaseProjSetProg();
ProjectStatusEnum match = ProjectStatusEnum.match(project.getStatus());
if(Objects.nonNull(match)){
if(Objects.nonNull(match.getCollectionStatus())){
baseinfo.setBaseProjSetProg(match.getCollectionStatus().getCode());
}
}
baseinfo.setBaseProjType(project.getProjectType());
baseinfo.setDeleted(Boolean.FALSE);
return baseinfo;


+ 35
- 32
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectStatusEnum.java View File

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.projectlib.enumeration;

import com.ningdatech.pmapi.gov.enumeration.GovProjectStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
@@ -21,48 +22,50 @@ public enum ProjectStatusEnum {
/**
* 项目阶段:未立项
*/
NOT_APPROVED(10000, "未立项"),
UNDER_INTERNAL_AUDIT(10001, "单位内部审核中"),
UNDER_INTERNAL_AUDIT_NOT_PASS(10002, "单位内部审核不通过"),
PENDING_PREQUALIFICATION(10003, "待预审"),
JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS(10004, "省级部门联审中"),
NOT_APPROVED(10000, "未立项",null),
UNDER_INTERNAL_AUDIT(10001, "单位内部审核中",null),
UNDER_INTERNAL_AUDIT_NOT_PASS(10002, "单位内部审核不通过",null),
PENDING_PREQUALIFICATION(10003, "待预审",null),
JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS(10004, "省级部门联审中",null),

JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS(10018, "省级部门联审通过"),
THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED(10005, "省级部门联审不通过"),
PRE_APPLYING(10006, "预审中"),
PREQUALIFICATION_FAILED(10007, "预审不通过"),
DEPARTMENT_JOINT_REVIEW(10008, "部门联审中"),
DEPARTMENT_JOINT_REVIEW_FAILED(10009, "部门联审不通过"),
IN_THE_ANNUAL_PLAN(10010, "年度计划中"),
BE_SUSPENDED(10011, "被暂缓"),
SCHEME_UNDER_REVIEW(10012, "方案评审中"),
SCHEME_REVIEW_FAILED(10013, "方案评审不通过"),
TO_BE_APPROVED(10014, "待立项批复"),
TO_BE_DECLARED(10015, "待申报"),
PLAN_TO_BE_DECLARED(10016, "方案待申报"),
PENDING_PREQUALIFICATION_CHOICE(10017, "待预审选择态"),
PREQUALIFICATION_WITHDRAW_CHOICE(10019, "预审中撤回选择态"),
APPROVED_AFTER_CHOICE(10020, "立项批复后选择态"),
TO_BE_APP_REGISTER(10021, "待应用注册"),
JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS(10018, "省级部门联审通过",null),
THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED(10005, "省级部门联审不通过",null),
PRE_APPLYING(10006, "预审中",null),
PREQUALIFICATION_FAILED(10007, "预审不通过",null),
DEPARTMENT_JOINT_REVIEW(10008, "部门联审中",null),
DEPARTMENT_JOINT_REVIEW_FAILED(10009, "部门联审不通过",null),
IN_THE_ANNUAL_PLAN(10010, "年度计划中",null),
BE_SUSPENDED(10011, "被暂缓",null),
SCHEME_UNDER_REVIEW(10012, "方案评审中",GovProjectStatusEnum.APPROVAL),
SCHEME_REVIEW_FAILED(10013, "方案评审不通过",null),
TO_BE_APPROVED(10014, "待立项批复",GovProjectStatusEnum.PENDING),
TO_BE_DECLARED(10015, "待申报",null),
PLAN_TO_BE_DECLARED(10016, "方案待申报",null),
PENDING_PREQUALIFICATION_CHOICE(10017, "待预审选择态",null),
PREQUALIFICATION_WITHDRAW_CHOICE(10019, "预审中撤回选择态",null),
APPROVED_AFTER_CHOICE(10020, "立项批复后选择态",null),
TO_BE_APP_REGISTER(10021, "待应用注册",null),
/**
* 项目阶段:已立项
*/
PROJECT_APPROVED(20000, "已立项"),
TO_BE_PURCHASED(20001, "待采购"),
UNDER_CONSTRUCTION(20002, "建设中"),
TO_BE_FINALLY_INSPECTED(20003, "待终验"),
FINAL_ACCEPTANCE_IS_UNDER_REVIEW(20004, "终验审核中"),
FINAL_ACCEPTANCE_REVIEW_FAILED(20005, "终验审核不通过"),
OPERATION(20006, "待开工"),
PROJECT_APPROVED(20000, "已立项",null),
TO_BE_PURCHASED(20001, "待采购",GovProjectStatusEnum.APPROVED),
UNDER_CONSTRUCTION(20002, "建设中",null),
TO_BE_FINALLY_INSPECTED(20003, "待终验",GovProjectStatusEnum.HAS_PRE_INS),
FINAL_ACCEPTANCE_IS_UNDER_REVIEW(20004, "终验审核中",null),
FINAL_ACCEPTANCE_REVIEW_FAILED(20005, "终验审核不通过",null),
OPERATION(20006, "待开工",GovProjectStatusEnum.PURCHASED),
/**
* 项目阶段:已归档
*/
ARCHIVED(30000, "已归档"),
ACCEPTED(30001, "已验收");
ARCHIVED(30000, "已归档",null),
ACCEPTED(30001, "已验收",GovProjectStatusEnum.HAS_FINAL_INS);

private Integer code;
private String desc;

private GovProjectStatusEnum collectionStatus;

public static String getDesc(Integer code) {
if (Objects.isNull(code)) {
return StringUtils.EMPTY;
@@ -75,7 +78,7 @@ public enum ProjectStatusEnum {
return StringUtils.EMPTY;
}

public static ProjectStatusEnum getValue(Integer code) {
public static ProjectStatusEnum match(Integer code) {
if (Objects.isNull(code)) {
return null;
}


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/ProcessEndListener.java View File

@@ -198,7 +198,7 @@ public class ProcessEndListener {
throw new BizException("传入实例类型错误: " + instTypeEnum);
}
}else {
switch (Objects.requireNonNull(ProjectStatusEnum.getValue(declaredProject.getStatus()))) {
switch (Objects.requireNonNull(ProjectStatusEnum.match(declaredProject.getStatus()))) {
// 当前项目状态是预审中
case PRE_APPLYING:
//先修改项目状态


+ 25
- 2
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCollectionTask.java View File

@@ -12,7 +12,12 @@ import com.ningdatech.pmapi.gov.model.vo.GovBizProjectListVO;
import com.ningdatech.pmapi.gov.model.vo.GovOperationProjectBaseinfoVO;
import com.ningdatech.pmapi.gov.model.vo.GovOperationProjectDetailVO;
import com.ningdatech.pmapi.gov.service.*;
import com.ningdatech.pmapi.gov.utils.ProjectConvertUtil;
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -22,7 +27,6 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.StringJoiner;
@@ -61,6 +65,12 @@ public class SynProjectCollectionTask {
@Autowired
private IGovBizProjectProcureService procureService;

@Autowired
private IProjectService projectService;

@Autowired
private ProjectLibManage projectLibManage;

private final Integer PAGE_NUMBER = 1;

/**
@@ -104,7 +114,7 @@ public class SynProjectCollectionTask {
collectionManage.pushProjectVo(projectDetail);
}

//运维备案项目
//2.运维备案项目
PageVo<GovBizProjectListVO> operationList = collectionManage.operationList(req);
log.info("operation list size :{}",operationList.getTotal());
for(GovBizProjectListVO vo : operationList.getRecords()){
@@ -117,6 +127,19 @@ public class SynProjectCollectionTask {
collectionManage.pushProjectVo(operationDetail);
}

//3.申报项目 需要推送的项目
List<Project> projects = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getNewest,Boolean.TRUE)
.eq(Project::getPush,Boolean.TRUE));
log.info("projects need push size :{}",projects.size());
for(Project project : projects){
ProjectDetailVO projectDetailVO = projectLibManage.detailProjectCode(project.getProjectCode());
GovBizProjectDetailVO vo = ProjectConvertUtil.declaredToCollection(projectDetailVO);
if(Objects.nonNull(vo)){
collectionManage.pushProjectVo(vo);
}
}

stopWatch.stop();
log.info("数据同步任务结束====={}s",stopWatch.getTotalTimeSeconds());
}


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java View File

@@ -168,7 +168,7 @@ public class HandlerManage {
throw new BizException("传入实例类型错误: " + instTypeEnum);
}
}else {
switch (Objects.requireNonNull(ProjectStatusEnum.getValue(declaredProject.getStatus()))) {
switch (Objects.requireNonNull(ProjectStatusEnum.match(declaredProject.getStatus()))) {
// 当前项目状态是预审中
case PRE_APPLYING:
//先修改项目状态
@@ -323,7 +323,7 @@ public class HandlerManage {
public void rootWithDraw(Project declaredProject) {
Long userId = LoginUserUtil.getUserId();
// 若是流程发起人点击撤回,项目回到上一个状态,需调用状态机更新项目状态,流程状态更新为审核通过
switch (Objects.requireNonNull(ProjectStatusEnum.getValue(declaredProject.getStatus()))) {
switch (Objects.requireNonNull(ProjectStatusEnum.match(declaredProject.getStatus()))) {
// 当前项目状态是单位内部审核中
case UNDER_INTERNAL_AUDIT:
// 更新项目状态为待申报


Loading…
Cancel
Save