mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 04:08:43 +08:00 
			
		
		
		
	【功能优化】工作流:流程详情的重构 50%:梳理整体结构
This commit is contained in:
		@@ -35,8 +35,6 @@ public enum BpmSimpleModelNodeType implements IntArrayValuable {
 | 
			
		||||
 | 
			
		||||
    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModelNodeType::getType).toArray();
 | 
			
		||||
 | 
			
		||||
    public static final String BPMN_USER_TASK_TYPE = "userTask";
 | 
			
		||||
 | 
			
		||||
    private final Integer type;
 | 
			
		||||
    private final String bpmnType;
 | 
			
		||||
    private final String name;
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,8 @@ Authorization: Bearer {{token}}
 | 
			
		||||
### 请求 /bpm/process-instance/get-bpmn 接口 => 失败
 | 
			
		||||
#GET {{baseUrl}}/bpm/process-instance/get-approval-detail?processInstanceId=1d5fb5a6-85f8-11ef-b717-7e93075f94e3
 | 
			
		||||
#GET {{baseUrl}}/bpm/process-instance/get-approval-detail?processInstanceId=3ee5c5ba-904a-11ef-a76e-b2ed5d6ef911
 | 
			
		||||
GET {{baseUrl}}/bpm/process-instance/get-approval-detail?processInstanceId=f630dfa2-8f92-11ef-947c-ba5e239a6eb4
 | 
			
		||||
#GET {{baseUrl}}/bpm/process-instance/get-approval-detail?processInstanceId=f630dfa2-8f92-11ef-947c-ba5e239a6eb4
 | 
			
		||||
GET {{baseUrl}}/bpm/process-instance/get-approval-detail?processInstanceId=9de8bdbf-9133-11ef-ae97-eaf49df1f932
 | 
			
		||||
Content-Type: application/json
 | 
			
		||||
tenant-id: 1
 | 
			
		||||
Authorization: Bearer {{token}}
 | 
			
		||||
@@ -6,15 +6,20 @@ import io.swagger.v3.oas.annotations.media.Schema;
 | 
			
		||||
import jakarta.validation.constraints.AssertTrue;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
 | 
			
		||||
@Schema(description = "管理后台 - 审批详情 Request VO")
 | 
			
		||||
@Data
 | 
			
		||||
public class BpmApprovalDetailReqVO {
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "流程定义的编号", example = "1024")
 | 
			
		||||
    private String processDefinitionId; // 发起流程的时候传流程定义 ID
 | 
			
		||||
    private String processDefinitionId; // 使用场景:发起流程时,传流程定义 ID
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "流程实例的编号", example = "1024")
 | 
			
		||||
    private String processInstanceId;  // 流程已发起时候传流程实例 ID
 | 
			
		||||
    private String processInstanceId;  // 使用场景:流程已发起时候传流程实例 ID
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "流程变量")
 | 
			
		||||
    private Map<String, Object> processVariable; // 使用场景:同 processDefinitionId,用于流程预测
 | 
			
		||||
 | 
			
		||||
    // TODO @芋艿:如果未来 BPMN 增加流程图,它没有发起人节点,会有问题。
 | 
			
		||||
    @Schema(description = "流程活动编号", example = "StartUserNode")
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance;
 | 
			
		||||
import cn.iocoder.yudao.module.bpm.controller.admin.base.user.UserSimpleBaseVO;
 | 
			
		||||
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionRespVO;
 | 
			
		||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskRespVO;
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonIgnore;
 | 
			
		||||
import io.swagger.v3.oas.annotations.media.Schema;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
@@ -73,9 +74,17 @@ public class BpmApprovalDetailRespVO {
 | 
			
		||||
        @Schema(description = "任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
 | 
			
		||||
        private String id;
 | 
			
		||||
 | 
			
		||||
        @Schema(description = "任务所属人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "1818")
 | 
			
		||||
        @JsonIgnore // 不返回,只是方便后续读取,赋值给 ownerUser
 | 
			
		||||
        private Long owner;
 | 
			
		||||
 | 
			
		||||
        @Schema(description = "任务所属人", example = "1024")
 | 
			
		||||
        private UserSimpleBaseVO ownerUser;
 | 
			
		||||
 | 
			
		||||
        @Schema(description = "任务分配人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "2048")
 | 
			
		||||
        @JsonIgnore // 不返回,只是方便后续读取,赋值给 assigneeUser
 | 
			
		||||
        private Long assignee;
 | 
			
		||||
 | 
			
		||||
        @Schema(description = "任务分配人", example = "2048")
 | 
			
		||||
        private UserSimpleBaseVO assigneeUser;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
 | 
			
		||||
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
 | 
			
		||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
 | 
			
		||||
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionRespVO;
 | 
			
		||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmApprovalDetailRespVO;
 | 
			
		||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceBpmnModelViewRespVO;
 | 
			
		||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceRespVO;
 | 
			
		||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskRespVO;
 | 
			
		||||
@@ -161,4 +162,12 @@ public interface BpmProcessInstanceConvert {
 | 
			
		||||
        return userVO;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    default BpmApprovalDetailRespVO.ApprovalTaskInfo buildApprovalTaskInfo(HistoricTaskInstance task) {
 | 
			
		||||
        if (task == null) {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
        return BeanUtils.toBean(task, BpmApprovalDetailRespVO.ApprovalTaskInfo.class)
 | 
			
		||||
                .setStatus(FlowableUtils.getTaskStatus(task)).setReason(FlowableUtils.getTaskReason(task));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -98,6 +98,17 @@ public class FlowableUtils {
 | 
			
		||||
        return (Integer) processVariables.get(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_STATUS);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获得流程实例的表单
 | 
			
		||||
     *
 | 
			
		||||
     * @param processInstance 流程实例
 | 
			
		||||
     * @return 表单
 | 
			
		||||
     */
 | 
			
		||||
    public static Map<String, Object> getProcessInstanceFormVariable(ProcessInstance processInstance) {
 | 
			
		||||
        Map<String, Object> processVariables = new HashMap<>(processInstance.getProcessVariables());
 | 
			
		||||
        return filterProcessInstanceFormVariable(processVariables);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获得流程实例的表单
 | 
			
		||||
     *
 | 
			
		||||
@@ -105,9 +116,8 @@ public class FlowableUtils {
 | 
			
		||||
     * @return 表单
 | 
			
		||||
     */
 | 
			
		||||
    public static Map<String, Object> getProcessInstanceFormVariable(HistoricProcessInstance processInstance) {
 | 
			
		||||
        Map<String, Object> formVariables = new HashMap<>(processInstance.getProcessVariables());
 | 
			
		||||
        filterProcessInstanceFormVariable(formVariables);
 | 
			
		||||
        return formVariables;
 | 
			
		||||
        Map<String, Object> processVariables = new HashMap<>(processInstance.getProcessVariables());
 | 
			
		||||
        return filterProcessInstanceFormVariable(processVariables);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user