工作流

dev_xd
姜玉琦 2024-08-22 16:28:18 +08:00
parent 72cf76c249
commit fe56d910ae
147 changed files with 8766 additions and 8581 deletions

23
pom.xml
View File

@ -34,7 +34,8 @@
<jjwt.version>0.9.1</jjwt.version> <jjwt.version>0.9.1</jjwt.version>
<minio.version>8.2.2</minio.version> <minio.version>8.2.2</minio.version>
<poi.version>4.1.2</poi.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> <transmittable-thread-local.version>2.14.2</transmittable-thread-local.version>
</properties> </properties>
@ -69,12 +70,6 @@
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-spring-boot-starter</artifactId>
<version>${flowable.version}</version>
</dependency>
<!-- FastDFS 分布式文件系统 --> <!-- FastDFS 分布式文件系统 -->
<dependency> <dependency>
<groupId>com.github.tobato</groupId> <groupId>com.github.tobato</groupId>
@ -150,6 +145,20 @@
<version>${transmittable-thread-local.version}</version> <version>${transmittable-thread-local.version}</version>
</dependency> </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> <dependency>
<groupId>com.yanzhu</groupId> <groupId>com.yanzhu</groupId>

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -6,28 +6,28 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
/** /**
* sys_expression * flowable_category
* *
* @author ruoyi * @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; private static final long serialVersionUID = 1L;
/** 表单主键 */ /** 流程分类id */
private Long id; private Long id;
/** 表达式名称 */ /** 流程分类名称 */
@Excel(name = "表达式名称") @Excel(name = "流程分类名称")
private String name; private String name;
/** 表达式内容 */ /** 分类编码 */
@Excel(name = "表达式内容") @Excel(name = "分类编码")
private String expression; private String code;
/** 状态 */ /** 删除标志0代表存在 2代表删除 */
private Integer status; private String delFlag;
public void setId(Long id) public void setId(Long id)
{ {
@ -47,23 +47,23 @@ public class SysExpression extends BaseEntity
{ {
return name; 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 @Override
@ -71,13 +71,13 @@ public class SysExpression extends BaseEntity
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("name", getName()) .append("name", getName())
.append("expression", getExpression()) .append("code", getCode())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.append("status", getStatus())
.append("remark", getRemark()) .append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("delFlag", getDelFlag())
.toString(); .toString();
} }
} }

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -0,0 +1,13 @@
package com.yanzhu.flowable.domain;
import lombok.Data;
/**
* 便
*/
@Data
public class FlowableFieldSearch extends FlowableFieldRef {
/** 字段范围 */
private String scope;
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 com.yanzhu.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;

View File

@ -1,4 +1,5 @@
package com.yanzhu.flowable.domain; package com.yanzhu.flowable.domain.my;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;

View File

@ -1,4 +1,4 @@
package com.yanzhu.flowable.domain; package com.yanzhu.flowable.domain.my;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.yanzhu.common.core.web.domain.BaseEntity; import com.yanzhu.common.core.web.domain.BaseEntity;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -1,6 +1,6 @@
package com.yanzhu.flowable.mapper; 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 org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -24,7 +24,7 @@
<!-- fa.assigneeId,--> <!-- fa.assigneeId,-->
<!-- fa.assigneeName,--> <!-- fa.assigneeName,-->
<!-- fa.assigneeDeptName--> <!-- 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 SELECT * FROM
vw_flow_all fa vw_flow_all fa
<where> <where>
@ -52,7 +52,7 @@
</select> </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 select vf.* as startUserPhone from vw_flow_all vf
where vf.procInsId = #{procInsId} where vf.procInsId = #{procInsId}
</select> </select>
@ -72,7 +72,7 @@
</select> </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 select fa.* from vw_flow_await fa
where where
1=1 1=1
@ -107,7 +107,7 @@
</select> </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 select fa.category,count(1) as total from vw_flow_await fa
where where
1=1 1=1
@ -141,7 +141,7 @@
</select> </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 select fa.* from vw_flow_finished fa
where where
fa.ASSIGNEE_=#{nowUser} fa.ASSIGNEE_=#{nowUser}
@ -153,7 +153,7 @@
order by fa.endTime desc order by fa.endTime desc
</select> </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 a.dict_label taskName,b.cnt assigneeId,c.cnt procDefVersion FROM
( SELECT * FROM sys_dict_data WHERE dict_type = 'sys_process_category') a ( 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 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 GROUP BY category) c ON a.dict_value=c.category
</select> </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 taskName, COUNT(1) assigneeId FROM (
SELECT *,'总包单位' cat FROM vw_flow_all WHERE finishTime IS NULL AND taskName LIKE '总包%' SELECT *,'总包单位' cat FROM vw_flow_all WHERE finishTime IS NULL AND taskName LIKE '总包%'
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if> <if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
@ -242,7 +242,7 @@
GROUP BY cat GROUP BY cat
</select> </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 taskName, COUNT(1) assigneeId FROM (
SELECT *,'总包单位' cat FROM vw_flow_all WHERE taskName LIKE '总包%' AND taskName!='提交申请' and finishTime IS not NULL 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> <if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
@ -302,7 +302,7 @@
GROUP BY cat GROUP BY cat
</select> </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 taskName, COUNT(1) assigneeId FROM (
SELECT *,'总包单位' cat FROM vw_flow_all WHERE taskName LIKE '总包%' AND taskName!='提交申请' SELECT *,'总包单位' cat FROM vw_flow_all WHERE taskName LIKE '总包%' AND taskName!='提交申请'
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if> <if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
@ -362,7 +362,7 @@
GROUP BY cat GROUP BY cat
</select> </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 SELECT * FROM vw_flow_all
<where> <where>
<if test="category != null and category != ''"> and category = #{category}</if> <if test="category != null and category != ''"> and category = #{category}</if>
@ -378,7 +378,7 @@
</where> </where>
</select> </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 SELECT * FROM vw_flow_all WHERE finishTime IS NULL
<if test="taskId!=null"> <if test="taskId!=null">
<if test="taskId==1"> AND taskName LIKE '总包%' </if> <if test="taskId==1"> AND taskName LIKE '总包%' </if>
@ -398,7 +398,7 @@
</if> </if>
</select> </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 SELECT * FROM vw_flow_all
<where> <where>
<if test="taskId!=null"> <if test="taskId!=null">
@ -418,7 +418,7 @@
</where> </where>
</select> </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 a.businessKey,a.cnt duration ,b.projectName businessKeyName FROM (
SELECT businessKey,COUNT(1) cnt FROM vw_flow_all WHERE taskName!='提交申请' SELECT businessKey,COUNT(1) cnt FROM vw_flow_all WHERE taskName!='提交申请'
<if test="deptId !=null and deptId>0">and businessDeptId=#{deptId}</if> <if test="deptId !=null and deptId>0">and businessDeptId=#{deptId}</if>
@ -427,7 +427,7 @@
ORDER BY a.cnt DESC ORDER BY a.cnt DESC
</select> </select>
<select id="findSafetyWorkList" parameterType="com.yanzhu.flowable.domain.FlowTaskEntity" resultType="com.yanzhu.flowable.domain.FlowTaskEntity"> <select id="findSafetyWorkList" parameterType="FlowTaskEntity" resultType="FlowTaskEntity">
SELECT SELECT
fa.procInsId, fa.procInsId,
fa.deployId, fa.deployId,
@ -465,7 +465,7 @@
select * from sur_project where id = #{proId} select * from sur_project where id = #{proId}
</select> </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 x.dict_label taskName,y.taskId from (
select dict_value,dict_label select dict_value,dict_label
from sys_dict_data where dict_type='flow_sub_dept_type' from sys_dict_data where dict_type='flow_sub_dept_type'
@ -491,7 +491,7 @@
group by d.dict_value,d.dict_label group by d.dict_value,d.dict_label
) y on x.dict_value=y.dict_value ) y on x.dict_value=y.dict_value
</select> </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 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 vw_flow_all a
LEFT JOIN act_hi_varinst b ON a.procInsId=b.PROC_INST_ID_ AND b.NAME_='subDeptType' LEFT JOIN act_hi_varinst b ON a.procInsId=b.PROC_INST_ID_ AND b.NAME_='subDeptType'
@ -510,6 +510,124 @@
</foreach> </foreach>
</if> </if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if> <if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
</select> </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> </mapper>

View File

@ -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>

View File

@ -2,83 +2,82 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "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="id" column="id" />
<result property="name" column="name" /> <result property="name" column="name" />
<result property="expression" column="expression" /> <result property="code" column="code" />
<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" /> <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> </resultMap>
<sql id="selectSysExpressionVo"> <sql id="selectFlowableCategoryVo">
select id, name, expression, create_time, update_time, create_by, update_by, status, remark from sys_expression select id, name, code, remark, create_by, create_time, update_by, update_time, del_flag from flowable_category
</sql> </sql>
<select id="selectSysExpressionList" parameterType="SysExpression" resultMap="SysExpressionResult"> <select id="selectFlowableCategoryList" parameterType="FlowableCategory" resultMap="FlowableCategoryResult">
<include refid="selectSysExpressionVo"/> <include refid="selectFlowableCategoryVo"/>
<where> <where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="expression != null and expression != ''"> and expression = #{expression}</if> <if test="code != null and code != ''"> and code = #{code}</if>
<if test="status != null "> and status = #{status}</if>
</where> </where>
</select> </select>
<select id="selectSysExpressionById" parameterType="Long" resultMap="SysExpressionResult"> <select id="selectFlowableCategoryById" parameterType="Long" resultMap="FlowableCategoryResult">
<include refid="selectSysExpressionVo"/> <include refid="selectFlowableCategoryVo"/>
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertSysExpression" parameterType="SysExpression" useGeneratedKeys="true" keyProperty="id"> <insert id="insertFlowableCategory" parameterType="FlowableCategory" useGeneratedKeys="true" keyProperty="id">
insert into sys_expression insert into flowable_category
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if> <if test="name != null">name,</if>
<if test="expression != null">expression,</if> <if test="code != null">code,</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> <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>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if> <if test="name != null">#{name},</if>
<if test="expression != null">#{expression},</if> <if test="code != null">#{code},</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> <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> </trim>
</insert> </insert>
<update id="updateSysExpression" parameterType="SysExpression"> <update id="updateFlowableCategory" parameterType="FlowableCategory">
update sys_expression update flowable_category
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if> <if test="name != null">name = #{name},</if>
<if test="expression != null">expression = #{expression},</if> <if test="code != null">code = #{code},</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> <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> </trim>
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteSysExpressionById" parameterType="Long"> <delete id="deleteFlowableCategoryById" parameterType="Long">
delete from sys_expression where id = #{id} delete from flowable_category where id = #{id}
</delete> </delete>
<delete id="deleteSysExpressionByIds" parameterType="String"> <delete id="deleteFlowableCategoryByIds" parameterType="String">
delete from sys_expression where id in delete from flowable_category where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -105,16 +105,14 @@
<version>5.3.3</version> <version>5.3.3</version>
</dependency> </dependency>
<dependency>
<groupId>jakarta.mail</groupId>
<artifactId>jakarta.mail-api</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.flowable</groupId> <groupId>org.flowable</groupId>
<artifactId>flowable-spring-boot-starter</artifactId> <artifactId>flowable-spring-boot-starter</artifactId>
<!-- 排除flowable自带的权限认证 -->
<exclusions>
<exclusion>
<groupId>org.flowable</groupId>
<artifactId>flowable-spring-security</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -8,6 +8,8 @@ package com.yanzhu.flowable.common.constant;
*/ */
public class ProcessConstants { public class ProcessConstants {
public static final String SUFFIX = ".bpmn";
/** /**
* *
*/ */

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -1,32 +1,32 @@
package com.yanzhu.flowable.config; //package com.yanzhu.flowable.config;
//
import org.flowable.engine.impl.db.DbIdGenerator; //import org.flowable.engine.impl.db.DbIdGenerator;
import org.flowable.spring.SpringProcessEngineConfiguration; //import org.flowable.spring.SpringProcessEngineConfiguration;
import org.flowable.spring.boot.EngineConfigurationConfigurer; //import org.flowable.spring.boot.EngineConfigurationConfigurer;
import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
import org.springframework.core.task.AsyncListenableTaskExecutor; //import org.springframework.core.task.AsyncListenableTaskExecutor;
import org.springframework.core.task.SimpleAsyncTaskExecutor; //import org.springframework.core.task.SimpleAsyncTaskExecutor;
//
/** ///**
* id // * 流程id生成处理
* @author Tony // * @author Tony
* @date 2022-12-26 10:24 // * @date 2022-12-26 10:24
*/ // */
@Configuration ////@Configuration
public class FlowableConfig implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> { //public class FlowableConfig implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> {
//
@Bean // @Bean
public AsyncListenableTaskExecutor applicationTaskExecutor() { // public AsyncListenableTaskExecutor applicationTaskExecutor() {
return new SimpleAsyncTaskExecutor(); // return new SimpleAsyncTaskExecutor();
} // }
//
@Override // @Override
public void configure(SpringProcessEngineConfiguration engineConfiguration) { // public void configure(SpringProcessEngineConfiguration engineConfiguration) {
engineConfiguration.setActivityFontName("宋体"); // engineConfiguration.setActivityFontName("宋体");
engineConfiguration.setLabelFontName("宋体"); // engineConfiguration.setLabelFontName("宋体");
engineConfiguration.setAnnotationFontName("宋体"); // engineConfiguration.setAnnotationFontName("宋体");
engineConfiguration.setIdGenerator(new DbIdGenerator()); // engineConfiguration.setIdGenerator(new DbIdGenerator());
} // }
//
} //}

View File

@ -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;
/**
*
* falseDB
* 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);
}
}

View File

@ -1,41 +1,41 @@
package com.yanzhu.flowable.config; //package com.yanzhu.flowable.config;
//
import com.yanzhu.flowable.listener.GlobalEventListener; //import com.yanzhu.flowable.listener.GlobalEventListener;
import lombok.RequiredArgsConstructor; //import lombok.RequiredArgsConstructor;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType; //import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType;
import org.flowable.common.engine.api.delegate.event.FlowableEventDispatcher; //import org.flowable.common.engine.api.delegate.event.FlowableEventDispatcher;
import org.flowable.spring.SpringProcessEngineConfiguration; //import org.flowable.spring.SpringProcessEngineConfiguration;
import org.springframework.context.ApplicationListener; //import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.ContextRefreshedEvent; //import org.springframework.context.event.ContextRefreshedEvent;
//
/** ///**
* Flowable // * Flowable添加全局监听器
* // *
* @author JiangYuQi // * @author JiangYuQi
*/ // */
@Configuration ////@Configuration
@RequiredArgsConstructor //@RequiredArgsConstructor
public class FlowableGlobalListenerConfig implements ApplicationListener<ContextRefreshedEvent> { //public class FlowableGlobalListenerConfig implements ApplicationListener<ContextRefreshedEvent> {
//
private final SpringProcessEngineConfiguration configuration; // private final SpringProcessEngineConfiguration configuration;
//
private final GlobalEventListener globalEventListener; // private final GlobalEventListener globalEventListener;
//
@Override // @Override
public void onApplicationEvent(ContextRefreshedEvent event) { // public void onApplicationEvent(ContextRefreshedEvent event) {
FlowableEventDispatcher dispatcher = configuration.getEventDispatcher(); // FlowableEventDispatcher dispatcher = configuration.getEventDispatcher();
/** // /**
* - // * 任务创建全局监听-待办消息发送
* PROCESS_CREATED // * PROCESS_CREATED 流程创建
* TASK_CREATED // * TASK_CREATED 任务创建
* TASK_COMPLETED // * TASK_COMPLETED 任务完成
* PROCESS_COMPLETED // * PROCESS_COMPLETED 流程完成
* // * 流程创建、任务创建、任务完成、流程完成
*/ // */
dispatcher.addEventListener(globalEventListener,FlowableEngineEventType.TASK_CREATED); // dispatcher.addEventListener(globalEventListener,FlowableEngineEventType.TASK_CREATED);
dispatcher.addEventListener(globalEventListener,FlowableEngineEventType.PROCESS_COMPLETED); // dispatcher.addEventListener(globalEventListener,FlowableEngineEventType.PROCESS_COMPLETED);
} // }
//
} //}
//

View File

@ -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.domain.AjaxResult;
import com.yanzhu.common.core.web.page.TableDataInfo; import com.yanzhu.common.core.web.page.TableDataInfo;
import com.yanzhu.common.security.utils.SecurityUtils; 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.flowable.service.IFlowBusinessKeyService;
import com.yanzhu.system.api.domain.SysUser; import com.yanzhu.system.api.domain.SysUser;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;

View File

@ -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);
}
}

View File

@ -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();
}
}

View File

@ -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);
}
}

View File

@ -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));
}
}

View File

@ -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));
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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("设置最新版本失败!");
}
}
}

View File

@ -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()));
}
}
}

View File

@ -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));
}
}

View File

@ -135,7 +135,6 @@ public class CustomProcessDiagramCanvas extends DefaultProcessDiagramCanvas {
SHELL_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/shellTask.png", this.customClassLoader)); 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)); 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)); 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)); 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)); 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)); COMPENSATE_THROW_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/compensate-throw.png", this.customClassLoader));

View File

@ -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();
/**
* xmlbpmnModel
*
* @param xml xml
* @return bpmnModel
*/
public static BpmnModel getBpmnModel(String xml) {
return bpmnXMLConverter.convertToBpmnModel(new StringStreamSource(xml), false, false);
}
/**
* bpmnModelxml
*
* @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;
}
}

View File

@ -1,6 +1,6 @@
package com.yanzhu.flowable.service; 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.List;
import java.util.Map; import java.util.Map;

View File

@ -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);
/**
*
* key1使key
* key1key
* @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);
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -1,7 +1,7 @@
package com.yanzhu.flowable.service.impl; package com.yanzhu.flowable.service.impl;
import com.yanzhu.common.core.text.Convert; 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.mapper.FlowBusinessKeyMapper;
import com.yanzhu.flowable.service.IFlowBusinessKeyService; import com.yanzhu.flowable.service.IFlowBusinessKeyService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -25,6 +25,7 @@ public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService {
@Resource @Resource
private FlowBusinessKeyMapper flowBusinessKeyMapper; private FlowBusinessKeyMapper flowBusinessKeyMapper;
/** /**
* *
* @param flowTaskEntity * @param flowTaskEntity

View File

@ -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;
}
/**
*
*
* key1使key
* key1key
* @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);
}
}

View File

@ -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("流程启动错误");
}
}
}

View File

@ -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);
}
}

View File

@ -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文件异常");
}
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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));
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -18,4 +18,9 @@ onMounted(() => {
width: 192px; width: 192px;
} }
} }
.bjs-container{
a{
display: none !important;
}
}
</style> </style>

View File

@ -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'
})
}

View File

@ -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