feat: 年度制修订-主动上报 不二次下发

This commit is contained in:
2023-12-08 14:53:21 +08:00
parent d523ab2944
commit f419487454
3 changed files with 20 additions and 7 deletions
@@ -6,7 +6,7 @@ package com.jero.modules.activiti.process.esAnnualReport.entity;
*/
public class AnnualReportTaskNameConstant {
public static final String STANDARD_ENGINEER_INIT = "标准化工程师发起";
public static final String CONTACT_USER_DISTRIBUTE = "各部所联络人填写/下发任务";
public static final String CONTACT_USER_DISTRIBUTE = "各部所联络人 填写/下发任务";
public static final String WORK_GROUP_COLLECT = "工作组/所联络人填写企标";
public static final String COLLECT_LEADER_APPROVAL = "收集联络人主管级领导审批";
public static final String CONTACT_USER_COLLECT = "各部所联络人汇总";
@@ -369,6 +369,13 @@ public class ProcessEsAnnualReport implements Serializable {
@ApiModelProperty(value = "收集联络人主管级领导")
private String collectUserLeader;
/**
* 执行Id
*/
@ApiModelProperty(value = "执行Id")
private String executionId;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@@ -154,7 +154,7 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
ProcessEsAnnualReport annualReport = annualReportDataVO.getDataList().get(0);
boolean distribute = annualReport.getDistributeFlag().equals("1");
String contactUserLeaderLeader = annualReport.getContactUserLeaderLeader();
taskService.setVariableLocal(taskId, "distribute", distribute);
taskService.setVariable(taskId, "distribute", distribute);
// 获取是否分发
if (distribute) {
String workGroupUsers = annualReport.getWorkGroupUser();
@@ -164,11 +164,15 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
taskService.setVariableLocal(taskId, "workGroupUserList", workGroupUserList);
taskService.setVariableLocal(taskId, "contactUserLeaderLeader", contactUserLeaderLeader);
} else {
// 获取执行id
String executionId = task.getExecutionId();
// 保存联络人主管级上级领导
dataList.forEach(data -> data.setContactUserLeaderLeader(contactUserLeaderLeader));
dataList.forEach(data -> data.setExecutionId(executionId));
dataList.forEach(data -> data.setProcessInstanceId(processInstanceId));
// 不分发,入库存表
saveBatch(dataList);
taskService.setVariableLocal(taskId, "contactUserLeaderLeader", contactUserLeaderLeader);
taskService.setVariable(taskId, "contactUserLeaderLeader", contactUserLeaderLeader);
}
break;
case WORK_GROUP_COLLECT:
@@ -205,6 +209,7 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
@Override
public AnnualReportDataVO getHandleData(String taskId) {
String userId = UserUtils.getUserId();
String executionId = taskService.createTaskQuery().taskId(taskId).singleResult().getExecutionId();
if (!actFlowCommonService.taskExists(taskId)) {
throw new JeroBootException("任务不存在");
}
@@ -245,16 +250,17 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
break;
case CONTACT_USER_COLLECT:
wrapper.eq(ProcessEsAnnualReport::getContactUser, userId);
wrapper.eq(ProcessEsAnnualReport::getProcessInstanceId, processInstanceId);
wrapper.eq(ProcessEsAnnualReport::getExecutionId, executionId);
annualReportDataVO.setDataList(list(wrapper));
break;
case CONTACT_USER_LEADER_APPROVAL:
// 获取上一个节点的审批人
wrapper.eq(ProcessEsAnnualReport::getContactUserLeaderLeader, userId);
wrapper.eq(ProcessEsAnnualReport::getProcessInstanceId, processInstanceId);
wrapper.eq(ProcessEsAnnualReport::getExecutionId, executionId);
annualReportDataVO.setDataList(list(wrapper));
break;
// case CONTACT_USER_EDIT:
// wrapper.eq(ProcessEsAnnualReport::getContactUser, userId);
// annualReportDataVO.setDataList(list(wrapper));
// break;
case STANDARD_ENGINEER_COLLECT:
wrapper.eq(ProcessEsAnnualReport::getProcessInstanceId, processInstanceId);
annualReportDataVO.setDataList(list(wrapper));