工作流
parent
72cf76c249
commit
fe56d910ae
23
pom.xml
23
pom.xml
|
@ -34,7 +34,8 @@
|
|||
<jjwt.version>0.9.1</jjwt.version>
|
||||
<minio.version>8.2.2</minio.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<flowable.version>6.7.2</flowable.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>
|
||||
|
||||
|
@ -69,12 +70,6 @@
|
|||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.flowable</groupId>
|
||||
<artifactId>flowable-spring-boot-starter</artifactId>
|
||||
<version>${flowable.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- FastDFS 分布式文件系统 -->
|
||||
<dependency>
|
||||
<groupId>com.github.tobato</groupId>
|
||||
|
@ -150,6 +145,20 @@
|
|||
<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,25 +0,0 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
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;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Tony
|
||||
* @date 2021/3/31 23:20
|
||||
*/
|
||||
@Data
|
||||
public class FlowFromFieldDTO implements Serializable {
|
||||
|
||||
private Object fields;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
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,43 +0,0 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 流程定义类型
|
||||
*/
|
||||
private String prtype;
|
||||
|
||||
/**
|
||||
* 流程单位
|
||||
*/
|
||||
private String ownerDeptId;
|
||||
|
||||
/**
|
||||
* 流程项目
|
||||
*/
|
||||
private String OwnerProjectId;
|
||||
|
||||
/**
|
||||
* xml 文件
|
||||
*/
|
||||
private String xml;
|
||||
}
|
|
@ -1,103 +0,0 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
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 procVars;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
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;
|
||||
}
|
|
@ -6,28 +6,28 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
|
|||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 流程达式对象 sys_expression
|
||||
* 流程分类对象 flowable_category
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-12-12
|
||||
* @date 2023-11-27
|
||||
*/
|
||||
public class SysExpression extends BaseEntity
|
||||
public class FlowableCategory extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 表单主键 */
|
||||
/** 流程分类id */
|
||||
private Long id;
|
||||
|
||||
/** 表达式名称 */
|
||||
@Excel(name = "表达式名称")
|
||||
/** 流程分类名称 */
|
||||
@Excel(name = "流程分类名称")
|
||||
private String name;
|
||||
|
||||
/** 表达式内容 */
|
||||
@Excel(name = "表达式内容")
|
||||
private String expression;
|
||||
/** 分类编码 */
|
||||
@Excel(name = "分类编码")
|
||||
private String code;
|
||||
|
||||
/** 状态 */
|
||||
private Integer status;
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
|
@ -47,23 +47,23 @@ public class SysExpression extends BaseEntity
|
|||
{
|
||||
return name;
|
||||
}
|
||||
public void setExpression(String expression)
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.expression = expression;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getExpression()
|
||||
public String getCode()
|
||||
{
|
||||
return expression;
|
||||
return code;
|
||||
}
|
||||
public void setStatus(Integer status)
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.status = status;
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Integer getStatus()
|
||||
public String getDelFlag()
|
||||
{
|
||||
return status;
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -71,13 +71,13 @@ public class SysExpression extends BaseEntity
|
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("expression", getExpression())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("status", getStatus())
|
||||
.append("code", getCode())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("delFlag", getDelFlag())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
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();
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* 流程字段定义对象 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();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
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();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 为了方便查询,提供一个组合类
|
||||
*/
|
||||
@Data
|
||||
public class FlowableFieldSearch extends FlowableFieldRef {
|
||||
|
||||
/** 字段范围 */
|
||||
private String scope;
|
||||
}
|
|
@ -0,0 +1,165 @@
|
|||
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();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
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();
|
||||
}
|
||||
}
|
|
@ -1,64 +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;
|
||||
|
||||
/**
|
||||
* 流程实例关联表单对象 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();
|
||||
}
|
||||
}
|
|
@ -1,70 +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;
|
||||
|
||||
/**
|
||||
* 流程表单对象 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();
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* 流程监听对象 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();
|
||||
}
|
||||
}
|
|
@ -1,65 +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;
|
||||
|
||||
/**
|
||||
* 流程任务关联单对象 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();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
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;
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
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;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.yanzhu.flowable.domain.vo;
|
||||
package com.yanzhu.flowable.domain.my;
|
||||
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
|
@ -1,4 +1,5 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
package com.yanzhu.flowable.domain.my;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
|
@ -1,4 +1,4 @@
|
|||
package com.yanzhu.flowable.domain;
|
||||
package com.yanzhu.flowable.domain.my;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
|
@ -1,49 +0,0 @@
|
|||
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 category;
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty("结束时间")
|
||||
private String endTime;
|
||||
|
||||
@ApiModelProperty("当前页码")
|
||||
private Integer pageNum;
|
||||
|
||||
@ApiModelProperty("每页条数")
|
||||
private Integer pageSize;
|
||||
|
||||
@ApiModelProperty("单位主键")
|
||||
private Long deptId;
|
||||
|
||||
@ApiModelProperty("单位名称")
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty("项目主键")
|
||||
private Long projectId;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("单位祖籍列表")
|
||||
private String deptAncestors;
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
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 Map<String, Object> applyInfos;
|
||||
|
||||
@ApiModelProperty("审批人")
|
||||
private String assignee;
|
||||
|
||||
@ApiModelProperty("候选人")
|
||||
private List<String> candidateUsers;
|
||||
|
||||
@ApiModelProperty("审批组")
|
||||
private List<String> candidateGroups;
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package com.yanzhu.flowable.domain.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class ProcKeyRole implements Serializable
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String roleId;
|
||||
|
||||
private String key;
|
||||
|
||||
private String sort;
|
||||
|
||||
private List<String> keys;
|
||||
|
||||
public String getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(String roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public List<String> getKeys() {
|
||||
return keys;
|
||||
}
|
||||
|
||||
public void setKeys(List<String> keys) {
|
||||
this.keys = keys;
|
||||
}
|
||||
|
||||
public String getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(String sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
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;
|
||||
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
package com.yanzhu.flowable.domain.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 流程实例启动
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2020-07-07
|
||||
*/
|
||||
public class StartTaskVO implements Serializable
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//流程实例ID
|
||||
private String procDefId;
|
||||
private String userId;
|
||||
private String userName;
|
||||
private String nickName;
|
||||
private Map<String, Object> variables;
|
||||
|
||||
public String getProcDefId() {
|
||||
return procDefId;
|
||||
}
|
||||
|
||||
public void setProcDefId(String procDefId) {
|
||||
this.procDefId = procDefId;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getNickName() {
|
||||
return nickName;
|
||||
}
|
||||
|
||||
public void setNickName(String nickName) {
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public Map<String, Object> getVariables() {
|
||||
return variables;
|
||||
}
|
||||
|
||||
public void setVariables(Map<String, Object> variables) {
|
||||
this.variables = variables;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package com.yanzhu.flowable.mapper;
|
||||
|
||||
import com.yanzhu.flowable.domain.FlowTaskEntity;
|
||||
import com.yanzhu.flowable.domain.my.FlowTaskEntity;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
@ -1,76 +0,0 @@
|
|||
package com.yanzhu.flowable.mapper;
|
||||
|
||||
import com.yanzhu.flowable.domain.FlowProcDefDto;
|
||||
import com.yanzhu.flowable.domain.vo.FlowDeptVo;
|
||||
import com.yanzhu.flowable.domain.vo.FlowQueryVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 流程定义查询
|
||||
*
|
||||
* @author Tony
|
||||
* @email
|
||||
* @date 2022/1/29 5:44 下午
|
||||
**/
|
||||
public interface FlowDeployMapper {
|
||||
|
||||
/**
|
||||
* 流程定义列表
|
||||
* @param roleId 发起角色
|
||||
* @param category 流程类别
|
||||
* @param name 流程名称
|
||||
* @return
|
||||
*/
|
||||
List<FlowProcDefDto> selectDeployList(@Param("roleId")String roleId, @Param("category")String category, @Param("name")String name);
|
||||
|
||||
/**
|
||||
* 我的流程定义列表
|
||||
* @param username 登录用户
|
||||
* @param category 流程类别
|
||||
* @param name 流程名称
|
||||
* @return
|
||||
*/
|
||||
List<FlowProcDefDto> selectMyDeployList(@Param("username")String username, @Param("category")String category, @Param("name")String name);
|
||||
|
||||
/**
|
||||
* 流程定义列表
|
||||
* @param flowQueryVo 流程查询
|
||||
* @return
|
||||
*/
|
||||
List<FlowProcDefDto> selectDeployList(FlowQueryVo flowQueryVo);
|
||||
|
||||
/**
|
||||
* 新增单位流程关系
|
||||
*
|
||||
* @param flowDeptVo 流程 单位关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertActReProcdefDept(FlowDeptVo flowDeptVo);
|
||||
|
||||
/**
|
||||
* 根据角色删除流程定义
|
||||
* @param roleId 橘色
|
||||
* @return
|
||||
*/
|
||||
int deleteDeployByRoleId(String roleId);
|
||||
|
||||
|
||||
/**
|
||||
* 批量新增流程定义角色配置
|
||||
* @param items 列表
|
||||
* @return
|
||||
*/
|
||||
int batchDeployRoleRole(List<Map<String, Object>> items);
|
||||
|
||||
/**
|
||||
* 流程发起排序设置
|
||||
* @param roleId 角色主键
|
||||
* @param key 流程
|
||||
* @param sort 排序
|
||||
* @return
|
||||
*/
|
||||
int updateProcKeyRoleSort(@Param("roleId")String roleId, @Param("key")String key, @Param("sort")String sort);
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
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);
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
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);
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
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);
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
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);
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
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);
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
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);
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
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);
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
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);
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
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);
|
||||
}
|
|
@ -24,7 +24,7 @@
|
|||
<!-- fa.assigneeId,-->
|
||||
<!-- fa.assigneeName,-->
|
||||
<!-- fa.assigneeDeptName-->
|
||||
<select id="selectAllFlowTaskByParams" parameterType="com.yanzhu.flowable.domain.FlowTaskEntity" resultType="com.yanzhu.flowable.domain.FlowTaskEntity">
|
||||
<select id="selectAllFlowTaskByParams" parameterType="FlowTaskEntity" resultType="FlowTaskEntity">
|
||||
SELECT * FROM
|
||||
vw_flow_all fa
|
||||
<where>
|
||||
|
@ -52,7 +52,7 @@
|
|||
</select>
|
||||
|
||||
<!--查询工作流任务-->
|
||||
<select id="findFlowTaskByProcInsId" parameterType="string" resultType="com.yanzhu.flowable.domain.FlowTaskEntity">
|
||||
<select id="findFlowTaskByProcInsId" parameterType="string" resultType="FlowTaskEntity">
|
||||
select vf.* as startUserPhone from vw_flow_all vf
|
||||
where vf.procInsId = #{procInsId}
|
||||
</select>
|
||||
|
@ -72,7 +72,7 @@
|
|||
</select>
|
||||
|
||||
<!--查询我的代办任务-->
|
||||
<select id="selectMyAwaitFlowTask" parameterType="com.yanzhu.flowable.domain.FlowTaskEntity" resultType="map">
|
||||
<select id="selectMyAwaitFlowTask" parameterType="FlowTaskEntity" resultType="map">
|
||||
select fa.* from vw_flow_await fa
|
||||
where
|
||||
1=1
|
||||
|
@ -107,7 +107,7 @@
|
|||
</select>
|
||||
|
||||
<!--根据条件查询我的代办分组数量统计-->
|
||||
<select id="findAwaitCountGroupByCategory" parameterType="com.yanzhu.flowable.domain.FlowTaskEntity" resultType="map">
|
||||
<select id="findAwaitCountGroupByCategory" parameterType="FlowTaskEntity" resultType="map">
|
||||
select fa.category,count(1) as total from vw_flow_await fa
|
||||
where
|
||||
1=1
|
||||
|
@ -141,7 +141,7 @@
|
|||
</select>
|
||||
|
||||
<!--查询我的已办任务-->
|
||||
<select id="selectMyFinishedFlowTask" parameterType="com.yanzhu.flowable.domain.FlowTaskEntity" resultType="map">
|
||||
<select id="selectMyFinishedFlowTask" parameterType="FlowTaskEntity" resultType="map">
|
||||
select fa.* from vw_flow_finished fa
|
||||
where
|
||||
fa.ASSIGNEE_=#{nowUser}
|
||||
|
@ -153,7 +153,7 @@
|
|||
order by fa.endTime desc
|
||||
</select>
|
||||
|
||||
<select id="groupByCategory" parameterType="com.yanzhu.flowable.domain.FlowTaskEntity" resultType="com.yanzhu.flowable.domain.FlowTaskEntity">
|
||||
<select id="groupByCategory" parameterType="FlowTaskEntity" resultType="FlowTaskEntity">
|
||||
SELECT a.dict_label taskName,b.cnt assigneeId,c.cnt procDefVersion FROM
|
||||
( SELECT * FROM sys_dict_data WHERE dict_type = 'sys_process_category') a
|
||||
LEFT JOIN (SELECT category,COUNT(1) cnt FROM vw_flow_all WHERE finishTime IS NOT NULL
|
||||
|
@ -182,7 +182,7 @@
|
|||
GROUP BY category) c ON a.dict_value=c.category
|
||||
</select>
|
||||
|
||||
<select id="groupByUnit" parameterType="com.yanzhu.flowable.domain.FlowTaskEntity" resultType="com.yanzhu.flowable.domain.FlowTaskEntity">
|
||||
<select id="groupByUnit" parameterType="FlowTaskEntity" resultType="FlowTaskEntity">
|
||||
SELECT cat taskName, COUNT(1) assigneeId FROM (
|
||||
SELECT *,'总包单位' cat FROM vw_flow_all WHERE finishTime IS NULL AND taskName LIKE '总包%'
|
||||
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
|
||||
|
@ -242,7 +242,7 @@
|
|||
GROUP BY cat
|
||||
</select>
|
||||
|
||||
<select id="groupByUnitFinish" parameterType="com.yanzhu.flowable.domain.FlowTaskEntity" resultType="com.yanzhu.flowable.domain.FlowTaskEntity">
|
||||
<select id="groupByUnitFinish" parameterType="FlowTaskEntity" resultType="FlowTaskEntity">
|
||||
SELECT cat taskName, COUNT(1) assigneeId FROM (
|
||||
SELECT *,'总包单位' cat FROM vw_flow_all WHERE taskName LIKE '总包%' AND taskName!='提交申请' and finishTime IS not NULL
|
||||
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
|
||||
|
@ -302,7 +302,7 @@
|
|||
GROUP BY cat
|
||||
</select>
|
||||
|
||||
<select id="groupByUnitTotal" parameterType="com.yanzhu.flowable.domain.FlowTaskEntity" resultType="com.yanzhu.flowable.domain.FlowTaskEntity">
|
||||
<select id="groupByUnitTotal" parameterType="FlowTaskEntity" resultType="FlowTaskEntity">
|
||||
SELECT cat taskName, COUNT(1) assigneeId FROM (
|
||||
SELECT *,'总包单位' cat FROM vw_flow_all WHERE taskName LIKE '总包%' AND taskName!='提交申请'
|
||||
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
|
||||
|
@ -362,7 +362,7 @@
|
|||
GROUP BY cat
|
||||
</select>
|
||||
|
||||
<select id="listByCategory" parameterType="com.yanzhu.flowable.domain.FlowTaskEntity" resultType="com.yanzhu.flowable.domain.FlowTaskEntity">
|
||||
<select id="listByCategory" parameterType="FlowTaskEntity" resultType="FlowTaskEntity">
|
||||
SELECT * FROM vw_flow_all
|
||||
<where>
|
||||
<if test="category != null and category != ''"> and category = #{category}</if>
|
||||
|
@ -378,7 +378,7 @@
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="listByUnit" parameterType="com.yanzhu.flowable.domain.FlowTaskEntity" resultType="com.yanzhu.flowable.domain.FlowTaskEntity">
|
||||
<select id="listByUnit" parameterType="FlowTaskEntity" resultType="FlowTaskEntity">
|
||||
SELECT * FROM vw_flow_all WHERE finishTime IS NULL
|
||||
<if test="taskId!=null">
|
||||
<if test="taskId==1"> AND taskName LIKE '总包%' </if>
|
||||
|
@ -398,7 +398,7 @@
|
|||
</if>
|
||||
</select>
|
||||
|
||||
<select id="listByState" parameterType="com.yanzhu.flowable.domain.FlowTaskEntity" resultType="com.yanzhu.flowable.domain.FlowTaskEntity">
|
||||
<select id="listByState" parameterType="FlowTaskEntity" resultType="FlowTaskEntity">
|
||||
SELECT * FROM vw_flow_all
|
||||
<where>
|
||||
<if test="taskId!=null">
|
||||
|
@ -418,7 +418,7 @@
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="groupByProject" resultType="com.yanzhu.flowable.domain.FlowTaskEntity" parameterType="long">
|
||||
<select id="groupByProject" resultType="FlowTaskEntity" parameterType="long">
|
||||
SELECT a.businessKey,a.cnt duration ,b.projectName businessKeyName FROM (
|
||||
SELECT businessKey,COUNT(1) cnt FROM vw_flow_all WHERE taskName!='提交申请'
|
||||
<if test="deptId !=null and deptId>0">and businessDeptId=#{deptId}</if>
|
||||
|
@ -427,7 +427,7 @@
|
|||
ORDER BY a.cnt DESC
|
||||
</select>
|
||||
|
||||
<select id="findSafetyWorkList" parameterType="com.yanzhu.flowable.domain.FlowTaskEntity" resultType="com.yanzhu.flowable.domain.FlowTaskEntity">
|
||||
<select id="findSafetyWorkList" parameterType="FlowTaskEntity" resultType="FlowTaskEntity">
|
||||
SELECT
|
||||
fa.procInsId,
|
||||
fa.deployId,
|
||||
|
@ -465,7 +465,7 @@
|
|||
select * from sur_project where id = #{proId}
|
||||
</select>
|
||||
|
||||
<select id="groupFlowBySubDeptType" parameterType="com.yanzhu.flowable.domain.FlowTaskEntity" resultType="com.yanzhu.flowable.domain.FlowTaskEntity">
|
||||
<select id="groupFlowBySubDeptType" parameterType="FlowTaskEntity" resultType="FlowTaskEntity">
|
||||
select x.dict_label taskName,y.taskId from (
|
||||
select dict_value,dict_label
|
||||
from sys_dict_data where dict_type='flow_sub_dept_type'
|
||||
|
@ -491,7 +491,7 @@
|
|||
group by d.dict_value,d.dict_label
|
||||
) y on x.dict_value=y.dict_value
|
||||
</select>
|
||||
<select id="listFlowBySubDeptType" parameterType="com.yanzhu.flowable.domain.FlowTaskEntity" resultType="com.yanzhu.flowable.domain.FlowTaskEntity">
|
||||
<select id="listFlowBySubDeptType" parameterType="FlowTaskEntity" resultType="FlowTaskEntity">
|
||||
SELECT a.procInsId,a.deployId,a.createTime,a.finishTime,a.businessKey,a.businessKeyName,a.startDeptName,b.TEXT_ as taskId, c.TEXT_ as deptName,d.dict_label taskName FROM
|
||||
vw_flow_all a
|
||||
LEFT JOIN act_hi_varinst b ON a.procInsId=b.PROC_INST_ID_ AND b.NAME_='subDeptType'
|
||||
|
@ -510,6 +510,124 @@
|
|||
</foreach>
|
||||
</if>
|
||||
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
|
||||
|
||||
</select>
|
||||
|
||||
<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,
|
||||
rpd.DEPT_ID_ as deptId,
|
||||
sd.dept_name as deptName,
|
||||
rpd.PROJ_ID_ as projectId,
|
||||
spi.project_name as projectName
|
||||
FROM
|
||||
act_re_procdef rp
|
||||
LEFT JOIN act_re_deployment rd ON rp.deployment_id_ = rd.id_
|
||||
left join act_re_procdef_dept rpd on rp.id_ = rpd.PROCDEF_ID_
|
||||
left join sys_dept sd on sd.dept_id = rpd.DEPT_ID_
|
||||
left join pro_project_info spi on spi.id = rpd.PROJ_ID_
|
||||
<where>
|
||||
rp.SUSPENSION_STATE_ = 1
|
||||
<if test="deptId != null">
|
||||
and rpd.DEPT_ID_ = #{deptId}
|
||||
</if>
|
||||
<if test="deptName != null and deptName != ''">
|
||||
and sd.dept_name like concat('%', #{deptName}, '%')
|
||||
</if>
|
||||
<if test="projectId != null">
|
||||
and rpd.PROJ_ID_ = #{projectId}
|
||||
</if>
|
||||
<if test="projectName != null and projectName != ''">
|
||||
and spi.project_name like concat('%', #{projectName}, '%')
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and rd.name_ like concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="category != null and category != ''">
|
||||
and rd.category_ = #{category}
|
||||
</if>
|
||||
<if test="flowKey != null and flowKey != ''">
|
||||
and rd.key_ = #{flowKey}
|
||||
</if>
|
||||
</where>
|
||||
order by rpd.SORT_
|
||||
</select>
|
||||
|
||||
<select id="selectMyDeployList" resultType="FlowProcDefDto">
|
||||
SELECT * FROM (
|
||||
SELECT
|
||||
rp.id_ as id,
|
||||
rp.deployment_id_ as deploymentId,
|
||||
rd.name_ as name,
|
||||
rd.category_ as category,
|
||||
sdd.dict_label as categoryName,
|
||||
rp.key_ as flowKey,
|
||||
rp.version_ as version,
|
||||
rp.suspension_state_ as suspensionState,
|
||||
rd.deploy_time_ as deploymentTime,
|
||||
ROW_NUMBER () OVER (
|
||||
PARTITION BY rp.key_
|
||||
ORDER BY
|
||||
rp.version_ DESC
|
||||
) AS rn
|
||||
FROM
|
||||
act_re_procdef rp
|
||||
LEFT JOIN act_re_deployment rd ON rp.deployment_id_ = rd.id_
|
||||
left join sys_dict_data sdd on sdd.dict_type='sys_process_category' and sdd.dict_value = rd.category_
|
||||
left join act_re_procdef_role rpr on rp.key_ = rpr.PROCDEF_KEY_
|
||||
left join sys_user_role sur on sur.role_id = rpr.ROLE_ID_
|
||||
left join sys_user su on su.user_id = sur.user_id
|
||||
<where>
|
||||
rp.SUSPENSION_STATE_ = 1 and su.user_name = #{username}
|
||||
<if test="name != null and name != ''">
|
||||
and rd.name_ like concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="category != null and category != ''">
|
||||
and rd.category_ = #{category}
|
||||
</if>
|
||||
</where>
|
||||
order by rd.deploy_time_ desc
|
||||
) v WHERE v.rn = 1
|
||||
</select>
|
||||
|
||||
<delete id="deleteDeployByRoleId" parameterType="string">
|
||||
delete from act_re_procdef_role where ROLE_ID_ = #{roleId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchDeployRoleRole">
|
||||
insert into act_re_procdef_role( PROCDEF_KEY_, ROLE_ID_) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.key}, #{item.roleId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateProcKeyRoleSort">
|
||||
update act_re_procdef_role set SORT_=#{sort} where PROCDEF_KEY_=#{key} and ROLE_ID_=#{roleId}
|
||||
</update>
|
||||
|
||||
<!--新增项目单位流程关系-->
|
||||
<insert id="insertActReProcdefDept" parameterType="FlowDeptVo">
|
||||
insert into act_re_procdef_dept
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="procdefId != null">PROCDEF_ID_,</if>
|
||||
<if test="prtype != null">TYPE_,</if>
|
||||
<if test="deptId != null">DEPT_ID_,</if>
|
||||
<if test="projId != null">PROJ_ID_,</if>
|
||||
<if test="sort != null">SORT_,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="procdefId != null">#{procdefId},</if>
|
||||
<if test="prtype != null">#{prtype},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="projId != null">#{projId},</if>
|
||||
<if test="sort != null">#{sort},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
|
@ -1,125 +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.FlowDeployMapper">
|
||||
|
||||
<select id="selectDeployList" resultType="com.yanzhu.flowable.domain.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,
|
||||
rpd.DEPT_ID_ as deptId,
|
||||
sd.dept_name as deptName,
|
||||
rpd.PROJ_ID_ as projectId,
|
||||
spi.project_name as projectName
|
||||
FROM
|
||||
act_re_procdef rp
|
||||
LEFT JOIN act_re_deployment rd ON rp.deployment_id_ = rd.id_
|
||||
left join act_re_procdef_dept rpd on rp.id_ = rpd.PROCDEF_ID_
|
||||
left join sys_dept sd on sd.dept_id = rpd.DEPT_ID_
|
||||
left join pro_project_info spi on spi.id = rpd.PROJ_ID_
|
||||
<where>
|
||||
rp.SUSPENSION_STATE_ = 1
|
||||
<if test="deptId != null">
|
||||
and rpd.DEPT_ID_ = #{deptId}
|
||||
</if>
|
||||
<if test="deptName != null and deptName != ''">
|
||||
and sd.dept_name like concat('%', #{deptName}, '%')
|
||||
</if>
|
||||
<if test="projectId != null">
|
||||
and rpd.PROJ_ID_ = #{projectId}
|
||||
</if>
|
||||
<if test="projectName != null and projectName != ''">
|
||||
and spi.project_name like concat('%', #{projectName}, '%')
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and rd.name_ like concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="category != null and category != ''">
|
||||
and rd.category_ = #{category}
|
||||
</if>
|
||||
<if test="flowKey != null and flowKey != ''">
|
||||
and rd.key_ = #{flowKey}
|
||||
</if>
|
||||
</where>
|
||||
order by rpr.SORT_
|
||||
</select>
|
||||
|
||||
<select id="selectMyDeployList" resultType="com.yanzhu.flowable.domain.FlowProcDefDto">
|
||||
SELECT * FROM (
|
||||
SELECT
|
||||
rp.id_ as id,
|
||||
rp.deployment_id_ as deploymentId,
|
||||
rd.name_ as name,
|
||||
rd.category_ as category,
|
||||
sdd.dict_label as categoryName,
|
||||
rp.key_ as flowKey,
|
||||
rp.version_ as version,
|
||||
rp.suspension_state_ as suspensionState,
|
||||
rd.deploy_time_ as deploymentTime,
|
||||
ROW_NUMBER () OVER (
|
||||
PARTITION BY rp.key_
|
||||
ORDER BY
|
||||
rp.version_ DESC
|
||||
) AS rn
|
||||
FROM
|
||||
act_re_procdef rp
|
||||
LEFT JOIN act_re_deployment rd ON rp.deployment_id_ = rd.id_
|
||||
left join sys_dict_data sdd on sdd.dict_type='sys_process_category' and sdd.dict_value = rd.category_
|
||||
left join act_re_procdef_role rpr on rp.key_ = rpr.PROCDEF_KEY_
|
||||
left join sys_user_role sur on sur.role_id = rpr.ROLE_ID_
|
||||
left join sys_user su on su.user_id = sur.user_id
|
||||
<where>
|
||||
rp.SUSPENSION_STATE_ = 1 and su.user_name = #{username}
|
||||
<if test="name != null and name != ''">
|
||||
and rd.name_ like concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="category != null and category != ''">
|
||||
and rd.category_ = #{category}
|
||||
</if>
|
||||
</where>
|
||||
order by rd.deploy_time_ desc
|
||||
) v WHERE v.rn = 1
|
||||
</select>
|
||||
|
||||
<delete id="deleteDeployByRoleId" parameterType="string">
|
||||
delete from act_re_procdef_role where ROLE_ID_ = #{roleId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchDeployRoleRole">
|
||||
insert into act_re_procdef_role( PROCDEF_KEY_, ROLE_ID_) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.key}, #{item.roleId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateProcKeyRoleSort">
|
||||
update act_re_procdef_role set SORT_=#{sort} where PROCDEF_KEY_=#{key} and ROLE_ID_=#{roleId}
|
||||
</update>
|
||||
|
||||
<!--新增项目单位流程关系-->
|
||||
<insert id="insertActReProcdefDept" parameterType="com.yanzhu.flowable.domain.vo.FlowDeptVo">
|
||||
insert into act_re_procdef_dept
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="procdefId != null">PROCDEF_ID_,</if>
|
||||
<if test="prtype != null">TYPE_,</if>
|
||||
<if test="deptId != null">DEPT_ID_,</if>
|
||||
<if test="projId != null">PROJ_ID_,</if>
|
||||
<if test="sort != null">SORT_,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="procdefId != null">#{procdefId},</if>
|
||||
<if test="prtype != null">#{prtype},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="projId != null">#{projId},</if>
|
||||
<if test="sort != null">#{sort},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
|
@ -2,83 +2,82 @@
|
|||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.flowable.mapper.SysExpressionMapper">
|
||||
<mapper namespace="com.yanzhu.flowable.mapper.FlowableCategoryMapper">
|
||||
|
||||
<resultMap type="SysExpression" id="SysExpressionResult">
|
||||
<resultMap type="FlowableCategory" id="FlowableCategoryResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="expression" column="expression" />
|
||||
<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="code" column="code" />
|
||||
<result property="remark" column="remark" />
|
||||
<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="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysExpressionVo">
|
||||
select id, name, expression, create_time, update_time, create_by, update_by, status, remark from sys_expression
|
||||
<sql id="selectFlowableCategoryVo">
|
||||
select id, name, code, remark, create_by, create_time, update_by, update_time, del_flag from flowable_category
|
||||
</sql>
|
||||
|
||||
<select id="selectSysExpressionList" parameterType="SysExpression" resultMap="SysExpressionResult">
|
||||
<include refid="selectSysExpressionVo"/>
|
||||
<select id="selectFlowableCategoryList" parameterType="FlowableCategory" resultMap="FlowableCategoryResult">
|
||||
<include refid="selectFlowableCategoryVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="expression != null and expression != ''"> and expression = #{expression}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="code != null and code != ''"> and code = #{code}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysExpressionById" parameterType="Long" resultMap="SysExpressionResult">
|
||||
<include refid="selectSysExpressionVo"/>
|
||||
<select id="selectFlowableCategoryById" parameterType="Long" resultMap="FlowableCategoryResult">
|
||||
<include refid="selectFlowableCategoryVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysExpression" parameterType="SysExpression" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_expression
|
||||
<insert id="insertFlowableCategory" parameterType="FlowableCategory" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into flowable_category
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="expression != null">expression,</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="code != null">code,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">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="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="expression != null">#{expression},</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="code != null">#{code},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysExpression" parameterType="SysExpression">
|
||||
update sys_expression
|
||||
<update id="updateFlowableCategory" parameterType="FlowableCategory">
|
||||
update flowable_category
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="expression != null">expression = #{expression},</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="code != null">code = #{code},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">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="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysExpressionById" parameterType="Long">
|
||||
delete from sys_expression where id = #{id}
|
||||
<delete id="deleteFlowableCategoryById" parameterType="Long">
|
||||
delete from flowable_category where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysExpressionByIds" parameterType="String">
|
||||
delete from sys_expression where id in
|
||||
<delete id="deleteFlowableCategoryByIds" parameterType="String">
|
||||
delete from flowable_category where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
|
@ -0,0 +1,113 @@
|
|||
<?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>
|
|
@ -0,0 +1,89 @@
|
|||
<?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>
|
|
@ -0,0 +1,87 @@
|
|||
<?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>
|
|
@ -1,66 +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.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="com.yanzhu.flowable.domain.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>
|
|
@ -1,82 +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.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>
|
|
@ -1,115 +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.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>
|
|
@ -1,61 +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.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>
|
|
@ -105,16 +105,14 @@
|
|||
<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>
|
||||
<!-- 排除flowable自带的权限认证 -->
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.flowable</groupId>
|
||||
<artifactId>flowable-spring-security</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
|
|
@ -8,6 +8,8 @@ package com.yanzhu.flowable.common.constant;
|
|||
*/
|
||||
public class ProcessConstants {
|
||||
|
||||
public static final String SUFFIX = ".bpmn";
|
||||
|
||||
/**
|
||||
* 动态数据
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
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;
|
||||
}
|
|
@ -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());
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
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);
|
||||
// }
|
||||
//
|
||||
//}
|
||||
//
|
||||
|
|
|
@ -4,7 +4,7 @@ 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.security.utils.SecurityUtils;
|
||||
import com.yanzhu.flowable.domain.FlowTaskEntity;
|
||||
import com.yanzhu.flowable.domain.my.FlowTaskEntity;
|
||||
import com.yanzhu.flowable.service.IFlowBusinessKeyService;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
|
@ -1,198 +0,0 @@
|
|||
package com.yanzhu.flowable.controller;
|
||||
|
||||
import com.yanzhu.common.core.text.Convert;
|
||||
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.utils.SecurityUtils;
|
||||
import com.yanzhu.flowable.domain.FlowProcDefDto;
|
||||
import com.yanzhu.flowable.domain.FlowSaveXmlVo;
|
||||
import com.yanzhu.flowable.domain.SysExpression;
|
||||
import com.yanzhu.flowable.domain.vo.FlowQueryVo;
|
||||
import com.yanzhu.flowable.service.IFlowDefinitionService;
|
||||
import com.yanzhu.flowable.service.ISysExpressionService;
|
||||
import com.yanzhu.system.api.RemoteFlowService;
|
||||
import com.yanzhu.system.api.RemoteRoleService;
|
||||
import com.yanzhu.system.api.RemoteUserService;
|
||||
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.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;
|
||||
|
||||
@Resource
|
||||
private ISysExpressionService sysExpressionService;
|
||||
|
||||
/**
|
||||
* 流程定义列表
|
||||
*
|
||||
* @param flowQueryVo 流程查询
|
||||
* @return 流程定义分页列表数据
|
||||
*/
|
||||
@GetMapping(value = "/list")
|
||||
@ApiOperation(value = "流程定义列表", response = FlowProcDefDto.class)
|
||||
public TableDataInfo list(FlowQueryVo flowQueryVo) {
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
//超管查询所有数据
|
||||
if(!SecurityUtils.isAdmin(sysUser.getUserId())){
|
||||
flowQueryVo.setDeptAncestors(sysUser.getDept().getAncestors()+","+sysUser.getDeptId());
|
||||
}
|
||||
return flowDefinitionService.list(flowQueryVo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导入流程文件", notes = "上传bpmn20的xml文件")
|
||||
@Log(title = "导入流程文件", businessType = BusinessType.INSERT)
|
||||
@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, null, null, null, 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 {
|
||||
in = new ByteArrayInputStream(vo.getXml().getBytes(StandardCharsets.UTF_8));
|
||||
flowDefinitionService.importFile(vo.getName(), vo.getCategory(), vo.getPrtype(), vo.getOwnerDeptId(), vo.getOwnerProjectId(), 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 = "申请表单") @RequestBody Map<String,Object> applyInfos) {
|
||||
return flowDefinitionService.startProcessInstanceById(procDefId, applyInfos);
|
||||
}
|
||||
|
||||
@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.UPDATE)
|
||||
@DeleteMapping(value = "/{deployIds}")
|
||||
public AjaxResult delete(@PathVariable String[] deployIds) {
|
||||
for (String deployId : deployIds) {
|
||||
flowDefinitionService.delete(deployId);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "指定流程达式列表")
|
||||
@GetMapping("/expList")
|
||||
public AjaxResult expList(SysExpression sysExpression) {
|
||||
List<SysExpression> list = sysExpressionService.selectSysExpressionList(sysExpression);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
package com.yanzhu.flowable.controller;
|
||||
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
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 {
|
||||
|
||||
@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 = "删除流程实例")
|
||||
@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();
|
||||
}
|
||||
}
|
|
@ -1,268 +0,0 @@
|
|||
package com.yanzhu.flowable.controller;
|
||||
|
||||
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.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 {
|
||||
|
||||
@Autowired
|
||||
private IFlowTaskService flowTaskService;
|
||||
|
||||
@ApiOperation(value = "我发起的流程", response = FlowTaskDto.class)
|
||||
@GetMapping(value = "/myProcess")
|
||||
public AjaxResult myProcess(FlowQueryVo queryVo) {
|
||||
return flowTaskService.myProcess(queryVo);
|
||||
}
|
||||
|
||||
@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 AjaxResult todoList(FlowQueryVo queryVo) {
|
||||
return flowTaskService.todoList(queryVo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取已办任务", response = FlowTaskDto.class)
|
||||
@GetMapping(value = "/finishedList")
|
||||
public AjaxResult finishedList(FlowQueryVo queryVo) {
|
||||
return flowTaskService.finishedList(queryVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "流程历史流转记录", response = FlowTaskDto.class)
|
||||
@GetMapping(value = "/flowRecord")
|
||||
public AjaxResult flowRecord(String procInsId, String deployId) {
|
||||
return flowTaskService.flowRecord(procInsId, deployId);
|
||||
}
|
||||
|
||||
|
||||
@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 = "/completeAndModify")
|
||||
public AjaxResult completeAndModify(@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 = "认领/签收任务")
|
||||
@Log(title = "认领/签收流程", businessType = BusinessType.INSERT)
|
||||
@PostMapping(value = "/claim")
|
||||
public AjaxResult claim(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
flowTaskService.claim(flowTaskVo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "取消认领/签收任务")
|
||||
@Log(title = "取消认领/签收流程", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/unClaim")
|
||||
public AjaxResult unClaim(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
flowTaskService.unClaim(flowTaskVo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "委派任务")
|
||||
@Log(title = "委派流程", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/delegateTask")
|
||||
public AjaxResult delegate(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
flowTaskService.delegateTask(flowTaskVo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "任务归还")
|
||||
@Log(title = "归还流程", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/resolveTask")
|
||||
public AjaxResult resolveTask(@RequestBody FlowTaskVo flowTaskVo) {
|
||||
flowTaskService.resolveTask(flowTaskVo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "转办任务")
|
||||
@Log(title = "转办流程", businessType = BusinessType.UPDATE)
|
||||
@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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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.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));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
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));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,172 @@
|
|||
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("设置最新版本失败!");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,152 @@
|
|||
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()));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,111 +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.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("@ss.hasPermi('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("@ss.hasPermi('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>(SysForm.class);
|
||||
util.exportExcel(response, list, "form");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程表单详细信息
|
||||
*/
|
||||
@RequiresPermissions("@ss.hasPermi('flowable:form:query')")
|
||||
@GetMapping(value = "/{formId}")
|
||||
public AjaxResult getInfo(@PathVariable("formId") Long formId) {
|
||||
return AjaxResult.success(SysFormService.selectSysFormById(formId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程表单
|
||||
*/
|
||||
@RequiresPermissions("@ss.hasPermi('flowable:form:add')")
|
||||
@Log(title = "流程表单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysForm sysForm) {
|
||||
return toAjax(SysFormService.insertSysForm(sysForm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程表单
|
||||
*/
|
||||
@RequiresPermissions("@ss.hasPermi('flowable:form:edit')")
|
||||
@Log(title = "流程表单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysForm sysForm) {
|
||||
return toAjax(SysFormService.updateSysForm(sysForm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程表单
|
||||
*/
|
||||
@RequiresPermissions("@ss.hasPermi('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));
|
||||
}
|
||||
}
|
|
@ -135,7 +135,6 @@ 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));
|
||||
|
|
|
@ -0,0 +1,143 @@
|
|||
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,6 +1,6 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.flowable.domain.FlowTaskEntity;
|
||||
import com.yanzhu.flowable.domain.my.FlowTaskEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
|
@ -1,81 +0,0 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.flowable.domain.vo.FlowQueryVo;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Tony
|
||||
* @date 2021-04-03 14:41
|
||||
*/
|
||||
public interface IFlowDefinitionService {
|
||||
|
||||
boolean exist(String processDefinitionKey);
|
||||
|
||||
/**
|
||||
* 流程定义列表
|
||||
*
|
||||
* @param flowQueryVo 流程查询
|
||||
* @return 流程定义分页列表数据
|
||||
*/
|
||||
TableDataInfo list(FlowQueryVo flowQueryVo);
|
||||
|
||||
/**
|
||||
* 导入流程文件
|
||||
* 当每个key的流程第一次部署时,指定版本为1。对其后所有使用相同key的流程定义,
|
||||
* 部署时版本会在该key当前已部署的最高版本号基础上加1。key参数用于区分流程定义
|
||||
* @param name
|
||||
* @param category
|
||||
* @param prtype 流程定义类型
|
||||
* @param OwnerDeptId 流程单位
|
||||
* @param OwnerProjectId 流程项目
|
||||
* @param in
|
||||
*/
|
||||
void importFile(String name, String category, String prtype, String OwnerDeptId, String OwnerProjectId, InputStream in);
|
||||
|
||||
/**
|
||||
* 读取xml
|
||||
* @param deployId
|
||||
* @return
|
||||
*/
|
||||
AjaxResult readXml(String deployId) throws IOException;
|
||||
|
||||
/**
|
||||
* 根据流程定义ID启动流程实例
|
||||
*
|
||||
* @param procDefId 流程ID
|
||||
* @param applyInfos 申请表单
|
||||
* @return
|
||||
*/
|
||||
AjaxResult startProcessInstanceById(String procDefId, Map<String,Object> applyInfos);
|
||||
|
||||
|
||||
/**
|
||||
* 激活或挂起流程定义
|
||||
*
|
||||
* @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);
|
||||
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
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);
|
||||
}
|
|
@ -1,208 +0,0 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.flowable.domain.vo.FlowQueryVo;
|
||||
import com.yanzhu.flowable.domain.vo.FlowTaskVo;
|
||||
import org.flowable.task.api.Task;
|
||||
|
||||
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
|
||||
*/
|
||||
AjaxResult myProcess(FlowQueryVo queryVo);
|
||||
|
||||
/**
|
||||
* 取消申请
|
||||
* 目前实现方式: 直接将当前流程变更为已完成
|
||||
* @param flowTaskVo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult stopProcess(FlowTaskVo flowTaskVo);
|
||||
|
||||
/**
|
||||
* 撤回流程
|
||||
* @param flowTaskVo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult revokeProcess(FlowTaskVo flowTaskVo);
|
||||
|
||||
|
||||
/**
|
||||
* 代办任务列表
|
||||
*
|
||||
* @param queryVo 请求参数
|
||||
* @return
|
||||
*/
|
||||
AjaxResult todoList(FlowQueryVo queryVo);
|
||||
|
||||
|
||||
/**
|
||||
* 已办任务列表
|
||||
*
|
||||
* @param queryVo 请求参数
|
||||
* @return
|
||||
*/
|
||||
AjaxResult finishedList(FlowQueryVo queryVo);
|
||||
|
||||
/**
|
||||
* 流程历史流转记录
|
||||
*
|
||||
* @param procInsId 流程实例Id
|
||||
* @return
|
||||
*/
|
||||
AjaxResult flowRecord(String procInsId,String deployId);
|
||||
|
||||
/**
|
||||
* 根据任务ID查询挂载的表单信息
|
||||
*
|
||||
* @param taskId 任务Id
|
||||
* @return
|
||||
*/
|
||||
Task 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;
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
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);
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
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);
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
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);
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
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);
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
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);
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
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;
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
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);
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
package com.yanzhu.flowable.service;
|
||||
|
||||
import com.yanzhu.flowable.domain.SysExpression;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程达式Service接口
|
||||
*
|
||||
* @author yanZhu
|
||||
* @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);
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
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);
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
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);
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package com.yanzhu.flowable.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.text.Convert;
|
||||
import com.yanzhu.flowable.domain.FlowTaskEntity;
|
||||
import com.yanzhu.flowable.domain.my.FlowTaskEntity;
|
||||
import com.yanzhu.flowable.mapper.FlowBusinessKeyMapper;
|
||||
import com.yanzhu.flowable.service.IFlowBusinessKeyService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -25,6 +25,7 @@ public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService {
|
|||
|
||||
@Resource
|
||||
private FlowBusinessKeyMapper flowBusinessKeyMapper;
|
||||
|
||||
/**
|
||||
* 根据条件查询所有流任务
|
||||
* @param flowTaskEntity
|
||||
|
|
|
@ -1,279 +0,0 @@
|
|||
package com.yanzhu.flowable.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.yanzhu.common.core.constant.HttpStatus;
|
||||
import com.yanzhu.common.core.constant.SecurityConstants;
|
||||
import com.yanzhu.common.core.domain.R;
|
||||
import com.yanzhu.common.core.enums.FlowableEnums;
|
||||
import com.yanzhu.common.core.exception.ServiceException;
|
||||
import com.yanzhu.common.core.text.Convert;
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
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.FlowComment;
|
||||
import com.yanzhu.flowable.domain.FlowProcDefDto;
|
||||
import com.yanzhu.flowable.domain.SysExpression;
|
||||
import com.yanzhu.flowable.domain.vo.FlowDeptVo;
|
||||
import com.yanzhu.flowable.domain.vo.FlowQueryVo;
|
||||
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.RemoteFlowService;
|
||||
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.engine.runtime.ProcessInstance;
|
||||
import org.flowable.image.impl.DefaultProcessDiagramGenerator;
|
||||
import org.flowable.task.api.Task;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 流程定义
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFlowDefinitionService {
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Resource
|
||||
private FlowDeployMapper flowDeployMapper;
|
||||
|
||||
@Autowired
|
||||
private RemoteFlowService remoteFlowService;
|
||||
|
||||
@Resource
|
||||
private ISysDeployFormService sysDeployFormService;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 流程定义列表
|
||||
*
|
||||
* @param flowQueryVo 流程查询
|
||||
* @return 流程定义分页列表数据
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo list(FlowQueryVo flowQueryVo) {
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
PageHelper.startPage(flowQueryVo.getPageNum(), flowQueryVo.getPageSize());
|
||||
List<FlowProcDefDto> list = flowDeployMapper.selectDeployList(flowQueryVo);
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(list);
|
||||
rspData.setTotal(new PageInfo(list).getTotal());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导入流程文件
|
||||
*
|
||||
* 当每个key的流程第一次部署时,指定版本为1。对其后所有使用相同key的流程定义,
|
||||
* 部署时版本会在该key当前已部署的最高版本号基础上加1。key参数用于区分流程定义
|
||||
* @param name 流程名称
|
||||
* @param category 流程类型
|
||||
* @param prtype 流程定义类型
|
||||
* @param OwnerDeptId 流程单位
|
||||
* @param OwnerProjectId 流程项目
|
||||
* @param in 流程文件流
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void importFile(String name, String category, String prtype, String OwnerDeptId, String OwnerProjectId, InputStream in) {
|
||||
if(SecurityUtils.isAdmin(SecurityUtils.getUserId())){
|
||||
throw new ServiceException("请选择项目后导入流程文件...");
|
||||
}
|
||||
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);
|
||||
/**新增流程单位关系**/
|
||||
FlowDeptVo flowDeptVo = new FlowDeptVo();
|
||||
flowDeptVo.setProcdefId(definition.getId());
|
||||
//超管不能导入流程文件
|
||||
if(SecurityUtils.isGSAdmin()){
|
||||
if(StringUtils.isNotEmpty(OwnerDeptId)){
|
||||
// OwnerDeptId转换Long失败...默认返回null
|
||||
flowDeptVo.setDeptId(Convert.toLong(OwnerDeptId));
|
||||
}
|
||||
if(StringUtils.isNotEmpty(OwnerDeptId)){
|
||||
// OwnerDeptId转换Long失败...默认返回null
|
||||
flowDeptVo.setProjId(Convert.toLong(OwnerProjectId));
|
||||
}
|
||||
}else{
|
||||
// 从用户信息中获取项目单位信息...
|
||||
flowDeptVo.setPrtype(prtype);
|
||||
flowDeptVo.setProjId(SecurityUtils.getLoginUser().getProjectId());
|
||||
flowDeptVo.setDeptId(SecurityUtils.getLoginUser().getProjectDeptId());
|
||||
}
|
||||
if(flowDeptVo.getDeptId()!=null){
|
||||
flowDeployMapper.insertActReProcdefDept(flowDeptVo);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取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 applyInfos 流程表单
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult startProcessInstanceById(String procDefId, Map<String,Object> applyInfos) {
|
||||
try {
|
||||
/**保存流程表单**/
|
||||
Map<String, Object> procDefData = redisService.getCacheObject(FlowableEnums.FLOW_KEY_CACHE+procDefId);
|
||||
R<Long> res;
|
||||
if(StringUtils.isNotNull(procDefData)){
|
||||
String procType = Convert.toStr(procDefData.get("TYPE_"));
|
||||
if(StringUtils.isNotNull(procType)){
|
||||
if(Objects.equals(procType,FlowableEnums.SUB_DEPTS.getCode())){
|
||||
res = remoteFlowService.addSubdeptsEntity(applyInfos, SecurityConstants.INNER);
|
||||
}else if(Objects.equals(procType,FlowableEnums.SUB_DEPTS.getCode())){
|
||||
res = remoteFlowService.addSubdeptsGroupEntity(applyInfos, SecurityConstants.INNER);
|
||||
}else if(Objects.equals(procType,FlowableEnums.SUB_DEPTS.getCode())){
|
||||
res = remoteFlowService.addSubdeptsUsersEntity(applyInfos, SecurityConstants.INNER);
|
||||
}else{
|
||||
return AjaxResult.error("审批流程配置异常,请联系管理员配置");
|
||||
}
|
||||
}else{
|
||||
return AjaxResult.error("审批流程配置异常,请联系管理员配置");
|
||||
}
|
||||
}else{
|
||||
return AjaxResult.error("未配置审批流程信息,请联系管理员配置");
|
||||
}
|
||||
if(StringUtils.isNotNull(res.getData())){
|
||||
Map<String, Object> variables = new HashMap<>();
|
||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId)
|
||||
.latestVersion().singleResult();
|
||||
if (Objects.nonNull(processDefinition) && processDefinition.isSuspended()) {
|
||||
return AjaxResult.error("流程已被挂起,请联系管理员激活流程");
|
||||
}
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
String userId = Convert.toStr(sysUser.getUserId());
|
||||
// 设置流程发起人Id到流程中
|
||||
identityService.setAuthenticatedUserId(userId);
|
||||
variables.put(ProcessConstants.PROCESS_INITIATOR, userId);
|
||||
variables.put("businessKey", res.getData());
|
||||
ProcessInstance processInstance;
|
||||
processInstance = runtimeService.startProcessInstanceById(procDefId, Convert.toStr(res.getData()),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(), Convert.toStr(userId));
|
||||
taskService.complete(task.getId(), variables);
|
||||
}
|
||||
return AjaxResult.success("流程启动成功");
|
||||
}else{
|
||||
return AjaxResult.error("流程表单保存失败");
|
||||
}
|
||||
} 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);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,117 +0,0 @@
|
|||
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.getUserId();
|
||||
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
|
@ -0,0 +1,126 @@
|
|||
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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,222 @@
|
|||
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文件异常");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,183 @@
|
|||
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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,423 @@
|
|||
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));
|
||||
}
|
||||
}
|
|
@ -1,112 +0,0 @@
|
|||
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);
|
||||
}
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
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 yanZhu
|
||||
* @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);
|
||||
}
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
package com.yanzhu.flowable.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.flowable.domain.SysForm;
|
||||
import com.yanzhu.flowable.mapper.SysFormMapper;
|
||||
import com.yanzhu.flowable.service.ISysFormService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程表单Service业务层处理
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
@Service
|
||||
public class SysFormServiceImpl implements ISysFormService
|
||||
{
|
||||
@Autowired
|
||||
private SysFormMapper sysFormMapper;
|
||||
|
||||
/**
|
||||
* 查询流程表单
|
||||
*
|
||||
* @param formId 流程表单ID
|
||||
* @return 流程表单
|
||||
*/
|
||||
@Override
|
||||
public SysForm selectSysFormById(Long formId)
|
||||
{
|
||||
return sysFormMapper.selectSysFormById(formId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程表单列表
|
||||
*
|
||||
* @param sysForm 流程表单
|
||||
* @return 流程表单
|
||||
*/
|
||||
@Override
|
||||
public List<SysForm> selectSysFormList(SysForm sysForm)
|
||||
{
|
||||
return sysFormMapper.selectSysFormList(sysForm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程表单
|
||||
*
|
||||
* @param sysForm 流程表单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysForm(SysForm sysForm)
|
||||
{
|
||||
sysForm.setCreateTime(DateUtils.getNowDate());
|
||||
return sysFormMapper.insertSysForm(sysForm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程表单
|
||||
*
|
||||
* @param sysForm 流程表单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysForm(SysForm sysForm)
|
||||
{
|
||||
sysForm.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysFormMapper.updateSysForm(sysForm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除流程表单
|
||||
*
|
||||
* @param formIds 需要删除的流程表单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysFormByIds(Long[] formIds)
|
||||
{
|
||||
return sysFormMapper.deleteSysFormByIds(formIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程表单信息
|
||||
*
|
||||
* @param formId 流程表单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysFormById(Long formId)
|
||||
{
|
||||
return sysFormMapper.deleteSysFormById(formId);
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
package com.yanzhu.flowable.service.impl;
|
||||
|
||||
import com.yanzhu.flowable.domain.SysTaskForm;
|
||||
import com.yanzhu.flowable.mapper.SysTaskFormMapper;
|
||||
import com.yanzhu.flowable.service.ISysTaskFormService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程任务关联单Service业务层处理
|
||||
*
|
||||
* @author Tony
|
||||
* @date 2021-04-03
|
||||
*/
|
||||
@Service
|
||||
public class SysTaskFormServiceImpl implements ISysTaskFormService
|
||||
{
|
||||
@Autowired
|
||||
private SysTaskFormMapper sysTaskFormMapper;
|
||||
|
||||
/**
|
||||
* 查询流程任务关联单
|
||||
*
|
||||
* @param id 流程任务关联单ID
|
||||
* @return 流程任务关联单
|
||||
*/
|
||||
@Override
|
||||
public SysTaskForm selectSysTaskFormById(Long id)
|
||||
{
|
||||
return sysTaskFormMapper.selectSysTaskFormById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程任务关联单列表
|
||||
*
|
||||
* @param sysTaskForm 流程任务关联单
|
||||
* @return 流程任务关联单
|
||||
*/
|
||||
@Override
|
||||
public List<SysTaskForm> selectSysTaskFormList(SysTaskForm sysTaskForm)
|
||||
{
|
||||
return sysTaskFormMapper.selectSysTaskFormList(sysTaskForm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程任务关联单
|
||||
*
|
||||
* @param sysTaskForm 流程任务关联单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysTaskForm(SysTaskForm sysTaskForm)
|
||||
{
|
||||
return sysTaskFormMapper.insertSysTaskForm(sysTaskForm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程任务关联单
|
||||
*
|
||||
* @param sysTaskForm 流程任务关联单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysTaskForm(SysTaskForm sysTaskForm)
|
||||
{
|
||||
return sysTaskFormMapper.updateSysTaskForm(sysTaskForm);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除流程任务关联单
|
||||
*
|
||||
* @param ids 需要删除的流程任务关联单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysTaskFormByIds(Long[] ids)
|
||||
{
|
||||
return sysTaskFormMapper.deleteSysTaskFormByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程任务关联单信息
|
||||
*
|
||||
* @param id 流程任务关联单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysTaskFormById(Long id)
|
||||
{
|
||||
return sysTaskFormMapper.deleteSysTaskFormById(id);
|
||||
}
|
||||
}
|
|
@ -18,4 +18,9 @@ onMounted(() => {
|
|||
width: 192px;
|
||||
}
|
||||
}
|
||||
.bjs-container{
|
||||
a{
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询流程分类列表
|
||||
export function listCategory(query) {
|
||||
return request({
|
||||
url: '/flowable/category/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询流程分类详细
|
||||
export function getCategory(id) {
|
||||
return request({
|
||||
url: '/flowable/category/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增流程分类
|
||||
export function addCategory(data) {
|
||||
return request({
|
||||
url: '/flowable/category',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改流程分类
|
||||
export function updateCategory(data) {
|
||||
return request({
|
||||
url: '/flowable/category',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除流程分类
|
||||
export function delCategory(id) {
|
||||
return request({
|
||||
url: '/flowable/category/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询流程字段定义列表
|
||||
export function listDef(query) {
|
||||
return request({
|
||||
url: '/flowable/def/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询流程字段定义详细
|
||||
export function getDef(id) {
|
||||
return request({
|
||||
url: '/flowable/def/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增流程字段定义
|
||||
export function addDef(data) {
|
||||
return request({
|
||||
url: '/flowable/def',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改流程字段定义
|
||||
export function updateDef(data) {
|
||||
return request({
|
||||
url: '/flowable/def',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除流程字段定义
|
||||
export function delDef(id) {
|
||||
return request({
|
||||
url: '/flowable/def/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
// 查询流程字段定义列表(不翻页)
|
||||
export function listAll(query) {
|
||||
return request({
|
||||
url: '/flowable/def/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue