Merge remote-tracking branch 'base-version/main' into test
# Conflicts: # zt-module-bpm/zt-module-bpm-server/src/main/java/com/zt/plat/module/bpm/api/task/BpmProcessInstanceApiImpl.java # zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/service/auth/AdminAuthServiceImpl.java
This commit is contained in:
@@ -1,19 +1,16 @@
|
||||
package com.zt.plat.module.bpm.api.task;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.zt.plat.module.bpm.api.task.dto.BpmTaskApproveReqDTO;
|
||||
import com.zt.plat.module.bpm.api.task.dto.BpmTaskRejectReqDTO;
|
||||
import com.zt.plat.module.bpm.api.task.dto.*;
|
||||
import com.zt.plat.module.bpm.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 流程实例")
|
||||
@@ -27,6 +24,37 @@ public interface BpmProcessInstanceApi {
|
||||
CommonResult<String> createProcessInstance(@RequestParam("userId") Long userId,
|
||||
@Valid @RequestBody BpmProcessInstanceCreateReqDTO reqDTO);
|
||||
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "获得指定流程实例", description = "在【流程详细】界面中,进行调用")
|
||||
@Parameter(name = "id", description = "流程实例的编号", required = true)
|
||||
CommonResult<BpmProcessInstanceRespDTO> getProcessInstance(@RequestParam("id") String id);
|
||||
|
||||
@DeleteMapping(PREFIX + "/cancel-by-start-user")
|
||||
@Operation(summary = "用户取消流程实例", description = "取消发起的流程")
|
||||
CommonResult<Boolean> cancelProcessInstanceByStartUser(
|
||||
@RequestParam("userId") Long userId,
|
||||
@Valid @RequestBody BpmProcessInstanceCancelReqDTO cancelReqDTO);
|
||||
|
||||
@DeleteMapping(PREFIX + "/cancel-by-admin")
|
||||
@Operation(summary = "管理员取消流程实例", description = "管理员撤回流程")
|
||||
CommonResult<Boolean> cancelProcessInstanceByAdmin(
|
||||
@RequestParam("userId") Long userId,
|
||||
@Valid @RequestBody BpmProcessInstanceCancelReqDTO cancelReqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/get-approval-detail")
|
||||
@Operation(summary = "获得审批详情")
|
||||
CommonResult<BpmApprovalDetailRespDTO> getApprovalDetail(@RequestParam("userId") Long userId,
|
||||
@Valid BpmApprovalDetailReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/get-next-approval-nodes")
|
||||
@Operation(summary = "获取下一个执行的流程节点")
|
||||
CommonResult<List<BpmApprovalDetailRespDTO.ActivityNode>> getNextApprovalNodes(@RequestParam("userId") Long userId,
|
||||
@Valid BpmApprovalDetailReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/get-bpmn-model-view")
|
||||
@Operation(summary = "获取流程实例的 BPMN 模型视图", description = "在【流程详细】界面中,进行调用")
|
||||
@Parameter(name = "id", description = "流程实例的编号", required = true)
|
||||
CommonResult<BpmProcessInstanceBpmnModelViewRespDTO> getProcessInstanceBpmnModelView(@RequestParam(value = "id") String id);
|
||||
|
||||
@PutMapping(PREFIX + "/approveTask")
|
||||
@Operation(summary = "通过任务")
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.zt.plat.module.bpm.api.task.dto;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.AssertTrue;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "RPC 服务 - 审批详情 Request DTO")
|
||||
@Data
|
||||
public class BpmApprovalDetailReqDTO {
|
||||
|
||||
@Schema(description = "流程定义的编号", example = "1024")
|
||||
private String processDefinitionId; // 使用场景:发起流程时,传流程定义 ID
|
||||
|
||||
@Schema(description = "流程变量")
|
||||
private Map<String, Object> processVariables; // 使用场景:同 processDefinitionId,用于流程预测
|
||||
|
||||
@Schema(description = "流程变量")
|
||||
private String processVariablesStr; // 解决 GET 无法传递对象的问题,最终转换成 processVariables 变量
|
||||
|
||||
@Schema(description = "流程实例的编号", example = "1024")
|
||||
private String processInstanceId; // 使用场景:流程已发起时候传流程实例 ID
|
||||
|
||||
// TODO @芋艿:如果未来 BPMN 增加流程图,它没有发起人节点,会有问题。
|
||||
@Schema(description = "流程活动编号", example = "StartUserNode")
|
||||
private String activityId; // 用于获取表单权限。1)发起流程时,传"发起人节点" activityId 可获取发起人的表单权限;2)从抄送列表界面进来时,传抄送的 activityId 可获取抄送人的表单权限;
|
||||
|
||||
@Schema(description = "流程任务编号", example = "95f2f08b-621b-11ef-bf39-00ff4722db8b")
|
||||
private String taskId; // 用于获取表单权限。1)从待审批/已审批界面进来时,传递 taskId 任务编号,可获取任务节点的变得权限
|
||||
|
||||
@AssertTrue(message = "流程定义的编号和流程实例的编号不能同时为空")
|
||||
@JsonIgnore
|
||||
public boolean isValidProcessParam() {
|
||||
return StrUtil.isNotEmpty(processDefinitionId) || StrUtil.isNotEmpty(processInstanceId);
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,55 @@
|
||||
package com.zt.plat.module.bpm.api.task.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "RPC 服务 - 流程定义 Response DTO")
|
||||
@Data
|
||||
public class BpmProcessDefinitionRespDTO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "流程标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "process_order")
|
||||
private String key;
|
||||
|
||||
@Schema(description = "流程名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "请假流程")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "流程描述", example = "请假流程描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "流程分类", requiredMode = Schema.RequiredMode.REQUIRED, example = "oa")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "表单类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer formType;
|
||||
|
||||
@Schema(description = "表单编号", example = "1024")
|
||||
private Long formId;
|
||||
|
||||
@Schema(description = "表单的配置", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String formConf;
|
||||
|
||||
@Schema(description = "表单项的数组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<String> formFields;
|
||||
|
||||
@Schema(description = "表单项的 JSON 数组字符串", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String formFieldsStr;
|
||||
|
||||
@Schema(description = "BPMN XML", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String bpmnXml;
|
||||
|
||||
@Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "是否挂起", requiredMode = Schema.RequiredMode.REQUIRED, example = "false")
|
||||
private Integer suspensionState;
|
||||
|
||||
@Schema(description = "部署时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime deploymentTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.zt.plat.module.bpm.api.task.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@Schema(description = "RPC 服务 - 流程示例的 BPMN 视图 Response DTO")
|
||||
@Data
|
||||
public class BpmProcessInstanceBpmnModelViewRespDTO {
|
||||
|
||||
// ========== 基本信息 ==========
|
||||
|
||||
@Schema(description = "流程实例信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private BpmProcessInstanceRespDTO processInstance;
|
||||
|
||||
@Schema(description = "任务列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<BpmTaskRespDTO> tasks;
|
||||
|
||||
@Schema(description = "BPMN XML", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String bpmnXml;
|
||||
|
||||
@Schema(description = "SIMPLE 模型")
|
||||
private BpmSimpleModelNodeDTO simpleModel;
|
||||
|
||||
// ========== 进度信息 ==========
|
||||
|
||||
@Schema(description = "进行中的活动节点编号集合", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Set<String> unfinishedTaskActivityIds; // 只包括 UserTask
|
||||
|
||||
@Schema(description = "已经完成的活动节点编号集合", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Set<String> finishedTaskActivityIds; // 包括 UserTask、Gateway 等,不包括 SequenceFlow
|
||||
|
||||
@Schema(description = "已经完成的连线节点编号集合", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Set<String> finishedSequenceFlowActivityIds; // 只包括 SequenceFlow
|
||||
|
||||
@Schema(description = "已经拒绝的活动节点编号集合", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Set<String> rejectedTaskActivityIds; // 只包括 UserTask
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.zt.plat.module.bpm.api.task.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "RPC 服务 - 流程实例的取消 Request DTO")
|
||||
@Data
|
||||
public class BpmProcessInstanceCancelReqDTO {
|
||||
|
||||
@Schema(description = "流程实例的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotEmpty(message = "流程实例的编号不能为空")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "取消原因", requiredMode = Schema.RequiredMode.REQUIRED, example = "不请假了!")
|
||||
@NotEmpty(message = "取消原因不能为空")
|
||||
private String reason;
|
||||
|
||||
}
|
||||
@@ -22,6 +22,9 @@ public class BpmProcessInstancePageReqDTO extends PageParam {
|
||||
@Schema(description = "流程定义的编号", example = "2048")
|
||||
private String processDefinitionId;
|
||||
|
||||
@Schema(description = "流程定义的标识", example = "2048")
|
||||
private String processDefinitionKey; // 精准匹配
|
||||
|
||||
@Schema(description = "流程分类", example = "1")
|
||||
private String category;
|
||||
|
||||
@@ -35,4 +38,14 @@ public class BpmProcessInstancePageReqDTO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] endTime;
|
||||
|
||||
@Schema(description = "发起用户编号", example = "1024")
|
||||
private Long startUserId; // 注意,只有在【流程实例】菜单,才使用该参数
|
||||
|
||||
@Schema(description = "动态表单字段查询 JSON Str", example = "{}")
|
||||
private String formFieldsParams; // SpringMVC 在 get 请求下,无法方便的定义 Map 类型的参数,所以通过 String 接收后,逻辑里面转换
|
||||
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.zt.plat.module.bpm.api.task.dto;
|
||||
|
||||
import com.zt.plat.framework.common.core.KeyValue;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "RPC 服务 - 流程实例 Response DTO")
|
||||
@@ -16,23 +19,26 @@ public class BpmProcessInstanceRespDTO {
|
||||
@Schema(description = "流程实例的名字", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "流程摘要")
|
||||
private List<KeyValue<String, String>> summary; // 只有流程表单,才有摘要!
|
||||
|
||||
@Schema(description = "流程定义的编号", example = "2048")
|
||||
private String processDefinitionId;
|
||||
|
||||
@Schema(description = "流程分类", example = "1")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "流程分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "请假")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "流程实例的状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "流程实例的结果", example = "1")
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "提交的表单值", example = "{\"name\": \"芋艿\"}")
|
||||
private Map<String, Object> formVariables;
|
||||
|
||||
@Schema(description = "业务的唯一标识", example = "1")
|
||||
private String businessKey;
|
||||
@Schema(description = "发起时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
@@ -43,4 +49,44 @@ public class BpmProcessInstanceRespDTO {
|
||||
@Schema(description = "持续时间", example = "1000")
|
||||
private Long durationInMillis;
|
||||
|
||||
@Schema(description = "提交的表单值", example = "{\"name\": \"芋艿\"}")
|
||||
private Map<String, Object> formVariables;
|
||||
|
||||
@Schema(description = "业务的唯一标识", example = "1")
|
||||
private String businessKey;
|
||||
|
||||
/**
|
||||
* 发起流程的用户
|
||||
*/
|
||||
private UserSimpleDTO startUser;
|
||||
|
||||
/**
|
||||
* 流程定义
|
||||
*/
|
||||
private BpmProcessDefinitionRespDTO processDefinition;
|
||||
|
||||
/**
|
||||
* 当前审批中的任务
|
||||
*/
|
||||
private List<Task> tasks; // 仅在流程实例分页才返回
|
||||
|
||||
@Schema(description = "流程任务")
|
||||
@Data
|
||||
public static class Task {
|
||||
|
||||
@Schema(description = "流程任务的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "任务名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "任务分配人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "2048")
|
||||
@JsonIgnore // 不返回,只是方便后续读取,赋值给 assigneeUser
|
||||
private Long assignee;
|
||||
|
||||
@Schema(description = "任务分配人", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "2048")
|
||||
private UserSimpleDTO assigneeUser;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zt.plat.module.bpm.api.task.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "RPC 服务 - 简单模型节点 DTO")
|
||||
@Data
|
||||
public class BpmSimpleModelNodeDTO {
|
||||
|
||||
@Schema(description = "节点编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "StartNode")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "节点名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "开始节点")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "节点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "节点属性")
|
||||
private Map<String, Object> attributes;
|
||||
|
||||
@Schema(description = "子节点列表")
|
||||
private List<BpmSimpleModelNodeDTO> childNode;
|
||||
|
||||
@Schema(description = "条件节点列表")
|
||||
private List<BpmSimpleModelNodeDTO> conditionNodes;
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user