update 标准征求意见流程
This commit is contained in:
+2
-2
@@ -20,10 +20,10 @@ import lombok.experimental.Accessors;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("process_fb_standard_consultation_list")
|
@TableName("process_fb_consultation_list")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@ApiModel(value="process_fb_standard_consultation_list对象", description="标准征求意见流程-征求意见列表表")
|
@ApiModel(value="process_fb_consultation_list对象", description="标准征求意见流程-征求意见列表表")
|
||||||
public class ProcessFbConsultationList implements Serializable {
|
public class ProcessFbConsultationList implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|||||||
+7
@@ -45,6 +45,10 @@ public class TaskListenerService {
|
|||||||
queryWrapper.eq(ProcessFbConsultationUserLink::getDepartLeaderId, userId);
|
queryWrapper.eq(ProcessFbConsultationUserLink::getDepartLeaderId, userId);
|
||||||
queryWrapper.eq(ProcessFbConsultationUserLink::getModuleOwnerId, assignee);
|
queryWrapper.eq(ProcessFbConsultationUserLink::getModuleOwnerId, assignee);
|
||||||
break;
|
break;
|
||||||
|
case ConsultationTaskKey.DESIGN_ENGINEER_2: // 设计工程师填写征求意见(不分发给模块负责人)
|
||||||
|
queryWrapper.eq(ProcessFbConsultationUserLink::getDepartLeaderId, userId);
|
||||||
|
queryWrapper.eq(ProcessFbConsultationUserLink::getDesignEngineerId, assignee);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
log.info("{}没有监听任务", taskDefinitionKey);
|
log.info("{}没有监听任务", taskDefinitionKey);
|
||||||
return;
|
return;
|
||||||
@@ -56,6 +60,9 @@ public class TaskListenerService {
|
|||||||
log.info("任务id: {}", delegateTask.getId());
|
log.info("任务id: {}", delegateTask.getId());
|
||||||
log.info("taskDefinitionKey: {}", taskDefinitionKey);
|
log.info("taskDefinitionKey: {}", taskDefinitionKey);
|
||||||
log.info("assignee: {}", assignee);
|
log.info("assignee: {}", assignee);
|
||||||
|
log.info("FormKey: {}", delegateTask.getFormKey());
|
||||||
|
log.info("任务ExecutionId: {}", execution.getId());
|
||||||
|
log.info("任务SuperExecutionId: {}", execution.getSuperExecutionId());
|
||||||
log.info("=======================================================================");
|
log.info("=======================================================================");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+53
-12
@@ -15,6 +15,7 @@ import com.jero.modules.activiti.process.fb.entity.ProcessFbConsultationList;
|
|||||||
import com.jero.modules.activiti.process.fb.entity.ProcessFbConsultationUserLink;
|
import com.jero.modules.activiti.process.fb.entity.ProcessFbConsultationUserLink;
|
||||||
import com.jero.modules.activiti.process.fb.entity.ProcessFbStandardConsultation;
|
import com.jero.modules.activiti.process.fb.entity.ProcessFbStandardConsultation;
|
||||||
import com.jero.modules.activiti.process.fb.mapper.ProcessFbStandardConsultationMapper;
|
import com.jero.modules.activiti.process.fb.mapper.ProcessFbStandardConsultationMapper;
|
||||||
|
import com.jero.modules.activiti.process.fb.service.IProcessFbConsultationListService;
|
||||||
import com.jero.modules.activiti.process.fb.service.IProcessFbConsultationUserLinkService;
|
import com.jero.modules.activiti.process.fb.service.IProcessFbConsultationUserLinkService;
|
||||||
import com.jero.modules.activiti.process.fb.service.IProcessFbStandardConsultationService;
|
import com.jero.modules.activiti.process.fb.service.IProcessFbStandardConsultationService;
|
||||||
import com.jero.modules.activiti.process.fb.service.IProcessHandleService;
|
import com.jero.modules.activiti.process.fb.service.IProcessHandleService;
|
||||||
@@ -29,6 +30,7 @@ import org.activiti.engine.TaskService;
|
|||||||
import org.activiti.engine.runtime.Execution;
|
import org.activiti.engine.runtime.Execution;
|
||||||
import org.activiti.engine.runtime.ProcessInstance;
|
import org.activiti.engine.runtime.ProcessInstance;
|
||||||
import org.activiti.engine.task.Task;
|
import org.activiti.engine.task.Task;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -55,6 +57,8 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
|
|||||||
@Resource
|
@Resource
|
||||||
private IProcessFbConsultationUserLinkService processFbConsultationUserLinkService;
|
private IProcessFbConsultationUserLinkService processFbConsultationUserLinkService;
|
||||||
@Resource
|
@Resource
|
||||||
|
private IProcessFbConsultationListService processFbConsultationListService;
|
||||||
|
@Resource
|
||||||
private TaskService taskService;
|
private TaskService taskService;
|
||||||
@Resource
|
@Resource
|
||||||
private RuntimeService runtimeService;
|
private RuntimeService runtimeService;
|
||||||
@@ -179,6 +183,19 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
|
|||||||
String taskDefinitionKey = task.getTaskDefinitionKey(); // 任务定义id
|
String taskDefinitionKey = task.getTaskDefinitionKey(); // 任务定义id
|
||||||
processHandleService.isMyTask(taskId); // 判断是否拥有任务处理权
|
processHandleService.isMyTask(taskId); // 判断是否拥有任务处理权
|
||||||
|
|
||||||
|
Execution execution = runtimeService.createExecutionQuery().executionId(task.getExecutionId()).singleResult();
|
||||||
|
taskInfo.setCommitFlag(CommitFlagEnum.PASS.getValue());
|
||||||
|
processHandleService.updateApprovalRecord(processInfoVO);
|
||||||
|
|
||||||
|
log.info("================================流程节点=================================");
|
||||||
|
log.info("任务Id: {}", task.getId());
|
||||||
|
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("=======================================================================");
|
||||||
|
|
||||||
switch (taskDefinitionKey) {
|
switch (taskDefinitionKey) {
|
||||||
case ConsultationTaskKey.DEPART_LEADER_START_1:
|
case ConsultationTaskKey.DEPART_LEADER_START_1:
|
||||||
processDepartLeaderStart_1(processInfoVO); // 各部所主管级领导分发
|
processDepartLeaderStart_1(processInfoVO); // 各部所主管级领导分发
|
||||||
@@ -186,20 +203,29 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
|
|||||||
case ConsultationTaskKey.DESIGN_ENGINEER_2: // 设计工程师填写征求意见(不分发给模块负责人)
|
case ConsultationTaskKey.DESIGN_ENGINEER_2: // 设计工程师填写征求意见(不分发给模块负责人)
|
||||||
processEngineer_2(processInfoVO);
|
processEngineer_2(processInfoVO);
|
||||||
break;
|
break;
|
||||||
|
case ConsultationTaskKey.DEPART_LEADER_COLLECT_2: // 各部所主管级领导汇总(不分发给模块负责人)
|
||||||
|
departLeaderCollect_2(processInfoVO);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new JeroBootException("目前还未开发,请联系管理员");
|
throw new JeroBootException("目前还未开发,请联系管理员");
|
||||||
}
|
}
|
||||||
taskInfo.setCommitFlag(CommitFlagEnum.PASS.getValue());
|
}
|
||||||
//processHandleService.updateApprovalRecord(processInfoVO);
|
|
||||||
|
|
||||||
Execution execution = runtimeService.createExecutionQuery().executionId(task.getExecutionId()).singleResult();
|
/**
|
||||||
log.info("================================流程节点=================================");
|
* @Author: liao
|
||||||
log.info("任务Id: {}", task.getId());
|
* @Date: 2023/11/21 9:39
|
||||||
log.info("任务ProcessInstanceId: {}", task.getProcessInstanceId());
|
* @Description: 各部所主管级领导汇总(不分发给模块负责人)
|
||||||
log.info("任务ExecutionId: {}", task.getExecutionId());
|
**/
|
||||||
log.info("任务SuperExecutionId: {}", execution.getSuperExecutionId());
|
private void departLeaderCollect_2(ProcessInfoVO<ProcessFbStandardConsultationVO> processInfoVO) {
|
||||||
log.info("任务ParentTaskId: {}", task.getParentTaskId());
|
ProcessFbStandardConsultationVO businessInfoDTO = processInfoVO.getBusinessInfoDTO(); // 全部业务信息
|
||||||
log.info("=======================================================================");
|
List<ProcessFbConsultationList> processFbConsultationLists = businessInfoDTO.getProcessFbConsultationLists();
|
||||||
|
|
||||||
|
String taskId = processInfoVO.getBasicTaskInfoDTO().getTaskId();
|
||||||
|
|
||||||
|
processFbConsultationListService.updateBatchById(processFbConsultationLists); // 更新业务信息
|
||||||
|
|
||||||
|
// 完成任务
|
||||||
|
taskService.complete(taskId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -209,12 +235,27 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
|
|||||||
**/
|
**/
|
||||||
private void processEngineer_2(ProcessInfoVO<ProcessFbStandardConsultationVO> processInfoVO) {
|
private void processEngineer_2(ProcessInfoVO<ProcessFbStandardConsultationVO> processInfoVO) {
|
||||||
ProcessFbStandardConsultationVO businessInfoDTO = processInfoVO.getBusinessInfoDTO(); // 全部业务信息
|
ProcessFbStandardConsultationVO businessInfoDTO = processInfoVO.getBusinessInfoDTO(); // 全部业务信息
|
||||||
ProcessFbConsultationUserLink userLink = businessInfoDTO.getProcessFbConsultationUserLink(); // 业务分派信息
|
List<ProcessFbConsultationList> processFbConsultationLists = businessInfoDTO.getProcessFbConsultationLists();
|
||||||
|
|
||||||
String taskId = processInfoVO.getBasicTaskInfoDTO().getTaskId();
|
String taskId = processInfoVO.getBasicTaskInfoDTO().getTaskId();
|
||||||
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||||
String processInstanceId = task.getProcessInstanceId();
|
|
||||||
|
|
||||||
|
String userLinkId = task.getFormKey();
|
||||||
|
log.info("userLinkId: {}", userLinkId);
|
||||||
|
|
||||||
|
// 先删除存储的数据
|
||||||
|
LambdaQueryWrapper<ProcessFbConsultationList> removeWrapper = new LambdaQueryWrapper<>();
|
||||||
|
removeWrapper.eq(ProcessFbConsultationList::getUserLinkId, userLinkId);
|
||||||
|
processFbConsultationListService.remove(removeWrapper);
|
||||||
|
|
||||||
|
// 保存业务信息
|
||||||
|
if (CollectionUtils.isNotEmpty(processFbConsultationLists)) {
|
||||||
|
processFbConsultationLists.forEach(consultation -> consultation.setUserLinkId(userLinkId));
|
||||||
|
processFbConsultationListService.saveBatch(processFbConsultationLists, processFbConsultationLists.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 完成任务
|
||||||
|
taskService.complete(taskId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user