mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-18 19:20:05 +08:00
BPM:完善相关的代码注释
This commit is contained in:
parent
3b8dee4963
commit
62de6c36bc
2
pom.xml
2
pom.xml
@ -16,7 +16,7 @@
|
||||
<module>yudao-module-system</module>
|
||||
<module>yudao-module-infra</module>
|
||||
<!-- <module>yudao-module-member</module>-->
|
||||
<!-- <module>yudao-module-bpm</module>-->
|
||||
<module>yudao-module-bpm</module>
|
||||
<!-- <module>yudao-module-report</module>-->
|
||||
<!-- <module>yudao-module-mp</module>-->
|
||||
<!-- <module>yudao-module-pay</module>-->
|
||||
|
@ -69,6 +69,7 @@
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Flowable 工作流相关 -->
|
||||
<dependency>
|
||||
<groupId>org.flowable</groupId>
|
||||
|
@ -34,6 +34,13 @@ public class BpmTaskAssignLeaderExpression {
|
||||
@Resource
|
||||
private BpmProcessInstanceService processInstanceService;
|
||||
|
||||
/**
|
||||
* 计算审批的候选人
|
||||
*
|
||||
* @param execution 流程执行实体
|
||||
* @param level 指定级别
|
||||
* @return 指定级别的领导
|
||||
*/
|
||||
public Set<Long> calculateUsers(DelegateExecution execution, int level) {
|
||||
Assert.isTrue(level > 0, "level 必须大于 0");
|
||||
// 获得发起人
|
||||
|
@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.util.collection.SetUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -20,7 +21,13 @@ public class BpmTaskAssignStartUserExpression {
|
||||
@Resource
|
||||
private BpmProcessInstanceService processInstanceService;
|
||||
|
||||
public Set<Long> calculateUsers(org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl execution) {
|
||||
/**
|
||||
* 计算审批的候选人
|
||||
*
|
||||
* @param execution 流程执行实体
|
||||
* @return 发起人
|
||||
*/
|
||||
public Set<Long> calculateUsers(ExecutionEntityImpl execution) {
|
||||
ProcessInstance processInstance = processInstanceService.getProcessInstance(execution.getProcessInstanceId());
|
||||
Long startUserId = NumberUtils.parseLong(processInstance.getStartUserId());
|
||||
return SetUtils.asSet(startUserId);
|
||||
|
@ -20,7 +20,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 监听 {@link org.flowable.task.api.Task} 的开始与完成
|
||||
* 监听 {@link Task} 的开始与完成
|
||||
*
|
||||
* @author jason
|
||||
*/
|
||||
|
@ -3,14 +3,12 @@ package cn.iocoder.yudao.module.bpm.framework.flowable.core.listener.demo.task;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.engine.delegate.TaskListener;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 类型为 class 的 TaskListener 监听器示例
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class DemoDelegateClassTaskListener implements TaskListener {
|
||||
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.bpm.framework.flowable.core.listener.demo.task;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 类型为 expression 的 TaskListener 监听器示例
|
||||
@ -9,6 +10,7 @@ import org.flowable.task.service.delegate.DelegateTask;
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DemoSpringExpressionTaskListener {
|
||||
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
|
@ -728,7 +728,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
||||
// 2.2 更新子任务为已取消
|
||||
String cancelReason = StrUtil.format("任务被取消,原因:由于[{}]操作[减签],", cancelUser.getNickname());
|
||||
childTaskList.forEach(childTask -> updateTaskStatusAndReason(childTask.getId(), BpmTaskStatusEnum.CANCEL.getStatus(), cancelReason));
|
||||
// 2.2 删除任务和所有子任务
|
||||
// 2.3 删除任务和所有子任务
|
||||
taskService.deleteTasks(convertList(childTaskList, Task::getId));
|
||||
|
||||
// 3. 记录日志到父任务中。先记录日志是因为,通过 handleParentTask 方法之后,任务可能被完成了,并且不存在了,会报异常,所以先记录
|
||||
|
Loading…
Reference in New Issue
Block a user