update - JSON 转换功能中的多实例选人的表达式

This commit is contained in:
wangli 2023-07-13 19:04:54 +08:00
parent b039f72b89
commit 70753de459
7 changed files with 174 additions and 151 deletions

View File

@ -19,5 +19,4 @@ public interface BpmConstants {
String PROCESS_PREFIX="Flowable";
String START_EVENT_ID="startEventNode";
String END_EVENT_ID="endEventNode";
String EXPRESSION_CLASS="exUtils.";
}

View File

@ -22,7 +22,6 @@ import java.util.*;
import java.util.stream.Collectors;
import static cn.axzo.workflow.core.common.BpmConstants.END_EVENT_ID;
import static cn.axzo.workflow.core.common.BpmConstants.EXPRESSION_CLASS;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.BPM_META_DATA_FORMAT_ERROR;
import static org.flowable.bpmn.model.ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION;
@ -31,10 +30,10 @@ public class BpmTransformUtil {
public static byte[] transformBpmnJsonToXml(BpmJsonNode bpmnJson, Model model) {
// JSONObject bpmnJson = (JSONObject) updateReqVO.getBpmnJson();
// JSONObject bpmnJson = (JSONObject) updateReqVO.getBpmnJson();
BpmnModel bpmnModel =new BpmnModel();
Process process=new Process();
BpmnModel bpmnModel = new BpmnModel();
Process process = new Process();
bpmnModel.addProcess(process);
process.setId(model.getKey());
@ -48,25 +47,26 @@ public class BpmTransformUtil {
}
List<SequenceFlow> sequenceFlows = Lists.newArrayList();
Map<String,BpmJsonNode> childNodeMap=new HashMap<>();
// JSONObject jsonObject = (JSONObject) JSONObject.toJSON(bpmnJson);
// ExtensionAttribute extensionAttribute=new ExtensionAttribute();
// extensionAttribute.setName("TestName");
// extensionAttribute.setNamespace("http://flowable.org/bpmn");
// extensionAttribute.setValue(bpmnJson.toJSONString());
//// process.addAttribute(extensionAttribute);
// JSONObject processNodes = bpmnJson.getJSONObject("nodeConfig");
Map<String, BpmJsonNode> childNodeMap = new HashMap<>();
// JSONObject jsonObject = (JSONObject) JSONObject.toJSON(bpmnJson);
// ExtensionAttribute extensionAttribute=new ExtensionAttribute();
// extensionAttribute.setName("TestName");
// extensionAttribute.setNamespace("http://flowable.org/bpmn");
// extensionAttribute.setValue(bpmnJson.toJSONString());
//// process.addAttribute(extensionAttribute);
// JSONObject processNodes = bpmnJson.getJSONObject("nodeConfig");
String lastNode = null;
try {
lastNode = create(startEvent.getId(), bpmnJson.getChildren(),process, bpmnModel, sequenceFlows, childNodeMap);
lastNode = create(startEvent.getId(), bpmnJson.getChildren(), process, bpmnModel, sequenceFlows,
childNodeMap);
} catch (Exception e) {
e.printStackTrace();
throw new WorkflowEngineException(BPM_META_DATA_FORMAT_ERROR);
}
EndEvent endEvent = createEndEvent();
process.addFlowElement(endEvent);
process.addFlowElement(connect(lastNode, endEvent.getId(),sequenceFlows, childNodeMap, process));
process.addFlowElement(connect(lastNode, endEvent.getId(), sequenceFlows, childNodeMap, process));
new BpmnAutoLayout(bpmnModel).execute();
@ -86,25 +86,26 @@ public class BpmTransformUtil {
return serviceTask;
}
public static SequenceFlow connect(String from, String to,List<SequenceFlow> sequenceFlows,Map<String,BpmJsonNode> childNodeMap,Process process) {
public static SequenceFlow connect(String from, String to, List<SequenceFlow> sequenceFlows, Map<String,
BpmJsonNode> childNodeMap, Process process) {
SequenceFlow flow = new SequenceFlow();
String sequenceFlowId = id("sequenceFlow");
if(process.getFlowElement(from) !=null && process.getFlowElement(from) instanceof ExclusiveGateway){
String sequenceFlowId = id("sequenceFlow");
if (process.getFlowElement(from) != null && process.getFlowElement(from) instanceof ExclusiveGateway) {
BpmJsonNode childNode = childNodeMap.get(to);
if(childNode!=null){
if (childNode != null) {
String parentId = childNode.getParentId();
if(StringUtils.isNotBlank(parentId)){
if (StringUtils.isNotBlank(parentId)) {
BpmJsonNode parentNode = childNodeMap.get(parentId);
if(parentNode!=null){
if(BpmFlowNodeType.NODE_CONDITION.getType().equals(parentNode.getType()) ){
sequenceFlowId=parentNode.getId();
if (parentNode != null) {
if (BpmFlowNodeType.NODE_CONDITION.getType().equals(parentNode.getType())) {
sequenceFlowId = parentNode.getId();
flow.setName(parentNode.getName());
if(!ObjectUtils.isEmpty(parentNode.getProperty()) && !Boolean.TRUE.equals(parentNode.getProperty().getDefaultCondition())){
if (!ObjectUtils.isEmpty(parentNode.getProperty()) && !Boolean.TRUE.equals(parentNode.getProperty().getDefaultCondition())) {
//解析条件表达式
StringBuffer conditionExpression=new StringBuffer();
conditionExpression.append("${ ( ");
conditionExpression.append(EXPRESSION_CLASS+"numberEquals("+parentNode.getProperty().getConditionBranchKey()+","+parentNode.getProperty().getConditionBranchValue()+") ");
conditionExpression.append(" ) }");
StringBuffer conditionExpression = new StringBuffer();
conditionExpression.append("${ ");
conditionExpression.append("var:eq('" + parentNode.getProperty().getConditionBranchKey() + "', " + parentNode.getProperty().getConditionBranchValue() + ") ");
conditionExpression.append(" }");
flow.setConditionExpression(conditionExpression.toString());
}
@ -127,56 +128,58 @@ public class BpmTransformUtil {
}
public static String create(String fromId, BpmJsonNode flowNode, Process process,BpmnModel bpmnModel,List<SequenceFlow> sequenceFlows,Map<String,BpmJsonNode> childNodeMap) throws InvocationTargetException, IllegalAccessException {
public static String create(String fromId, BpmJsonNode flowNode, Process process, BpmnModel bpmnModel,
List<SequenceFlow> sequenceFlows, Map<String, BpmJsonNode> childNodeMap) throws InvocationTargetException, IllegalAccessException {
String nodeType = flowNode.getType();
if (BpmFlowNodeType.NODE_ROUTER.isEqual(nodeType)) {
return createExclusiveGatewayBuilder(fromId, flowNode,process,bpmnModel,sequenceFlows,childNodeMap);
return createExclusiveGatewayBuilder(fromId, flowNode, process, bpmnModel, sequenceFlows, childNodeMap);
} else if (BpmFlowNodeType.NODE_TASK.isEqual(nodeType)) {
childNodeMap.put(flowNode.getId(),flowNode);
childNodeMap.put(flowNode.getId(), flowNode);
Map incoming = flowNode.getIncoming();
incoming.put("incoming", Collections.singletonList(fromId));
String id = createTask(process,flowNode,sequenceFlows,childNodeMap);
String id = createTask(process, flowNode, sequenceFlows, childNodeMap);
// 如果当前任务还有后续任务则遍历创建后续任务
BpmJsonNode children = flowNode.getChildren();
if (Objects.nonNull(children) &&StringUtils.isNotBlank(children.getId())) {
return create(id, children,process,bpmnModel,sequenceFlows,childNodeMap);
if (Objects.nonNull(children) && StringUtils.isNotBlank(children.getId())) {
return create(id, children, process, bpmnModel, sequenceFlows, childNodeMap);
} else {
return id;
}
}
else if(BpmFlowNodeType.NODE_STARTER.isEqual(nodeType)){
childNodeMap.put(flowNode.getId(),flowNode);
} else if (BpmFlowNodeType.NODE_STARTER.isEqual(nodeType)) {
childNodeMap.put(flowNode.getId(), flowNode);
Map incoming = flowNode.getIncoming();
incoming.put("incoming", Collections.singletonList(fromId));
String id = createTask(process,flowNode,sequenceFlows,childNodeMap);
String id = createTask(process, flowNode, sequenceFlows, childNodeMap);
// 如果当前任务还有后续任务则遍历创建后续任务
BpmJsonNode children = flowNode.getChildren();
if (Objects.nonNull(children) &&StringUtils.isNotBlank(children.getId())) {
return create(id, children,process,bpmnModel,sequenceFlows,childNodeMap);
if (Objects.nonNull(children) && StringUtils.isNotBlank(children.getId())) {
return create(id, children, process, bpmnModel, sequenceFlows, childNodeMap);
} else {
return id;
}
}
else {
} else {
throw new RuntimeException("未知节点类型: nodeType=" + nodeType);
}
}
public static ExclusiveGateway createExclusiveGateWayEnd(String id){
ExclusiveGateway exclusiveGateway=new ExclusiveGateway();
public static ExclusiveGateway createExclusiveGateWayEnd(String id) {
ExclusiveGateway exclusiveGateway = new ExclusiveGateway();
exclusiveGateway.setId(id);
return exclusiveGateway;
}
private static String createExclusiveGatewayBuilder(String formId, BpmJsonNode flowNode,Process process,BpmnModel bpmnModel,List<SequenceFlow> sequenceFlows,Map<String,BpmJsonNode> childNodeMap) throws InvocationTargetException, IllegalAccessException {
childNodeMap.put(flowNode.getId(),flowNode);
String name =flowNode.getName();
private static String createExclusiveGatewayBuilder(String formId, BpmJsonNode flowNode, Process process,
BpmnModel bpmnModel, List<SequenceFlow> sequenceFlows,
Map<String, BpmJsonNode> childNodeMap) throws InvocationTargetException, IllegalAccessException {
childNodeMap.put(flowNode.getId(), flowNode);
String name = flowNode.getName();
String exclusiveGatewayId = flowNode.getId();
ExclusiveGateway exclusiveGateway = new ExclusiveGateway();
exclusiveGateway.setId(exclusiveGatewayId);
exclusiveGateway.setName(name);
process.addFlowElement(exclusiveGateway);
process.addFlowElement(connect(formId, exclusiveGatewayId,sequenceFlows,childNodeMap,process));
process.addFlowElement(connect(formId, exclusiveGatewayId, sequenceFlows, childNodeMap, process));
if (Objects.isNull(flowNode.getBranches()) && Objects.isNull(flowNode.getChildren())) {
return exclusiveGatewayId;
@ -187,25 +190,25 @@ public class BpmTransformUtil {
for (BpmJsonNode element : flowNodes) {
if (!ObjectUtils.isEmpty(element.getProperty())) {
Boolean typeElse = element.getProperty().getDefaultCondition();
if(Boolean.TRUE.equals(typeElse)){
if (Boolean.TRUE.equals(typeElse)) {
exclusiveGateway.setDefaultFlow(element.getId());
}
}
childNodeMap.put(element.getId(),element);
childNodeMap.put(element.getId(), element);
BpmJsonNode childNode = element.getChildren();
String nodeName = element.getName();
if (!ObjectUtils.isEmpty(element.getProperty()) && (Objects.isNull(childNode) || StringUtils.isBlank(childNode.getId()))) {
if (!ObjectUtils.isEmpty(element.getProperty()) && (Objects.isNull(childNode) || StringUtils.isBlank(childNode.getId()))) {
incoming.add(exclusiveGatewayId);
Map condition = new HashMap();
//解析条件表达式
StringBuffer conditionExpression=new StringBuffer();
conditionExpression.append("${ ( ");
conditionExpression.append(EXPRESSION_CLASS+"numberEquals("+element.getProperty().getConditionBranchKey()+","+element.getProperty().getConditionBranchValue()+") ");
conditionExpression.append(" ) }");
StringBuffer conditionExpression = new StringBuffer();
conditionExpression.append("${ ");
conditionExpression.append( "var:eq('" + element.getProperty().getConditionBranchKey() + "', " + element.getProperty().getConditionBranchValue() + ") ");
conditionExpression.append(" }");
condition.put("nodeName", nodeName);
condition.put("expression", conditionExpression.toString());
@ -215,8 +218,9 @@ public class BpmTransformUtil {
// 只生成一个任务同时设置当前任务的条件
Map incomingObj = childNode.getIncoming();
incomingObj.put("incoming", Collections.singletonList(exclusiveGatewayId));
String identifier = create(exclusiveGatewayId, childNode,process,bpmnModel,sequenceFlows,childNodeMap);
List<SequenceFlow> flows = sequenceFlows.stream().filter(flow -> StringUtils.equals(exclusiveGatewayId, flow.getSourceRef()))
String identifier = create(exclusiveGatewayId, childNode, process, bpmnModel, sequenceFlows, childNodeMap);
List<SequenceFlow> flows = sequenceFlows.stream().filter(flow -> StringUtils.equals(exclusiveGatewayId,
flow.getSourceRef()))
.collect(Collectors.toList());
flows.stream().forEach(
e -> {
@ -225,9 +229,10 @@ public class BpmTransformUtil {
}
// 设置条件表达式
// TODO 不知道什么意思
// if (Objects.isNull(e.getConditionExpression()) && StringUtils.isNotBlank(expression)) {
// e.setConditionExpression(expression);
// }
// if (Objects.isNull(e.getConditionExpression()) && StringUtils
// .isNotBlank(expression)) {
// e.setConditionExpression(expression);
// }
}
);
if (Objects.nonNull(identifier)) {
@ -238,87 +243,86 @@ public class BpmTransformUtil {
BpmJsonNode childNode = flowNode.getChildren();
if (Objects.nonNull(childNode) &&StringUtils.isNotBlank(childNode.getId()) ) {
if (Objects.nonNull(childNode) && StringUtils.isNotBlank(childNode.getId())) {
String parentId = childNode.getParentId();
BpmJsonNode parentChildNode = childNodeMap.get(parentId);
if(BpmFlowNodeType.NODE_ROUTER.getType().equals(parentChildNode.getType())){
String endExId= parentChildNode.getId()+"end";
process.addFlowElement(createExclusiveGateWayEnd(endExId));
if (incoming == null || incoming.isEmpty()) {
return create(exclusiveGatewayId, childNode, process, bpmnModel, sequenceFlows,
childNodeMap);
}
else {
Map incomingObj = childNode.getIncoming();
// 所有 service task 连接 end exclusive gateway
incomingObj.put("incoming", incoming);
FlowElement flowElement = bpmnModel.getFlowElement(incoming.get(0));
// 1.0 先进行边连接, 暂存 nextNode
BpmJsonNode nextNode = childNode.getChildren();
childNode.setChildren(null);
String identifier = endExId;
for (int i = 0; i < incoming.size(); i++) {
process.addFlowElement(connect(incoming.get(i), identifier, sequenceFlows,childNodeMap,process));
}
// 针对 gateway 空任务分支 添加条件表达式
if (!conditions.isEmpty()) {
FlowElement flowElement1 = bpmnModel.getFlowElement(identifier);
// 获取从 gateway 到目标节点 未设置条件表达式的节点
List<SequenceFlow> flows = sequenceFlows.stream().filter(
flow -> StringUtils.equals(flowElement1.getId(), flow.getTargetRef()))
.filter(
flow -> StringUtils.equals(flow.getSourceRef(), exclusiveGatewayId))
.collect(Collectors.toList());
flows.stream().forEach(sequenceFlow -> {
if (!conditions.isEmpty()) {
Map condition = conditions.get(0);
String nodeName = (String) condition.get("nodeName");
String expression = (String) condition.get("expression");
if (StringUtils.isBlank(sequenceFlow.getName()) && StringUtils
.isNotBlank(nodeName)) {
sequenceFlow.setName(nodeName);
}
// 设置条件表达式
if (Objects.isNull(sequenceFlow.getConditionExpression())
&& StringUtils.isNotBlank(expression)) {
sequenceFlow.setConditionExpression(expression);
}
conditions.remove(0);
}
});
}
// 1.1 边连接完成后在进行 nextNode 创建
if (Objects.nonNull(nextNode) &&StringUtils.isNotBlank(nextNode.getId())) {
return create(identifier, nextNode, process, bpmnModel, sequenceFlows,
childNodeMap);
} else {
return identifier;
}
}
if (BpmFlowNodeType.NODE_ROUTER.getType().equals(parentChildNode.getType())) {
String endExId = parentChildNode.getId() + "end";
process.addFlowElement(createExclusiveGateWayEnd(endExId));
if (incoming == null || incoming.isEmpty()) {
return create(exclusiveGatewayId, childNode, process, bpmnModel, sequenceFlows,
childNodeMap);
} else {
Map incomingObj = childNode.getIncoming();
// 所有 service task 连接 end exclusive gateway
incomingObj.put("incoming", incoming);
FlowElement flowElement = bpmnModel.getFlowElement(incoming.get(0));
// 1.0 先进行边连接, 暂存 nextNode
BpmJsonNode nextNode = childNode.getChildren();
childNode.setChildren(null);
String identifier = endExId;
for (int i = 0; i < incoming.size(); i++) {
process.addFlowElement(connect(incoming.get(i), identifier, sequenceFlows, childNodeMap,
process));
}
// 针对 gateway 空任务分支 添加条件表达式
if (!conditions.isEmpty()) {
FlowElement flowElement1 = bpmnModel.getFlowElement(identifier);
// 获取从 gateway 到目标节点 未设置条件表达式的节点
List<SequenceFlow> flows = sequenceFlows.stream().filter(
flow -> StringUtils.equals(flowElement1.getId(), flow.getTargetRef()))
.filter(
flow -> StringUtils.equals(flow.getSourceRef(), exclusiveGatewayId))
.collect(Collectors.toList());
flows.stream().forEach(sequenceFlow -> {
if (!conditions.isEmpty()) {
Map condition = conditions.get(0);
String nodeName = (String) condition.get("nodeName");
String expression = (String) condition.get("expression");
if (StringUtils.isBlank(sequenceFlow.getName()) && StringUtils
.isNotBlank(nodeName)) {
sequenceFlow.setName(nodeName);
}
// 设置条件表达式
if (Objects.isNull(sequenceFlow.getConditionExpression())
&& StringUtils.isNotBlank(expression)) {
sequenceFlow.setConditionExpression(expression);
}
conditions.remove(0);
}
});
}
// 1.1 边连接完成后在进行 nextNode 创建
if (Objects.nonNull(nextNode) && StringUtils.isNotBlank(nextNode.getId())) {
return create(identifier, nextNode, process, bpmnModel, sequenceFlows,
childNodeMap);
} else {
return identifier;
}
}
}
}
return exclusiveGatewayId;
}
private static String createTask(Process process,BpmJsonNode flowNode,List<SequenceFlow> sequenceFlows,Map<String,BpmJsonNode> childNodeMap) {
private static String createTask(Process process, BpmJsonNode flowNode, List<SequenceFlow> sequenceFlows,
Map<String, BpmJsonNode> childNodeMap) {
Map incomingJson = flowNode.getIncoming();
List<String> incoming = (List<String>) incomingJson.get("incoming");
// 自动生成id
// String id = id("serviceTask");
String id=flowNode.getId();
// String id = id("serviceTask");
String id = flowNode.getId();
if (incoming != null && !incoming.isEmpty()) {
UserTask userTask = new UserTask();
userTask.setName(flowNode.getName());
userTask.setId(id);
process.addFlowElement(userTask);
process.addFlowElement(connect(incoming.get(0), id,sequenceFlows,childNodeMap,process));
process.addFlowElement(connect(incoming.get(0), id, sequenceFlows, childNodeMap, process));
FlowableListener createTaskListener = new FlowableListener();
createTaskListener.setEvent(TaskListener.EVENTNAME_ALL_EVENTS);
@ -326,9 +330,8 @@ public class BpmTransformUtil {
// FIXME 如果监听器想设置多个,这里还需要额外处理
createTaskListener.setImplementation("${engineTaskEventListener}");
userTask.setTaskListeners(Arrays.asList(createTaskListener));
if("root".equalsIgnoreCase(id)){
}
else{
if ("root".equalsIgnoreCase(id)) {
} else {
ArrayList<FlowableListener> listeners = new ArrayList<>();
FlowableListener activitiListener = new FlowableListener();
activitiListener.setEvent(ExecutionListener.EVENTNAME_START);
@ -342,9 +345,10 @@ public class BpmTransformUtil {
BpmJsonNodeProperty property = flowNode.getProperty();
BpmFlowMultiMode mode = property.getMultiMode();
MultiInstanceLoopCharacteristics multiInstanceLoopCharacteristics = new MultiInstanceLoopCharacteristics();
MultiInstanceLoopCharacteristics multiInstanceLoopCharacteristics =
new MultiInstanceLoopCharacteristics();
// 审批人集合参数
multiInstanceLoopCharacteristics.setInputDataItem(userTask.getId()+"assigneeList");
multiInstanceLoopCharacteristics.setInputDataItem(userTask.getId() + "assigneeList");
// 迭代集合
multiInstanceLoopCharacteristics.setElementVariable("assigneeName");
// 并行
@ -352,10 +356,12 @@ public class BpmTransformUtil {
userTask.setAssignee("${assigneeName}");
// 设置多实例属性
userTask.setLoopCharacteristics(multiInstanceLoopCharacteristics);
if(BpmFlowMultiMode.OR.getType().equals(mode.getType())){
multiInstanceLoopCharacteristics.setCompletionCondition("${nrOfCompletedInstances/nrOfInstances > 0}");
} else if (BpmFlowMultiMode.AND.getType().equals(mode.getType())){
multiInstanceLoopCharacteristics.setCompletionCondition("${nrOfInstances == nrOfCompletedInstances}");
if (BpmFlowMultiMode.OR.getType().equals(mode.getType())) {
multiInstanceLoopCharacteristics.setCompletionCondition("${nrOfCompletedInstances" +
"/nrOfInstances > 0}");
} else if (BpmFlowMultiMode.AND.getType().equals(mode.getType())) {
multiInstanceLoopCharacteristics.setCompletionCondition("${nrOfInstances == " +
"nrOfCompletedInstances}");
}
}
}

View File

@ -39,12 +39,14 @@ public interface BpmTaskService {
/**
* 获取实例正在审核的人列表
*
* FIXME 该接口 web 不能正常响应
* */
List<Task> getActiveTasksByProcessInstanceId(String processInstanceId);
/**
* 获得流程任务列表
*
* FIXME 该接口 web 不能正常响应
* @param processInstanceIds 流程实例的编号数组
* @return 流程任务列表
*/

View File

@ -73,7 +73,7 @@ public class BpmPageParam implements Serializable {
} else if (!(o instanceof BpmPageParam)) {
return false;
} else {
BpmPageParam other = (BpmPageParam)o;
BpmPageParam other = (BpmPageParam) o;
if (!other.canEqual(this)) {
return false;
} else {

View File

@ -0,0 +1,19 @@
package cn.axzo.workflow.core.service.dto.request.task;
import cn.axzo.workflow.core.service.dto.request.BpmPageParam;
import lombok.Data;
/**
* TODO
*
* @author wangli
* @since 2023/7/13 16:38
*/
@Data
public class BpmTaskActivePageDTO extends BpmPageParam {
private String processInstanceId;
private String businessKey;
private Long identityId;
private String tenantId;
}

View File

@ -33,7 +33,7 @@ public class BpmTaskDelegateImpl implements BpmTaskDelegate {
assigners.add(user2);
}
if (Objects.equals("NODE1688636856136_0.05991425774293391_1", delegateTask.getTaskDefinitionKey())) {
if (Objects.equals("NODE1688636856135_0.9932837808231312_1", delegateTask.getTaskDefinitionKey())) {
BpmTaskDelegateAssigner user1 = new BpmTaskDelegateAssigner();
user1.setAssignerId("65712");
user1.setAssignerName("王汪");

View File

@ -23,35 +23,32 @@ public class BpmTaskController {
private BpmTaskService bpmTaskService;
/**
* 待审核列表
* */
*/
@GetMapping("/getTodoPage")
public CommonResponse<BpmPageResult<BpmTaskTodoPageItemRespVO>> getTodoTaskPage(@RequestBody BpmTaskTodoBpmPageDTO dto) {
log.info("待审核列表 getTodoTaskPage===>>>参数:{}", dto);
BpmPageResult<BpmTaskTodoPageItemRespVO> result=bpmTaskService.getTodoTaskPage(dto);
BpmPageResult<BpmTaskTodoPageItemRespVO> result = bpmTaskService.getTodoTaskPage(dto);
return CommonResponse.success(result);
}
/**
* 已完成的审批列表
* */
*/
@GetMapping("/getDonePage")
public CommonResponse<BpmPageResult<BpmTaskTodoPageItemRespVO>> getDoneTaskPage(@RequestBody BpmTaskTodoBpmPageDTO dto) {
log.info("已完成的审批列表 getDoneTaskPage===>>>参数:{}", dto);
BpmPageResult<BpmTaskTodoPageItemRespVO> result=bpmTaskService.getDoneTaskPage(dto);
BpmPageResult<BpmTaskTodoPageItemRespVO> result = bpmTaskService.getDoneTaskPage(dto);
return CommonResponse.success(result);
}
/**
* 同意
* */
*/
@PostMapping("/approve")
public CommonResponse approveTask(@RequestBody BpmTaskAuditDTO dto) {
public CommonResponse approveTask(@RequestBody BpmTaskAuditDTO dto) {
log.info("同意 approveTask===>>>参数:{}", dto);
bpmTaskService.approveTask(dto);
return CommonResponse.success();
@ -59,9 +56,9 @@ public class BpmTaskController {
/**
* 拒绝
* */
*/
@PostMapping("/reject")
public CommonResponse rejectTask(@RequestBody BpmTaskAuditDTO dto) {
public CommonResponse rejectTask(@RequestBody BpmTaskAuditDTO dto) {
log.info("拒绝 rejectTask===>>>参数:{}", dto);
bpmTaskService.rejectTask(dto);
return CommonResponse.success();
@ -74,17 +71,17 @@ public class BpmTaskController {
@GetMapping("/listByProcessInstanceId")
public CommonResponse<List<HistoricTaskInstance>> getTaskListByProcessInstanceId(@RequestBody String processInstanceId) {
log.info("获取历史已审批的列表详情 getTaskListByProcessInstanceId===>>>参数:{}", processInstanceId);
List<HistoricTaskInstance> result=bpmTaskService.getTaskListByProcessInstanceId(processInstanceId);
List<HistoricTaskInstance> result = bpmTaskService.getTaskListByProcessInstanceId(processInstanceId);
return CommonResponse.success(result);
}
/**
* 获取实例正在审核的人列表
* */
*/
@GetMapping("/active/listTasksByProcessInstanceId")
public CommonResponse<List<Task>> getActiveTasksByProcessInstanceId(@RequestBody String processInstanceId) {
log.info(" 获取实例正在审核的人列表 getActiveTasksByProcessInstanceId===>>>参数:{}", processInstanceId);
List<Task> result=bpmTaskService.getActiveTasksByProcessInstanceId(processInstanceId);
List<Task> result = bpmTaskService.getActiveTasksByProcessInstanceId(processInstanceId);
return CommonResponse.success(result);
}