@@ -99,10 +99,10 @@ public class ProjectDeclareAction { | |||||
project.setStatus(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode()); | 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) { | public void PRE_APPLYING_WITHDRAW(Message<ProjectStatusChangeEvent> message) { | ||||
Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); | 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 project = (Project) message.getHeaders().get(PROJECT_DECLARE); | ||||
project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode()); | 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()); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | } |
@@ -24,14 +24,35 @@ public class ProjectDeclareChoiceAction implements Action<ProjectStatusEnum, Pro | |||||
public void execute(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) { | public void execute(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) { | ||||
log.info(String.valueOf(stateContext.getTarget().getId())); | log.info(String.valueOf(stateContext.getTarget().getId())); | ||||
ProjectStatusEnum projectStatusEnum = 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()); | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -34,7 +34,6 @@ import java.util.EnumSet; | |||||
@RequiredArgsConstructor | @RequiredArgsConstructor | ||||
public class ProjectDeclareStateMachineBuilder { | public class ProjectDeclareStateMachineBuilder { | ||||
private static final ProjectDeclareGuardFactory projectDeclareGuardFactory = new ProjectDeclareGuardFactory(); | private static final ProjectDeclareGuardFactory projectDeclareGuardFactory = new ProjectDeclareGuardFactory(); | ||||
private static final ProjectDeclareAction projectDeclareAction = new ProjectDeclareAction(); | |||||
private final BeanFactory beanFactory; | private final BeanFactory beanFactory; | ||||
private Logger logger = LoggerFactory.getLogger(getClass()); | private Logger logger = LoggerFactory.getLogger(getClass()); | ||||
/** | /** | ||||
@@ -64,6 +63,7 @@ public class ProjectDeclareStateMachineBuilder { | |||||
.withStates() | .withStates() | ||||
.initial(ProjectStatusEnum.UNDER_INTERNAL_AUDIT) | .initial(ProjectStatusEnum.UNDER_INTERNAL_AUDIT) | ||||
.choice(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) | .choice(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) | ||||
.choice(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE) | |||||
.states(EnumSet.allOf(ProjectStatusEnum.class)); | .states(EnumSet.allOf(ProjectStatusEnum.class)); | ||||
builder.configureTransitions() | builder.configureTransitions() | ||||
@@ -87,6 +87,7 @@ public class ProjectDeclareStateMachineBuilder { | |||||
.source(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS) | .source(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS) | ||||
.target(ProjectStatusEnum.UNDER_INTERNAL_AUDIT) | .target(ProjectStatusEnum.UNDER_INTERNAL_AUDIT) | ||||
.event(ProjectStatusChangeEvent.PROJECT_APPLICATION_SUBMIT).and() | .event(ProjectStatusChangeEvent.PROJECT_APPLICATION_SUBMIT).and() | ||||
// 待预审预审申报,从待预审到待预审选择 | // 待预审预审申报,从待预审到待预审选择 | ||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION) | .source(ProjectStatusEnum.PENDING_PREQUALIFICATION) | ||||
@@ -95,8 +96,9 @@ public class ProjectDeclareStateMachineBuilder { | |||||
// 待预审申报,从待预审选择->省级部门联审中,预审中,完成其中一种状态 | // 待预审申报,从待预审选择->省级部门联审中,预审中,完成其中一种状态 | ||||
.withChoice() | .withChoice() | ||||
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) | .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() | .withExternal() | ||||
.source(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS) | .source(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS) | ||||
@@ -112,7 +114,7 @@ public class ProjectDeclareStateMachineBuilder { | |||||
.source(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS) | .source(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS) | ||||
.target(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED) | .target(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED) | ||||
.event(ProjectStatusChangeEvent.PROVINCIAL_DEPARTMENT_REVIEW_REJECT).and() | .event(ProjectStatusChangeEvent.PROVINCIAL_DEPARTMENT_REVIEW_REJECT).and() | ||||
// 省级部门联审中撤回,从省级部门联审中到省级部门联审不通过 | |||||
// 省级部门联审中撤回,从省级部门联审中到待预审 | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS) | .source(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS) | ||||
.target(ProjectStatusEnum.PENDING_PREQUALIFICATION) | .target(ProjectStatusEnum.PENDING_PREQUALIFICATION) | ||||
@@ -128,17 +130,17 @@ public class ProjectDeclareStateMachineBuilder { | |||||
.source(ProjectStatusEnum.PRE_APPLYING) | .source(ProjectStatusEnum.PRE_APPLYING) | ||||
.target(ProjectStatusEnum.PREQUALIFICATION_FAILED) | .target(ProjectStatusEnum.PREQUALIFICATION_FAILED) | ||||
.event(ProjectStatusChangeEvent.PRELIMINARY_REVIEW_REJECT).and() | .event(ProjectStatusChangeEvent.PRELIMINARY_REVIEW_REJECT).and() | ||||
// 预审中撤回,从预审中到待预审选择 | |||||
// 预审中撤回,从预审中到预审中撤回选择态 | |||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.PRE_APPLYING) | .source(ProjectStatusEnum.PRE_APPLYING) | ||||
.target(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) | |||||
.target(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE) | |||||
.event(ProjectStatusChangeEvent.PRE_APPLYING_WITHDRAW).and() | .event(ProjectStatusChangeEvent.PRE_APPLYING_WITHDRAW).and() | ||||
// 预审中撤回,从待预审选择->省级部门联审成功,待预审,完成其中一种状态 | |||||
// 预审中撤回,从预审中撤回选择态->省级部门联审成功,待预审,完成其中一种状态 | |||||
.withChoice() | .withChoice() | ||||
.source(ProjectStatusEnum.PRE_APPLYING) | |||||
.source(ProjectStatusEnum.PREQUALIFICATION_WITHDRAW_CHOICE) | |||||
.first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard() | .first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard() | ||||
,new ProjectDeclareChoiceAction()) | ,new ProjectDeclareChoiceAction()) | ||||
.last(ProjectStatusEnum.PENDING_PREQUALIFICATION,projectDeclareAction.new ProjectDeclareChoiceAction()).and() | |||||
.last(ProjectStatusEnum.PENDING_PREQUALIFICATION,new ProjectDeclareChoiceAction()).and() | |||||
// 预审不通过重新提交,从预审不通过到待预审选择 | // 预审不通过重新提交,从预审不通过到待预审选择 | ||||
.withExternal() | .withExternal() | ||||
.source(ProjectStatusEnum.PREQUALIFICATION_FAILED) | .source(ProjectStatusEnum.PREQUALIFICATION_FAILED) | ||||
@@ -147,8 +149,8 @@ public class ProjectDeclareStateMachineBuilder { | |||||
// 预审不通过重新提交,从待预审选择->省级部门联审中,预审中,完成其中一种状态 | // 预审不通过重新提交,从待预审选择->省级部门联审中,预审中,完成其中一种状态 | ||||
.withChoice() | .withChoice() | ||||
.source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) | .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() | .withExternal() | ||||
.source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW) | .source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW) | ||||
@@ -223,7 +223,10 @@ public class ExcelDownUtil { | |||||
List<String> nameList = CollUtils.fieldList(fileArray, w -> w.getString(CommonConst.FILE_NAME)); | List<String> nameList = CollUtils.fieldList(fileArray, w -> w.getString(CommonConst.FILE_NAME)); | ||||
columnValue = nameList.stream().collect(Collectors.joining(StrPool.COMMA)); | columnValue = nameList.stream().collect(Collectors.joining(StrPool.COMMA)); | ||||
}else { | }else { | ||||
columnValue = jsonObject.getString(column.toString()); | |||||
columnValue = String.valueOf(jsonObject.get(column.toString())); | |||||
} | |||||
if (CommonConst.NULL.equals(columnValue)){ | |||||
columnValue = ""; | |||||
} | } | ||||
columnValues.add(columnValue); | columnValues.add(columnValue); | ||||
}); | }); | ||||
@@ -44,6 +44,7 @@ public enum ProjectStatusEnum { | |||||
TO_BE_DECLARED(10015, "待申报"), | TO_BE_DECLARED(10015, "待申报"), | ||||
PLAN_TO_BE_DECLARED(10016, "方案待申报"), | PLAN_TO_BE_DECLARED(10016, "方案待申报"), | ||||
PENDING_PREQUALIFICATION_CHOICE(10017, "待预审选择态"), | PENDING_PREQUALIFICATION_CHOICE(10017, "待预审选择态"), | ||||
PREQUALIFICATION_WITHDRAW_CHOICE(10019, "预审中撤回选择态"), | |||||
/** | /** | ||||
* 项目阶段:已立项 | * 项目阶段:已立项 | ||||
*/ | */ | ||||
@@ -262,7 +262,17 @@ public class TodoCenterManage { | |||||
req.setUserId(String.valueOf(userId)); | req.setUserId(String.valueOf(userId)); | ||||
req.setEmployeeCode(employeeCode); | req.setEmployeeCode(employeeCode); | ||||
BeanUtils.copyProperties(param,req); | 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(); | ExcelExportWriter excelExportWriter = new ExcelExportWriter(); | ||||
@@ -549,7 +559,7 @@ public class TodoCenterManage { | |||||
List<Project> projects = projectLibManage.projectList(projectListReq); | List<Project> projects = projectLibManage.projectList(projectListReq); | ||||
List<ProcessTaskVo> userIdoList = Lists.newArrayList(); | List<ProcessTaskVo> userIdoList = Lists.newArrayList(); | ||||
Map<String, Project> projectInfoMap = Maps.newHashMap(); | 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)); | Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); | ||||
// 再查出项目关联的流程实例ID | // 再查出项目关联的流程实例ID | ||||
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); | List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); | ||||
@@ -687,7 +697,7 @@ public class TodoCenterManage { | |||||
List<ProcessInstanceVo> userSubmittedList = Lists.newArrayList(); | List<ProcessInstanceVo> userSubmittedList = Lists.newArrayList(); | ||||
Map<String, Project> projectInfoMap = Maps.newHashMap(); | 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)); | Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); | ||||
// 再查出项目关联的流程实例ID | // 再查出项目关联的流程实例ID | ||||
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); | List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); | ||||
@@ -827,7 +837,7 @@ public class TodoCenterManage { | |||||
List<ProcessInstanceVo> ccMeList = Lists.newArrayList(); | List<ProcessInstanceVo> ccMeList = Lists.newArrayList(); | ||||
Map<String, Project> projectInfoMap = Maps.newHashMap(); | 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)); | Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); | ||||
// 再查出项目关联的流程实例ID | // 再查出项目关联的流程实例ID | ||||
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); | List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); | ||||