mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 18:15:56 +08:00
Merge branch 'future/flowable' of https://gitee.com/dromara/RuoYi-Vue-Plus into future/flowable
This commit is contained in:
commit
d6e0e812b5
@ -4,7 +4,6 @@ import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@ -16,6 +15,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -73,7 +73,7 @@ public class ActProcessDefinitionController extends BaseController {
|
||||
public R<Map<String, Object>> getXml(@NotBlank(message = "流程定义id不能为空") @PathVariable String processDefinitionId) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
String xmlStr = actProcessDefinitionService.processDefinitionXml(processDefinitionId);
|
||||
map.put("xml", StringUtils.splitList("\n"));
|
||||
map.put("xml", Arrays.asList(xmlStr.split("\n")));
|
||||
map.put("xmlStr", xmlStr);
|
||||
return R.ok(map);
|
||||
}
|
||||
|
||||
@ -56,6 +56,16 @@ public class TestLeaveBo extends BaseEntity {
|
||||
@NotNull(message = "请假天数不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Integer leaveDays;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Integer startLeaveDays;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Integer endLeaveDays;
|
||||
|
||||
/**
|
||||
* 请假原因
|
||||
*/
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
package org.dromara.workflow.listener;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.engine.delegate.DelegateExecution;
|
||||
import org.flowable.engine.delegate.ExecutionListener;
|
||||
import org.flowable.task.api.Task;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 流程实例监听测试
|
||||
*
|
||||
* @author may
|
||||
* @date 2023-12-12
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Component("testLeaveExecutionListener")
|
||||
public class TestLeaveExecutionListener implements ExecutionListener {
|
||||
|
||||
private final TaskService taskService;
|
||||
|
||||
@Override
|
||||
public void notify(DelegateExecution execution) {
|
||||
Task task = taskService.createTaskQuery().executionId(execution.getId()).singleResult();
|
||||
log.info("执行监听【" + task.getName() + "】");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package org.dromara.workflow.listener;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.flowable.task.service.delegate.TaskListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 流程任务监听测试
|
||||
*
|
||||
* @author may
|
||||
* @date 2023-12-12
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("testLeaveTaskListener")
|
||||
public class TestLeaveTaskListener implements TaskListener {
|
||||
@Override
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
log.info("执行监听【" + delegateTask.getName() + "】");
|
||||
}
|
||||
}
|
||||
@ -31,10 +31,7 @@ import org.dromara.workflow.flowable.cmd.ExecutionChildByExecutionIdCmd;
|
||||
import org.dromara.workflow.service.IActHiProcinstService;
|
||||
import org.dromara.workflow.service.IActProcessInstanceService;
|
||||
import org.dromara.workflow.utils.WorkflowUtils;
|
||||
import org.flowable.bpmn.model.BpmnModel;
|
||||
import org.flowable.bpmn.model.FlowElement;
|
||||
import org.flowable.bpmn.model.GraphicInfo;
|
||||
import org.flowable.bpmn.model.UserTask;
|
||||
import org.flowable.bpmn.model.*;
|
||||
import org.flowable.engine.*;
|
||||
import org.flowable.engine.history.HistoricActivityInstance;
|
||||
import org.flowable.engine.history.HistoricProcessInstance;
|
||||
@ -294,6 +291,18 @@ public class ActProcessInstanceServiceImpl implements IActProcessInstanceService
|
||||
graphicInfoVo.setNodeName(flowElement.getName());
|
||||
graphicInfoVos.add(graphicInfoVo);
|
||||
}
|
||||
if (flowElement instanceof SubProcess) {
|
||||
Collection<FlowElement> subFlowElements = ((SubProcess) flowElement).getFlowElements();
|
||||
for (FlowElement element : subFlowElements) {
|
||||
if (element instanceof UserTask) {
|
||||
GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(element.getId());
|
||||
GraphicInfoVo graphicInfoVo = BeanUtil.toBean(graphicInfo, GraphicInfoVo.class);
|
||||
graphicInfoVo.setNodeId(element.getId());
|
||||
graphicInfoVo.setNodeName(element.getName());
|
||||
graphicInfoVos.add(graphicInfoVo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//节点图形信息
|
||||
map.put("graphicInfoVos", graphicInfoVos);
|
||||
|
||||
@ -71,10 +71,10 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<TestLeave> buildQueryWrapper(TestLeaveBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<TestLeave> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLeaveType()), TestLeave::getLeaveType, bo.getLeaveType());
|
||||
lqw.eq(bo.getLeaveDays() != null, TestLeave::getLeaveDays, bo.getLeaveDays());
|
||||
lqw.ge(bo.getStartLeaveDays() != null,TestLeave::getLeaveDays, bo.getStartLeaveDays());
|
||||
lqw.le(bo.getEndLeaveDays() != null,TestLeave::getLeaveDays, bo.getEndLeaveDays());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
BIN
script/bpmn/请假流程(监听)-leave8.zip
Normal file
BIN
script/bpmn/请假流程(监听)-leave8.zip
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user