工作流模块提交
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package com.njcn.bpm.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* BPM 流程 MetaInfo Response DTO
|
||||
* 主要用于 { Model#setMetaInfo(String)} 的存储
|
||||
*
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class BpmModelMetaInfoRespDTO {
|
||||
|
||||
/**
|
||||
* 流程图标
|
||||
*/
|
||||
private String icon;
|
||||
/**
|
||||
* 流程描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 表单类型
|
||||
*/
|
||||
private Integer formType;
|
||||
/**
|
||||
* 表单编号
|
||||
*/
|
||||
private String formId;
|
||||
/**
|
||||
* 自定义表单的提交路径,使用 Vue 的路由地址
|
||||
*/
|
||||
private String formCustomCreatePath;
|
||||
/**
|
||||
* 自定义表单的查看路径,使用 Vue 的路由地址
|
||||
*/
|
||||
private String formCustomViewPath;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.njcn.bpm.pojo.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.njcn.bpm.enums.ErrorCode;
|
||||
import com.njcn.bpm.enums.GlobalErrorCodeConstants;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import lombok.Data;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 通用返回
|
||||
*
|
||||
* @param <T> 数据泛型
|
||||
*/
|
||||
@Data
|
||||
public class CommonResult<T> implements Serializable {
|
||||
|
||||
/**
|
||||
* 错误码
|
||||
*
|
||||
* @see ErrorCode#getCode()
|
||||
*/
|
||||
private Integer code;
|
||||
/**
|
||||
* 返回数据
|
||||
*/
|
||||
private T data;
|
||||
/**
|
||||
* 错误提示,用户可阅读
|
||||
*
|
||||
* @see ErrorCode#getMsg() ()
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 将传入的 result 对象,转换成另外一个泛型结果的对象
|
||||
*
|
||||
* 因为 A 方法返回的 CommonResult 对象,不满足调用其的 B 方法的返回,所以需要进行转换。
|
||||
*
|
||||
* @param result 传入的 result 对象
|
||||
* @param <T> 返回的泛型
|
||||
* @return 新的 CommonResult 对象
|
||||
*/
|
||||
public static <T> CommonResult<T> error(CommonResult<?> result) {
|
||||
return error(result.getCode(), result.getMsg());
|
||||
}
|
||||
|
||||
public static <T> CommonResult<T> error(Integer code, String message) {
|
||||
Assert.isTrue(!GlobalErrorCodeConstants.SUCCESS.getCode().equals(code), "code 必须是错误的!");
|
||||
CommonResult<T> result = new CommonResult<>();
|
||||
result.code = code;
|
||||
result.msg = message;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static <T> CommonResult<T> error( String message) {
|
||||
CommonResult<T> result = new CommonResult<>();
|
||||
result.msg = message;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static <T> CommonResult<T> error(ErrorCode errorCode) {
|
||||
return error(errorCode.getCode(), errorCode.getMsg());
|
||||
}
|
||||
|
||||
public static <T> CommonResult<T> success(T data) {
|
||||
CommonResult<T> result = new CommonResult<>();
|
||||
result.code = GlobalErrorCodeConstants.SUCCESS.getCode();
|
||||
result.data = data;
|
||||
result.msg = "";
|
||||
return result;
|
||||
}
|
||||
|
||||
public static boolean isSuccess(Integer code) {
|
||||
return Objects.equals(code, GlobalErrorCodeConstants.SUCCESS.getCode());
|
||||
}
|
||||
|
||||
@JsonIgnore // 避免 jackson 序列化
|
||||
public boolean isSuccess() {
|
||||
return isSuccess(code);
|
||||
}
|
||||
|
||||
@JsonIgnore // 避免 jackson 序列化
|
||||
public boolean isError() {
|
||||
return !isSuccess();
|
||||
}
|
||||
|
||||
// ========= 和 Exception 异常体系集成 =========
|
||||
|
||||
/**
|
||||
*/
|
||||
public void checkError() throws BusinessException {
|
||||
if (isSuccess()) {
|
||||
return;
|
||||
}
|
||||
// 业务异常
|
||||
throw new BusinessException(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果没有,则返回 {@link #data} 数据
|
||||
*/
|
||||
@JsonIgnore // 避免 jackson 序列化
|
||||
public T getCheckedData() {
|
||||
checkError();
|
||||
return data;
|
||||
}
|
||||
|
||||
public static <T> CommonResult<T> error(BusinessException serviceException) {
|
||||
return error( serviceException.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.njcn.bpm.pojo.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "分页结果")
|
||||
@Data
|
||||
public final class PageResult<T> implements Serializable {
|
||||
|
||||
private List<T> list;
|
||||
|
||||
private Long total;
|
||||
|
||||
public PageResult() {
|
||||
}
|
||||
|
||||
public PageResult(List<T> list, Long total) {
|
||||
this.list = list;
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public PageResult(Long total) {
|
||||
this.list = new ArrayList<>();
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public static <T> PageResult<T> empty() {
|
||||
return new PageResult<>(0L);
|
||||
}
|
||||
|
||||
public static <T> PageResult<T> empty(Long total) {
|
||||
return new PageResult<>(total);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.njcn.bpm.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* BPM 流程分类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class BpmCategoryParam implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 分类名
|
||||
*/
|
||||
@ApiModelProperty("分类名")
|
||||
@NotNull(message = "分类名不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 分类标志
|
||||
*/
|
||||
@ApiModelProperty("分类标志")
|
||||
@NotNull(message = "分类标志不能为空")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 分类描述
|
||||
*/
|
||||
@ApiModelProperty("分类描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 分类状态
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("分类状态")
|
||||
private Integer status = 1;
|
||||
/**
|
||||
* 分类排序
|
||||
*/
|
||||
@ApiModelProperty("分类排序")
|
||||
private Integer sort = 100;
|
||||
|
||||
/**
|
||||
* 更新操作实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class BpmCategoryUpdateParam extends BpmCategoryParam {
|
||||
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class BpmCategoryQueryParam extends BaseParam {
|
||||
|
||||
/**
|
||||
* 表单名称
|
||||
*/
|
||||
@ApiModelProperty("分类名称")
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* 分类标志
|
||||
*/
|
||||
@ApiModelProperty("分类标志")
|
||||
private String code;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.njcn.bpm.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BpmFormParam implements Serializable {
|
||||
|
||||
/**
|
||||
* 表单名
|
||||
*/
|
||||
@ApiModelProperty("表单名称")
|
||||
@NotNull(message = "表单名称不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ApiModelProperty("表单状态")
|
||||
@NotNull(message = "表单状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 表单的配置
|
||||
*/
|
||||
@ApiModelProperty("表单的配置-JSON 字符串")
|
||||
@NotNull(message = "表单的配置不能为空")
|
||||
private String conf;
|
||||
|
||||
/**
|
||||
* 表单项的数组
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("表单项的数组-JSON 字符串的数组")
|
||||
@NotNull(message = "表单项的数组不能为空")
|
||||
private List<String> fields;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 更新操作实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class BpmFormUpdateParam extends BpmFormParam {
|
||||
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class BpmFormQueryParam extends BaseParam {
|
||||
|
||||
/**
|
||||
* 表单名称
|
||||
*/
|
||||
@ApiModelProperty("表单名称")
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.njcn.bpm.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.validator.constraints.URL;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
@Data
|
||||
public class BpmModelParam implements Serializable {
|
||||
|
||||
|
||||
@ApiModelProperty("流程标识")
|
||||
@NotNull(message = "流程标识不能为空")
|
||||
private String key;
|
||||
|
||||
@ApiModelProperty("流程名称")
|
||||
@NotNull(message = "流程名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty( "流程图标")
|
||||
private String icon;
|
||||
|
||||
@ApiModelProperty("流程分类")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty("BPMN XML")
|
||||
private String bpmnXml;
|
||||
|
||||
@ApiModelProperty("流程表单")
|
||||
private String formId;
|
||||
|
||||
@ApiModelProperty("流程描述")
|
||||
private String description;
|
||||
|
||||
private Integer formType = 10;
|
||||
|
||||
|
||||
private String formCustomCreatePath;
|
||||
|
||||
private String formCustomViewPath;
|
||||
|
||||
/**
|
||||
* 更新操作实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class BpmModelUpdateParam extends BpmModelParam {
|
||||
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
private String id;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class BpmModelQueryParam extends BaseParam {
|
||||
|
||||
@ApiModelProperty("流程标识")
|
||||
private String key;
|
||||
|
||||
@ApiModelProperty("流程名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("流程分类")
|
||||
private String category;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.njcn.bpm.pojo.param;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* BPM 流程定义的拓信息
|
||||
* 主要解决 Flowable {@link org.flowable.engine.repository.ProcessDefinition} 不支持拓展字段,所以新建该表
|
||||
*/
|
||||
@Data
|
||||
public class BpmProcessDefinitionInfoParam extends BaseEntity implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 流程定义的编号
|
||||
* <p>
|
||||
* 关联 ProcessDefinition 的 id 属性
|
||||
*/
|
||||
private String processDefinitionId;
|
||||
/**
|
||||
* 流程模型的编号
|
||||
* <p>
|
||||
* 关联 Model 的 id 属性
|
||||
*/
|
||||
private String modelId;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 表单类型
|
||||
*/
|
||||
private Integer formType;
|
||||
|
||||
/**
|
||||
* 动态表单编号
|
||||
*/
|
||||
private String formId;
|
||||
|
||||
/**
|
||||
* 表单的配置
|
||||
*/
|
||||
private String formConf;
|
||||
|
||||
/**
|
||||
* 表单项的数组
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<String> formFields;
|
||||
|
||||
|
||||
/**
|
||||
* 自定义表单的提交路径,使用 Vue 的路由地址
|
||||
*/
|
||||
private String formCustomCreatePath;
|
||||
|
||||
/**
|
||||
* 自定义表单的查看路径,使用 Vue 的路由地址
|
||||
*/
|
||||
private String formCustomViewPath;
|
||||
|
||||
/**
|
||||
* 更新操作实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class BpmProcessDefinitionInfoUpdateParam extends BpmProcessDefinitionInfoParam {
|
||||
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class BpmProcessDefinitionInfoQueryParam extends BaseParam {
|
||||
|
||||
@ApiModelProperty("标识-精准匹配")
|
||||
private String key;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.njcn.bpm.pojo.param;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Schema(description="分页参数")
|
||||
@Data
|
||||
public class PageParam implements Serializable {
|
||||
|
||||
private static final Integer PAGE_NO = 1;
|
||||
private static final Integer PAGE_SIZE = 10;
|
||||
|
||||
/**
|
||||
* 每页条数 - 不分页
|
||||
*
|
||||
* 例如说,导出接口,可以设置 {@link #pageSize} 为 -1 不分页,查询所有数据。
|
||||
*/
|
||||
public static final Integer PAGE_SIZE_NONE = -1;
|
||||
|
||||
@NotNull(message = "页码不能为空")
|
||||
@Min(value = 1, message = "页码最小值为 1")
|
||||
private Integer pageNo = PAGE_NO;
|
||||
|
||||
@NotNull(message = "每页条数不能为空")
|
||||
@Min(value = 1, message = "每页条数最小值为 1")
|
||||
@Max(value = 100, message = "每页条数最大值为 100")
|
||||
private Integer pageSize = PAGE_SIZE;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.njcn.bpm.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* BPM 流程分类 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("bpm_category")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BpmCategory extends BaseEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* 分类编号
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* 分类名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 分类标志
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 分类描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 分类状态
|
||||
*
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 分类排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.njcn.bpm.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* BPM 工作流的表单定义
|
||||
* 用于工作流的申请表单,需要动态配置的场景
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName(value = "bpm_form", autoResultMap = true)
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BpmForm extends BaseEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* 表单名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 表单的配置
|
||||
*/
|
||||
private String conf;
|
||||
/**
|
||||
* 表单项的数组
|
||||
*
|
||||
* 目前直接将 https://github.com/JakHuang/form-generator 生成的 JSON 串,直接保存
|
||||
* 定义:https://github.com/JakHuang/form-generator/issues/46
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<String> fields;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.njcn.bpm.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* BPM 流程定义的拓信息
|
||||
* 主要解决 Flowable {@link org.flowable.engine.repository.ProcessDefinition} 不支持拓展字段,所以新建该表
|
||||
*
|
||||
*/
|
||||
@TableName(value = "bpm_process_definition_info", autoResultMap = true)
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BpmProcessDefinitionInfo extends BaseEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* 流程定义的编号
|
||||
*
|
||||
* 关联 ProcessDefinition 的 id 属性
|
||||
*/
|
||||
private String processDefinitionId;
|
||||
/**
|
||||
* 流程模型的编号
|
||||
*
|
||||
* 关联 Model 的 id 属性
|
||||
*/
|
||||
private String modelId;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 表单类型
|
||||
*
|
||||
*/
|
||||
private Integer formType;
|
||||
|
||||
/**
|
||||
* 动态表单编号
|
||||
*
|
||||
*/
|
||||
private String formId;
|
||||
|
||||
/**
|
||||
* 表单的配置
|
||||
*
|
||||
*/
|
||||
private String formConf;
|
||||
|
||||
/**
|
||||
* 表单项的数组
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<String> formFields;
|
||||
|
||||
|
||||
/**
|
||||
* 自定义表单的提交路径,使用 Vue 的路由地址
|
||||
*/
|
||||
private String formCustomCreatePath;
|
||||
|
||||
/**
|
||||
* 自定义表单的查看路径,使用 Vue 的路由地址
|
||||
*/
|
||||
private String formCustomViewPath;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.njcn.bpm.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程表单
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2024-04-25
|
||||
*/
|
||||
@Data
|
||||
@TableName("wf_form")
|
||||
public class WFForm extends BaseEntity implements Serializable{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 流程表单id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 表单名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 表单内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 表单描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.njcn.bpm.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* BPM 流程分类 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class BpmCategoryVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 分类编号
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 分类名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 分类标志
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 分类描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 分类状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 分类排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.bpm.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BpmFormVO implements Serializable {
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String conf;
|
||||
|
||||
private List<String> fields;
|
||||
|
||||
private Integer status; // 参见 CommonStatusEnum 枚举
|
||||
|
||||
private String remark;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.njcn.bpm.pojo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 流程模型 Response VO")
|
||||
@Data
|
||||
public class BpmModelRespVO {
|
||||
|
||||
private String id;
|
||||
|
||||
private String key;
|
||||
|
||||
private String name;
|
||||
|
||||
@Schema(description = "流程图标", example = "https://www.iocoder.cn/yudao.jpg")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "流程描述", example = "我是描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "流程分类编码", example = "1")
|
||||
private String category;
|
||||
@Schema(description = "流程分类名字", example = "请假")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "表单类型-参见 bpm_model_form_type 数据字典", example = "1")
|
||||
private Integer formType;
|
||||
|
||||
@Schema(description = "表单编号", example = "1024")
|
||||
private String formId; // 在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空
|
||||
@Schema(description = "表单名字", example = "请假表单")
|
||||
private String formName;
|
||||
|
||||
@Schema(description = "自定义表单的提交路径", example = "/bpm/oa/leave/create")
|
||||
private String formCustomCreatePath; // 使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空
|
||||
@Schema(description = "自定义表单的查看路径", example = "/bpm/oa/leave/view")
|
||||
private String formCustomViewPath; // ,使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private String bpmnXml;
|
||||
|
||||
/**
|
||||
* 最新部署的流程定义
|
||||
*/
|
||||
private BpmProcessDefinitionInfoVO processDefinition;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package com.njcn.bpm.pojo.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* BPM 流程定义的拓信息
|
||||
* 主要解决 Flowable {@link org.flowable.engine.repository.ProcessDefinition} 不支持拓展字段,所以新建该表
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class BpmProcessDefinitionInfoVO extends BaseEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 流程定义的编号
|
||||
*
|
||||
* 关联 ProcessDefinition 的 id 属性
|
||||
*/
|
||||
private String processDefinitionId;
|
||||
/**
|
||||
* 流程模型的编号
|
||||
*
|
||||
* 关联 Model 的 id 属性
|
||||
*/
|
||||
private String modelId;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 表单类型
|
||||
*
|
||||
*/
|
||||
private Integer formType;
|
||||
|
||||
/**
|
||||
* 动态表单编号
|
||||
*
|
||||
*/
|
||||
private String formId;
|
||||
|
||||
/**
|
||||
* 表单的配置
|
||||
*
|
||||
*/
|
||||
private String formConf;
|
||||
|
||||
/**
|
||||
* 表单项的数组
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<String> formFields;
|
||||
|
||||
|
||||
/**
|
||||
* 自定义表单的提交路径,使用 Vue 的路由地址
|
||||
*/
|
||||
private String formCustomCreatePath;
|
||||
|
||||
/**
|
||||
* 自定义表单的查看路径,使用 Vue 的路由地址
|
||||
*/
|
||||
private String formCustomViewPath;
|
||||
|
||||
|
||||
private Integer version;
|
||||
|
||||
private String name;
|
||||
|
||||
private String key;
|
||||
|
||||
|
||||
@ApiModelProperty("流程分类")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty("流程分类名字")
|
||||
private String categoryName;
|
||||
|
||||
|
||||
@ApiModelProperty("表单名字")
|
||||
private String formName;
|
||||
|
||||
|
||||
private Integer suspensionState; // 参见 SuspensionState 枚举
|
||||
|
||||
@ApiModelProperty("部署时间")
|
||||
private LocalDateTime deploymentTime; // 需要从对应的 Deployment 读取,非必须返回
|
||||
|
||||
@ApiModelProperty("BPMN")
|
||||
private String bpmnXml; // 需要从对应的 BpmnModel 读取,非必须返回
|
||||
|
||||
@ApiModelProperty("发起用户需要选择审批人的任务数组")
|
||||
private List<BpmProcessDefinitionInfoVO.UserTask> startUserSelectTasks; // 需要从对应的 BpmnModel 读取,非必须返回
|
||||
|
||||
@Schema(description = "BPMN UserTask 用户任务")
|
||||
@Data
|
||||
public static class UserTask {
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user