Browse Source

Merge remote-tracking branch 'origin/master'

master
niohe·erbao 1 year ago
parent
commit
b8b1432b60
6 changed files with 63 additions and 45 deletions
  1. +2
    -21
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java
  2. +29
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareChoiceAction.java
  3. +13
    -11
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java
  4. +4
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/util/ExcelDownUtil.java
  5. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectStatusEnum.java
  6. +14
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java

+ 2
- 21
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java View File

@@ -99,10 +99,10 @@ public class ProjectDeclareAction {
project.setStatus(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode());
}

@OnTransition(source = "PRE_APPLYING", target = "PENDING_PREQUALIFICATION_CHOICE")
@OnTransition(source = "PRE_APPLYING", target = "PREQUALIFICATION_WITHDRAW_CHOICE")
public void PRE_APPLYING_WITHDRAW(Message<ProjectStatusChangeEvent> message) {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode());
project.setStatus(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE.getCode());
}


@@ -256,23 +256,4 @@ public class ProjectDeclareAction {
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE);
project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode());
}


public class ProjectDeclareChoiceAction implements Action<ProjectStatusEnum, ProjectStatusChangeEvent> {

@Override
public void execute(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) {
log.info(String.valueOf(stateContext.getTarget().getId()));
ProjectStatusEnum projectStatusEnum = stateContext.getTarget().getId();
if (projectStatusEnum.equals(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)) {
Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class);
log.info("预审申报事件之前,项目的状态为:{}" + project.getStatus());
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project)) {
project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode());
} else {
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
}
}
}
}
}

+ 29
- 8
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareChoiceAction.java View File

@@ -24,14 +24,35 @@ public class ProjectDeclareChoiceAction implements Action<ProjectStatusEnum, Pro
public void execute(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) {
log.info(String.valueOf(stateContext.getTarget().getId()));
ProjectStatusEnum projectStatusEnum = stateContext.getTarget().getId();
if (projectStatusEnum.equals(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)){
Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class);
log.info("预审申报事件之前,项目的状态为:{}"+project.getStatus());
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project)){
project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode());
}else {
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
}
switch (projectStatusEnum){
case PENDING_PREQUALIFICATION_CHOICE:
preDeclareChoice(stateContext);
break;
case PREQUALIFICATION_WITHDRAW_CHOICE:
preWithDrawChoice(stateContext);
break;
default:
throw new IllegalStateException("Unexpected value: " + projectStatusEnum);
}
}

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)){
project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode());
}else {
project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode());
}
}

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)){
project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode());
}else {
project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode());
}
}
}

+ 13
- 11
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java View File

@@ -34,7 +34,6 @@ import java.util.EnumSet;
@RequiredArgsConstructor
public class ProjectDeclareStateMachineBuilder {
private static final ProjectDeclareGuardFactory projectDeclareGuardFactory = new ProjectDeclareGuardFactory();
private static final ProjectDeclareAction projectDeclareAction = new ProjectDeclareAction();
private final BeanFactory beanFactory;
private Logger logger = LoggerFactory.getLogger(getClass());
/**
@@ -64,6 +63,7 @@ public class ProjectDeclareStateMachineBuilder {
.withStates()
.initial(ProjectStatusEnum.UNDER_INTERNAL_AUDIT)
.choice(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)
.choice(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE)
.states(EnumSet.allOf(ProjectStatusEnum.class));

builder.configureTransitions()
@@ -87,6 +87,7 @@ public class ProjectDeclareStateMachineBuilder {
.source(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS)
.target(ProjectStatusEnum.UNDER_INTERNAL_AUDIT)
.event(ProjectStatusChangeEvent.PROJECT_APPLICATION_SUBMIT).and()

// 待预审预审申报,从待预审到待预审选择
.withExternal()
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION)
@@ -95,8 +96,9 @@ public class ProjectDeclareStateMachineBuilder {
// 待预审申报,从待预审选择->省级部门联审中,预审中,完成其中一种状态
.withChoice()
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),projectDeclareAction.new ProjectDeclareChoiceAction())
.last(ProjectStatusEnum.PRE_APPLYING,projectDeclareAction.new ProjectDeclareChoiceAction()).and()
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),new ProjectDeclareChoiceAction())
.last(ProjectStatusEnum.PRE_APPLYING,new ProjectDeclareChoiceAction()).and()

// 省级部门联审通过,从省级部门联审中到省级部门联审成功
.withExternal()
.source(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS)
@@ -112,7 +114,7 @@ public class ProjectDeclareStateMachineBuilder {
.source(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS)
.target(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED)
.event(ProjectStatusChangeEvent.PROVINCIAL_DEPARTMENT_REVIEW_REJECT).and()
// 省级部门联审中撤回,从省级部门联审中到省级部门联审不通过
// 省级部门联审中撤回,从省级部门联审中到待预审
.withExternal()
.source(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS)
.target(ProjectStatusEnum.PENDING_PREQUALIFICATION)
@@ -128,17 +130,17 @@ public class ProjectDeclareStateMachineBuilder {
.source(ProjectStatusEnum.PRE_APPLYING)
.target(ProjectStatusEnum.PREQUALIFICATION_FAILED)
.event(ProjectStatusChangeEvent.PRELIMINARY_REVIEW_REJECT).and()
// 预审中撤回,从预审中到预审选择
// 预审中撤回,从预审中到预审中撤回选择
.withExternal()
.source(ProjectStatusEnum.PRE_APPLYING)
.target(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)
.target(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE)
.event(ProjectStatusChangeEvent.PRE_APPLYING_WITHDRAW).and()
// 预审中撤回,从预审选择->省级部门联审成功,待预审,完成其中一种状态
// 预审中撤回,从预审中撤回选择->省级部门联审成功,待预审,完成其中一种状态
.withChoice()
.source(ProjectStatusEnum.PRE_APPLYING)
.source(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE)
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard()
,new ProjectDeclareChoiceAction())
.last(ProjectStatusEnum.PENDING_PREQUALIFICATION,projectDeclareAction.new ProjectDeclareChoiceAction()).and()
.last(ProjectStatusEnum.PENDING_PREQUALIFICATION,new ProjectDeclareChoiceAction()).and()
// 预审不通过重新提交,从预审不通过到待预审选择
.withExternal()
.source(ProjectStatusEnum.PREQUALIFICATION_FAILED)
@@ -147,8 +149,8 @@ public class ProjectDeclareStateMachineBuilder {
// 预审不通过重新提交,从待预审选择->省级部门联审中,预审中,完成其中一种状态
.withChoice()
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),projectDeclareAction.new ProjectDeclareChoiceAction())
.last(ProjectStatusEnum.PRE_APPLYING,projectDeclareAction.new ProjectDeclareChoiceAction()).and()
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),new ProjectDeclareChoiceAction())
.last(ProjectStatusEnum.PRE_APPLYING,new ProjectDeclareChoiceAction()).and()
// 部门联审通过,从部门联审中到年度计划中
.withExternal()
.source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW)


+ 4
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/util/ExcelDownUtil.java View File

@@ -223,7 +223,10 @@ public class ExcelDownUtil {
List<String> nameList = CollUtils.fieldList(fileArray, w -> w.getString(CommonConst.FILE_NAME));
columnValue = nameList.stream().collect(Collectors.joining(StrPool.COMMA));
}else {
columnValue = jsonObject.getString(column.toString());
columnValue = String.valueOf(jsonObject.get(column.toString()));
}
if (CommonConst.NULL.equals(columnValue)){
columnValue = "";
}
columnValues.add(columnValue);
});


+ 1
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectStatusEnum.java View File

@@ -44,6 +44,7 @@ public enum ProjectStatusEnum {
TO_BE_DECLARED(10015, "待申报"),
PLAN_TO_BE_DECLARED(10016, "方案待申报"),
PENDING_PREQUALIFICATION_CHOICE(10017, "待预审选择态"),
PREQUALIFICATION_WITHDRAW_CHOICE(10019, "预审中撤回选择态"),
/**
* 项目阶段:已立项
*/


+ 14
- 4
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -262,7 +262,17 @@ public class TodoCenterManage {
req.setUserId(String.valueOf(userId));
req.setEmployeeCode(employeeCode);
BeanUtils.copyProperties(param,req);
userTodoList = processTaskService.getUserTodoList(req);

//有待办节点的(不包含退回)
List<ProcessTaskVo> todoList = processTaskService.getUserTodoList(req);
//有退回待办的
List<ProcessTaskVo> backList = processTaskService.getBackTodoList(req);
//合并 并且排序
userTodoList = Stream.concat(todoList.stream(),backList.stream())
.filter(Objects::nonNull)
.sorted(Comparator.comparing(ProcessTaskVo::getTaskCreateTime)
.reversed())
.collect(Collectors.toList());
}

ExcelExportWriter excelExportWriter = new ExcelExportWriter();
@@ -549,7 +559,7 @@ public class TodoCenterManage {
List<Project> projects = projectLibManage.projectList(projectListReq);
List<ProcessTaskVo> userIdoList = Lists.newArrayList();
Map<String, Project> projectInfoMap = Maps.newHashMap();
if (CollUtil.isEmpty(projects)) {
if (CollUtil.isNotEmpty(projects)) {
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v));
// 再查出项目关联的流程实例ID
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList());
@@ -687,7 +697,7 @@ public class TodoCenterManage {

List<ProcessInstanceVo> userSubmittedList = Lists.newArrayList();
Map<String, Project> projectInfoMap = Maps.newHashMap();
if (CollUtil.isEmpty(projects)) {
if (CollUtil.isNotEmpty(projects)) {
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v));
// 再查出项目关联的流程实例ID
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList());
@@ -827,7 +837,7 @@ public class TodoCenterManage {

List<ProcessInstanceVo> ccMeList = Lists.newArrayList();
Map<String, Project> projectInfoMap = Maps.newHashMap();
if (CollUtil.isEmpty(projects)) {
if (CollUtil.isNotEmpty(projects)) {
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v));
// 再查出项目关联的流程实例ID
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList());


Loading…
Cancel
Save