fix: 码全代码添加
This commit is contained in:
32
template/cvbp/cvbp-workflow/.gitignore
vendored
Normal file
32
template/cvbp/cvbp-workflow/.gitignore
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
74
template/cvbp/cvbp-workflow/pom.xml
Normal file
74
template/cvbp/cvbp-workflow/pom.xml
Normal file
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.codvision</groupId>
|
||||
<artifactId>cvbp</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>cvbp-workflow</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<description>工作流服务</description>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.codvision</groupId>
|
||||
<artifactId>cvbp-auth-center</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flowable</groupId>
|
||||
<artifactId>flowable-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.persistence</groupId>
|
||||
<artifactId>persistence-api</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<properties>
|
||||
<profiles.active>dev</profiles.active>
|
||||
</properties>
|
||||
<activation>
|
||||
<!-- 默认环境 -->
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>prd</id>
|
||||
<properties>
|
||||
<profiles.active>prd</profiles.active>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<classifier>exec</classifier>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.codvision.workflow;
|
||||
|
||||
import com.codvision.webcore.util.WebUtil;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class WorkflowApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
ConfigurableApplicationContext application = SpringApplication.run(WorkflowApplication.class, args);
|
||||
WebUtil.printWebUrl(application.getEnvironment());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.config;
|
||||
|
||||
import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
/**
|
||||
* swagger配置
|
||||
*
|
||||
* @author lingee
|
||||
* @date 2023/8/4
|
||||
*/
|
||||
@Configuration("workflowSwaggerConfig")
|
||||
@EnableSwagger2
|
||||
@EnableSwaggerBootstrapUI
|
||||
public class SwaggerConfig {
|
||||
|
||||
@Bean
|
||||
public Docket workflowApiConfig() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(webApiInfo())
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.basePackage("com.codvision.workflow"))
|
||||
.build().groupName("工作流模块");
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建接口文档的具体信息,会显示在接口文档页面中
|
||||
*
|
||||
* @return ApiInfo
|
||||
*/
|
||||
private ApiInfo webApiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
// 文档标题
|
||||
.title("工作流模块接口管理")
|
||||
// 文档描述
|
||||
.description("工作流模块接口文档")
|
||||
// 版本
|
||||
.version("1.0")
|
||||
// 版权
|
||||
.license("Codvision")
|
||||
// 版权地址
|
||||
.licenseUrl("http://www.codvision.com")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.codvision.workflow.config;
|
||||
|
||||
import org.flowable.engine.impl.db.DbIdGenerator;
|
||||
import org.flowable.spring.SpringProcessEngineConfiguration;
|
||||
import org.flowable.spring.boot.EngineConfigurationConfigurer;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Configuration
|
||||
@ComponentScan("com.codvision.workflow")
|
||||
public class WorkFlowConfig implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> {
|
||||
|
||||
@Override
|
||||
public void configure(SpringProcessEngineConfiguration engineConfiguration) {
|
||||
// 防止流程图中中文乱码
|
||||
engineConfiguration.setActivityFontName("宋体");
|
||||
engineConfiguration.setLabelFontName("宋体");
|
||||
engineConfiguration.setAnnotationFontName("宋体");
|
||||
|
||||
// 设置ID生成器
|
||||
engineConfiguration.setIdGenerator(new DbIdGenerator());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.codvision.workflow.config;
|
||||
|
||||
import com.codvision.workflow.listener.GlobalWorkFlowMultiInstanceListener;
|
||||
import com.codvision.workflow.listener.GlobalWorkFlowStatusChangeListener;
|
||||
import com.codvision.workflow.listener.GlobalWorkFlowVariableListener;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
|
||||
import static org.flowable.common.engine.api.delegate.event.FlowableEngineEventType.*;
|
||||
|
||||
|
||||
/**
|
||||
* 流程全局监听配置
|
||||
* @author hxl
|
||||
*/
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
public class WorkFlowGlobalEventListenerConfig implements ApplicationListener<ContextRefreshedEvent> {
|
||||
|
||||
private final GlobalWorkFlowStatusChangeListener globalWorkFlowStatusChangeListener;
|
||||
private final GlobalWorkFlowVariableListener globalWorkFlowVariableListener;
|
||||
private final GlobalWorkFlowMultiInstanceListener globalWorkFlowMultiInstanceListener;
|
||||
private final RuntimeService runtimeService;
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ContextRefreshedEvent event) {
|
||||
runtimeService.addEventListener(globalWorkFlowStatusChangeListener, TASK_CREATED, ACTIVITY_COMPLETED);
|
||||
runtimeService.addEventListener(globalWorkFlowVariableListener, VARIABLE_CREATED);
|
||||
runtimeService.addEventListener(globalWorkFlowMultiInstanceListener, MULTI_INSTANCE_ACTIVITY_COMPLETED_WITH_CONDITION);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.codvision.workflow.config;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.flowable.engine.*;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Getter
|
||||
@Component
|
||||
public class WorkFlowServiceFactory {
|
||||
|
||||
@Resource
|
||||
protected RepositoryService repositoryService;
|
||||
|
||||
@Resource
|
||||
protected RuntimeService runtimeService;
|
||||
|
||||
@Resource
|
||||
protected IdentityService identityService;
|
||||
|
||||
@Resource
|
||||
protected TaskService taskService;
|
||||
|
||||
@Resource
|
||||
protected HistoryService historyService;
|
||||
|
||||
@Resource
|
||||
protected ManagementService managementService;
|
||||
|
||||
@Resource
|
||||
protected ProcessEngine processEngine;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
@NonNullApi
|
||||
@NonNullFields
|
||||
package com.codvision.workflow.config;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.NonNullFields;
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.constant;
|
||||
|
||||
/**
|
||||
* 缓存常量类,用于定义key值,要求同类型的key值前缀保持一致,如用户 USER:XXX、USER:YYY
|
||||
* @author hxl
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public final class CacheContant {
|
||||
// 流程状态
|
||||
public static final String WORK_FLOW_STATUS = "WORK:FLOW:STATUS:";
|
||||
// 工作流多实例已完成的任务ID
|
||||
public static final String WORK_FLOW_MULTI_INSTANCE_COMPLETED = "WORK:FLOW:MULTI:INSTANCE:COMPLETED:";
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.codvision.workflow.constant;
|
||||
|
||||
/**
|
||||
* 流程常量
|
||||
* @author hxl
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public class WorkFlowConstant {
|
||||
|
||||
// 扩展字段flowable:button 按钮
|
||||
public static final String EXTENSION_ELEMENT_BUTTON = "button";
|
||||
// 扩展字段flowable:button name 按钮名称
|
||||
public static final String EXTENSION_ELEMENT_BUTTON_NAME = "name";
|
||||
// 扩展字段flowable:button code 按钮编码
|
||||
public static final String EXTENSION_ELEMENT_BUTTON_CODE = "code";
|
||||
// 扩展字段flowable:button sort 按钮排序字段
|
||||
public static final String EXTENSION_ELEMENT_BUTTON_SORT = "sort";
|
||||
// 扩展字段 流程状态
|
||||
public static final String EXTENSION_ELEMENT_WORK_FLOW_STATUS = "status";
|
||||
// 扩展字段 流程状态值
|
||||
public static final String EXTENSION_ELEMENT_WORK_FLOW_STATUS_CODE = "code";
|
||||
// 扩展字段 流程超期
|
||||
public static final String EXTENSION_ELEMENT_TIMIT_OUT = "timeout";
|
||||
// 扩展字段 流程超期截止时间(单位分钟)
|
||||
public static final String EXTENSION_ELEMENT_TIMIT = "time";
|
||||
// 扩展字段 退回
|
||||
public static final String EXTENSION_ELEMENT_TASK_RETURN = "return";
|
||||
// 扩展字段 退回 目标节点Key
|
||||
public static final String EXTENSION_ELEMENT_TASK_RETURN_TARGET_KEY = "targetKey";
|
||||
// 工作流定时任务Job Group
|
||||
public static final String WORK_FLOW_JOB_GROUP = "WORK:FLOW:JOB:GROUP";
|
||||
// 全局超期
|
||||
public static final String WORK_FLOW_TIME_OUT_INSTANCE_ID = "WORK:FLOW:TIME:OUT:INSTANCE:ID:";
|
||||
// 任务签收超期
|
||||
public static final String WORK_FLOW_TIME_OUT_CLAIM_TASK_ID = "WORK_FLOW_TIME_OUT_CLAIM_TASK_ID:";
|
||||
// 任务完成超期
|
||||
public static final String WORK_FLOW_TIME_OUT_COMPLETE_TASK_ID = "WORK_FLOW_TIME_OUT_COMPLETE_TASK_ID:";
|
||||
// 工作流延期审核人员配置
|
||||
public static final String WORK_FLOW_DELAY_REVIEWER_CONFIG_USER = "WORK_FLOW_DELAY_REVIEWER_CONFIG_USER";
|
||||
// 工作流延期审核组织配置
|
||||
public static final String WORK_FLOW_DELAY_REVIEWER_CONFIG_ORG = "WORK_FLOW_DELAY_REVIEWER_CONFIG_ORG";
|
||||
// 工作流延期审核角色配置
|
||||
public static final String WORK_FLOW_DELAY_REVIEWER_CONFIG_ROLE = "WORK_FLOW_DELAY_REVIEWER_CONFIG_ROLE";
|
||||
// 任务退回次数限制前缀
|
||||
public static final String TASK_RETURN_LIMIT = "TASK_RETURN_LIMIT_";
|
||||
// 任务操作次数限制前缀
|
||||
public static final String TASK_OPERATE_LIMIT = "TASK_OPERATE_LIMIT_";
|
||||
// 动态分配下一个任务节点的办理人
|
||||
public static final String TASK_DYNAMIC_HANDLER = "TASK_DYNAMIC_HANDLER";
|
||||
// 已签收标志
|
||||
public static final String CLAIM_SIGN = "CLAIM_SIGN";
|
||||
// 签收短信配置
|
||||
public static final String CLAIM_SMS_PARAMS = "CLAIM_SMS_PARAMS";
|
||||
// 当前节点所有的用户接收短信标志
|
||||
public static final String SMS_CURRENT_USERS = "SMS_CURRENT_USERS";
|
||||
|
||||
// 指定当前用户任务办理人所需的角色
|
||||
public static final String TASK_ROLR = "TASK_ROLE";
|
||||
// 无办理人自动办结标志
|
||||
public static final String AUTO_COMPLETE_NO_USERS = "AUTO_COMPLETE_NO_USERS";
|
||||
// 数据隔离标志
|
||||
public static final String SUB_DATA = "SUB_DATA";
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.codvision.workflow.constant.enums;
|
||||
|
||||
|
||||
import com.codvision.auth.entity.vo.SysUserVO;
|
||||
import com.codvision.auth.support.UserContext;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 动态表单内置变量
|
||||
* @author hxl
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum WorkFlowFormInnerVariableEnum {
|
||||
|
||||
// 操作人姓名
|
||||
OPERATOR_NAME,
|
||||
// 操作人联系电话
|
||||
OPERATOR_TEL,
|
||||
// 操作人所属组织
|
||||
OPERATOR_ORG_NAME,
|
||||
;
|
||||
|
||||
public static boolean isInner(String variable) {
|
||||
for (WorkFlowFormInnerVariableEnum value : values()) {
|
||||
if (value.name().equals(variable)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String get(String variable) {
|
||||
SysUserVO sysUserVO = UserContext.get();
|
||||
for (WorkFlowFormInnerVariableEnum value : values()) {
|
||||
if (value.name().equals(variable)) {
|
||||
switch (value) {
|
||||
case OPERATOR_NAME:
|
||||
return sysUserVO.getName();
|
||||
case OPERATOR_TEL:
|
||||
return sysUserVO.getMobile();
|
||||
case OPERATOR_ORG_NAME:
|
||||
return sysUserVO.getActiveOrgName();
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.codvision.workflow.constant.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 流程操作类型
|
||||
* @author hxl
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum WorkFlowOperationTypeEnum {
|
||||
|
||||
// 开始
|
||||
INITIATED(-2, ""),
|
||||
|
||||
// 结束
|
||||
ENDED(-1,""),
|
||||
|
||||
// 已签收
|
||||
CLAIM(0,"flow_claim"),
|
||||
|
||||
// 已处置
|
||||
AGREED(1,"flow_agree"),
|
||||
|
||||
// 已转办
|
||||
TRANSFERRED(2,"flow_transfer"),
|
||||
|
||||
// 已委派
|
||||
DELEGATED(3,"flow_delegate"),
|
||||
|
||||
// 已拒绝
|
||||
REJECTED(4,"flow_reject"),
|
||||
|
||||
// 撤回重办
|
||||
REVOKE_REDO(5,""),
|
||||
|
||||
// 已退回
|
||||
RETURN(6,"");
|
||||
|
||||
private final int type;
|
||||
private final String code;
|
||||
|
||||
public static WorkFlowOperationTypeEnum getType(int type) {
|
||||
for (WorkFlowOperationTypeEnum value : values()) {
|
||||
if (value.getType() == type) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.codvision.workflow.constant.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 工作流催办类型
|
||||
* @author hxl
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum WorkFlowUrgingTypeEnum {
|
||||
|
||||
// 系统通知
|
||||
SYS_NOTICE(0),
|
||||
|
||||
// 短信
|
||||
SMS(1),
|
||||
|
||||
// 浙政钉
|
||||
GOV_DING_TALK(2);
|
||||
|
||||
private final int type;
|
||||
|
||||
public static WorkFlowUrgingTypeEnum getType(int type) {
|
||||
for (WorkFlowUrgingTypeEnum value : values()) {
|
||||
if (value.getType() == type) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.controller;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.commoncore.common.ResponseEntity;
|
||||
import com.codvision.commoncore.exception.BusinessException;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.workflow.entity.Questionnaire;
|
||||
import com.codvision.workflow.service.QuestionnaireService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author codvision
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/questionnaire")
|
||||
@Api(tags = "动态表单应用管理模块")
|
||||
public class QuestionnaireController {
|
||||
|
||||
private final QuestionnaireService service;
|
||||
|
||||
@PostMapping("/getPageResult")
|
||||
@ApiOperation("分页列表")
|
||||
public ResponseEntity<IPage<Questionnaire>> getPageResult(@RequestBody QueryPage<Map<String, Object>> queryPage) {
|
||||
return new ResponseEntity<IPage<Questionnaire>>().data(service.getPageResult(queryPage));
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("添加")
|
||||
public ResponseEntity<String> add(@Validated @RequestBody Questionnaire questionnaire) {
|
||||
questionnaire.setUuid(IdUtil.fastSimpleUUID());
|
||||
service.save(questionnaire);
|
||||
return new ResponseEntity<String>().ok();
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("编辑")
|
||||
public ResponseEntity<String> update(@RequestBody Questionnaire questionnaire) {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>();
|
||||
if (questionnaire.getId() == null) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
service.updateById(questionnaire);
|
||||
return responseEntity.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation("删除")
|
||||
public ResponseEntity<String> delete(@RequestParam(value = "id") Integer id) {
|
||||
service.delById(id);
|
||||
return new ResponseEntity<String>().ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.commoncore.common.ResponseEntity;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.workflow.entity.QuestionnaireModule;
|
||||
import com.codvision.workflow.service.QuestionnaireModuleService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author codvision
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/questionnaireModule")
|
||||
@Api(tags = "动态表单设置模块")
|
||||
public class QuestionnaireModuleController {
|
||||
|
||||
private final QuestionnaireModuleService service;
|
||||
|
||||
@PostMapping("/getPageResult")
|
||||
@ApiOperation("分页列表")
|
||||
public ResponseEntity<IPage<QuestionnaireModule>> getPageResult(@RequestBody QueryPage<Map<String, Object>> queryPage) {
|
||||
return new ResponseEntity<IPage<QuestionnaireModule>>().data(service.getPageResult(queryPage));
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("添加")
|
||||
public ResponseEntity<QuestionnaireModule> add(@RequestBody QuestionnaireModule questionnaireModule) {
|
||||
service.save(questionnaireModule);
|
||||
return new ResponseEntity<QuestionnaireModule>().back(200, "成功", questionnaireModule);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("编辑")
|
||||
public ResponseEntity<String> update(@RequestBody List<QuestionnaireModule> questionnaireModules) {
|
||||
service.batchUpdate(questionnaireModules);
|
||||
return new ResponseEntity<String>().ok();
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation("删除")
|
||||
public ResponseEntity<String> delete(@RequestParam(value = "id") Integer id) {
|
||||
service.removeById(id);
|
||||
return new ResponseEntity<String>().ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "校验某个问卷是否已经被用户在浏览器上填报过")
|
||||
@PostMapping("/checkFillIn")
|
||||
public ResponseEntity<Integer> checkFillIn(@ApiParam(value = "应用uuid") @RequestParam(value = "uuid", required = false, defaultValue = "") String uuid,
|
||||
@ApiParam(value = "浏览器id") @RequestParam(value = "webId", required = false, defaultValue = "") String webId) {
|
||||
ResponseEntity<Integer> responseEntity = new ResponseEntity<>();
|
||||
return responseEntity.back(200, "成功", service.checkFillIn(uuid, webId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.commoncore.common.ResponseEntity;
|
||||
import com.codvision.commoncore.exception.BusinessException;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.workflow.entity.QuestionnaireResult;
|
||||
import com.codvision.workflow.service.QuestionnaireResultService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author codvision
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/questionnaireResult")
|
||||
@Api(tags = "动态表单填报存值模块")
|
||||
public class QuestionnaireResultController {
|
||||
|
||||
private final QuestionnaireResultService service;
|
||||
|
||||
@PostMapping("/getPageResult")
|
||||
@ApiOperation("分页列表")
|
||||
public ResponseEntity<IPage<QuestionnaireResult>> getPageResult(@RequestBody QueryPage<Map<String, Object>> queryPage) {
|
||||
return new ResponseEntity<IPage<QuestionnaireResult>>().data(service.getPageResult(queryPage));
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("添加")
|
||||
public ResponseEntity<String> add(@Validated @RequestBody QuestionnaireResult questionnaireresult) {
|
||||
service.save(questionnaireresult);
|
||||
return new ResponseEntity<String>().ok();
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("编辑")
|
||||
public ResponseEntity<String> update(@RequestBody QuestionnaireResult questionnaireresult) {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>();
|
||||
if (questionnaireresult.getId() == null) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
service.updateById(questionnaireresult);
|
||||
return responseEntity.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.codvision.workflow.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.commoncore.common.ResponseEntity;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.workflow.entity.WorkFlowButton;
|
||||
import com.codvision.workflow.service.WorkFlowButtonService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "工作流按钮管理")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/flowButton")
|
||||
public class WorkFlowButtonController {
|
||||
|
||||
private final WorkFlowButtonService service;
|
||||
|
||||
@PostMapping("/getPageList")
|
||||
@ApiOperation("分页列表")
|
||||
public ResponseEntity<IPage<WorkFlowButton>> getPageList(@RequestBody QueryPage<WorkFlowButton> queryPage) {
|
||||
return new ResponseEntity<IPage<WorkFlowButton>>().data(service.getPageResult(queryPage));
|
||||
}
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("更新")
|
||||
public ResponseEntity<Boolean> update(@RequestBody WorkFlowButton workFlowButton) {
|
||||
return new ResponseEntity<>(service.updateButton(workFlowButton));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getListByTaskId")
|
||||
@ApiOperation("获取任务节点的按钮配置信息")
|
||||
public ResponseEntity<List<WorkFlowButton>> getListByTaskId(@RequestParam String taskId) {
|
||||
return new ResponseEntity<List<WorkFlowButton>>().data(service.getListByTaskId(taskId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.codvision.workflow.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.commoncore.common.ResponseEntity;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.workflow.entity.WorkFlowCcItem;
|
||||
import com.codvision.workflow.service.WorkFlowCcItemService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Api(tags = "工作流抄送事项管理")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/flowCcItem")
|
||||
public class WorkFlowCcItemController {
|
||||
|
||||
private final WorkFlowCcItemService service;
|
||||
@PostMapping("/getPageList")
|
||||
@ApiOperation("分页列表")
|
||||
public ResponseEntity<IPage<WorkFlowCcItem>> getPageList(@RequestBody QueryPage<Map<String, Object>> queryPage) {
|
||||
return new ResponseEntity<IPage<WorkFlowCcItem>>().data(service.getPageResult(queryPage));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.commoncore.common.ResponseEntity;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.workflow.entity.WorkFlowData;
|
||||
import com.codvision.workflow.entity.vo.WorkFlowDataVO;
|
||||
import com.codvision.workflow.service.WorkFlowDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "工作流数据管理")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/flowData")
|
||||
public class WorkFlowDataController {
|
||||
|
||||
private final WorkFlowDataService service;
|
||||
|
||||
@PostMapping("/getPageResult")
|
||||
@ApiOperation("分页列表")
|
||||
public ResponseEntity<IPage<WorkFlowDataVO>> getPageResult(@RequestBody QueryPage<Map<String, Object>> queryPage) {
|
||||
return new ResponseEntity<IPage<WorkFlowDataVO>>().data(service.getPageResult(queryPage));
|
||||
}
|
||||
|
||||
@PostMapping("/myInitiatedList")
|
||||
@ApiOperation("我发起的列表")
|
||||
public ResponseEntity<IPage<WorkFlowDataVO>> myInitiatedList(@RequestBody QueryPage<Map<String, Object>> queryPage) {
|
||||
return new ResponseEntity<IPage<WorkFlowDataVO>>().data(service.myInitiatedList(queryPage));
|
||||
}
|
||||
|
||||
@PostMapping("/todoList")
|
||||
@ApiOperation("我待办的列表")
|
||||
public ResponseEntity<IPage<WorkFlowDataVO>> todoList(@RequestBody QueryPage<Map<String, Object>> queryPage) {
|
||||
return new ResponseEntity<IPage<WorkFlowDataVO>>().data(service.todoList(queryPage));
|
||||
}
|
||||
|
||||
@PostMapping("/finishedList")
|
||||
@ApiOperation("我已办的列表")
|
||||
public ResponseEntity<IPage<WorkFlowDataVO>> finishedList(@RequestBody QueryPage<Map<String, Object>> queryPage) {
|
||||
return new ResponseEntity<IPage<WorkFlowDataVO>>().data(service.finishedList(queryPage));
|
||||
}
|
||||
|
||||
@PostMapping("/claimList")
|
||||
@ApiOperation("待签收列表")
|
||||
public ResponseEntity<IPage<WorkFlowDataVO>> claimList(@RequestBody QueryPage<Map<String, Object>> queryPage) {
|
||||
return new ResponseEntity<IPage<WorkFlowDataVO>>().data(service.claimList(queryPage));
|
||||
}
|
||||
|
||||
@PostMapping("/getById")
|
||||
@ApiOperation("根据ID获取详情")
|
||||
public ResponseEntity<WorkFlowData> getById(@RequestParam(value = "id") Integer id) {
|
||||
return new ResponseEntity<WorkFlowData>().data(service.getById(id));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.commoncore.common.ResponseEntity;
|
||||
import com.codvision.commoncore.exception.BusinessException;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.workflow.entity.WorkFlowDefinition;
|
||||
import com.codvision.workflow.entity.WorkFlowVersionRecord;
|
||||
import com.codvision.workflow.entity.dto.WorkFlowDefinitionDTO;
|
||||
import com.codvision.workflow.entity.vo.WorkFlowElementVO;
|
||||
import com.codvision.workflow.service.WorkFlowDefinitionService;
|
||||
import com.codvision.workflow.service.WorkFlowVersionRecordService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "工作流流程定义管理")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/flowDefinition")
|
||||
public class WorkFlowDefinitionController {
|
||||
|
||||
private final WorkFlowDefinitionService service;
|
||||
private final WorkFlowVersionRecordService versionService;
|
||||
|
||||
@PostMapping("/getPageResult")
|
||||
@ApiOperation("分页列表")
|
||||
public ResponseEntity<IPage<WorkFlowDefinition>> getPageResult(@RequestBody QueryPage<Map<String, Object>> queryPage) {
|
||||
return new ResponseEntity<IPage<WorkFlowDefinition>>().data(service.getPageResult(queryPage));
|
||||
}
|
||||
|
||||
@PostMapping("/getVersionRecord")
|
||||
@ApiOperation("版本更新记录列表")
|
||||
public ResponseEntity<IPage<WorkFlowVersionRecord>> getVersionRecord(@RequestBody QueryPage<Map<String, Object>> queryPage) {
|
||||
return new ResponseEntity<IPage<WorkFlowVersionRecord>>().data(versionService.getPageResult(queryPage));
|
||||
}
|
||||
|
||||
@PostMapping("/save")
|
||||
@ApiOperation("流程定义保存")
|
||||
public ResponseEntity<String> save(@RequestBody WorkFlowDefinitionDTO definitionDTO) {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>();
|
||||
try (InputStream in = new ByteArrayInputStream(definitionDTO.getXmlFile().getBytes(StandardCharsets.UTF_8))) {
|
||||
service.save(definitionDTO, in);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return responseEntity.error(10000,"保存失败");
|
||||
}
|
||||
|
||||
return responseEntity.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("激活或挂起流程定义")
|
||||
@PostMapping("/activeOrSuspend")
|
||||
public ResponseEntity<String> changeState(@RequestParam(value = "state") Integer state,
|
||||
@RequestParam(value = "deployId") String deployId) {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>();
|
||||
if (state == null || StringUtils.isBlank(deployId)) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
|
||||
service.activeOrSuspend(state, deployId);
|
||||
return responseEntity.ok();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除流程定义")
|
||||
@PostMapping("/del")
|
||||
public ResponseEntity<String> del(@RequestBody List<String> deployIds) {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>();
|
||||
if (CollectionUtils.isEmpty(deployIds)) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
|
||||
service.delete(deployIds);
|
||||
return responseEntity.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("获取流程定义xml文件")
|
||||
@GetMapping("/getXml/{deployId}")
|
||||
public ResponseEntity<String> getXml(@PathVariable(value = "deployId") String deployId) {
|
||||
return new ResponseEntity<String>().data(service.getXml(deployId));
|
||||
}
|
||||
|
||||
@ApiOperation("获取流程定义图片文件")
|
||||
@GetMapping("/getImage/{deployId}")
|
||||
public void getImage(@PathVariable(value = "deployId") String deployId, HttpServletResponse response) {
|
||||
response.setContentType("image/png");
|
||||
try (OutputStream os = response.getOutputStream()) {
|
||||
BufferedImage image = ImageIO.read(service.getImage(deployId));
|
||||
if (image != null) {
|
||||
ImageIO.write(image, "png", os);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("根据流程定义xml获取所有可回退的节点")
|
||||
@PostMapping("/getReturnTaskList")
|
||||
public ResponseEntity<List<WorkFlowElementVO>> getReturnTaskList(@RequestParam(value = "xmlStr") String xmlStr,
|
||||
@RequestParam(value = "currentTaskKey") String currentTaskKey) {
|
||||
ResponseEntity<List<WorkFlowElementVO>> responseEntity = new ResponseEntity<>();
|
||||
if (StringUtils.isBlank(xmlStr) || StringUtils.isBlank(currentTaskKey)) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
|
||||
return responseEntity.data(service.getReturnTaskList(xmlStr, currentTaskKey));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.codvision.workflow.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.commoncore.common.ResponseEntity;
|
||||
import com.codvision.commoncore.exception.BusinessException;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.workflow.entity.WorkFlowDelayRecord;
|
||||
import com.codvision.workflow.entity.dto.WorkFlowDelayDTO;
|
||||
import com.codvision.workflow.service.WorkFlowDelayRecordService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "工作流延期申请")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/delayRecord")
|
||||
public class WorkFlowDelayRecordController {
|
||||
|
||||
private final WorkFlowDelayRecordService service;
|
||||
|
||||
@PostMapping("/getPageResult")
|
||||
@ApiOperation("分页列表")
|
||||
public ResponseEntity<IPage<WorkFlowDelayRecord>> getPageResult(@RequestBody QueryPage<Map<String, Object>> queryPage) {
|
||||
return new ResponseEntity<IPage<WorkFlowDelayRecord>>().data(service.getPageResult(queryPage));
|
||||
}
|
||||
|
||||
@ApiOperation("我的延期申请记录")
|
||||
@PostMapping("/myDelayRecords")
|
||||
public ResponseEntity<IPage<WorkFlowDelayRecord>> myDelayRecords(@RequestBody QueryPage<Map<String, Object>> queryPage) {
|
||||
return new ResponseEntity<IPage<WorkFlowDelayRecord>>().data(service.myDelayRecords(queryPage));
|
||||
}
|
||||
@ApiOperation("添加延期申请")
|
||||
@PostMapping("/add")
|
||||
public ResponseEntity<String> add(@Validated @RequestBody WorkFlowDelayDTO workFlowDelayDTO) {
|
||||
service.add(workFlowDelayDTO);
|
||||
return new ResponseEntity<String>().ok();
|
||||
}
|
||||
|
||||
@ApiOperation("延期申请审核")
|
||||
@PostMapping("/audit")
|
||||
public ResponseEntity<String> audit(@RequestParam(value = "id") Integer id,
|
||||
@RequestParam(value = "status") Integer status,
|
||||
@RequestParam(required = false) String comment) {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>();
|
||||
if (id == null || status == null) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
|
||||
service.audit(id, status, comment);
|
||||
return responseEntity.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.commoncore.common.ResponseEntity;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.workflow.entity.WorkFlowExpression;
|
||||
import com.codvision.workflow.service.WorkFlowExpressionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "工作流表达式管理")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/flowExpression")
|
||||
public class WorkFlowExpressionController {
|
||||
|
||||
private final WorkFlowExpressionService service;
|
||||
|
||||
@PostMapping("/getPageResult")
|
||||
@ApiOperation("分页列表")
|
||||
public ResponseEntity<IPage<WorkFlowExpression>> getPageResult(@RequestBody QueryPage<Map<String, Object>> queryPage) {
|
||||
return new ResponseEntity<IPage<WorkFlowExpression>>().data(service.getPageResult(queryPage));
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("添加")
|
||||
public ResponseEntity<String> add(@Validated @RequestBody WorkFlowExpression expression) {
|
||||
service.addExpression(expression);
|
||||
return new ResponseEntity<String>().ok();
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("更新")
|
||||
public ResponseEntity<String> update(@RequestBody WorkFlowExpression expression) {
|
||||
service.updateExpression(expression);
|
||||
return new ResponseEntity<String>().ok();
|
||||
}
|
||||
|
||||
@PostMapping("/del")
|
||||
@ApiOperation("删除")
|
||||
public ResponseEntity<String> del(@RequestParam(value = "id") Integer id) {
|
||||
service.removeExpression(id);
|
||||
return new ResponseEntity<String>().ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.controller;
|
||||
|
||||
import com.codvision.commoncore.common.ResponseEntity;
|
||||
import com.codvision.commoncore.exception.BusinessException;
|
||||
import com.codvision.workflow.entity.WorkFlowForm;
|
||||
import com.codvision.workflow.entity.vo.WorkFlowFormVO;
|
||||
import com.codvision.workflow.service.WorkFlowFormService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "工作流表单权限管理")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/flowForm")
|
||||
public class WorkFlowFormController {
|
||||
|
||||
private final WorkFlowFormService service;
|
||||
|
||||
@PostMapping("/elementFormList")
|
||||
@ApiOperation("表单权限列表")
|
||||
public ResponseEntity<List<WorkFlowForm>> elementFormList(@RequestParam(value = "definitionId") String definitionId) {
|
||||
return new ResponseEntity<List<WorkFlowForm>>().data(service.elementFormList(definitionId));
|
||||
}
|
||||
|
||||
@PostMapping("/getAllFormInfo")
|
||||
@ApiOperation("获取表单全部信息")
|
||||
public ResponseEntity<WorkFlowFormVO> getAllFormInfo(@RequestParam(value = "definitionId") String definitionId,
|
||||
@RequestParam(value = "instanceId") String instanceId) {
|
||||
ResponseEntity<WorkFlowFormVO> responseEntity = new ResponseEntity<>();
|
||||
if (StringUtils.isBlank(definitionId) || StringUtils.isBlank(instanceId)) {
|
||||
return responseEntity.error(30002);
|
||||
}
|
||||
|
||||
return responseEntity.data(service.getAllFormInfo(definitionId, instanceId));
|
||||
}
|
||||
|
||||
@PostMapping("/getStartFormAuth")
|
||||
@ApiOperation("获取发起表单权限信息")
|
||||
public ResponseEntity<WorkFlowFormVO> getStartFormAuth(@RequestParam(value = "definitionId") String definitionId,
|
||||
@RequestParam(required = false) String instanceId) {
|
||||
ResponseEntity<WorkFlowFormVO> responseEntity = new ResponseEntity<>();
|
||||
if (StringUtils.isBlank(definitionId)) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
|
||||
return responseEntity.data(service.getStartFormAuth(definitionId, instanceId));
|
||||
}
|
||||
|
||||
@PostMapping("/getTaskFormAuth")
|
||||
@ApiOperation("获取任务表单权限信息")
|
||||
public ResponseEntity<WorkFlowFormVO> getTaskFormAuth(@RequestParam(value = "definitionId") String definitionId,
|
||||
@RequestParam(value = "instanceId") String instanceId,
|
||||
@RequestParam(required = false) String taskId,
|
||||
@RequestParam(value = "elementKey") String elementKey) {
|
||||
ResponseEntity<WorkFlowFormVO> responseEntity = new ResponseEntity<>();
|
||||
if (StringUtils.isBlank(definitionId) || StringUtils.isBlank(instanceId) || StringUtils.isBlank(elementKey)) {
|
||||
return responseEntity.error(30002);
|
||||
}
|
||||
|
||||
return responseEntity.data(service.getTaskFormAuth(definitionId, elementKey, instanceId, taskId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.controller;
|
||||
|
||||
import com.codvision.commoncore.common.ResponseEntity;
|
||||
import com.codvision.commoncore.exception.BusinessException;
|
||||
import com.codvision.workflow.entity.WorkFlowFormLink;
|
||||
import com.codvision.workflow.entity.dto.WorkFlowFormLinkDTO;
|
||||
import com.codvision.workflow.entity.vo.WorkFlowFormLinkVO;
|
||||
import com.codvision.workflow.service.WorkFlowFormLinkService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "工作流业务模块表单关联管理")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/flowFormLink")
|
||||
public class WorkFlowFormLinkController {
|
||||
|
||||
private final WorkFlowFormLinkService service;
|
||||
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("添加关联信息")
|
||||
public ResponseEntity<String> addFormLink(@Validated @RequestBody WorkFlowFormLinkDTO workFlowFormLinkDTO) {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>();
|
||||
if (CollectionUtils.isEmpty(workFlowFormLinkDTO.getMenuIds())) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
|
||||
service.addFormLink(workFlowFormLinkDTO);
|
||||
return responseEntity.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("更新关联信息")
|
||||
public ResponseEntity<String> updateFormLink(@Validated @RequestBody WorkFlowFormLinkDTO workFlowFormLinkDTO) {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>();
|
||||
service.updateFormLink(workFlowFormLinkDTO);
|
||||
return responseEntity.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/getFormInfoByMenuId")
|
||||
@ApiOperation("根据菜单ID获取表单信息")
|
||||
public ResponseEntity<WorkFlowFormLinkVO> getFormInfoByMenuId(@RequestParam(value = "menuId") Integer menuId) {
|
||||
ResponseEntity<WorkFlowFormLinkVO> responseEntity = new ResponseEntity<>();
|
||||
if (menuId == null) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
|
||||
return responseEntity.data(service.getFormInfoByMenuId(menuId));
|
||||
}
|
||||
|
||||
@PostMapping("/getByDefinitionId")
|
||||
@ApiOperation("根据流程定义ID获取关联信息")
|
||||
public ResponseEntity<List<WorkFlowFormLink>> getByDefinitionId(@RequestParam(value = "definitionId") String definitionId) {
|
||||
ResponseEntity<List<WorkFlowFormLink>> responseEntity = new ResponseEntity<>();
|
||||
if (StringUtils.isBlank(definitionId)) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
|
||||
return responseEntity.data(service.getByDefinitionId(definitionId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.codvision.workflow.controller;
|
||||
|
||||
|
||||
import com.codvision.commoncore.common.ResponseEntity;
|
||||
import com.codvision.commoncore.exception.BusinessException;
|
||||
import com.codvision.workflow.entity.vo.WorkFlowViewerVO;
|
||||
import com.codvision.workflow.service.WorkFlowInstanceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "工作流流程实例管理")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/flowInstance")
|
||||
public class WorkFlowInstanceController {
|
||||
|
||||
private final WorkFlowInstanceService service;
|
||||
|
||||
@ApiOperation("根据流程定义id启动流程实例")
|
||||
@PostMapping("/start/{procDefId}")
|
||||
public ResponseEntity<String> start(@PathVariable(value = "procDefId") String procDefId,
|
||||
@RequestBody Map<String, Object> variables) {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>();
|
||||
if (StringUtils.isBlank(procDefId)) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
|
||||
service.startProcessInstanceById(procDefId, variables);
|
||||
return responseEntity.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("删除流程实例")
|
||||
@PostMapping("/del")
|
||||
public ResponseEntity<String> del(@RequestBody List<String> instanceIds,
|
||||
@RequestParam(required = false) String deleteReason) {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>();
|
||||
if (CollectionUtils.isEmpty(instanceIds)) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
|
||||
service.del(instanceIds, deleteReason);
|
||||
return responseEntity.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("流程执行进度")
|
||||
@GetMapping("/flowPace")
|
||||
public ResponseEntity<WorkFlowViewerVO> flowPace(@RequestParam(value = "instanceId") String instanceId,
|
||||
@RequestParam(value = "deployId") String deployId) {
|
||||
ResponseEntity<WorkFlowViewerVO> responseEntity = new ResponseEntity<>();
|
||||
if (StringUtils.isBlank(instanceId) || StringUtils.isBlank(deployId)) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
return responseEntity.data(service.flowPace(instanceId, deployId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.commoncore.common.ResponseEntity;
|
||||
import com.codvision.commoncore.exception.BusinessException;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.workflow.entity.WorkFlowListener;
|
||||
import com.codvision.workflow.service.WorkFlowListenerService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "工作流监听器管理")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/flowListener")
|
||||
public class WorkFlowListenerController {
|
||||
|
||||
private final WorkFlowListenerService service;
|
||||
|
||||
@PostMapping("/getPageResult")
|
||||
@ApiOperation("分页列表")
|
||||
public ResponseEntity<IPage<WorkFlowListener>> getPageResult(@RequestBody QueryPage<Map<String, Object>> queryPage) {
|
||||
return new ResponseEntity<IPage<WorkFlowListener>>().data(service.getPageResult(queryPage));
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("更新")
|
||||
public ResponseEntity<String> update(@RequestBody WorkFlowListener workFlowListener) {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>();
|
||||
if (workFlowListener.getId() == null) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
|
||||
service.updateById(workFlowListener);
|
||||
return responseEntity.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/del")
|
||||
@ApiOperation("删除")
|
||||
public ResponseEntity<String> del(@RequestParam(value = "id") Integer id) {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>();
|
||||
if (id == null) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
|
||||
service.removeById(id);
|
||||
return responseEntity.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.controller;
|
||||
|
||||
import com.codvision.commoncore.common.ResponseEntity;
|
||||
import com.codvision.workflow.entity.vo.WorkFlowRecordVO;
|
||||
import com.codvision.workflow.service.WorkFlowRecordService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "工作流流程记录管理")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/flowRecord")
|
||||
public class WorkFlowRecordController {
|
||||
|
||||
private final WorkFlowRecordService service;
|
||||
|
||||
@PostMapping("/getListByInstanceId")
|
||||
@ApiOperation("根据流程实例ID获取列表")
|
||||
public ResponseEntity<List<WorkFlowRecordVO>> getListByInstanceId(@RequestParam(value = "instanceId") String instanceId) {
|
||||
return new ResponseEntity<List<WorkFlowRecordVO>>().data(service.getListByInstanceId(instanceId));
|
||||
}
|
||||
|
||||
@PostMapping("/addCustomRecord")
|
||||
@ApiOperation("添加自定义记录")
|
||||
public ResponseEntity<String> addCustomRecord(@RequestParam(value = "taskId") String taskId,
|
||||
@RequestParam(value = "operationType") Integer operationType) {
|
||||
service.addCustomRecord(taskId, operationType);
|
||||
return new ResponseEntity<String>().ok();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.codvision.workflow.controller;
|
||||
|
||||
import com.codvision.commoncore.common.ResponseEntity;
|
||||
import com.codvision.commoncore.exception.BusinessException;
|
||||
import com.codvision.workflow.entity.dto.WorkFlowDynamicAllocationDTO;
|
||||
import com.codvision.workflow.entity.dto.WorkFlowTaskHandleDTO;
|
||||
import com.codvision.workflow.service.WorkFlowTaskService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "工作流流程任务")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/flowTask")
|
||||
public class WorkFlowTaskController {
|
||||
|
||||
private final WorkFlowTaskService service;
|
||||
|
||||
@ApiOperation("审批任务")
|
||||
@PostMapping("/complete")
|
||||
public ResponseEntity<String> complete(@Validated @RequestBody WorkFlowTaskHandleDTO taskHandleDTO) {
|
||||
service.complete(taskHandleDTO);
|
||||
return new ResponseEntity<String>().ok();
|
||||
}
|
||||
|
||||
@ApiOperation("拒绝任务")
|
||||
@PostMapping("/reject")
|
||||
public ResponseEntity<String> reject(@Validated @RequestBody WorkFlowTaskHandleDTO taskHandleDTO) {
|
||||
service.reject(taskHandleDTO);
|
||||
return new ResponseEntity<String>().ok();
|
||||
}
|
||||
|
||||
@ApiOperation("任务转办")
|
||||
@PostMapping("/transferTask")
|
||||
public ResponseEntity<String> transferTask(@Validated @RequestBody WorkFlowTaskHandleDTO taskHandleDTO) {
|
||||
service.transferTask(taskHandleDTO);
|
||||
return new ResponseEntity<String>().ok();
|
||||
}
|
||||
|
||||
@ApiOperation("任务委派")
|
||||
@PostMapping("/delegateTask")
|
||||
public ResponseEntity<String> delegateTask(@Validated @RequestBody WorkFlowTaskHandleDTO taskHandleDTO) {
|
||||
service.delegateTask(taskHandleDTO);
|
||||
return new ResponseEntity<String>().ok();
|
||||
}
|
||||
|
||||
@ApiOperation("撤回重办")
|
||||
@PostMapping("/revokeRedo")
|
||||
public ResponseEntity<String> revokeRedo(@Validated @RequestBody WorkFlowTaskHandleDTO taskHandleDTO) {
|
||||
service.revokeRedo(taskHandleDTO);
|
||||
return new ResponseEntity<String>().ok();
|
||||
}
|
||||
|
||||
@ApiOperation("退回")
|
||||
@PostMapping("/taskReturn")
|
||||
public ResponseEntity<String> taskReturn(@Validated @RequestBody WorkFlowTaskHandleDTO taskHandleDTO) {
|
||||
service.taskReturn(taskHandleDTO);
|
||||
return new ResponseEntity<String>().ok();
|
||||
}
|
||||
|
||||
@ApiOperation("任务催办")
|
||||
@PostMapping("/urgingTask")
|
||||
public ResponseEntity<String> urgingTask(@RequestParam(value = "type") Integer type,
|
||||
@RequestParam(value = "content") String content,
|
||||
@RequestParam(value = "instanceId") String instanceId) {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>();
|
||||
if (type == null || StringUtils.isBlank(instanceId) || StringUtils.isBlank(content)) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
|
||||
service.urgingTask(instanceId, type, content);
|
||||
return responseEntity.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("撤销任务")
|
||||
@PostMapping("/cancel")
|
||||
public ResponseEntity<String> cancel(@RequestParam(value = "instanceId") String instanceId) {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>();
|
||||
if (StringUtils.isBlank(instanceId)) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
|
||||
service.cancel(instanceId);
|
||||
return responseEntity.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("认领/签收任务")
|
||||
@PostMapping("/claim")
|
||||
public ResponseEntity<String> claim(@RequestParam(value = "taskId") String taskId) {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>();
|
||||
if (StringUtils.isBlank(taskId)) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
|
||||
service.claim(taskId);
|
||||
return responseEntity.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("取消认领/签收任务")
|
||||
@PostMapping("/unClaim")
|
||||
public ResponseEntity<String> unClaim(@RequestParam(value = "taskId") String taskId) {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>();
|
||||
if (StringUtils.isBlank(taskId)) {
|
||||
throw new BusinessException(30002);
|
||||
}
|
||||
|
||||
service.unClaim(taskId);
|
||||
return responseEntity.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("分配下一节点处理人或者处理组织(需结合任务监听器一起使用)")
|
||||
@PostMapping("/dynamicAllocation")
|
||||
public void dynamicAllocation(@Validated @RequestBody WorkFlowDynamicAllocationDTO workFlowDynamicAllocationDTO) {
|
||||
service.dynamicAllocation(workFlowDynamicAllocationDTO);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author codvision
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("tbl_questionnaire")
|
||||
public class Questionnaire implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private Integer createBy;
|
||||
|
||||
@ApiModelProperty("有效开始时间")
|
||||
private String startTime;
|
||||
|
||||
@NotBlank(message = "问卷名称不能为空")
|
||||
@ApiModelProperty("问卷名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("有效截至时间")
|
||||
private String endTime;
|
||||
|
||||
@ApiModelProperty("唯一id")
|
||||
private String uuid;
|
||||
|
||||
@ApiModelProperty("问卷状态(0-未发布,1-已发布,2已过期)")
|
||||
private Integer status;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.codvision.workflow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author codvision
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("tbl_questionnaire_module")
|
||||
public class QuestionnaireModule implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("问卷id")
|
||||
private Integer questionnaireId;
|
||||
|
||||
@ApiModelProperty("表单对象")
|
||||
private String formObject;
|
||||
|
||||
@ApiModelProperty("排序字段")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("表单自定义属性")
|
||||
private String attribute;
|
||||
|
||||
@ApiModelProperty("表单的默认赋值")
|
||||
private String value;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author codvision
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("tbl_questionnaire_result")
|
||||
public class QuestionnaireResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("表单的属性:值,以json对象保存")
|
||||
private String result;
|
||||
|
||||
@ApiModelProperty("填写人uid")
|
||||
private Integer uid;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private Integer questionnaireId;
|
||||
|
||||
@ApiModelProperty("浏览器id")
|
||||
private String webId;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty("创建时间")
|
||||
private String createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@ApiModelProperty("更新时间")
|
||||
private String updateTime;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.codvision.workflow.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("tbl_work_flow_button")
|
||||
public class WorkFlowButton implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("按钮编码")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("按钮名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("排序字段")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("流程状态")
|
||||
private Integer flowStatus;
|
||||
|
||||
@ApiModelProperty("是否启用")
|
||||
private Boolean isEnable;
|
||||
|
||||
@ApiModelProperty("按钮类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("是否危险属性")
|
||||
private Boolean isDanger;
|
||||
|
||||
@ApiModelProperty("是否幽灵属性")
|
||||
private Boolean isGhost;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.codvision.workflow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("tbl_work_flow_cc_item")
|
||||
public class WorkFlowCcItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("流程定义ID")
|
||||
private String definitionId;
|
||||
|
||||
@ApiModelProperty("流程实例ID")
|
||||
private String instanceId;
|
||||
|
||||
@ApiModelProperty("流程任务ID")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty("流程任务名称")
|
||||
private String taskName;
|
||||
|
||||
@ApiModelProperty("抄送标题")
|
||||
private String ccTitle;
|
||||
|
||||
@ApiModelProperty("抄送人姓名")
|
||||
private String ccName;
|
||||
|
||||
@ApiModelProperty("抄送人ID")
|
||||
private Integer ccUid;
|
||||
|
||||
@ApiModelProperty("接收人ID")
|
||||
private Integer toUid;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.codvision.workflow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("tbl_work_flow_data")
|
||||
public class WorkFlowData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("流程定义ID")
|
||||
private String definitionId;
|
||||
|
||||
@ApiModelProperty("流程定义Key")
|
||||
private String definitionKey;
|
||||
|
||||
@ApiModelProperty("流程部署ID")
|
||||
private String deployId;
|
||||
|
||||
@ApiModelProperty("流程实例ID")
|
||||
private String instanceId;
|
||||
|
||||
@ApiModelProperty("表单数据")
|
||||
private String formDataJson;
|
||||
|
||||
@ApiModelProperty("创建者ID")
|
||||
private Integer creatorUid;
|
||||
|
||||
@ApiModelProperty("创建者姓名")
|
||||
private String creatorName;
|
||||
|
||||
@ApiModelProperty("创建者所属组织")
|
||||
private Integer creatorOid;
|
||||
|
||||
@ApiModelProperty("流程状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("截止时间")
|
||||
private String deadlineTime;
|
||||
|
||||
@ApiModelProperty("是否已超期")
|
||||
private Boolean isExpired;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.codvision.workflow.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class WorkFlowDefinition implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("流程id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("流程名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("流程key")
|
||||
private String flowKey;
|
||||
|
||||
@ApiModelProperty("流程分类")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty("表单ID")
|
||||
private Integer formId;
|
||||
|
||||
@ApiModelProperty("表单名称")
|
||||
private String formName;
|
||||
|
||||
@ApiModelProperty("版本")
|
||||
private int version;
|
||||
|
||||
@ApiModelProperty("部署ID")
|
||||
private String deploymentId;
|
||||
|
||||
@ApiModelProperty("流程定义状态: 1:激活, 2:中止")
|
||||
private int suspensionState;
|
||||
|
||||
@ApiModelProperty("最新更新时间")
|
||||
private String latestUpdateTime;
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.codvision.workflow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.Transient;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("tbl_work_flow_delay_record")
|
||||
public class WorkFlowDelayRecord implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("流程实例ID")
|
||||
private String instanceId;
|
||||
|
||||
@ApiModelProperty("业务ID")
|
||||
private Integer bizId;
|
||||
|
||||
@ApiModelProperty("原截止时间")
|
||||
private String oldDeadline;
|
||||
|
||||
@ApiModelProperty("新截止时间")
|
||||
private String newDeadline;
|
||||
|
||||
@ApiModelProperty("申请人ID")
|
||||
private Integer applicantUid;
|
||||
|
||||
@ApiModelProperty("申请人所属组织")
|
||||
private Integer applicantOid;
|
||||
|
||||
@ApiModelProperty("申请人姓名")
|
||||
private String applicantName;
|
||||
|
||||
@ApiModelProperty("申请人联系电话")
|
||||
private String applicantTel;
|
||||
|
||||
@ApiModelProperty("申请原因")
|
||||
private String reason;
|
||||
|
||||
@ApiModelProperty("审核人ID")
|
||||
private Integer reviewerUid;
|
||||
|
||||
@ApiModelProperty("审核人OID")
|
||||
private Integer reviewerOid;
|
||||
|
||||
@ApiModelProperty("审核人角色ID")
|
||||
private Integer reviewerRoleId;
|
||||
|
||||
@ApiModelProperty("审核人姓名")
|
||||
private String reviewerName;
|
||||
|
||||
@ApiModelProperty("审核人联系电话")
|
||||
private String reviewerTel;
|
||||
|
||||
@ApiModelProperty("审核意见")
|
||||
private String comment;
|
||||
|
||||
@ApiModelProperty("审核时间")
|
||||
private String auditTime;
|
||||
|
||||
@ApiModelProperty("审核状态,0-待审核|1-审核通过|2-审核未通过")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("延期类型,0-节点延期 1-全局延期")
|
||||
private Integer type;
|
||||
|
||||
@Transient
|
||||
@ApiModelProperty("流程定义ID")
|
||||
private String definitionId;
|
||||
|
||||
@Transient
|
||||
@ApiModelProperty("流程部署ID")
|
||||
private String deployId;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.codvision.workflow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@TableName("tbl_work_flow_expression")
|
||||
public class WorkFlowExpression implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("表达式")
|
||||
private String expression;
|
||||
|
||||
@ApiModelProperty("是否系统内置")
|
||||
private Boolean isSystem;
|
||||
|
||||
@ApiModelProperty("类型,0-人员配置 1-流转条件 2-表单默认值")
|
||||
private Integer type;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.codvision.workflow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 流程表单
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("tbl_work_flow_form")
|
||||
public class WorkFlowForm implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@NotBlank(message = "表单ID不能为空")
|
||||
@ApiModelProperty("表单ID")
|
||||
private Integer formId;
|
||||
|
||||
@NotBlank(message = "流程定义ID不能为空")
|
||||
@ApiModelProperty("流程定义ID")
|
||||
private String definitionId;
|
||||
|
||||
@ApiModelProperty("流程定义Key")
|
||||
private String definitionKey;
|
||||
|
||||
@NotBlank(message = "元素唯一值不能为空")
|
||||
@ApiModelProperty("元素唯一值")
|
||||
private String elementKey;
|
||||
|
||||
@NotBlank(message = "表单权限不能为空")
|
||||
@ApiModelProperty("表单权限")
|
||||
private String formAuthJson;
|
||||
|
||||
@ApiModelProperty("主表单标志")
|
||||
private Boolean isStartForm;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.codvision.workflow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("tbl_work_flow_form_link")
|
||||
public class WorkFlowFormLink implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("流程定义ID")
|
||||
private String definitionId;
|
||||
|
||||
@ApiModelProperty("流程定义Key")
|
||||
private String definitionKey;
|
||||
|
||||
@ApiModelProperty("表单ID")
|
||||
private Integer formId;
|
||||
|
||||
@ApiModelProperty("系统菜单ID")
|
||||
private Integer menuId;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.codvision.workflow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("tbl_work_flow_listener")
|
||||
public class WorkFlowListener implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String listenerName;
|
||||
|
||||
@ApiModelProperty("监听类型")
|
||||
private String listenerType;
|
||||
|
||||
@ApiModelProperty("事件")
|
||||
private String listenerEvent;
|
||||
|
||||
@ApiModelProperty("执行内容")
|
||||
private String listenerValue;
|
||||
|
||||
@ApiModelProperty("执行类型")
|
||||
private String listenerValueType;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("是否启用")
|
||||
private Boolean isEnable;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.codvision.workflow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("tbl_work_flow_record")
|
||||
public class WorkFlowRecord implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("流程部署ID")
|
||||
private String deployId;
|
||||
|
||||
@ApiModelProperty("流程实例ID")
|
||||
private String instanceId;
|
||||
|
||||
@ApiModelProperty("流程执行实例ID")
|
||||
private String executionId;
|
||||
|
||||
@ApiModelProperty("流程任务ID")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty("流程任务名称")
|
||||
private String taskName;
|
||||
|
||||
@ApiModelProperty("操作人ID")
|
||||
private Integer operatorUid;
|
||||
|
||||
@ApiModelProperty("操作人姓名")
|
||||
private String operatorName;
|
||||
|
||||
@ApiModelProperty("操作人所属组织OID")
|
||||
private Integer operatorOid;
|
||||
|
||||
@ApiModelProperty("操作人所属组织名称")
|
||||
private String operatorOrgName;
|
||||
|
||||
@ApiModelProperty("处理动作类型")
|
||||
private Integer action;
|
||||
|
||||
@ApiModelProperty("处理动作编码")
|
||||
private String actionCode;
|
||||
|
||||
@ApiModelProperty("处理动作描述")
|
||||
private String actionDesc;
|
||||
|
||||
@ApiModelProperty("接收时间")
|
||||
private String receiveTime;
|
||||
|
||||
@ApiModelProperty("办结时间")
|
||||
private String completeTime;
|
||||
|
||||
@ApiModelProperty("审核意见")
|
||||
private String comment;
|
||||
|
||||
@ApiModelProperty("活动ID")
|
||||
private String activityId;
|
||||
|
||||
@ApiModelProperty("活动类型")
|
||||
private String activityType;
|
||||
|
||||
@ApiModelProperty("截止时间")
|
||||
private String deadlineTime;
|
||||
|
||||
@ApiModelProperty("是否已超期")
|
||||
private Boolean isExpired;
|
||||
|
||||
@ApiModelProperty("表单数据")
|
||||
private String formDataJson;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.codvision.workflow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("tbl_work_flow_sub_data")
|
||||
public class WorkFlowSubData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("流程实例ID")
|
||||
private String instanceId;
|
||||
|
||||
@ApiModelProperty("流程任务ID")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty("流程任务key")
|
||||
private String taskKey;
|
||||
|
||||
@ApiModelProperty("表单数据")
|
||||
private String formDataJson;
|
||||
|
||||
@ApiModelProperty("操作人ID")
|
||||
private Integer operatorUid;
|
||||
|
||||
@ApiModelProperty("操作人姓名")
|
||||
private String operatorName;
|
||||
|
||||
@ApiModelProperty("操作人所属组织")
|
||||
private Integer operatorOid;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.codvision.workflow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("tbl_work_flow_version_record")
|
||||
public class WorkFlowVersionRecord implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("流程定义名称")
|
||||
private String definitionName;
|
||||
|
||||
@ApiModelProperty("流程定义ID")
|
||||
private String definitionId;
|
||||
|
||||
@ApiModelProperty("流程定义key")
|
||||
private String definitionKey;
|
||||
|
||||
@ApiModelProperty("流程定义版本号")
|
||||
private Integer version;
|
||||
|
||||
@ApiModelProperty("操作人姓名")
|
||||
private String operatorName;
|
||||
|
||||
@ApiModelProperty("操作人账号")
|
||||
private String operatorAccount;
|
||||
|
||||
@ApiModelProperty("操作人ID")
|
||||
private Integer operatorUid;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WorkFlowDefinitionDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotNull(message = "请选择表单")
|
||||
@ApiModelProperty("表单ID")
|
||||
private Integer formId;
|
||||
|
||||
@ApiModelProperty("流程名称")
|
||||
private String flowName;
|
||||
|
||||
@ApiModelProperty("流程分类")
|
||||
private String category;
|
||||
|
||||
@NotBlank(message = "xml数据不能为空")
|
||||
@ApiModelProperty("bpmn2.0的xml文件")
|
||||
private String xmlFile;
|
||||
|
||||
@NotBlank(message = "表单权限数据不能为空")
|
||||
@ApiModelProperty("表单权限")
|
||||
private String formAuthJson;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.codvision.workflow.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class WorkFlowDelayDTO {
|
||||
|
||||
@NotBlank(message = "任务ID不能为空")
|
||||
@ApiModelProperty("任务ID")
|
||||
private String taskId;
|
||||
|
||||
@NotBlank(message = "请选择延期时间")
|
||||
@ApiModelProperty("延期时间")
|
||||
private String delayTime;
|
||||
|
||||
@ApiModelProperty("申请原因说明")
|
||||
private String reason;
|
||||
|
||||
@ApiModelProperty("延期类型,0-节点延期 1-全局延期")
|
||||
private Integer delayType;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.codvision.workflow.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class WorkFlowDynamicAllocationDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotBlank(message = "任务ID不能为空")
|
||||
@ApiModelProperty("任务ID")
|
||||
private String taskId;
|
||||
|
||||
@NotNull(message = "请指定分配类型")
|
||||
@ApiModelProperty("分配类型:0-人员 1-组织")
|
||||
private Integer allocationType;
|
||||
|
||||
@ApiModelProperty("用户uid集合")
|
||||
private List<Integer> userIdList;
|
||||
|
||||
@ApiModelProperty("组织OID")
|
||||
private Integer oid;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WorkFlowFormLinkDTO {
|
||||
|
||||
@NotBlank(message = "流程定义ID不能为空")
|
||||
@ApiModelProperty("流程定义ID")
|
||||
private String definitionId;
|
||||
|
||||
@NotBlank(message = "流程定义Key不能为空")
|
||||
@ApiModelProperty("流程定义Key")
|
||||
private String definitionKey;
|
||||
|
||||
@NotNull(message = "表单ID不能为空")
|
||||
@ApiModelProperty("表单ID")
|
||||
private Integer formId;
|
||||
|
||||
@ApiModelProperty("系统菜单ID")
|
||||
private List<Integer> menuIds;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.codvision.workflow.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@ApiModel
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WorkFlowRecordOperatorDTO {
|
||||
|
||||
@ApiModelProperty("操作人姓名")
|
||||
private String operatorName;
|
||||
|
||||
@ApiModelProperty("操作人所属组织名称")
|
||||
private String operatorOrgName;
|
||||
|
||||
@ApiModelProperty("操作人联系电话")
|
||||
private String operatorTel;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.codvision.workflow.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
public class WorkFlowSmsDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("短信模板code")
|
||||
private String templateCode;
|
||||
|
||||
@ApiModelProperty("模板参数,json形式")
|
||||
private String templateParam;
|
||||
|
||||
@ApiModelProperty("短信签名")
|
||||
private String signName;
|
||||
|
||||
@ApiModelProperty("短信接收手机号码,支持以逗号分隔的形式进行批量调用")
|
||||
private String phoneNumbers;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.codvision.workflow.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class WorkFlowTaskHandleDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotBlank(message = "任务ID不能为空")
|
||||
@ApiModelProperty("任务ID")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty("评审意见")
|
||||
private String comment;
|
||||
|
||||
@ApiModelProperty("目标用户ID")
|
||||
private Integer toUserId;
|
||||
|
||||
@ApiModelProperty("抄送用户")
|
||||
private List<Integer> toCcUserIds;
|
||||
|
||||
@ApiModelProperty("目标部门OID")
|
||||
private Integer oid;
|
||||
|
||||
@ApiModelProperty("目标任务节点key")
|
||||
private String targetTaskKey;
|
||||
|
||||
@ApiModelProperty("流程变量")
|
||||
private Map<String, Object> variables;
|
||||
|
||||
@ApiModelProperty("动态分配")
|
||||
private WorkFlowDynamicAllocationDTO allocation;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.codvision.workflow.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 任务回退次数限制对象
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@ApiModel
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WorkFlowTaskReturnLimitDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("任务key")
|
||||
private String taskDefinitionKey;
|
||||
|
||||
@ApiModelProperty("回退限制次数")
|
||||
private Integer limitCount;
|
||||
|
||||
@ApiModelProperty("回退限制类型,0-用户 1-组织")
|
||||
private Integer limitType;
|
||||
|
||||
@ApiModelProperty("用户回退次数信息")
|
||||
private Map<Integer, Integer> userMap;
|
||||
|
||||
@ApiModelProperty("组织回退次数信息")
|
||||
private Map<Integer, Integer> orgMap;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.codvision.workflow.entity.vo;
|
||||
|
||||
import com.codvision.workflow.entity.WorkFlowData;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WorkFlowDataVO extends WorkFlowData {
|
||||
|
||||
private String elementKey;
|
||||
|
||||
@ApiModelProperty("任务ID")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty("当前任务节点名称")
|
||||
private String taskName;
|
||||
|
||||
@ApiModelProperty("当前处理人或组织名称")
|
||||
private String assigneeOrOrgName;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.entity.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class WorkFlowElementVO {
|
||||
|
||||
@ApiModelProperty("任务节点唯一值")
|
||||
private String taskKey;
|
||||
|
||||
@ApiModelProperty("任务名称")
|
||||
private String taskName;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.entity.vo;
|
||||
|
||||
import com.codvision.workflow.entity.QuestionnaireModule;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WorkFlowFormLinkVO {
|
||||
|
||||
@ApiModelProperty("流程定义ID")
|
||||
private String definitionId;
|
||||
|
||||
@ApiModelProperty("流程定义key")
|
||||
private String definitionKey;
|
||||
|
||||
@ApiModelProperty("表单ID")
|
||||
private Integer formId;
|
||||
|
||||
@ApiModelProperty("表单结构数据")
|
||||
List<QuestionnaireModule> formJson;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.entity.vo;
|
||||
|
||||
import com.codvision.workflow.entity.QuestionnaireModule;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@ApiModel
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WorkFlowFormVO {
|
||||
|
||||
@ApiModelProperty("表单信息")
|
||||
private List<QuestionnaireModule> formJson;
|
||||
|
||||
@ApiModelProperty("表单权限")
|
||||
private String formAuthJson;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.entity.vo;
|
||||
|
||||
import com.codvision.workflow.entity.WorkFlowRecord;
|
||||
import com.codvision.workflow.entity.dto.WorkFlowRecordOperatorDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WorkFlowRecordVO extends WorkFlowRecord {
|
||||
|
||||
@ApiModelProperty("耗时")
|
||||
private String durationTime;
|
||||
|
||||
@ApiModelProperty("操作人联系电话")
|
||||
private String operatorTel;
|
||||
|
||||
@ApiModelProperty("操作人信息")
|
||||
private List<WorkFlowRecordOperatorDTO> operatorList;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.codvision.workflow.entity.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@ApiModel
|
||||
public class WorkFlowTaskRecordVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("任务唯一标识")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty("任务名称")
|
||||
private String taskName;
|
||||
|
||||
@ApiModelProperty("当前处理人ID")
|
||||
private Integer assigneeUserId;
|
||||
|
||||
@ApiModelProperty("当前处理人姓名")
|
||||
private String assigneeName;
|
||||
|
||||
@ApiModelProperty("当前处理人所属组织名称")
|
||||
private String assigneeOrgName;
|
||||
|
||||
@ApiModelProperty("接收时间")
|
||||
private String receivedTime;
|
||||
|
||||
@ApiModelProperty("办结时间")
|
||||
private String handledTime;
|
||||
|
||||
@ApiModelProperty("意见评论内容")
|
||||
private String comment;
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.codvision.workflow.entity.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@ApiModel
|
||||
public class WorkFlowTaskVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("任务编号")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty("任务key")
|
||||
private String taskKey;
|
||||
|
||||
@ApiModelProperty("任务名称")
|
||||
private String taskName;
|
||||
|
||||
@ApiModelProperty("任务执行人名称")
|
||||
private String assigneeName;
|
||||
|
||||
@ApiModelProperty("流程发起人Id")
|
||||
private String startUserId;
|
||||
|
||||
@ApiModelProperty("流程发起人名称")
|
||||
private String startUserName;
|
||||
|
||||
@ApiModelProperty("流程类型")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty("流程定义名称")
|
||||
private String procDefName;
|
||||
|
||||
@ApiModelProperty("流程定义版本")
|
||||
private Integer procDefVersion;
|
||||
|
||||
@ApiModelProperty("流程定义ID")
|
||||
private String definitionId;
|
||||
|
||||
@ApiModelProperty("流程部署编号")
|
||||
private String deployId;
|
||||
|
||||
@ApiModelProperty("流程实例ID")
|
||||
private String procInsId;
|
||||
|
||||
@ApiModelProperty("任务耗时")
|
||||
private String durationTime;
|
||||
|
||||
@ApiModelProperty("任务创建时间")
|
||||
private String createTime;
|
||||
|
||||
@ApiModelProperty("任务办结时间")
|
||||
private String finishTime;
|
||||
|
||||
@ApiModelProperty("流程状态")
|
||||
private String flowStatus;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.codvision.workflow.entity.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class WorkFlowViewerVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("已执行完的元素ID")
|
||||
private List<String> historyElementIdList;
|
||||
|
||||
@ApiModelProperty("正在执行的元素ID")
|
||||
private List<String> activeElementIdList;
|
||||
|
||||
@ApiModelProperty("流程定义xml数据")
|
||||
private String xmlData;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.codvision.workflow.job;
|
||||
|
||||
|
||||
import com.codvision.workflow.entity.WorkFlowData;
|
||||
import com.codvision.workflow.service.WorkFlowDataService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
/**
|
||||
* 完整流程的超时检查
|
||||
* @author hxl
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class WorkFlowGlobalTimeOutJob implements Job {
|
||||
|
||||
private final RuntimeService runtimeService;
|
||||
private final WorkFlowDataService workFlowDataService;
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
JobDataMap jobDataMap = jobExecutionContext.getJobDetail().getJobDataMap();
|
||||
String instanceId = (String) jobDataMap.get("instanceId");
|
||||
if (StringUtils.isBlank(instanceId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 判断流程是否已结束,若已结束则直接返回
|
||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(instanceId).singleResult();
|
||||
if (processInstance == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取流程数据,若数据获取为空则直接返回
|
||||
WorkFlowData workFlowData = workFlowDataService.getFormDataByInstanceId(instanceId);
|
||||
if (workFlowData == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 设置超期状态
|
||||
workFlowData.setIsExpired(true);
|
||||
workFlowDataService.updateById(workFlowData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.codvision.workflow.job;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.codvision.workflow.entity.WorkFlowRecord;
|
||||
import com.codvision.workflow.service.WorkFlowRecordService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import static com.codvision.workflow.constant.enums.WorkFlowOperationTypeEnum.CLAIM;
|
||||
|
||||
|
||||
/**
|
||||
* 用户任务签收超时检查
|
||||
* @author hxl
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class WorkFlowTaskClaimTimeOutJob implements Job {
|
||||
|
||||
private final WorkFlowRecordService workFlowRecordService;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
JobDataMap jobDataMap = jobExecutionContext.getJobDetail().getJobDataMap();
|
||||
String taskId = (String) jobDataMap.get("taskId");
|
||||
if (StringUtils.isBlank(taskId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 判断是否已签收,若已签收则比较完成时间和截止时间大小以此确认是否超时
|
||||
WorkFlowRecord workFlowRecord = workFlowRecordService.getByTaskIdAndAction(taskId, CLAIM.getType());
|
||||
if (workFlowRecord != null) {
|
||||
if (StringUtils.isBlank(workFlowRecord.getDeadlineTime())) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 若完成时间大于截止时间则设置超时状态
|
||||
int compare = DateUtil.compare(DateUtil.parse(workFlowRecord.getCompleteTime(), DatePattern.NORM_DATETIME_PATTERN),
|
||||
DateUtil.parse(workFlowRecord.getDeadlineTime(), DatePattern.NORM_DATETIME_PATTERN));
|
||||
if (compare > 0) {
|
||||
workFlowRecord.setIsExpired(true);
|
||||
workFlowRecordService.updateById(workFlowRecord);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
workFlowRecord = workFlowRecordService.getByTodoTaskId(taskId);
|
||||
if (workFlowRecord == null || StringUtils.isBlank(workFlowRecord.getDeadlineTime())) {
|
||||
return;
|
||||
}
|
||||
|
||||
workFlowRecord.setIsExpired(true);
|
||||
workFlowRecordService.updateById(workFlowRecord);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.codvision.workflow.job;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.codvision.workflow.entity.WorkFlowRecord;
|
||||
import com.codvision.workflow.service.WorkFlowRecordService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.task.api.Task;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import static com.codvision.workflow.constant.WorkFlowConstant.WORK_FLOW_TIME_OUT_CLAIM_TASK_ID;
|
||||
import static com.codvision.workflow.constant.enums.WorkFlowOperationTypeEnum.CLAIM;
|
||||
|
||||
|
||||
/**
|
||||
* 用户任务完成超时检查
|
||||
* @author hxl
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class WorkFlowTaskCompleteTimeOutJob implements Job {
|
||||
|
||||
private final TaskService taskService;
|
||||
private final WorkFlowRecordService workFlowRecordService;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
JobDataMap jobDataMap = jobExecutionContext.getJobDetail().getJobDataMap();
|
||||
String taskId = (String) jobDataMap.get("taskId");
|
||||
if (StringUtils.isBlank(taskId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||
if (task == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 若此时未签收并且存在签收超时配置,则直接返回
|
||||
WorkFlowRecord claimRecord = workFlowRecordService.getByTaskIdAndAction(taskId, CLAIM.getType());
|
||||
if (claimRecord == null) {
|
||||
String value = (String) taskService.getVariableLocal(taskId, WORK_FLOW_TIME_OUT_CLAIM_TASK_ID + taskId);
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
WorkFlowRecord workFlowRecord = workFlowRecordService.getByTodoTaskId(taskId);
|
||||
if (workFlowRecord == null || StringUtils.isBlank(workFlowRecord.getDeadlineTime())) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean isExpired = StringUtils.isBlank(workFlowRecord.getCompleteTime())
|
||||
|| DateUtil.compare(DateUtil.parse(workFlowRecord.getCompleteTime(), DatePattern.NORM_DATETIME_PATTERN), DateUtil.parse(workFlowRecord.getDeadlineTime(), DatePattern.NORM_DATETIME_PATTERN)) > 0;
|
||||
workFlowRecord.setIsExpired(isExpired);
|
||||
workFlowRecordService.updateById(workFlowRecord);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.codvision.workflow.listener;
|
||||
|
||||
|
||||
import com.codvision.cachecore.utils.RedisUtil;
|
||||
import com.codvision.workflow.service.WorkFlowRecordService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.engine.delegate.event.AbstractFlowableEngineEventListener;
|
||||
import org.flowable.engine.delegate.event.FlowableMultiInstanceActivityCompletedEvent;
|
||||
import org.flowable.task.api.Task;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.codvision.workflow.constant.CacheContant.WORK_FLOW_MULTI_INSTANCE_COMPLETED;
|
||||
|
||||
|
||||
/**
|
||||
* 多实例全局监听器
|
||||
* @author hxl
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class GlobalWorkFlowMultiInstanceListener extends AbstractFlowableEngineEventListener {
|
||||
|
||||
private final TaskService taskService;
|
||||
private final WorkFlowRecordService workFlowRecordService;
|
||||
public static final String PARALLEL_MULTI_INSTANCE_BEHAVIOR = "org.flowable.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior";
|
||||
|
||||
@Override
|
||||
protected void multiInstanceActivityCompletedWithCondition(FlowableMultiInstanceActivityCompletedEvent event) {
|
||||
// 非并行会签则直接返回
|
||||
if (!PARALLEL_MULTI_INSTANCE_BEHAVIOR.equals(event.getBehaviorClass())) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取已完成的用户节点ID
|
||||
String key = WORK_FLOW_MULTI_INSTANCE_COMPLETED + event.getActivityId();
|
||||
Set<String> cacheSet = RedisUtil.get(key);
|
||||
if (CollectionUtils.isEmpty(cacheSet)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取当前正在执行的用户节点信息
|
||||
List<Task> tasks = taskService.createTaskQuery().processInstanceId(event.getProcessInstanceId()).taskDefinitionKey(event.getActivityId()).list();
|
||||
if (CollectionUtils.isEmpty(tasks)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取未完成的用户节点ID
|
||||
List<String> taskIds = tasks.stream().map(Task::getId).filter(id -> !cacheSet.contains(id)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(taskIds)) {
|
||||
RedisUtil.del(key);
|
||||
return;
|
||||
}
|
||||
|
||||
// 清除未完成的用户节点的操作记录
|
||||
workFlowRecordService.delByInstanceIdAndActivityIdAndTaskIds(event.getProcessInstanceId(), event.getActivityId(), taskIds);
|
||||
RedisUtil.del(key);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.codvision.workflow.listener;
|
||||
|
||||
|
||||
import com.codvision.cachecore.utils.RedisUtil;
|
||||
import com.codvision.workflow.entity.WorkFlowData;
|
||||
import com.codvision.workflow.service.WorkFlowDataService;
|
||||
import com.codvision.workflow.util.WorkFlowUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.flowable.bpmn.constants.BpmnXMLConstants;
|
||||
import org.flowable.bpmn.model.BpmnModel;
|
||||
import org.flowable.bpmn.model.ExtensionElement;
|
||||
import org.flowable.bpmn.model.FlowElement;
|
||||
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
|
||||
import org.flowable.engine.RepositoryService;
|
||||
import org.flowable.engine.delegate.event.AbstractFlowableEngineEventListener;
|
||||
import org.flowable.engine.delegate.event.FlowableActivityEvent;
|
||||
import org.flowable.task.service.impl.persistence.entity.TaskEntityImpl;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.codvision.workflow.constant.CacheContant.WORK_FLOW_STATUS;
|
||||
import static com.codvision.workflow.constant.WorkFlowConstant.EXTENSION_ELEMENT_WORK_FLOW_STATUS;
|
||||
import static com.codvision.workflow.constant.WorkFlowConstant.EXTENSION_ELEMENT_WORK_FLOW_STATUS_CODE;
|
||||
|
||||
/**
|
||||
* 全局流程状态更改监听器
|
||||
* @author hxl
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class GlobalWorkFlowStatusChangeListener extends AbstractFlowableEngineEventListener {
|
||||
|
||||
private final RepositoryService repositoryService;
|
||||
private final WorkFlowDataService workFlowDataService;
|
||||
|
||||
@Override
|
||||
protected void activityCompleted(FlowableActivityEvent event) {
|
||||
if (!BpmnXMLConstants.ELEMENT_EVENT_END.equals(event.getActivityType())) {
|
||||
return;
|
||||
}
|
||||
|
||||
changeStatus(event.getProcessDefinitionId(), event.getProcessInstanceId(), event.getActivityId());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void taskCreated(FlowableEngineEntityEvent event) {
|
||||
TaskEntityImpl entity = (TaskEntityImpl) event.getEntity();
|
||||
changeStatus(entity.getProcessDefinitionId(), entity.getProcessInstanceId(), entity.getTaskDefinitionKey());
|
||||
}
|
||||
|
||||
|
||||
private void changeStatus(String processDefinitionId, String instanceId, String flowElementId) {
|
||||
BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId);
|
||||
FlowElement flowElement = WorkFlowUtil.getFlowElementById(bpmnModel, flowElementId);
|
||||
if (flowElement == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<ExtensionElement> flowStatusElements = WorkFlowUtil.getExtensionElements(flowElement, EXTENSION_ELEMENT_WORK_FLOW_STATUS);
|
||||
if (CollectionUtils.isEmpty(flowStatusElements)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ExtensionElement extensionElement = flowStatusElements.get(0);
|
||||
String workFlowStatus = extensionElement.getAttributeValue(null, EXTENSION_ELEMENT_WORK_FLOW_STATUS_CODE);
|
||||
if (StringUtils.isBlank(workFlowStatus)) {
|
||||
return;
|
||||
}
|
||||
|
||||
WorkFlowData workFlowData = workFlowDataService.getFormDataByInstanceId(instanceId);
|
||||
if (workFlowData == null) {
|
||||
// 启动时数据还未存储入库,此时先记录流程状态
|
||||
RedisUtil.set(WORK_FLOW_STATUS + instanceId, workFlowStatus,1, TimeUnit.MINUTES);
|
||||
return;
|
||||
}
|
||||
|
||||
workFlowData.setStatus(Integer.valueOf(workFlowStatus));
|
||||
workFlowDataService.updateById(workFlowData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.codvision.workflow.listener;
|
||||
|
||||
|
||||
import com.codvision.auth.support.SendSms;
|
||||
import com.codvision.base.service.ISysConfigService;
|
||||
import com.codvision.workflow.entity.dto.WorkFlowSmsDTO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.engine.delegate.event.AbstractFlowableEngineEventListener;
|
||||
import org.flowable.variable.api.event.FlowableVariableEvent;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import static com.codvision.workflow.constant.WorkFlowConstant.CLAIM_SIGN;
|
||||
import static com.codvision.workflow.constant.WorkFlowConstant.CLAIM_SMS_PARAMS;
|
||||
|
||||
/**
|
||||
* 全局变量监听器
|
||||
* @author hxl
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class GlobalWorkFlowVariableListener extends AbstractFlowableEngineEventListener {
|
||||
|
||||
private final TaskService taskService;
|
||||
private final ISysConfigService configService;
|
||||
|
||||
@Override
|
||||
protected void variableCreated(FlowableVariableEvent event) {
|
||||
try {
|
||||
// 签收短信消息通知
|
||||
if (CLAIM_SIGN.equals(event.getVariableName()) && (Boolean) event.getVariableValue()) {
|
||||
WorkFlowSmsDTO sms = (WorkFlowSmsDTO) taskService.getVariableLocal(event.getTaskId(), CLAIM_SMS_PARAMS);
|
||||
if (sms == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
SendSms sendSms = new SendSms(configService);
|
||||
sendSms.sendWithParam(sms.getPhoneNumbers(), sms.getSignName(), sms.getTemplateCode(), sms.getTemplateParam());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.codvision.workflow.listener.execution;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.flowable.engine.delegate.DelegateExecution;
|
||||
import org.flowable.engine.delegate.ExecutionListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.codvision.base.support.BaseConst.COMMA_SYMBOL;
|
||||
|
||||
/**
|
||||
* 多实例执行监听器
|
||||
* @author hxl
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Component(value = "workFlowMultiInstanceListener")
|
||||
public class WorkFlowMultiInstanceListener implements ExecutionListener {
|
||||
|
||||
@Override
|
||||
public void notify(DelegateExecution execution) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户ID集合
|
||||
* @param variable 变量名称,支持表单变量、自定义变量
|
||||
* @return 用户ID集合
|
||||
*/
|
||||
public List<Integer> execute(String variable) {
|
||||
return Arrays.stream(variable.split(COMMA_SYMBOL)).map(s -> Integer.parseInt(s.trim())).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.codvision.workflow.listener.task;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.codvision.auth.entity.SysUser;
|
||||
import com.codvision.auth.service.ISysUserService;
|
||||
import com.codvision.auth.support.SendSms;
|
||||
import com.codvision.base.service.ISysConfigService;
|
||||
import com.codvision.workflow.entity.dto.WorkFlowSmsDTO;
|
||||
import com.codvision.workflow.service.WorkFlowService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.codvision.workflow.constant.WorkFlowConstant.CLAIM_SMS_PARAMS;
|
||||
import static com.codvision.workflow.constant.WorkFlowConstant.SMS_CURRENT_USERS;
|
||||
|
||||
|
||||
/**
|
||||
* 阿里云短信消息通知
|
||||
* @author hxl
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Component(value = "workFlowAliyunSmsMsgNoticeListener")
|
||||
public class WorkFlowAliyunSmsMsgNoticeListener {
|
||||
|
||||
private static final Pattern PATTERN = Pattern.compile("\\$\\{([^}]+)}");
|
||||
private final ISysConfigService configService;
|
||||
private final TaskService taskService;
|
||||
private final WorkFlowService workFlowService;
|
||||
private final ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 发送短信消息通知(事件类型 -> create)
|
||||
* @param delegateTask 当前任务
|
||||
* @param expression 布尔表达式,为true时生效
|
||||
* @param smsJson 短信信息,json形式
|
||||
*/
|
||||
public void sendMsg(DelegateTask delegateTask, boolean expression, String smsJson) {
|
||||
try {
|
||||
if (!expression) {
|
||||
return;
|
||||
}
|
||||
|
||||
WorkFlowSmsDTO sms = preHandle(delegateTask.getId(), smsJson);
|
||||
if (sms == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
sendSmsMsg(sms);
|
||||
} catch (Exception e) {
|
||||
// 发送短信可以看做边缘业务功能,捕获后仅打印异常信息,防止发生异常影响流程的正常进行
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 签收发送短信消息通知(事件类型 -> create)
|
||||
* @param delegateTask 当前任务
|
||||
* @param smsJson 短信信息,json形式
|
||||
*/
|
||||
public void sendClaimMsg(DelegateTask delegateTask, String smsJson) {
|
||||
WorkFlowSmsDTO sms = preHandle(delegateTask.getId(), smsJson);
|
||||
if (sms == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
taskService.setVariableLocal(delegateTask.getId(), CLAIM_SMS_PARAMS, sms);
|
||||
}
|
||||
|
||||
|
||||
@SneakyThrows
|
||||
private void sendSmsMsg(WorkFlowSmsDTO sms) {
|
||||
SendSms sendSms = new SendSms(configService);
|
||||
sendSms.sendWithParam(sms.getPhoneNumbers(), sms.getSignName(), sms.getTemplateCode(), sms.getTemplateParam());
|
||||
}
|
||||
|
||||
private WorkFlowSmsDTO preHandle(String taskId, String smsJson) {
|
||||
if (StringUtils.isBlank(smsJson) || !JSONUtil.isTypeJSONObject(smsJson)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
WorkFlowSmsDTO sms = JSONUtil.toBean(smsJson, WorkFlowSmsDTO.class);
|
||||
if (StringUtils.isBlank(sms.getTemplateCode()) || StringUtils.isBlank(sms.getSignName())
|
||||
|| StringUtils.isBlank(sms.getTemplateParam()) || StringUtils.isBlank(sms.getPhoneNumbers())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!JSONUtil.isTypeJSONObject(sms.getTemplateParam())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
sms.setPhoneNumbers(initSmsParams(taskId, sms.getPhoneNumbers()));
|
||||
sms.setTemplateParam(initSmsParams(taskId, sms.getTemplateParam()));
|
||||
return sms;
|
||||
}
|
||||
|
||||
private String initSmsParams(String taskId, String str) {
|
||||
Map<String, Object> varMap = new HashMap<>(16);
|
||||
Matcher matcher = PATTERN.matcher(str);
|
||||
while (matcher.find()) {
|
||||
String var = matcher.group(1);
|
||||
if (StringUtils.isBlank(var)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (varMap.containsKey(var)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (SMS_CURRENT_USERS.equals(var)) {
|
||||
List<Integer> taskRelatedUserIds = workFlowService.getTaskRelatedUserIds(taskId);
|
||||
if (CollectionUtils.isEmpty(taskRelatedUserIds)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(taskRelatedUserIds);
|
||||
if (CollectionUtils.isEmpty(sysUsers)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String value = sysUsers.stream().map(SysUser::getMobile).filter(StringUtils::isNotBlank).distinct().collect(Collectors.joining(","));
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
varMap.put(var, value);
|
||||
}
|
||||
} else {
|
||||
Object o = taskService.getVariable(taskId, var);
|
||||
if (o == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
varMap.put(var, o);
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<String, Object> entry : varMap.entrySet()) {
|
||||
str = str.replaceAll("\\$\\{"+entry.getKey()+"}", String.valueOf(entry.getValue()));
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.codvision.workflow.listener.task;
|
||||
|
||||
import com.codvision.workflow.service.WorkFlowService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.flowable.task.service.delegate.TaskListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.codvision.workflow.constant.WorkFlowConstant.AUTO_COMPLETE_NO_USERS;
|
||||
|
||||
|
||||
/**
|
||||
* 自动办结
|
||||
* @author hxl
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Component(value = "workFlowAutoCompleteListener")
|
||||
public class WorkFlowAutoCompleteListener implements TaskListener {
|
||||
|
||||
private final WorkFlowService workFlowService;
|
||||
private final TaskService taskService;
|
||||
|
||||
|
||||
/**
|
||||
* 若当前节点无办理人(含候选人与候选组),则自动办结(事件类型 -> create)
|
||||
* @param delegateTask 当前节点
|
||||
*/
|
||||
@Override
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
List<Integer> userIds = workFlowService.getTaskRelatedUserIds(delegateTask.getId());
|
||||
if (CollectionUtils.isNotEmpty(userIds)) {
|
||||
return;
|
||||
}
|
||||
|
||||
taskService.setVariableLocal(delegateTask.getId(), AUTO_COMPLETE_NO_USERS, true);
|
||||
taskService.complete(delegateTask.getId());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.codvision.workflow.listener.task;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.codvision.workflow.entity.WorkFlowData;
|
||||
import com.codvision.workflow.entity.WorkFlowForm;
|
||||
import com.codvision.workflow.service.WorkFlowDataService;
|
||||
import com.codvision.workflow.service.WorkFlowFormService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.flowable.task.service.delegate.TaskListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 清除当前任务节点历史填写的表单数据(任务监听器 事件类型 -> create)
|
||||
* @author hxl
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Component(value = "workFlowCleanHistoricalFormDataListener")
|
||||
public class WorkFlowCleanHistoricalFormDataListener implements TaskListener {
|
||||
|
||||
private final static String AUTH_NUM = "3";
|
||||
private final WorkFlowFormService workFlowFormService;
|
||||
private final WorkFlowDataService workFlowDataService;
|
||||
|
||||
@Override
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
WorkFlowData workFlowData = workFlowDataService.getFormDataByInstanceId(delegateTask.getProcessInstanceId());
|
||||
if (workFlowData == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
WorkFlowForm workFlowForm = workFlowFormService.getTaskFormAuth(delegateTask.getProcessDefinitionId(), delegateTask.getTaskDefinitionKey());
|
||||
if (workFlowForm == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, Object> formDataMap = JSONUtil.parseObj(workFlowData.getFormDataJson());
|
||||
Map<String, Object> formAuthMap = JSONUtil.parseObj(workFlowForm.getFormAuthJson());
|
||||
if (ObjectUtil.isEmpty(formDataMap) || ObjectUtil.isEmpty(formAuthMap)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (Map.Entry<String, Object> it : formAuthMap.entrySet()) {
|
||||
if (AUTH_NUM.equals(it.getValue())) {
|
||||
formDataMap.remove(it.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
workFlowData.setFormDataJson(JSONUtil.toJsonStr(formDataMap));
|
||||
workFlowDataService.updateById(workFlowData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.codvision.workflow.listener.task;
|
||||
|
||||
|
||||
import com.codvision.commoncore.exception.BusinessException;
|
||||
import com.codvision.workflow.entity.WorkFlowRecord;
|
||||
import com.codvision.workflow.service.WorkFlowRecordService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import static com.codvision.workflow.constant.WorkFlowConstant.TASK_OPERATE_LIMIT;
|
||||
|
||||
|
||||
/**
|
||||
* 自定义操作次数限制监听器(任务监听器 事件类型 -> complete)
|
||||
* @author hxl
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Component(value = "workFlowCustomOperateLimitListener")
|
||||
public class WorkFlowCustomOperateLimitListener {
|
||||
|
||||
private final TaskService taskService;
|
||||
private final WorkFlowRecordService workFlowRecordService;
|
||||
|
||||
/**
|
||||
* 执行方法
|
||||
* @param delegateTask 当前任务
|
||||
* @param limitType 限制类型 0-用户 1-组织
|
||||
* @param limitCount 限制次数
|
||||
* @param expression 布尔表达式
|
||||
*/
|
||||
public void execute(DelegateTask delegateTask, Integer limitType, Integer limitCount, boolean expression) {
|
||||
if (!expression || limitType == null || limitCount == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
WorkFlowRecord workFlowRecord = workFlowRecordService.getByTaskId(delegateTask.getId());
|
||||
if (workFlowRecord == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
int limitTarget = limitType == 0 ? workFlowRecord.getOperatorUid() : workFlowRecord.getOperatorOid();
|
||||
String key = TASK_OPERATE_LIMIT + delegateTask.getTaskDefinitionKey() + "_" + limitType + "_" + limitTarget;
|
||||
Integer count = (Integer) taskService.getVariable(delegateTask.getId(), key);
|
||||
count = count == null ? 1 : ++count;
|
||||
if (count > limitCount) {
|
||||
throw new BusinessException("分配次数已达上限");
|
||||
}
|
||||
|
||||
taskService.setVariable(delegateTask.getId(), key, count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.codvision.workflow.listener.task;
|
||||
|
||||
import com.codvision.auth.entity.SysUser;
|
||||
import com.codvision.auth.service.ISysUserService;
|
||||
import com.codvision.auth.service.third.GovDingService;
|
||||
import com.codvision.workflow.service.WorkFlowService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 普通钉钉、浙政钉消息通知
|
||||
* @author hxl
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Component(value = "workFlowDingMsgNoticeListener")
|
||||
public class WorkFlowDingMsgNoticeListener {
|
||||
|
||||
private final GovDingService govDingService;
|
||||
private final ISysUserService sysUserService;
|
||||
private final WorkFlowService workFlowService;
|
||||
|
||||
/**
|
||||
* 浙政钉文本消息(工作通知消息 事件类型 -> create)
|
||||
* @param delegateTask 当前任务
|
||||
* @param receiverIds 接收人用户ID(accountId),若未指定消息接收人,则默认发送消息给当前节点的所有用户
|
||||
* @param content 消息内容
|
||||
*/
|
||||
public void sendGovTextMsg(DelegateTask delegateTask, String receiverIds, String content) {
|
||||
if (StringUtils.isBlank(content)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 若未指定消息接收人,则默认发送消息给当前节点的所有用户
|
||||
receiverIds = StringUtils.isBlank(receiverIds) ? getReceiverIds(delegateTask.getId()) : receiverIds;
|
||||
if (StringUtils.isBlank(receiverIds)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
govDingService.sendTextMsg(receiverIds, content);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 浙政钉链接消息(工作通知消息 事件类型 -> create)
|
||||
* @param delegateTask 当前任务
|
||||
* @param receiverIds 接收人用户ID(accountId),若未指定消息接收人,则默认发送消息给当前节点的所有用户
|
||||
* @param title 消息标题
|
||||
* @param text 消息描述
|
||||
* @param messageUrl 消息点击链接地址,当发送消息为小程序时支持小程序跳转链接
|
||||
* @param picUrl 图片地址
|
||||
*/
|
||||
public void sendGovLinkMsg(DelegateTask delegateTask, String receiverIds, String title, String text, String messageUrl, String picUrl) {
|
||||
if (StringUtils.isBlank(title) || StringUtils.isBlank(text) || StringUtils.isBlank(messageUrl) || StringUtils.isBlank(picUrl)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 若未指定消息接收人,则默认发送消息给当前节点的所有用户
|
||||
receiverIds = StringUtils.isBlank(receiverIds) ? getReceiverIds(delegateTask.getId()) : receiverIds;
|
||||
if (StringUtils.isBlank(receiverIds)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
govDingService.sendLinkMsg(receiverIds, title, text, messageUrl, picUrl);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 浙政钉MarkDown消息(工作通知消息 事件类型 -> create)
|
||||
* @param delegateTask 当前任务
|
||||
* @param receiverIds 接收人用户ID(accountId),若未指定消息接收人,则默认发送消息给当前节点的所有用户
|
||||
* @param title 标题
|
||||
* @param text markdown的文本
|
||||
*/
|
||||
public void sendGovMarkDownMsg(DelegateTask delegateTask, String receiverIds, String title, String text) {
|
||||
if (StringUtils.isBlank(title) || StringUtils.isBlank(text)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 若未指定消息接收人,则默认发送消息给当前节点的所有用户
|
||||
receiverIds = StringUtils.isBlank(receiverIds) ? getReceiverIds(delegateTask.getId()) : receiverIds;
|
||||
if (StringUtils.isBlank(receiverIds)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
govDingService.sendMarkDownMsg(receiverIds, title, text);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private String getReceiverIds(String taskId) {
|
||||
List<Integer> taskRelatedUserIds = workFlowService.getTaskRelatedUserIds(taskId);
|
||||
if (CollectionUtils.isEmpty(taskRelatedUserIds)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(taskRelatedUserIds);
|
||||
if (CollectionUtils.isEmpty(sysUsers)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return sysUsers.stream().map(SysUser::getZzdId)
|
||||
.filter(StringUtils::isNotBlank).distinct().collect(Collectors.joining(","));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
package com.codvision.workflow.listener.task;
|
||||
|
||||
|
||||
import com.codvision.auth.entity.SysRole;
|
||||
import com.codvision.auth.entity.vo.SysUserVO;
|
||||
import com.codvision.auth.service.ISysRoleService;
|
||||
import com.codvision.auth.service.ISysUserService;
|
||||
import com.codvision.commoncore.exception.BusinessException;
|
||||
import com.codvision.commoncore.utils.Preconditions;
|
||||
import com.codvision.workflow.entity.WorkFlowRecord;
|
||||
import com.codvision.workflow.entity.dto.WorkFlowDynamicAllocationDTO;
|
||||
import com.codvision.workflow.service.WorkFlowRecordService;
|
||||
import com.codvision.workflow.service.WorkFlowService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.flowable.bpmn.constants.BpmnXMLConstants;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.engine.runtime.ActivityInstance;
|
||||
import org.flowable.task.api.Task;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.codvision.workflow.constant.WorkFlowConstant.TASK_DYNAMIC_HANDLER;
|
||||
import static com.codvision.workflow.constant.WorkFlowConstant.TASK_ROLR;
|
||||
import static com.codvision.workflow.constant.enums.WorkFlowOperationTypeEnum.RETURN;
|
||||
|
||||
|
||||
/**
|
||||
* 动态分配处理人或处理组织(任务监听器 事件类型 -> create)
|
||||
* @author hxl
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Component(value = "workFlowDynamicAllocationListener")
|
||||
public class WorkFlowDynamicAllocationListener {
|
||||
|
||||
private final TaskService taskService;
|
||||
private final WorkFlowService workFlowService;
|
||||
private final WorkFlowRecordService workFlowRecordService;
|
||||
private final ISysUserService sysUserService;
|
||||
private final ISysRoleService sysRoleService;
|
||||
private final RuntimeService runtimeService;
|
||||
|
||||
/**
|
||||
* 分配组织
|
||||
* @param delegateTask 当前任务
|
||||
* @param oid 组织ID
|
||||
* @param roleId 角色ID,可以为空
|
||||
*/
|
||||
public void setOrg(DelegateTask delegateTask, Integer oid, Long roleId) {
|
||||
if (oid == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (roleId != null) {
|
||||
SysRole sysRole = sysRoleService.getById(roleId);
|
||||
if (sysRole == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
taskService.setVariableLocal(delegateTask.getId(), TASK_ROLR, roleId);
|
||||
}
|
||||
|
||||
workFlowService.clearCandidates(delegateTask.getId());
|
||||
taskService.addCandidateGroup(delegateTask.getId(), oid.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 分配用户
|
||||
* @param delegateTask 当前任务
|
||||
* @param oid 组织OID
|
||||
* @param roleId 角色ID, 可以为空
|
||||
*/
|
||||
public void setAssignees(DelegateTask delegateTask, Integer oid, Long roleId) {
|
||||
if (oid == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
workFlowService.clearCandidates(delegateTask.getId());
|
||||
delegateTask.addCandidateUsers(getNextUserIds(oid, roleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分配用户
|
||||
* @param delegateTask 当前任务
|
||||
* @param variableName 表单字段
|
||||
*/
|
||||
public void setAssignee(DelegateTask delegateTask, String variableName) {
|
||||
if (StringUtils.isBlank(variableName)) {
|
||||
return;
|
||||
}
|
||||
|
||||
String variable = (String) taskService.getVariable(delegateTask.getId(), variableName);
|
||||
if (StringUtils.isBlank(variable)) {
|
||||
return;
|
||||
}
|
||||
|
||||
workFlowService.clearCandidates(delegateTask.getId());
|
||||
delegateTask.addCandidateUsers(Collections.singletonList(variable));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分配用户或组织(配合动态表单组件使用)
|
||||
* @param delegateTask 当前任务
|
||||
* @param roleId 角色ID,可以为空,使用场景:分配组织时可指定具体的角色
|
||||
*/
|
||||
public void setAssigneesOrOrg(DelegateTask delegateTask, Long roleId) {
|
||||
// 兼容退回操作
|
||||
WorkFlowRecord workFlowRecord = workFlowRecordService.getLatestByInstanceId(delegateTask.getProcessInstanceId());
|
||||
if (workFlowRecord != null && workFlowRecord.getAction() != null && RETURN.getType() == workFlowRecord.getAction()) {
|
||||
List<ActivityInstance> activityInstances = runtimeService.createActivityInstanceQuery()
|
||||
.processInstanceId(delegateTask.getProcessInstanceId()).activityId(delegateTask.getTaskDefinitionKey()).finished().orderByActivityInstanceEndTime().desc().list();
|
||||
if (CollectionUtils.isEmpty(activityInstances)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ActivityInstance activityInstance = activityInstances.get(0);
|
||||
delegateTask.addCandidateUsers(Collections.singletonList(activityInstance.getAssignee()));
|
||||
return;
|
||||
}
|
||||
|
||||
workFlowService.clearCandidates(delegateTask.getId());
|
||||
WorkFlowDynamicAllocationDTO allocation = (WorkFlowDynamicAllocationDTO) taskService.getVariable(delegateTask.getId(), TASK_DYNAMIC_HANDLER);
|
||||
if (allocation == null) {
|
||||
throw new BusinessException("获取动态分配处理人或处理组织信息失败");
|
||||
}
|
||||
|
||||
if (allocation.getAllocationType() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (allocation.getAllocationType() == 0) {
|
||||
if (CollectionUtils.isEmpty(allocation.getUserIdList())) {
|
||||
return;
|
||||
}
|
||||
delegateTask.addCandidateUsers(allocation.getUserIdList().stream().map(String::valueOf).collect(Collectors.toList()));
|
||||
} else {
|
||||
Integer oid = allocation.getOid();
|
||||
if (oid == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (roleId != null) {
|
||||
delegateTask.addCandidateUsers(getNextUserIds(oid, roleId));
|
||||
} else {
|
||||
taskService.addCandidateGroup(delegateTask.getId(), oid.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 由下而上逐级设置处理人
|
||||
* @param delegateTask 当前任务
|
||||
* @param isFirstUserTask 是否为流程中第一个用户节点
|
||||
* @param roleId 角色ID,可以为空
|
||||
*/
|
||||
public void setParentOrgAssignee(DelegateTask delegateTask, Boolean isFirstUserTask, Long roleId) {
|
||||
if (isFirstUserTask == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String userId = null;
|
||||
if (isFirstUserTask) {
|
||||
// 获取发起人ID
|
||||
userId = (String) delegateTask.getVariable(BpmnXMLConstants.ATTRIBUTE_EVENT_START_INITIATOR);
|
||||
} else {
|
||||
List<Task> taskList = taskService.createTaskQuery().processInstanceId(delegateTask.getProcessInstanceId())
|
||||
.orderByTaskCreateTime().desc().list();
|
||||
if (CollectionUtils.isNotEmpty(taskList)) {
|
||||
// 获取上一个任务节点的办理人ID
|
||||
userId = taskList.get(0).getAssignee();
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(userId)) {
|
||||
SysUserVO sysUserVO = sysUserService.getDetail(Integer.valueOf(userId));
|
||||
Preconditions.checkArgument(sysUserVO != null, "获取发起人或上一步办理人用户信息失败");
|
||||
delegateTask.addCandidateUsers(getNextUserIds(sysUserVO.getActivePoid(), roleId));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private List<String> getNextUserIds(Integer oid, Long roleId) {
|
||||
Map<String, Object> paraMap = new HashMap<>(16);
|
||||
paraMap.put("oid", oid);
|
||||
if (roleId != null) {
|
||||
paraMap.put("roleId", roleId);
|
||||
}
|
||||
|
||||
List<SysUserVO> sysUserVOList = sysUserService.listUsers(paraMap);
|
||||
Preconditions.checkArgument(CollectionUtils.isNotEmpty(sysUserVOList), "获取下一步办理人信息失败");
|
||||
return sysUserVOList.stream().map(SysUserVO::getId).map(String::valueOf).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.codvision.workflow.listener.task;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.flowable.task.service.delegate.TaskListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import static com.codvision.workflow.constant.WorkFlowConstant.SUB_DATA;
|
||||
|
||||
|
||||
/**
|
||||
* 数据隔离配置(事件类型 -> create)
|
||||
* @author hxl
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Component(value = "workFlowSubDataListener")
|
||||
public class WorkFlowSubDataListener implements TaskListener {
|
||||
|
||||
private final TaskService taskService;
|
||||
|
||||
@Override
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
taskService.setVariableLocal(delegateTask.getId(), SUB_DATA, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.codvision.workflow.listener.task;
|
||||
|
||||
|
||||
import com.codvision.auth.entity.Org;
|
||||
import com.codvision.auth.entity.SysRole;
|
||||
import com.codvision.auth.entity.SysUser;
|
||||
import com.codvision.auth.service.IOrgService;
|
||||
import com.codvision.auth.service.ISysRoleService;
|
||||
import com.codvision.auth.service.ISysUserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import static com.codvision.workflow.constant.WorkFlowConstant.*;
|
||||
|
||||
|
||||
/**
|
||||
* 任务延期申请审核人员配置监听器 (任务监听器 事件类型 -> create)
|
||||
* @author hxl
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Component(value = "workFlowTaskDelayReviewerConfigListener")
|
||||
public class WorkFlowTaskDelayReviewerConfigListener {
|
||||
|
||||
private final TaskService taskService;
|
||||
private final ISysUserService sysUserService;
|
||||
private final IOrgService orgService;
|
||||
private final ISysRoleService sysRoleService;
|
||||
|
||||
public void setUid(DelegateTask delegateTask, Integer uid) {
|
||||
if (uid == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
SysUser sysUser = sysUserService.getById(uid);
|
||||
if (sysUser == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
taskService.setVariable(delegateTask.getId(), WORK_FLOW_DELAY_REVIEWER_CONFIG_USER, uid);
|
||||
}
|
||||
|
||||
public void setOid(DelegateTask delegateTask, Integer oid, Integer roleId) {
|
||||
if (oid == null && roleId == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (roleId != null) {
|
||||
SysRole sysRole = sysRoleService.getById(roleId);
|
||||
if (sysRole == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
taskService.setVariable(delegateTask.getId(), WORK_FLOW_DELAY_REVIEWER_CONFIG_ROLE, roleId);
|
||||
}
|
||||
|
||||
if (oid != null) {
|
||||
Org org = orgService.getById(oid);
|
||||
if (org == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
taskService.setVariable(delegateTask.getId(), WORK_FLOW_DELAY_REVIEWER_CONFIG_ORG, oid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.codvision.workflow.listener.task;
|
||||
|
||||
import com.codvision.workflow.entity.dto.WorkFlowTaskReturnLimitDTO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static com.codvision.workflow.constant.WorkFlowConstant.TASK_RETURN_LIMIT;
|
||||
|
||||
|
||||
/**
|
||||
* 回退次数限制监听器(任务监听器 事件类型 -> create)
|
||||
* @author hxl
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Component(value = "workFlowTaskReturnLimitListener")
|
||||
public class WorkFlowTaskReturnLimitListener {
|
||||
|
||||
private final TaskService taskService;
|
||||
|
||||
/**
|
||||
* 执行方法
|
||||
* @param delegateTask 当前任务
|
||||
* @param limitType 限制类型 0-用户 1-组织
|
||||
* @param limitCount 限制次数
|
||||
* @param expression 布尔表达式
|
||||
*/
|
||||
public void execute(DelegateTask delegateTask, Integer limitType, Integer limitCount, boolean expression) {
|
||||
if (!expression || limitType == null || limitCount == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String variableName = TASK_RETURN_LIMIT + delegateTask.getTaskDefinitionKey();
|
||||
WorkFlowTaskReturnLimitDTO taskReturnLimit = (WorkFlowTaskReturnLimitDTO) taskService.getVariable(delegateTask.getId(), variableName);
|
||||
if (taskReturnLimit == null) {
|
||||
taskReturnLimit = WorkFlowTaskReturnLimitDTO.builder().taskDefinitionKey(delegateTask.getTaskDefinitionKey())
|
||||
.limitType(limitType)
|
||||
.limitCount(limitCount)
|
||||
.userMap(new HashMap<>(16))
|
||||
.orgMap(new HashMap<>(16))
|
||||
.build();
|
||||
taskService.setVariable(delegateTask.getId(), variableName, taskReturnLimit);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.codvision.workflow.listener.task;
|
||||
|
||||
|
||||
import com.codvision.workflow.job.WorkFlowTaskClaimTimeOutJob;
|
||||
import com.codvision.workflow.job.WorkFlowTaskCompleteTimeOutJob;
|
||||
import com.codvision.workflow.service.WorkFlowService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import static com.codvision.workflow.constant.WorkFlowConstant.WORK_FLOW_TIME_OUT_CLAIM_TASK_ID;
|
||||
import static com.codvision.workflow.constant.WorkFlowConstant.WORK_FLOW_TIME_OUT_COMPLETE_TASK_ID;
|
||||
|
||||
/**
|
||||
* 用户任务超时监听器(任务监听器 事件类型 -> create)
|
||||
* @author hxl
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Component(value = "workFlowTaskTimeOutListener")
|
||||
public class WorkFlowTaskTimeOutListener {
|
||||
|
||||
private final WorkFlowService workFlowService;
|
||||
|
||||
/**
|
||||
* 用户任务签收超时
|
||||
* @param delegateTask 当前任务
|
||||
* @param minutes 分钟
|
||||
*/
|
||||
public void claim(DelegateTask delegateTask, Integer minutes) {
|
||||
workFlowService.taskJob(delegateTask, WORK_FLOW_TIME_OUT_CLAIM_TASK_ID, minutes, WorkFlowTaskClaimTimeOutJob.class, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户任务完成超时
|
||||
* @param delegateTask 当前任务
|
||||
* @param minutes 分钟
|
||||
*/
|
||||
public void complete(DelegateTask delegateTask, Integer minutes) {
|
||||
workFlowService.taskJob(delegateTask, WORK_FLOW_TIME_OUT_COMPLETE_TASK_ID, minutes, WorkFlowTaskCompleteTimeOutJob.class, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.codvision.workflow.listener.task;
|
||||
|
||||
import com.codvision.base.support.WebSocketServer;
|
||||
import com.codvision.workflow.service.WorkFlowService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.flowable.task.service.delegate.TaskListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 待办消息WebSocket通知监听器(任务监听器 事件类型 -> create)
|
||||
* @author hxl
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Component(value = "workFlowTodoMsgNoticeListener")
|
||||
public class WorkFlowTodoMsgNoticeListener implements TaskListener {
|
||||
|
||||
private final WorkFlowService workFlowService;
|
||||
|
||||
@Override
|
||||
@SneakyThrows
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
List<Integer> taskRelatedUserIds = workFlowService.getTaskRelatedUserIds(delegateTask.getId());
|
||||
if (CollectionUtils.isEmpty(taskRelatedUserIds)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (Integer uid : taskRelatedUserIds) {
|
||||
WebSocketServer.sendInfo("EVENT_TODO_MSG", uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.workflow.entity.Questionnaire;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author codvision
|
||||
*/
|
||||
public interface QuestionnaireMapper extends BaseMapper<Questionnaire> {
|
||||
|
||||
/**
|
||||
* 分页通用查询
|
||||
* @param page 分页对象
|
||||
* @param paraMap 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<Questionnaire> getPageResult(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.workflow.entity.QuestionnaireModule;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author codvision
|
||||
*/
|
||||
public interface QuestionnaireModuleMapper extends BaseMapper<QuestionnaireModule> {
|
||||
|
||||
/**
|
||||
* 分页通用查询
|
||||
* @param page 分页对象
|
||||
* @param paraMap 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<QuestionnaireModule> getPageResult(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);
|
||||
|
||||
/**
|
||||
* 检测是否已经填写过问卷
|
||||
* @param uuid uuid
|
||||
* @param webId webId
|
||||
* @return 数值
|
||||
*/
|
||||
Integer checkFillIn(@Param("uuid") String uuid, @Param("webId") String webId);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.workflow.entity.QuestionnaireResult;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author codvision
|
||||
*/
|
||||
public interface QuestionnaireResultMapper extends BaseMapper<QuestionnaireResult> {
|
||||
|
||||
/**
|
||||
* 分页通用查询
|
||||
* @param page 分页对象
|
||||
* @param paraMap 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<QuestionnaireResult> getPageResult(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.codvision.workflow.entity.WorkFlowButton;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowButtonMapper extends BaseMapper<WorkFlowButton> {
|
||||
|
||||
|
||||
/**
|
||||
* 分页通用查询
|
||||
* @param page 分页对象
|
||||
* @param queryWrapper 条件构造器
|
||||
* @return 数据列表
|
||||
*/
|
||||
IPage<WorkFlowButton> getPageResult(IPage<WorkFlowButton> page, @Param(Constants.WRAPPER) Wrapper<WorkFlowButton> queryWrapper);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.workflow.entity.WorkFlowCcItem;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowCcItemMapper extends BaseMapper<WorkFlowCcItem> {
|
||||
|
||||
/**
|
||||
* 分页通用查询
|
||||
* @param page 分页对象
|
||||
* @param paraMap 查询条件
|
||||
* @return 数据列表
|
||||
*/
|
||||
IPage<WorkFlowCcItem> getPageResult(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);
|
||||
|
||||
/**
|
||||
* 批量添加抄送人
|
||||
* @param ccItems 参数
|
||||
*/
|
||||
void batchAddCcItems(List<WorkFlowCcItem> ccItems);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.workflow.entity.WorkFlowData;
|
||||
import com.codvision.workflow.entity.vo.WorkFlowDataVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowDataMapper extends BaseMapper<WorkFlowData> {
|
||||
|
||||
/**
|
||||
* 分页通用查询
|
||||
* @param page 分页对象
|
||||
* @param paraMap 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowDataVO> getPageResult(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);
|
||||
|
||||
/**
|
||||
* 我发起的列表
|
||||
* @param page 分页对象
|
||||
* @param paraMap 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowDataVO> myInitiatedList(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);
|
||||
|
||||
/**
|
||||
* 我待办的列表
|
||||
* @param page 分页对象
|
||||
* @param paraMap 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowDataVO> todoList(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);
|
||||
|
||||
|
||||
/**
|
||||
* 我已办的列表
|
||||
* @param page 分页对象
|
||||
* @param paraMap 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowDataVO> finishedList(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);
|
||||
|
||||
|
||||
/**
|
||||
* 待签收列表
|
||||
* @param page 分页对象
|
||||
* @param paraMap 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowDataVO> claimList(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);
|
||||
|
||||
/**
|
||||
* 更新表单数据
|
||||
* @param instanceId 流程实例ID
|
||||
* @param jsonData 表单数据
|
||||
*/
|
||||
void updateFormDataByInstanceId(@Param("instanceId") String instanceId, @Param("jsonData") String jsonData);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.workflow.entity.WorkFlowDefinition;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowDefinitionMapper {
|
||||
|
||||
/**
|
||||
* 分页通用查询
|
||||
* @param page 分页对象
|
||||
* @param paraMap 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowDefinition> getPageResult(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.workflow.entity.WorkFlowDelayRecord;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowDelayRecordMapper extends BaseMapper<WorkFlowDelayRecord> {
|
||||
|
||||
/**
|
||||
* 分页通用查询
|
||||
* @param page 分页对象
|
||||
* @param paraMap 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowDelayRecord> getPageResult(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);
|
||||
|
||||
/**
|
||||
* 我的延期申请记录
|
||||
* @param page 分页对象
|
||||
* @param paraMap 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowDelayRecord> myDelayRecords(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.workflow.entity.WorkFlowExpression;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowExpressionMapper extends BaseMapper<WorkFlowExpression> {
|
||||
|
||||
/**
|
||||
* 分页通用查询
|
||||
* @param page 分页对象
|
||||
* @param paraMap 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowExpression> getPageResult(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.codvision.workflow.entity.WorkFlowFormLink;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowFormLinkMapper extends BaseMapper<WorkFlowFormLink> {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.codvision.workflow.entity.WorkFlowForm;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowFormMapper extends BaseMapper<WorkFlowForm> {
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.workflow.entity.WorkFlowListener;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowListenerMapper extends BaseMapper<WorkFlowListener> {
|
||||
|
||||
/**
|
||||
* 分页通用查询
|
||||
* @param page 分页对象
|
||||
* @param paraMap 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowListener> getPageResult(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowMapper {
|
||||
|
||||
/**
|
||||
* 删除历史活动实例
|
||||
* @param executionId 执行实例ID
|
||||
* @param startTime 开始时间
|
||||
*/
|
||||
void delHistoricActivityInstance(@Param("executionId") String executionId, @Param("startTime") String startTime);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.codvision.workflow.entity.WorkFlowRecord;
|
||||
import com.codvision.workflow.entity.vo.WorkFlowRecordVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowRecordMapper extends BaseMapper<WorkFlowRecord> {
|
||||
|
||||
/**
|
||||
* 通用查询
|
||||
* @param paraMap 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
List<WorkFlowRecordVO> findAll(@Param("query") Map<String, Object> paraMap);
|
||||
|
||||
/**
|
||||
* 根据任务ID获取信息
|
||||
* @param taskId 任务ID
|
||||
* @return 当前正在执行的任务记录
|
||||
*/
|
||||
WorkFlowRecord getByTodoTaskId(String taskId);
|
||||
|
||||
/**
|
||||
* 根据流程实例ID、活动ID和任务ID删除当前还未操作的记录
|
||||
* @param instanceId 流程实例ID
|
||||
* @param activityId 流程活动ID
|
||||
* @param taskIds 任务ID
|
||||
*/
|
||||
void delByInstanceIdAndActivityIdAndTaskIds(@Param("instanceId") String instanceId, @Param("activityId") String activityId, @Param("taskIds") List<String> taskIds);
|
||||
|
||||
/**
|
||||
* 批量添加
|
||||
* @param records 数据
|
||||
*/
|
||||
void insertBatch(List<WorkFlowRecord> records);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.codvision.workflow.entity.WorkFlowSubData;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowSubDataMapper extends BaseMapper<WorkFlowSubData> {
|
||||
|
||||
/**
|
||||
* 更新表单数据
|
||||
* @param taskId 任务ID
|
||||
* @param jsonData 表单数据
|
||||
*/
|
||||
void updateFormData(@Param("taskId") String taskId, @Param("jsonData") String jsonData);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.workflow.entity.WorkFlowVersionRecord;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowVersionRecordMapper extends BaseMapper<WorkFlowVersionRecord> {
|
||||
|
||||
/**
|
||||
* 分页通用查询
|
||||
* @param page 分页对象
|
||||
* @param paraMap 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowVersionRecord> getPageResult(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.workflow.entity.QuestionnaireModule;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author codvision
|
||||
*/
|
||||
public interface QuestionnaireModuleService extends IService<QuestionnaireModule> {
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
* @param queryPage 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<QuestionnaireModule> getPageResult(QueryPage<Map<String, Object>> queryPage);
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
* @param questionnaireModules 数据
|
||||
*/
|
||||
void batchUpdate(List<QuestionnaireModule> questionnaireModules);
|
||||
|
||||
/**
|
||||
* 校验某个问卷是否已经被用户在浏览器上填报过
|
||||
* @param uuid uuid
|
||||
* @param webId webId
|
||||
* @return 数值
|
||||
*/
|
||||
Integer checkFillIn(String uuid, String webId);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.workflow.entity.QuestionnaireResult;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author codvision
|
||||
*/
|
||||
public interface QuestionnaireResultService extends IService<QuestionnaireResult> {
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
* @param queryPage 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<QuestionnaireResult> getPageResult(QueryPage<Map<String, Object>> queryPage);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.workflow.entity.Questionnaire;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author codvision
|
||||
*/
|
||||
public interface QuestionnaireService extends IService<Questionnaire> {
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
* @param queryPage 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<Questionnaire> getPageResult(QueryPage<Map<String, Object>> queryPage);
|
||||
|
||||
/**
|
||||
* 根据主鍵刪除
|
||||
* @param id 主键
|
||||
*/
|
||||
void delById(Integer id);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.workflow.entity.WorkFlowButton;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowButtonService extends IService<WorkFlowButton> {
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
* @param queryPage 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowButton> getPageResult(QueryPage<WorkFlowButton> queryPage);
|
||||
|
||||
/**
|
||||
* 获取任务节点的按钮配置信息
|
||||
* @param taskId 任务ID
|
||||
* @return 列表
|
||||
*/
|
||||
List<WorkFlowButton> getListByTaskId(String taskId);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param workFlowButton 参数
|
||||
* @return 布尔值
|
||||
*/
|
||||
boolean updateButton(WorkFlowButton workFlowButton);
|
||||
|
||||
/**
|
||||
* 根据按钮编码获取按钮信息
|
||||
* @param code 按钮编码
|
||||
* @return 按钮信息
|
||||
*/
|
||||
WorkFlowButton getByCode(String code);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.workflow.entity.WorkFlowCcItem;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowCcItemService extends IService<WorkFlowCcItem> {
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
* @param queryPage 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowCcItem> getPageResult(QueryPage<Map<String, Object>> queryPage);
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param workFlowCcItem 抄送项
|
||||
* @param toCcUserIds 抄送人id
|
||||
*/
|
||||
void addCcItem(WorkFlowCcItem workFlowCcItem, List<Integer> toCcUserIds);
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.webcore.service.IBaseService;
|
||||
import com.codvision.workflow.entity.WorkFlowData;
|
||||
import com.codvision.workflow.entity.vo.WorkFlowDataVO;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowDataService extends IBaseService<WorkFlowData, WorkFlowDataVO> {
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
* @param queryPage 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowDataVO> getPageResult(QueryPage<Map<String, Object>> queryPage);
|
||||
|
||||
/**
|
||||
* 我发起的列表
|
||||
* @param queryPage 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowDataVO> myInitiatedList(QueryPage<Map<String, Object>> queryPage);
|
||||
|
||||
/**
|
||||
* 我待办的列表
|
||||
* @param queryPage 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowDataVO> todoList(QueryPage<Map<String, Object>> queryPage);
|
||||
|
||||
/**
|
||||
* 我已办的列表
|
||||
* @param queryPage 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowDataVO> finishedList(QueryPage<Map<String, Object>> queryPage);
|
||||
|
||||
/**
|
||||
* 待签收列表
|
||||
* @param queryPage 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowDataVO> claimList(QueryPage<Map<String, Object>> queryPage);
|
||||
|
||||
/**
|
||||
* 更新表单数据
|
||||
* @param instanceId 流程实例ID
|
||||
* @param jsonData 表单数据
|
||||
*/
|
||||
void updateFormDataByInstanceId(String instanceId, String jsonData);
|
||||
|
||||
/**
|
||||
* 获取表单数据
|
||||
* @param instanceId 流程实例ID
|
||||
* @return 表单数据
|
||||
*/
|
||||
WorkFlowData getFormDataByInstanceId(String instanceId);
|
||||
|
||||
/**
|
||||
* 统计数据
|
||||
* @param deployId 流程部署ID
|
||||
* @return 当前部署产生的数据量
|
||||
*/
|
||||
int getCountByDeployId(String deployId);
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param deployId 流程部署ID
|
||||
*/
|
||||
void delAllByDeployId(String deployId);
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param instanceId 流程实例ID
|
||||
*/
|
||||
void delByInstanceId(String instanceId);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (c) 2023 codvision.com All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.codvision.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.codvision.webcore.bean.QueryPage;
|
||||
import com.codvision.workflow.entity.WorkFlowDefinition;
|
||||
import com.codvision.workflow.entity.dto.WorkFlowDefinitionDTO;
|
||||
import com.codvision.workflow.entity.vo.WorkFlowElementVO;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hxl
|
||||
*/
|
||||
public interface WorkFlowDefinitionService {
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
* @param queryPage 查询条件
|
||||
* @return 列表
|
||||
*/
|
||||
IPage<WorkFlowDefinition> getPageResult(QueryPage<Map<String, Object>> queryPage);
|
||||
|
||||
/**
|
||||
* 添加流程定义
|
||||
* @param definitionDTO 流程定义
|
||||
* @param in 流
|
||||
*/
|
||||
void save(WorkFlowDefinitionDTO definitionDTO, InputStream in);
|
||||
|
||||
/**
|
||||
* 激活或挂起流程定义
|
||||
* @param state 状态
|
||||
* @param deployId 流程部署ID
|
||||
*/
|
||||
void activeOrSuspend(Integer state, String deployId);
|
||||
|
||||
/**
|
||||
* 删除流程定义
|
||||
* @param deployIds 流程部署ID
|
||||
*/
|
||||
void delete(List<String> deployIds);
|
||||
|
||||
/**
|
||||
* 获取流程定义xml
|
||||
* @param deployId 流程部署ID
|
||||
* @return xml
|
||||
*/
|
||||
String getXml(String deployId);
|
||||
|
||||
/**
|
||||
* 获取流程定义图片
|
||||
* @param deployId 流程部署ID
|
||||
* @return 图片
|
||||
*/
|
||||
InputStream getImage(String deployId);
|
||||
|
||||
/**
|
||||
* 根据流程定义xml获取所有可回退的节点
|
||||
* @param xmlStr 流程定义xml
|
||||
* @param currentTaskKey 当前任务节点key
|
||||
* @return 图片
|
||||
*/
|
||||
List<WorkFlowElementVO> getReturnTaskList(String xmlStr, String currentTaskKey);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user