提交代码
parent
fe56d910ae
commit
8674561038
16
pom.xml
16
pom.xml
|
@ -34,8 +34,6 @@
|
|||
<jjwt.version>0.9.1</jjwt.version>
|
||||
<minio.version>8.2.2</minio.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<flowable.version>7.0.0</flowable.version>
|
||||
<jakarta.version>2.1.2</jakarta.version>
|
||||
<transmittable-thread-local.version>2.14.2</transmittable-thread-local.version>
|
||||
</properties>
|
||||
|
||||
|
@ -145,20 +143,6 @@
|
|||
<version>${transmittable-thread-local.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- MAIL -->
|
||||
<dependency>
|
||||
<groupId>jakarta.mail</groupId>
|
||||
<artifactId>jakarta.mail-api</artifactId>
|
||||
<version>${jakarta.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- flowable -->
|
||||
<dependency>
|
||||
<groupId>org.flowable</groupId>
|
||||
<artifactId>flowable-spring-boot-starter</artifactId>
|
||||
<version>${flowable.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 核心模块 -->
|
||||
<dependency>
|
||||
<groupId>com.yanzhu</groupId>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package com.yanzhu.common.core.utils.bean;
|
||||
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
@ -107,4 +109,55 @@ public class BeanUtils extends org.springframework.beans.BeanUtils
|
|||
{
|
||||
return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX));
|
||||
}
|
||||
|
||||
/**
|
||||
* Java Bean 转换为 Map
|
||||
* @param bean
|
||||
* @return
|
||||
* @throws IllegalAccessException
|
||||
*/
|
||||
public static Map<String, Object> beanToMap(Object bean) throws IllegalAccessException {
|
||||
if (bean == null) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Class<?> beanClass = bean.getClass();
|
||||
Field[] fields = beanClass.getDeclaredFields();
|
||||
|
||||
for (Field field : fields) {
|
||||
field.setAccessible(true); // 允许访问私有字段
|
||||
String fieldName = field.getName();
|
||||
Object value = field.get(bean);
|
||||
map.put(fieldName, value);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* toUnderlineCase 是 Hutool 库中的一个方法,
|
||||
* 用于将驼峰命名法的字符串转换为下划线分隔的字符串(即蛇形命名法)。
|
||||
* 比如,将 "myVariableName" 转换成 "my_variable_name"。
|
||||
* 如下是自定义实现
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
public static String toUnderlineCase(CharSequence str) {
|
||||
if (StringUtils.isEmpty(str)) {
|
||||
return null;
|
||||
}
|
||||
StringBuilder result = new StringBuilder();
|
||||
char[] chars = str.toString().toCharArray();
|
||||
|
||||
for (char c : chars) {
|
||||
if (Character.isUpperCase(c)) {
|
||||
if (result.length() > 0) {
|
||||
result.append('_');
|
||||
}
|
||||
result.append(Character.toLowerCase(c));
|
||||
} else {
|
||||
result.append(c);
|
||||
}
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,6 +71,15 @@ public class BaseController
|
|||
return rspData;
|
||||
}
|
||||
|
||||
protected TableDataInfo getDataTable(PageInfo<?> pageInfo) {
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setRows(pageInfo.getList());
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setTotal(pageInfo.getTotal());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功
|
||||
*/
|
||||
|
|
|
@ -1,83 +0,0 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 流程分类对象 flowable_category
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-11-27
|
||||
*/
|
||||
public class FlowableCategory extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 流程分类id */
|
||||
private Long id;
|
||||
|
||||
/** 流程分类名称 */
|
||||
@Excel(name = "流程分类名称")
|
||||
private String name;
|
||||
|
||||
/** 分类编码 */
|
||||
@Excel(name = "分类编码")
|
||||
private String code;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("code", getCode())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("delFlag", getDelFlag())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 流程部署对象 flowable_deploy
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Data
|
||||
public class FlowableDeploy extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 流程定义ID */
|
||||
@Excel(name = "流程定义ID")
|
||||
private String definitionId;
|
||||
|
||||
/** 流程名称 */
|
||||
@Excel(name = "流程名称")
|
||||
private String processName;
|
||||
|
||||
/** 流程Key */
|
||||
@Excel(name = "流程Key")
|
||||
private String processKey;
|
||||
|
||||
/** 分类编码 */
|
||||
@Excel(name = "分类编码")
|
||||
private String category;
|
||||
|
||||
/** 版本 */
|
||||
@Excel(name = "版本")
|
||||
private Integer version;
|
||||
|
||||
/** 部署ID */
|
||||
@Excel(name = "部署ID")
|
||||
private String deploymentId;
|
||||
|
||||
/** 流程定义状态 */
|
||||
@Excel(name = "流程定义状态")
|
||||
private Boolean suspended;
|
||||
|
||||
/** 部署时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "部署时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date deploymentTime;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("definitionId", getDefinitionId())
|
||||
.append("processName", getProcessName())
|
||||
.append("processKey", getProcessKey())
|
||||
.append("category", getCategory())
|
||||
.append("version", getVersion())
|
||||
.append("deploymentId", getDeploymentId())
|
||||
.append("suspended", getSuspended())
|
||||
.append("deploymentTime", getDeploymentTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -1,126 +0,0 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 流程字段定义对象 flowable_field_def
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
public class FlowableFieldDef extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private String id;
|
||||
|
||||
/** 数据库字段/表单字段 */
|
||||
@Excel(name = "数据库字段/表单字段")
|
||||
private String field;
|
||||
|
||||
/** 字段名/表单字段名 */
|
||||
@Excel(name = "字段名/表单字段名")
|
||||
private String label;
|
||||
|
||||
/** 字段宽度 */
|
||||
@Excel(name = "字段宽度")
|
||||
private Long width;
|
||||
|
||||
/** 字段组件类型 */
|
||||
@Excel(name = "字段组件类型")
|
||||
private String type;
|
||||
|
||||
/** 字段定义 */
|
||||
@Excel(name = "字段定义")
|
||||
private String scheme;
|
||||
|
||||
/** 字段范围 */
|
||||
@Excel(name = "字段范围")
|
||||
private String scope;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setField(String field)
|
||||
{
|
||||
this.field = field;
|
||||
}
|
||||
|
||||
public String getField()
|
||||
{
|
||||
return field;
|
||||
}
|
||||
public void setLabel(String label)
|
||||
{
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getLabel()
|
||||
{
|
||||
return label;
|
||||
}
|
||||
public void setWidth(Long width)
|
||||
{
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public Long getWidth()
|
||||
{
|
||||
return width;
|
||||
}
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setScheme(String scheme)
|
||||
{
|
||||
this.scheme = scheme;
|
||||
}
|
||||
|
||||
public String getScheme()
|
||||
{
|
||||
return scheme;
|
||||
}
|
||||
public void setScope(String scope)
|
||||
{
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
public String getScope()
|
||||
{
|
||||
return scope;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("field", getField())
|
||||
.append("label", getLabel())
|
||||
.append("remark", getRemark())
|
||||
.append("width", getWidth())
|
||||
.append("type", getType())
|
||||
.append("scheme", getScheme())
|
||||
.append("scope", getScope())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 流程字段引用关系对象 flowable_field_ref
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
public class FlowableFieldRef extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private String id;
|
||||
|
||||
/** 模块 */
|
||||
@Excel(name = "模块")
|
||||
private String module;
|
||||
|
||||
/** 模型标识 */
|
||||
@Excel(name = "模型标识")
|
||||
private String mkey;
|
||||
|
||||
/** 字段ID */
|
||||
@Excel(name = "字段ID")
|
||||
private String fieldId;
|
||||
|
||||
/** 版本号 */
|
||||
@Excel(name = "版本号")
|
||||
private Long version;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setModule(String module)
|
||||
{
|
||||
this.module = module;
|
||||
}
|
||||
|
||||
public String getModule()
|
||||
{
|
||||
return module;
|
||||
}
|
||||
public void setMkey(String mkey)
|
||||
{
|
||||
this.mkey = mkey;
|
||||
}
|
||||
|
||||
public String getMkey()
|
||||
{
|
||||
return mkey;
|
||||
}
|
||||
public void setFieldId(String fieldId)
|
||||
{
|
||||
this.fieldId = fieldId;
|
||||
}
|
||||
|
||||
public String getFieldId()
|
||||
{
|
||||
return fieldId;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("module", getModule())
|
||||
.append("mkey", getMkey())
|
||||
.append("fieldId", getFieldId())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("version", getVersion())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 为了方便查询,提供一个组合类
|
||||
*/
|
||||
@Data
|
||||
public class FlowableFieldSearch extends FlowableFieldRef {
|
||||
|
||||
/** 字段范围 */
|
||||
private String scope;
|
||||
}
|
|
@ -1,165 +0,0 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 流程模型对象 flowable_model
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-11-28
|
||||
*/
|
||||
public class FlowableModel extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 模型ID */
|
||||
@Excel(name = "模型ID")
|
||||
private String modelId;
|
||||
|
||||
/** 模型名称 */
|
||||
@Excel(name = "模型名称")
|
||||
private String modelName;
|
||||
|
||||
/** 模型Key */
|
||||
@Excel(name = "模型Key")
|
||||
private String modelKey;
|
||||
|
||||
/** 分类编码 */
|
||||
@Excel(name = "分类编码")
|
||||
private String category;
|
||||
|
||||
/** 版本 */
|
||||
@Excel(name = "版本")
|
||||
private Integer version;
|
||||
|
||||
/** 表单类型 */
|
||||
@Excel(name = "表单类型")
|
||||
private Integer formType;
|
||||
|
||||
/** 表单ID */
|
||||
@Excel(name = "表单ID")
|
||||
private Long formId;
|
||||
|
||||
/** 模型描述 */
|
||||
@Excel(name = "模型描述")
|
||||
private String description;
|
||||
|
||||
/** 流程xm */
|
||||
@Excel(name = "流程xm")
|
||||
private String bpmnXml;
|
||||
|
||||
/** 表单内容 */
|
||||
@Excel(name = "表单内容")
|
||||
private String content;
|
||||
|
||||
public void setModelId(String modelId)
|
||||
{
|
||||
this.modelId = modelId;
|
||||
}
|
||||
|
||||
public String getModelId()
|
||||
{
|
||||
return modelId;
|
||||
}
|
||||
public void setModelName(String modelName)
|
||||
{
|
||||
this.modelName = modelName;
|
||||
}
|
||||
|
||||
public String getModelName()
|
||||
{
|
||||
return modelName;
|
||||
}
|
||||
public void setModelKey(String modelKey)
|
||||
{
|
||||
this.modelKey = modelKey;
|
||||
}
|
||||
|
||||
public String getModelKey()
|
||||
{
|
||||
return modelKey;
|
||||
}
|
||||
public void setCategory(String category)
|
||||
{
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getCategory()
|
||||
{
|
||||
return category;
|
||||
}
|
||||
public void setVersion(Integer version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Integer getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setFormType(Integer formType)
|
||||
{
|
||||
this.formType = formType;
|
||||
}
|
||||
|
||||
public Integer getFormType()
|
||||
{
|
||||
return formType;
|
||||
}
|
||||
public void setFormId(Long formId)
|
||||
{
|
||||
this.formId = formId;
|
||||
}
|
||||
|
||||
public Long getFormId()
|
||||
{
|
||||
return formId;
|
||||
}
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
public void setBpmnXml(String bpmnXml)
|
||||
{
|
||||
this.bpmnXml = bpmnXml;
|
||||
}
|
||||
|
||||
public String getBpmnXml()
|
||||
{
|
||||
return bpmnXml;
|
||||
}
|
||||
public void setContent(String content)
|
||||
{
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getContent()
|
||||
{
|
||||
return content;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("modelId", getModelId())
|
||||
.append("modelName", getModelName())
|
||||
.append("modelKey", getModelKey())
|
||||
.append("category", getCategory())
|
||||
.append("version", getVersion())
|
||||
.append("formType", getFormType())
|
||||
.append("formId", getFormId())
|
||||
.append("description", getDescription())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("bpmnXml", getBpmnXml())
|
||||
.append("content", getContent())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 建模页面绑定对象 flowable_model_page
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
public class FlowableModelPage extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private String id;
|
||||
|
||||
/** 模块 */
|
||||
@Excel(name = "模块")
|
||||
private String module;
|
||||
|
||||
/** 模型标识 */
|
||||
@Excel(name = "模型标识")
|
||||
private String mkey;
|
||||
|
||||
/** 页面名称 */
|
||||
@Excel(name = "页面名称")
|
||||
private String name;
|
||||
|
||||
/** 页面定义 */
|
||||
@Excel(name = "页面定义")
|
||||
private String pageScheme;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setModule(String module)
|
||||
{
|
||||
this.module = module;
|
||||
}
|
||||
|
||||
public String getModule()
|
||||
{
|
||||
return module;
|
||||
}
|
||||
public void setMkey(String mkey)
|
||||
{
|
||||
this.mkey = mkey;
|
||||
}
|
||||
|
||||
public String getMkey()
|
||||
{
|
||||
return mkey;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setPageScheme(String pageScheme)
|
||||
{
|
||||
this.pageScheme = pageScheme;
|
||||
}
|
||||
|
||||
public String getPageScheme()
|
||||
{
|
||||
return pageScheme;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("module", getModule())
|
||||
.append("mkey", getMkey())
|
||||
.append("name", getName())
|
||||
.append("pageScheme", getPageScheme())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 流程实例关联表单对象 sys_instance_form
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-03-30
|
||||
*/
|
||||
public class SysDeployForm extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 表单主键 */
|
||||
@Excel(name = "表单主键")
|
||||
private Long formId;
|
||||
|
||||
/** 流程定义主键 */
|
||||
@Excel(name = "流程定义主键")
|
||||
private String deployId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setFormId(Long formId)
|
||||
{
|
||||
this.formId = formId;
|
||||
}
|
||||
|
||||
public Long getFormId()
|
||||
{
|
||||
return formId;
|
||||
}
|
||||
|
||||
public String getDeployId() {
|
||||
return deployId;
|
||||
}
|
||||
|
||||
public void setDeployId(String deployId) {
|
||||
this.deployId = deployId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("formId", getFormId())
|
||||
.append("deployId", getDeployId())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 流程达式对象 sys_expression
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-12-12
|
||||
*/
|
||||
public class SysExpression extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 表单主键 */
|
||||
private Long id;
|
||||
|
||||
/** 表达式名称 */
|
||||
@Excel(name = "表达式名称")
|
||||
private String name;
|
||||
|
||||
/** 表达式内容 */
|
||||
@Excel(name = "表达式内容")
|
||||
private String expression;
|
||||
/**
|
||||
* 表达式类型 exp_data_type
|
||||
* fixed: 系统指定
|
||||
* dynamic: 动态选择
|
||||
*
|
||||
* */
|
||||
private String dataType;
|
||||
|
||||
/** 状态 */
|
||||
private Integer status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setExpression(String expression)
|
||||
{
|
||||
this.expression = expression;
|
||||
}
|
||||
|
||||
public String getExpression()
|
||||
{
|
||||
return expression;
|
||||
}
|
||||
|
||||
public String getDataType() {
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public void setDataType(String dataType) {
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("expression", getExpression())
|
||||
.append("dataType", getDataType())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("status", getStatus())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 流程表单对象 sys_task_form
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-03-30
|
||||
*/
|
||||
public class SysForm extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 表单主键 */
|
||||
private Long formId;
|
||||
|
||||
/** 表单名称 */
|
||||
@Excel(name = "表单名称")
|
||||
private String formName;
|
||||
|
||||
/** 表单内容 */
|
||||
@Excel(name = "表单内容")
|
||||
private String formContent;
|
||||
|
||||
public void setFormId(Long formId)
|
||||
{
|
||||
this.formId = formId;
|
||||
}
|
||||
|
||||
public Long getFormId()
|
||||
{
|
||||
return formId;
|
||||
}
|
||||
public void setFormName(String formName)
|
||||
{
|
||||
this.formName = formName;
|
||||
}
|
||||
|
||||
public String getFormName()
|
||||
{
|
||||
return formName;
|
||||
}
|
||||
public void setFormContent(String formContent)
|
||||
{
|
||||
this.formContent = formContent;
|
||||
}
|
||||
|
||||
public String getFormContent()
|
||||
{
|
||||
return formContent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("formId", getFormId())
|
||||
.append("formName", getFormName())
|
||||
.append("formContent", getFormContent())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 流程监听对象 sys_listener
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2022-12-25
|
||||
*/
|
||||
public class SysListener extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 表单主键 */
|
||||
private Long id;
|
||||
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
|
||||
/** 监听类型 */
|
||||
@Excel(name = "监听类型")
|
||||
private String type;
|
||||
|
||||
/** 事件类型 */
|
||||
@Excel(name = "事件类型")
|
||||
private String eventType;
|
||||
|
||||
/** 值类型 */
|
||||
@Excel(name = "值类型")
|
||||
private String valueType;
|
||||
|
||||
/** 执行内容 */
|
||||
@Excel(name = "执行内容")
|
||||
private String value;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private Integer status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setEventType(String eventType)
|
||||
{
|
||||
this.eventType = eventType;
|
||||
}
|
||||
|
||||
public String getEventType()
|
||||
{
|
||||
return eventType;
|
||||
}
|
||||
public void setValueType(String valueType)
|
||||
{
|
||||
this.valueType = valueType;
|
||||
}
|
||||
|
||||
public String getValueType()
|
||||
{
|
||||
return valueType;
|
||||
}
|
||||
public void setValue(String value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
public void setStatus(Integer status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("type", getType())
|
||||
.append("eventType", getEventType())
|
||||
.append("valueType", getValueType())
|
||||
.append("value", getValue())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("status", getStatus())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 流程任务关联单对象 sys_task_form
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
public class SysTaskForm extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 表单主键 */
|
||||
@Excel(name = "表单主键")
|
||||
private Long formId;
|
||||
|
||||
/** 所属任务 */
|
||||
@Excel(name = "所属任务")
|
||||
private String taskId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setFormId(Long formId)
|
||||
{
|
||||
this.formId = formId;
|
||||
}
|
||||
|
||||
public Long getFormId()
|
||||
{
|
||||
return formId;
|
||||
}
|
||||
public void setTaskId(String taskId)
|
||||
{
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public String getTaskId()
|
||||
{
|
||||
return taskId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("formId", getFormId())
|
||||
.append("taskId", getTaskId())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
package com.yanzhu.flowable.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author ruoyi
|
||||
* @createTime 2023/11/28
|
||||
*/
|
||||
@Data
|
||||
public class FlowableMetaInfoBo {
|
||||
|
||||
/**
|
||||
* 创建者(username)
|
||||
*/
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 流程描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 表单类型
|
||||
*/
|
||||
private Integer formType;
|
||||
/**
|
||||
* 表单编号
|
||||
*/
|
||||
private Long formId;
|
||||
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
package com.yanzhu.flowable.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* flowable 流程模型对象
|
||||
*
|
||||
* @author ruoyi
|
||||
* @createtime 2023/11/28
|
||||
*/
|
||||
@Data
|
||||
public class FlowableModelBo {
|
||||
/**
|
||||
* 模型主键
|
||||
*/
|
||||
private String modelId;
|
||||
/**
|
||||
* 模型名称
|
||||
*/
|
||||
private String modelName;
|
||||
/**
|
||||
* 模型Key
|
||||
*/
|
||||
private String modelKey;
|
||||
/**
|
||||
* 流程分类
|
||||
*/
|
||||
private String category;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 表单类型
|
||||
*/
|
||||
private Integer formType;
|
||||
/**
|
||||
* 表单主键
|
||||
*/
|
||||
private Long formId;
|
||||
/**
|
||||
* 流程xml
|
||||
*/
|
||||
private String bpmnXml;
|
||||
/**
|
||||
* 是否保存为新版本
|
||||
*/
|
||||
private Boolean newVersion;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.yanzhu.flowable.domain.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Tony
|
||||
* @date 2021/3/28 15:50
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class FlowCommentDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 意见类别 0 正常意见 1 退回意见 2 驳回意见
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 意见内容
|
||||
*/
|
||||
private String comment;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.yanzhu.flowable.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Tony
|
||||
* @date 2021/3/31 23:20
|
||||
*/
|
||||
@Data
|
||||
public class FlowFromFieldDTO implements Serializable {
|
||||
|
||||
private Object fields;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.yanzhu.flowable.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 动态人员、组
|
||||
* @author Tony
|
||||
* @date 2021/4/17 22:59
|
||||
*/
|
||||
@Data
|
||||
public class FlowNextDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 审批人类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 是否需要动态指定任务审批人
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 流程变量
|
||||
*/
|
||||
private String vars;
|
||||
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
package com.yanzhu.flowable.domain.my;
|
||||
|
||||
package com.yanzhu.flowable.domain.dto;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
@ -34,9 +33,6 @@ public class FlowProcDefDto implements Serializable {
|
|||
@ApiModelProperty("流程分类")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty("流程分类名称")
|
||||
private String categoryName;
|
||||
|
||||
@ApiModelProperty("配置表单名称")
|
||||
private String formName;
|
||||
|
||||
|
@ -67,5 +63,4 @@ public class FlowProcDefDto implements Serializable {
|
|||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.yanzhu.flowable.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Tony
|
||||
* @date 2021/3/28 19:48
|
||||
*/
|
||||
@Data
|
||||
public class FlowSaveXmlVo implements Serializable {
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 流程分类
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* xml 文件
|
||||
*/
|
||||
private String xml;
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
package com.yanzhu.flowable.domain.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>工作流任务<p>
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModel("工作流任务相关-返回参数")
|
||||
public class FlowTaskDto implements Serializable {
|
||||
|
||||
@ApiModelProperty("任务编号")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty("任务执行编号")
|
||||
private String executionId;
|
||||
|
||||
@ApiModelProperty("任务名称")
|
||||
private String taskName;
|
||||
|
||||
@ApiModelProperty("任务Key")
|
||||
private String taskDefKey;
|
||||
|
||||
@ApiModelProperty("任务执行人Id")
|
||||
private Long assigneeId;
|
||||
|
||||
@ApiModelProperty("部门名称")
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty("流程发起人部门名称")
|
||||
private String startDeptName;
|
||||
|
||||
@ApiModelProperty("任务执行人名称")
|
||||
private String assigneeName;
|
||||
@ApiModelProperty("任务执行人部门")
|
||||
private String assigneeDeptName;;
|
||||
|
||||
@ApiModelProperty("流程发起人Id")
|
||||
private String startUserId;
|
||||
|
||||
@ApiModelProperty("流程发起人名称")
|
||||
private String startUserName;
|
||||
|
||||
@ApiModelProperty("流程类型")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty("流程变量信息")
|
||||
private Object variables;
|
||||
|
||||
@ApiModelProperty("局部变量信息")
|
||||
private Object taskLocalVars;
|
||||
|
||||
@ApiModelProperty("流程部署编号")
|
||||
private String deployId;
|
||||
|
||||
@ApiModelProperty("流程ID")
|
||||
private String procDefId;
|
||||
|
||||
@ApiModelProperty("流程key")
|
||||
private String procDefKey;
|
||||
|
||||
@ApiModelProperty("流程定义名称")
|
||||
private String procDefName;
|
||||
|
||||
@ApiModelProperty("流程定义内置使用版本")
|
||||
private int procDefVersion;
|
||||
|
||||
@ApiModelProperty("流程实例ID")
|
||||
private String procInsId;
|
||||
|
||||
@ApiModelProperty("历史流程实例ID")
|
||||
private String hisProcInsId;
|
||||
|
||||
@ApiModelProperty("任务耗时")
|
||||
private String duration;
|
||||
|
||||
@ApiModelProperty("任务意见")
|
||||
private FlowCommentDto comment;
|
||||
|
||||
@ApiModelProperty("候选执行人")
|
||||
private String candidate;
|
||||
|
||||
@ApiModelProperty("任务创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("任务完成时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date finishTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.yanzhu.flowable.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Tony
|
||||
* @date 2021/4/21 20:55
|
||||
*/
|
||||
@Data
|
||||
public class FlowViewerDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 流程key
|
||||
*/
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* 是否完成(已经审批)
|
||||
*/
|
||||
private boolean completed;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.yanzhu.flowable.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>流程任务<p>
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("工作流任务相关--请求参数")
|
||||
public class FlowQueryVo {
|
||||
|
||||
@ApiModelProperty("流程名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty("结束时间")
|
||||
private String endTime;
|
||||
|
||||
@ApiModelProperty("当前页码")
|
||||
private Integer pageNum;
|
||||
|
||||
@ApiModelProperty("每页条数")
|
||||
private Integer pageSize;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package com.yanzhu.flowable.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>流程任务<p>
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("工作流任务相关--请求参数")
|
||||
public class FlowTaskVo {
|
||||
|
||||
@ApiModelProperty("任务Id")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty("用户Id")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("任务意见")
|
||||
private String comment;
|
||||
|
||||
@ApiModelProperty("流程实例Id")
|
||||
private String instanceId;
|
||||
|
||||
@ApiModelProperty("节点")
|
||||
private String targetKey;
|
||||
|
||||
private String deploymentId;
|
||||
@ApiModelProperty("流程环节定义ID")
|
||||
private String defId;
|
||||
|
||||
@ApiModelProperty("子执行流ID")
|
||||
private String currentChildExecutionId;
|
||||
|
||||
@ApiModelProperty("子执行流是否已执行")
|
||||
private Boolean flag;
|
||||
|
||||
@ApiModelProperty("流程变量信息")
|
||||
private Map<String, Object> variables;
|
||||
|
||||
@ApiModelProperty("审批人")
|
||||
private String assignee;
|
||||
|
||||
@ApiModelProperty("候选人")
|
||||
private List<String> candidateUsers;
|
||||
|
||||
@ApiModelProperty("审批组")
|
||||
private List<String> candidateGroups;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.yanzhu.flowable.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>可退回节点<p>
|
||||
*
|
||||
* @author tony
|
||||
* @date 2022-04-23 11:01:52
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("可退回节点")
|
||||
public class ReturnTaskNodeVo {
|
||||
|
||||
@ApiModelProperty("任务Id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("用户Id")
|
||||
private String name;
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.yanzhu.flowable.mapper;
|
||||
|
||||
import com.yanzhu.flowable.domain.dto.FlowProcDefDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程定义查询
|
||||
*
|
||||
* @author Tony
|
||||
* @email
|
||||
* @date 2022/1/29 5:44 下午
|
||||
**/
|
||||
public interface FlowDeployMapper {
|
||||
|
||||
/**
|
||||
* 流程定义列表
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
List<FlowProcDefDto> selectDeployList(String name);
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
package com.yanzhu.flowable.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.yanzhu.flowable.domain.FlowableCategory;
|
||||
|
||||
/**
|
||||
* 流程分类Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-11-27
|
||||
*/
|
||||
public interface FlowableCategoryMapper
|
||||
{
|
||||
/**
|
||||
* 查询流程分类
|
||||
*
|
||||
* @param id 流程分类主键
|
||||
* @return 流程分类
|
||||
*/
|
||||
public FlowableCategory selectFlowableCategoryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询流程分类列表
|
||||
*
|
||||
* @param flowableCategory 流程分类
|
||||
* @return 流程分类集合
|
||||
*/
|
||||
public List<FlowableCategory> selectFlowableCategoryList(FlowableCategory flowableCategory);
|
||||
|
||||
/**
|
||||
* 新增流程分类
|
||||
*
|
||||
* @param flowableCategory 流程分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFlowableCategory(FlowableCategory flowableCategory);
|
||||
|
||||
/**
|
||||
* 修改流程分类
|
||||
*
|
||||
* @param flowableCategory 流程分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFlowableCategory(FlowableCategory flowableCategory);
|
||||
|
||||
/**
|
||||
* 删除流程分类
|
||||
*
|
||||
* @param id 流程分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableCategoryById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除流程分类
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableCategoryByIds(Long[] ids);
|
||||
}
|
|
@ -1,69 +0,0 @@
|
|||
package com.yanzhu.flowable.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.yanzhu.flowable.domain.FlowableFieldDef;
|
||||
import com.yanzhu.flowable.domain.FlowableFieldSearch;
|
||||
|
||||
/**
|
||||
* 流程字段定义Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
public interface FlowableFieldDefMapper
|
||||
{
|
||||
/**
|
||||
* 查询流程字段定义
|
||||
*
|
||||
* @param id 流程字段定义主键
|
||||
* @return 流程字段定义
|
||||
*/
|
||||
public FlowableFieldDef selectFlowableFieldDefById(String id);
|
||||
|
||||
/**
|
||||
* 查询流程字段定义列表
|
||||
*
|
||||
* @param flowableFieldDef 流程字段定义
|
||||
* @return 流程字段定义集合
|
||||
*/
|
||||
public List<FlowableFieldDef> selectFlowableFieldDefList(FlowableFieldDef flowableFieldDef);
|
||||
|
||||
/**
|
||||
* 新增流程字段定义
|
||||
*
|
||||
* @param flowableFieldDef 流程字段定义
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFlowableFieldDef(FlowableFieldDef flowableFieldDef);
|
||||
|
||||
/**
|
||||
* 修改流程字段定义
|
||||
*
|
||||
* @param flowableFieldDef 流程字段定义
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFlowableFieldDef(FlowableFieldDef flowableFieldDef);
|
||||
|
||||
/**
|
||||
* 删除流程字段定义
|
||||
*
|
||||
* @param id 流程字段定义主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableFieldDefById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除流程字段定义
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableFieldDefByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 查询流程字段引用关系列表(不翻页,关联字段定义表查询)
|
||||
* @param flowableFieldSearch
|
||||
* @return
|
||||
*/
|
||||
public List<FlowableFieldDef> listCombination(FlowableFieldSearch flowableFieldSearch);
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
package com.yanzhu.flowable.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.yanzhu.flowable.domain.FlowableFieldRef;
|
||||
|
||||
/**
|
||||
* 流程字段引用关系Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
public interface FlowableFieldRefMapper
|
||||
{
|
||||
/**
|
||||
* 查询流程字段引用关系
|
||||
*
|
||||
* @param id 流程字段引用关系主键
|
||||
* @return 流程字段引用关系
|
||||
*/
|
||||
public FlowableFieldRef selectFlowableFieldRefById(String id);
|
||||
|
||||
/**
|
||||
* 查询流程字段引用关系列表
|
||||
*
|
||||
* @param flowableFieldRef 流程字段引用关系
|
||||
* @return 流程字段引用关系集合
|
||||
*/
|
||||
public List<FlowableFieldRef> selectFlowableFieldRefList(FlowableFieldRef flowableFieldRef);
|
||||
|
||||
/**
|
||||
* 新增流程字段引用关系
|
||||
*
|
||||
* @param flowableFieldRef 流程字段引用关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFlowableFieldRef(FlowableFieldRef flowableFieldRef);
|
||||
|
||||
/**
|
||||
* 修改流程字段引用关系
|
||||
*
|
||||
* @param flowableFieldRef 流程字段引用关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFlowableFieldRef(FlowableFieldRef flowableFieldRef);
|
||||
|
||||
/**
|
||||
* 删除流程字段引用关系
|
||||
*
|
||||
* @param id 流程字段引用关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableFieldRefById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除流程字段引用关系
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableFieldRefByIds(String[] ids);
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
package com.yanzhu.flowable.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.yanzhu.flowable.domain.FlowableModelPage;
|
||||
|
||||
/**
|
||||
* 建模页面绑定Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-25
|
||||
*/
|
||||
public interface FlowableModelPageMapper
|
||||
{
|
||||
/**
|
||||
* 查询建模页面绑定
|
||||
*
|
||||
* @param id 建模页面绑定主键
|
||||
* @return 建模页面绑定
|
||||
*/
|
||||
public FlowableModelPage selectFlowableModelPageById(String id);
|
||||
|
||||
/**
|
||||
* 查询建模页面绑定列表
|
||||
*
|
||||
* @param flowableModelPage 建模页面绑定
|
||||
* @return 建模页面绑定集合
|
||||
*/
|
||||
public List<FlowableModelPage> selectFlowableModelPageList(FlowableModelPage flowableModelPage);
|
||||
|
||||
/**
|
||||
* 新增建模页面绑定
|
||||
*
|
||||
* @param flowableModelPage 建模页面绑定
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFlowableModelPage(FlowableModelPage flowableModelPage);
|
||||
|
||||
/**
|
||||
* 修改建模页面绑定
|
||||
*
|
||||
* @param flowableModelPage 建模页面绑定
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFlowableModelPage(FlowableModelPage flowableModelPage);
|
||||
|
||||
/**
|
||||
* 删除建模页面绑定
|
||||
*
|
||||
* @param id 建模页面绑定主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableModelPageById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除建模页面绑定
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableModelPageByIds(String[] ids);
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package com.yanzhu.flowable.mapper;
|
||||
|
||||
import com.yanzhu.flowable.domain.SysDeployForm;
|
||||
import com.yanzhu.flowable.domain.SysForm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程实例关联表单Mapper接口
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-03-30
|
||||
*/
|
||||
public interface SysDeployFormMapper
|
||||
{
|
||||
/**
|
||||
* 查询流程实例关联表单
|
||||
*
|
||||
* @param id 流程实例关联表单ID
|
||||
* @return 流程实例关联表单
|
||||
*/
|
||||
public SysDeployForm selectSysDeployFormById(Long id);
|
||||
|
||||
/**
|
||||
* 查询流程实例关联表单列表
|
||||
*
|
||||
* @param SysDeployForm 流程实例关联表单
|
||||
* @return 流程实例关联表单集合
|
||||
*/
|
||||
public List<SysDeployForm> selectSysDeployFormList(SysDeployForm SysDeployForm);
|
||||
|
||||
/**
|
||||
* 新增流程实例关联表单
|
||||
*
|
||||
* @param SysDeployForm 流程实例关联表单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysDeployForm(SysDeployForm SysDeployForm);
|
||||
|
||||
/**
|
||||
* 修改流程实例关联表单
|
||||
*
|
||||
* @param SysDeployForm 流程实例关联表单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysDeployForm(SysDeployForm SysDeployForm);
|
||||
|
||||
/**
|
||||
* 删除流程实例关联表单
|
||||
*
|
||||
* @param id 流程实例关联表单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDeployFormById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除流程实例关联表单
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDeployFormByIds(Long[] ids);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询流程挂着的表单
|
||||
* @param deployId
|
||||
* @return
|
||||
*/
|
||||
SysForm selectSysDeployFormByDeployId(String deployId);
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.yanzhu.flowable.mapper;
|
||||
|
||||
import com.yanzhu.flowable.domain.SysExpression;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程达式Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-12-12
|
||||
*/
|
||||
public interface SysExpressionMapper
|
||||
{
|
||||
/**
|
||||
* 查询流程达式
|
||||
*
|
||||
* @param id 流程达式主键
|
||||
* @return 流程达式
|
||||
*/
|
||||
public SysExpression selectSysExpressionById(Long id);
|
||||
|
||||
/**
|
||||
* 查询流程达式列表
|
||||
*
|
||||
* @param sysExpression 流程达式
|
||||
* @return 流程达式集合
|
||||
*/
|
||||
public List<SysExpression> selectSysExpressionList(SysExpression sysExpression);
|
||||
|
||||
/**
|
||||
* 新增流程达式
|
||||
*
|
||||
* @param sysExpression 流程达式
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysExpression(SysExpression sysExpression);
|
||||
|
||||
/**
|
||||
* 修改流程达式
|
||||
*
|
||||
* @param sysExpression 流程达式
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysExpression(SysExpression sysExpression);
|
||||
|
||||
/**
|
||||
* 删除流程达式
|
||||
*
|
||||
* @param id 流程达式主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysExpressionById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除流程达式
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysExpressionByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.yanzhu.flowable.mapper;
|
||||
|
||||
import com.yanzhu.flowable.domain.SysForm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程表单Mapper接口
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-03-30
|
||||
*/
|
||||
public interface SysFormMapper
|
||||
{
|
||||
/**
|
||||
* 查询流程表单
|
||||
*
|
||||
* @param formId 流程表单ID
|
||||
* @return 流程表单
|
||||
*/
|
||||
public SysForm selectSysFormById(Long formId);
|
||||
|
||||
/**
|
||||
* 查询流程表单列表
|
||||
*
|
||||
* @param sysForm 流程表单
|
||||
* @return 流程表单集合
|
||||
*/
|
||||
public List<SysForm> selectSysFormList(SysForm sysForm);
|
||||
|
||||
/**
|
||||
* 新增流程表单
|
||||
*
|
||||
* @param sysForm 流程表单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysForm(SysForm sysForm);
|
||||
|
||||
/**
|
||||
* 修改流程表单
|
||||
*
|
||||
* @param sysForm 流程表单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysForm(SysForm sysForm);
|
||||
|
||||
/**
|
||||
* 删除流程表单
|
||||
*
|
||||
* @param formId 流程表单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysFormById(Long formId);
|
||||
|
||||
/**
|
||||
* 批量删除流程表单
|
||||
*
|
||||
* @param formIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysFormByIds(Long[] formIds);
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.yanzhu.flowable.mapper;
|
||||
|
||||
import com.yanzhu.flowable.domain.SysListener;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程监听Mapper接口
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2022-12-25
|
||||
*/
|
||||
public interface SysListenerMapper
|
||||
{
|
||||
/**
|
||||
* 查询流程监听
|
||||
*
|
||||
* @param id 流程监听主键
|
||||
* @return 流程监听
|
||||
*/
|
||||
public SysListener selectSysListenerById(Long id);
|
||||
|
||||
/**
|
||||
* 查询流程监听列表
|
||||
*
|
||||
* @param sysListener 流程监听
|
||||
* @return 流程监听集合
|
||||
*/
|
||||
public List<SysListener> selectSysListenerList(SysListener sysListener);
|
||||
|
||||
/**
|
||||
* 新增流程监听
|
||||
*
|
||||
* @param sysListener 流程监听
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysListener(SysListener sysListener);
|
||||
|
||||
/**
|
||||
* 修改流程监听
|
||||
*
|
||||
* @param sysListener 流程监听
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysListener(SysListener sysListener);
|
||||
|
||||
/**
|
||||
* 删除流程监听
|
||||
*
|
||||
* @param id 流程监听主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysListenerById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除流程监听
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysListenerByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.yanzhu.flowable.mapper;
|
||||
|
||||
import com.yanzhu.flowable.domain.SysTaskForm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程任务关联单Mapper接口
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
public interface SysTaskFormMapper
|
||||
{
|
||||
/**
|
||||
* 查询流程任务关联单
|
||||
*
|
||||
* @param id 流程任务关联单ID
|
||||
* @return 流程任务关联单
|
||||
*/
|
||||
public SysTaskForm selectSysTaskFormById(Long id);
|
||||
|
||||
/**
|
||||
* 查询流程任务关联单列表
|
||||
*
|
||||
* @param sysTaskForm 流程任务关联单
|
||||
* @return 流程任务关联单集合
|
||||
*/
|
||||
public List<SysTaskForm> selectSysTaskFormList(SysTaskForm sysTaskForm);
|
||||
|
||||
/**
|
||||
* 新增流程任务关联单
|
||||
*
|
||||
* @param sysTaskForm 流程任务关联单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysTaskForm(SysTaskForm sysTaskForm);
|
||||
|
||||
/**
|
||||
* 修改流程任务关联单
|
||||
*
|
||||
* @param sysTaskForm 流程任务关联单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysTaskForm(SysTaskForm sysTaskForm);
|
||||
|
||||
/**
|
||||
* 删除流程任务关联单
|
||||
*
|
||||
* @param id 流程任务关联单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysTaskFormById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除流程任务关联单
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysTaskFormByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.flowable.mapper.FlowDeployMapper">
|
||||
|
||||
|
||||
<select id="selectDeployList" resultType="FlowProcDefDto">
|
||||
|
||||
SELECT
|
||||
rp.id_ as id,
|
||||
rp.deployment_id_ as deploymentId,
|
||||
rd.name_ as name,
|
||||
rd.category_ as category,
|
||||
rp.key_ as flowKey,
|
||||
rp.version_ as version,
|
||||
rp.suspension_state_ as suspensionState,
|
||||
rd.deploy_time_ as deploymentTime
|
||||
FROM
|
||||
act_re_procdef rp
|
||||
LEFT JOIN act_re_deployment rd ON rp.deployment_id_ = rd.id_
|
||||
<where>
|
||||
<if test="name != null and name != ''">
|
||||
and rd.name_ like concat('%', #{name}, '%')
|
||||
</if>
|
||||
</where>
|
||||
order by rd.deploy_time_ desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
|
@ -1,113 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.flowable.mapper.FlowableFieldDefMapper">
|
||||
|
||||
<resultMap type="FlowableFieldDef" id="FlowableFieldDefResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="field" column="field" />
|
||||
<result property="label" column="label" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="width" column="width" />
|
||||
<result property="type" column="type" />
|
||||
<result property="scheme" column="scheme" />
|
||||
<result property="scope" column="scope" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFlowableFieldDefVo">
|
||||
select id, field, label, remark, width, type, scheme, scope, update_by, update_time, create_by, create_time from flowable_field_def
|
||||
</sql>
|
||||
|
||||
<select id="selectFlowableFieldDefList" parameterType="FlowableFieldDef" resultMap="FlowableFieldDefResult">
|
||||
<include refid="selectFlowableFieldDefVo"/>
|
||||
<where>
|
||||
<if test="field != null and field != ''"> and field = #{field}</if>
|
||||
<if test="label != null and label != ''"> and label = #{label}</if>
|
||||
<if test="width != null "> and width = #{width}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="scheme != null and scheme != ''"> and scheme = #{scheme}</if>
|
||||
<if test="scope != null and scope != ''"> and scope = #{scope}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectFlowableFieldDefById" parameterType="String" resultMap="FlowableFieldDefResult">
|
||||
<include refid="selectFlowableFieldDefVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<!--字段定义表和字段引用表关联查询 -->
|
||||
<select id="listCombination" parameterType="FlowableFieldSearch" resultMap="FlowableFieldDefResult">
|
||||
select def.* from flowable_field_def def,flowable_field_ref ref
|
||||
<where>
|
||||
<if test="scope != null and scope != ''"> and def.scope = #{scope}</if>
|
||||
<if test="module != null and module != ''"> and ref.module = #{module}</if>
|
||||
<if test="mkey != null and mkey != ''"> and ref.mkey = #{mkey}</if>
|
||||
<if test="version != null and version != ''"> and ref.version = #{version}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertFlowableFieldDef" parameterType="FlowableFieldDef">
|
||||
insert into flowable_field_def
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="field != null and field != ''">field,</if>
|
||||
<if test="label != null and label != ''">label,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="width != null">width,</if>
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
<if test="scheme != null and scheme != ''">scheme,</if>
|
||||
<if test="scope != null">scope,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="field != null and field != ''">#{field},</if>
|
||||
<if test="label != null and label != ''">#{label},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="width != null">#{width},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="scheme != null and scheme != ''">#{scheme},</if>
|
||||
<if test="scope != null">#{scope},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateFlowableFieldDef" parameterType="FlowableFieldDef">
|
||||
update flowable_field_def
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="field != null and field != ''">field = #{field},</if>
|
||||
<if test="label != null and label != ''">label = #{label},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="width != null">width = #{width},</if>
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
<if test="scheme != null and scheme != ''">scheme = #{scheme},</if>
|
||||
<if test="scope != null">scope = #{scope},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteFlowableFieldDefById" parameterType="String">
|
||||
delete from flowable_field_def where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFlowableFieldDefByIds" parameterType="String">
|
||||
delete from flowable_field_def where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -1,89 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.flowable.mapper.FlowableFieldRefMapper">
|
||||
|
||||
<resultMap type="FlowableFieldRef" id="FlowableFieldRefResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="module" column="module" />
|
||||
<result property="mkey" column="mkey" />
|
||||
<result property="fieldId" column="field_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="version" column="version" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFlowableFieldRefVo">
|
||||
select id, module, mkey, field_id, create_by, create_time, update_by, update_time, version from flowable_field_ref
|
||||
</sql>
|
||||
|
||||
<select id="selectFlowableFieldRefList" parameterType="FlowableFieldRef" resultMap="FlowableFieldRefResult">
|
||||
<include refid="selectFlowableFieldRefVo"/>
|
||||
<where>
|
||||
<if test="module != null and module != ''"> and module = #{module}</if>
|
||||
<if test="mkey != null and mkey != ''"> and mkey = #{mkey}</if>
|
||||
<if test="fieldId != null and fieldId != ''"> and field_id = #{fieldId}</if>
|
||||
<if test="version != null "> and version = #{version}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectFlowableFieldRefById" parameterType="String" resultMap="FlowableFieldRefResult">
|
||||
<include refid="selectFlowableFieldRefVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertFlowableFieldRef" parameterType="FlowableFieldRef">
|
||||
insert into flowable_field_ref
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="module != null and module != ''">module,</if>
|
||||
<if test="mkey != null and mkey != ''">mkey,</if>
|
||||
<if test="fieldId != null and fieldId != ''">field_id,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="version != null">version,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="module != null and module != ''">#{module},</if>
|
||||
<if test="mkey != null and mkey != ''">#{mkey},</if>
|
||||
<if test="fieldId != null and fieldId != ''">#{fieldId},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="version != null">#{version},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateFlowableFieldRef" parameterType="FlowableFieldRef">
|
||||
update flowable_field_ref
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="module != null and module != ''">module = #{module},</if>
|
||||
<if test="mkey != null and mkey != ''">mkey = #{mkey},</if>
|
||||
<if test="fieldId != null and fieldId != ''">field_id = #{fieldId},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="version != null">version = #{version},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteFlowableFieldRefById" parameterType="String">
|
||||
delete from flowable_field_ref where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFlowableFieldRefByIds" parameterType="String">
|
||||
delete from flowable_field_ref where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -1,87 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.flowable.mapper.FlowableModelPageMapper">
|
||||
|
||||
<resultMap type="FlowableModelPage" id="FlowableModelPageResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="module" column="module" />
|
||||
<result property="mkey" column="mkey" />
|
||||
<result property="name" column="name" />
|
||||
<result property="pageScheme" column="page_scheme" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFlowableModelPageVo">
|
||||
select id, module, mkey, name, page_scheme, update_by, update_time, create_by, create_time from flowable_model_page
|
||||
</sql>
|
||||
|
||||
<select id="selectFlowableModelPageList" parameterType="FlowableModelPage" resultMap="FlowableModelPageResult">
|
||||
<include refid="selectFlowableModelPageVo"/>
|
||||
<where>
|
||||
<if test="module != null and module != ''"> and module = #{module}</if>
|
||||
<if test="mkey != null and mkey != ''"> and mkey = #{mkey}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="pageScheme != null and pageScheme != ''"> and page_scheme = #{pageScheme}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectFlowableModelPageById" parameterType="String" resultMap="FlowableModelPageResult">
|
||||
<include refid="selectFlowableModelPageVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertFlowableModelPage" parameterType="FlowableModelPage" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into flowable_model_page
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="module != null and module != ''">module,</if>
|
||||
<if test="mkey != null and mkey != ''">mkey,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="pageScheme != null and pageScheme != ''">page_scheme,</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="module != null and module != ''">#{module},</if>
|
||||
<if test="mkey != null and mkey != ''">#{mkey},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="pageScheme != null and pageScheme != ''">#{pageScheme},</if>
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateFlowableModelPage" parameterType="FlowableModelPage">
|
||||
update flowable_model_page
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="module != null and module != ''">module = #{module},</if>
|
||||
<if test="mkey != null and mkey != ''">mkey = #{mkey},</if>
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="pageScheme != null and pageScheme != ''">page_scheme = #{pageScheme},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteFlowableModelPageById" parameterType="String">
|
||||
delete from flowable_model_page where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFlowableModelPageByIds" parameterType="String">
|
||||
delete from flowable_model_page where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.flowable.mapper.SysDeployFormMapper">
|
||||
|
||||
<resultMap type="SysDeployForm" id="SysDeployFormResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="formId" column="form_id" />
|
||||
<result property="deployId" column="deploy_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysDeployFormVo">
|
||||
select id, form_id, deploy_id from sys_deploy_form
|
||||
</sql>
|
||||
|
||||
<select id="selectSysDeployFormList" parameterType="SysDeployForm" resultMap="SysDeployFormResult">
|
||||
<include refid="selectSysDeployFormVo"/>
|
||||
<where>
|
||||
<if test="formId != null "> and form_id = #{formId}</if>
|
||||
<if test="deployId != null and deployId != ''"> and deploy_id = #{deployId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysDeployFormById" parameterType="Long" resultMap="SysDeployFormResult">
|
||||
<include refid="selectSysDeployFormVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectSysDeployFormByDeployId" resultType="SysForm">
|
||||
select t1.form_content as formContent,t1.form_name as formName,t1.form_id as formId from sys_form t1 left join sys_deploy_form t2 on t1.form_id = t2.form_id
|
||||
where t2.deploy_id = #{deployId} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertSysDeployForm" parameterType="SysDeployForm" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_deploy_form
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="formId != null">form_id,</if>
|
||||
<if test="deployId != null">deploy_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="formId != null">#{formId},</if>
|
||||
<if test="deployId != null">#{deployId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysDeployForm" parameterType="SysDeployForm">
|
||||
update sys_deploy_form
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="formId != null">form_id = #{formId},</if>
|
||||
<if test="deployId != null">deploy_id = #{deployId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysDeployFormById" parameterType="Long">
|
||||
delete from sys_deploy_form where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysDeployFormByIds" parameterType="String">
|
||||
delete from sys_deploy_form where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -2,84 +2,89 @@
|
|||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.flowable.mapper.FlowableCategoryMapper">
|
||||
|
||||
<resultMap type="FlowableCategory" id="FlowableCategoryResult">
|
||||
<mapper namespace="com.yanzhu.flowable.mapper.SysExpressionMapper">
|
||||
|
||||
<resultMap type="SysExpression" id="SysExpressionResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="code" column="code" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="expression" column="expression" />
|
||||
<result property="dataType" column="data_type" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFlowableCategoryVo">
|
||||
select id, name, code, remark, create_by, create_time, update_by, update_time, del_flag from flowable_category
|
||||
<sql id="selectSysExpressionVo">
|
||||
select id, name, expression,data_type, create_time, update_time, create_by, update_by, status, remark from sys_expression
|
||||
</sql>
|
||||
|
||||
<select id="selectFlowableCategoryList" parameterType="FlowableCategory" resultMap="FlowableCategoryResult">
|
||||
<include refid="selectFlowableCategoryVo"/>
|
||||
<where>
|
||||
<select id="selectSysExpressionList" parameterType="SysExpression" resultMap="SysExpressionResult">
|
||||
<include refid="selectSysExpressionVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="code != null and code != ''"> and code = #{code}</if>
|
||||
<if test="expression != null and expression != ''"> and expression = #{expression}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectFlowableCategoryById" parameterType="Long" resultMap="FlowableCategoryResult">
|
||||
<include refid="selectFlowableCategoryVo"/>
|
||||
|
||||
<select id="selectSysExpressionById" parameterType="Long" resultMap="SysExpressionResult">
|
||||
<include refid="selectSysExpressionVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertFlowableCategory" parameterType="FlowableCategory" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into flowable_category
|
||||
|
||||
<insert id="insertSysExpression" parameterType="SysExpression" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_expression
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="code != null">code,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="expression != null">expression,</if>
|
||||
<if test="dataType != null">data_type,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="code != null">#{code},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="expression != null">#{expression},</if>
|
||||
<if test="dataType != null">#{dataType},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateFlowableCategory" parameterType="FlowableCategory">
|
||||
update flowable_category
|
||||
<update id="updateSysExpression" parameterType="SysExpression">
|
||||
update sys_expression
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="code != null">code = #{code},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="expression != null">expression = #{expression},</if>
|
||||
<if test="dataType != null">data_type = #{dataType},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteFlowableCategoryById" parameterType="Long">
|
||||
delete from flowable_category where id = #{id}
|
||||
<delete id="deleteSysExpressionById" parameterType="Long">
|
||||
delete from sys_expression where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFlowableCategoryByIds" parameterType="String">
|
||||
delete from flowable_category where id in
|
||||
<delete id="deleteSysExpressionByIds" parameterType="String">
|
||||
delete from sys_expression where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
|
@ -0,0 +1,82 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.flowable.mapper.SysFormMapper">
|
||||
|
||||
<resultMap type="SysForm" id="SysFormResult">
|
||||
<result property="formId" column="form_id" />
|
||||
<result property="formName" column="form_name" />
|
||||
<result property="formContent" column="form_content" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysFormVo">
|
||||
select form_id, form_name, form_content, create_time, update_time, create_by, update_by, remark from sys_form
|
||||
</sql>
|
||||
|
||||
<select id="selectSysFormList" parameterType="SysForm" resultMap="SysFormResult">
|
||||
<include refid="selectSysFormVo"/>
|
||||
<where>
|
||||
<if test="formName != null and formName != ''"> and form_name like concat('%', #{formName}, '%')</if>
|
||||
<if test="formContent != null and formContent != ''"> and form_content = #{formContent}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectSysFormById" parameterType="Long" resultMap="SysFormResult">
|
||||
<include refid="selectSysFormVo"/>
|
||||
where form_id = #{formId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysForm" parameterType="SysForm" useGeneratedKeys="true" keyProperty="formId">
|
||||
insert into sys_form
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="formName != null">form_name,</if>
|
||||
<if test="formContent != null">form_content,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="formName != null">#{formName},</if>
|
||||
<if test="formContent != null">#{formContent},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysForm" parameterType="SysForm">
|
||||
update sys_form
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="formName != null">form_name = #{formName},</if>
|
||||
<if test="formContent != null">form_content = #{formContent},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where form_id = #{formId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysFormById" parameterType="Long">
|
||||
delete from sys_form where form_id = #{formId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysFormByIds" parameterType="String">
|
||||
delete from sys_form where form_id in
|
||||
<foreach item="formId" collection="array" open="(" separator="," close=")">
|
||||
#{formId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,115 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.flowable.mapper.SysListenerMapper">
|
||||
|
||||
<resultMap type="SysListener" id="SysListenerResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="eventType" column="event_type"/>
|
||||
<result property="valueType" column="value_type"/>
|
||||
<result property="value" column="value"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysListenerVo">
|
||||
select id,
|
||||
name,
|
||||
type,
|
||||
event_type,
|
||||
value_type,
|
||||
value,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
update_by,
|
||||
status,
|
||||
remark
|
||||
from sys_listener
|
||||
</sql>
|
||||
|
||||
<select id="selectSysListenerList" parameterType="SysListener" resultMap="SysListenerResult">
|
||||
<include refid="selectSysListenerVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
|
||||
<if test="type != null and type != ''">and type = #{type}</if>
|
||||
<if test="eventType != null and eventType != ''">and event_type = #{eventType}</if>
|
||||
<if test="valueType != null and valueType != ''">and value_type = #{valueType}</if>
|
||||
<if test="value != null and value != ''">and value = #{value}</if>
|
||||
<if test="status != null ">and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysListenerById" parameterType="Long" resultMap="SysListenerResult">
|
||||
<include refid="selectSysListenerVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysListener" parameterType="SysListener" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_listener
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="eventType != null">event_type,</if>
|
||||
<if test="valueType != null">value_type,</if>
|
||||
<if test="value != null">value,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="eventType != null">#{eventType},</if>
|
||||
<if test="valueType != null">#{valueType},</if>
|
||||
<if test="value != null">#{value},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysListener" parameterType="SysListener">
|
||||
update sys_listener
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="eventType != null">event_type = #{eventType},</if>
|
||||
<if test="valueType != null">value_type = #{valueType},</if>
|
||||
<if test="value != null">value = #{value},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysListenerById" parameterType="Long">
|
||||
delete
|
||||
from sys_listener
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysListenerByIds" parameterType="String">
|
||||
delete from sys_listener where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.flowable.mapper.SysTaskFormMapper">
|
||||
|
||||
<resultMap type="SysTaskForm" id="SysTaskFormResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="formId" column="form_id" />
|
||||
<result property="taskId" column="task_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysTaskFormVo">
|
||||
select id, form_id, task_id from sys_task_form
|
||||
</sql>
|
||||
|
||||
<select id="selectSysTaskFormList" parameterType="SysTaskForm" resultMap="SysTaskFormResult">
|
||||
<include refid="selectSysTaskFormVo"/>
|
||||
<where>
|
||||
<if test="formId != null "> and form_id = #{formId}</if>
|
||||
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysTaskFormById" parameterType="Long" resultMap="SysTaskFormResult">
|
||||
<include refid="selectSysTaskFormVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysTaskForm" parameterType="SysTaskForm" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_task_form
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="formId != null">form_id,</if>
|
||||
<if test="taskId != null">task_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="formId != null">#{formId},</if>
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysTaskForm" parameterType="SysTaskForm">
|
||||
update sys_task_form
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="formId != null">form_id = #{formId},</if>
|
||||
<if test="taskId != null">task_id = #{taskId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysTaskFormById" parameterType="Long">
|
||||
delete from sys_task_form where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysTaskFormByIds" parameterType="String">
|
||||
delete from sys_task_form where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -13,6 +13,7 @@
|
|||
<artifactId>yanzhu-modules-flowable</artifactId>
|
||||
|
||||
<properties>
|
||||
<flowable.version>6.7.2</flowable.version>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
</properties>
|
||||
|
@ -105,14 +106,16 @@
|
|||
<version>5.3.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>jakarta.mail</groupId>
|
||||
<artifactId>jakarta.mail-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.flowable</groupId>
|
||||
<artifactId>flowable-spring-boot-starter</artifactId>
|
||||
<version>${flowable.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.flowable</groupId>
|
||||
<artifactId>flowable-spring-security</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
|
|
@ -8,8 +8,6 @@ package com.yanzhu.flowable.common.constant;
|
|||
*/
|
||||
public class ProcessConstants {
|
||||
|
||||
public static final String SUFFIX = ".bpmn";
|
||||
|
||||
/**
|
||||
* 动态数据
|
||||
*/
|
||||
|
@ -25,13 +23,11 @@ public class ProcessConstants {
|
|||
*/
|
||||
public static final String ASSIGNEE = "assignee";
|
||||
|
||||
|
||||
/**
|
||||
* 候选人
|
||||
*/
|
||||
public static final String CANDIDATE_USERS = "candidateUsers";
|
||||
|
||||
|
||||
/**
|
||||
* 审批组
|
||||
*/
|
||||
|
@ -72,11 +68,9 @@ public class ProcessConstants {
|
|||
*/
|
||||
public static final String PROCESS_INITIATOR = "INITIATOR";
|
||||
|
||||
|
||||
/**
|
||||
* 流程跳过
|
||||
*/
|
||||
public static final String FLOWABLE_SKIP_EXPRESSION_ENABLED = "_FLOWABLE_SKIP_EXPRESSION_ENABLED";
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
package com.yanzhu.flowable.common.enums;
|
||||
|
||||
/**
|
||||
* 缓存key
|
||||
*/
|
||||
public enum CacheType {
|
||||
|
||||
FLOWCATEGORY("flowcategory","流程分类");
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private String remark;
|
||||
CacheType(String code,String remark){
|
||||
this.code = code;
|
||||
this.remark = remark;
|
||||
}
|
||||
}
|
|
@ -16,8 +16,8 @@ public enum FlowComment {
|
|||
REJECT("3", "驳回意见"),
|
||||
DELEGATE("4", "委派意见"),
|
||||
ASSIGN("5", "转办意见"),
|
||||
STOP("6", "终止流程"),
|
||||
REVOKE("7", "撤回流程");
|
||||
STOP("6", "终止流程");
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
package com.yanzhu.flowable.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author ruoyi
|
||||
* @createTime 2023/11/28
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum FormType {
|
||||
|
||||
/**
|
||||
* 流程表单
|
||||
*/
|
||||
PROCESS(0),
|
||||
|
||||
/**
|
||||
* 外置表单
|
||||
*/
|
||||
EXTERNAL(1),
|
||||
|
||||
/**
|
||||
* 节点独立表单
|
||||
*/
|
||||
INDEPENDENT(2);
|
||||
|
||||
/**
|
||||
* 表单类型
|
||||
*/
|
||||
private final Integer type;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.yanzhu.flowable.common.expand.el;
|
||||
|
||||
/**
|
||||
* 扩展表达式
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2023-03-04 09:10
|
||||
*/
|
||||
public interface BaseEl {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.yanzhu.flowable.common.expand.el;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 扩展表达式
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2023-03-04 12:10
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class FlowEl implements BaseEl {
|
||||
|
||||
public String findDeptLeader(String name) {
|
||||
log.info("开始查询表达式变量值,getName");
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getName(String name) {
|
||||
log.info("开始查询表达式变量值,getName");
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.yanzhu.flowable.common.expand.function;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.common.engine.api.variable.VariableContainer;
|
||||
import org.flowable.common.engine.impl.el.function.AbstractFlowableVariableExpressionFunction;
|
||||
|
||||
/**
|
||||
* 表达式函数:实现逻辑用java
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2023-03-04 09:10
|
||||
*/
|
||||
@Slf4j
|
||||
public class ExpressionLanguageJavaFunction extends AbstractFlowableVariableExpressionFunction{
|
||||
|
||||
public ExpressionLanguageJavaFunction() {
|
||||
super("test");
|
||||
}
|
||||
|
||||
public static String test(VariableContainer variableContainer, String variableName) {
|
||||
log.info("开始查询表达式变量值,test");
|
||||
Object variableValue = getVariableValue(variableContainer, variableName);
|
||||
return variableValue.toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,32 +1,32 @@
|
|||
//package com.yanzhu.flowable.config;
|
||||
//
|
||||
//import org.flowable.engine.impl.db.DbIdGenerator;
|
||||
//import org.flowable.spring.SpringProcessEngineConfiguration;
|
||||
//import org.flowable.spring.boot.EngineConfigurationConfigurer;
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.core.task.AsyncListenableTaskExecutor;
|
||||
//import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
||||
//
|
||||
///**
|
||||
// * 流程id生成处理
|
||||
// * @author Tony
|
||||
// * @date 2022-12-26 10:24
|
||||
// */
|
||||
////@Configuration
|
||||
//public class FlowableConfig implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> {
|
||||
//
|
||||
// @Bean
|
||||
// public AsyncListenableTaskExecutor applicationTaskExecutor() {
|
||||
// return new SimpleAsyncTaskExecutor();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void configure(SpringProcessEngineConfiguration engineConfiguration) {
|
||||
// engineConfiguration.setActivityFontName("宋体");
|
||||
// engineConfiguration.setLabelFontName("宋体");
|
||||
// engineConfiguration.setAnnotationFontName("宋体");
|
||||
// engineConfiguration.setIdGenerator(new DbIdGenerator());
|
||||
// }
|
||||
//
|
||||
//}
|
||||
package com.yanzhu.flowable.config;
|
||||
|
||||
import org.flowable.engine.impl.db.DbIdGenerator;
|
||||
import org.flowable.spring.SpringProcessEngineConfiguration;
|
||||
import org.flowable.spring.boot.EngineConfigurationConfigurer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.task.AsyncListenableTaskExecutor;
|
||||
import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
||||
|
||||
/**
|
||||
* 流程id生成处理
|
||||
* @author Tony
|
||||
* @date 2022-12-26 10:24
|
||||
*/
|
||||
@Configuration
|
||||
public class FlowableConfig implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> {
|
||||
|
||||
@Bean
|
||||
public AsyncListenableTaskExecutor applicationTaskExecutor() {
|
||||
return new SimpleAsyncTaskExecutor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(SpringProcessEngineConfiguration engineConfiguration) {
|
||||
engineConfiguration.setActivityFontName("宋体");
|
||||
engineConfiguration.setLabelFontName("宋体");
|
||||
engineConfiguration.setAnnotationFontName("宋体");
|
||||
engineConfiguration.setIdGenerator(new DbIdGenerator());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,63 +0,0 @@
|
|||
package com.yanzhu.flowable.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.flowable.spring.SpringProcessEngineConfiguration;
|
||||
import org.flowable.spring.boot.EngineConfigurationConfigurer;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author ruoyi
|
||||
* @date 2023/11/28
|
||||
*/
|
||||
@Data
|
||||
@Configuration
|
||||
public class FlowableEngineConfig implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> {
|
||||
/**
|
||||
* jdbc 驱动类
|
||||
*/
|
||||
@Value("${spring.datasource.driver-class-name}")
|
||||
private String jdbcDriver;
|
||||
/**
|
||||
* jdbc url
|
||||
*/
|
||||
@Value("${spring.datasource.url}")
|
||||
private String jdbcUrl;
|
||||
/**
|
||||
* jdbc 用户名
|
||||
*/
|
||||
@Value("${spring.datasource.username}")
|
||||
private String jdbcUsername;
|
||||
/**
|
||||
* jdbc 密码
|
||||
*/
|
||||
@Value("${spring.datasource.password}")
|
||||
private String jdbcPassword;
|
||||
/**
|
||||
* 设置在进程引擎启动和关闭时处理数据库模式的策略
|
||||
* false(默认值):在创建流程引擎时,根据库检查DB架构的版本,如果版本不匹配,则抛出异常。
|
||||
* true:在构建流程引擎时,将执行检查,并在必要时执行模式更新。如果该架构不存在,则创建该架构。
|
||||
* create-drop:在创建流程引擎时创建架构,在关闭流程引擎时删除架构。
|
||||
*/
|
||||
@Value("${spring.datasource.databaseSchemaUpdate}")
|
||||
private String databaseSchemaUpdate;
|
||||
/**
|
||||
* 指示Flowable引擎在启动时启动异步执行器。用于定时任务
|
||||
*/
|
||||
@Value("${spring.datasource.asyncExecutorActivate}")
|
||||
private boolean asyncExecutorActivate;
|
||||
|
||||
@Override
|
||||
public void configure(SpringProcessEngineConfiguration engineConfiguration) {
|
||||
engineConfiguration.setActivityFontName("宋体");
|
||||
engineConfiguration.setLabelFontName("宋体");
|
||||
engineConfiguration.setAnnotationFontName("宋体");
|
||||
engineConfiguration.setJdbcDriver(this.jdbcDriver);
|
||||
engineConfiguration.setJdbcUrl(this.jdbcUrl);
|
||||
engineConfiguration.setJdbcUsername(this.jdbcUsername);
|
||||
engineConfiguration.setJdbcPassword(this.jdbcPassword);
|
||||
engineConfiguration.setDatabaseSchemaUpdate(this.databaseSchemaUpdate);
|
||||
engineConfiguration.setAsyncExecutorActivate(this.asyncExecutorActivate);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,41 +1,41 @@
|
|||
//package com.yanzhu.flowable.config;
|
||||
//
|
||||
//import com.yanzhu.flowable.listener.GlobalEventListener;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType;
|
||||
//import org.flowable.common.engine.api.delegate.event.FlowableEventDispatcher;
|
||||
//import org.flowable.spring.SpringProcessEngineConfiguration;
|
||||
//import org.springframework.context.ApplicationListener;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.context.event.ContextRefreshedEvent;
|
||||
//
|
||||
///**
|
||||
// * Flowable添加全局监听器
|
||||
// *
|
||||
// * @author JiangYuQi
|
||||
// */
|
||||
////@Configuration
|
||||
//@RequiredArgsConstructor
|
||||
//public class FlowableGlobalListenerConfig implements ApplicationListener<ContextRefreshedEvent> {
|
||||
//
|
||||
// private final SpringProcessEngineConfiguration configuration;
|
||||
//
|
||||
// private final GlobalEventListener globalEventListener;
|
||||
//
|
||||
// @Override
|
||||
// public void onApplicationEvent(ContextRefreshedEvent event) {
|
||||
// FlowableEventDispatcher dispatcher = configuration.getEventDispatcher();
|
||||
// /**
|
||||
// * 任务创建全局监听-待办消息发送
|
||||
// * PROCESS_CREATED 流程创建
|
||||
// * TASK_CREATED 任务创建
|
||||
// * TASK_COMPLETED 任务完成
|
||||
// * PROCESS_COMPLETED 流程完成
|
||||
// * 流程创建、任务创建、任务完成、流程完成
|
||||
// */
|
||||
// dispatcher.addEventListener(globalEventListener,FlowableEngineEventType.TASK_CREATED);
|
||||
// dispatcher.addEventListener(globalEventListener,FlowableEngineEventType.PROCESS_COMPLETED);
|
||||
// }
|
||||
//
|
||||
//}
|
||||
//
|
||||
package com.yanzhu.flowable.config;
|
||||
|
||||
import com.yanzhu.flowable.listener.GlobalEventListener;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType;
|
||||
import org.flowable.common.engine.api.delegate.event.FlowableEventDispatcher;
|
||||
import org.flowable.spring.SpringProcessEngineConfiguration;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
|
||||
/**
|
||||
* Flowable添加全局监听器
|
||||
*
|
||||
* @author JiangYuQi
|
||||
*/
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
public class FlowableGlobalListenerConfig implements ApplicationListener<ContextRefreshedEvent> {
|
||||
|
||||
private final SpringProcessEngineConfiguration configuration;
|
||||
|
||||
private final GlobalEventListener globalEventListener;
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ContextRefreshedEvent event) {
|
||||
FlowableEventDispatcher dispatcher = configuration.getEventDispatcher();
|
||||
/**
|
||||
* 任务创建全局监听-待办消息发送
|
||||
* PROCESS_CREATED 流程创建
|
||||
* TASK_CREATED 任务创建
|
||||
* TASK_COMPLETED 任务完成
|
||||
* PROCESS_COMPLETED 流程完成
|
||||
* 流程创建、任务创建、任务完成、流程完成
|
||||
*/
|
||||
dispatcher.addEventListener(globalEventListener,FlowableEngineEventType.TASK_CREATED);
|
||||
dispatcher.addEventListener(globalEventListener,FlowableEngineEventType.PROCESS_COMPLETED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,210 @@
|
|||
package com.yanzhu.flowable.controller;
|
||||
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.flowable.domain.SysExpression;
|
||||
import com.yanzhu.flowable.domain.dto.FlowProcDefDto;
|
||||
import com.yanzhu.flowable.domain.dto.FlowSaveXmlVo;
|
||||
import com.yanzhu.flowable.rpc.RemoteSystemService;
|
||||
import com.yanzhu.flowable.service.IFlowDefinitionService;
|
||||
import com.yanzhu.flowable.service.ISysExpressionService;
|
||||
import com.yanzhu.system.api.domain.SysRole;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 工作流程定义
|
||||
* </p>
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "流程定义")
|
||||
@RestController
|
||||
@RequestMapping("/definition")
|
||||
public class FlowDefinitionController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IFlowDefinitionService flowDefinitionService;
|
||||
|
||||
@Autowired
|
||||
private RemoteSystemService remoteSystemService;
|
||||
|
||||
@Resource
|
||||
private ISysExpressionService sysExpressionService;
|
||||
|
||||
@GetMapping(value = "/list")
|
||||
@ApiOperation(value = "流程定义列表", response = FlowProcDefDto.class)
|
||||
public TableDataInfo list(@ApiParam(value = "流程名称", required = false) @RequestParam(required = false) String name) {
|
||||
startPage();
|
||||
List<FlowProcDefDto> list = flowDefinitionService.list(name);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "导入流程文件", notes = "上传bpmn20的xml文件")
|
||||
@PostMapping("/import")
|
||||
public AjaxResult importFile(@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) String category,
|
||||
MultipartFile file) {
|
||||
InputStream in = null;
|
||||
try {
|
||||
in = file.getInputStream();
|
||||
flowDefinitionService.importFile(name, category, in);
|
||||
} catch (Exception e) {
|
||||
log.error("导入失败:", e);
|
||||
return AjaxResult.success(e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error("关闭输入流出错", e);
|
||||
}
|
||||
}
|
||||
|
||||
return AjaxResult.success("导入成功");
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "读取xml文件")
|
||||
@GetMapping("/readXml/{deployId}")
|
||||
public AjaxResult readXml(@ApiParam(value = "流程定义id") @PathVariable(value = "deployId") String deployId) {
|
||||
try {
|
||||
return flowDefinitionService.readXml(deployId);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("加载xml文件异常");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "读取图片文件")
|
||||
@GetMapping("/readImage/{deployId}")
|
||||
public void readImage(@ApiParam(value = "流程定义id") @PathVariable(value = "deployId") String deployId, HttpServletResponse response) {
|
||||
OutputStream os = null;
|
||||
BufferedImage image = null;
|
||||
try {
|
||||
image = ImageIO.read(flowDefinitionService.readImage(deployId));
|
||||
response.setContentType("image/png");
|
||||
os = response.getOutputStream();
|
||||
if (image != null) {
|
||||
ImageIO.write(image, "png", os);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (os != null) {
|
||||
os.flush();
|
||||
os.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "保存流程设计器内的xml文件")
|
||||
@Log(title = "流程定义", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/save")
|
||||
public AjaxResult save(@RequestBody FlowSaveXmlVo vo) {
|
||||
InputStream in = null;
|
||||
try {
|
||||
String xml = vo.getXml();
|
||||
//将xml数据进行base64解码
|
||||
xml = StringUtils.utf8Str(xml);
|
||||
//in = new ByteArrayInputStream(vo.getXml().getBytes(StandardCharsets.UTF_8));
|
||||
in = new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8));
|
||||
flowDefinitionService.importFile(vo.getName(), vo.getCategory(), in);
|
||||
} catch (Exception e) {
|
||||
log.error("导入失败:", e);
|
||||
return AjaxResult.error(e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error("关闭输入流出错", e);
|
||||
}
|
||||
}
|
||||
|
||||
return AjaxResult.success("导入成功");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "发起流程")
|
||||
@Log(title = "发起流程", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/start/{procDefId}")
|
||||
public AjaxResult start(@ApiParam(value = "流程定义id") @PathVariable(value = "procDefId") String procDefId,
|
||||
@ApiParam(value = "变量集合,json对象") @RequestBody Map<String, Object> variables) {
|
||||
return flowDefinitionService.startProcessInstanceById(procDefId, variables);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "激活或挂起流程定义")
|
||||
@Log(title = "激活/挂起流程", businessType = BusinessType.UPDATE)
|
||||
@PutMapping(value = "/updateState")
|
||||
public AjaxResult updateState(@ApiParam(value = "1:激活,2:挂起", required = true) @RequestParam Integer state,
|
||||
@ApiParam(value = "流程部署ID", required = true) @RequestParam String deployId) {
|
||||
flowDefinitionService.updateState(state, deployId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除流程")
|
||||
@Log(title = "删除流程", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping(value = "/{deployIds}")
|
||||
public AjaxResult delete(@PathVariable String[] deployIds) {
|
||||
for (String deployId : deployIds) {
|
||||
flowDefinitionService.delete(deployId);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "指定流程办理人员列表")
|
||||
@GetMapping("/userList")
|
||||
public AjaxResult userList(SysUser user) {
|
||||
List<SysUser> list = remoteSystemService.getUsers(user);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "指定流程办理组列表")
|
||||
@GetMapping("/roleList")
|
||||
public AjaxResult roleList(SysRole role) {
|
||||
List<SysRole> list = remoteSystemService.getRoles(role);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "指定流程达式列表")
|
||||
@GetMapping("/expList")
|
||||
public AjaxResult expList(SysExpression sysExpression) {
|
||||
List<SysExpression> list = sysExpressionService.selectSysExpressionList(sysExpression);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.yanzhu.flowable.controller;
|
||||
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.flowable.domain.vo.FlowTaskVo;
|
||||
import com.yanzhu.flowable.service.IFlowInstanceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>工作流流程实例管理<p>
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "工作流流程实例管理")
|
||||
@RestController
|
||||
@RequestMapping("/instance")
|
||||
public class FlowInstanceController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IFlowInstanceService flowInstanceService;
|
||||
|
||||
@ApiOperation(value = "根据流程定义id启动流程实例")
|
||||
@PostMapping("/startBy/{procDefId}")
|
||||
public AjaxResult startById(@ApiParam(value = "流程定义id") @PathVariable(value = "procDefId") String procDefId,
|
||||
@ApiParam(value = "变量集合,json对象") @RequestBody Map<String, Object> variables) {
|
||||
return flowInstanceService.startProcessInstanceById(procDefId, variables);
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "激活或挂起流程实例")
|
||||
@PostMapping(value = "/updateState")
|
||||
public AjaxResult updateState(@ApiParam(value = "1:激活,2:挂起", required = true) @RequestParam Integer state,
|
||||
@ApiParam(value = "流程实例ID", required = true) @RequestParam String instanceId) {
|
||||
flowInstanceService.updateState(state,instanceId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("结束流程实例")
|
||||
@PostMapping(value = "/stopProcessInstance")
|
||||
public AjaxResult stopProcessInstance(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
flowInstanceService.stopProcessInstance(flowTaskVo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除流程实例")
|
||||
@Log(title = "删除任务", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping(value = "/delete/{instanceIds}")
|
||||
public AjaxResult delete(@ApiParam(value = "流程实例ID", required = true) @PathVariable String[] instanceIds,
|
||||
@ApiParam(value = "删除原因") @RequestParam(required = false) String deleteReason) {
|
||||
for (String instanceId : instanceIds) {
|
||||
flowInstanceService.delete(instanceId,deleteReason);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,281 @@
|
|||
package com.yanzhu.flowable.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.flowable.domain.dto.FlowTaskDto;
|
||||
import com.yanzhu.flowable.domain.vo.FlowQueryVo;
|
||||
import com.yanzhu.flowable.domain.vo.FlowTaskVo;
|
||||
import com.yanzhu.flowable.service.IFlowTaskService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
* <p>工作流任务管理<p>
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "工作流流程任务管理")
|
||||
@RestController
|
||||
@RequestMapping("/task")
|
||||
public class FlowTaskController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IFlowTaskService flowTaskService;
|
||||
|
||||
@ApiOperation(value = "我发起的流程", response = FlowTaskDto.class)
|
||||
@GetMapping(value = "/myProcess")
|
||||
public TableDataInfo myProcess(FlowQueryVo queryVo) {
|
||||
PageInfo<FlowTaskDto> list = flowTaskService.myProcess(queryVo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "取消申请", response = FlowTaskDto.class)
|
||||
@Log(title = "取消申请", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/stopProcess")
|
||||
public AjaxResult stopProcess(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
return flowTaskService.stopProcess(flowTaskVo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "撤回流程", response = FlowTaskDto.class)
|
||||
@Log(title = "撤回流程", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/revokeProcess")
|
||||
public AjaxResult revokeProcess(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
return flowTaskService.revokeProcess(flowTaskVo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取待办列表", response = FlowTaskDto.class)
|
||||
@GetMapping(value = "/todoList")
|
||||
public TableDataInfo todoList(FlowQueryVo queryVo) {
|
||||
PageInfo<FlowTaskDto> list = flowTaskService.todoList(queryVo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取已办任务", response = FlowTaskDto.class)
|
||||
@GetMapping(value = "/finishedList")
|
||||
public TableDataInfo finishedList(FlowQueryVo queryVo) {
|
||||
PageInfo<FlowTaskDto> list = flowTaskService.finishedList(queryVo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "流程历史流转记录", response = FlowTaskDto.class)
|
||||
@GetMapping(value = "/flowRecord")
|
||||
public AjaxResult flowRecord(String procInsId, String deployId) {
|
||||
return flowTaskService.flowRecord(procInsId, deployId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据任务ID查询挂载的表单信息")
|
||||
@GetMapping(value = "/getTaskForm")
|
||||
public AjaxResult getTaskForm(String taskId) {
|
||||
return flowTaskService.getTaskForm(taskId);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "流程初始化表单", response = FlowTaskDto.class)
|
||||
@GetMapping(value = "/flowFormData")
|
||||
public AjaxResult flowFormData(String deployId) {
|
||||
return flowTaskService.flowFormData(deployId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取流程变量", response = FlowTaskDto.class)
|
||||
@GetMapping(value = "/processVariables/{taskId}")
|
||||
public AjaxResult processVariables(@ApiParam(value = "流程任务Id") @PathVariable(value = "taskId") String taskId) {
|
||||
return flowTaskService.processVariables(taskId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "审批任务")
|
||||
@Log(title = "审批任务", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/complete")
|
||||
public AjaxResult complete(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
return flowTaskService.complete(flowTaskVo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "驳回任务")
|
||||
@Log(title = "驳回任务", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/reject")
|
||||
public AjaxResult taskReject(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
flowTaskService.taskReject(flowTaskVo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "退回任务")
|
||||
@Log(title = "退回任务", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/return")
|
||||
public AjaxResult taskReturn(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
flowTaskService.taskReturn(flowTaskVo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取所有可回退的节点")
|
||||
@PostMapping(value = "/returnList")
|
||||
public AjaxResult findReturnTaskList(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
return flowTaskService.findReturnTaskList(flowTaskVo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除任务")
|
||||
@Log(title = "删除任务", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping(value = "/delete")
|
||||
public AjaxResult delete(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
flowTaskService.deleteTask(flowTaskVo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "认领/签收任务")
|
||||
@PostMapping(value = "/claim")
|
||||
public AjaxResult claim(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
flowTaskService.claim(flowTaskVo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "取消认领/签收任务")
|
||||
@PostMapping(value = "/unClaim")
|
||||
public AjaxResult unClaim(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
flowTaskService.unClaim(flowTaskVo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "委派任务")
|
||||
@PostMapping(value = "/delegateTask")
|
||||
public AjaxResult delegate(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
flowTaskService.delegateTask(flowTaskVo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "任务归还")
|
||||
@PostMapping(value = "/resolveTask")
|
||||
public AjaxResult resolveTask(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
flowTaskService.resolveTask(flowTaskVo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "转办任务")
|
||||
@PostMapping(value = "/assignTask")
|
||||
public AjaxResult assign(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
flowTaskService.assignTask(flowTaskVo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping(value = "/addMultiInstanceExecution")
|
||||
@ApiOperation(value = "多实例加签")
|
||||
public AjaxResult addMultiInstanceExecution(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
flowTaskService.addMultiInstanceExecution(flowTaskVo);
|
||||
return AjaxResult.success("加签成功");
|
||||
}
|
||||
|
||||
@PostMapping(value = "/deleteMultiInstanceExecution")
|
||||
@ApiOperation(value = "多实例减签")
|
||||
public AjaxResult deleteMultiInstanceExecution(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
flowTaskService.deleteMultiInstanceExecution(flowTaskVo);
|
||||
return AjaxResult.success("减签成功");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取下一节点")
|
||||
@PostMapping(value = "/nextFlowNode")
|
||||
public AjaxResult getNextFlowNode(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
return flowTaskService.getNextFlowNode(flowTaskVo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "流程发起时获取下一节点")
|
||||
@PostMapping(value = "/nextFlowNodeByStart")
|
||||
public AjaxResult getNextFlowNodeByStart(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
return flowTaskService.getNextFlowNodeByStart(flowTaskVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成流程图
|
||||
*
|
||||
* @param processId 任务ID
|
||||
*/
|
||||
@GetMapping("/diagram/{processId}")
|
||||
public void genProcessDiagram(HttpServletResponse response,
|
||||
@PathVariable("processId") String processId) {
|
||||
InputStream inputStream = flowTaskService.diagram(processId);
|
||||
OutputStream os = null;
|
||||
BufferedImage image = null;
|
||||
try {
|
||||
image = ImageIO.read(inputStream);
|
||||
response.setContentType("image/png");
|
||||
os = response.getOutputStream();
|
||||
if (image != null) {
|
||||
ImageIO.write(image, "png", os);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (os != null) {
|
||||
os.flush();
|
||||
os.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程执行节点
|
||||
*
|
||||
* @param procInsId 流程实例编号
|
||||
* @param procInsId 任务执行编号
|
||||
*/
|
||||
@GetMapping("/flowViewer/{procInsId}/{executionId}")
|
||||
public AjaxResult getFlowViewer(@PathVariable("procInsId") String procInsId,
|
||||
@PathVariable("executionId") String executionId) {
|
||||
return flowTaskService.getFlowViewer(procInsId, executionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程节点信息
|
||||
*
|
||||
* @param procInsId 流程实例id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/flowXmlAndNode")
|
||||
public AjaxResult flowXmlAndNode(@RequestParam(value = "procInsId", required = false) String procInsId,
|
||||
@RequestParam(value = "deployId", required = false) String deployId) {
|
||||
return flowTaskService.flowXmlAndNode(procInsId, deployId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程节点表单
|
||||
*
|
||||
* @param taskId 流程任务编号
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/flowTaskForm")
|
||||
public AjaxResult flowTaskForm(@RequestParam(value = "taskId", required = false) String taskId) throws Exception {
|
||||
return flowTaskService.flowTaskForm(taskId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程节点信息
|
||||
*
|
||||
* @param procInsId 流程实例编号
|
||||
* @param elementId 流程节点编号
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/flowTaskInfo")
|
||||
public AjaxResult flowTaskInfo(@RequestParam(value = "procInsId") String procInsId,
|
||||
@RequestParam(value = "elementId") String elementId) {
|
||||
return flowTaskService.flowTaskInfo(procInsId, elementId);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,98 +0,0 @@
|
|||
package com.yanzhu.flowable.controller;
|
||||
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
import com.yanzhu.flowable.domain.FlowableCategory;
|
||||
import com.yanzhu.flowable.service.IFlowableCategoryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程分类Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-11-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/category")
|
||||
public class FlowableCategoryController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IFlowableCategoryService flowableCategoryService;
|
||||
|
||||
/**
|
||||
* 查询流程分类列表
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_classify:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(FlowableCategory flowableCategory)
|
||||
{
|
||||
startPage();
|
||||
List<FlowableCategory> list = flowableCategoryService.selectFlowableCategoryList(flowableCategory);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出流程分类列表
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_classify:export")
|
||||
@Log(title = "流程分类", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, FlowableCategory flowableCategory)
|
||||
{
|
||||
List<FlowableCategory> list = flowableCategoryService.selectFlowableCategoryList(flowableCategory);
|
||||
ExcelUtil<FlowableCategory> util = new ExcelUtil<FlowableCategory>(FlowableCategory.class);
|
||||
util.exportExcel(response, list, "流程分类数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程分类详细信息
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_classify:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(flowableCategoryService.selectFlowableCategoryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程分类
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_classify:add")
|
||||
@Log(title = "流程分类", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody FlowableCategory flowableCategory)
|
||||
{
|
||||
return toAjax(flowableCategoryService.insertFlowableCategory(flowableCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程分类
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_classify:update")
|
||||
@Log(title = "流程分类", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody FlowableCategory flowableCategory)
|
||||
{
|
||||
return toAjax(flowableCategoryService.updateFlowableCategory(flowableCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程分类
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_classify:delete")
|
||||
@Log(title = "流程分类", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(flowableCategoryService.deleteFlowableCategoryByIds(ids));
|
||||
}
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
package com.yanzhu.flowable.controller;
|
||||
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
import com.yanzhu.flowable.domain.FlowableDeploy;
|
||||
import com.yanzhu.flowable.service.IFlowableDeployService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程部署Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/deploy")
|
||||
public class FlowableDeployController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IFlowableDeployService flowableDeployService;
|
||||
|
||||
/**
|
||||
* 查询流程部署列表
|
||||
*/
|
||||
@RequiresPermissions("flowable:deploy:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(FlowableDeploy flowableDeploy)
|
||||
{
|
||||
startPage();
|
||||
List<FlowableDeploy> list = flowableDeployService.selectFlowableDeployList(flowableDeploy);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程部署详细信息
|
||||
*/
|
||||
@RequiresPermissions("flowable:deploy:query")
|
||||
@GetMapping(value = "/{definitionId}")
|
||||
public AjaxResult getInfo(@PathVariable("definitionId") String definitionId)
|
||||
{
|
||||
return success(flowableDeployService.selectFlowableDeployByDefinitionId(definitionId));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除流程部署
|
||||
*/
|
||||
@RequiresPermissions("flowable:deploy:remove")
|
||||
@Log(title = "流程部署", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{definitionIds}")
|
||||
public AjaxResult remove(@PathVariable String[] definitionIds)
|
||||
{
|
||||
return toAjax(flowableDeployService.deleteFlowableDeployByDefinitionIds(definitionIds));
|
||||
}
|
||||
/**
|
||||
* 查询流程部署版本列表
|
||||
*/
|
||||
@RequiresPermissions("flowable:deploy:publishList")
|
||||
@GetMapping("/publishList")
|
||||
public TableDataInfo publishList(@RequestParam String processKey) {
|
||||
startPage();
|
||||
|
||||
List<FlowableDeploy> list = flowableDeployService.queryPublishList(processKey);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 激活或挂起流程
|
||||
*
|
||||
* @param state 状态(active:激活 suspended:挂起)
|
||||
* @param definitionId 流程定义ID
|
||||
*/
|
||||
@RequiresPermissions("flowable:deploy:state")
|
||||
@PutMapping(value = "/changeState")
|
||||
public AjaxResult changeState(@RequestParam String state, @RequestParam String definitionId) {
|
||||
flowableDeployService.updateState(definitionId,state);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取xml文件
|
||||
* @param definitionId 流程定义ID
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("flowable:deploy:bpmnXml")
|
||||
@GetMapping("/bpmnXml/{definitionId}")
|
||||
public AjaxResult getBpmnXml(@PathVariable(value = "definitionId") String definitionId) {
|
||||
return AjaxResult.success("查询成功", flowableDeployService.queryBpmnXmlById(definitionId));
|
||||
}
|
||||
}
|
|
@ -1,109 +0,0 @@
|
|||
package com.yanzhu.flowable.controller;
|
||||
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
import com.yanzhu.flowable.domain.FlowableFieldDef;
|
||||
import com.yanzhu.flowable.service.IFlowableFieldDefService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程字段定义Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/def")
|
||||
public class FlowableFieldDefController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IFlowableFieldDefService flowableFieldDefService;
|
||||
|
||||
/**
|
||||
* 查询流程字段定义列表
|
||||
*/
|
||||
@RequiresPermissions("flowable:def:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(FlowableFieldDef flowableFieldDef)
|
||||
{
|
||||
startPage();
|
||||
List<FlowableFieldDef> list = flowableFieldDefService.selectFlowableFieldDefList(flowableFieldDef);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出流程字段定义列表
|
||||
*/
|
||||
@RequiresPermissions("flowable:def:export")
|
||||
@Log(title = "流程字段定义", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, FlowableFieldDef flowableFieldDef)
|
||||
{
|
||||
List<FlowableFieldDef> list = flowableFieldDefService.selectFlowableFieldDefList(flowableFieldDef);
|
||||
ExcelUtil<FlowableFieldDef> util = new ExcelUtil<FlowableFieldDef>(FlowableFieldDef.class);
|
||||
util.exportExcel(response, list, "流程字段定义数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程字段定义详细信息
|
||||
*/
|
||||
@RequiresPermissions("flowable:def:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(flowableFieldDefService.selectFlowableFieldDefById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程字段定义
|
||||
*/
|
||||
@RequiresPermissions("flowable:def:add")
|
||||
@Log(title = "流程字段定义", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody FlowableFieldDef flowableFieldDef)
|
||||
{
|
||||
return toAjax(flowableFieldDefService.insertFlowableFieldDef(flowableFieldDef));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程字段定义
|
||||
*/
|
||||
@RequiresPermissions("flowable:def:edit")
|
||||
@Log(title = "流程字段定义", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody FlowableFieldDef flowableFieldDef)
|
||||
{
|
||||
return toAjax(flowableFieldDefService.updateFlowableFieldDef(flowableFieldDef));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程字段定义
|
||||
*/
|
||||
@RequiresPermissions("flowable:def:remove")
|
||||
@Log(title = "流程字段定义", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(flowableFieldDefService.deleteFlowableFieldDefByIds(ids));
|
||||
}
|
||||
/**
|
||||
* 查询流程字段定义列表(不翻页)
|
||||
*/
|
||||
@RequiresPermissions("flowable:def:listAll")
|
||||
@GetMapping("/listAll")
|
||||
public AjaxResult listAll(FlowableFieldDef flowableFieldDef)
|
||||
{
|
||||
List<FlowableFieldDef> list = flowableFieldDefService.selectFlowableFieldDefList(flowableFieldDef);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,113 +0,0 @@
|
|||
package com.yanzhu.flowable.controller;
|
||||
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
import com.yanzhu.flowable.domain.FlowableFieldDef;
|
||||
import com.yanzhu.flowable.domain.FlowableFieldRef;
|
||||
import com.yanzhu.flowable.domain.FlowableFieldSearch;
|
||||
import com.yanzhu.flowable.service.IFlowableFieldDefService;
|
||||
import com.yanzhu.flowable.service.IFlowableFieldRefService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程字段引用关系Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ref")
|
||||
public class FlowableFieldRefController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IFlowableFieldRefService flowableFieldRefService;
|
||||
|
||||
@Autowired
|
||||
private IFlowableFieldDefService flowableFieldDefService;
|
||||
/**
|
||||
* 查询流程字段引用关系列表
|
||||
*/
|
||||
@RequiresPermissions("flowable:ref:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(FlowableFieldRef flowableFieldRef)
|
||||
{
|
||||
startPage();
|
||||
List<FlowableFieldRef> list = flowableFieldRefService.selectFlowableFieldRefList(flowableFieldRef);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出流程字段引用关系列表
|
||||
*/
|
||||
@RequiresPermissions("flowable:ref:export")
|
||||
@Log(title = "流程字段引用关系", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, FlowableFieldRef flowableFieldRef)
|
||||
{
|
||||
List<FlowableFieldRef> list = flowableFieldRefService.selectFlowableFieldRefList(flowableFieldRef);
|
||||
ExcelUtil<FlowableFieldRef> util = new ExcelUtil<FlowableFieldRef>(FlowableFieldRef.class);
|
||||
util.exportExcel(response, list, "流程字段引用关系数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程字段引用关系详细信息
|
||||
*/
|
||||
@RequiresPermissions("flowable:ref:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(flowableFieldRefService.selectFlowableFieldRefById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程字段引用关系
|
||||
*/
|
||||
@RequiresPermissions("flowable:ref:add")
|
||||
@Log(title = "流程字段引用关系", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody FlowableFieldRef flowableFieldRef)
|
||||
{
|
||||
return toAjax(flowableFieldRefService.insertFlowableFieldRef(flowableFieldRef));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程字段引用关系
|
||||
*/
|
||||
@RequiresPermissions("flowable:ref:edit")
|
||||
@Log(title = "流程字段引用关系", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody FlowableFieldRef flowableFieldRef)
|
||||
{
|
||||
return toAjax(flowableFieldRefService.updateFlowableFieldRef(flowableFieldRef));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程字段引用关系
|
||||
*/
|
||||
@RequiresPermissions("flowable:ref:remove")
|
||||
@Log(title = "流程字段引用关系", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(flowableFieldRefService.deleteFlowableFieldRefByIds(ids));
|
||||
}
|
||||
/**
|
||||
* 查询流程字段引用关系列表(不翻页,关联字段定义表查询)
|
||||
*/
|
||||
@RequiresPermissions("flowable:ref:listCombination")
|
||||
@GetMapping("/listCombination")
|
||||
public AjaxResult listCombination(FlowableFieldSearch flowableFieldSearch)
|
||||
{
|
||||
List<FlowableFieldDef> list = flowableFieldDefService.listCombination(flowableFieldSearch);
|
||||
return success(list);
|
||||
}
|
||||
}
|
|
@ -1,172 +0,0 @@
|
|||
package com.yanzhu.flowable.controller;
|
||||
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
import com.yanzhu.flowable.domain.FlowableModel;
|
||||
import com.yanzhu.flowable.domain.bo.FlowableModelBo;
|
||||
import com.yanzhu.flowable.service.IFlowableModelService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程模型Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-11-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/model")
|
||||
@Slf4j
|
||||
public class FlowableModelController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IFlowableModelService flowableModelService;
|
||||
|
||||
/**
|
||||
* 查询流程模型列表
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_model:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(FlowableModelBo flowableModelBo)
|
||||
{
|
||||
startPage();
|
||||
List<FlowableModel> list = flowableModelService.selectFlowableModelList(flowableModelBo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出流程模型列表
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_model:export")
|
||||
@Log(title = "流程模型", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, FlowableModelBo flowableModel)
|
||||
{
|
||||
List<FlowableModel> list = flowableModelService.selectFlowableModelList(flowableModel);
|
||||
ExcelUtil<FlowableModel> util = new ExcelUtil<FlowableModel>(FlowableModel.class);
|
||||
util.exportExcel(response, list, "流程模型数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程模型详细信息
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_model:query")
|
||||
@GetMapping(value = "/{modelId}")
|
||||
public AjaxResult getInfo(@PathVariable("modelId") String modelId)
|
||||
{
|
||||
return success(flowableModelService.selectFlowableModelByModelId(modelId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程模型
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_model:add")
|
||||
@Log(title = "流程模型", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody FlowableModel flowableModel)
|
||||
{
|
||||
return toAjax(flowableModelService.insertFlowableModel(flowableModel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程模型
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_model:update")
|
||||
@Log(title = "流程模型", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody FlowableModel flowableModel)
|
||||
{
|
||||
return toAjax(flowableModelService.updateFlowableModel(flowableModel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程模型
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_model:delete")
|
||||
@Log(title = "流程模型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{modelIds}")
|
||||
public AjaxResult remove(@PathVariable String[] modelIds)
|
||||
{
|
||||
return toAjax(flowableModelService.deleteFlowableModelByModelIds(modelIds));
|
||||
}
|
||||
/**
|
||||
* 部署流程模型
|
||||
*
|
||||
* @param modelId 流程模型主键
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_model:deploy")
|
||||
@Log(title = "部署流程模型", businessType = BusinessType.OTHER)
|
||||
@PostMapping("/deploy")
|
||||
public AjaxResult deployModel(@RequestParam String modelId) {
|
||||
try {
|
||||
flowableModelService.deployModel(modelId);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
log.error("部署失败!",e);
|
||||
}
|
||||
return success();
|
||||
}
|
||||
/**
|
||||
* 获取流程表单详细信息
|
||||
*
|
||||
* @param modelId 模型id
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_model:queryXml")
|
||||
@GetMapping(value = "/getBpmnXml/{modelId}")
|
||||
public AjaxResult getBpmnXml(@NotNull(message = "主键不能为空") @PathVariable("modelId") String modelId) {
|
||||
try {
|
||||
return AjaxResult.success("查询成功",flowableModelService.queryBpmnXmlById(modelId));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
log.error("获取模型xml失败!模型id:"+modelId,e);
|
||||
return AjaxResult.error("获取模型xml失败!");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 查询流程模型版本历史列表
|
||||
*
|
||||
* @param modelBo 流程模型对象
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_model:historyList")
|
||||
@GetMapping("/historyList")
|
||||
public TableDataInfo historyList(FlowableModelBo modelBo) {
|
||||
startPage();
|
||||
List<FlowableModel> list = flowableModelService.historyList(modelBo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 保存(更新或插入新版本)流程模型
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_model::save")
|
||||
@PostMapping("/save")
|
||||
public AjaxResult save(@RequestBody FlowableModelBo modelBo) {
|
||||
flowableModelService.saveModel(modelBo);
|
||||
return success();
|
||||
}
|
||||
/**
|
||||
* 设为最新流程模型
|
||||
* @param modelId
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("flow:flow_model:lastest")
|
||||
@PostMapping("/latest/")
|
||||
public AjaxResult latest(@RequestParam String modelId) {
|
||||
try {
|
||||
flowableModelService.latestModel(modelId);
|
||||
return success();
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
log.error("设置最新版本失败!",e);
|
||||
return error("设置最新版本失败!");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,152 +0,0 @@
|
|||
package com.yanzhu.flowable.controller;
|
||||
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
import com.yanzhu.flowable.domain.FlowableModelPage;
|
||||
import com.yanzhu.flowable.service.IFlowableModelPageService;
|
||||
import io.jsonwebtoken.lang.Collections;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 建模页面绑定Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/page")
|
||||
public class FlowableModelPageController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IFlowableModelPageService flowableModelPageService;
|
||||
|
||||
/**
|
||||
* 查询建模页面绑定列表
|
||||
*/
|
||||
@RequiresPermissions("flowable:page:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(FlowableModelPage flowableModelPage)
|
||||
{
|
||||
startPage();
|
||||
List<FlowableModelPage> list = flowableModelPageService.selectFlowableModelPageList(flowableModelPage);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出建模页面绑定列表
|
||||
*/
|
||||
@RequiresPermissions("flowable:page:export")
|
||||
@Log(title = "建模页面绑定", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, FlowableModelPage flowableModelPage)
|
||||
{
|
||||
List<FlowableModelPage> list = flowableModelPageService.selectFlowableModelPageList(flowableModelPage);
|
||||
ExcelUtil<FlowableModelPage> util = new ExcelUtil<FlowableModelPage>(FlowableModelPage.class);
|
||||
util.exportExcel(response, list, "建模页面绑定数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取建模页面绑定详细信息
|
||||
*/
|
||||
@RequiresPermissions("flowable:page:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(flowableModelPageService.selectFlowableModelPageById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增建模页面绑定
|
||||
*/
|
||||
@RequiresPermissions("flowable:page:add")
|
||||
@Log(title = "建模页面绑定", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody FlowableModelPage flowableModelPage)
|
||||
{
|
||||
return toAjax(flowableModelPageService.insertFlowableModelPage(flowableModelPage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改建模页面绑定
|
||||
*/
|
||||
@RequiresPermissions("flowable:page:edit")
|
||||
@Log(title = "建模页面绑定", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody FlowableModelPage flowableModelPage)
|
||||
{
|
||||
return toAjax(flowableModelPageService.updateFlowableModelPage(flowableModelPage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除建模页面绑定
|
||||
*/
|
||||
@RequiresPermissions("flowable:page:remove")
|
||||
@Log(title = "建模页面绑定", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(flowableModelPageService.deleteFlowableModelPageByIds(ids));
|
||||
}
|
||||
/**
|
||||
* 建模页面绑定
|
||||
*/
|
||||
@RequiresPermissions("flowable:page:bind")
|
||||
@Log(title = "建模页面绑定", businessType = BusinessType.UPDATE)
|
||||
@PutMapping(value="/bind")
|
||||
public AjaxResult bind(@RequestBody FlowableModelPage flowableModelPage)
|
||||
{
|
||||
List<FlowableModelPage> list = flowableModelPageService.selectFlowableModelPageListByBind(flowableModelPage);
|
||||
if(Collections.isEmpty(list)){
|
||||
return toAjax(flowableModelPageService.insertFlowableModelPage(flowableModelPage));
|
||||
}else {
|
||||
flowableModelPage.setId(list.get(0).getId());
|
||||
return toAjax(flowableModelPageService.updateFlowableModelPage(flowableModelPage));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 建模页面单页面查询(根据模块,流程标识,页面名称查询)
|
||||
*/
|
||||
@RequiresPermissions("flowable:page:findPage")
|
||||
@Log(title = "建模页面单页面查询", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value="/findPage")
|
||||
public AjaxResult findPage(@RequestBody FlowableModelPage flowableModelPage)
|
||||
{
|
||||
FlowableModelPage page = flowableModelPageService.selectFlowableModelPageSingle(flowableModelPage);
|
||||
return success(page);
|
||||
}
|
||||
/**
|
||||
* 建模页面模块页面查询(按模块,流程标识查询)
|
||||
*/
|
||||
@RequiresPermissions("flowable:page:findModulePage")
|
||||
@Log(title = "建模页面模块页面查询", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value="/findModulePage")
|
||||
public AjaxResult findModulePage(@RequestBody FlowableModelPage flowableModelPage)
|
||||
{
|
||||
List<FlowableModelPage> list = flowableModelPageService.selectFlowableModelPage(flowableModelPage);
|
||||
return success(list);
|
||||
}
|
||||
/**
|
||||
* 建模页面解绑
|
||||
*/
|
||||
@RequiresPermissions("flowable:page:unbind")
|
||||
@Log(title = "建模页面解绑", businessType = BusinessType.UPDATE)
|
||||
@PutMapping(value="/unbind")
|
||||
public AjaxResult unbind(@RequestBody FlowableModelPage flowableModelPage)
|
||||
{
|
||||
List<FlowableModelPage> list = flowableModelPageService.selectFlowableModelPageListByBind(flowableModelPage);
|
||||
if(Collections.isEmpty(list)){
|
||||
return error("页面没找到!");
|
||||
}else {
|
||||
return toAjax(flowableModelPageService.deleteFlowableModelPageById(list.get(0).getId()));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package com.yanzhu.flowable.controller;
|
||||
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
import com.yanzhu.flowable.domain.SysExpression;
|
||||
import com.yanzhu.flowable.service.ISysExpressionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程达式Controller
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2022-12-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/expression")
|
||||
public class SysExpressionController extends BaseController {
|
||||
@Autowired
|
||||
private ISysExpressionService sysExpressionService;
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 查询流程达式列表
|
||||
*/
|
||||
@RequiresPermissions("system:expression:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysExpression sysExpression) {
|
||||
startPage();
|
||||
List<SysExpression> list = sysExpressionService.selectSysExpressionList(sysExpression);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出流程达式列表
|
||||
*/
|
||||
@RequiresPermissions("system:expression:export")
|
||||
@Log(title = "流程达式", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysExpression sysExpression) {
|
||||
List<SysExpression> list = sysExpressionService.selectSysExpressionList(sysExpression);
|
||||
ExcelUtil<SysExpression> util = new ExcelUtil<SysExpression>(SysExpression.class);
|
||||
util.exportExcel(response, list, "流程达式数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程达式详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:expression:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(sysExpressionService.selectSysExpressionById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程达式
|
||||
*/
|
||||
@RequiresPermissions("system:expression:add")
|
||||
@Log(title = "流程达式", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysExpression sysExpression) {
|
||||
return toAjax(sysExpressionService.insertSysExpression(sysExpression));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程达式
|
||||
*/
|
||||
@RequiresPermissions("system:expression:edit")
|
||||
@Log(title = "流程达式", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysExpression sysExpression) {
|
||||
return toAjax(sysExpressionService.updateSysExpression(sysExpression));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程达式
|
||||
*/
|
||||
@RequiresPermissions("system:expression:remove")
|
||||
@Log(title = "流程达式", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(sysExpressionService.deleteSysExpressionByIds(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,112 @@
|
|||
package com.yanzhu.flowable.controller;
|
||||
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
import com.yanzhu.flowable.domain.SysDeployForm;
|
||||
import com.yanzhu.flowable.domain.SysForm;
|
||||
import com.yanzhu.flowable.service.ISysDeployFormService;
|
||||
import com.yanzhu.flowable.service.ISysFormService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程表单Controller
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/form")
|
||||
public class SysFormController extends BaseController {
|
||||
@Autowired
|
||||
private ISysFormService SysFormService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeployFormService sysDeployFormService;
|
||||
|
||||
/**
|
||||
* 查询流程表单列表
|
||||
*/
|
||||
@RequiresPermissions("flowable:form:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysForm sysForm) {
|
||||
startPage();
|
||||
List<SysForm> list = SysFormService.selectSysFormList(sysForm);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/formList")
|
||||
public AjaxResult formList(SysForm sysForm) {
|
||||
List<SysForm> list = SysFormService.selectSysFormList(sysForm);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出流程表单列表
|
||||
*/
|
||||
@RequiresPermissions("flowable:form:export")
|
||||
@Log(title = "流程表单", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public void export(HttpServletResponse response, SysForm sysForm) {
|
||||
List<SysForm> list = SysFormService.selectSysFormList(sysForm);
|
||||
ExcelUtil<SysForm> util = new ExcelUtil<>(SysForm.class);
|
||||
util.exportExcel(response, list, "form");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程表单详细信息
|
||||
*/
|
||||
@RequiresPermissions("flowable:form:query")
|
||||
@GetMapping(value = "/{formId}")
|
||||
public AjaxResult getInfo(@PathVariable("formId") Long formId) {
|
||||
return AjaxResult.success(SysFormService.selectSysFormById(formId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程表单
|
||||
*/
|
||||
@RequiresPermissions("flowable:form:add")
|
||||
@Log(title = "流程表单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysForm sysForm) {
|
||||
return toAjax(SysFormService.insertSysForm(sysForm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程表单
|
||||
*/
|
||||
@RequiresPermissions("flowable:form:edit")
|
||||
@Log(title = "流程表单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysForm sysForm) {
|
||||
return toAjax(SysFormService.updateSysForm(sysForm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程表单
|
||||
*/
|
||||
@RequiresPermissions("flowable:form:remove")
|
||||
@Log(title = "流程表单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{formIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] formIds) {
|
||||
return toAjax(SysFormService.deleteSysFormByIds(formIds));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 挂载流程表单
|
||||
*/
|
||||
@Log(title = "流程表单", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/addDeployForm")
|
||||
public AjaxResult addDeployForm(@RequestBody SysDeployForm sysDeployForm) {
|
||||
return toAjax(sysDeployFormService.insertSysDeployForm(sysDeployForm));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package com.yanzhu.flowable.controller;
|
||||
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
import com.yanzhu.flowable.domain.SysListener;
|
||||
import com.yanzhu.flowable.service.ISysListenerService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程监听Controller
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2022-12-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/listener")
|
||||
public class SysListenerController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISysListenerService sysListenerService;
|
||||
|
||||
/**
|
||||
* 查询流程监听列表
|
||||
*/
|
||||
@RequiresPermissions("system:listener:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysListener sysListener)
|
||||
{
|
||||
startPage();
|
||||
List<SysListener> list = sysListenerService.selectSysListenerList(sysListener);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出流程监听列表
|
||||
*/
|
||||
@RequiresPermissions("system:listener:export")
|
||||
@Log(title = "流程监听", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysListener sysListener)
|
||||
{
|
||||
List<SysListener> list = sysListenerService.selectSysListenerList(sysListener);
|
||||
ExcelUtil<SysListener> util = new ExcelUtil<SysListener>(SysListener.class);
|
||||
util.exportExcel(response, list, "流程监听数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程监听详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:listener:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(sysListenerService.selectSysListenerById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程监听
|
||||
*/
|
||||
@RequiresPermissions("system:listener:add")
|
||||
@Log(title = "流程监听", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysListener sysListener)
|
||||
{
|
||||
return toAjax(sysListenerService.insertSysListener(sysListener));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程监听
|
||||
*/
|
||||
@RequiresPermissions("system:listener:edit")
|
||||
@Log(title = "流程监听", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysListener sysListener)
|
||||
{
|
||||
return toAjax(sysListenerService.updateSysListener(sysListener));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程监听
|
||||
*/
|
||||
@RequiresPermissions("system:listener:remove")
|
||||
@Log(title = "流程监听", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(sysListenerService.deleteSysListenerByIds(ids));
|
||||
}
|
||||
}
|
|
@ -135,6 +135,7 @@ public class CustomProcessDiagramCanvas extends DefaultProcessDiagramCanvas {
|
|||
SHELL_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/shellTask.png", this.customClassLoader));
|
||||
DMN_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/dmnTask.png", this.customClassLoader));
|
||||
CAMEL_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/camelTask.png", this.customClassLoader));
|
||||
MULE_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/muleTask.png", this.customClassLoader));
|
||||
HTTP_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/httpTask.png", this.customClassLoader));
|
||||
TIMER_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/timer.png", this.customClassLoader));
|
||||
COMPENSATE_THROW_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/compensate-throw.png", this.customClassLoader));
|
||||
|
|
|
@ -159,13 +159,13 @@ public class FindNextNodeUtil {
|
|||
/**
|
||||
* 判断是否是多实例子流程并且需要设置集合类型变量
|
||||
*/
|
||||
public static boolean checkSubProcess(String Id, Collection<FlowElement> flowElements, List<UserTask> nextUser) {
|
||||
public static boolean checkSubProcess(String id, Collection<FlowElement> flowElements, List<UserTask> nextUser) {
|
||||
for (FlowElement flowElement1 : flowElements) {
|
||||
if (flowElement1 instanceof SubProcess && flowElement1.getId().equals(Id)) {
|
||||
if (flowElement1 instanceof SubProcess && flowElement1.getId().equals(id)) {
|
||||
|
||||
SubProcess sp = (SubProcess) flowElement1;
|
||||
if (sp.getLoopCharacteristics() != null) {
|
||||
String inputDataItem = sp.getLoopCharacteristics().getInputDataItem();
|
||||
// String inputDataItem = sp.getLoopCharacteristics().getInputDataItem();
|
||||
UserTask userTask = new UserTask();
|
||||
userTask.setId(sp.getId());
|
||||
userTask.setLoopCharacteristics(sp.getLoopCharacteristics());
|
||||
|
@ -251,7 +251,7 @@ public class FindNextNodeUtil {
|
|||
*/
|
||||
public static boolean expressionResult(Map<String, Object> map, String expression) {
|
||||
Expression exp = AviatorEvaluator.compile(expression);
|
||||
final Object execute = exp.execute(map);
|
||||
return Boolean.parseBoolean(String.valueOf(execute));
|
||||
return (Boolean)exp.execute(map);
|
||||
// return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,143 +0,0 @@
|
|||
package com.yanzhu.flowable.flow;
|
||||
|
||||
import org.flowable.bpmn.converter.BpmnXMLConverter;
|
||||
import org.flowable.bpmn.model.Process;
|
||||
import org.flowable.bpmn.model.*;
|
||||
import org.flowable.common.engine.impl.util.io.StringStreamSource;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author ruoyi
|
||||
* @createTime 2023/11/29 19:04
|
||||
*/
|
||||
public class ModelHelper {
|
||||
|
||||
private static final BpmnXMLConverter bpmnXMLConverter = new BpmnXMLConverter();
|
||||
|
||||
/**
|
||||
* xml转bpmnModel对象
|
||||
*
|
||||
* @param xml xml
|
||||
* @return bpmnModel对象
|
||||
*/
|
||||
public static BpmnModel getBpmnModel(String xml) {
|
||||
return bpmnXMLConverter.convertToBpmnModel(new StringStreamSource(xml), false, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* bpmnModel转xml对象
|
||||
*
|
||||
* @param bpmnModel bpmnModel对象
|
||||
* @return xml
|
||||
*/
|
||||
public static byte[] getBpmnXml(BpmnModel bpmnModel) {
|
||||
return bpmnXMLConverter.convertToXML(bpmnModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取开始节点
|
||||
*
|
||||
* @param model bpmnModel对象
|
||||
* @return 开始节点(未找到开始节点,返回null)
|
||||
*/
|
||||
public static StartEvent getStartEvent(BpmnModel model) {
|
||||
Process process = model.getMainProcess();
|
||||
FlowElement startElement = process.getInitialFlowElement();
|
||||
if (startElement instanceof StartEvent) {
|
||||
return (StartEvent) startElement;
|
||||
}
|
||||
return getStartEvent(process.getFlowElements());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取开始节点
|
||||
*
|
||||
* @param flowElements 流程元素集合
|
||||
* @return 开始节点(未找到开始节点,返回null)
|
||||
*/
|
||||
public static StartEvent getStartEvent(Collection<FlowElement> flowElements) {
|
||||
for (FlowElement flowElement : flowElements) {
|
||||
if (flowElement instanceof StartEvent) {
|
||||
return (StartEvent) flowElement;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取结束节点
|
||||
*
|
||||
* @param model bpmnModel对象
|
||||
* @return 结束节点(未找到开始节点,返回null)
|
||||
*/
|
||||
public static EndEvent getEndEvent(BpmnModel model) {
|
||||
Process process = model.getMainProcess();
|
||||
return getEndEvent(process.getFlowElements());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取结束节点
|
||||
*
|
||||
* @param flowElements 流程元素集合
|
||||
* @return 结束节点(未找到开始节点,返回null)
|
||||
*/
|
||||
public static EndEvent getEndEvent(Collection<FlowElement> flowElements) {
|
||||
for (FlowElement flowElement : flowElements) {
|
||||
if (flowElement instanceof EndEvent) {
|
||||
return (EndEvent) flowElement;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static UserTask getUserTaskByKey(BpmnModel model, String taskKey) {
|
||||
Process process = model.getMainProcess();
|
||||
FlowElement flowElement = process.getFlowElement(taskKey);
|
||||
if (flowElement instanceof UserTask) {
|
||||
return (UserTask) flowElement;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isMultiInstance(BpmnModel model, String taskKey) {
|
||||
UserTask userTask = getUserTaskByKey(model, taskKey);
|
||||
if (userTask==null) {
|
||||
return userTask.hasMultiInstanceLoopCharacteristics();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有用户任务节点
|
||||
*
|
||||
* @param model bpmnModel对象
|
||||
* @return 用户任务节点列表
|
||||
*/
|
||||
public static Collection<UserTask> getAllUserTaskEvent(BpmnModel model) {
|
||||
Process process = model.getMainProcess();
|
||||
Collection<FlowElement> flowElements = process.getFlowElements();
|
||||
return getAllUserTaskEvent(flowElements, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有用户任务节点
|
||||
* @param flowElements 流程元素集合
|
||||
* @param allElements 所有流程元素集合
|
||||
* @return 用户任务节点列表
|
||||
*/
|
||||
public static Collection<UserTask> getAllUserTaskEvent(Collection<FlowElement> flowElements, Collection<UserTask> allElements) {
|
||||
allElements = allElements == null ? new ArrayList<>() : allElements;
|
||||
for (FlowElement flowElement : flowElements) {
|
||||
if (flowElement instanceof UserTask) {
|
||||
allElements.add((UserTask) flowElement);
|
||||
}
|
||||
if (flowElement instanceof SubProcess) {
|
||||
// 继续深入子流程,进一步获取子流程
|
||||
allElements = getAllUserTaskEvent(((SubProcess) flowElement).getFlowElements(), allElements);
|
||||
}
|
||||
}
|
||||
return allElements;
|
||||
}
|
||||
}
|
|
@ -1,372 +0,0 @@
|
|||
package com.yanzhu.flowable.flow;
|
||||
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import org.flowable.bpmn.converter.BpmnXMLConverter;
|
||||
import org.flowable.bpmn.model.*;
|
||||
import org.flowable.bpmn.model.Process;
|
||||
import org.flowable.common.engine.impl.util.io.StringStreamSource;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author KonBAI
|
||||
* @createTime 2022/3/26 19:04
|
||||
*/
|
||||
public class ModelUtils {
|
||||
|
||||
private static final BpmnXMLConverter bpmnXMLConverter = new BpmnXMLConverter();
|
||||
|
||||
/**
|
||||
* xml转bpmnModel对象
|
||||
*
|
||||
* @param xml xml
|
||||
* @return bpmnModel对象
|
||||
*/
|
||||
public static BpmnModel getBpmnModel(String xml) {
|
||||
return bpmnXMLConverter.convertToBpmnModel(new StringStreamSource(xml), false, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* bpmnModel转xml字符串
|
||||
*
|
||||
* @deprecated 存在会丢失 bpmn 连线问题
|
||||
* @param bpmnModel bpmnModel对象
|
||||
* @return xml字符串
|
||||
*/
|
||||
@Deprecated
|
||||
public static String getBpmnXmlStr(BpmnModel bpmnModel) {
|
||||
return StringUtils.utf8Str(getBpmnXml(bpmnModel));
|
||||
}
|
||||
|
||||
/**
|
||||
* bpmnModel转xml对象
|
||||
*
|
||||
* @deprecated 存在丢失 bpmn 连线问题
|
||||
* @param bpmnModel bpmnModel对象
|
||||
* @return xml
|
||||
*/
|
||||
@Deprecated
|
||||
public static byte[] getBpmnXml(BpmnModel bpmnModel) {
|
||||
return bpmnXMLConverter.convertToXML(bpmnModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据节点,获取入口连线
|
||||
*
|
||||
* @param source 起始节点
|
||||
* @return 入口连线列表
|
||||
*/
|
||||
public static List<SequenceFlow> getElementIncomingFlows(FlowElement source) {
|
||||
List<SequenceFlow> sequenceFlows = new ArrayList<>();
|
||||
if (source instanceof FlowNode) {
|
||||
sequenceFlows = ((FlowNode) source).getIncomingFlows();
|
||||
}
|
||||
return sequenceFlows;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据节点,获取出口连线
|
||||
*
|
||||
* @param source 起始节点
|
||||
* @return 出口连线列表
|
||||
*/
|
||||
public static List<SequenceFlow> getElementOutgoingFlows(FlowElement source) {
|
||||
List<SequenceFlow> sequenceFlows = new ArrayList<>();
|
||||
if (source instanceof FlowNode) {
|
||||
sequenceFlows = ((FlowNode) source).getOutgoingFlows();
|
||||
}
|
||||
return sequenceFlows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取开始节点
|
||||
*
|
||||
* @param model bpmnModel对象
|
||||
* @return 开始节点(未找到开始节点,返回null)
|
||||
*/
|
||||
public static StartEvent getStartEvent(BpmnModel model) {
|
||||
Process process = model.getMainProcess();
|
||||
FlowElement startElement = process.getInitialFlowElement();
|
||||
if (startElement instanceof StartEvent) {
|
||||
return (StartEvent) startElement;
|
||||
}
|
||||
return getStartEvent(process.getFlowElements());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取开始节点
|
||||
*
|
||||
* @param flowElements 流程元素集合
|
||||
* @return 开始节点(未找到开始节点,返回null)
|
||||
*/
|
||||
public static StartEvent getStartEvent(Collection<FlowElement> flowElements) {
|
||||
for (FlowElement flowElement : flowElements) {
|
||||
if (flowElement instanceof StartEvent) {
|
||||
return (StartEvent) flowElement;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取结束节点
|
||||
*
|
||||
* @param model bpmnModel对象
|
||||
* @return 结束节点(未找到开始节点,返回null)
|
||||
*/
|
||||
public static EndEvent getEndEvent(BpmnModel model) {
|
||||
Process process = model.getMainProcess();
|
||||
return getEndEvent(process.getFlowElements());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取结束节点
|
||||
*
|
||||
* @param flowElements 流程元素集合
|
||||
* @return 结束节点(未找到开始节点,返回null)
|
||||
*/
|
||||
public static EndEvent getEndEvent(Collection<FlowElement> flowElements) {
|
||||
for (FlowElement flowElement : flowElements) {
|
||||
if (flowElement instanceof EndEvent) {
|
||||
return (EndEvent) flowElement;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static UserTask getUserTaskByKey(BpmnModel model, String taskKey) {
|
||||
Process process = model.getMainProcess();
|
||||
FlowElement flowElement = process.getFlowElement(taskKey);
|
||||
if (flowElement instanceof UserTask) {
|
||||
return (UserTask) flowElement;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程元素信息
|
||||
*
|
||||
* @param model bpmnModel对象
|
||||
* @param flowElementId 元素ID
|
||||
* @return 元素信息
|
||||
*/
|
||||
public static FlowElement getFlowElementById(BpmnModel model, String flowElementId) {
|
||||
Process process = model.getMainProcess();
|
||||
return process.getFlowElement(flowElementId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取元素表单Key(限开始节点和用户节点可用)
|
||||
*
|
||||
* @param flowElement 元素
|
||||
* @return 表单Key
|
||||
*/
|
||||
public static String getFormKey(FlowElement flowElement) {
|
||||
if (flowElement != null) {
|
||||
if (flowElement instanceof StartEvent) {
|
||||
return ((StartEvent) flowElement).getFormKey();
|
||||
} else if (flowElement instanceof UserTask) {
|
||||
return ((UserTask) flowElement).getFormKey();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取开始节点属性值
|
||||
* @param model bpmnModel对象
|
||||
* @param name 属性名
|
||||
* @return 属性值
|
||||
*/
|
||||
public static String getStartEventAttributeValue(BpmnModel model, String name) {
|
||||
StartEvent startEvent = getStartEvent(model);
|
||||
return getElementAttributeValue(startEvent, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取结束节点属性值
|
||||
* @param model bpmnModel对象
|
||||
* @param name 属性名
|
||||
* @return 属性值
|
||||
*/
|
||||
public static String getEndEventAttributeValue(BpmnModel model, String name) {
|
||||
EndEvent endEvent = getEndEvent(model);
|
||||
return getElementAttributeValue(endEvent, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户任务节点属性值
|
||||
* @param model bpmnModel对象
|
||||
* @param taskKey 任务Key
|
||||
* @param name 属性名
|
||||
* @return 属性值
|
||||
*/
|
||||
public static String getUserTaskAttributeValue(BpmnModel model, String taskKey, String name) {
|
||||
UserTask userTask = getUserTaskByKey(model, taskKey);
|
||||
return getElementAttributeValue(userTask, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取元素属性值
|
||||
* @param baseElement 流程元素
|
||||
* @param name 属性名
|
||||
* @return 属性值
|
||||
*/
|
||||
public static String getElementAttributeValue(BaseElement baseElement, String name) {
|
||||
if (baseElement != null) {
|
||||
List<ExtensionAttribute> attributes = baseElement.getAttributes().get(name);
|
||||
if (attributes != null && !attributes.isEmpty()) {
|
||||
attributes.iterator().next().getValue();
|
||||
Iterator<ExtensionAttribute> attrIterator = attributes.iterator();
|
||||
if(attrIterator.hasNext()) {
|
||||
ExtensionAttribute attribute = attrIterator.next();
|
||||
return attribute.getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isMultiInstance(BpmnModel model, String taskKey) {
|
||||
UserTask userTask = getUserTaskByKey(model, taskKey);
|
||||
if (!Objects.isNull(userTask)) {
|
||||
return userTask.hasMultiInstanceLoopCharacteristics();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有用户任务节点
|
||||
*
|
||||
* @param model bpmnModel对象
|
||||
* @return 用户任务节点列表
|
||||
*/
|
||||
public static Collection<UserTask> getAllUserTaskEvent(BpmnModel model) {
|
||||
Process process = model.getMainProcess();
|
||||
Collection<FlowElement> flowElements = process.getFlowElements();
|
||||
return getAllUserTaskEvent(flowElements, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有用户任务节点
|
||||
* @param flowElements 流程元素集合
|
||||
* @param allElements 所有流程元素集合
|
||||
* @return 用户任务节点列表
|
||||
*/
|
||||
public static Collection<UserTask> getAllUserTaskEvent(Collection<FlowElement> flowElements, Collection<UserTask> allElements) {
|
||||
allElements = allElements == null ? new ArrayList<>() : allElements;
|
||||
for (FlowElement flowElement : flowElements) {
|
||||
if (flowElement instanceof UserTask) {
|
||||
allElements.add((UserTask) flowElement);
|
||||
}
|
||||
if (flowElement instanceof SubProcess) {
|
||||
// 继续深入子流程,进一步获取子流程
|
||||
allElements = getAllUserTaskEvent(((SubProcess) flowElement).getFlowElements(), allElements);
|
||||
}
|
||||
}
|
||||
return allElements;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找起始节点下一个用户任务列表列表
|
||||
* @param source 起始节点
|
||||
* @return 结果
|
||||
*/
|
||||
public static List<UserTask> findNextUserTasks(FlowElement source) {
|
||||
return findNextUserTasks(source, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找起始节点下一个用户任务列表列表
|
||||
* @param source 起始节点
|
||||
* @param hasSequenceFlow 已经经过的连线的 ID,用于判断线路是否重复
|
||||
* @param userTaskList 用户任务列表
|
||||
* @return 结果
|
||||
*/
|
||||
public static List<UserTask> findNextUserTasks(FlowElement source, Set<String> hasSequenceFlow, List<UserTask> userTaskList) {
|
||||
hasSequenceFlow = Optional.ofNullable(hasSequenceFlow).orElse(new HashSet<>());
|
||||
userTaskList = Optional.ofNullable(userTaskList).orElse(new ArrayList<>());
|
||||
// 获取出口连线
|
||||
List<SequenceFlow> sequenceFlows = getElementOutgoingFlows(source);
|
||||
if (!sequenceFlows.isEmpty()) {
|
||||
for (SequenceFlow sequenceFlow : sequenceFlows) {
|
||||
// 如果发现连线重复,说明循环了,跳过这个循环
|
||||
if (hasSequenceFlow.contains(sequenceFlow.getId())) {
|
||||
continue;
|
||||
}
|
||||
// 添加已经走过的连线
|
||||
hasSequenceFlow.add(sequenceFlow.getId());
|
||||
FlowElement targetFlowElement = sequenceFlow.getTargetFlowElement();
|
||||
if (targetFlowElement instanceof UserTask) {
|
||||
// 若节点为用户任务,加入到结果列表中
|
||||
userTaskList.add((UserTask) targetFlowElement);
|
||||
} else {
|
||||
// 若节点非用户任务,继续递归查找下一个节点
|
||||
findNextUserTasks(targetFlowElement, hasSequenceFlow, userTaskList);
|
||||
}
|
||||
}
|
||||
}
|
||||
return userTaskList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 迭代从后向前扫描,判断目标节点相对于当前节点是否是串行
|
||||
* 不存在直接回退到子流程中的情况,但存在从子流程出去到父流程情况
|
||||
* @param source 起始节点
|
||||
* @param target 目标节点
|
||||
* @param visitedElements 已经经过的连线的 ID,用于判断线路是否重复
|
||||
* @return 结果
|
||||
*/
|
||||
public static boolean isSequentialReachable(FlowElement source, FlowElement target, Set<String> visitedElements) {
|
||||
visitedElements = visitedElements == null ? new HashSet<>() : visitedElements;
|
||||
if (source instanceof StartEvent && isInEventSubprocess(source)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 根据类型,获取入口连线
|
||||
List<SequenceFlow> sequenceFlows = getElementIncomingFlows(source);
|
||||
if (sequenceFlows != null && sequenceFlows.size() > 0) {
|
||||
// 循环找到目标元素
|
||||
for (SequenceFlow sequenceFlow: sequenceFlows) {
|
||||
// 如果发现连线重复,说明循环了,跳过这个循环
|
||||
if (visitedElements.contains(sequenceFlow.getId())) {
|
||||
continue;
|
||||
}
|
||||
// 添加已经走过的连线
|
||||
visitedElements.add(sequenceFlow.getId());
|
||||
FlowElement sourceFlowElement = sequenceFlow.getSourceFlowElement();
|
||||
// 这条线路存在目标节点,这条线路完成,进入下个线路
|
||||
if (target.getId().equals(sourceFlowElement.getId())) {
|
||||
continue;
|
||||
}
|
||||
// 如果目标节点为并行网关,则不继续
|
||||
if (sourceFlowElement instanceof ParallelGateway) {
|
||||
return false;
|
||||
}
|
||||
// 否则就继续迭代
|
||||
boolean isSequential = isSequentialReachable(sourceFlowElement, target, visitedElements);
|
||||
if (!isSequential) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected static boolean isInEventSubprocess(FlowElement flowElement) {
|
||||
FlowElementsContainer flowElementsContainer = flowElement.getParentContainer();
|
||||
while (flowElementsContainer != null) {
|
||||
if (flowElementsContainer instanceof EventSubProcess) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (flowElementsContainer instanceof FlowElement) {
|
||||
flowElementsContainer = ((FlowElement) flowElementsContainer).getParentContainer();
|
||||
} else {
|
||||
flowElementsContainer = null;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.yanzhu.flowable.rpc;
|
||||
|
||||
import com.yanzhu.common.core.constant.SecurityConstants;
|
||||
import com.yanzhu.common.core.constant.ServiceNameConstants;
|
||||
import com.yanzhu.common.core.domain.R;
|
||||
import com.yanzhu.system.api.domain.SysRole;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* system rpc接口调用
|
||||
*/
|
||||
@FeignClient(value = ServiceNameConstants.SYSTEM_SERVICE)
|
||||
public interface IRemoteSystemService {
|
||||
|
||||
@GetMapping("/rpc/user/list")
|
||||
R<List<SysUser>> getUsers(@RequestParam Map<String, Object> paraMap, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@GetMapping("/rpc/user/{userId}")
|
||||
R<SysUser> getUserById(@PathVariable(value = "userId") Long userId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@GetMapping("/rpc/role/list")
|
||||
R<List<SysRole>> getRoles(@RequestParam Map<String, Object> paraMap, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
@GetMapping("/rpc/role/{roleId}")
|
||||
R<SysRole> getRoleById(@PathVariable(value = "roleId") Long userId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package com.yanzhu.flowable.rpc;
|
||||
|
||||
import com.yanzhu.common.core.constant.SecurityConstants;
|
||||
import com.yanzhu.common.core.domain.R;
|
||||
import com.yanzhu.common.core.exception.ServiceException;
|
||||
import com.yanzhu.common.core.utils.bean.BeanUtils;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import com.yanzhu.system.api.domain.SysRole;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class RemoteSystemService {
|
||||
|
||||
@Autowired
|
||||
private IRemoteSystemService remoteSystemService;
|
||||
|
||||
private <T> List<T> resultToList(R<List<T>> dataResult) {
|
||||
if (R.FAIL == dataResult.getCode()) {
|
||||
throw new ServiceException(dataResult.getMsg());
|
||||
}
|
||||
return dataResult.getData();
|
||||
}
|
||||
|
||||
private <T> T resultToBean(R<T> dataResult) {
|
||||
if (R.FAIL == dataResult.getCode()) {
|
||||
throw new ServiceException(dataResult.getMsg());
|
||||
}
|
||||
return dataResult.getData();
|
||||
}
|
||||
|
||||
public List<SysUser> getUsers(SysUser sysUser) {
|
||||
//远程调用system接口获取所有电站信息
|
||||
R<List<SysUser>> dataResult = remoteSystemService.getUsers(beanToMap(sysUser), SecurityConstants.INNER);
|
||||
return resultToList(dataResult);
|
||||
}
|
||||
|
||||
public List<SysRole> getRoles(SysRole sysRole) {
|
||||
//远程调用system接口获取所有电站信息
|
||||
R<List<SysRole>> dataResult = remoteSystemService.getRoles(beanToMap(sysRole), SecurityConstants.INNER);
|
||||
return resultToList(dataResult);
|
||||
}
|
||||
|
||||
private Map<String, Object> beanToMap(Object obj) {
|
||||
try {
|
||||
Map<String, Object> paraMap = BeanUtils.beanToMap(obj);
|
||||
if (obj instanceof BaseEntity) {
|
||||
paraMap.remove("params");
|
||||
}
|
||||
return paraMap;
|
||||
}catch (Exception e){
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public SysUser getUserById(Long userId) {
|
||||
//远程调用system接口获取所有电站信息
|
||||
R<SysUser> dataResult = remoteSystemService.getUserById(userId, SecurityConstants.INNER);
|
||||
return resultToBean(dataResult);
|
||||
}
|
||||
|
||||
public SysRole getRoleById(Long roleId) {
|
||||
//远程调用system接口获取所有电站信息
|
||||
R<SysRole> dataResult = remoteSystemService.getRoleById(roleId, SecurityConstants.INNER);
|
||||
return resultToBean(dataResult);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.flowable.domain.dto.FlowProcDefDto;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Tony
|
||||
* @date 2021-04-03 14:41
|
||||
*/
|
||||
public interface IFlowDefinitionService {
|
||||
|
||||
boolean exist(String processDefinitionKey);
|
||||
|
||||
|
||||
/**
|
||||
* 流程定义列表
|
||||
*
|
||||
* @return 流程定义分页列表数据
|
||||
*/
|
||||
List<FlowProcDefDto> list(String name);
|
||||
|
||||
/**
|
||||
* 导入流程文件
|
||||
* 当每个key的流程第一次部署时,指定版本为1。对其后所有使用相同key的流程定义,
|
||||
* 部署时版本会在该key当前已部署的最高版本号基础上加1。key参数用于区分流程定义
|
||||
* @param name
|
||||
* @param category
|
||||
* @param in
|
||||
*/
|
||||
void importFile(String name, String category, InputStream in);
|
||||
|
||||
/**
|
||||
* 读取xml
|
||||
* @param deployId
|
||||
* @return
|
||||
*/
|
||||
AjaxResult readXml(String deployId) throws IOException;
|
||||
|
||||
/**
|
||||
* 根据流程定义ID启动流程实例
|
||||
*
|
||||
* @param procDefId
|
||||
* @param variables
|
||||
* @return
|
||||
*/
|
||||
|
||||
AjaxResult startProcessInstanceById(String procDefId, Map<String, Object> variables);
|
||||
|
||||
|
||||
/**
|
||||
* 激活或挂起流程定义
|
||||
*
|
||||
* @param state 状态
|
||||
* @param deployId 流程部署ID
|
||||
*/
|
||||
void updateState(Integer state, String deployId);
|
||||
|
||||
|
||||
/**
|
||||
* 删除流程定义
|
||||
*
|
||||
* @param deployId 流程部署ID act_ge_bytearray 表中 deployment_id值
|
||||
*/
|
||||
void delete(String deployId);
|
||||
|
||||
|
||||
/**
|
||||
* 读取图片文件
|
||||
* @param deployId
|
||||
* @return
|
||||
*/
|
||||
InputStream readImage(String deployId);
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.flowable.domain.vo.FlowTaskVo;
|
||||
import org.flowable.engine.history.HistoricProcessInstance;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Tony
|
||||
* @date 2021-04-03 14:40
|
||||
*/
|
||||
public interface IFlowInstanceService {
|
||||
|
||||
/**
|
||||
* 结束流程实例
|
||||
*
|
||||
* @param vo
|
||||
*/
|
||||
void stopProcessInstance(FlowTaskVo vo);
|
||||
|
||||
/**
|
||||
* 激活或挂起流程实例
|
||||
*
|
||||
* @param state 状态
|
||||
* @param instanceId 流程实例ID
|
||||
*/
|
||||
void updateState(Integer state, String instanceId);
|
||||
|
||||
/**
|
||||
* 删除流程实例ID
|
||||
*
|
||||
* @param instanceId 流程实例ID
|
||||
* @param deleteReason 删除原因
|
||||
*/
|
||||
void delete(String instanceId, String deleteReason);
|
||||
|
||||
/**
|
||||
* 根据实例ID查询历史实例数据
|
||||
*
|
||||
* @param processInstanceId
|
||||
* @return
|
||||
*/
|
||||
HistoricProcessInstance getHistoricProcessInstanceById(String processInstanceId);
|
||||
|
||||
/**
|
||||
* 根据流程定义ID启动流程实例
|
||||
*
|
||||
* @param procDefId 流程定义Id
|
||||
* @param variables 流程变量
|
||||
* @return
|
||||
*/
|
||||
AjaxResult startProcessInstanceById(String procDefId, Map<String, Object> variables);
|
||||
}
|
|
@ -0,0 +1,217 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.flowable.domain.dto.FlowTaskDto;
|
||||
import com.yanzhu.flowable.domain.vo.FlowQueryVo;
|
||||
import com.yanzhu.flowable.domain.vo.FlowTaskVo;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* @author Tony
|
||||
* @date 2021-04-03 14:42
|
||||
*/
|
||||
public interface IFlowTaskService {
|
||||
|
||||
/**
|
||||
* 审批任务
|
||||
*
|
||||
* @param task 请求实体参数
|
||||
*/
|
||||
AjaxResult complete(FlowTaskVo task);
|
||||
|
||||
/**
|
||||
* 驳回任务
|
||||
*
|
||||
* @param flowTaskVo
|
||||
*/
|
||||
void taskReject(FlowTaskVo flowTaskVo);
|
||||
|
||||
|
||||
/**
|
||||
* 退回任务
|
||||
*
|
||||
* @param flowTaskVo 请求实体参数
|
||||
*/
|
||||
void taskReturn(FlowTaskVo flowTaskVo);
|
||||
|
||||
/**
|
||||
* 获取所有可回退的节点
|
||||
*
|
||||
* @param flowTaskVo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult findReturnTaskList(FlowTaskVo flowTaskVo);
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
*
|
||||
* @param flowTaskVo 请求实体参数
|
||||
*/
|
||||
void deleteTask(FlowTaskVo flowTaskVo);
|
||||
|
||||
/**
|
||||
* 认领/签收任务
|
||||
*
|
||||
* @param flowTaskVo 请求实体参数
|
||||
*/
|
||||
void claim(FlowTaskVo flowTaskVo);
|
||||
|
||||
/**
|
||||
* 取消认领/签收任务
|
||||
*
|
||||
* @param flowTaskVo 请求实体参数
|
||||
*/
|
||||
void unClaim(FlowTaskVo flowTaskVo);
|
||||
|
||||
/**
|
||||
* 委派任务
|
||||
*
|
||||
* @param flowTaskVo 请求实体参数
|
||||
*/
|
||||
void delegateTask(FlowTaskVo flowTaskVo);
|
||||
|
||||
/**
|
||||
* 任务归还
|
||||
*
|
||||
* @param flowTaskVo 请求实体参数
|
||||
*/
|
||||
void resolveTask(FlowTaskVo flowTaskVo);
|
||||
|
||||
|
||||
/**
|
||||
* 转办任务
|
||||
*
|
||||
* @param flowTaskVo 请求实体参数
|
||||
*/
|
||||
void assignTask(FlowTaskVo flowTaskVo);
|
||||
|
||||
|
||||
/**
|
||||
* 多实例加签
|
||||
* @param flowTaskVo
|
||||
*/
|
||||
void addMultiInstanceExecution(FlowTaskVo flowTaskVo);
|
||||
|
||||
/**
|
||||
* 多实例减签
|
||||
* @param flowTaskVo
|
||||
*/
|
||||
void deleteMultiInstanceExecution(FlowTaskVo flowTaskVo);
|
||||
|
||||
/**
|
||||
* 我发起的流程
|
||||
* @param queryVo 请求参数
|
||||
* @return
|
||||
*/
|
||||
PageInfo<FlowTaskDto> myProcess(FlowQueryVo queryVo);
|
||||
|
||||
/**
|
||||
* 取消申请
|
||||
* 目前实现方式: 直接将当前流程变更为已完成
|
||||
* @param flowTaskVo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult stopProcess(FlowTaskVo flowTaskVo);
|
||||
|
||||
/**
|
||||
* 撤回流程
|
||||
* @param flowTaskVo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult revokeProcess(FlowTaskVo flowTaskVo);
|
||||
|
||||
|
||||
/**
|
||||
* 代办任务列表
|
||||
*
|
||||
* @param queryVo 请求参数
|
||||
* @return
|
||||
*/
|
||||
PageInfo<FlowTaskDto> todoList(FlowQueryVo queryVo);
|
||||
|
||||
|
||||
/**
|
||||
* 已办任务列表
|
||||
*
|
||||
* @param queryVo 请求参数
|
||||
* @return
|
||||
*/
|
||||
PageInfo<FlowTaskDto> finishedList(FlowQueryVo queryVo);
|
||||
|
||||
/**
|
||||
* 流程历史流转记录
|
||||
*
|
||||
* @param procInsId 流程实例Id
|
||||
* @return
|
||||
*/
|
||||
AjaxResult flowRecord(String procInsId,String deployId);
|
||||
|
||||
/**
|
||||
* 根据任务ID查询挂载的表单信息
|
||||
*
|
||||
* @param taskId 任务Id
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getTaskForm(String taskId);
|
||||
|
||||
/**
|
||||
* 获取流程过程图
|
||||
* @param processId
|
||||
* @return
|
||||
*/
|
||||
InputStream diagram(String processId);
|
||||
|
||||
/**
|
||||
* 获取流程执行节点
|
||||
* @param procInsId
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getFlowViewer(String procInsId,String executionId);
|
||||
|
||||
/**
|
||||
* 获取流程变量
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
AjaxResult processVariables(String taskId);
|
||||
|
||||
/**
|
||||
* 获取下一节点
|
||||
* @param flowTaskVo 任务
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getNextFlowNode(FlowTaskVo flowTaskVo);
|
||||
|
||||
AjaxResult getNextFlowNodeByStart(FlowTaskVo flowTaskVo);
|
||||
|
||||
/**
|
||||
* 流程初始化表单
|
||||
* @param deployId
|
||||
* @return
|
||||
*/
|
||||
AjaxResult flowFormData(String deployId);
|
||||
|
||||
/**
|
||||
* 流程节点信息
|
||||
* @param procInsId
|
||||
* @return
|
||||
*/
|
||||
AjaxResult flowXmlAndNode(String procInsId,String deployId);
|
||||
|
||||
/**
|
||||
* 流程节点表单
|
||||
* @param taskId 流程任务编号
|
||||
* @return
|
||||
*/
|
||||
AjaxResult flowTaskForm(String taskId) throws Exception;
|
||||
|
||||
/**
|
||||
* 流程节点信息
|
||||
* @param procInsId
|
||||
* @param elementId
|
||||
* @return
|
||||
*/
|
||||
AjaxResult flowTaskInfo(String procInsId, String elementId);
|
||||
}
|
|
@ -1,69 +0,0 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.flowable.domain.FlowableCategory;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 流程分类Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-11-27
|
||||
*/
|
||||
public interface IFlowableCategoryService
|
||||
{
|
||||
/**
|
||||
* 查询流程分类
|
||||
*
|
||||
* @param id 流程分类主键
|
||||
* @return 流程分类
|
||||
*/
|
||||
public FlowableCategory selectFlowableCategoryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询流程分类列表
|
||||
*
|
||||
* @param flowableCategory 流程分类
|
||||
* @return 流程分类集合
|
||||
*/
|
||||
public List<FlowableCategory> selectFlowableCategoryList(FlowableCategory flowableCategory);
|
||||
|
||||
/**
|
||||
* 新增流程分类
|
||||
*
|
||||
* @param flowableCategory 流程分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFlowableCategory(FlowableCategory flowableCategory);
|
||||
|
||||
/**
|
||||
* 修改流程分类
|
||||
*
|
||||
* @param flowableCategory 流程分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFlowableCategory(FlowableCategory flowableCategory);
|
||||
|
||||
/**
|
||||
* 批量删除流程分类
|
||||
*
|
||||
* @param ids 需要删除的流程分类主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableCategoryByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除流程分类信息
|
||||
*
|
||||
* @param id 流程分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableCategoryById(Long id);
|
||||
|
||||
/**
|
||||
* 更新缓存
|
||||
* @param flowableCategories
|
||||
*/
|
||||
public Map<String,String> updateRedis(List<FlowableCategory> flowableCategories);
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.flowable.domain.FlowableDeploy;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程部署Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
public interface IFlowableDeployService
|
||||
{
|
||||
/**
|
||||
* 查询流程部署
|
||||
*
|
||||
* @param definitionId 流程部署主键
|
||||
* @return 流程部署
|
||||
*/
|
||||
public FlowableDeploy selectFlowableDeployByDefinitionId(String definitionId);
|
||||
|
||||
/**
|
||||
* 查询流程部署列表
|
||||
*
|
||||
* @param flowableDeploy 流程部署
|
||||
* @return 流程部署集合
|
||||
*/
|
||||
public List<FlowableDeploy> selectFlowableDeployList(FlowableDeploy flowableDeploy);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除流程部署
|
||||
*
|
||||
* @param definitionIds 需要删除的流程部署主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableDeployByDefinitionIds(String[] definitionIds);
|
||||
|
||||
/**
|
||||
* 删除流程部署信息
|
||||
*
|
||||
* @param definitionId 流程部署主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableDeployByDefinitionId(String definitionId);
|
||||
|
||||
/**
|
||||
* 查询所有部署的历史版本
|
||||
* @param processKey 流程key
|
||||
* @return
|
||||
*/
|
||||
public List<FlowableDeploy> queryPublishList(String processKey);
|
||||
|
||||
/**
|
||||
* 改变部署状态
|
||||
* @param definitionId
|
||||
* @param stateCode
|
||||
*/
|
||||
public void updateState(String definitionId, String stateCode);
|
||||
|
||||
/**
|
||||
* 查询流程图
|
||||
* @param definitionId
|
||||
* @return
|
||||
*/
|
||||
public String queryBpmnXmlById(String definitionId);
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.flowable.domain.FlowableFieldDef;
|
||||
import com.yanzhu.flowable.domain.FlowableFieldSearch;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程字段定义Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
public interface IFlowableFieldDefService
|
||||
{
|
||||
/**
|
||||
* 查询流程字段定义
|
||||
*
|
||||
* @param id 流程字段定义主键
|
||||
* @return 流程字段定义
|
||||
*/
|
||||
public FlowableFieldDef selectFlowableFieldDefById(String id);
|
||||
|
||||
/**
|
||||
* 查询流程字段定义列表
|
||||
*
|
||||
* @param flowableFieldDef 流程字段定义
|
||||
* @return 流程字段定义集合
|
||||
*/
|
||||
public List<FlowableFieldDef> selectFlowableFieldDefList(FlowableFieldDef flowableFieldDef);
|
||||
|
||||
/**
|
||||
* 新增流程字段定义
|
||||
*
|
||||
* @param flowableFieldDef 流程字段定义
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFlowableFieldDef(FlowableFieldDef flowableFieldDef);
|
||||
|
||||
/**
|
||||
* 修改流程字段定义
|
||||
*
|
||||
* @param flowableFieldDef 流程字段定义
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFlowableFieldDef(FlowableFieldDef flowableFieldDef);
|
||||
|
||||
/**
|
||||
* 批量删除流程字段定义
|
||||
*
|
||||
* @param ids 需要删除的流程字段定义主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableFieldDefByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除流程字段定义信息
|
||||
*
|
||||
* @param id 流程字段定义主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableFieldDefById(String id);
|
||||
|
||||
/**
|
||||
* 查询流程字段引用关系列表(不翻页,关联字段定义表查询)
|
||||
* @param flowableFieldSearch
|
||||
* @return
|
||||
*/
|
||||
List<FlowableFieldDef> listCombination(FlowableFieldSearch flowableFieldSearch);
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.flowable.domain.FlowableFieldRef;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程字段引用关系Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
public interface IFlowableFieldRefService
|
||||
{
|
||||
/**
|
||||
* 查询流程字段引用关系
|
||||
*
|
||||
* @param id 流程字段引用关系主键
|
||||
* @return 流程字段引用关系
|
||||
*/
|
||||
public FlowableFieldRef selectFlowableFieldRefById(String id);
|
||||
|
||||
/**
|
||||
* 查询流程字段引用关系列表
|
||||
*
|
||||
* @param flowableFieldRef 流程字段引用关系
|
||||
* @return 流程字段引用关系集合
|
||||
*/
|
||||
public List<FlowableFieldRef> selectFlowableFieldRefList(FlowableFieldRef flowableFieldRef);
|
||||
|
||||
/**
|
||||
* 新增流程字段引用关系
|
||||
*
|
||||
* @param flowableFieldRef 流程字段引用关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFlowableFieldRef(FlowableFieldRef flowableFieldRef);
|
||||
|
||||
/**
|
||||
* 修改流程字段引用关系
|
||||
*
|
||||
* @param flowableFieldRef 流程字段引用关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFlowableFieldRef(FlowableFieldRef flowableFieldRef);
|
||||
|
||||
/**
|
||||
* 批量删除流程字段引用关系
|
||||
*
|
||||
* @param ids 需要删除的流程字段引用关系主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableFieldRefByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除流程字段引用关系信息
|
||||
*
|
||||
* @param id 流程字段引用关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableFieldRefById(String id);
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.flowable.domain.FlowableModelPage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 建模页面绑定Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-25
|
||||
*/
|
||||
public interface IFlowableModelPageService
|
||||
{
|
||||
/**
|
||||
* 查询建模页面绑定
|
||||
*
|
||||
* @param id 建模页面绑定主键
|
||||
* @return 建模页面绑定
|
||||
*/
|
||||
public FlowableModelPage selectFlowableModelPageById(String id);
|
||||
|
||||
/**
|
||||
* 查询建模页面绑定列表
|
||||
*
|
||||
* @param flowableModelPage 建模页面绑定
|
||||
* @return 建模页面绑定集合
|
||||
*/
|
||||
public List<FlowableModelPage> selectFlowableModelPageList(FlowableModelPage flowableModelPage);
|
||||
|
||||
/**
|
||||
* 新增建模页面绑定
|
||||
*
|
||||
* @param flowableModelPage 建模页面绑定
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFlowableModelPage(FlowableModelPage flowableModelPage);
|
||||
|
||||
/**
|
||||
* 修改建模页面绑定
|
||||
*
|
||||
* @param flowableModelPage 建模页面绑定
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFlowableModelPage(FlowableModelPage flowableModelPage);
|
||||
|
||||
/**
|
||||
* 批量删除建模页面绑定
|
||||
*
|
||||
* @param ids 需要删除的建模页面绑定主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableModelPageByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除建模页面绑定信息
|
||||
*
|
||||
* @param id 建模页面绑定主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFlowableModelPageById(String id);
|
||||
|
||||
/**
|
||||
* 查询需要绑定的建模页面
|
||||
* @param flowableModelPage
|
||||
* @return
|
||||
*/
|
||||
List<FlowableModelPage> selectFlowableModelPageListByBind(FlowableModelPage flowableModelPage);
|
||||
|
||||
/***
|
||||
* 建模页面单页面查询(根据模块,流程标识,页面名称查询)
|
||||
* @param flowableModelPage
|
||||
* @return
|
||||
*/
|
||||
FlowableModelPage selectFlowableModelPageSingle(FlowableModelPage flowableModelPage);
|
||||
|
||||
/**
|
||||
* 建模页面模块页面查询(按模块,流程标识查询)
|
||||
* @param flowableModelPage
|
||||
* @return
|
||||
*/
|
||||
List<FlowableModelPage> selectFlowableModelPage(FlowableModelPage flowableModelPage);
|
||||
}
|
|
@ -1,96 +0,0 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.flowable.domain.FlowableModel;
|
||||
import com.yanzhu.flowable.domain.bo.FlowableModelBo;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程模型Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-11-28
|
||||
*/
|
||||
public interface IFlowableModelService
|
||||
{
|
||||
/**
|
||||
* 查询流程模型
|
||||
*
|
||||
* @param modelId 流程模型主键
|
||||
* @return 流程模型
|
||||
*/
|
||||
public FlowableModel selectFlowableModelByModelId(String modelId);
|
||||
|
||||
/**
|
||||
* 查询流程模型列表
|
||||
*
|
||||
* @param flowableModel 流程模型
|
||||
* @return 流程模型集合
|
||||
*/
|
||||
public List<FlowableModel> selectFlowableModelList(FlowableModelBo flowableModel);
|
||||
|
||||
/**
|
||||
* 新增流程模型
|
||||
*
|
||||
* @param flowableModel 流程模型
|
||||
* @return
|
||||
*/
|
||||
public int insertFlowableModel(FlowableModel flowableModel);
|
||||
|
||||
/**
|
||||
* 修改流程模型
|
||||
*
|
||||
* @param flowableModel 流程模型
|
||||
* @return
|
||||
*/
|
||||
public int updateFlowableModel(FlowableModel flowableModel);
|
||||
|
||||
/**
|
||||
* 批量删除流程模型
|
||||
*
|
||||
* @param modelIds 需要删除的流程模型主键集合
|
||||
* @return
|
||||
*/
|
||||
public int deleteFlowableModelByModelIds(String[] modelIds);
|
||||
|
||||
/**
|
||||
* 删除流程模型信息
|
||||
*
|
||||
* @param modelId 流程模型主键
|
||||
*/
|
||||
public void deleteFlowableModelByModelId(String modelId);
|
||||
|
||||
/**
|
||||
* 部署流程
|
||||
* @param modelId 模型id
|
||||
*/
|
||||
public void deployModel(String modelId) throws UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
* 获取模型xml
|
||||
* @param modelId
|
||||
* @return
|
||||
* @throws UnsupportedEncodingException
|
||||
*/
|
||||
public String queryBpmnXmlById(String modelId) throws UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
* 查询模型历史版本
|
||||
* @param modelBo
|
||||
* @return
|
||||
*/
|
||||
List<FlowableModel> historyList(FlowableModelBo modelBo);
|
||||
|
||||
/**
|
||||
* 新增或更新模型xml
|
||||
* @param modelBo
|
||||
*/
|
||||
void saveModel(FlowableModelBo modelBo);
|
||||
|
||||
/**
|
||||
* 设置为最新版本
|
||||
* @param modelId
|
||||
*/
|
||||
void latestModel(String modelId) throws UnsupportedEncodingException;
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.flowable.domain.SysDeployForm;
|
||||
import com.yanzhu.flowable.domain.SysForm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程实例关联表单Service接口
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
public interface ISysDeployFormService
|
||||
{
|
||||
/**
|
||||
* 查询流程实例关联表单
|
||||
*
|
||||
* @param id 流程实例关联表单ID
|
||||
* @return 流程实例关联表单
|
||||
*/
|
||||
public SysDeployForm selectSysDeployFormById(Long id);
|
||||
|
||||
/**
|
||||
* 查询流程实例关联表单列表
|
||||
*
|
||||
* @param sysDeployForm 流程实例关联表单
|
||||
* @return 流程实例关联表单集合
|
||||
*/
|
||||
public List<SysDeployForm> selectSysDeployFormList(SysDeployForm sysDeployForm);
|
||||
|
||||
/**
|
||||
* 新增流程实例关联表单
|
||||
*
|
||||
* @param sysDeployForm 流程实例关联表单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysDeployForm(SysDeployForm sysDeployForm);
|
||||
|
||||
/**
|
||||
* 修改流程实例关联表单
|
||||
*
|
||||
* @param sysDeployForm 流程实例关联表单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysDeployForm(SysDeployForm sysDeployForm);
|
||||
|
||||
/**
|
||||
* 批量删除流程实例关联表单
|
||||
*
|
||||
* @param ids 需要删除的流程实例关联表单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDeployFormByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除流程实例关联表单信息
|
||||
*
|
||||
* @param id 流程实例关联表单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDeployFormById(Long id);
|
||||
|
||||
/**
|
||||
* 查询流程挂着的表单
|
||||
* @param deployId
|
||||
* @return
|
||||
*/
|
||||
SysForm selectSysDeployFormByDeployId(String deployId);
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.flowable.domain.SysExpression;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程达式Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-12-12
|
||||
*/
|
||||
public interface ISysExpressionService
|
||||
{
|
||||
/**
|
||||
* 查询流程达式
|
||||
*
|
||||
* @param id 流程达式主键
|
||||
* @return 流程达式
|
||||
*/
|
||||
public SysExpression selectSysExpressionById(Long id);
|
||||
|
||||
/**
|
||||
* 查询流程达式列表
|
||||
*
|
||||
* @param sysExpression 流程达式
|
||||
* @return 流程达式集合
|
||||
*/
|
||||
public List<SysExpression> selectSysExpressionList(SysExpression sysExpression);
|
||||
|
||||
/**
|
||||
* 新增流程达式
|
||||
*
|
||||
* @param sysExpression 流程达式
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysExpression(SysExpression sysExpression);
|
||||
|
||||
/**
|
||||
* 修改流程达式
|
||||
*
|
||||
* @param sysExpression 流程达式
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysExpression(SysExpression sysExpression);
|
||||
|
||||
/**
|
||||
* 批量删除流程达式
|
||||
*
|
||||
* @param ids 需要删除的流程达式主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysExpressionByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除流程达式信息
|
||||
*
|
||||
* @param id 流程达式主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysExpressionById(Long id);
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.flowable.domain.SysForm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 表单
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
public interface ISysFormService
|
||||
{
|
||||
/**
|
||||
* 查询流程表单
|
||||
*
|
||||
* @param formId 流程表单ID
|
||||
* @return 流程表单
|
||||
*/
|
||||
public SysForm selectSysFormById(Long formId);
|
||||
|
||||
/**
|
||||
* 查询流程表单列表
|
||||
*
|
||||
* @param sysForm 流程表单
|
||||
* @return 流程表单集合
|
||||
*/
|
||||
public List<SysForm> selectSysFormList(SysForm sysForm);
|
||||
|
||||
/**
|
||||
* 新增流程表单
|
||||
*
|
||||
* @param sysForm 流程表单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysForm(SysForm sysForm);
|
||||
|
||||
/**
|
||||
* 修改流程表单
|
||||
*
|
||||
* @param sysForm 流程表单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysForm(SysForm sysForm);
|
||||
|
||||
/**
|
||||
* 批量删除流程表单
|
||||
*
|
||||
* @param formIds 需要删除的流程表单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysFormByIds(Long[] formIds);
|
||||
|
||||
/**
|
||||
* 删除流程表单信息
|
||||
*
|
||||
* @param formId 流程表单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysFormById(Long formId);
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.flowable.domain.SysListener;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程监听Service接口
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2022-12-25
|
||||
*/
|
||||
public interface ISysListenerService
|
||||
{
|
||||
/**
|
||||
* 查询流程监听
|
||||
*
|
||||
* @param id 流程监听主键
|
||||
* @return 流程监听
|
||||
*/
|
||||
public SysListener selectSysListenerById(Long id);
|
||||
|
||||
/**
|
||||
* 查询流程监听列表
|
||||
*
|
||||
* @param sysListener 流程监听
|
||||
* @return 流程监听集合
|
||||
*/
|
||||
public List<SysListener> selectSysListenerList(SysListener sysListener);
|
||||
|
||||
/**
|
||||
* 新增流程监听
|
||||
*
|
||||
* @param sysListener 流程监听
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysListener(SysListener sysListener);
|
||||
|
||||
/**
|
||||
* 修改流程监听
|
||||
*
|
||||
* @param sysListener 流程监听
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysListener(SysListener sysListener);
|
||||
|
||||
/**
|
||||
* 批量删除流程监听
|
||||
*
|
||||
* @param ids 需要删除的流程监听主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysListenerByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除流程监听信息
|
||||
*
|
||||
* @param id 流程监听主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysListenerById(Long id);
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.flowable.domain.SysTaskForm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程任务关联单Service接口
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
@Deprecated
|
||||
public interface ISysTaskFormService {
|
||||
/**
|
||||
* 查询流程任务关联单
|
||||
*
|
||||
* @param id 流程任务关联单ID
|
||||
* @return 流程任务关联单
|
||||
*/
|
||||
public SysTaskForm selectSysTaskFormById(Long id);
|
||||
|
||||
/**
|
||||
* 查询流程任务关联单列表
|
||||
*
|
||||
* @param sysTaskForm 流程任务关联单
|
||||
* @return 流程任务关联单集合
|
||||
*/
|
||||
public List<SysTaskForm> selectSysTaskFormList(SysTaskForm sysTaskForm);
|
||||
|
||||
/**
|
||||
* 新增流程任务关联单
|
||||
*
|
||||
* @param sysTaskForm 流程任务关联单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysTaskForm(SysTaskForm sysTaskForm);
|
||||
|
||||
/**
|
||||
* 修改流程任务关联单
|
||||
*
|
||||
* @param sysTaskForm 流程任务关联单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysTaskForm(SysTaskForm sysTaskForm);
|
||||
|
||||
/**
|
||||
* 批量删除流程任务关联单
|
||||
*
|
||||
* @param ids 需要删除的流程任务关联单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysTaskFormByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除流程任务关联单信息
|
||||
*
|
||||
* @param id 流程任务关联单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysTaskFormById(Long id);
|
||||
}
|
|
@ -0,0 +1,232 @@
|
|||
package com.yanzhu.flowable.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.flowable.common.constant.ProcessConstants;
|
||||
import com.yanzhu.flowable.domain.SysForm;
|
||||
import com.yanzhu.flowable.domain.dto.FlowProcDefDto;
|
||||
import com.yanzhu.flowable.factory.FlowServiceFactory;
|
||||
import com.yanzhu.flowable.mapper.FlowDeployMapper;
|
||||
import com.yanzhu.flowable.service.IFlowDefinitionService;
|
||||
import com.yanzhu.flowable.service.ISysDeployFormService;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.flowable.bpmn.model.BpmnModel;
|
||||
import org.flowable.engine.repository.Deployment;
|
||||
import org.flowable.engine.repository.ProcessDefinition;
|
||||
import org.flowable.engine.repository.ProcessDefinitionQuery;
|
||||
import org.flowable.image.impl.DefaultProcessDiagramGenerator;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 流程定义
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFlowDefinitionService {
|
||||
|
||||
@Resource
|
||||
private ISysDeployFormService sysDeployFormService;
|
||||
|
||||
@Resource
|
||||
private FlowDeployMapper flowDeployMapper;
|
||||
|
||||
private static final String BPMN_FILE_SUFFIX = ".bpmn";
|
||||
|
||||
@Override
|
||||
public boolean exist(String processDefinitionKey) {
|
||||
ProcessDefinitionQuery processDefinitionQuery
|
||||
= repositoryService.createProcessDefinitionQuery().processDefinitionKey(processDefinitionKey);
|
||||
long count = processDefinitionQuery.count();
|
||||
return count > 0 ? true : false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 流程定义列表
|
||||
*
|
||||
* @return 流程定义分页列表数据
|
||||
*/
|
||||
@Override
|
||||
public List<FlowProcDefDto> list(String name) {
|
||||
|
||||
final List<FlowProcDefDto> dataList = flowDeployMapper.selectDeployList(name);
|
||||
// 加载挂表单
|
||||
for (FlowProcDefDto procDef : dataList) {
|
||||
SysForm sysForm = sysDeployFormService.selectSysDeployFormByDeployId(procDef.getDeploymentId());
|
||||
if (Objects.nonNull(sysForm)) {
|
||||
procDef.setFormName(sysForm.getFormName());
|
||||
procDef.setFormId(sysForm.getFormId());
|
||||
}
|
||||
}
|
||||
return dataList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表转换
|
||||
* @param name
|
||||
* @return
|
||||
public Page<FlowProcDefDto> list(String name) {
|
||||
Page<FlowProcDefDto> page = new Page<>();
|
||||
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
final List<FlowProcDefDto> dataList = flowDeployMapper.selectDeployList(name);
|
||||
// 加载挂表单
|
||||
for (FlowProcDefDto procDef : dataList) {
|
||||
SysForm sysForm = sysDeployFormService.selectSysDeployFormByDeployId(procDef.getDeploymentId());
|
||||
if (Objects.nonNull(sysForm)) {
|
||||
procDef.setFormName(sysForm.getFormName());
|
||||
procDef.setFormId(sysForm.getFormId());
|
||||
}
|
||||
}
|
||||
page.setTotal(new PageInfo(dataList).getTotal());
|
||||
// todo page.setRecords(dataList);
|
||||
return page;
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* 导入流程文件
|
||||
*
|
||||
* 当每个key的流程第一次部署时,指定版本为1。对其后所有使用相同key的流程定义,
|
||||
* 部署时版本会在该key当前已部署的最高版本号基础上加1。key参数用于区分流程定义
|
||||
* @param name
|
||||
* @param category
|
||||
* @param in
|
||||
*/
|
||||
@Override
|
||||
public void importFile(String name, String category, InputStream in) {
|
||||
Deployment deploy = repositoryService.createDeployment().addInputStream(name + BPMN_FILE_SUFFIX, in).name(name).category(category).deploy();
|
||||
ProcessDefinition definition = repositoryService.createProcessDefinitionQuery().deploymentId(deploy.getId()).singleResult();
|
||||
repositoryService.setProcessDefinitionCategory(definition.getId(), category);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取xml
|
||||
*
|
||||
* @param deployId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult readXml(String deployId) throws IOException {
|
||||
ProcessDefinition definition = repositoryService.createProcessDefinitionQuery().deploymentId(deployId).singleResult();
|
||||
InputStream inputStream = repositoryService.getResourceAsStream(definition.getDeploymentId(), definition.getResourceName());
|
||||
String result = IOUtils.toString(inputStream, StandardCharsets.UTF_8.name());
|
||||
return AjaxResult.success("", result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取xml
|
||||
*
|
||||
* @param deployId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public InputStream readImage(String deployId) {
|
||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().deploymentId(deployId).singleResult();
|
||||
//获得图片流
|
||||
DefaultProcessDiagramGenerator diagramGenerator = new DefaultProcessDiagramGenerator();
|
||||
BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinition.getId());
|
||||
//输出为图片
|
||||
return diagramGenerator.generateDiagram(
|
||||
bpmnModel,
|
||||
"png",
|
||||
Collections.emptyList(),
|
||||
Collections.emptyList(),
|
||||
"宋体",
|
||||
"宋体",
|
||||
"宋体",
|
||||
null,
|
||||
1.0,
|
||||
false);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据流程定义ID启动流程实例
|
||||
*
|
||||
* @param procDefId 流程模板ID
|
||||
* @param variables 流程变量
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult startProcessInstanceById(String procDefId, Map<String, Object> variables) {
|
||||
try {
|
||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId)
|
||||
.latestVersion().singleResult();
|
||||
if (Objects.nonNull(processDefinition) && processDefinition.isSuspended()) {
|
||||
return AjaxResult.error("流程已被挂起,请先激活流程");
|
||||
}
|
||||
// 设置流程发起人Id到流程中
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
identityService.setAuthenticatedUserId(sysUser.getUserId().toString());
|
||||
variables.put(ProcessConstants.PROCESS_INITIATOR, sysUser.getUserId());
|
||||
runtimeService.startProcessInstanceById(procDefId, variables);
|
||||
|
||||
// 流程发起时 跳过发起人节点
|
||||
// SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
||||
// identityService.setAuthenticatedUserId(sysUser.getUserId().toString());
|
||||
// variables.put(ProcessConstants.PROCESS_INITIATOR, "");
|
||||
// ProcessInstance processInstance = runtimeService.startProcessInstanceById(procDefId, variables);
|
||||
// // 给第一步申请人节点设置任务执行人和意见
|
||||
// Task task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult();
|
||||
// if (Objects.nonNull(task)) {
|
||||
// taskService.addComment(task.getId(), processInstance.getProcessInstanceId(), FlowComment.NORMAL.getType(), sysUser.getNickName() + "发起流程申请");
|
||||
//// taskService.setAssignee(task.getId(), sysUser.getUserId().toString());
|
||||
// taskService.complete(task.getId(), variables);
|
||||
// }
|
||||
return AjaxResult.success("流程启动成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error("流程启动错误");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 激活或挂起流程定义
|
||||
*
|
||||
* @param state 状态
|
||||
* @param deployId 流程部署ID
|
||||
*/
|
||||
@Override
|
||||
public void updateState(Integer state, String deployId) {
|
||||
ProcessDefinition procDef = repositoryService.createProcessDefinitionQuery().deploymentId(deployId).singleResult();
|
||||
// 激活
|
||||
if (state == 1) {
|
||||
repositoryService.activateProcessDefinitionById(procDef.getId(), true, null);
|
||||
}
|
||||
// 挂起
|
||||
if (state == 2) {
|
||||
repositoryService.suspendProcessDefinitionById(procDef.getId(), true, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除流程定义
|
||||
*
|
||||
* @param deployId 流程部署ID act_ge_bytearray 表中 deployment_id值
|
||||
*/
|
||||
@Override
|
||||
public void delete(String deployId) {
|
||||
// true 允许级联删除 ,不设置会导致数据库外键关联异常
|
||||
repositoryService.deleteDeployment(deployId, true);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
package com.yanzhu.flowable.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.flowable.domain.vo.FlowTaskVo;
|
||||
import com.yanzhu.flowable.factory.FlowServiceFactory;
|
||||
import com.yanzhu.flowable.service.IFlowInstanceService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.common.engine.api.FlowableObjectNotFoundException;
|
||||
import org.flowable.engine.history.HistoricProcessInstance;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>工作流流程实例管理<p>
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlowInstanceService {
|
||||
|
||||
/**
|
||||
* 结束流程实例
|
||||
*
|
||||
* @param vo
|
||||
*/
|
||||
@Override
|
||||
public void stopProcessInstance(FlowTaskVo vo) {
|
||||
String taskId = vo.getTaskId();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 激活或挂起流程实例
|
||||
*
|
||||
* @param state 状态
|
||||
* @param instanceId 流程实例ID
|
||||
*/
|
||||
@Override
|
||||
public void updateState(Integer state, String instanceId) {
|
||||
|
||||
// 激活
|
||||
if (state == 1) {
|
||||
runtimeService.activateProcessInstanceById(instanceId);
|
||||
}
|
||||
// 挂起
|
||||
if (state == 2) {
|
||||
runtimeService.suspendProcessInstanceById(instanceId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程实例ID
|
||||
*
|
||||
* @param instanceId 流程实例ID
|
||||
* @param deleteReason 删除原因
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(String instanceId, String deleteReason) {
|
||||
|
||||
// 查询历史数据
|
||||
HistoricProcessInstance historicProcessInstance = getHistoricProcessInstanceById(instanceId);
|
||||
if (historicProcessInstance.getEndTime() != null) {
|
||||
historyService.deleteHistoricProcessInstance(historicProcessInstance.getId());
|
||||
return;
|
||||
}
|
||||
// 删除流程实例
|
||||
runtimeService.deleteProcessInstance(instanceId, deleteReason);
|
||||
// 删除历史流程实例
|
||||
historyService.deleteHistoricProcessInstance(instanceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据实例ID查询历史实例数据
|
||||
*
|
||||
* @param processInstanceId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public HistoricProcessInstance getHistoricProcessInstanceById(String processInstanceId) {
|
||||
HistoricProcessInstance historicProcessInstance =
|
||||
historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
||||
if (Objects.isNull(historicProcessInstance)) {
|
||||
throw new FlowableObjectNotFoundException("流程实例不存在: " + processInstanceId);
|
||||
}
|
||||
return historicProcessInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据流程定义ID启动流程实例
|
||||
*
|
||||
* @param procDefId 流程定义Id
|
||||
* @param variables 流程变量
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult startProcessInstanceById(String procDefId, Map<String, Object> variables) {
|
||||
|
||||
try {
|
||||
// 设置流程发起人Id到流程中
|
||||
Long userId = SecurityUtils.getLoginUser().getSysUser().getUserId();
|
||||
// identityService.setAuthenticatedUserId(userId.toString());
|
||||
variables.put("initiator",userId);
|
||||
variables.put("_FLOWABLE_SKIP_EXPRESSION_ENABLED", true);
|
||||
runtimeService.startProcessInstanceById(procDefId, variables);
|
||||
return AjaxResult.success("流程启动成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error("流程启动错误");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,126 +0,0 @@
|
|||
package com.yanzhu.flowable.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.redis.service.RedisService;
|
||||
import com.yanzhu.flowable.common.enums.CacheType;
|
||||
import com.yanzhu.flowable.domain.FlowableCategory;
|
||||
import com.yanzhu.flowable.mapper.FlowableCategoryMapper;
|
||||
import com.yanzhu.flowable.service.IFlowableCategoryService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 流程分类Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-11-27
|
||||
*/
|
||||
@Service
|
||||
public class FlowableCategoryServiceImpl implements IFlowableCategoryService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(FlowableCategoryServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Autowired
|
||||
private FlowableCategoryMapper flowableCategoryMapper;
|
||||
|
||||
/**
|
||||
* 查询流程分类
|
||||
*
|
||||
* @param id 流程分类主键
|
||||
* @return 流程分类
|
||||
*/
|
||||
@Override
|
||||
public FlowableCategory selectFlowableCategoryById(Long id)
|
||||
{
|
||||
return flowableCategoryMapper.selectFlowableCategoryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程分类列表
|
||||
*
|
||||
* @param flowableCategory 流程分类
|
||||
* @return 流程分类
|
||||
*/
|
||||
@Override
|
||||
public List<FlowableCategory> selectFlowableCategoryList(FlowableCategory flowableCategory)
|
||||
{
|
||||
log.debug("enter selectFlowableCategoryList!");
|
||||
List<FlowableCategory> flowableCategories = flowableCategoryMapper.selectFlowableCategoryList(flowableCategory);
|
||||
updateRedis(flowableCategories);
|
||||
return flowableCategories;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新缓存
|
||||
* @param flowableCategories
|
||||
*/
|
||||
@Override
|
||||
public Map<String,String> updateRedis(List<FlowableCategory> flowableCategories) {
|
||||
if(flowableCategories==null ){
|
||||
flowableCategories = selectFlowableCategoryList(new FlowableCategory());
|
||||
}
|
||||
//更新缓存
|
||||
Map<String, String> categoryMap = flowableCategories.stream().collect(Collectors.toMap(FlowableCategory::getCode, FlowableCategory::getName));
|
||||
redisService.setCacheObject(CacheType.FLOWCATEGORY.getCode(), categoryMap);
|
||||
return categoryMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程分类
|
||||
*
|
||||
* @param flowableCategory 流程分类
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertFlowableCategory(FlowableCategory flowableCategory)
|
||||
{
|
||||
flowableCategory.setCreateTime(DateUtils.getNowDate());
|
||||
return flowableCategoryMapper.insertFlowableCategory(flowableCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程分类
|
||||
*
|
||||
* @param flowableCategory 流程分类
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateFlowableCategory(FlowableCategory flowableCategory)
|
||||
{
|
||||
flowableCategory.setUpdateTime(DateUtils.getNowDate());
|
||||
return flowableCategoryMapper.updateFlowableCategory(flowableCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除流程分类
|
||||
*
|
||||
* @param ids 需要删除的流程分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFlowableCategoryByIds(Long[] ids)
|
||||
{
|
||||
return flowableCategoryMapper.deleteFlowableCategoryByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程分类信息
|
||||
*
|
||||
* @param id 流程分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFlowableCategoryById(Long id)
|
||||
{
|
||||
return flowableCategoryMapper.deleteFlowableCategoryById(id);
|
||||
}
|
||||
}
|
|
@ -1,222 +0,0 @@
|
|||
package com.yanzhu.flowable.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.common.core.web.page.PageDomain;
|
||||
import com.yanzhu.common.core.web.page.TableSupport;
|
||||
import com.yanzhu.flowable.domain.FlowableDeploy;
|
||||
import com.yanzhu.flowable.factory.FlowServiceFactory;
|
||||
import com.yanzhu.flowable.service.IFlowableDeployService;
|
||||
import org.flowable.common.engine.impl.db.SuspensionState;
|
||||
import org.flowable.engine.repository.Deployment;
|
||||
import org.flowable.engine.repository.ProcessDefinition;
|
||||
import org.flowable.engine.repository.ProcessDefinitionQuery;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 流程部署Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Service
|
||||
public class FlowableDeployServiceImpl extends FlowServiceFactory implements IFlowableDeployService
|
||||
{
|
||||
/**
|
||||
* 查询流程部署
|
||||
*
|
||||
* @param definitionId 流程部署主键
|
||||
* @return 流程部署
|
||||
*/
|
||||
@Override
|
||||
public FlowableDeploy selectFlowableDeployByDefinitionId(String definitionId)
|
||||
{
|
||||
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery()
|
||||
.latestVersion()
|
||||
.orderByProcessDefinitionKey()
|
||||
.asc();
|
||||
processDefinitionQuery.deploymentId(definitionId);
|
||||
if(processDefinitionQuery.count()==0){
|
||||
return new FlowableDeploy();
|
||||
}
|
||||
FlowableDeploy flowableDeploy = new FlowableDeploy();
|
||||
ProcessDefinition result = processDefinitionQuery.singleResult();
|
||||
|
||||
flowableDeploy.setDefinitionId(result.getId());
|
||||
flowableDeploy.setDeploymentId(result.getDeploymentId());
|
||||
flowableDeploy.setVersion(result.getVersion());
|
||||
Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(definitionId).singleResult();
|
||||
flowableDeploy.setDeploymentTime(deployment.getDeploymentTime());
|
||||
flowableDeploy.setSuspended(result.isSuspended());
|
||||
flowableDeploy.setProcessKey(result.getKey());
|
||||
flowableDeploy.setProcessName(result.getName());
|
||||
flowableDeploy.setCategory(deployment.getCategory());
|
||||
return flowableDeploy;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程部署列表
|
||||
*
|
||||
* @param flowableDeploy 流程部署
|
||||
* @return 流程部署
|
||||
*/
|
||||
@Override
|
||||
public List<FlowableDeploy> selectFlowableDeployList(FlowableDeploy flowableDeploy)
|
||||
{
|
||||
List<FlowableDeploy> retList = null;
|
||||
// 流程定义列表数据查询
|
||||
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery()
|
||||
.latestVersion()
|
||||
.orderByProcessDefinitionKey()
|
||||
.asc();
|
||||
if (StringUtils.isNotBlank(flowableDeploy.getProcessKey())) {
|
||||
processDefinitionQuery.processDefinitionKeyLike("%" + flowableDeploy.getProcessKey() + "%");
|
||||
}
|
||||
if (StringUtils.isNotBlank(flowableDeploy.getProcessName())) {
|
||||
processDefinitionQuery.processDefinitionNameLike("%" + flowableDeploy.getProcessName() + "%");
|
||||
}
|
||||
if (StringUtils.isNotBlank(flowableDeploy.getCategory())) {
|
||||
processDefinitionQuery.processDefinitionCategory(flowableDeploy.getCategory());
|
||||
}
|
||||
if (flowableDeploy.getSuspended()!=null) {
|
||||
if(!flowableDeploy.getSuspended()){
|
||||
processDefinitionQuery.active();
|
||||
} else {
|
||||
processDefinitionQuery.suspended();
|
||||
}
|
||||
}
|
||||
long pageTotal = processDefinitionQuery.count();
|
||||
if (pageTotal <= 0) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
PageDomain pageDomain = TableSupport.getPageDomain();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
int offset = pageSize * (pageNum - 1);
|
||||
List<ProcessDefinition> definitionList = processDefinitionQuery.listPage(offset, pageSize);
|
||||
|
||||
retList = new ArrayList<>(definitionList.size());
|
||||
for (ProcessDefinition processDefinition : definitionList) {
|
||||
String deploymentId = processDefinition.getDeploymentId();
|
||||
|
||||
Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
|
||||
FlowableDeploy vo = new FlowableDeploy();
|
||||
vo.setDefinitionId(processDefinition.getId());
|
||||
vo.setProcessKey(processDefinition.getKey());
|
||||
vo.setProcessName(processDefinition.getName());
|
||||
vo.setVersion(processDefinition.getVersion());
|
||||
vo.setCategory(processDefinition.getCategory());
|
||||
vo.setDeploymentId(processDefinition.getDeploymentId());
|
||||
vo.setSuspended(processDefinition.isSuspended());
|
||||
// 流程部署信息
|
||||
vo.setCategory(deployment.getCategory());
|
||||
vo.setDeploymentTime(deployment.getDeploymentTime());
|
||||
retList.add(vo);
|
||||
}
|
||||
return retList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除流程部署
|
||||
*
|
||||
* @param definitionIds 需要删除的流程部署主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFlowableDeployByDefinitionIds(String[] definitionIds)
|
||||
{
|
||||
for (String deployId : definitionIds) {
|
||||
repositoryService.deleteDeployment(deployId, true);
|
||||
//deployFormMapper.delete(new LambdaQueryWrapper<WfDeployForm>().eq(WfDeployForm::getDeployId, deployId));
|
||||
}
|
||||
return definitionIds.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程部署信息
|
||||
*
|
||||
* @param definitionId 流程部署主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFlowableDeployByDefinitionId(String definitionId)
|
||||
{
|
||||
repositoryService.deleteDeployment(definitionId, true);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部署的所有历史版本
|
||||
* @param processKey
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<FlowableDeploy> queryPublishList(String processKey) {
|
||||
// 创建查询条件
|
||||
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery()
|
||||
.processDefinitionKey(processKey)
|
||||
.orderByProcessDefinitionVersion()
|
||||
.desc();
|
||||
long pageTotal = processDefinitionQuery.count();
|
||||
if (pageTotal <= 0) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
// 根据查询条件,查询所有版本
|
||||
PageDomain pageDomain = TableSupport.getPageDomain();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
int offset = pageSize * (pageNum - 1);
|
||||
List<ProcessDefinition> processDefinitionList = processDefinitionQuery
|
||||
.listPage(offset, pageSize);
|
||||
List<FlowableDeploy> retList = processDefinitionList.stream().map(item -> {
|
||||
FlowableDeploy vo = new FlowableDeploy();
|
||||
vo.setDefinitionId(item.getId());
|
||||
vo.setProcessKey(item.getKey());
|
||||
vo.setProcessName(item.getName());
|
||||
vo.setVersion(item.getVersion());
|
||||
vo.setCategory(item.getCategory());
|
||||
vo.setDeploymentId(item.getDeploymentId());
|
||||
vo.setSuspended(item.isSuspended());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
return retList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 改变部署状态
|
||||
*
|
||||
* @param definitionId
|
||||
* @param stateCode
|
||||
*/
|
||||
@Override
|
||||
public void updateState(String definitionId, String stateCode) {
|
||||
if (SuspensionState.ACTIVE.toString().equals(stateCode)) {
|
||||
// 激活
|
||||
repositoryService.activateProcessDefinitionById(definitionId, true, null);
|
||||
} else if (SuspensionState.SUSPENDED.toString().equals(stateCode)) {
|
||||
// 挂起
|
||||
repositoryService.suspendProcessDefinitionById(definitionId, true, null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程图
|
||||
*
|
||||
* @param definitionId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String queryBpmnXmlById(String definitionId) {
|
||||
InputStream inputStream = repositoryService.getProcessModel(definitionId);
|
||||
try {
|
||||
return StringUtils.utf8Str(inputStream);
|
||||
} catch (Exception exception) {
|
||||
throw new RuntimeException("加载xml文件异常");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,109 +0,0 @@
|
|||
package com.yanzhu.flowable.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.flowable.domain.FlowableFieldDef;
|
||||
import com.yanzhu.flowable.domain.FlowableFieldSearch;
|
||||
import com.yanzhu.flowable.mapper.FlowableFieldDefMapper;
|
||||
import com.yanzhu.flowable.service.IFlowableFieldDefService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程字段定义Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
@Service
|
||||
public class FlowableFieldDefServiceImpl implements IFlowableFieldDefService
|
||||
{
|
||||
@Autowired
|
||||
private FlowableFieldDefMapper flowableFieldDefMapper;
|
||||
|
||||
/**
|
||||
* 查询流程字段定义
|
||||
*
|
||||
* @param id 流程字段定义主键
|
||||
* @return 流程字段定义
|
||||
*/
|
||||
@Override
|
||||
public FlowableFieldDef selectFlowableFieldDefById(String id)
|
||||
{
|
||||
return flowableFieldDefMapper.selectFlowableFieldDefById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程字段定义列表
|
||||
*
|
||||
* @param flowableFieldDef 流程字段定义
|
||||
* @return 流程字段定义
|
||||
*/
|
||||
@Override
|
||||
public List<FlowableFieldDef> selectFlowableFieldDefList(FlowableFieldDef flowableFieldDef)
|
||||
{
|
||||
return flowableFieldDefMapper.selectFlowableFieldDefList(flowableFieldDef);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程字段定义
|
||||
*
|
||||
* @param flowableFieldDef 流程字段定义
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertFlowableFieldDef(FlowableFieldDef flowableFieldDef)
|
||||
{
|
||||
flowableFieldDef.setCreateTime(DateUtils.getNowDate());
|
||||
return flowableFieldDefMapper.insertFlowableFieldDef(flowableFieldDef);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程字段定义
|
||||
*
|
||||
* @param flowableFieldDef 流程字段定义
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateFlowableFieldDef(FlowableFieldDef flowableFieldDef)
|
||||
{
|
||||
flowableFieldDef.setUpdateTime(DateUtils.getNowDate());
|
||||
return flowableFieldDefMapper.updateFlowableFieldDef(flowableFieldDef);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除流程字段定义
|
||||
*
|
||||
* @param ids 需要删除的流程字段定义主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFlowableFieldDefByIds(String[] ids)
|
||||
{
|
||||
return flowableFieldDefMapper.deleteFlowableFieldDefByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程字段定义信息
|
||||
*
|
||||
* @param id 流程字段定义主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFlowableFieldDefById(String id)
|
||||
{
|
||||
return flowableFieldDefMapper.deleteFlowableFieldDefById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程字段引用关系列表(不翻页,关联字段定义表查询)
|
||||
*
|
||||
* @param flowableFieldSearch
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<FlowableFieldDef> listCombination(FlowableFieldSearch flowableFieldSearch) {
|
||||
return flowableFieldDefMapper.listCombination(flowableFieldSearch);
|
||||
}
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
package com.yanzhu.flowable.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.flowable.domain.FlowableFieldRef;
|
||||
import com.yanzhu.flowable.mapper.FlowableFieldRefMapper;
|
||||
import com.yanzhu.flowable.service.IFlowableFieldRefService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程字段引用关系Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
@Service
|
||||
public class FlowableFieldRefServiceImpl implements IFlowableFieldRefService
|
||||
{
|
||||
@Autowired
|
||||
private FlowableFieldRefMapper flowableFieldRefMapper;
|
||||
|
||||
/**
|
||||
* 查询流程字段引用关系
|
||||
*
|
||||
* @param id 流程字段引用关系主键
|
||||
* @return 流程字段引用关系
|
||||
*/
|
||||
@Override
|
||||
public FlowableFieldRef selectFlowableFieldRefById(String id)
|
||||
{
|
||||
return flowableFieldRefMapper.selectFlowableFieldRefById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程字段引用关系列表
|
||||
*
|
||||
* @param flowableFieldRef 流程字段引用关系
|
||||
* @return 流程字段引用关系
|
||||
*/
|
||||
@Override
|
||||
public List<FlowableFieldRef> selectFlowableFieldRefList(FlowableFieldRef flowableFieldRef)
|
||||
{
|
||||
return flowableFieldRefMapper.selectFlowableFieldRefList(flowableFieldRef);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程字段引用关系
|
||||
*
|
||||
* @param flowableFieldRef 流程字段引用关系
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertFlowableFieldRef(FlowableFieldRef flowableFieldRef)
|
||||
{
|
||||
flowableFieldRef.setCreateTime(DateUtils.getNowDate());
|
||||
return flowableFieldRefMapper.insertFlowableFieldRef(flowableFieldRef);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程字段引用关系
|
||||
*
|
||||
* @param flowableFieldRef 流程字段引用关系
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateFlowableFieldRef(FlowableFieldRef flowableFieldRef)
|
||||
{
|
||||
flowableFieldRef.setUpdateTime(DateUtils.getNowDate());
|
||||
return flowableFieldRefMapper.updateFlowableFieldRef(flowableFieldRef);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除流程字段引用关系
|
||||
*
|
||||
* @param ids 需要删除的流程字段引用关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFlowableFieldRefByIds(String[] ids)
|
||||
{
|
||||
return flowableFieldRefMapper.deleteFlowableFieldRefByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程字段引用关系信息
|
||||
*
|
||||
* @param id 流程字段引用关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFlowableFieldRefById(String id)
|
||||
{
|
||||
return flowableFieldRefMapper.deleteFlowableFieldRefById(id);
|
||||
}
|
||||
}
|
|
@ -1,183 +0,0 @@
|
|||
package com.yanzhu.flowable.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.exception.ServiceException;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.flowable.domain.FlowableModelPage;
|
||||
import com.yanzhu.flowable.mapper.FlowableModelPageMapper;
|
||||
import com.yanzhu.flowable.service.IFlowableModelPageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 建模页面绑定Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-12-25
|
||||
*/
|
||||
@Service
|
||||
public class FlowableModelPageServiceImpl implements IFlowableModelPageService
|
||||
{
|
||||
@Autowired
|
||||
private FlowableModelPageMapper flowableModelPageMapper;
|
||||
|
||||
/**
|
||||
* 查询建模页面绑定
|
||||
*
|
||||
* @param id 建模页面绑定主键
|
||||
* @return 建模页面绑定
|
||||
*/
|
||||
@Override
|
||||
public FlowableModelPage selectFlowableModelPageById(String id)
|
||||
{
|
||||
return flowableModelPageMapper.selectFlowableModelPageById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询建模页面绑定列表
|
||||
*
|
||||
* @param flowableModelPage 建模页面绑定
|
||||
* @return 建模页面绑定
|
||||
*/
|
||||
@Override
|
||||
public List<FlowableModelPage> selectFlowableModelPageList(FlowableModelPage flowableModelPage)
|
||||
{
|
||||
return flowableModelPageMapper.selectFlowableModelPageList(flowableModelPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增建模页面绑定
|
||||
*
|
||||
* @param flowableModelPage 建模页面绑定
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertFlowableModelPage(FlowableModelPage flowableModelPage)
|
||||
{
|
||||
flowableModelPage.setCreateTime(DateUtils.getNowDate());
|
||||
//设置创建用户id及用户名
|
||||
flowableModelPage.setCreateBy(SecurityUtils.getUsername());
|
||||
return flowableModelPageMapper.insertFlowableModelPage(flowableModelPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改建模页面绑定
|
||||
*
|
||||
* @param flowableModelPage 建模页面绑定
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateFlowableModelPage(FlowableModelPage flowableModelPage)
|
||||
{
|
||||
flowableModelPage.setUpdateTime(DateUtils.getNowDate());
|
||||
//设置更新用户用户名
|
||||
flowableModelPage.setUpdateBy(SecurityUtils.getUsername());
|
||||
return flowableModelPageMapper.updateFlowableModelPage(flowableModelPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除建模页面绑定
|
||||
*
|
||||
* @param ids 需要删除的建模页面绑定主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFlowableModelPageByIds(String[] ids)
|
||||
{
|
||||
return flowableModelPageMapper.deleteFlowableModelPageByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除建模页面绑定信息
|
||||
*
|
||||
* @param id 建模页面绑定主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFlowableModelPageById(String id)
|
||||
{
|
||||
return flowableModelPageMapper.deleteFlowableModelPageById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询需要绑定的建模页面
|
||||
*
|
||||
* @param flowableModelPage
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<FlowableModelPage> selectFlowableModelPageListByBind(FlowableModelPage flowableModelPage) {
|
||||
FlowableModelPage searchModelPage = new FlowableModelPage();
|
||||
//参数检查
|
||||
//模块不能为空
|
||||
if(StringUtils.isEmpty(flowableModelPage.getModule()))
|
||||
throw new ServiceException("模块名称不能为空!");
|
||||
//流程标识不能为空
|
||||
if(StringUtils.isEmpty(flowableModelPage.getMkey()))
|
||||
throw new ServiceException("流程标识不能空!");
|
||||
//页面名称不能为空
|
||||
if(StringUtils.isEmpty(flowableModelPage.getName()))
|
||||
throw new ServiceException("页面名称不能为空!");
|
||||
searchModelPage.setModule(flowableModelPage.getModule());
|
||||
searchModelPage.setMkey(flowableModelPage.getMkey());
|
||||
searchModelPage.setName(flowableModelPage.getName());
|
||||
return flowableModelPageMapper.selectFlowableModelPageList(searchModelPage);
|
||||
}
|
||||
|
||||
/***
|
||||
* 建模页面单页面查询(根据模块,流程标识,页面名称查询)
|
||||
* @param flowableModelPage
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public FlowableModelPage selectFlowableModelPageSingle(FlowableModelPage flowableModelPage) {
|
||||
FlowableModelPage searchModelPage = new FlowableModelPage();
|
||||
//参数检查
|
||||
//模块不能为空
|
||||
if(StringUtils.isEmpty(flowableModelPage.getModule())) {
|
||||
return null;
|
||||
}
|
||||
//流程标识不能为空
|
||||
if(StringUtils.isEmpty(flowableModelPage.getMkey())){
|
||||
return null;
|
||||
}
|
||||
//页面名称不能为空
|
||||
if(StringUtils.isEmpty(flowableModelPage.getName())){
|
||||
return null;
|
||||
}
|
||||
searchModelPage.setModule(flowableModelPage.getModule());
|
||||
searchModelPage.setMkey(flowableModelPage.getMkey());
|
||||
searchModelPage.setName(flowableModelPage.getName());
|
||||
List<FlowableModelPage> list = flowableModelPageMapper.selectFlowableModelPageList(searchModelPage);
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return null;
|
||||
}else{
|
||||
return list.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 建模页面模块页面查询(按模块,流程标识查询)
|
||||
*
|
||||
* @param flowableModelPage
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<FlowableModelPage> selectFlowableModelPage(FlowableModelPage flowableModelPage) {
|
||||
FlowableModelPage searchModelPage = new FlowableModelPage();
|
||||
//参数检查
|
||||
//模块不能为空
|
||||
if(StringUtils.isEmpty(flowableModelPage.getModule()))
|
||||
throw new ServiceException("模块名称不能为空!");
|
||||
//流程标识不能为空
|
||||
if(StringUtils.isEmpty(flowableModelPage.getMkey()))
|
||||
throw new ServiceException("流程标识不能空!");
|
||||
searchModelPage.setModule(flowableModelPage.getModule());
|
||||
searchModelPage.setMkey(flowableModelPage.getMkey());
|
||||
return flowableModelPageMapper.selectFlowableModelPageList(searchModelPage);
|
||||
}
|
||||
}
|
|
@ -1,423 +0,0 @@
|
|||
package com.yanzhu.flowable.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.common.core.web.page.PageDomain;
|
||||
import com.yanzhu.common.core.web.page.TableSupport;
|
||||
import com.yanzhu.common.redis.service.RedisService;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.flowable.common.constant.ProcessConstants;
|
||||
import com.yanzhu.flowable.common.enums.CacheType;
|
||||
import com.yanzhu.flowable.common.enums.FormType;
|
||||
import com.yanzhu.flowable.domain.FlowableModel;
|
||||
import com.yanzhu.flowable.domain.bo.FlowableMetaInfoBo;
|
||||
import com.yanzhu.flowable.domain.bo.FlowableModelBo;
|
||||
import com.yanzhu.flowable.factory.FlowServiceFactory;
|
||||
import com.yanzhu.flowable.flow.ModelHelper;
|
||||
import com.yanzhu.flowable.service.IFlowableCategoryService;
|
||||
import com.yanzhu.flowable.service.IFlowableModelService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.bpmn.model.BpmnModel;
|
||||
import org.flowable.bpmn.model.StartEvent;
|
||||
import org.flowable.engine.repository.Deployment;
|
||||
import org.flowable.engine.repository.Model;
|
||||
import org.flowable.engine.repository.ModelQuery;
|
||||
import org.flowable.engine.repository.ProcessDefinition;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 流程模型Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @createtime 2023-11-28
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class FlowableModelServiceImpl extends FlowServiceFactory implements IFlowableModelService
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Autowired
|
||||
private IFlowableCategoryService flowableCategoryService;
|
||||
/**
|
||||
* 查询流程模型
|
||||
*
|
||||
* @param modelId 流程模型主键
|
||||
* @return 流程模型
|
||||
*/
|
||||
@Override
|
||||
public FlowableModel selectFlowableModelByModelId(String modelId)
|
||||
{
|
||||
// 获取流程模型
|
||||
Model model = repositoryService.getModel(modelId);
|
||||
if (model==null) {
|
||||
throw new RuntimeException("流程模型不存在!");
|
||||
}
|
||||
// 获取流程图
|
||||
String bpmnXml ;
|
||||
try {
|
||||
bpmnXml = queryBpmnXmlById(modelId);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
//e.printStackTrace();
|
||||
log.error("模型转换为字符串失败!模型id:"+modelId,e);
|
||||
throw new RuntimeException("模型转换为字符串失败!");
|
||||
}
|
||||
FlowableModel modelVo = new FlowableModel();
|
||||
modelVo.setModelId(model.getId());
|
||||
modelVo.setModelName(model.getName());
|
||||
modelVo.setModelKey(model.getKey());
|
||||
modelVo.setCategory(model.getCategory());
|
||||
modelVo.setCreateTime(model.getCreateTime());
|
||||
modelVo.setVersion(model.getVersion());
|
||||
modelVo.setBpmnXml(bpmnXml);
|
||||
FlowableMetaInfoBo metaInfo = JSON.parseObject(model.getMetaInfo(), FlowableMetaInfoBo.class);
|
||||
if (metaInfo != null) {
|
||||
modelVo.setDescription(metaInfo.getDescription());
|
||||
modelVo.setFormType(metaInfo.getFormType());
|
||||
modelVo.setFormId(metaInfo.getFormId());
|
||||
if (FormType.PROCESS.getType().equals(metaInfo.getFormType())) {
|
||||
//TODO
|
||||
//WfFormVo wfFormVo = formService.queryById(metaInfo.getFormId());
|
||||
//modelVo.setContent(wfFormVo.getContent());
|
||||
}
|
||||
}
|
||||
return modelVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程模型列表
|
||||
*
|
||||
* @param flowableModel 流程模型
|
||||
* @return 流程模型
|
||||
*/
|
||||
@Override
|
||||
public List<FlowableModel> selectFlowableModelList(FlowableModelBo flowableModel)
|
||||
{
|
||||
PageDomain pageDomain = TableSupport.getPageDomain();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
|
||||
ModelQuery modelQuery = repositoryService.createModelQuery().latestVersion().orderByCreateTime().desc();
|
||||
|
||||
// 构建查询条件
|
||||
if (StringUtils.isNotBlank(flowableModel.getModelKey())) {
|
||||
modelQuery.modelKey(flowableModel.getModelKey());
|
||||
}
|
||||
if (StringUtils.isNotBlank(flowableModel.getModelName())) {
|
||||
modelQuery.modelNameLike("%" + flowableModel.getModelName() + "%");
|
||||
}
|
||||
if (StringUtils.isNotBlank(flowableModel.getCategory())) {
|
||||
modelQuery.modelCategory(flowableModel.getCategory());
|
||||
}
|
||||
|
||||
// 执行查询
|
||||
long pageTotal = modelQuery.count();
|
||||
if (pageTotal <= 0) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
//有bug 先注掉
|
||||
//modelQuery = modelQuery.latestVersion();
|
||||
int offset = pageSize * (pageNum - 1);
|
||||
List<Model> modelList = modelQuery.listPage(offset, pageSize);
|
||||
List<FlowableModel> flowableModelList = new ArrayList<>(modelList.size());
|
||||
//获取流程分类缓存
|
||||
Map<String,String> flowCategoryMap = redisService.getCacheObject(CacheType.FLOWCATEGORY.getCode());
|
||||
if(flowCategoryMap==null){
|
||||
flowCategoryMap = flowableCategoryService.updateRedis(null);
|
||||
}
|
||||
Map<String, String> finalFlowCategoryMap = flowCategoryMap;
|
||||
modelList.forEach(model -> {
|
||||
FlowableModel modelVo = new FlowableModel();
|
||||
modelVo.setModelId(model.getId());
|
||||
modelVo.setModelName(model.getName());
|
||||
modelVo.setModelKey(model.getKey());
|
||||
//翻译分类
|
||||
modelVo.setCategory(finalFlowCategoryMap.get(model.getCategory()));
|
||||
modelVo.setCreateTime(model.getCreateTime());
|
||||
modelVo.setVersion(model.getVersion());
|
||||
FlowableMetaInfoBo metaInfo = JSON.parseObject(model.getMetaInfo(), FlowableMetaInfoBo.class);
|
||||
if (metaInfo != null) {
|
||||
modelVo.setDescription(metaInfo.getDescription());
|
||||
modelVo.setFormType(metaInfo.getFormType());
|
||||
modelVo.setFormId(metaInfo.getFormId());
|
||||
}
|
||||
flowableModelList.add(modelVo);
|
||||
});
|
||||
return flowableModelList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程模型
|
||||
*
|
||||
* @param flowableModel 流程模型
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int insertFlowableModel(FlowableModel flowableModel)
|
||||
{
|
||||
flowableModel.setCreateTime(DateUtils.getNowDate());
|
||||
Model model = repositoryService.newModel();
|
||||
model.setName(flowableModel.getModelName());
|
||||
model.setKey(flowableModel.getModelKey());
|
||||
model.setCategory(flowableModel.getCategory());
|
||||
String metaInfo = buildMetaInfo(new FlowableMetaInfoBo(), flowableModel.getDescription());
|
||||
model.setMetaInfo(metaInfo);
|
||||
// 保存流程模型
|
||||
repositoryService.saveModel(model);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程模型
|
||||
*
|
||||
* @param flowableModel 流程模型
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int updateFlowableModel(FlowableModel flowableModel)
|
||||
{
|
||||
// 根据模型Key查询模型信息
|
||||
Model model = repositoryService.getModel(flowableModel.getModelId());
|
||||
if (model==null) {
|
||||
throw new RuntimeException("流程模型不存在!");
|
||||
}
|
||||
model.setCategory(flowableModel.getCategory());
|
||||
FlowableMetaInfoBo metaInfoDto = JSON.parseObject(model.getMetaInfo(), FlowableMetaInfoBo.class);
|
||||
String metaInfo = buildMetaInfo(metaInfoDto, flowableModel.getDescription());
|
||||
model.setMetaInfo(metaInfo);
|
||||
// 保存流程模型
|
||||
repositoryService.saveModel(model);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除流程模型
|
||||
*
|
||||
* @param modelIds 需要删除的流程模型主键
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int deleteFlowableModelByModelIds(String[] modelIds)
|
||||
{
|
||||
for(String id:modelIds){
|
||||
Model model = repositoryService.getModel(id);
|
||||
if (model==null) {
|
||||
throw new RuntimeException("流程模型不存在!");
|
||||
}
|
||||
repositoryService.deleteModel(id);
|
||||
}
|
||||
return modelIds.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程模型信息
|
||||
*
|
||||
* @param modelId 流程模型主键
|
||||
*/
|
||||
@Override
|
||||
public void deleteFlowableModelByModelId(String modelId)
|
||||
{
|
||||
Model model = repositoryService.getModel(modelId);
|
||||
if (model==null) {
|
||||
throw new RuntimeException("流程模型不存在!");
|
||||
}
|
||||
repositoryService.deleteModel(modelId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 部署流程
|
||||
*
|
||||
* @param modelId 模型id
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deployModel(String modelId) throws UnsupportedEncodingException {
|
||||
// 获取流程模型
|
||||
Model model = repositoryService.getModel(modelId);
|
||||
if (model== null) {
|
||||
throw new RuntimeException("流程模型不存在!");
|
||||
}
|
||||
// 获取流程图
|
||||
String bpmnXml = queryBpmnXmlById(modelId);
|
||||
//BpmnModel bpmnModel = ModelHelper.getBpmnModel(bpmnXml);
|
||||
String processName = model.getName() + ProcessConstants.SUFFIX;
|
||||
Deployment deployment = repositoryService.createDeployment()
|
||||
.key(model.getKey())
|
||||
.name(model.getName())
|
||||
.category(model.getCategory())
|
||||
.addString(model.getKey() + ".bpmn20.xml", bpmnXml)
|
||||
.deploy();
|
||||
// 调整分类
|
||||
ProcessDefinition precessDefinition = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).singleResult();
|
||||
repositoryService.setProcessDefinitionCategory(precessDefinition.getId(),model.getCategory());
|
||||
// TODO:保存部署表单
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建模型扩展信息
|
||||
* @return 返回模型扩展信息
|
||||
*/
|
||||
private String buildMetaInfo(FlowableMetaInfoBo metaInfo, String description) {
|
||||
// 只有非空,才进行设置,避免更新时的覆盖
|
||||
if (StringUtils.isNotEmpty(description)) {
|
||||
metaInfo.setDescription(description);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(metaInfo.getCreateUser())) {
|
||||
metaInfo.setCreateUser(SecurityUtils.getUsername());
|
||||
}
|
||||
return JSON.toJSONString(metaInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将模型数据转字符串返回
|
||||
* @param modelId 模型id
|
||||
* @return 返回模型字符串格式
|
||||
*/
|
||||
public String queryBpmnXmlById(String modelId) throws UnsupportedEncodingException {
|
||||
byte[] bpmnBytes = repositoryService.getModelEditorSource(modelId);
|
||||
if(bpmnBytes!=null) {
|
||||
return new String(bpmnBytes, StandardCharsets.UTF_8);
|
||||
}else{
|
||||
return new String("");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询模型历史版本
|
||||
*
|
||||
* @param modelBo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<FlowableModel> historyList(FlowableModelBo modelBo) {
|
||||
ModelQuery modelQuery = repositoryService.createModelQuery()
|
||||
.modelKey(modelBo.getModelKey())
|
||||
.orderByModelVersion()
|
||||
.desc();
|
||||
// 执行查询(不显示最新版,-1)
|
||||
long pageTotal = modelQuery.count() - 1;
|
||||
if (pageTotal <= 0) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
PageDomain pageDomain = TableSupport.getPageDomain();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
// offset+1,去掉最新版
|
||||
int offset = 1 + pageSize * (pageNum - 1);
|
||||
List<Model> modelList = modelQuery.listPage(offset, pageSize);
|
||||
List<FlowableModel> modelVoList = new ArrayList<>(modelList.size());
|
||||
modelList.forEach(model -> {
|
||||
FlowableModel modelVo = new FlowableModel();
|
||||
modelVo.setModelId(model.getId());
|
||||
modelVo.setModelName(model.getName());
|
||||
modelVo.setModelKey(model.getKey());
|
||||
modelVo.setCategory(model.getCategory());
|
||||
modelVo.setCreateTime(model.getCreateTime());
|
||||
modelVo.setVersion(model.getVersion());
|
||||
FlowableMetaInfoBo metaInfo = JSON.parseObject(model.getMetaInfo(), FlowableMetaInfoBo.class);
|
||||
if (metaInfo != null) {
|
||||
modelVo.setDescription(metaInfo.getDescription());
|
||||
modelVo.setFormType(metaInfo.getFormType());
|
||||
modelVo.setFormId(metaInfo.getFormId());
|
||||
}
|
||||
modelVoList.add(modelVo);
|
||||
});
|
||||
return modelVoList;
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveModel(FlowableModelBo modelBo) {
|
||||
// 查询模型信息
|
||||
Model model = repositoryService.getModel(modelBo.getModelId());
|
||||
if (model==null) {
|
||||
throw new RuntimeException("流程模型不存在!");
|
||||
}
|
||||
log.info("==========bpmnxml=========");
|
||||
log.info(modelBo.getBpmnXml());
|
||||
BpmnModel bpmnModel = ModelHelper.getBpmnModel(modelBo.getBpmnXml());
|
||||
if (bpmnModel==null) {
|
||||
throw new RuntimeException("获取模型设计失败!");
|
||||
}
|
||||
//String processName = bpmnModel.getMainProcess().getName();
|
||||
// 获取开始节点
|
||||
StartEvent startEvent = ModelHelper.getStartEvent(bpmnModel);
|
||||
if (startEvent==null) {
|
||||
throw new RuntimeException("开始节点不存在,请检查流程设计是否有误!");
|
||||
}
|
||||
// 获取开始节点配置的表单Key
|
||||
// if (StringUtils.isBlank(startEvent.getFormKey())) {
|
||||
// throw new RuntimeException("请配置流程表单");
|
||||
// }
|
||||
Model newModel;
|
||||
if (Boolean.TRUE.equals(modelBo.getNewVersion())) {
|
||||
newModel = repositoryService.newModel();
|
||||
newModel.setName(model.getName());
|
||||
newModel.setKey(model.getKey());
|
||||
newModel.setCategory(model.getCategory());
|
||||
newModel.setMetaInfo(model.getMetaInfo());
|
||||
//获取最大版本号
|
||||
ModelQuery modelQuery = repositoryService.createModelQuery()
|
||||
.modelName(model.getName())
|
||||
.modelCategory(model.getCategory())
|
||||
.orderByModelVersion()
|
||||
.desc();
|
||||
int offset = 1 * (1 - 1);
|
||||
List<Model> modelList = modelQuery.listPage(offset, 1);
|
||||
newModel.setVersion(modelList.get(0).getVersion() + 1);
|
||||
} else {
|
||||
newModel = model;
|
||||
// 设置流程名称
|
||||
newModel.setName(model.getName());
|
||||
}
|
||||
// 保存流程模型
|
||||
repositoryService.saveModel(newModel);
|
||||
// 保存 BPMN XML
|
||||
repositoryService.addModelEditorSource(newModel.getId(), ModelHelper.getBpmnXml(bpmnModel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置为最新版本
|
||||
*
|
||||
* @param modelId
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void latestModel(String modelId) throws UnsupportedEncodingException {
|
||||
// 获取流程模型
|
||||
Model model = repositoryService.getModel(modelId);
|
||||
if (model==null) {
|
||||
throw new RuntimeException("流程模型不存在!");
|
||||
}
|
||||
String bpmnXml = queryBpmnXmlById(modelId);
|
||||
Integer latestVersion = repositoryService.createModelQuery()
|
||||
.modelKey(model.getKey())
|
||||
.latestVersion()
|
||||
.singleResult()
|
||||
.getVersion();
|
||||
if (model.getVersion().equals(latestVersion)) {
|
||||
throw new RuntimeException("当前版本已是最新版!");
|
||||
}
|
||||
Model newModel = repositoryService.newModel();
|
||||
newModel.setName(model.getName());
|
||||
newModel.setKey(model.getKey());
|
||||
newModel.setCategory(model.getCategory());
|
||||
newModel.setMetaInfo(model.getMetaInfo());
|
||||
newModel.setVersion(latestVersion + 1);
|
||||
// 保存流程模型
|
||||
repositoryService.saveModel(newModel);
|
||||
// 保存 BPMN XML
|
||||
repositoryService.addModelEditorSource(newModel.getId(), bpmnXml.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
package com.yanzhu.flowable.service.impl;
|
||||
|
||||
import com.yanzhu.flowable.domain.SysDeployForm;
|
||||
import com.yanzhu.flowable.domain.SysForm;
|
||||
import com.yanzhu.flowable.mapper.SysDeployFormMapper;
|
||||
import com.yanzhu.flowable.service.ISysDeployFormService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 流程实例关联表单Service业务层处理
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
@Service
|
||||
public class SysDeployFormServiceImpl implements ISysDeployFormService {
|
||||
@Autowired
|
||||
private SysDeployFormMapper sysDeployFormMapper;
|
||||
|
||||
/**
|
||||
* 查询流程实例关联表单
|
||||
*
|
||||
* @param id 流程实例关联表单ID
|
||||
* @return 流程实例关联表单
|
||||
*/
|
||||
@Override
|
||||
public SysDeployForm selectSysDeployFormById(Long id) {
|
||||
return sysDeployFormMapper.selectSysDeployFormById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程实例关联表单列表
|
||||
*
|
||||
* @param sysDeployForm 流程实例关联表单
|
||||
* @return 流程实例关联表单
|
||||
*/
|
||||
@Override
|
||||
public List<SysDeployForm> selectSysDeployFormList(SysDeployForm sysDeployForm) {
|
||||
return sysDeployFormMapper.selectSysDeployFormList(sysDeployForm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程实例关联表单
|
||||
*
|
||||
* @param sysDeployForm 流程实例关联表单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysDeployForm(SysDeployForm sysDeployForm) {
|
||||
SysForm sysForm = sysDeployFormMapper.selectSysDeployFormByDeployId(sysDeployForm.getDeployId());
|
||||
if (Objects.isNull(sysForm)) {
|
||||
return sysDeployFormMapper.insertSysDeployForm(sysDeployForm);
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程实例关联表单
|
||||
*
|
||||
* @param sysDeployForm 流程实例关联表单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysDeployForm(SysDeployForm sysDeployForm) {
|
||||
return sysDeployFormMapper.updateSysDeployForm(sysDeployForm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除流程实例关联表单
|
||||
*
|
||||
* @param ids 需要删除的流程实例关联表单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysDeployFormByIds(Long[] ids) {
|
||||
return sysDeployFormMapper.deleteSysDeployFormByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程实例关联表单信息
|
||||
*
|
||||
* @param id 流程实例关联表单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysDeployFormById(Long id) {
|
||||
return sysDeployFormMapper.deleteSysDeployFormById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程挂着的表单
|
||||
*
|
||||
* @param deployId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public SysForm selectSysDeployFormByDeployId(String deployId) {
|
||||
return sysDeployFormMapper.selectSysDeployFormByDeployId(deployId);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
package com.yanzhu.flowable.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.flowable.domain.SysExpression;
|
||||
import com.yanzhu.flowable.mapper.SysExpressionMapper;
|
||||
import com.yanzhu.flowable.service.ISysExpressionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程达式Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-12-12
|
||||
*/
|
||||
@Service
|
||||
public class SysExpressionServiceImpl implements ISysExpressionService
|
||||
{
|
||||
@Autowired
|
||||
private SysExpressionMapper sysExpressionMapper;
|
||||
|
||||
/**
|
||||
* 查询流程达式
|
||||
*
|
||||
* @param id 流程达式主键
|
||||
* @return 流程达式
|
||||
*/
|
||||
@Override
|
||||
public SysExpression selectSysExpressionById(Long id)
|
||||
{
|
||||
return sysExpressionMapper.selectSysExpressionById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程达式列表
|
||||
*
|
||||
* @param sysExpression 流程达式
|
||||
* @return 流程达式
|
||||
*/
|
||||
@Override
|
||||
public List<SysExpression> selectSysExpressionList(SysExpression sysExpression)
|
||||
{
|
||||
return sysExpressionMapper.selectSysExpressionList(sysExpression);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程达式
|
||||
*
|
||||
* @param sysExpression 流程达式
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysExpression(SysExpression sysExpression)
|
||||
{
|
||||
sysExpression.setCreateTime(DateUtils.getNowDate());
|
||||
return sysExpressionMapper.insertSysExpression(sysExpression);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程达式
|
||||
*
|
||||
* @param sysExpression 流程达式
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysExpression(SysExpression sysExpression)
|
||||
{
|
||||
sysExpression.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysExpressionMapper.updateSysExpression(sysExpression);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除流程达式
|
||||
*
|
||||
* @param ids 需要删除的流程达式主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysExpressionByIds(Long[] ids)
|
||||
{
|
||||
return sysExpressionMapper.deleteSysExpressionByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程达式信息
|
||||
*
|
||||
* @param id 流程达式主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysExpressionById(Long id)
|
||||
{
|
||||
return sysExpressionMapper.deleteSysExpressionById(id);
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue