add 选择标准接口增加标准状态查询条件

This commit is contained in:
liao
2023-11-21 15:56:14 +08:00
parent 4f483c51a1
commit 6227edc9d7
8 changed files with 211 additions and 115 deletions
@@ -0,0 +1,14 @@
package com.jero.modules.activiti.process.fb.common;
/**
* @Author: liao
* @Date: 2023/11/21 15:29
* @Description: 节点排序值
*/
public class ConsultationNodeSort {
public final static Integer MODULE_OWNER_LIST = 3; // 模块负责人
public final static Integer DESIGN_ENGINEER_LIST = 4; // 模块负责人
}
@@ -13,6 +13,8 @@ public class ConsultationTaskKey {
public static final String ENGINEER_START_END = "engineer_start_end"; // 法规工程师汇总
public static final String REJECT = "reject"; // 法规工程师驳回
public static final String DEPART_LEADER_START_1 = "depart_leader_start_1"; // 各部所主管级领导分发
public static final String DEPART_LEADER_START_2 = "depart_leader_start_2"; // 各部所主管级领导分发
@@ -40,29 +40,39 @@ public class TaskListenerService {
LambdaQueryWrapper<ProcessFbConsultationUserLink> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ProcessFbConsultationUserLink::getBusinessId, processAll.getProjectId());
String userId = CurrentUserUtil.getId();
ProcessFbConsultationUserLink userLink;
switch (taskDefinitionKey) {
case ConsultationTaskKey.MODULE_OWNER_START: // 模块负责人分发
queryWrapper.eq(ProcessFbConsultationUserLink::getDepartLeaderId, userId);
queryWrapper.eq(ProcessFbConsultationUserLink::getModuleOwnerId, assignee);
userLink = processFbConsultationUserLinkService.getOne(queryWrapper);
delegateTask.setFormKey(userLink.getId());
break;
case ConsultationTaskKey.DESIGN_ENGINEER_2: // 设计工程师填写征求意见(不分发给模块负责人)
queryWrapper.eq(ProcessFbConsultationUserLink::getDepartLeaderId, userId);
queryWrapper.eq(ProcessFbConsultationUserLink::getDesignEngineerId, assignee);
userLink = processFbConsultationUserLinkService.getOne(queryWrapper);
delegateTask.setFormKey(userLink.getId());
break;
case ConsultationTaskKey.DESIGN_ENGINEER_1: // 设计工程师填写征求意见(分发给模块负责人)
userLink = processFbConsultationUserLinkService.getById(assignee);
assignee = userLink.getDesignEngineerId();
delegateTask.setAssignee(userLink.getDesignEngineerId());
delegateTask.setFormKey(userLink.getId());
break;
default:
log.info("{}没有监听任务", taskDefinitionKey);
return;
}
ProcessFbConsultationUserLink userLink = processFbConsultationUserLinkService.getOne(queryWrapper);
delegateTask.setFormKey(userLink.getId());
log.info("================================任务监听器=================================");
log.info("任务id: {}", delegateTask.getId());
log.info("TaskDefinitionKey: {}", delegateTask.getTaskDefinitionKey());
log.info("任务Name: {}", delegateTask.getName());
log.info("taskDefinitionKey: {}", taskDefinitionKey);
log.info("assignee: {}", assignee);
log.info("FormKey: {}", delegateTask.getFormKey());
log.info("任务ExecutionId: {}", execution.getId());
log.info("任务SuperExecutionId: {}", execution.getSuperExecutionId());
log.info("任务ExecutionId: {}", execution.getParentId());
log.info("=======================================================================");
}
@@ -7,6 +7,7 @@ import com.jero.modules.activiti.entity.ProcessNode;
import com.jero.modules.activiti.entity.ProcessNodeLink;
import com.jero.modules.activiti.enums.CommitFlagEnum;
import com.jero.modules.activiti.enums.ProcessTypeEnum;
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.ProcessDefinitionKey;
import com.jero.modules.activiti.process.fb.dto.BasicProcessInfoDTO;
@@ -39,6 +40,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -189,11 +191,12 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
log.info("================================流程节点=================================");
log.info("任务Id: {}", task.getId());
log.info("TaskDefinitionKey: {}", task.getTaskDefinitionKey());
log.info("任务Name: {}", task.getName());
log.info("任务FormKey: {}", task.getFormKey());
log.info("任务ProcessInstanceId: {}", task.getProcessInstanceId());
log.info("任务ExecutionId: {}", task.getExecutionId());
log.info("任务SuperExecutionId: {}", execution.getSuperExecutionId());
log.info("任务ParentTaskId: {}", task.getParentTaskId());
log.info("任务ExecutionId: {}", execution.getParentId());
log.info("=======================================================================");
switch (taskDefinitionKey) {
@@ -206,11 +209,59 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
case ConsultationTaskKey.DEPART_LEADER_COLLECT_2: // 各部所主管级领导汇总(不分发给模块负责人)
departLeaderCollect_2(processInfoVO);
break;
case ConsultationTaskKey.MODULE_OWNER_START: // 模块负责人分发
moduleOwnerStart(processInfoVO);
break;
default:
throw new JeroBootException("目前还未开发,请联系管理员");
}
}
/**
* @Author: liao
* @Date: 2023/11/21 15:07
* @Description: 模块负责人分发
**/
private void moduleOwnerStart(ProcessInfoVO<ProcessFbStandardConsultationVO> processInfoVO) {
ProcessFbStandardConsultationVO businessInfoDTO = processInfoVO.getBusinessInfoDTO(); // 全部业务信息
String designEngineerId = businessInfoDTO.getProcessFbConsultationUserLink().getDesignEngineerId();
if (StringUtils.isBlank(designEngineerId)) {
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "designEngineerId");
}
String taskId = processInfoVO.getBasicTaskInfoDTO().getTaskId();
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
String userLinkId = task.getFormKey();
log.info("userLinkId: {}", userLinkId);
ProcessFbConsultationUserLink processFbConsultationUserLink = processFbConsultationUserLinkService.getById(userLinkId);
List<String> designEngineerIdList = Arrays.asList(designEngineerId.split(","));
List<ProcessFbConsultationUserLink> userLinkList = new ArrayList<>();
designEngineerIdList.forEach(designEngineer -> {
ProcessFbConsultationUserLink userLink = new ProcessFbConsultationUserLink();
userLink.setUserType(processFbConsultationUserLink.getUserType());
userLink.setBusinessId(processFbConsultationUserLink.getBusinessId());
userLink.setDepartLeaderId(processFbConsultationUserLink.getDepartLeaderId());
userLink.setModuleOwnerId(processFbConsultationUserLink.getModuleOwnerId());
userLink.setDesignEngineerId(designEngineer);
userLinkList.add(userLink);
});
processFbConsultationUserLinkService.removeById(userLinkId); // 先删除
processFbConsultationUserLinkService.saveBatch(userLinkList, userLinkList.size()); // 后新增
List<String> idList = userLinkList.stream().map(ProcessFbConsultationUserLink::getId).collect(Collectors.toList());
String processInstanceId = task.getProcessInstanceId();
runtimeService.setVariableLocal(processInstanceId, "designEngineerList", idList);
saveNodeUserLink(processInstanceId, ConsultationNodeSort.DESIGN_ENGINEER_LIST, designEngineerIdList);
// 完成任务
taskService.complete(taskId);
}
/**
* @Author: liao
* @Date: 2023/11/21 9:39
@@ -222,7 +273,9 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
String taskId = processInfoVO.getBasicTaskInfoDTO().getTaskId();
processFbConsultationListService.updateBatchById(processFbConsultationLists); // 更新业务信息
if (CollectionUtils.isNotEmpty(processFbConsultationLists)) {
processFbConsultationListService.updateBatchById(processFbConsultationLists); // 更新业务信息
}
// 完成任务
taskService.complete(taskId);
@@ -285,6 +338,7 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
List<String> moduleOwnerIds = Arrays.asList(userLink.getModuleOwnerId().split(","));
moduleOwnerIds.forEach(moduleOwnerId -> {
ProcessFbConsultationUserLink link = new ProcessFbConsultationUserLink();
link.setUserType("1");
link.setBusinessId(processInfoVO.getBusinessId());
link.setDepartLeaderId(CurrentUserUtil.getId());
link.setModuleOwnerId(moduleOwnerId);
@@ -293,7 +347,7 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
processFbConsultationUserLinkService.saveBatch(linkList, linkList.size());
variables.put("passFirst", true);
variables.put("moduleOwnerList", moduleOwnerIds);
saveNodeUserLink(processInstanceId, 3, moduleOwnerIds);
saveNodeUserLink(processInstanceId, ConsultationNodeSort.MODULE_OWNER_LIST, moduleOwnerIds);
} else { // 设计工程师
if (StringUtils.isBlank(userLink.getDesignEngineerId())) {
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "designEngineerId");
@@ -301,6 +355,7 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
List<String> designEngineerIds = Arrays.asList(userLink.getDesignEngineerId().split(","));
designEngineerIds.forEach(designEngineerId -> {
ProcessFbConsultationUserLink link = new ProcessFbConsultationUserLink();
link.setUserType("2");
link.setBusinessId(processInfoVO.getBusinessId());
link.setDepartLeaderId(CurrentUserUtil.getId());
link.setDesignEngineerId(designEngineerId);
@@ -309,7 +364,7 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
processFbConsultationUserLinkService.saveBatch(linkList, linkList.size());
variables.put("passFirst", false);
variables.put("designEngineerList", designEngineerIds);
saveNodeUserLink(processInstanceId, 4, designEngineerIds);
saveNodeUserLink(processInstanceId, ConsultationNodeSort.DESIGN_ENGINEER_LIST, designEngineerIds);
}
runtimeService.setVariablesLocal(processInstanceId, variables);
@@ -100,9 +100,11 @@ public class ProcessHandleServiceImpl implements IProcessHandleService {
log.info("================================启动流程=================================");
log.info("流程定义id: {}", processDefinitionId);
log.info("流程实例id: {}", processInstanceId);
log.info("任务Id: {}", task.getId());
log.info("TaskDefinitionKey: {}", task.getTaskDefinitionKey());
log.info("任务Name: {}", task.getName());
log.info("任务ExecutionId: {}", task.getExecutionId());
log.info("任务SuperExecutionId: {}", execution.getSuperExecutionId());
log.info("任务ParentTaskId: {}", task.getParentTaskId());
log.info("任务ExecutionId: {}", execution.getParentId());
log.info("=======================================================================");
// 完成任务
@@ -79,6 +79,9 @@
<if test="vo.source != null and vo.source != ''">
AND #{vo.source} LIKE CONCAT('%', standard.source, '%')
</if>
<if test="vo.standardState != null and vo.standardState != ''">
AND #{vo.standardState} LIKE CONCAT('%', standard.standard_state, '%')
</if>
<if test="vo.standardNumberOrName != null and vo.standardNumberOrName != ''">
AND (standard_number LIKE CONCAT('%', #{vo.standardNumberOrName}, '%') OR
standard_name LIKE CONCAT('%', #{vo.standardNumberOrName}, '%'))
@@ -28,4 +28,7 @@ public class ManyStandardSelectionBoxVO {
@ApiModelProperty(value = "发布状态的拆分稿-标识")
private String releaseSplitFlag;
@ApiModelProperty(value = "标准状态")
private java.lang.String standardState;
}