update 法规合规评估流程

This commit is contained in:
lijiarao
2024-01-29 13:58:41 +08:00
parent e489f70b41
commit 7794f0f1dd
5 changed files with 1928 additions and 653 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ ORDER BY process_definition_id, sort;
update process_node update process_node
set is_view = 0 set is_view = 0
where process_definition_id like 'standard-assessment:%' where process_definition_id like 'standard-assessment:%'
and substr(xml_node_id, -2) in ('_2', '_3', '_4', '_5'); and substr(xml_node_id, -2) in ('_2', '_3', '_4', '_5', '_6', '_7', '_8');
# 更新是否可跳过 # 更新是否可跳过
update process_node update process_node
set is_skip = 1 set is_skip = 1
@@ -9,18 +9,23 @@ public class ProcessProjectStandardCommon {
public static final String STANDARDS_ENGINEER = "standardsEngineer"; public static final String STANDARDS_ENGINEER = "standardsEngineer";
public static final String MANAGER_LEADER_LIST = "managerLeaderList"; public static final String MANAGER_LEADER_LIST = "managerLeaderList";
public static final String MANAGER_LEADER_LIST_SIZE = "managerLeaderListSize";
public static final String MODULE_OWNER_LIST = "moduleOwnerList"; public static final String MODULE_OWNER_LIST = "moduleOwnerList";
public static final String MODULE_OWNER_LIST_SIZE = "moduleOwnerListSize"; public static final String MODULE_OWNER_LIST_SIZE = "moduleOwnerListSize";
public static final String DESIGN_ENGINEER_LIST = "designEngineerList"; public static final String DESIGN_ENGINEER_LIST = "designEngineerList";
public static final String DESIGN_ENGINEER_LIST_SIZE = "designEngineerListSize"; public static final String DESIGN_ENGINEER_LIST_SIZE = "designEngineerListSize";
public static final String NOT_INVOLVED_MODULE_OWNER_LIST_SIZE = "notInvolvedModuleOwnerListSize";
public static final String NOT_INVOLVED_MODULE_OWNER_LIST = "notInvolvedModuleOwnerList"; public static final String NOT_INVOLVED_MODULE_OWNER_LIST = "notInvolvedModuleOwnerList";
public static final String NOT_INVOLVED_MODULE_OWNER_LIST_SIZE = "notInvolvedModuleOwnerListSize";
public static final String NOT_INVOLVED_MANAGER_LEADER_LIST = "notInvolvedManagerLeaderList";
public static final String NOT_INVOLVED_MANAGER_LEADER_LIST_SIZE = "notInvolvedManagerLeaderListSize";
//法规工程师发起 //法规工程师发起
public static final String FGGCSFQ = "fggcsfq"; public static final String FGGCSFQ = "fggcsfq";
//部所主管级领导下发 //部所主管级领导下发
public static final String BSZGJLDXF = "bszgjldxf"; public static final String BSZGJLDXF_ = "bszgjldxf_";
//模块责任人分发 //模块责任人分发
public static final String MKZRRFF_ = "mkzrrff_"; public static final String MKZRRFF_ = "mkzrrff_";
public static final String MKZRRFF_1 = "mkzrrff_1"; public static final String MKZRRFF_1 = "mkzrrff_1";
@@ -28,6 +33,9 @@ public class ProcessProjectStandardCommon {
public static final String MKZRRFF_3 = "mkzrrff_3"; public static final String MKZRRFF_3 = "mkzrrff_3";
public static final String MKZRRFF_4 = "mkzrrff_4"; public static final String MKZRRFF_4 = "mkzrrff_4";
public static final String MKZRRFF_5 = "mkzrrff_5"; public static final String MKZRRFF_5 = "mkzrrff_5";
public static final String MKZRRFF_6 = "mkzrrff_6";
public static final String MKZRRFF_7 = "mkzrrff_7";
public static final String MKZRRFF_8 = "mkzrrff_8";
//设计工程师评估 //设计工程师评估
public static final String SJGCSPG_ = "sjgcspg_"; public static final String SJGCSPG_ = "sjgcspg_";
public static final String SJGCSPG_1 = "sjgcspg_1"; public static final String SJGCSPG_1 = "sjgcspg_1";
@@ -3,7 +3,6 @@ package com.jero.modules.activiti.process.projectstandard.service;
import cn.hutool.core.collection.CollStreamUtil; import cn.hutool.core.collection.CollStreamUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -64,7 +63,6 @@ import com.jero.modules.activiti.process.projectstandard.mapper.ProcessProjectSt
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -148,16 +146,18 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
List<ProcessProjectStandardTermUser> termUserList = new ArrayList<>(); List<ProcessProjectStandardTermUser> termUserList = new ArrayList<>();
switch (taskDefinitionKey) { switch (taskDefinitionKey) {
//部所主管级领导下发 //部所主管级领导下发
case ProcessProjectStandardCommon.BSZGJLDXF: case ProcessProjectStandardCommon.BSZGJLDXF_:
processProjectStandardTermList = termMapper.getByResponsibleUnitLeader(processId, originUserId, false); processProjectStandardTermList = termMapper.getByResponsibleUnitLeader(processId, originUserId, false);
break; break;
//模块责任人分发 //模块责任人分发
case ProcessProjectStandardCommon.MKZRRFF_1: case ProcessProjectStandardCommon.MKZRRFF_1:
case ProcessProjectStandardCommon.MKZRRFF_6:
processProjectStandardTermList = termMapper.getByModuleOwner(processId, originUserId, executionParentId, false); processProjectStandardTermList = termMapper.getByModuleOwner(processId, originUserId, executionParentId, false);
break; break;
//驳回后模块责任人分发 //驳回后模块责任人分发
case ProcessProjectStandardCommon.MKZRRFF_4: case ProcessProjectStandardCommon.MKZRRFF_4:
case ProcessProjectStandardCommon.MKZRRFF_5: case ProcessProjectStandardCommon.MKZRRFF_5:
case ProcessProjectStandardCommon.MKZRRFF_8:
processProjectStandardTermList = termMapper.getByRejectModuleOwner(processId, originUserId, executionParentId); processProjectStandardTermList = termMapper.getByRejectModuleOwner(processId, originUserId, executionParentId);
break; break;
//设计工程师评估 //设计工程师评估
@@ -381,16 +381,18 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
processHandleService.updateApprovalRecord(processInfoVO); processHandleService.updateApprovalRecord(processInfoVO);
switch (taskDefinitionKey){ switch (taskDefinitionKey){
//部所主管级领导下发 //部所主管级领导下发
case ProcessProjectStandardCommon.BSZGJLDXF: case ProcessProjectStandardCommon.BSZGJLDXF_:
bszgjldxfSubmit(processInfoVO, processDTO); bszgjldxfSubmit(processInfoVO, processDTO);
break; break;
//模块责任人分发 //模块责任人分发
//驳回后模块责任人分发 //驳回后模块责任人分发
case ProcessProjectStandardCommon.MKZRRFF_1: case ProcessProjectStandardCommon.MKZRRFF_1:
case ProcessProjectStandardCommon.MKZRRFF_6:
mkzrrffSubmit(processInfoVO, processDTO, false); mkzrrffSubmit(processInfoVO, processDTO, false);
break; break;
case ProcessProjectStandardCommon.MKZRRFF_4: case ProcessProjectStandardCommon.MKZRRFF_4:
case ProcessProjectStandardCommon.MKZRRFF_5: case ProcessProjectStandardCommon.MKZRRFF_5:
case ProcessProjectStandardCommon.MKZRRFF_8:
mkzrrffSubmit(processInfoVO, processDTO, true); mkzrrffSubmit(processInfoVO, processDTO, true);
break; break;
//设计工程师评估 //设计工程师评估
@@ -434,6 +436,7 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
default: default:
} }
} }
//模块责任人审批 //模块责任人审批
private void mkzrrffApprove(ProcessInfoVO<ProcessProjectStandardVO> processInfoVO, ProcessDTO processDTO, boolean pass) { private void mkzrrffApprove(ProcessInfoVO<ProcessProjectStandardVO> processInfoVO, ProcessDTO processDTO, boolean pass) {
Task task = processDTO.getTask(); Task task = processDTO.getTask();
@@ -519,6 +522,7 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
taskService.complete(taskId, variables); taskService.complete(taskId, variables);
ThreadLocalUtil.remove(); ThreadLocalUtil.remove();
} }
//法规工程师审批 //法规工程师审批
private void fggcsspApprove(ProcessInfoVO<ProcessProjectStandardVO> processInfoVO, ProcessDTO processDTO, boolean pass) { private void fggcsspApprove(ProcessInfoVO<ProcessProjectStandardVO> processInfoVO, ProcessDTO processDTO, boolean pass) {
String businessId = processInfoVO.getBusinessId(); String businessId = processInfoVO.getBusinessId();
@@ -618,26 +622,37 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
String taskId = processDTO.getTaskId(); String taskId = processDTO.getTaskId();
Map<String, Object> variables = new HashMap<>(); Map<String, Object> variables = new HashMap<>();
variables.put(ProcessProjectStandardCommon.PASS, pass); variables.put(ProcessProjectStandardCommon.PASS, pass);
List<String> designEngineerList;
if (pass){ if (pass){
designEngineerList = updateTermList.stream() List<String> designEngineerList = updateTermList.stream()
.map(ProcessProjectStandardTerm::getDesignEngineer) .map(ProcessProjectStandardTerm::getDesignEngineer)
.filter(Objects::nonNull) .filter(Objects::nonNull)
.distinct() .distinct()
.collect(Collectors.toList()); .collect(Collectors.toList());
variables.put(ProcessProjectStandardCommon.DESIGN_ENGINEER_LIST, designEngineerList);
variables.put(ProcessProjectStandardCommon.DESIGN_ENGINEER_LIST_SIZE, designEngineerList.size());
}else { }else {
LambdaQueryWrapper<ProcessProjectStandardTermUser> wrapper1 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ProcessProjectStandardTermUser> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(ProcessProjectStandardTermUser::getProcessId, businessId); wrapper1.eq(ProcessProjectStandardTermUser::getProcessId, businessId);
wrapper1.isNotNull(ProcessProjectStandardTermUser::getResponsibleUnitLeader); wrapper1.isNotNull(ProcessProjectStandardTermUser::getResponsibleUnitLeader);
List<ProcessProjectStandardTermUser> termUserList = termUserService.list(wrapper1); List<ProcessProjectStandardTermUser> termUserList = termUserService.list(wrapper1);
designEngineerList = termUserList.stream() //选择不涉及的模块责任人
List<String> notInvolvedManagerLeaderList = termUserList.stream()
.filter(i -> StringUtils.isBlank(i.getModuleOwner()))
.map(ProcessProjectStandardTermUser::getResponsibleUnitLeader) .map(ProcessProjectStandardTermUser::getResponsibleUnitLeader)
.filter(Objects::nonNull)
.distinct() .distinct()
.collect(Collectors.toList()); .collect(Collectors.toList());
//选择设计工程师的模块责任人
List<String> managerLeaderList = termUserList.stream()
.filter(i -> StringUtils.isNotBlank(i.getModuleOwner()))
.map(ProcessProjectStandardTermUser::getResponsibleUnitLeader)
.distinct()
.collect(Collectors.toList());
variables.put(ProcessProjectStandardCommon.NOT_INVOLVED_MANAGER_LEADER_LIST, notInvolvedManagerLeaderList);
variables.put(ProcessProjectStandardCommon.NOT_INVOLVED_MANAGER_LEADER_LIST_SIZE, notInvolvedManagerLeaderList.size());
variables.put(ProcessProjectStandardCommon.MANAGER_LEADER_LIST, managerLeaderList);
variables.put(ProcessProjectStandardCommon.MANAGER_LEADER_LIST_SIZE, managerLeaderList.size());
} }
variables.put(ProcessProjectStandardCommon.DESIGN_ENGINEER_LIST, designEngineerList);
variables.put(ProcessProjectStandardCommon.DESIGN_ENGINEER_LIST_SIZE, designEngineerList.size());
taskService.complete(taskId, variables); taskService.complete(taskId, variables);
if (pass){ if (pass){
//发送消息 //发送消息
@@ -686,6 +701,8 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
if (StringUtils.isBlank(moduleOwner)){ if (StringUtils.isBlank(moduleOwner)){
throw new JeroBootException(ResultCommon.PARAMETER_NOT_RECOGNIZED); throw new JeroBootException(ResultCommon.PARAMETER_NOT_RECOGNIZED);
} }
updateWrapper.set(ProcessProjectStandardTermUser::getNotInvolved, null);
updateWrapper.set(ProcessProjectStandardTermUser::getAssessResults, null);
updateWrapper.set(ProcessProjectStandardTermUser::getModuleOwner, moduleOwner); updateWrapper.set(ProcessProjectStandardTermUser::getModuleOwner, moduleOwner);
updateWrapper.set(ProcessProjectStandardTermUser::getParentExecutionId, executionId); updateWrapper.set(ProcessProjectStandardTermUser::getParentExecutionId, executionId);
moduleOwnerIds.add(moduleOwner); moduleOwnerIds.add(moduleOwner);
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff