update 标准征求意见流程

This commit is contained in:
liao
2023-11-28 13:56:44 +08:00
parent dfbd8d6aa5
commit 8b79d1821c
4 changed files with 106 additions and 12 deletions
@@ -0,0 +1,12 @@
package com.jero.modules.activiti.process.fb.common;
/**
* @Author: liao
* @Date: 2023/11/28 11:41
* @Description: 常量
*/
public class ConsultationCommon {
public static final String USER_TYPE_MODULE_OWNER = "1"; // 模块负责人
}
@@ -83,4 +83,8 @@ public class ProcessFbConsultationList implements Serializable {
@Excel(name = "设计工程师名称", width = 15) @Excel(name = "设计工程师名称", width = 15)
@ApiModelProperty(value = "设计工程师名称") @ApiModelProperty(value = "设计工程师名称")
private java.lang.String designEngineerName; private java.lang.String designEngineerName;
/**设计工程师id*/
@Excel(name = "设计工程师id", width = 15)
@ApiModelProperty(value = "设计工程师id")
private java.lang.String designEngineerId;
} }
@@ -71,6 +71,10 @@ public class TaskListenerService {
userLink.setParentExecutionId(parentExecutionId); userLink.setParentExecutionId(parentExecutionId);
processFbConsultationUserLinkService.updateById(userLink); processFbConsultationUserLinkService.updateById(userLink);
break; break;
case ConsultationTaskKey.MODULE_OWNER_END_2: // 模块负责人汇总填写意见(主管级领导驳回后)
case ConsultationTaskKey.MODULE_OWNER_END_3: // 法规工程师审批驳回后的子流程中的模块负责人汇总
delegateTask.setFormKey(userId); // 绑定主管级领导的id
break;
default: default:
log.info("{}没有监听任务", taskDefinitionKey); log.info("{}没有监听任务", taskDefinitionKey);
} }
@@ -7,6 +7,7 @@ import com.jero.modules.activiti.entity.ProcessNode;
import com.jero.modules.activiti.entity.ProcessNodeLink; import com.jero.modules.activiti.entity.ProcessNodeLink;
import com.jero.modules.activiti.enums.CommitFlagEnum; import com.jero.modules.activiti.enums.CommitFlagEnum;
import com.jero.modules.activiti.enums.ProcessTypeEnum; import com.jero.modules.activiti.enums.ProcessTypeEnum;
import com.jero.modules.activiti.process.fb.common.ConsultationCommon;
import com.jero.modules.activiti.process.fb.common.ConsultationNodeSort; import com.jero.modules.activiti.process.fb.common.ConsultationNodeSort;
import com.jero.modules.activiti.process.fb.common.ConsultationTaskKey; import com.jero.modules.activiti.process.fb.common.ConsultationTaskKey;
import com.jero.modules.activiti.process.fb.common.ProcessDefinitionKey; import com.jero.modules.activiti.process.fb.common.ProcessDefinitionKey;
@@ -295,41 +296,112 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
public ProcessInfoVO<ProcessFbStandardConsultationVO> queryProcessInfoVO(String draftId, String processInstanceId, String taskId) { public ProcessInfoVO<ProcessFbStandardConsultationVO> queryProcessInfoVO(String draftId, String processInstanceId, String taskId) {
ProcessInfoVO processInfoVO = processHandleService.queryProcessInfoVO(draftId, processInstanceId, taskId); ProcessInfoVO processInfoVO = processHandleService.queryProcessInfoVO(draftId, processInstanceId, taskId);
ProcessFbStandardConsultationVO processFbStandardConsultationVO = new ProcessFbStandardConsultationVO(); ProcessFbStandardConsultationVO processFbStandardConsultationVO = new ProcessFbStandardConsultationVO();
processInfoVO.setBusinessInfoDTO(processFbStandardConsultationVO);
String businessId = processInfoVO.getBusinessId(); String businessId = processInfoVO.getBusinessId();
ProcessFbStandardConsultation processFbStandardConsultation = getById(businessId); ProcessFbStandardConsultation processFbStandardConsultation = getById(businessId);
processFbStandardConsultationVO.setProcessFbStandardConsultation(processFbStandardConsultation); // 业务基本信息 processFbStandardConsultationVO.setProcessFbStandardConsultation(processFbStandardConsultation); // 业务基本信息
LambdaQueryWrapper<ProcessFbConsultationList> queryWrapper = new LambdaQueryWrapper<>(); if (StringUtils.isBlank(taskId)) return processInfoVO;
queryWrapper.eq(ProcessFbConsultationList::getBusinessId, businessId);
List<ProcessFbConsultationList> consultationLists = processFbConsultationListService.list(queryWrapper);
processFbStandardConsultationVO.setProcessFbConsultationLists(consultationLists);
// 人员选择
LambdaQueryWrapper<ProcessFbConsultationUserLink> linkQueryWrapper = new LambdaQueryWrapper<>();
linkQueryWrapper.eq(ProcessFbConsultationUserLink::getBusinessId, businessId);
// 征求意见列表
LambdaQueryWrapper<ProcessFbConsultationList> listQueryWrapper = new LambdaQueryWrapper<>();
listQueryWrapper.eq(ProcessFbConsultationList::getBusinessId, businessId);
String userId = CurrentUserUtil.getId();
Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
String executionId = task.getExecutionId();
Execution execution = runtimeService.createExecutionQuery().executionId(executionId).singleResult();
String executionParentId = execution.getParentId();
String taskDefinitionKey = task.getTaskDefinitionKey(); // 任务定义id String taskDefinitionKey = task.getTaskDefinitionKey(); // 任务定义id
List<ProcessFbConsultationUserLink> userLinks;
ProcessFbConsultationUserLink userLink;
List<String> linkIds;
List<ProcessFbConsultationList> consultationLists;
switch (taskDefinitionKey) { switch (taskDefinitionKey) {
case ConsultationTaskKey.DEPART_LEADER_START_1: case ConsultationTaskKey.DEPART_LEADER_START_1: // 各部所主管级领导分发
processDepartLeaderStart_1_draft(processInfoVO); // 各部所主管级领导分发 linkQueryWrapper.eq(ProcessFbConsultationUserLink::getDepartLeaderId, userId);
userLinks = processFbConsultationUserLinkService.list(linkQueryWrapper);
if (CollectionUtils.isNotEmpty(userLinks)) {
userLink = userLinks.get(0);
String userType = userLink.getUserType();
if (ConsultationCommon.USER_TYPE_MODULE_OWNER.equals(userType)) { // 模块负责人
List<String> collect = userLinks.stream()
.map(ProcessFbConsultationUserLink::getModuleOwnerId)
.distinct().collect(Collectors.toList());
userLink.setModuleOwnerId(StringUtils.join(collect, ","));
} else { // 设计工程师
List<String> collect = userLinks.stream()
.map(ProcessFbConsultationUserLink::getDesignEngineerId)
.distinct().collect(Collectors.toList());
userLink.setDesignEngineerId(StringUtils.join(collect, ","));
}
processFbStandardConsultationVO.setProcessFbConsultationUserLink(userLink);
}
break; break;
case ConsultationTaskKey.DESIGN_ENGINEER_1: // 设计工程师填写征求意见(分发给模块负责人) case ConsultationTaskKey.DESIGN_ENGINEER_1: // 设计工程师填写征求意见(分发给模块负责人)
case ConsultationTaskKey.DESIGN_ENGINEER_2: // 设计工程师填写征求意见(不分发给模块负责人) case ConsultationTaskKey.DESIGN_ENGINEER_2: // 设计工程师填写征求意见(不分发给模块负责人)
designEngineer_draft(processInfoVO); linkQueryWrapper.eq(ProcessFbConsultationUserLink::getParentExecutionId, executionParentId);
linkQueryWrapper.eq(ProcessFbConsultationUserLink::getDesignEngineerId, userId);
userLink = processFbConsultationUserLinkService.getOne(linkQueryWrapper);
listQueryWrapper.eq(ProcessFbConsultationList::getDesignEngineerId, userId);
listQueryWrapper.eq(ProcessFbConsultationList::getUserLinkId, userLink.getId());
consultationLists = processFbConsultationListService.list(listQueryWrapper);
processFbStandardConsultationVO.setProcessFbConsultationLists(consultationLists);
break; break;
case ConsultationTaskKey.MODULE_OWNER_END_1: // 模块负责人汇总填写意见(可跳过) case ConsultationTaskKey.MODULE_OWNER_END_1: // 模块负责人汇总填写意见(可跳过)
case ConsultationTaskKey.MODULE_OWNER_END_2: // 模块负责人汇总填写意见(主管级领导驳回后) linkQueryWrapper.eq(ProcessFbConsultationUserLink::getParentExecutionId, executionId);
case ConsultationTaskKey.MODULE_OWNER_END_3: // 法规工程师审批驳回后的子流程中的模块负责人汇总 linkQueryWrapper.eq(ProcessFbConsultationUserLink::getModuleOwnerId, userId);
userLinks = processFbConsultationUserLinkService.list(linkQueryWrapper);
linkIds = userLinks.stream().map(ProcessFbConsultationUserLink::getId).collect(Collectors.toList());
listQueryWrapper.in(ProcessFbConsultationList::getUserLinkId, linkIds);
consultationLists = processFbConsultationListService.list(listQueryWrapper);
processFbStandardConsultationVO.setProcessFbConsultationLists(consultationLists);
break;
case ConsultationTaskKey.DEPART_LEADER_COLLECT_3: // 法规工程师审批驳回后的子流程中的各部所主管级领导汇总 case ConsultationTaskKey.DEPART_LEADER_COLLECT_3: // 法规工程师审批驳回后的子流程中的各部所主管级领导汇总
case ConsultationTaskKey.DEPART_LEADER_COLLECT_2: // 各部所主管级领导汇总(不分发给模块负责人) case ConsultationTaskKey.DEPART_LEADER_COLLECT_2: // 各部所主管级领导汇总(不分发给模块负责人)
collect_draft(processInfoVO); linkQueryWrapper.eq(ProcessFbConsultationUserLink::getDepartLeaderId, userId);
userLinks = processFbConsultationUserLinkService.list(linkQueryWrapper);
linkIds = userLinks.stream().map(ProcessFbConsultationUserLink::getId).collect(Collectors.toList());
listQueryWrapper.in(ProcessFbConsultationList::getUserLinkId, linkIds);
consultationLists = processFbConsultationListService.list(listQueryWrapper);
processFbStandardConsultationVO.setProcessFbConsultationLists(consultationLists);
break;
case ConsultationTaskKey.MODULE_OWNER_END_2: // 模块负责人汇总填写意见(主管级领导驳回后)
case ConsultationTaskKey.MODULE_OWNER_END_3: // 法规工程师审批驳回后的子流程中的模块负责人汇总
linkQueryWrapper.eq(ProcessFbConsultationUserLink::getDepartLeaderId, task.getFormKey());
linkQueryWrapper.eq(ProcessFbConsultationUserLink::getModuleOwnerId, userId);
userLinks = processFbConsultationUserLinkService.list(linkQueryWrapper);
linkIds = userLinks.stream().map(ProcessFbConsultationUserLink::getId).collect(Collectors.toList());
listQueryWrapper.in(ProcessFbConsultationList::getUserLinkId, linkIds);
consultationLists = processFbConsultationListService.list(listQueryWrapper);
processFbStandardConsultationVO.setProcessFbConsultationLists(consultationLists);
break;
case ConsultationTaskKey.ENGINEER_START_END: // 法规工程师审批
consultationLists = processFbConsultationListService.list(listQueryWrapper);
processFbStandardConsultationVO.setProcessFbConsultationLists(consultationLists);
break; break;
case ConsultationTaskKey.MODULE_OWNER_START: // 模块负责人分发 case ConsultationTaskKey.MODULE_OWNER_START: // 模块负责人分发
moduleOwnerStart_draft(processInfoVO); linkQueryWrapper.eq(ProcessFbConsultationUserLink::getParentExecutionId, executionId);
linkQueryWrapper.eq(ProcessFbConsultationUserLink::getModuleOwnerId, userId);
userLinks = processFbConsultationUserLinkService.list(linkQueryWrapper);
if (CollectionUtils.isNotEmpty(userLinks)) {
List<String> collect = userLinks.stream()
.map(ProcessFbConsultationUserLink::getDesignEngineerId)
.distinct().collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect)) {
userLink = userLinks.get(0);
userLink.setDesignEngineerId(StringUtils.join(collect, ","));
}
}
break; break;
default: default:
log.info("taskDefinitionKey:{},没有业务数据保存", taskDefinitionKey); log.info("taskDefinitionKey:{},没有业务数据保存", taskDefinitionKey);
} }
processInfoVO.setBusinessInfoDTO(processFbStandardConsultationVO);
return processInfoVO; return processInfoVO;
} }
@@ -602,6 +674,7 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
consultation.setUserLinkId(userLinkId); consultation.setUserLinkId(userLinkId);
consultation.setBusinessId(businessId); consultation.setBusinessId(businessId);
consultation.setDesignEngineerName(designEngineerName); consultation.setDesignEngineerName(designEngineerName);
consultation.setDesignEngineerId(CurrentUserUtil.getId());
}); });
processFbConsultationListService.saveBatch(processFbConsultationLists, processFbConsultationLists.size()); processFbConsultationListService.saveBatch(processFbConsultationLists, processFbConsultationLists.size());
} }
@@ -637,6 +710,7 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
consultation.setUserLinkId(userLinkId); consultation.setUserLinkId(userLinkId);
consultation.setBusinessId(businessId); consultation.setBusinessId(businessId);
consultation.setDesignEngineerName(designEngineerName); consultation.setDesignEngineerName(designEngineerName);
consultation.setDesignEngineerId(CurrentUserUtil.getId());
}); });
processFbConsultationListService.saveBatch(processFbConsultationLists, processFbConsultationLists.size()); processFbConsultationListService.saveBatch(processFbConsultationLists, processFbConsultationLists.size());
} }