fix: 年度制修订各部门主动上报BUG修复
This commit is contained in:
+5
@@ -481,4 +481,9 @@ public class ActFlowCommonService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getOriginTaskAssignee(String taskId) {
|
||||||
|
ProcessApprovalRecord approvalRecord = processApprovalRecordService.getToDoByTaskId(taskId);
|
||||||
|
return approvalRecord.getUserId();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+27
-18
@@ -139,9 +139,7 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void approvalProcess(AnnualReportDataVO annualReportDataVO, boolean pass) {
|
public void approvalProcess(AnnualReportDataVO annualReportDataVO, boolean pass) {
|
||||||
String userId = UserUtils.getUserId();
|
|
||||||
CommonVO commonVO = annualReportDataVO.getCommonVO();
|
CommonVO commonVO = annualReportDataVO.getCommonVO();
|
||||||
Map<String, Object> flowUserVO = annualReportDataVO.getFlowUser();
|
|
||||||
List<ProcessEsAnnualReport> dataList = annualReportDataVO.getDataList();
|
List<ProcessEsAnnualReport> dataList = annualReportDataVO.getDataList();
|
||||||
String taskId = commonVO.getTaskId();
|
String taskId = commonVO.getTaskId();
|
||||||
// 获取task
|
// 获取task
|
||||||
@@ -152,11 +150,16 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
|
|||||||
String taskName = task.getName();
|
String taskName = task.getName();
|
||||||
String processInstanceId = actFlowCommonService.getProcessInstanceIdByTaskId(taskId);
|
String processInstanceId = actFlowCommonService.getProcessInstanceIdByTaskId(taskId);
|
||||||
ProcessEsAnnualReport annualReport;
|
ProcessEsAnnualReport annualReport;
|
||||||
|
String executionId = task.getExecutionId();
|
||||||
|
String contactUser = (String) runtimeService.getVariable(executionId, "contactUser");
|
||||||
|
String workGroupUser = (String) runtimeService.getVariable(executionId, "workGroupUser");
|
||||||
|
String contactUserLeaderLeader;
|
||||||
|
LambdaQueryWrapper<ProcessEsAnnualReport> wrapper = new LambdaQueryWrapper<>();
|
||||||
switch (taskName) {
|
switch (taskName) {
|
||||||
case CONTACT_USER_DISTRIBUTE:
|
case CONTACT_USER_DISTRIBUTE:
|
||||||
annualReport = annualReportDataVO.getDataList().get(0);
|
annualReport = annualReportDataVO.getDataList().get(0);
|
||||||
boolean distribute = annualReport.getDistributeFlag().equals("1");
|
boolean distribute = annualReport.getDistributeFlag().equals("1");
|
||||||
String contactUserLeaderLeader = annualReport.getContactUserLeaderLeader();
|
contactUserLeaderLeader = annualReport.getContactUserLeaderLeader();
|
||||||
taskService.setVariable(taskId, "distribute", distribute);
|
taskService.setVariable(taskId, "distribute", distribute);
|
||||||
// 获取是否分发
|
// 获取是否分发
|
||||||
if (distribute) {
|
if (distribute) {
|
||||||
@@ -165,47 +168,53 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
|
|||||||
List<String> workGroupUserList = StrUtil.split(workGroupUsers, ',');
|
List<String> workGroupUserList = StrUtil.split(workGroupUsers, ',');
|
||||||
// 设置流程变量
|
// 设置流程变量
|
||||||
taskService.setVariable(taskId, "workGroupUserList", workGroupUserList);
|
taskService.setVariable(taskId, "workGroupUserList", workGroupUserList);
|
||||||
taskService.setVariable(taskId, "contactUserLeaderLeader", contactUserLeaderLeader);
|
|
||||||
} else {
|
} else {
|
||||||
// 获取执行id
|
|
||||||
String executionId = task.getExecutionId();
|
|
||||||
// 保存联络人主管级上级领导
|
// 保存联络人主管级上级领导
|
||||||
dataList.forEach(data -> data.setContactUserLeaderLeader(contactUserLeaderLeader));
|
dataList.forEach(data -> data.setContactUserLeaderLeader(contactUserLeaderLeader));
|
||||||
dataList.forEach(data -> data.setExecutionId(executionId));
|
dataList.forEach(data -> data.setExecutionId(executionId));
|
||||||
dataList.forEach(data -> data.setProcessInstanceId(processInstanceId));
|
dataList.forEach(data -> data.setProcessInstanceId(processInstanceId));
|
||||||
|
dataList.forEach(data -> data.setContactUser(contactUser));
|
||||||
// 不分发,入库存表
|
// 不分发,入库存表
|
||||||
saveBatch(dataList);
|
saveBatch(dataList);
|
||||||
taskService.setVariable(taskId, "contactUserLeaderLeader", contactUserLeaderLeader);
|
taskService.setVariable(taskId, "contactUserLeaderLeader", contactUserLeaderLeader);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WORK_GROUP_COLLECT:
|
case WORK_GROUP_COLLECT:
|
||||||
|
// 先删后增
|
||||||
|
wrapper.eq(ProcessEsAnnualReport::getWorkGroupUser, workGroupUser);
|
||||||
|
wrapper.eq(ProcessEsAnnualReport::getContactUser, contactUser);
|
||||||
|
wrapper.eq(ProcessEsAnnualReport::getProcessInstanceId, processInstanceId);
|
||||||
|
remove(wrapper);
|
||||||
annualReport = annualReportDataVO.getDataList().get(0);
|
annualReport = annualReportDataVO.getDataList().get(0);
|
||||||
String collectUserLeader = annualReport.getCollectUserLeader();
|
String collectUserLeader = annualReport.getCollectUserLeader();
|
||||||
String executionId = task.getExecutionId();
|
|
||||||
String contactUser = (String) runtimeService.getVariable(executionId, "contactUser");
|
|
||||||
dataList.forEach(data -> data.setContactUser(contactUser));
|
dataList.forEach(data -> data.setContactUser(contactUser));
|
||||||
dataList.forEach(data -> data.setExecutionId(executionId));
|
dataList.forEach(data -> data.setExecutionId(executionId));
|
||||||
|
dataList.forEach(data -> data.setProcessInstanceId(processInstanceId));
|
||||||
// 保存收集联络人主管级领导
|
// 保存收集联络人主管级领导
|
||||||
dataList.forEach(data -> data.setCollectUserLeader(collectUserLeader));
|
dataList.forEach(data -> data.setCollectUserLeader(collectUserLeader));
|
||||||
dataList.forEach(data -> data.setWorkGroupUser(UserUtils.getUserId()));
|
dataList.forEach(data -> data.setWorkGroupUser(workGroupUser));
|
||||||
saveBatch(dataList);
|
saveBatch(dataList);
|
||||||
// 设置下一个节点的审批人流程变量
|
// 设置下一个节点的审批人流程变量
|
||||||
taskService.setVariable(taskId, "collectUserLeader", collectUserLeader);
|
taskService.setVariable(taskId, "collectUserLeader", collectUserLeader);
|
||||||
break;
|
break;
|
||||||
case CONTACT_USER_COLLECT:
|
case CONTACT_USER_COLLECT:
|
||||||
// 先删后增
|
// 先删后增
|
||||||
LambdaQueryWrapper<ProcessEsAnnualReport> wrapper = new LambdaQueryWrapper<>();
|
wrapper.eq(ProcessEsAnnualReport::getContactUser, contactUser);
|
||||||
wrapper.eq(ProcessEsAnnualReport::getContactUser, UserUtils.getUserId());
|
|
||||||
wrapper.eq(ProcessEsAnnualReport::getProcessInstanceId, processInstanceId);
|
wrapper.eq(ProcessEsAnnualReport::getProcessInstanceId, processInstanceId);
|
||||||
remove(wrapper);
|
remove(wrapper);
|
||||||
|
annualReport = annualReportDataVO.getDataList().get(0);
|
||||||
|
contactUserLeaderLeader = annualReport.getContactUserLeaderLeader();
|
||||||
|
dataList.forEach(data -> data.setExecutionId(executionId));
|
||||||
|
dataList.forEach(data -> data.setContactUserLeaderLeader(contactUserLeaderLeader));
|
||||||
|
taskService.setVariable(taskId, "contactUserLeaderLeader", contactUserLeaderLeader);
|
||||||
saveBatch(dataList);
|
saveBatch(dataList);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
runtimeService.setVariable(processInstanceId, "pass", pass);
|
runtimeService.setVariableLocal(processInstanceId, "pass", pass);
|
||||||
// 更新审批表为完成,填充数据
|
// 更新审批表为完成,填充数据
|
||||||
actFlowCommonService.updateApprovalInfo(commonVO, taskId, pass);
|
actFlowCommonService.updateApprovalInfo(commonVO, taskId, pass);
|
||||||
// 审批节点
|
// 审批节点
|
||||||
actFlowCommonService.completeTask(taskId, userId);
|
actFlowCommonService.completeTask(taskId, UserUtils.getUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -215,7 +224,8 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AnnualReportDataVO getHandleData(String taskId) {
|
public AnnualReportDataVO getHandleData(String taskId) {
|
||||||
String userId = UserUtils.getUserId();
|
String userId = actFlowCommonService.getOriginTaskAssignee(taskId);
|
||||||
|
// 判断是否是转办的 找到原始任务办理人
|
||||||
if (!actFlowCommonService.taskExists(taskId)) {
|
if (!actFlowCommonService.taskExists(taskId)) {
|
||||||
throw new JeroBootException("任务不存在");
|
throw new JeroBootException("任务不存在");
|
||||||
}
|
}
|
||||||
@@ -251,16 +261,15 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
|
|||||||
// do nothing now
|
// do nothing now
|
||||||
break;
|
break;
|
||||||
case WORK_GROUP_COLLECT:
|
case WORK_GROUP_COLLECT:
|
||||||
// do nothing now
|
wrapper.eq(ProcessEsAnnualReport::getWorkGroupUser, userId);
|
||||||
|
wrapper.eq(ProcessEsAnnualReport::getExecutionId, executionId);
|
||||||
break;
|
break;
|
||||||
case COLLECT_LEADER_APPROVAL:
|
case COLLECT_LEADER_APPROVAL:
|
||||||
wrapper.eq(ProcessEsAnnualReport::getCollectUserLeader, userId);
|
wrapper.eq(ProcessEsAnnualReport::getCollectUserLeader, userId);
|
||||||
annualReportDataVO.setDataList(list(wrapper));
|
wrapper.eq(ProcessEsAnnualReport::getExecutionId, executionId);
|
||||||
break;
|
break;
|
||||||
case CONTACT_USER_COLLECT:
|
case CONTACT_USER_COLLECT:
|
||||||
wrapper.eq(ProcessEsAnnualReport::getContactUser, userId);
|
wrapper.eq(ProcessEsAnnualReport::getContactUser, userId);
|
||||||
wrapper.in(ProcessEsAnnualReport::getExecutionId, executionIdList);
|
|
||||||
annualReportDataVO.setDataList(list(wrapper));
|
|
||||||
break;
|
break;
|
||||||
case CONTACT_USER_LEADER_APPROVAL:
|
case CONTACT_USER_LEADER_APPROVAL:
|
||||||
wrapper.eq(ProcessEsAnnualReport::getContactUserLeaderLeader, userId);
|
wrapper.eq(ProcessEsAnnualReport::getContactUserLeaderLeader, userId);
|
||||||
|
|||||||
Reference in New Issue
Block a user