feat: initial iShare project code
This commit is contained in:
37
pigx-flow/pigx-flow-task/pigx-flow-task-api/pom.xml
Normal file
37
pigx-flow/pigx-flow-task/pigx-flow-task-api/pom.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
||||
http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-flow-task</artifactId>
|
||||
<version>5.2.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-flow-task-api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!--core 工具类-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
</dependency>
|
||||
<!--mybatis plus extension,包含了mybatis plus core-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-extension</artifactId>
|
||||
</dependency>
|
||||
<!--feign 工具类-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-feign</artifactId>
|
||||
</dependency>
|
||||
<!-- excel 导入导出 -->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-excel</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.pig4cloud.pigx.flow.task.api.feign;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.dto.*;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2023/7/14
|
||||
*/
|
||||
@FeignClient(contextId = "remoteFlowEngineService", value = ServiceNameConstants.FLOW_ENGINE_SERVER)
|
||||
public interface RemoteFlowEngineService {
|
||||
|
||||
/**
|
||||
* 查询任务变量
|
||||
* @param variableQueryParamDto 变量查询参数
|
||||
* @return 任务变量结果
|
||||
*/
|
||||
@PostMapping("/task/queryTaskVariables")
|
||||
R<Map<String, Object>> queryTaskVariables(@RequestBody VariableQueryParamDto variableQueryParamDto);
|
||||
|
||||
/**
|
||||
* 查询简单数据
|
||||
* @param userId 用户ID
|
||||
* @return 索引页统计数据
|
||||
*/
|
||||
@GetMapping("/process-instance/querySimpleData")
|
||||
R<IndexPageStatistics> querySimpleData(@RequestParam("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 创建流程
|
||||
* @param map 流程JSON对象
|
||||
* @return 创建流程结果
|
||||
*/
|
||||
@PostMapping("/flow/create")
|
||||
R<String> createFlow(@RequestBody Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 启动流程实例
|
||||
* @param processInstanceParamDto 流程实例参数
|
||||
* @return 启动流程结果
|
||||
*/
|
||||
@PostMapping("/flow/start")
|
||||
R<String> startProcess(@RequestBody ProcessInstanceParamDto processInstanceParamDto);
|
||||
|
||||
/**
|
||||
* 查询待办任务
|
||||
* @param paramDto 任务查询参数
|
||||
* @return 待办任务列表
|
||||
*/
|
||||
@PostMapping("/flow/queryAssignTask")
|
||||
R<Page<TaskDto>> queryAssignTask(@RequestBody TaskQueryParamDto paramDto);
|
||||
|
||||
/**
|
||||
* 查询已完成任务
|
||||
* @param paramDto 任务查询参数
|
||||
* @return 已完成任务列表
|
||||
*/
|
||||
@PostMapping("/flow/queryCompletedTask")
|
||||
R<Page<TaskDto>> queryCompletedTask(@RequestBody TaskQueryParamDto paramDto);
|
||||
|
||||
/**
|
||||
* 完成任务
|
||||
* @param taskParamDto 任务参数
|
||||
* @return 完成任务结果
|
||||
*/
|
||||
@PostMapping("/task/complete")
|
||||
R<String> completeTask(@RequestBody TaskParamDto taskParamDto);
|
||||
|
||||
/**
|
||||
* 设置任务负责人
|
||||
* @param taskParamDto 任务参数
|
||||
* @return 设置负责人结果
|
||||
*/
|
||||
@PostMapping("/task/setAssignee")
|
||||
R<String> setAssignee(@RequestBody TaskParamDto taskParamDto);
|
||||
|
||||
/**
|
||||
* 停止流程实例
|
||||
* @param taskParamDto 任务参数
|
||||
* @return 停止流程实例结果
|
||||
*/
|
||||
@PostMapping("/flow/stopProcessInstance")
|
||||
R<String> stopProcessInstance(@RequestBody TaskParamDto taskParamDto);
|
||||
|
||||
/**
|
||||
* 解决任务
|
||||
* @param taskParamDto 任务参数
|
||||
* @return 解决任务结果
|
||||
*/
|
||||
@PostMapping("/task/resolveTask")
|
||||
R<String> resolveTask(@RequestBody TaskParamDto taskParamDto);
|
||||
|
||||
/**
|
||||
* 退回任务
|
||||
* @param taskParamDto 任务参数
|
||||
* @return 退回任务结果
|
||||
*/
|
||||
@PostMapping("/task/back")
|
||||
R<String> back(@RequestBody TaskParamDto taskParamDto);
|
||||
|
||||
/**
|
||||
* 委派任务
|
||||
* @param taskParamDto 任务参数
|
||||
* @return 委派任务结果
|
||||
*/
|
||||
@PostMapping("/task/delegateTask")
|
||||
R<String> delegateTask(@RequestBody TaskParamDto taskParamDto);
|
||||
|
||||
/**
|
||||
* 查询任务
|
||||
* @param taskId 任务ID
|
||||
* @param userId 用户ID
|
||||
* @return 任务查询结果
|
||||
*/
|
||||
@GetMapping("/task/engine/queryTask")
|
||||
R<TaskResultDto> queryTask(@RequestParam("taskId") String taskId, @RequestParam("userId") Long userId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.pig4cloud.pigx.flow.task.api.feign;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.dto.*;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2023/7/14
|
||||
*/
|
||||
@FeignClient(contextId = "remoteFlowTaskService", value = ServiceNameConstants.FLOW_TASK_SERVER)
|
||||
public interface RemoteFlowTaskService {
|
||||
|
||||
/**
|
||||
* 节点开始事件
|
||||
* @param nodeRecordParamDto
|
||||
*/
|
||||
@PostMapping("/remote/startNodeEvent")
|
||||
void startNodeEvent(@RequestBody ProcessNodeRecordParamDto nodeRecordParamDto);
|
||||
|
||||
/**
|
||||
* 节点结束事件
|
||||
* @param nodeRecordParamDto
|
||||
*/
|
||||
@PostMapping("/remote/endNodeEvent")
|
||||
void endNodeEvent(@RequestBody ProcessNodeRecordParamDto nodeRecordParamDto);
|
||||
|
||||
/**
|
||||
* 流程结束事件
|
||||
* @param processInstanceParamDto
|
||||
*/
|
||||
@PostMapping("/remote/endProcess")
|
||||
void endProcessEvent(@RequestBody ProcessInstanceParamDto processInstanceParamDto);
|
||||
|
||||
/**
|
||||
* 创建流程事件
|
||||
* @param processInstanceRecordParamDto
|
||||
*/
|
||||
@PostMapping("/remote/createProcessEvent")
|
||||
void createProcessEvent(@RequestBody ProcessInstanceRecordParamDto processInstanceRecordParamDto);
|
||||
|
||||
/**
|
||||
* 根据角色id集合查询用户id集合
|
||||
* @param roleIdList
|
||||
*/
|
||||
@PostMapping("/remote/queryUserIdListByRoleIdList")
|
||||
R<List<String>> queryUserIdListByRoleIdList(@RequestBody List<String> roleIdList);
|
||||
|
||||
/**
|
||||
* 根据部门id集合查询所有的用户id集合
|
||||
* @param deptIdList
|
||||
*/
|
||||
@PostMapping("/remote/queryUserIdListByDepIdList")
|
||||
R<List<String>> queryUserIdListByDepIdList(@RequestBody List<String> deptIdList);
|
||||
|
||||
/**
|
||||
* 查询流程管理员
|
||||
* @param flowId 流程id
|
||||
*/
|
||||
@GetMapping("/remote/queryProcessAdmin")
|
||||
R<Long> queryProcessAdmin(@RequestParam("flowId") String flowId);
|
||||
|
||||
/**
|
||||
* 查询节点数据
|
||||
* @param flowId 流程id
|
||||
* @param nodeId 节点id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/processNodeData/getNodeData")
|
||||
R<Node> queryNodeOriData(@RequestParam("flowId") String flowId, @RequestParam("nodeId") String nodeId);
|
||||
|
||||
/**
|
||||
* 节点开始指派用户了
|
||||
* @param processNodeRecordAssignUserParamDto
|
||||
*/
|
||||
@PostMapping("/remote/startAssignUser")
|
||||
R startAssignUser(@RequestBody ProcessNodeRecordAssignUserParamDto processNodeRecordAssignUserParamDto);
|
||||
|
||||
/**
|
||||
* 任务结束事件
|
||||
* @param processNodeRecordAssignUserParamDto
|
||||
*/
|
||||
@PostMapping("/remote/taskEndEvent")
|
||||
R taskEndEvent(@RequestBody ProcessNodeRecordAssignUserParamDto processNodeRecordAssignUserParamDto);
|
||||
|
||||
/**
|
||||
* 保存抄送数据
|
||||
* @param processCopyDto
|
||||
*/
|
||||
@PostMapping("/remote/savecc")
|
||||
R saveCC(@RequestBody ProcessCopyDto processCopyDto);
|
||||
|
||||
/**
|
||||
* 保存节点原始数据
|
||||
* @param processNodeDataDto
|
||||
*/
|
||||
@PostMapping("/processNodeData/saveNodeData")
|
||||
R saveNodeOriData(@RequestBody ProcessNodeDataDto processNodeDataDto);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
@author pigx archetype
|
||||
* <p>
|
||||
* feign client 存放目录,注意 @EnablePigxFeignClients 的扫描范围
|
||||
*/
|
||||
package com.pig4cloud.pigx.flow.task.api.feign;
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.pig4cloud.pigx.flow.task.constant;
|
||||
|
||||
/**
|
||||
* EasyCaptcha 验证码类型枚举
|
||||
*
|
||||
* @author haoxr
|
||||
* @since 2023/03/24
|
||||
*/
|
||||
public enum CaptchaTypeEnum {
|
||||
|
||||
/**
|
||||
* 算数
|
||||
*/
|
||||
ARITHMETIC,
|
||||
/**
|
||||
* 中文
|
||||
*/
|
||||
CHINESE,
|
||||
/**
|
||||
* 中文闪图
|
||||
*/
|
||||
CHINESE_GIF,
|
||||
/**
|
||||
* 闪图
|
||||
*/
|
||||
GIF, SPEC
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.pig4cloud.pigx.flow.task.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* 表单类型枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum FormTypeEnum {
|
||||
|
||||
INPUT("Input", "单行文本", ""), TEXTAREA("Textarea", "多行文本", ""), NUMBER("Number", "数字", null),
|
||||
DATE("Date", "日期", null), DATE_TIME("DateTime", "日期时间", null),
|
||||
|
||||
SEQUENCE("Sequence", "发号器", null), LAYOUT("Layout", "明细", null), TIME("Time", "时间", null),
|
||||
MONEY("Money", "金额", null), SINGLE_SELECT("SingleSelect", "单选", new ArrayList<>()),
|
||||
SELECT_DEPT("SelectDept", "部门", new ArrayList<>()), SELECT_USER("SelectUser", "用户", new ArrayList<>()),
|
||||
|
||||
;
|
||||
|
||||
private String type;
|
||||
|
||||
private String name;
|
||||
|
||||
private Object defaultValue;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.pig4cloud.pigx.flow.task.constant;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 枚举通用接口
|
||||
*
|
||||
* @author haoxr
|
||||
* @since 2022/3/27 12:06
|
||||
*/
|
||||
public interface IBaseEnum<T> {
|
||||
|
||||
T getValue();
|
||||
|
||||
String getLabel();
|
||||
|
||||
/**
|
||||
* 根据值获取枚举
|
||||
* @param value
|
||||
* @param clazz
|
||||
* @param <E> 枚举
|
||||
* @return
|
||||
*/
|
||||
static <E extends Enum<E> & IBaseEnum> E getEnumByValue(Object value, Class<E> clazz) {
|
||||
Objects.requireNonNull(value);
|
||||
EnumSet<E> allEnums = EnumSet.allOf(clazz); // 获取类型下的所有枚举
|
||||
E matchEnum = allEnums.stream().filter(e -> ObjectUtil.equal(e.getValue(), value)).findFirst().orElse(null);
|
||||
return matchEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文本标签获取值
|
||||
* @param value
|
||||
* @param clazz
|
||||
* @param <E>
|
||||
* @return
|
||||
*/
|
||||
static <E extends Enum<E> & IBaseEnum> String getLabelByValue(Object value, Class<E> clazz) {
|
||||
Objects.requireNonNull(value);
|
||||
EnumSet<E> allEnums = EnumSet.allOf(clazz); // 获取类型下的所有枚举
|
||||
E matchEnum = allEnums.stream().filter(e -> ObjectUtil.equal(e.getValue(), value)).findFirst().orElse(null);
|
||||
|
||||
String label = null;
|
||||
if (matchEnum != null) {
|
||||
label = matchEnum.getLabel();
|
||||
}
|
||||
return label;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文本标签获取值
|
||||
* @param label
|
||||
* @param clazz
|
||||
* @param <E>
|
||||
* @return
|
||||
*/
|
||||
static <E extends Enum<E> & IBaseEnum> Object getValueByLabel(String label, Class<E> clazz) {
|
||||
Objects.requireNonNull(label);
|
||||
EnumSet<E> allEnums = EnumSet.allOf(clazz); // 获取类型下的所有枚举
|
||||
String finalLabel = label;
|
||||
E matchEnum = allEnums.stream().filter(e -> ObjectUtil.equal(e.getLabel(), finalLabel)).findFirst()
|
||||
.orElse(null);
|
||||
|
||||
Object value = null;
|
||||
if (matchEnum != null) {
|
||||
value = matchEnum.getValue();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.pig4cloud.pigx.flow.task.constant;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 菜单类型枚举
|
||||
*
|
||||
* @author haoxr
|
||||
* @since 2022/4/23 9:36
|
||||
*/
|
||||
|
||||
public enum MenuTypeEnum implements IBaseEnum<Integer> {
|
||||
|
||||
NULL(0, null), MENU(1, "菜单"), CATALOG(2, "目录"), EXTLINK(3, "外链"), BUTTON(4, "按钮");
|
||||
|
||||
@Getter
|
||||
@EnumValue // Mybatis-Plus 提供注解表示插入数据库时插入该值
|
||||
private Integer value;
|
||||
|
||||
@Getter
|
||||
// @JsonValue // 表示对枚举序列化时返回此字段
|
||||
private String label;
|
||||
|
||||
MenuTypeEnum(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.pig4cloud.pigx.flow.task.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum NodeStatusEnum {
|
||||
|
||||
WKS(0, "未开始"), JXZ(1, "进行中"), YJS(2, "已结束"),;
|
||||
|
||||
private int code;
|
||||
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.pig4cloud.pigx.flow.task.constant;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 节点枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum NodeTypeEnum {
|
||||
|
||||
ROOT("根节点", 0, false), END("结束节点", -1, false),
|
||||
|
||||
APPROVAL("审批节点", 1, false), CC("抄送节点", 2, false), EXCLUSIVE_GATEWAY("条件分支", 4, true),
|
||||
|
||||
PARALLEL_GATEWAY("并行分支", 5, true), EMPTY("空", 3, false),
|
||||
|
||||
;
|
||||
|
||||
public static NodeTypeEnum getByValue(int value) {
|
||||
return Arrays.stream(NodeTypeEnum.values()).filter(w -> w.getValue() == value).findAny().orElse(null);
|
||||
}
|
||||
|
||||
NodeTypeEnum(String name, Integer value, Boolean branch) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.branch = branch;
|
||||
}
|
||||
|
||||
private String name;
|
||||
|
||||
private Integer value;
|
||||
|
||||
private Boolean branch;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.pig4cloud.pigx.flow.task.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 用户节点类型枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum NodeUserTypeEnum {
|
||||
|
||||
USER("user", "用户"), DEPT("dept", "部门"), ROLE("role", "角色"),;
|
||||
|
||||
private String key;
|
||||
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.pig4cloud.pigx.flow.task.constant;
|
||||
|
||||
public class ProcessInstanceConstant {
|
||||
|
||||
/**
|
||||
* 空执行人
|
||||
*/
|
||||
public static final Long DEFAULT_EMPTY_ASSIGN = -99999999L;
|
||||
|
||||
/**
|
||||
* 用户任务没有执行人的情况下如何处理 自动通过
|
||||
*/
|
||||
public static final String USER_TASK_NOBODY_HANDLER_TO_PASS = "TO_PASS";
|
||||
|
||||
/**
|
||||
* 转交给管理员
|
||||
*/
|
||||
public static final String USER_TASK_NOBODY_HANDLER_TO_ADMIN = "TO_ADMIN";
|
||||
|
||||
/**
|
||||
* 指定人员
|
||||
*/
|
||||
public static final String USER_TASK_NOBODY_HANDLER_TO_USER = "TO_USER";
|
||||
|
||||
/**
|
||||
* 结束流程
|
||||
*/
|
||||
public static final String USER_TASK_NOBODY_HANDLER_TO_END = "TO_END";
|
||||
|
||||
public static final String USER_TASK_NOBODY_HANDLER_TO_REFUSE = "TO_REFUSE";
|
||||
|
||||
/**
|
||||
* 拒绝之后 结束流程
|
||||
*/
|
||||
public static final String USER_TASK_REFUSE_TYPE_TO_END = "TO_END";
|
||||
|
||||
/**
|
||||
* 拒绝之后 到某个节点
|
||||
*/
|
||||
public static final String USER_TASK_REFUSE_TYPE_TO_NODE = "TO_NODE";
|
||||
|
||||
/**
|
||||
* 会签
|
||||
*/
|
||||
public static final int MULTIPLE_MODE_AL_SAME = 1;
|
||||
|
||||
/**
|
||||
* 或签
|
||||
*/
|
||||
public static final int MULTIPLE_MODE_ONE = 2;
|
||||
|
||||
/**
|
||||
* 顺签
|
||||
*/
|
||||
public static final int MULTIPLE_MODE_ALL_SORT = 3;
|
||||
|
||||
public static class AssignedTypeClass {
|
||||
|
||||
// 指定用户
|
||||
public static final int USER = 1;
|
||||
|
||||
// 指定主管
|
||||
public static final int LEADER = 2;
|
||||
|
||||
// 发起人自己
|
||||
public static final int SELF = 5;
|
||||
|
||||
// 表单人员
|
||||
public static final int FORM_USER = 8;
|
||||
|
||||
// 发起人自选
|
||||
public static final int SELF_SELECT = 4;
|
||||
|
||||
// 角色
|
||||
public static final int ROLE = 3;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 表单权限
|
||||
*/
|
||||
public static class FormPermClass {
|
||||
|
||||
// 隐藏
|
||||
public static final String HIDE = "H";
|
||||
|
||||
// 只读
|
||||
public static final String READ = "R";
|
||||
|
||||
// 编辑
|
||||
public static final String EDIT = "E";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.pig4cloud.pigx.flow.task.constant;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 状态枚举
|
||||
*
|
||||
* @author haoxr
|
||||
* @since 2022/10/14
|
||||
*/
|
||||
public enum StatusEnum implements IBaseEnum<Integer> {
|
||||
|
||||
ENABLE(1, "启用"), DISABLE(0, "禁用");
|
||||
|
||||
@Getter
|
||||
private Integer value;
|
||||
|
||||
@Getter
|
||||
private String label;
|
||||
|
||||
StatusEnum(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.pig4cloud.pigx.flow.task.constant;
|
||||
|
||||
/**
|
||||
* 系统常量
|
||||
*
|
||||
* @author haoxr
|
||||
* @since 2022/10/22
|
||||
*/
|
||||
public interface SystemConstants {
|
||||
|
||||
/**
|
||||
* 根节点ID
|
||||
*/
|
||||
Long ROOT_NODE_ID = 0L;
|
||||
|
||||
/**
|
||||
* 系统默认密码
|
||||
*/
|
||||
String DEFAULT_PASSWORD = "123456";
|
||||
|
||||
/**
|
||||
* 超级管理员角色编码
|
||||
*/
|
||||
String ROOT_ROLE_CODE = "ROOT";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* @author pigx archetype
|
||||
* <p>
|
||||
* 常量和枚举定义
|
||||
*/
|
||||
package com.pig4cloud.pigx.flow.task.constant;
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检查子部门DTO
|
||||
*/
|
||||
@Data
|
||||
public class CheckChildDto {
|
||||
|
||||
/**
|
||||
* 子部门ID
|
||||
*/
|
||||
private Long childId;
|
||||
|
||||
/**
|
||||
* 父部门ID列表
|
||||
*/
|
||||
private List<Long> deptIdList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检查是否是给定的父级
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class CheckParentDto {
|
||||
|
||||
private Long parentId;
|
||||
|
||||
private List<Long> deptIdList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 条件类
|
||||
*/
|
||||
@Data
|
||||
public class Condition {
|
||||
|
||||
/**
|
||||
* 条件键
|
||||
*/
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* 表达式
|
||||
*/
|
||||
private String expression;
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private Object value;
|
||||
|
||||
/**
|
||||
* 键类型
|
||||
*/
|
||||
private String keyType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分组条件类
|
||||
*/
|
||||
@Data
|
||||
public class GroupCondition {
|
||||
|
||||
/**
|
||||
* 是否并行
|
||||
*/
|
||||
private Boolean mode;
|
||||
|
||||
/**
|
||||
* 条件列表
|
||||
*/
|
||||
private List<Condition> conditionList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 首页统计数据
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class IndexPageStatistics {
|
||||
|
||||
/**
|
||||
* 待办数量
|
||||
*/
|
||||
private Long pendingNum;
|
||||
|
||||
/**
|
||||
* 发起数量
|
||||
*/
|
||||
private Long startedNum;
|
||||
|
||||
/**
|
||||
* 抄送任务
|
||||
*/
|
||||
private Long copyNum;
|
||||
|
||||
/**
|
||||
* 完成数量
|
||||
*/
|
||||
private Long completedNum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class Nobody {
|
||||
|
||||
private String handler;
|
||||
|
||||
private List<NodeUser> assignedUser;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class Node {
|
||||
|
||||
private String id;
|
||||
|
||||
private String parentId;
|
||||
|
||||
private String headId;
|
||||
|
||||
private String tailId;
|
||||
|
||||
private String placeHolder;
|
||||
|
||||
private Integer type;
|
||||
|
||||
@JsonProperty(value = "nodeName")
|
||||
private String name;
|
||||
|
||||
private Boolean error;
|
||||
|
||||
@JsonProperty("childNode")
|
||||
private Node children;
|
||||
|
||||
private Integer assignedType;
|
||||
|
||||
private Boolean multiple;
|
||||
|
||||
private Integer multipleMode;
|
||||
|
||||
private Integer deptLeaderLevel;
|
||||
|
||||
private String formUserId;
|
||||
|
||||
private String formUserName;
|
||||
|
||||
private List<NodeUser> nodeUserList;
|
||||
|
||||
private List<Node> conditionNodes;
|
||||
|
||||
private Map<String, String> formPerms;
|
||||
|
||||
private Nobody nobody;
|
||||
|
||||
private Boolean groupMode;
|
||||
|
||||
private List<GroupCondition> conditionList;
|
||||
|
||||
private Refuse refuse;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 节点处理http请求结果对象
|
||||
*/
|
||||
@Data
|
||||
public class NodeHttpResultVO {
|
||||
|
||||
private Boolean ok;
|
||||
|
||||
private Map<String, Object> data;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 节点用户对象
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
public class NodeUser {
|
||||
|
||||
/**
|
||||
* 用户od
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 选择
|
||||
*/
|
||||
private Boolean selected;
|
||||
|
||||
private String avatar;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class ProcessCopyDto {
|
||||
|
||||
/**
|
||||
* 当前节点时间
|
||||
*/
|
||||
private LocalDateTime nodeTime;
|
||||
|
||||
/**
|
||||
* 发起人
|
||||
*/
|
||||
private Long startUserId;
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
private String flowId;
|
||||
|
||||
/**
|
||||
* 实例id
|
||||
*/
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 节点id
|
||||
*/
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 节点 名称
|
||||
*/
|
||||
private String nodeName;
|
||||
|
||||
/**
|
||||
* 表单数据
|
||||
*/
|
||||
private String formData;
|
||||
|
||||
/**
|
||||
* 抄送人id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 流程实例参数对象
|
||||
*/
|
||||
@Data
|
||||
public class ProcessInstanceParamDto {
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
private String flowId;
|
||||
|
||||
/**
|
||||
* 参数集合
|
||||
*/
|
||||
private Map<String, Object> paramMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 发起人
|
||||
*/
|
||||
private String startUserId;
|
||||
|
||||
/**
|
||||
* 实例id
|
||||
*/
|
||||
private String processInstanceId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程记录
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-07
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class ProcessInstanceRecordParamDto {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
private String flowId;
|
||||
|
||||
/**
|
||||
* 流程实例id
|
||||
*/
|
||||
private String processInstanceId;
|
||||
|
||||
private String parentProcessInstanceId;
|
||||
|
||||
/**
|
||||
* 表单数据
|
||||
*/
|
||||
private String formData;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProcessNodeDataDto {
|
||||
|
||||
private String flowId;
|
||||
|
||||
private String nodeId;
|
||||
|
||||
private String data;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 流程节点记录-执行人
|
||||
*/
|
||||
@Data
|
||||
public class ProcessNodeRecordAssignUserParamDto {
|
||||
|
||||
/**
|
||||
* 流程id (process id)
|
||||
*/
|
||||
private String flowId;
|
||||
|
||||
/**
|
||||
* 流程实例id (process instance id)
|
||||
*/
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 表单数据 (form data)
|
||||
*/
|
||||
private String data;
|
||||
|
||||
/**
|
||||
* 本地数据 (local data)
|
||||
*/
|
||||
private String localData;
|
||||
|
||||
/**
|
||||
* 节点id (node id)
|
||||
*/
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 用户id (user id)
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 执行id (execution id)
|
||||
*/
|
||||
private String executionId;
|
||||
|
||||
/**
|
||||
* 任务id (task id)
|
||||
*/
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 审批描述 (approval description)
|
||||
*/
|
||||
private String approveDesc;
|
||||
|
||||
/**
|
||||
* 节点名称 (node name)
|
||||
*/
|
||||
private String nodeName;
|
||||
|
||||
/**
|
||||
* 任务类型 (task type)
|
||||
*/
|
||||
private String taskType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 流程节点记录
|
||||
*/
|
||||
@Data
|
||||
public class ProcessNodeRecordParamDto {
|
||||
|
||||
/**
|
||||
* 流程id (process id)
|
||||
*/
|
||||
private String flowId;
|
||||
|
||||
/**
|
||||
* 流程实例id (process instance id)
|
||||
*/
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 表单数据 (form data)
|
||||
*/
|
||||
private String data;
|
||||
|
||||
/**
|
||||
* 节点id (node id)
|
||||
*/
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 节点类型 (node type)
|
||||
*/
|
||||
private String nodeType;
|
||||
|
||||
/**
|
||||
* 节点名字 (node name)
|
||||
*/
|
||||
private String nodeName;
|
||||
|
||||
/**
|
||||
* 执行id (execution id)
|
||||
*/
|
||||
private String executionId;
|
||||
|
||||
/**
|
||||
* 任务id (task id)
|
||||
*/
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 审批描述 (approval description)
|
||||
*/
|
||||
private String approveDesc;
|
||||
|
||||
/**
|
||||
* 任务类型 (task type)
|
||||
*/
|
||||
private String taskType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Refuse {
|
||||
|
||||
private String handler;
|
||||
|
||||
private String nodeId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Huijun Zhao
|
||||
* @description
|
||||
* @date 2023-07-28 10:36
|
||||
*/
|
||||
@Data
|
||||
public class SelectValue {
|
||||
|
||||
private String key;
|
||||
|
||||
private String value;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 任务对象
|
||||
*/
|
||||
@Data
|
||||
public class TaskDto {
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
private String flowId;
|
||||
|
||||
/**
|
||||
* 参数集合
|
||||
*/
|
||||
private Map<String, Object> paramMap;
|
||||
|
||||
/**
|
||||
* 实例id
|
||||
*/
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 执行id
|
||||
*/
|
||||
private String executionId;
|
||||
|
||||
/**
|
||||
* 耗时
|
||||
*/
|
||||
private Long durationInMillis;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 执行人
|
||||
*/
|
||||
private String assign;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
private String taskName;
|
||||
|
||||
/**
|
||||
* 节点id
|
||||
*/
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 任务创建时间
|
||||
*/
|
||||
private Date taskCreateTime;
|
||||
|
||||
private Date taskEndTime;
|
||||
|
||||
/**
|
||||
* 流程组名字
|
||||
*/
|
||||
private String groupName;
|
||||
|
||||
/**
|
||||
* 发起人id
|
||||
*/
|
||||
private Long rootUserId;
|
||||
|
||||
/**
|
||||
* 发起人名字
|
||||
*/
|
||||
private String rootUserName;
|
||||
|
||||
/**
|
||||
* 发起人头像
|
||||
*/
|
||||
private String rootUserAvatarUrl;
|
||||
|
||||
/**
|
||||
* 发起时间
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
private String processName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 任务完成参数对象
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class TaskParamDto {
|
||||
|
||||
private String processInstanceId;
|
||||
|
||||
private List<String> processInstanceIdList;
|
||||
|
||||
/**
|
||||
* 节点id
|
||||
*/
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 添加子流程发起人
|
||||
*/
|
||||
private Boolean appendChildProcessRootId;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 模板用户id
|
||||
*/
|
||||
private String targetUserId;
|
||||
|
||||
/**
|
||||
* 参数
|
||||
*/
|
||||
private Map<String, Object> paramMap;
|
||||
|
||||
/**
|
||||
* 任务本地变量
|
||||
*/
|
||||
private Map<String, Object> taskLocalParamMap;
|
||||
|
||||
/**
|
||||
* 模板节点
|
||||
*/
|
||||
private String targetNodeId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户任务查询参数
|
||||
*/
|
||||
@Data
|
||||
public class TaskQueryParamDto {
|
||||
|
||||
/**
|
||||
* 任务执行人
|
||||
*/
|
||||
private String assign;
|
||||
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
private Integer pageNum;
|
||||
|
||||
/**
|
||||
* 每页的数量
|
||||
*/
|
||||
private Integer pageSize;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
private String processName;
|
||||
|
||||
/**
|
||||
* 任务时间
|
||||
*/
|
||||
private LocalDateTime[] taskTime;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 任务结果对象
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class TaskResultDto {
|
||||
|
||||
private Boolean currentTask;
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
private String flowId;
|
||||
|
||||
private Node taskNode;
|
||||
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 实例id
|
||||
*/
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 委派状态
|
||||
*/
|
||||
private String delegationState;
|
||||
|
||||
/**
|
||||
* 是否允许继续委派
|
||||
*/
|
||||
private Boolean delegate;
|
||||
|
||||
/**
|
||||
* 所有变量
|
||||
*/
|
||||
private Map<String, Object> variableAll;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class VariableQueryParamDto {
|
||||
|
||||
private String taskId;
|
||||
|
||||
private List<String> keyList;
|
||||
|
||||
private String executionId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* @author pigx archetype
|
||||
* <p>
|
||||
* DTO 存放目录
|
||||
*/
|
||||
package com.pig4cloud.pigx.flow.task.dto;
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.pig4cloud.pigx.flow.task.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-07-06
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("process")
|
||||
public class Process {
|
||||
|
||||
/**
|
||||
* 表单ID
|
||||
*/
|
||||
@TableField("flow_id")
|
||||
private String flowId;
|
||||
|
||||
/**
|
||||
* 表单名称
|
||||
*/
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 图标配置
|
||||
*/
|
||||
@TableField("logo")
|
||||
private String logo;
|
||||
|
||||
/**
|
||||
* 设置项
|
||||
*/
|
||||
@TableField("settings")
|
||||
private String settings;
|
||||
|
||||
/**
|
||||
* 分组ID
|
||||
*/
|
||||
@TableField("group_id")
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 表单设置内容
|
||||
*/
|
||||
@TableField("form_items")
|
||||
private String formItems;
|
||||
|
||||
/**
|
||||
* 流程设置内容
|
||||
*/
|
||||
@TableField("process")
|
||||
private String process;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
|
||||
@TableField("sort")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 0 正常 1=隐藏
|
||||
*/
|
||||
@TableField("is_hidden")
|
||||
private Boolean hidden;
|
||||
|
||||
/**
|
||||
* 0 正常 1=停用
|
||||
*/
|
||||
@TableField("is_stop")
|
||||
private Boolean stop;
|
||||
|
||||
/**
|
||||
* 流程管理员
|
||||
*/
|
||||
@TableField("admin_id")
|
||||
private Long adminId;
|
||||
|
||||
/**
|
||||
* 唯一性id
|
||||
*/
|
||||
@TableField("unique_id")
|
||||
private String uniqueId;
|
||||
|
||||
/**
|
||||
* 管理员
|
||||
*/
|
||||
@TableField("admin_list")
|
||||
private String adminList;
|
||||
|
||||
/**
|
||||
* 范围描述显示
|
||||
*/
|
||||
@TableField("range_show")
|
||||
private String rangeShow;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.pig4cloud.pigx.flow.task.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程抄送数据
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-07-06
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("process_copy")
|
||||
public class ProcessCopy {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 流程发起时间
|
||||
*/
|
||||
@TableField("start_time")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 当前节点时间
|
||||
*/
|
||||
@TableField("node_time")
|
||||
private LocalDateTime nodeTime;
|
||||
|
||||
/**
|
||||
* 发起人
|
||||
*/
|
||||
@TableField("start_user_id")
|
||||
private Long startUserId;
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
@TableField("flow_id")
|
||||
private String flowId;
|
||||
|
||||
/**
|
||||
* 实例id
|
||||
*/
|
||||
@TableField("process_instance_id")
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 节点id
|
||||
*/
|
||||
@TableField("node_id")
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 分组id
|
||||
*/
|
||||
@TableField("group_id")
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 分组名称
|
||||
*/
|
||||
@TableField("group_name")
|
||||
private String groupName;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
@TableField("process_name")
|
||||
private String processName;
|
||||
|
||||
/**
|
||||
* 节点 名称
|
||||
*/
|
||||
@TableField("node_name")
|
||||
private String nodeName;
|
||||
|
||||
/**
|
||||
* 表单数据
|
||||
*/
|
||||
@TableField("form_data")
|
||||
private String formData;
|
||||
|
||||
/**
|
||||
* 抄送人id
|
||||
*/
|
||||
@TableField("user_id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.pig4cloud.pigx.flow.task.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-07-06
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("process_group")
|
||||
public class ProcessGroup {
|
||||
|
||||
/**
|
||||
* 分组名
|
||||
*/
|
||||
@TableField("group_name")
|
||||
private String groupName;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@TableField("sort")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.pig4cloud.pigx.flow.task.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程记录
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-07-06
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("process_instance_record")
|
||||
public class ProcessInstanceRecord {
|
||||
|
||||
/**
|
||||
* 流程名字
|
||||
*/
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@TableField("logo")
|
||||
private String logo;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableField("user_id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
@TableField("flow_id")
|
||||
private String flowId;
|
||||
|
||||
/**
|
||||
* 流程实例id
|
||||
*/
|
||||
@TableField("process_instance_id")
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 表单数据
|
||||
*/
|
||||
@TableField("form_data")
|
||||
private String formData;
|
||||
|
||||
/**
|
||||
* 组id
|
||||
*/
|
||||
@TableField("group_id")
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 组名称
|
||||
*/
|
||||
@TableField("group_name")
|
||||
private String groupName;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@TableField("end_time")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 上级流程实例id
|
||||
*/
|
||||
@TableField("parent_process_instance_id")
|
||||
private String parentProcessInstanceId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.pig4cloud.pigx.flow.task.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程节点数据
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-07-06
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("process_node_data")
|
||||
public class ProcessNodeData {
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
@TableField("flow_id")
|
||||
private String flowId;
|
||||
|
||||
/**
|
||||
* 表单数据
|
||||
*/
|
||||
@TableField("data")
|
||||
private String data;
|
||||
|
||||
@TableField("node_id")
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.pig4cloud.pigx.flow.task.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程节点记录
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-07-06
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("process_node_record")
|
||||
public class ProcessNodeRecord {
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
@TableField("flow_id")
|
||||
private String flowId;
|
||||
|
||||
/**
|
||||
* 流程实例id
|
||||
*/
|
||||
@TableField("process_instance_id")
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 表单数据
|
||||
*/
|
||||
@TableField("data")
|
||||
private String data;
|
||||
|
||||
@TableField("node_id")
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 节点类型
|
||||
*/
|
||||
@TableField("node_type")
|
||||
private String nodeType;
|
||||
|
||||
/**
|
||||
* 节点名字
|
||||
*/
|
||||
@TableField("node_name")
|
||||
private String nodeName;
|
||||
|
||||
/**
|
||||
* 节点状态
|
||||
*/
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@TableField("start_time")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@TableField("end_time")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 执行id
|
||||
*/
|
||||
@TableField("execution_id")
|
||||
private String executionId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
package com.pig4cloud.pigx.flow.task.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程节点记录-执行人
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-07-06
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("process_node_record_assign_user")
|
||||
public class ProcessNodeRecordAssignUser {
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
@TableField("flow_id")
|
||||
private String flowId;
|
||||
|
||||
/**
|
||||
* 流程实例id
|
||||
*/
|
||||
@TableField("process_instance_id")
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 表单数据
|
||||
*/
|
||||
@TableField("data")
|
||||
private String data;
|
||||
|
||||
@TableField("node_id")
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableField("user_id")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 节点状态
|
||||
*/
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@TableField("start_time")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@TableField("end_time")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 执行id
|
||||
*/
|
||||
@TableField("execution_id")
|
||||
private String executionId;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@TableField("task_id")
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 审批意见
|
||||
*/
|
||||
@TableField("approve_desc")
|
||||
private String approveDesc;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
@TableField("node_name")
|
||||
private String nodeName;
|
||||
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
@TableField("task_type")
|
||||
private String taskType;
|
||||
|
||||
/**
|
||||
* 表单本地数据
|
||||
*/
|
||||
@TableField("local_data")
|
||||
private String localData;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.pig4cloud.pigx.flow.task.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程发起人
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-07-06
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("process_starter")
|
||||
public class ProcessStarter {
|
||||
|
||||
/**
|
||||
* 用户id或者部门id
|
||||
*/
|
||||
@TableField("type_id")
|
||||
private Long typeId;
|
||||
|
||||
/**
|
||||
* 类型 user dept
|
||||
*/
|
||||
@TableField("type")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
@TableField("process_id")
|
||||
private Long processId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* @author pigx archetype
|
||||
* <p>
|
||||
* 实体 存放目录
|
||||
*/
|
||||
package com.pig4cloud.pigx.flow.task.entity;
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.pig4cloud.pigx.flow.task.utils;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.pig4cloud.pigx.flow.task.constant.NodeTypeEnum;
|
||||
import com.pig4cloud.pigx.flow.task.constant.ProcessInstanceConstant;
|
||||
import com.pig4cloud.pigx.flow.task.dto.Node;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class NodeUtil {
|
||||
|
||||
public static String getFlowId(String processDefinitionId) {
|
||||
return StrUtil.subBefore(processDefinitionId, ":", false);
|
||||
}
|
||||
|
||||
public static boolean isNode(Node childNode) {
|
||||
return childNode != null && StrUtil.isNotBlank(childNode.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加结束节点
|
||||
* @param node
|
||||
*/
|
||||
public static void addEndNode(Node node) {
|
||||
|
||||
Node children = node.getChildren();
|
||||
if (isNode(children)) {
|
||||
addEndNode(children);
|
||||
}
|
||||
else {
|
||||
Node end = new Node();
|
||||
end.setId("end");
|
||||
end.setType(NodeTypeEnum.END.getValue());
|
||||
end.setName("结束节点");
|
||||
end.setParentId(node.getId());
|
||||
node.setChildren(end);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 需要发起人选择用户的节点
|
||||
* @param node
|
||||
*/
|
||||
public static List<String> selectUserNodeId(Node node) {
|
||||
List<String> list = new ArrayList<>();
|
||||
|
||||
if (!isNode(node)) {
|
||||
return list;
|
||||
}
|
||||
|
||||
Integer type = node.getType();
|
||||
|
||||
if (type == NodeTypeEnum.APPROVAL.getValue().intValue()) {
|
||||
|
||||
Integer assignedType = node.getAssignedType();
|
||||
|
||||
boolean selfSelect = assignedType == ProcessInstanceConstant.AssignedTypeClass.SELF_SELECT;
|
||||
if (selfSelect) {
|
||||
list.add(node.getId());
|
||||
}
|
||||
}
|
||||
|
||||
if (type == NodeTypeEnum.EXCLUSIVE_GATEWAY.getValue().intValue()
|
||||
|| type == NodeTypeEnum.PARALLEL_GATEWAY.getValue().intValue()) {
|
||||
|
||||
// 条件分支
|
||||
List<Node> branchs = node.getConditionNodes();
|
||||
for (Node branch : branchs) {
|
||||
Node children = branch.getChildren();
|
||||
List<String> strings = selectUserNodeId(children);
|
||||
list.addAll(strings);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> next = selectUserNodeId(node.getChildren());
|
||||
list.addAll(next);
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.pig4cloud.pigx.flow.task.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author : willian fu
|
||||
* @date : 2022/7/4
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class ErrorRspVo {
|
||||
|
||||
private Integer code;
|
||||
|
||||
private String msg;
|
||||
|
||||
private String desp;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.pig4cloud.pigx.flow.task.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : willian fu
|
||||
* @date : 2020/9/21
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FormGroupVo {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 流程名字
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 流程
|
||||
*/
|
||||
private List<FlowVo> items;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
public static class FlowVo {
|
||||
|
||||
private String flowId;
|
||||
|
||||
/**
|
||||
* 发起范围
|
||||
*/
|
||||
private String rangeShow;
|
||||
|
||||
private String name;
|
||||
|
||||
private String logo;
|
||||
|
||||
private Boolean stop;
|
||||
|
||||
private String remark;
|
||||
|
||||
private LocalDateTime updated;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.pig4cloud.pigx.flow.task.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 表单
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class FormItemVO {
|
||||
|
||||
private String id;
|
||||
|
||||
private String perm;
|
||||
|
||||
private String icon;
|
||||
|
||||
private String name;
|
||||
|
||||
private String type;
|
||||
|
||||
private Boolean required;
|
||||
|
||||
private String typeName;
|
||||
|
||||
private String placeholder;
|
||||
|
||||
private Props props;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public static class Props {
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object dictValue;
|
||||
|
||||
private Object options;
|
||||
|
||||
private Boolean self;
|
||||
|
||||
private Boolean multi;
|
||||
|
||||
private Object oriForm;
|
||||
|
||||
private Object maxLength;
|
||||
|
||||
private Object minLength;
|
||||
|
||||
private Object regex;
|
||||
|
||||
private Object regexDesc;
|
||||
|
||||
private String prefix;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.flow.task.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class NodeFormatParamVo {
|
||||
|
||||
private String flowId;
|
||||
|
||||
private String processInstanceId;
|
||||
|
||||
private String taskId;
|
||||
|
||||
private Map<String, Object> paramMap;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.pig4cloud.pigx.flow.task.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程节点显示对象
|
||||
*/
|
||||
@Data
|
||||
public class NodeVo {
|
||||
|
||||
/**
|
||||
* nodeId
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户列表
|
||||
*/
|
||||
private List<UserVo> userVoList;
|
||||
|
||||
/**
|
||||
* 显示
|
||||
*/
|
||||
private String placeholder;
|
||||
|
||||
/**
|
||||
* 状态 1进行中2已完成
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 节点类型
|
||||
*/
|
||||
private Object type;
|
||||
|
||||
/**
|
||||
* 发起人选择用户
|
||||
*/
|
||||
private Boolean selectUser;
|
||||
|
||||
/**
|
||||
* 是否多选
|
||||
*/
|
||||
private Boolean multiple;
|
||||
|
||||
/**
|
||||
* 子级列表
|
||||
*/
|
||||
private List<NodeVo> children;
|
||||
|
||||
/**
|
||||
* 分支列表
|
||||
*/
|
||||
private List<NodeVo> branch;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.pig4cloud.pigx.flow.task.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author : willian fu
|
||||
* @version : 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrgTreeVo {
|
||||
|
||||
/**
|
||||
* 用户od
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 选择
|
||||
*/
|
||||
private Boolean selected;
|
||||
|
||||
private String avatar;
|
||||
|
||||
private Integer status = 1;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.pig4cloud.pigx.flow.task.vo;
|
||||
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessCopy;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProcessCopyVo extends ProcessCopy {
|
||||
|
||||
private String startUserName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.pig4cloud.pigx.flow.task.vo;
|
||||
|
||||
import com.pig4cloud.pigx.flow.task.entity.Process;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class ProcessVO extends Process {
|
||||
|
||||
/**
|
||||
* 需要发起人选择的节点id
|
||||
*/
|
||||
private List<String> selectUserNodeId;
|
||||
|
||||
private Map<String, Object> variableMap;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.pig4cloud.pigx.flow.task.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserVo {
|
||||
|
||||
/**
|
||||
* 用户od
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
private LocalDateTime showTime;
|
||||
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 意见
|
||||
*/
|
||||
private String approveDesc;
|
||||
|
||||
private String operType;
|
||||
|
||||
/**
|
||||
* 状态 1进行中2已完成
|
||||
*/
|
||||
private Integer status = 0;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
com.pig4cloud.pigx.flow.task.api.feign.RemoteFlowTaskService
|
||||
com.pig4cloud.pigx.flow.task.api.feign.RemoteFlowEngineService
|
||||
18
pigx-flow/pigx-flow-task/pigx-flow-task-biz/Dockerfile
Normal file
18
pigx-flow/pigx-flow-task/pigx-flow-task-biz/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM pig4cloud/java:8-jre
|
||||
|
||||
MAINTAINER wangiegie@gmail.com
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV JAVA_OPTS="-Xms512m -Xmx1024m -Djava.security.egd=file:/dev/./urandom"
|
||||
|
||||
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
RUN mkdir -p /pigx-flow-task
|
||||
|
||||
WORKDIR /pigx-flow-task
|
||||
|
||||
EXPOSE 9030
|
||||
|
||||
ADD ./target/pigx-flow-task-biz.jar ./
|
||||
|
||||
CMD sleep 60;java $JAVA_OPTS -jar pigx-flow-task-biz.jar
|
||||
118
pigx-flow/pigx-flow-task/pigx-flow-task-biz/pom.xml
Normal file
118
pigx-flow/pigx-flow-task/pigx-flow-task-biz/pom.xml
Normal file
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
||||
http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-flow-task</artifactId>
|
||||
<version>5.2.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-flow-task-biz</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!--必备: undertow容器-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-undertow</artifactId>
|
||||
</dependency>
|
||||
<!--必备: spring boot web-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<!--必备: 注册中心客户端-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!--必备: 配置中心客户端-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<!--必备: 操作数据源相关-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-data</artifactId>
|
||||
</dependency>
|
||||
<!--选配: 发号器-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-sequence</artifactId>
|
||||
</dependency>
|
||||
<!--必备:pigx安全模块-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
</dependency>
|
||||
<!--必备:xss 过滤模块-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-xss</artifactId>
|
||||
</dependency>
|
||||
<!--必备: sentinel 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-sentinel</artifactId>
|
||||
</dependency>
|
||||
<!--必备: feign 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-feign</artifactId>
|
||||
</dependency>
|
||||
<!--必备: 依赖api模块-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-flow-task-api</artifactId>
|
||||
</dependency>
|
||||
<!--必备: log 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-log</artifactId>
|
||||
</dependency>
|
||||
<!--选配: mybatis 依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!--选配: druid 连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!--选配: mysql 数据库驱动 -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
<!--选配: swagger文档-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-swagger</artifactId>
|
||||
</dependency>
|
||||
<!--测试: spring boot test-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.dameng</groupId>
|
||||
<artifactId>DmJdbcDriver18</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.pig4cloud.pigx.flow.task;
|
||||
|
||||
import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxResourceServer;
|
||||
import com.pig4cloud.pigx.common.swagger.annotation.EnableOpenApi;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
/**
|
||||
* @author pigx archetype
|
||||
* <p>
|
||||
* 项目启动类
|
||||
*/
|
||||
@EnableOpenApi("task")
|
||||
@EnablePigxFeignClients
|
||||
@EnableDiscoveryClient
|
||||
@EnablePigxResourceServer
|
||||
@SpringBootApplication
|
||||
public class PigxFlowTaskApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(PigxFlowTaskApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.pig4cloud.pigx.flow.task.config;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.pig4cloud.pigx.common.data.tenant.TenantContextHolder;
|
||||
import com.pig4cloud.pigx.common.sequence.builder.DbSeqBuilder;
|
||||
import com.pig4cloud.pigx.common.sequence.properties.SequenceDbProperties;
|
||||
import com.pig4cloud.pigx.common.sequence.sequence.Sequence;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2023-07-19
|
||||
* <p>
|
||||
* 设置发号器生成规则
|
||||
*/
|
||||
@Configuration
|
||||
public class SequenceConfiguration {
|
||||
|
||||
/**
|
||||
* 工作流发号器
|
||||
* @param dataSource
|
||||
* @param properties
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Sequence flowSequence(DataSource dataSource, SequenceDbProperties properties) {
|
||||
return DbSeqBuilder.create()
|
||||
.bizName(() -> String.format("flow_%s_%s", TenantContextHolder.getTenantId(), DateUtil.today()))
|
||||
.dataSource(dataSource).step(properties.getStep()).retryTimes(properties.getRetryTimes())
|
||||
.tableName(properties.getTableName()).build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.pig4cloud.pigx.flow.task.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.service.ICombinationGroupService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 组聚合接口控制器
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/combination/group")
|
||||
public class CombinationGroupController {
|
||||
|
||||
private final ICombinationGroupService combinationGroupService;
|
||||
|
||||
/**
|
||||
* 查询表单组包含流程
|
||||
* @return 表单组数据
|
||||
*/
|
||||
@GetMapping("listGroupWithProcess")
|
||||
public R listGroupWithProcess(Page page, Long groupId) {
|
||||
return combinationGroupService.listGroupWithProcess(page, groupId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有我可以发起的表单组
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("listCurrentUserStartGroup")
|
||||
public R listCurrentUserStartGroup() {
|
||||
return combinationGroupService.listCurrentUserStartGroup();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.pig4cloud.pigx.flow.task.controller;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.service.IOrgService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author : willian fu
|
||||
* @date : 2022/6/27
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/org")
|
||||
public class OrgController {
|
||||
|
||||
private final IOrgService orgService;
|
||||
|
||||
/**
|
||||
* 查询组织架构树
|
||||
* @param deptId 部门id
|
||||
* @param showLeave 是否显示离职员工
|
||||
* @return 组织架构树数据
|
||||
*/
|
||||
@GetMapping("tree")
|
||||
public R getOrgTreeData(@RequestParam(defaultValue = "0") Long deptId, String type,
|
||||
@RequestParam(defaultValue = "false") Boolean showLeave) {
|
||||
return orgService.getOrgTreeData(deptId, type, showLeave);
|
||||
}
|
||||
|
||||
/**
|
||||
* 模糊搜索用户
|
||||
* @param userName 用户名/拼音/首字母
|
||||
* @return 匹配到的用户
|
||||
*/
|
||||
@GetMapping("tree/user/search")
|
||||
public R getOrgTreeUser(@RequestParam String userName) {
|
||||
return orgService.getOrgTreeUser(userName.trim());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.pig4cloud.pigx.flow.task.controller;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.entity.Process;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessService;
|
||||
import com.pig4cloud.pigx.flow.task.vo.ProcessVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/process")
|
||||
public class ProcessController {
|
||||
|
||||
private final IProcessService processService;
|
||||
|
||||
/**
|
||||
* 获取详细数据
|
||||
* @param flowId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getDetail")
|
||||
public R<ProcessVO> getDetail(String flowId) {
|
||||
return processService.getDetail(flowId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建流程
|
||||
* @param process
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("create")
|
||||
public R create(@RequestBody Process process) {
|
||||
return processService.create(process);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑表单
|
||||
* @param flowId 摸板ID
|
||||
* @param type 类型 stop using delete
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("update/{flowId}")
|
||||
public R update(@PathVariable String flowId, @RequestParam String type,
|
||||
@RequestParam(required = false) Long groupId) {
|
||||
return processService.update(flowId, type, groupId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.pig4cloud.pigx.flow.task.controller;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessCopyService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程抄送数据 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-20
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/processCopy")
|
||||
public class ProcessCopyController {
|
||||
|
||||
private final IProcessCopyService processCopyService;
|
||||
|
||||
/**
|
||||
* 查询单个抄送详细信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("querySingleDetail")
|
||||
public R querySingleDetail(long id) {
|
||||
return processCopyService.querySingleDetail(id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.pig4cloud.pigx.flow.task.controller;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessGroup;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessGroupService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("processGroup")
|
||||
public class ProcessGroupController {
|
||||
|
||||
private final IProcessGroupService processGroupService;
|
||||
|
||||
/**
|
||||
* 组列表
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("list")
|
||||
public R<List<ProcessGroup>> queryList() {
|
||||
return processGroupService.queryList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程分组
|
||||
* @param processGroup 分组名
|
||||
* @return 添加结果
|
||||
*/
|
||||
@PostMapping("create")
|
||||
public R create(@RequestBody ProcessGroup processGroup) {
|
||||
return processGroupService.create(processGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分组
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("delete/{id}")
|
||||
public R delete(@PathVariable long id) {
|
||||
return processGroupService.delete(id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.pig4cloud.pigx.flow.task.controller;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.dto.ProcessInstanceParamDto;
|
||||
import com.pig4cloud.pigx.flow.task.dto.TaskQueryParamDto;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessInstanceService;
|
||||
import com.pig4cloud.pigx.flow.task.vo.NodeFormatParamVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 流程实例
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/process-instance")
|
||||
public class ProcessInstanceController {
|
||||
|
||||
private final IProcessInstanceService processInstanceService;
|
||||
|
||||
/**
|
||||
* 启动流程
|
||||
* @param processInstanceParamDto
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@PostMapping("startProcessInstance")
|
||||
public R startProcessInstance(@RequestBody ProcessInstanceParamDto processInstanceParamDto) {
|
||||
return processInstanceService.startProcessInstance(processInstanceParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前登录用户的待办任务
|
||||
* @param pageDto
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@PostMapping("queryMineTask")
|
||||
public R queryMineTask(@RequestBody TaskQueryParamDto queryParamDto) {
|
||||
return processInstanceService.queryMineTask(queryParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前登录用户已办任务
|
||||
* @param taskQueryParamDto
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@PostMapping("queryMineEndTask")
|
||||
public R queryMineEndTask(@RequestBody TaskQueryParamDto taskQueryParamDto) {
|
||||
return processInstanceService.queryMineEndTask(taskQueryParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我发起的
|
||||
* @param pageDto
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@PostMapping("queryMineStarted")
|
||||
public R queryMineStarted(@RequestBody TaskQueryParamDto taskQueryParamDto) {
|
||||
return processInstanceService.queryMineStarted(taskQueryParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询抄送我的
|
||||
* @param pageDto
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@PostMapping("queryMineCC")
|
||||
public R queryMineCC(@RequestBody TaskQueryParamDto taskQueryParamDto) {
|
||||
return processInstanceService.queryMineCC(taskQueryParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化流程显示
|
||||
* @param nodeFormatParamVo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("formatStartNodeShow")
|
||||
public R formatStartNodeShow(@RequestBody NodeFormatParamVo nodeFormatParamVo) {
|
||||
return processInstanceService.formatStartNodeShow(nodeFormatParamVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程详情
|
||||
* @param processInstanceId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("detail")
|
||||
public R detail(String processInstanceId) {
|
||||
return processInstanceService.detail(processInstanceId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.pig4cloud.pigx.flow.task.controller;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.dto.Node;
|
||||
import com.pig4cloud.pigx.flow.task.dto.ProcessNodeDataDto;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessNodeDataService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程节点数据 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-07
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/processNodeData")
|
||||
public class ProcessNodeDataController {
|
||||
|
||||
private final IProcessNodeDataService processNodeDataService;
|
||||
|
||||
/**
|
||||
* 保存节点数据
|
||||
* @param processNodeDataDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("saveNodeData")
|
||||
public R saveNodeData(@RequestBody ProcessNodeDataDto processNodeDataDto) {
|
||||
return processNodeDataService.saveNodeData(processNodeDataDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取节点数据
|
||||
* @param flowId
|
||||
* @param nodeId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getNodeData")
|
||||
public R<Node> getNodeData(String flowId, String nodeId) {
|
||||
return processNodeDataService.getNodeData(flowId, nodeId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package com.pig4cloud.pigx.flow.task.controller;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.dto.*;
|
||||
import com.pig4cloud.pigx.flow.task.service.IRemoteService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 远程请求控制器
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/remote")
|
||||
public class RemoteController {
|
||||
|
||||
private final IRemoteService remoteService;
|
||||
|
||||
/**
|
||||
* 根据角色id集合查询用户id集合
|
||||
* @param roleIdList
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("queryUserIdListByRoleIdList")
|
||||
public R<List<Long>> queryUserIdListByRoleIdList(@RequestBody List<Long> roleIdList) {
|
||||
return remoteService.queryUserIdListByRoleIdList(roleIdList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存抄送
|
||||
* @param copyDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("savecc")
|
||||
public R saveCC(@RequestBody ProcessCopyDto copyDto) {
|
||||
return remoteService.saveCC(copyDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否是所有的父级
|
||||
* @param checkParentDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("checkIsAllParent")
|
||||
public R<Boolean> checkIsAllParent(@RequestBody CheckParentDto checkParentDto) {
|
||||
return remoteService.checkIsAllParent(checkParentDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门id集合查询用户id集合
|
||||
* @param depIdList
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("queryUserIdListByDepIdList")
|
||||
public R<List<Long>> queryUserIdListByDepIdList(@RequestBody List<Long> depIdList) {
|
||||
return remoteService.queryUserIdListByDepIdList(depIdList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否是所有的子级
|
||||
* @param checkChildDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("checkIsAllChild")
|
||||
public R<Boolean> checkIsAllChild(@RequestBody CheckChildDto checkChildDto) {
|
||||
return remoteService.checkIsAllChild(checkChildDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户的信息-包括扩展字段
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("queryUserAllInfo")
|
||||
public R<Map<String, Object>> queryUserAllInfo(long userId) {
|
||||
return remoteService.queryUserAllInfo(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始节点事件
|
||||
* @param recordParamDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("startNodeEvent")
|
||||
public R startNodeEvent(@RequestBody ProcessNodeRecordParamDto recordParamDto) {
|
||||
return remoteService.startNodeEvent(recordParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程创建了
|
||||
* @param processInstanceRecordParamDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("createProcessEvent")
|
||||
public R createProcessEvent(@RequestBody ProcessInstanceRecordParamDto processInstanceRecordParamDto) {
|
||||
return remoteService.createProcessEvent(processInstanceRecordParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束节点事件
|
||||
* @param recordParamDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("endNodeEvent")
|
||||
public R endNodeEvent(@RequestBody ProcessNodeRecordParamDto recordParamDto) {
|
||||
return remoteService.endNodeEvent(recordParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始设置执行人
|
||||
* @param processNodeRecordAssignUserParamDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("startAssignUser")
|
||||
public R startAssignUser(@RequestBody ProcessNodeRecordAssignUserParamDto processNodeRecordAssignUserParamDto) {
|
||||
return remoteService.startAssignUser(processNodeRecordAssignUserParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务结束事件
|
||||
* @param processNodeRecordAssignUserParamDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("taskEndEvent")
|
||||
public R taskEndEvent(@RequestBody ProcessNodeRecordAssignUserParamDto processNodeRecordAssignUserParamDto) {
|
||||
return remoteService.taskEndEvent(processNodeRecordAssignUserParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 实例结束
|
||||
* @param processInstanceParamDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("endProcess")
|
||||
public R endProcess(@RequestBody ProcessInstanceParamDto processInstanceParamDto) {
|
||||
return remoteService.endProcess(processInstanceParamDto.getProcessInstanceId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程管理员
|
||||
* @param flowId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("queryProcessAdmin")
|
||||
public R<Long> queryProcessAdmin(String flowId) {
|
||||
return remoteService.queryProcessAdmin(flowId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.pig4cloud.pigx.flow.task.controller;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.dto.TaskParamDto;
|
||||
import com.pig4cloud.pigx.flow.task.service.ITaskService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 任务实例
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/task")
|
||||
public class TaskController {
|
||||
|
||||
private final ITaskService taskService;
|
||||
|
||||
/**
|
||||
* 查询首页数据看板
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@GetMapping("queryTaskData")
|
||||
public R queryTaskData() {
|
||||
return taskService.queryTaskData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询任务
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@GetMapping("queryTask")
|
||||
public R queryTask(String taskId, boolean view) {
|
||||
|
||||
return taskService.queryTask(taskId, view);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成任务
|
||||
* @param completeParamDto
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@PostMapping("completeTask")
|
||||
public R completeTask(@RequestBody TaskParamDto completeParamDto) {
|
||||
|
||||
return taskService.completeTask(completeParamDto);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 前加签
|
||||
* @param completeParamDto
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@PostMapping("delegateTask")
|
||||
public R delegateTask(@RequestBody TaskParamDto completeParamDto) {
|
||||
|
||||
return taskService.delegateTask(completeParamDto);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 加签完成任务
|
||||
* @param completeParamDto
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@PostMapping("resolveTask")
|
||||
public R resolveTask(@RequestBody TaskParamDto completeParamDto) {
|
||||
|
||||
return taskService.resolveTask(completeParamDto);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置执行人
|
||||
* @param completeParamDto
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@PostMapping("setAssignee")
|
||||
public R setAssignee(@RequestBody TaskParamDto completeParamDto) {
|
||||
|
||||
return taskService.setAssignee(completeParamDto);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束流程
|
||||
* @param completeParamDto
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@PostMapping("stopProcessInstance")
|
||||
public R stopProcessInstance(@RequestBody TaskParamDto completeParamDto) {
|
||||
|
||||
return taskService.stopProcessInstance(completeParamDto);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 退回
|
||||
* @param taskParamDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("back")
|
||||
public R back(@RequestBody TaskParamDto taskParamDto) {
|
||||
return taskService.back(taskParamDto);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.flow.task.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessCopy;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程抄送数据 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-20
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProcessCopyMapper extends BaseMapper<ProcessCopy> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.flow.task.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessGroup;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-25
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProcessGroupMapper extends BaseMapper<ProcessGroup> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.flow.task.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessInstanceRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程记录 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-07
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProcessInstanceRecordMapper extends BaseMapper<ProcessInstanceRecord> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.flow.task.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.pig4cloud.pigx.flow.task.entity.Process;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cxygzl
|
||||
* @since 2023-05-25
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProcessMapper extends BaseMapper<Process> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.flow.task.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessNodeData;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程节点数据 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-07
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProcessNodeDataMapper extends BaseMapper<ProcessNodeData> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.flow.task.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessNodeRecordAssignUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程节点记录-执行人 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cxygzl
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProcessNodeRecordAssignUserMapper extends BaseMapper<ProcessNodeRecordAssignUser> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.flow.task.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessNodeRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程节点记录 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cxygzl
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProcessNodeRecordMapper extends BaseMapper<ProcessNodeRecord> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.pig4cloud.pigx.flow.task.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessStarter;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程发起人 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-30
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProcessStarterMapper extends BaseMapper<ProcessStarter> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.pig4cloud.pigx.flow.task.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
|
||||
/**
|
||||
* 聚合接口
|
||||
*/
|
||||
public interface ICombinationGroupService {
|
||||
|
||||
/**
|
||||
* 查询表单组包含流程
|
||||
* @param groupId 表单ID
|
||||
* @return 表单组数据
|
||||
*/
|
||||
R listGroupWithProcess(Page page, Long groupId);
|
||||
|
||||
/**
|
||||
* 查询所有我可以发起的表单组
|
||||
* @return
|
||||
*/
|
||||
R listCurrentUserStartGroup();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.pig4cloud.pigx.flow.task.service;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
|
||||
/**
|
||||
* @author : willian fu
|
||||
* @version : 1.0
|
||||
*/
|
||||
public interface IOrgService {
|
||||
|
||||
/**
|
||||
* 查询组织架构树
|
||||
* @param deptId 部门id
|
||||
* @param type 只查询部门架构
|
||||
* @param showLeave 是否显示离职员工
|
||||
* @return 组织架构树数据
|
||||
*/
|
||||
R getOrgTreeData(Long deptId, String type, Boolean showLeave);
|
||||
|
||||
/**
|
||||
* 模糊搜索用户
|
||||
* @param userName 用户名/拼音/首字母
|
||||
* @return 匹配到的用户
|
||||
*/
|
||||
R getOrgTreeUser(String userName);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.pig4cloud.pigx.flow.task.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessCopy;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程抄送数据 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-20
|
||||
*/
|
||||
public interface IProcessCopyService extends IService<ProcessCopy> {
|
||||
|
||||
/**
|
||||
* 查询单个抄送详细信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
R querySingleDetail(long id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.pig4cloud.pigx.flow.task.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessGroup;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-25
|
||||
*/
|
||||
public interface IProcessGroupService extends IService<ProcessGroup> {
|
||||
|
||||
/**
|
||||
* 组列表
|
||||
* @return
|
||||
*/
|
||||
R<List<ProcessGroup>> queryList();
|
||||
|
||||
/**
|
||||
* 新增流程分组
|
||||
* @param processGroup 分组名
|
||||
* @return 添加结果
|
||||
*/
|
||||
R create(ProcessGroup processGroup);
|
||||
|
||||
/**
|
||||
* 删除分组
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
R delete(long id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.pig4cloud.pigx.flow.task.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessInstanceRecord;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程记录 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-07
|
||||
*/
|
||||
public interface IProcessInstanceRecordService extends IService<ProcessInstanceRecord> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.pig4cloud.pigx.flow.task.service;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.dto.ProcessInstanceParamDto;
|
||||
import com.pig4cloud.pigx.flow.task.dto.TaskQueryParamDto;
|
||||
import com.pig4cloud.pigx.flow.task.vo.NodeFormatParamVo;
|
||||
|
||||
/**
|
||||
* 流程实例进程
|
||||
*/
|
||||
public interface IProcessInstanceService {
|
||||
|
||||
/**
|
||||
* 启动流程
|
||||
* @param processInstanceParamDto
|
||||
* @return
|
||||
*/
|
||||
R startProcessInstance(ProcessInstanceParamDto processInstanceParamDto);
|
||||
|
||||
/**
|
||||
* 查询当前登录用户的待办任务
|
||||
* @param taskQueryParamDto taskQueryParamDto
|
||||
* @return
|
||||
*/
|
||||
R queryMineTask(TaskQueryParamDto taskQueryParamDto);
|
||||
|
||||
/**
|
||||
* 查询已办任务
|
||||
* @param taskQueryParamDto
|
||||
* @return
|
||||
*/
|
||||
R queryMineEndTask(TaskQueryParamDto taskQueryParamDto);
|
||||
|
||||
/**
|
||||
* 流程结束
|
||||
* @param processsInstanceId
|
||||
* @return
|
||||
*/
|
||||
R end(String processsInstanceId);
|
||||
|
||||
/**
|
||||
* 查询我发起的
|
||||
* @param taskQueryParamDto
|
||||
* @return
|
||||
*/
|
||||
R queryMineStarted(TaskQueryParamDto taskQueryParamDto);
|
||||
|
||||
/**
|
||||
* 查询抄送给我的
|
||||
* @param taskQueryParamDto
|
||||
* @return
|
||||
*/
|
||||
R queryMineCC(TaskQueryParamDto taskQueryParamDto);
|
||||
|
||||
/**
|
||||
* 格式化流程显示
|
||||
* @param nodeFormatParamVo
|
||||
* @return
|
||||
*/
|
||||
R formatStartNodeShow(NodeFormatParamVo nodeFormatParamVo);
|
||||
|
||||
/**
|
||||
* 流程详情
|
||||
* @param processInstanceId
|
||||
* @return
|
||||
*/
|
||||
R detail(String processInstanceId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.pig4cloud.pigx.flow.task.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.dto.Node;
|
||||
import com.pig4cloud.pigx.flow.task.dto.ProcessNodeDataDto;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessNodeData;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程节点数据 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-07
|
||||
*/
|
||||
public interface IProcessNodeDataService extends IService<ProcessNodeData> {
|
||||
|
||||
/**
|
||||
* 保存流程节点数据
|
||||
* @param processNodeDataDto
|
||||
* @return
|
||||
*/
|
||||
R saveNodeData(ProcessNodeDataDto processNodeDataDto);
|
||||
|
||||
/***
|
||||
* 获取节点数据
|
||||
* @param flowId
|
||||
* @param nodeId
|
||||
* @return
|
||||
*/
|
||||
R<Node> getNodeData(String flowId, String nodeId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.pig4cloud.pigx.flow.task.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessNodeRecordAssignUser;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程节点记录-执行人 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author cxygzl
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface IProcessNodeRecordAssignUserService extends IService<ProcessNodeRecordAssignUser> {
|
||||
|
||||
/**
|
||||
* 设置执行人
|
||||
* @param processNodeRecordAssignUserParamDto
|
||||
* @return
|
||||
*/
|
||||
R addAssignUser(ProcessNodeRecordAssignUserParamDto processNodeRecordAssignUserParamDto);
|
||||
|
||||
/**
|
||||
* 任务完成通知
|
||||
* @param processNodeRecordAssignUserParamDto
|
||||
* @return
|
||||
*/
|
||||
R completeTaskEvent(ProcessNodeRecordAssignUserParamDto processNodeRecordAssignUserParamDto);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.pig4cloud.pigx.flow.task.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.dto.ProcessNodeRecordParamDto;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessNodeRecord;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程节点记录 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author cxygzl
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface IProcessNodeRecordService extends IService<ProcessNodeRecord> {
|
||||
|
||||
/**
|
||||
* 节点开始
|
||||
* @param processNodeRecordParamDto
|
||||
* @return
|
||||
*/
|
||||
R start(ProcessNodeRecordParamDto processNodeRecordParamDto);
|
||||
|
||||
/**
|
||||
* 节点结束
|
||||
* @param processNodeRecordParamDto
|
||||
* @return
|
||||
*/
|
||||
R complete(ProcessNodeRecordParamDto processNodeRecordParamDto);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.pig4cloud.pigx.flow.task.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.entity.Process;
|
||||
import com.pig4cloud.pigx.flow.task.vo.ProcessVO;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author cxygzl
|
||||
* @since 2023-05-25
|
||||
*/
|
||||
public interface IProcessService extends IService<Process> {
|
||||
|
||||
/**
|
||||
* 获取详细数据
|
||||
* @param flowId
|
||||
* @return
|
||||
*/
|
||||
R<ProcessVO> getDetail(String flowId);
|
||||
|
||||
Process getByFlowId(String flowId);
|
||||
|
||||
void updateByFlowId(Process process);
|
||||
|
||||
void hide(String flowId);
|
||||
|
||||
/**
|
||||
* 创建流程
|
||||
* @param process
|
||||
* @return
|
||||
*/
|
||||
R create(Process process);
|
||||
|
||||
/**
|
||||
* 编辑表单
|
||||
* @param flowId 摸板ID
|
||||
* @param type 类型 stop using delete
|
||||
* @return 操作结果
|
||||
*/
|
||||
R update(String flowId, String type, Long groupId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.pig4cloud.pigx.flow.task.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessStarter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程发起人 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-30
|
||||
*/
|
||||
public interface IProcessStarterService extends IService<ProcessStarter> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
|
||||
package com.pig4cloud.pigx.flow.task.service;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.dto.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 远程调用的接口
|
||||
*/
|
||||
public interface IRemoteService {
|
||||
|
||||
/**
|
||||
* 根据角色id集合查询用户id集合
|
||||
* @param roleIdList
|
||||
* @return
|
||||
*/
|
||||
R<List<Long>> queryUserIdListByRoleIdList(List<Long> roleIdList);
|
||||
|
||||
/**
|
||||
* 保存抄送
|
||||
* @param copyDto
|
||||
* @return
|
||||
*/
|
||||
R saveCC(ProcessCopyDto copyDto);
|
||||
|
||||
/**
|
||||
* 检查是否是所有的父级
|
||||
* @param checkParentDto
|
||||
* @return
|
||||
*/
|
||||
R<Boolean> checkIsAllParent(CheckParentDto checkParentDto);
|
||||
|
||||
/**
|
||||
* 根据部门id集合查询用户id集合
|
||||
* @param depIdList
|
||||
* @return
|
||||
*/
|
||||
R<List<Long>> queryUserIdListByDepIdList(List<Long> depIdList);
|
||||
|
||||
/**
|
||||
* 检查是否是所有的子级
|
||||
* @param checkChildDto
|
||||
* @return
|
||||
*/
|
||||
R<Boolean> checkIsAllChild(CheckChildDto checkChildDto);
|
||||
|
||||
/**
|
||||
* 获取用户的信息-包括扩展字段
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
R<Map<String, Object>> queryUserAllInfo(long userId);
|
||||
|
||||
/**
|
||||
* 开始节点事件
|
||||
* @param recordParamDto
|
||||
* @return
|
||||
*/
|
||||
R startNodeEvent(ProcessNodeRecordParamDto recordParamDto);
|
||||
|
||||
/**
|
||||
* 流程创建了
|
||||
* @param processInstanceRecordParamDto
|
||||
* @return
|
||||
*/
|
||||
R createProcessEvent(ProcessInstanceRecordParamDto processInstanceRecordParamDto);
|
||||
|
||||
/**
|
||||
* 完成节点事件
|
||||
* @param recordParamDto
|
||||
* @return
|
||||
*/
|
||||
R endNodeEvent(ProcessNodeRecordParamDto recordParamDto);
|
||||
|
||||
/**
|
||||
* 开始设置执行人
|
||||
* @param processNodeRecordAssignUserParamDto
|
||||
* @return
|
||||
*/
|
||||
R startAssignUser(ProcessNodeRecordAssignUserParamDto processNodeRecordAssignUserParamDto);
|
||||
|
||||
/**
|
||||
* 任务结束事件
|
||||
* @param processNodeRecordAssignUserParamDto
|
||||
* @return
|
||||
*/
|
||||
R taskEndEvent(ProcessNodeRecordAssignUserParamDto processNodeRecordAssignUserParamDto);
|
||||
|
||||
/**
|
||||
* 实例结束
|
||||
* @param processInstanceId
|
||||
* @return
|
||||
*/
|
||||
R endProcess(String processInstanceId);
|
||||
|
||||
/**
|
||||
* 查询流程管理员
|
||||
* @param flowId
|
||||
* @return
|
||||
*/
|
||||
R<Long> queryProcessAdmin(String flowId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.pig4cloud.pigx.flow.task.service;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.dto.TaskParamDto;
|
||||
|
||||
/**
|
||||
* 任务处理
|
||||
*/
|
||||
public interface ITaskService {
|
||||
|
||||
/**
|
||||
* 查询任务
|
||||
* @param taskId
|
||||
* @param view
|
||||
* @return
|
||||
*/
|
||||
R queryTask(String taskId, boolean view);
|
||||
|
||||
/**
|
||||
* 完成任务
|
||||
* @param taskParamDto
|
||||
* @return
|
||||
*/
|
||||
R completeTask(TaskParamDto taskParamDto);
|
||||
|
||||
/**
|
||||
* 前加签
|
||||
* @param taskParamDto
|
||||
* @return
|
||||
*/
|
||||
R delegateTask(TaskParamDto taskParamDto);
|
||||
|
||||
/**
|
||||
* 加签完成任务
|
||||
* @param taskParamDto
|
||||
* @return
|
||||
*/
|
||||
R resolveTask(TaskParamDto taskParamDto);
|
||||
|
||||
/**
|
||||
* 设置执行人
|
||||
* @param taskParamDto
|
||||
* @return
|
||||
*/
|
||||
R setAssignee(TaskParamDto taskParamDto);
|
||||
|
||||
/**
|
||||
* 结束流程
|
||||
* @param taskParamDto
|
||||
* @return
|
||||
*/
|
||||
R stopProcessInstance(TaskParamDto taskParamDto);
|
||||
|
||||
/**
|
||||
* 退回
|
||||
* @param taskParamDto
|
||||
* @return
|
||||
*/
|
||||
R back(TaskParamDto taskParamDto);
|
||||
|
||||
/**
|
||||
* 查询首页数据看板
|
||||
* @return
|
||||
*/
|
||||
R queryTaskData();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.pig4cloud.pigx.flow.task.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.service.PigxUser;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import com.pig4cloud.pigx.flow.task.constant.NodeUserTypeEnum;
|
||||
import com.pig4cloud.pigx.flow.task.entity.Process;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessGroup;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessStarter;
|
||||
import com.pig4cloud.pigx.flow.task.service.ICombinationGroupService;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessGroupService;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessService;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessStarterService;
|
||||
import com.pig4cloud.pigx.flow.task.vo.FormGroupVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class CombinationGroupServiceImpl implements ICombinationGroupService {
|
||||
|
||||
private final IProcessGroupService processGroupService;
|
||||
|
||||
private final IProcessService processService;
|
||||
|
||||
private final IProcessStarterService processStarterService;
|
||||
|
||||
/**
|
||||
* 查询表单组包含流程
|
||||
* @param hidden
|
||||
* @return 表单组数据
|
||||
*/
|
||||
@Override
|
||||
public R listGroupWithProcess(Page page, Long groupId) {
|
||||
return R.ok(processService.lambdaQuery().eq(Process::getGroupId, groupId).eq(Process::getHidden, false)
|
||||
.orderByAsc(Process::getSort).orderByDesc(Process::getCreateTime).page(page));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有我可以发起的表单组
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R listCurrentUserStartGroup() {
|
||||
PigxUser user = SecurityUtils.getUser();
|
||||
|
||||
List<FormGroupVo> formGroupVos = new LinkedList<>();
|
||||
|
||||
List<ProcessGroup> processGroupList = processGroupService.lambdaQuery().orderByAsc(ProcessGroup::getSort)
|
||||
.list();
|
||||
|
||||
processGroupList.forEach(group -> {
|
||||
FormGroupVo formGroupVo = FormGroupVo.builder().id(group.getId()).name(group.getGroupName())
|
||||
.items(new LinkedList<>()).build();
|
||||
formGroupVos.add(formGroupVo);
|
||||
|
||||
List<Process> processList = processService.lambdaQuery().eq(Process::getGroupId, group.getId())
|
||||
.eq(Process::getHidden, false).eq(Process::getStop, false).orderByAsc(Process::getSort).list();
|
||||
|
||||
Map<Long, Boolean> existMap = new HashMap<>();
|
||||
|
||||
if (!processList.isEmpty()) {
|
||||
List<Long> idList = processList.stream().map(Process::getId).collect(Collectors.toList());
|
||||
// 查询发起人集合
|
||||
List<ProcessStarter> processStarterList = processStarterService.lambdaQuery()
|
||||
.in(ProcessStarter::getProcessId, idList).list();
|
||||
Map<Long, List<ProcessStarter>> groupmap = processStarterList.stream()
|
||||
.collect(Collectors.groupingBy(ProcessStarter::getProcessId));
|
||||
|
||||
for (Process process : processList) {
|
||||
List<ProcessStarter> processStarters = groupmap.get(process.getId());
|
||||
if (processStarters == null) {
|
||||
existMap.put(process.getId(), true);
|
||||
continue;
|
||||
}
|
||||
boolean match = processStarters.stream().anyMatch(w -> w.getTypeId().longValue() == user.getId()
|
||||
&& w.getType().equals(NodeUserTypeEnum.USER.getKey()));
|
||||
if (match) {
|
||||
existMap.put(process.getId(), true);
|
||||
continue;
|
||||
}
|
||||
Set<Long> deptIdSet = processStarters.stream()
|
||||
.filter(w -> w.getType().equals(NodeUserTypeEnum.DEPT.getKey())).map(w -> w.getTypeId())
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
existMap.put(process.getId(), deptIdSet.contains(user.getDeptId()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
processList.forEach(process -> {
|
||||
|
||||
if (!existMap.get(process.getId())) {
|
||||
return;
|
||||
}
|
||||
|
||||
formGroupVo.getItems()
|
||||
.add(FormGroupVo.FlowVo.builder().flowId(process.getFlowId()).name(process.getName())
|
||||
.logo(process.getLogo()).remark(process.getRemark()).stop(process.getStop())
|
||||
.updated(process.getUpdateTime()).build());
|
||||
});
|
||||
});
|
||||
return R.ok(formGroupVos);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.pig4cloud.pigx.flow.task.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysDept;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysRole;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.admin.api.feign.RemoteDeptService;
|
||||
import com.pig4cloud.pigx.admin.api.feign.RemoteRoleService;
|
||||
import com.pig4cloud.pigx.admin.api.feign.RemoteUserService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.core.util.RetOps;
|
||||
import com.pig4cloud.pigx.flow.task.constant.NodeUserTypeEnum;
|
||||
import com.pig4cloud.pigx.flow.task.service.IOrgService;
|
||||
import com.pig4cloud.pigx.flow.task.utils.DataUtil;
|
||||
import com.pig4cloud.pigx.flow.task.vo.OrgTreeVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class OrgServiceImpl implements IOrgService {
|
||||
|
||||
private final RemoteUserService remoteUserService;
|
||||
|
||||
private final RemoteRoleService remoteRoleService;
|
||||
|
||||
private final RemoteDeptService remoteDeptService;
|
||||
|
||||
/**
|
||||
* 查询组织架构树
|
||||
* @param deptId 部门id
|
||||
* @param type 只查询部门架构
|
||||
* @param showLeave 是否显示离职员工
|
||||
* @return 组织架构树数据
|
||||
*/
|
||||
@Override
|
||||
public R getOrgTreeData(Long deptId, String type, Boolean showLeave) {
|
||||
List<OrgTreeVo> orgs = new LinkedList<>();
|
||||
|
||||
if (StrUtil.equals(type, NodeUserTypeEnum.ROLE.getKey())) {
|
||||
// 角色
|
||||
|
||||
List<SysRole> roleList = remoteRoleService.getAllRole().getData();
|
||||
|
||||
for (SysRole role : roleList) {
|
||||
OrgTreeVo orgTreeVo = new OrgTreeVo();
|
||||
orgTreeVo.setId(role.getRoleId());
|
||||
orgTreeVo.setName(role.getRoleName());
|
||||
orgTreeVo.setType(NodeUserTypeEnum.ROLE.getKey());
|
||||
orgTreeVo.setSelected(false);
|
||||
orgs.add(orgTreeVo);
|
||||
}
|
||||
|
||||
Dict dict = Dict.create().set("roleList", orgs).set("childDepartments", orgs).set("employees",
|
||||
new ArrayList<>());
|
||||
return R.ok(dict);
|
||||
|
||||
}
|
||||
|
||||
Dict dict = Dict.create().set("titleDepartments", new ArrayList<>()).set("roleList", new ArrayList<>())
|
||||
.set("employees", new ArrayList<>());
|
||||
|
||||
List<SysDept> deptList = remoteDeptService.getAllDept().getData();
|
||||
|
||||
// 查询所有部门及员工
|
||||
{
|
||||
List deptVoList = new ArrayList();
|
||||
for (SysDept dept : deptList) {
|
||||
OrgTreeVo orgTreeVo = new OrgTreeVo();
|
||||
orgTreeVo.setId(dept.getDeptId());
|
||||
orgTreeVo.setName(dept.getName());
|
||||
orgTreeVo.setType(NodeUserTypeEnum.DEPT.getKey());
|
||||
orgTreeVo.setSelected(false);
|
||||
deptVoList.add(orgTreeVo);
|
||||
}
|
||||
dict.set("childDepartments", deptVoList);
|
||||
}
|
||||
if (!StrUtil.equals(type, NodeUserTypeEnum.DEPT.getKey())) {
|
||||
|
||||
List userVoList = new ArrayList();
|
||||
|
||||
List<SysUser> userList = remoteUserService.getUserIdListByDeptIdList(CollUtil.toList(deptId)).getData();
|
||||
|
||||
for (SysUser user : userList) {
|
||||
OrgTreeVo orgTreeVo = new OrgTreeVo();
|
||||
orgTreeVo.setId(user.getUserId());
|
||||
orgTreeVo.setName(user.getUsername());
|
||||
orgTreeVo.setType(NodeUserTypeEnum.USER.getKey());
|
||||
orgTreeVo.setSelected(false);
|
||||
orgTreeVo.setAvatar(user.getAvatar());
|
||||
userVoList.add(orgTreeVo);
|
||||
}
|
||||
dict.set("employees", userVoList);
|
||||
}
|
||||
|
||||
if (deptId > 0) {
|
||||
List<SysDept> allDept = remoteDeptService.getAllDept().getData();
|
||||
List<SysDept> depts = DataUtil.selectParentByDept(deptId, allDept);
|
||||
dict.set("titleDepartments", CollUtil.reverse(depts));
|
||||
}
|
||||
|
||||
return R.ok(dict);
|
||||
}
|
||||
|
||||
/**
|
||||
* 模糊搜索用户
|
||||
* @param userName 用户名/拼音/首字母
|
||||
* @return 匹配到的用户
|
||||
*/
|
||||
@Override
|
||||
public R getOrgTreeUser(String userName) {
|
||||
return R.ok(RetOps.of(remoteUserService.getUserListByUserName(userName)).getData().orElseGet(ArrayList::new)
|
||||
.stream().map(user -> {
|
||||
OrgTreeVo orgTreeVo = new OrgTreeVo();
|
||||
orgTreeVo.setId(user.getUserId());
|
||||
orgTreeVo.setName(user.getUsername());
|
||||
orgTreeVo.setType(NodeUserTypeEnum.USER.getKey());
|
||||
orgTreeVo.setSelected(false);
|
||||
orgTreeVo.setAvatar(user.getAvatar());
|
||||
return orgTreeVo;
|
||||
}).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package com.pig4cloud.pigx.flow.task.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.constant.FormTypeEnum;
|
||||
import com.pig4cloud.pigx.flow.task.constant.ProcessInstanceConstant;
|
||||
import com.pig4cloud.pigx.flow.task.dto.Node;
|
||||
import com.pig4cloud.pigx.flow.task.entity.Process;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessCopy;
|
||||
import com.pig4cloud.pigx.flow.task.mapper.ProcessCopyMapper;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessCopyService;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessNodeDataService;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessService;
|
||||
import com.pig4cloud.pigx.flow.task.vo.FormItemVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程抄送数据 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-20
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ProcessCopyServiceImpl extends ServiceImpl<ProcessCopyMapper, ProcessCopy> implements IProcessCopyService {
|
||||
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
private final IProcessService processService;
|
||||
|
||||
private final IProcessNodeDataService nodeDataService;
|
||||
|
||||
/**
|
||||
* 查询单个抄送详细信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public R querySingleDetail(long id) {
|
||||
ProcessCopy processCopy = this.getById(id);
|
||||
String flowId = processCopy.getFlowId();
|
||||
Process oaForms = processService.getByFlowId(flowId);
|
||||
if (oaForms == null) {
|
||||
return R.failed("流程不存在");
|
||||
}
|
||||
String formData = processCopy.getFormData();
|
||||
|
||||
Map<String, Object> variableMap = objectMapper.readValue(formData, new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
|
||||
String nodeId = processCopy.getNodeId();
|
||||
|
||||
Node node = nodeDataService.getNodeData(flowId, nodeId).getData();
|
||||
Map<String, String> formPerms = node.getFormPerms();
|
||||
|
||||
List<FormItemVO> jsonObjectList = objectMapper.readValue(oaForms.getFormItems(),
|
||||
new TypeReference<List<FormItemVO>>() {
|
||||
});
|
||||
for (FormItemVO formItemVO : jsonObjectList) {
|
||||
String fid = formItemVO.getId();
|
||||
String perm = formPerms.get(fid);
|
||||
formItemVO.setPerm(StrUtil.isBlankIfStr(perm) ? ProcessInstanceConstant.FormPermClass.HIDE : perm);
|
||||
|
||||
if (formItemVO.getType().equals(FormTypeEnum.LAYOUT.getType())) {
|
||||
// 明细
|
||||
|
||||
List<Map<String, Object>> subParamList = MapUtil.get(variableMap, fid,
|
||||
new cn.hutool.core.lang.TypeReference<List<Map<String, Object>>>() {
|
||||
});
|
||||
|
||||
Object value = formItemVO.getProps().getValue();
|
||||
|
||||
List<List<FormItemVO>> l = new ArrayList<>();
|
||||
for (Map<String, Object> map : subParamList) {
|
||||
List<FormItemVO> subItemList = Convert.toList(FormItemVO.class, value);
|
||||
for (FormItemVO itemVO : subItemList) {
|
||||
itemVO.getProps().setValue(map.get(itemVO.getId()));
|
||||
|
||||
String permSub = formPerms.get(itemVO.getId());
|
||||
if (StrUtil.isNotBlank(permSub)) {
|
||||
itemVO.setPerm(ProcessInstanceConstant.FormPermClass.EDIT.equals(permSub)
|
||||
? ProcessInstanceConstant.FormPermClass.READ : permSub
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
else {
|
||||
itemVO.setPerm(ProcessInstanceConstant.FormPermClass.HIDE);
|
||||
}
|
||||
|
||||
}
|
||||
l.add(subItemList);
|
||||
}
|
||||
formItemVO.getProps().setValue(l);
|
||||
|
||||
}
|
||||
else {
|
||||
formItemVO.getProps().setValue(variableMap.get(fid));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Dict set = Dict.create().set("formItems", jsonObjectList);
|
||||
|
||||
return R.ok(set);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.pig4cloud.pigx.flow.task.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessGroup;
|
||||
import com.pig4cloud.pigx.flow.task.mapper.ProcessGroupMapper;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessGroupService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-25
|
||||
*/
|
||||
@Service
|
||||
public class ProcessGroupServiceImpl extends ServiceImpl<ProcessGroupMapper, ProcessGroup>
|
||||
implements IProcessGroupService {
|
||||
|
||||
/**
|
||||
* 组列表
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R<List<ProcessGroup>> queryList() {
|
||||
List<ProcessGroup> processGroupList = this.lambdaQuery().orderByAsc(ProcessGroup::getSort).list();
|
||||
|
||||
return R.ok(processGroupList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增表单分组
|
||||
* @param processGroup 分组名
|
||||
* @return 添加结果
|
||||
*/
|
||||
@Override
|
||||
public R create(ProcessGroup processGroup) {
|
||||
ProcessGroup pg = new ProcessGroup();
|
||||
pg.setSort(0);
|
||||
pg.setGroupName(processGroup.getGroupName());
|
||||
|
||||
this.save(pg);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分组
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R delete(long id) {
|
||||
this.removeById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.pig4cloud.pigx.flow.task.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessInstanceRecord;
|
||||
import com.pig4cloud.pigx.flow.task.mapper.ProcessInstanceRecordMapper;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessInstanceRecordService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程记录 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-07
|
||||
*/
|
||||
@Service
|
||||
public class ProcessInstanceRecordServiceImpl extends ServiceImpl<ProcessInstanceRecordMapper, ProcessInstanceRecord>
|
||||
implements IProcessInstanceRecordService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,417 @@
|
||||
package com.pig4cloud.pigx.flow.task.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.admin.api.feign.RemoteUserService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.service.PigxUser;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import com.pig4cloud.pigx.flow.task.api.feign.RemoteFlowEngineService;
|
||||
import com.pig4cloud.pigx.flow.task.constant.FormTypeEnum;
|
||||
import com.pig4cloud.pigx.flow.task.constant.NodeStatusEnum;
|
||||
import com.pig4cloud.pigx.flow.task.constant.NodeUserTypeEnum;
|
||||
import com.pig4cloud.pigx.flow.task.constant.ProcessInstanceConstant;
|
||||
import com.pig4cloud.pigx.flow.task.dto.*;
|
||||
import com.pig4cloud.pigx.flow.task.entity.Process;
|
||||
import com.pig4cloud.pigx.flow.task.entity.*;
|
||||
import com.pig4cloud.pigx.flow.task.service.*;
|
||||
import com.pig4cloud.pigx.flow.task.utils.NodeFormatUtil;
|
||||
import com.pig4cloud.pigx.flow.task.vo.FormItemVO;
|
||||
import com.pig4cloud.pigx.flow.task.vo.NodeFormatParamVo;
|
||||
import com.pig4cloud.pigx.flow.task.vo.NodeVo;
|
||||
import com.pig4cloud.pigx.flow.task.vo.ProcessCopyVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 实例进程服务
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class ProcessInstanceServiceImpl implements IProcessInstanceService {
|
||||
|
||||
private final RemoteFlowEngineService flowEngineService;
|
||||
|
||||
private final RemoteUserService userService;
|
||||
|
||||
private final IProcessInstanceRecordService processInstanceRecordService;
|
||||
|
||||
private final IProcessCopyService processCopyService;
|
||||
|
||||
private final IProcessService processService;
|
||||
|
||||
private final IProcessNodeRecordService processNodeRecordService;
|
||||
|
||||
private final IProcessNodeRecordAssignUserService processNodeRecordAssignUserService;
|
||||
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
/**
|
||||
* 启动流程
|
||||
* @param processInstanceParamDto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R startProcessInstance(ProcessInstanceParamDto processInstanceParamDto) {
|
||||
|
||||
PigxUser user = SecurityUtils.getUser();
|
||||
|
||||
processInstanceParamDto.setStartUserId(String.valueOf(user.getId()));
|
||||
Map<String, Object> paramMap = processInstanceParamDto.getParamMap();
|
||||
Dict rootUser = Dict.create().set("id", user.getId()).set("name", user.getUsername()).set("type",
|
||||
NodeUserTypeEnum.USER.getKey());
|
||||
paramMap.put("root", CollUtil.newArrayList(rootUser));
|
||||
return flowEngineService.startProcess(processInstanceParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前登录用户的待办任务
|
||||
* @param pageVO
|
||||
* @param taskDto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R queryMineTask(TaskQueryParamDto taskQueryParamDto) {
|
||||
taskQueryParamDto.setAssign(SecurityUtils.getUser().getId().toString());
|
||||
R<Page<TaskDto>> r = flowEngineService.queryAssignTask(taskQueryParamDto);
|
||||
|
||||
if (CollUtil.isEmpty(r.getData().getRecords())) {
|
||||
return r;
|
||||
}
|
||||
|
||||
Set<String> processInstanceIdSet = r.getData().getRecords().stream().map(TaskDto::getProcessInstanceId)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
// 流程实例记录
|
||||
List<ProcessInstanceRecord> processInstanceRecordList = processInstanceRecordService.lambdaQuery()
|
||||
.in(ProcessInstanceRecord::getProcessInstanceId, processInstanceIdSet).list();
|
||||
|
||||
// 发起人
|
||||
List<SysUser> startUserList = processInstanceRecordList.stream().map(ProcessInstanceRecord::getUserId)
|
||||
.map(userId -> userService.getUserById(userId).getData()).collect(Collectors.toList());
|
||||
|
||||
Page<TaskDto> pageResultDto = r.getData();
|
||||
List<TaskDto> taskDtoList = new ArrayList<>();
|
||||
for (TaskDto record : r.getData().getRecords()) {
|
||||
ProcessInstanceRecord processInstanceRecord = processInstanceRecordList.stream()
|
||||
.filter(w -> StrUtil.equals(w.getProcessInstanceId(), record.getProcessInstanceId())).findAny()
|
||||
.orElse(null);
|
||||
|
||||
if (processInstanceRecord != null) {
|
||||
record.setProcessName(processInstanceRecord.getName());
|
||||
SysUser startUser = startUserList.stream()
|
||||
.filter(w -> w.getUserId().longValue() == processInstanceRecord.getUserId()).findAny()
|
||||
.orElse(null);
|
||||
|
||||
record.setRootUserId(processInstanceRecord.getUserId());
|
||||
record.setGroupName(processInstanceRecord.getGroupName());
|
||||
record.setRootUserName(startUser.getUsername());
|
||||
record.setRootUserAvatarUrl(startUser.getAvatar());
|
||||
record.setStartTime(processInstanceRecord.getCreateTime());
|
||||
|
||||
taskDtoList.add(record);
|
||||
}
|
||||
}
|
||||
|
||||
pageResultDto.setRecords(taskDtoList);
|
||||
|
||||
return R.ok(pageResultDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询已办任务
|
||||
* @param taskQueryParamDto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R queryMineEndTask(TaskQueryParamDto taskQueryParamDto) {
|
||||
taskQueryParamDto.setAssign(SecurityUtils.getUser().getId().toString());
|
||||
R<Page<TaskDto>> r = flowEngineService.queryCompletedTask(taskQueryParamDto);
|
||||
|
||||
Page<TaskDto> pageResultDto = r.getData();
|
||||
List<TaskDto> records = pageResultDto.getRecords();
|
||||
if (CollUtil.isEmpty(records)) {
|
||||
return R.ok(pageResultDto);
|
||||
|
||||
}
|
||||
|
||||
Set<String> processInstanceIdSet = records.stream().map(TaskDto::getProcessInstanceId)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
// 流程实例记录
|
||||
List<ProcessInstanceRecord> processInstanceRecordList = processInstanceRecordService.lambdaQuery()
|
||||
.in(ProcessInstanceRecord::getProcessInstanceId, processInstanceIdSet).list();
|
||||
|
||||
// 发起人
|
||||
List<SysUser> startUserList = processInstanceRecordList.stream().map(ProcessInstanceRecord::getUserId)
|
||||
.map(userId -> userService.getUserById(userId).getData()).collect(Collectors.toList());
|
||||
|
||||
List<TaskDto> taskDtoList = new ArrayList<>();
|
||||
for (TaskDto record : records) {
|
||||
|
||||
ProcessInstanceRecord processInstanceRecord = processInstanceRecordList.stream()
|
||||
.filter(w -> StrUtil.equals(w.getProcessInstanceId(), record.getProcessInstanceId())).findAny()
|
||||
.orElse(null);
|
||||
|
||||
if (processInstanceRecord != null) {
|
||||
|
||||
record.setProcessName(processInstanceRecord.getName());
|
||||
|
||||
SysUser startUser = startUserList.stream()
|
||||
.filter(w -> w.getUserId().longValue() == processInstanceRecord.getUserId()).findAny()
|
||||
.orElse(null);
|
||||
|
||||
record.setRootUserId(processInstanceRecord.getUserId());
|
||||
record.setGroupName(processInstanceRecord.getGroupName());
|
||||
record.setRootUserName(startUser.getName());
|
||||
record.setRootUserAvatarUrl(startUser.getAvatar());
|
||||
record.setTaskId(record.getTaskId());
|
||||
record.setStartTime(processInstanceRecord.getCreateTime());
|
||||
taskDtoList.add(record);
|
||||
}
|
||||
}
|
||||
|
||||
pageResultDto.setRecords(taskDtoList);
|
||||
|
||||
return R.ok(pageResultDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程结束
|
||||
* @param processsInstanceId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R end(String processsInstanceId) {
|
||||
processInstanceRecordService.lambdaUpdate().set(ProcessInstanceRecord::getEndTime, new Date())
|
||||
.set(ProcessInstanceRecord::getStatus, NodeStatusEnum.YJS.getCode())
|
||||
.eq(ProcessInstanceRecord::getProcessInstanceId, processsInstanceId)
|
||||
.update(new ProcessInstanceRecord());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我发起的
|
||||
* @param pageDto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R queryMineStarted(TaskQueryParamDto taskQueryParamDto) {
|
||||
|
||||
long userId = SecurityUtils.getUser().getId();
|
||||
|
||||
Page<ProcessInstanceRecord> instanceRecordPage = processInstanceRecordService.lambdaQuery()
|
||||
.eq(ProcessInstanceRecord::getUserId, userId)
|
||||
.eq(ProcessInstanceRecord::getStatus, taskQueryParamDto.getStatus())
|
||||
.between(ArrayUtil.isNotEmpty(taskQueryParamDto.getTaskTime()), ProcessInstanceRecord::getCreateTime,
|
||||
ArrayUtil.isNotEmpty(taskQueryParamDto.getTaskTime()) ? taskQueryParamDto.getTaskTime()[0]
|
||||
: null,
|
||||
ArrayUtil.isNotEmpty(taskQueryParamDto.getTaskTime()) ? taskQueryParamDto.getTaskTime()[1]
|
||||
: null)
|
||||
.orderByDesc(ProcessInstanceRecord::getCreateTime)
|
||||
.page(new Page<>(taskQueryParamDto.getPageNum(), taskQueryParamDto.getPageSize()));
|
||||
|
||||
return R.ok(instanceRecordPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询抄送给我的
|
||||
* @param pageDto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R queryMineCC(TaskQueryParamDto taskQueryParamDto) {
|
||||
|
||||
long userId = SecurityUtils.getUser().getId();
|
||||
|
||||
Page<ProcessCopy> page = processCopyService.lambdaQuery().eq(ProcessCopy::getUserId, userId).between(
|
||||
ArrayUtil.isNotEmpty(taskQueryParamDto.getTaskTime()), ProcessCopy::getCreateTime,
|
||||
ArrayUtil.isNotEmpty(taskQueryParamDto.getTaskTime()) ? taskQueryParamDto.getTaskTime()[0] : null,
|
||||
ArrayUtil.isNotEmpty(taskQueryParamDto.getTaskTime()) ? taskQueryParamDto.getTaskTime()[1] : null)
|
||||
.orderByDesc(ProcessCopy::getNodeTime)
|
||||
.page(new Page<>(taskQueryParamDto.getPageNum(), taskQueryParamDto.getPageSize()));
|
||||
|
||||
List<ProcessCopy> records = page.getRecords();
|
||||
|
||||
List<ProcessCopyVo> processCopyVoList = BeanUtil.copyToList(records, ProcessCopyVo.class);
|
||||
|
||||
if (CollUtil.isNotEmpty(records)) {
|
||||
// 发起人
|
||||
List<SysUser> startUserList = records.stream().map(ProcessCopy::getStartUserId)
|
||||
.map(id -> userService.getUserById(id).getData()).collect(Collectors.toList());
|
||||
|
||||
for (ProcessCopyVo record : processCopyVoList) {
|
||||
SysUser startUser = startUserList.stream()
|
||||
.filter(w -> w.getUserId().longValue() == record.getStartUserId()).findAny().orElse(null);
|
||||
record.setStartUserName(startUser.getUsername());
|
||||
}
|
||||
}
|
||||
|
||||
Page p = BeanUtil.copyProperties(page, Page.class);
|
||||
|
||||
p.setRecords(processCopyVoList);
|
||||
|
||||
return R.ok(p);
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化流程显示
|
||||
* @param nodeFormatParamVo
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public R formatStartNodeShow(NodeFormatParamVo nodeFormatParamVo) {
|
||||
String flowId = nodeFormatParamVo.getFlowId();
|
||||
String processInstanceId = nodeFormatParamVo.getProcessInstanceId();
|
||||
if (StrUtil.isAllBlank(flowId, processInstanceId)) {
|
||||
return R.ok(new ArrayList<>());
|
||||
}
|
||||
|
||||
if (StrUtil.isBlankIfStr(flowId) && StrUtil.isNotBlank(processInstanceId)) {
|
||||
ProcessInstanceRecord processInstanceRecord = processInstanceRecordService.lambdaQuery()
|
||||
.eq(ProcessInstanceRecord::getProcessInstanceId, processInstanceId).one();
|
||||
flowId = processInstanceRecord.getFlowId();
|
||||
|
||||
}
|
||||
Map<String, Object> paramMap = nodeFormatParamVo.getParamMap();
|
||||
if (StrUtil.isNotBlank(nodeFormatParamVo.getTaskId())) {
|
||||
VariableQueryParamDto variableQueryParamDto = new VariableQueryParamDto();
|
||||
variableQueryParamDto.setTaskId(nodeFormatParamVo.getTaskId());
|
||||
R<Map<String, Object>> r = flowEngineService.queryTaskVariables(variableQueryParamDto);
|
||||
if (!r.isOk()) {
|
||||
ProcessNodeRecordAssignUser processNodeRecordAssignUser = processNodeRecordAssignUserService
|
||||
.lambdaQuery().eq(ProcessNodeRecordAssignUser::getTaskId, nodeFormatParamVo.getTaskId())
|
||||
.eq(ProcessNodeRecordAssignUser::getStatus, NodeStatusEnum.YJS.getCode()).last("limit 1")
|
||||
.orderByDesc(ProcessNodeRecordAssignUser::getEndTime).one();
|
||||
|
||||
String data = processNodeRecordAssignUser.getData();
|
||||
|
||||
Map<String, Object> variableMap = objectMapper.readValue(data,
|
||||
new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
variableMap.putAll(paramMap);
|
||||
paramMap.putAll(variableMap);
|
||||
}
|
||||
else {
|
||||
Map<String, Object> variableMap = r.getData();
|
||||
variableMap.putAll(paramMap);
|
||||
paramMap.putAll(variableMap);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Set<String> completeNodeSet = new HashSet<>();
|
||||
|
||||
if (StrUtil.isNotBlank(processInstanceId)) {
|
||||
List<ProcessNodeRecord> processNodeRecordList = processNodeRecordService.lambdaQuery()
|
||||
.eq(ProcessNodeRecord::getProcessInstanceId, processInstanceId)
|
||||
.eq(ProcessNodeRecord::getStatus, NodeStatusEnum.YJS.getCode()).list();
|
||||
Set<String> collect = processNodeRecordList.stream().map(ProcessNodeRecord::getNodeId)
|
||||
.collect(Collectors.toSet());
|
||||
completeNodeSet.addAll(collect);
|
||||
}
|
||||
|
||||
Process oaForms = processService.getByFlowId(flowId);
|
||||
String process = oaForms.getProcess();
|
||||
Node nodeDto = objectMapper.readValue(process, new TypeReference<Node>() {
|
||||
});
|
||||
|
||||
List<NodeVo> processNodeShowDtos = NodeFormatUtil.formatProcessNodeShow(nodeDto, completeNodeSet,
|
||||
new HashSet<>(), processInstanceId, paramMap);
|
||||
|
||||
return R.ok(processNodeShowDtos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程详情
|
||||
* @param processInstanceId
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public R detail(String processInstanceId) {
|
||||
ProcessInstanceRecord processInstanceRecord = processInstanceRecordService.lambdaQuery()
|
||||
.eq(ProcessInstanceRecord::getProcessInstanceId, processInstanceId).one();
|
||||
|
||||
Process oaForms = processService.getByFlowId(processInstanceRecord.getFlowId());
|
||||
if (oaForms == null) {
|
||||
return R.failed("流程不存在");
|
||||
}
|
||||
|
||||
// 发起人变量数据
|
||||
String formData = processInstanceRecord.getFormData();
|
||||
Map<String, Object> variableMap = objectMapper.readValue(formData, new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
// 发起人表单权限
|
||||
String process = oaForms.getProcess();
|
||||
|
||||
Node nodeDto = objectMapper.readValue(process, Node.class);
|
||||
Map<String, String> formPerms1 = nodeDto.getFormPerms();
|
||||
|
||||
List<FormItemVO> jsonObjectList = objectMapper.readValue(oaForms.getFormItems(),
|
||||
new TypeReference<List<FormItemVO>>() {
|
||||
});
|
||||
for (FormItemVO formItemVO : jsonObjectList) {
|
||||
String id = formItemVO.getId();
|
||||
String perm = formPerms1.get(id);
|
||||
|
||||
formItemVO.setPerm(StrUtil.isBlankIfStr(perm) ? ProcessInstanceConstant.FormPermClass.READ
|
||||
: (StrUtil.equals(perm, ProcessInstanceConstant.FormPermClass.HIDE) ? perm
|
||||
: ProcessInstanceConstant.FormPermClass.READ));
|
||||
|
||||
if (formItemVO.getType().equals(FormTypeEnum.LAYOUT.getType())) {
|
||||
// 明细
|
||||
List<Map<String, Object>> subParamList = MapUtil.get(variableMap, id,
|
||||
new cn.hutool.core.lang.TypeReference<List<Map<String, Object>>>() {
|
||||
});
|
||||
|
||||
Object value = formItemVO.getProps().getValue();
|
||||
|
||||
List<List<FormItemVO>> l = new ArrayList<>();
|
||||
for (Map<String, Object> map : subParamList) {
|
||||
List<FormItemVO> subItemList = Convert.toList(FormItemVO.class, value);
|
||||
for (FormItemVO itemVO : subItemList) {
|
||||
itemVO.getProps().setValue(map.get(itemVO.getId()));
|
||||
|
||||
String permSub = formPerms1.get(itemVO.getId());
|
||||
|
||||
itemVO.setPerm(StrUtil.isBlankIfStr(permSub) ? ProcessInstanceConstant.FormPermClass.READ
|
||||
: (StrUtil.equals(permSub, ProcessInstanceConstant.FormPermClass.HIDE) ? permSub
|
||||
: ProcessInstanceConstant.FormPermClass.READ));
|
||||
|
||||
}
|
||||
l.add(subItemList);
|
||||
}
|
||||
formItemVO.getProps().setValue(l);
|
||||
|
||||
}
|
||||
else {
|
||||
formItemVO.getProps().setValue(variableMap.get(id));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Dict set = Dict.create().set("processInstanceId", processInstanceId).set("process", oaForms.getProcess())
|
||||
|
||||
.set("formItems", jsonObjectList);
|
||||
|
||||
return R.ok(set);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.pig4cloud.pigx.flow.task.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.dto.Node;
|
||||
import com.pig4cloud.pigx.flow.task.dto.ProcessNodeDataDto;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessNodeData;
|
||||
import com.pig4cloud.pigx.flow.task.mapper.ProcessNodeDataMapper;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessNodeDataService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程节点数据 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Vincent
|
||||
* @since 2023-05-07
|
||||
*/
|
||||
@Service
|
||||
public class ProcessNodeDataServiceImpl extends ServiceImpl<ProcessNodeDataMapper, ProcessNodeData>
|
||||
implements IProcessNodeDataService {
|
||||
|
||||
/**
|
||||
* 保存流程节点数据。
|
||||
* @param processNodeDataDto 流程节点数据DTO
|
||||
* @return 保存结果
|
||||
*/
|
||||
@Override
|
||||
public R saveNodeData(ProcessNodeDataDto processNodeDataDto) {
|
||||
ProcessNodeData processNodeData = BeanUtil.copyProperties(processNodeDataDto, ProcessNodeData.class);
|
||||
this.save(processNodeData);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取节点数据。
|
||||
* @param flowId 流程ID
|
||||
* @param nodeId 节点ID
|
||||
* @return 节点数据
|
||||
*/
|
||||
@Override
|
||||
public R<Node> getNodeData(String flowId, String nodeId) {
|
||||
Optional<ProcessNodeData> processNodeDataOptional = this.lambdaQuery().eq(ProcessNodeData::getFlowId, flowId)
|
||||
.eq(ProcessNodeData::getNodeId, nodeId).oneOpt();
|
||||
|
||||
Node node = processNodeDataOptional
|
||||
.map(processNodeData -> JSONUtil.toBean(processNodeData.getData(), Node.class)).orElse(null);
|
||||
|
||||
return R.ok(node);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.pig4cloud.pigx.flow.task.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.flow.task.constant.NodeStatusEnum;
|
||||
import com.pig4cloud.pigx.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.pig4cloud.pigx.flow.task.entity.ProcessNodeRecordAssignUser;
|
||||
import com.pig4cloud.pigx.flow.task.mapper.ProcessNodeRecordAssignUserMapper;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessNodeRecordAssignUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程节点记录-执行人 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author cxygzl
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Service
|
||||
public class ProcessNodeRecordAssignUserServiceImpl
|
||||
extends ServiceImpl<ProcessNodeRecordAssignUserMapper, ProcessNodeRecordAssignUser>
|
||||
implements IProcessNodeRecordAssignUserService {
|
||||
|
||||
/**
|
||||
* 设置执行人
|
||||
* @param processNodeRecordAssignUserParamDto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R addAssignUser(ProcessNodeRecordAssignUserParamDto processNodeRecordAssignUserParamDto) {
|
||||
if (StrUtil.isNotBlank(processNodeRecordAssignUserParamDto.getApproveDesc())) {
|
||||
ProcessNodeRecordAssignUser processNodeRecordAssignUser = this.lambdaQuery()
|
||||
.eq(ProcessNodeRecordAssignUser::getTaskId, processNodeRecordAssignUserParamDto.getTaskId())
|
||||
.orderByDesc(ProcessNodeRecordAssignUser::getId).last("limit 1").one();
|
||||
if (processNodeRecordAssignUser != null) {
|
||||
processNodeRecordAssignUser.setApproveDesc(processNodeRecordAssignUserParamDto.getApproveDesc());
|
||||
processNodeRecordAssignUser.setTaskType(processNodeRecordAssignUserParamDto.getTaskType());
|
||||
processNodeRecordAssignUser.setStatus(NodeStatusEnum.YJS.getCode());
|
||||
processNodeRecordAssignUser.setEndTime(LocalDateTime.now());
|
||||
this.updateById(processNodeRecordAssignUser);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ProcessNodeRecordAssignUser processNodeRecordAssignUser = BeanUtil
|
||||
.copyProperties(processNodeRecordAssignUserParamDto, ProcessNodeRecordAssignUser.class);
|
||||
processNodeRecordAssignUser.setStartTime(LocalDateTime.now());
|
||||
processNodeRecordAssignUser.setStatus(NodeStatusEnum.JXZ.getCode());
|
||||
processNodeRecordAssignUser.setApproveDesc("");
|
||||
processNodeRecordAssignUser.setTaskType("");
|
||||
this.save(processNodeRecordAssignUser);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务完成通知
|
||||
* @param processNodeRecordAssignUserParamDto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R completeTaskEvent(ProcessNodeRecordAssignUserParamDto processNodeRecordAssignUserParamDto) {
|
||||
ProcessNodeRecordAssignUser processNodeRecordAssignUser = this.lambdaQuery()
|
||||
.eq(ProcessNodeRecordAssignUser::getTaskId, processNodeRecordAssignUserParamDto.getTaskId())
|
||||
.eq(ProcessNodeRecordAssignUser::getUserId, processNodeRecordAssignUserParamDto.getUserId())
|
||||
.eq(ProcessNodeRecordAssignUser::getProcessInstanceId,
|
||||
processNodeRecordAssignUserParamDto.getProcessInstanceId())
|
||||
.eq(ProcessNodeRecordAssignUser::getStatus, NodeStatusEnum.JXZ.getCode())
|
||||
.orderByDesc(ProcessNodeRecordAssignUser::getId).last("limit 1").one();
|
||||
processNodeRecordAssignUser.setStatus(NodeStatusEnum.YJS.getCode());
|
||||
processNodeRecordAssignUser.setApproveDesc(processNodeRecordAssignUserParamDto.getApproveDesc());
|
||||
processNodeRecordAssignUser.setEndTime(LocalDateTime.now());
|
||||
processNodeRecordAssignUser.setData(processNodeRecordAssignUserParamDto.getData());
|
||||
processNodeRecordAssignUser.setLocalData(processNodeRecordAssignUserParamDto.getLocalData());
|
||||
processNodeRecordAssignUser.setTaskType("COMPLETE");
|
||||
this.updateById(processNodeRecordAssignUser);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user