新增模块,es,activiti

This commit is contained in:
lhc
2021-02-22 17:25:54 +08:00
parent ab5a12f6bb
commit 32868afd9e
58 changed files with 4327 additions and 24 deletions

46
README.md Normal file
View File

@@ -0,0 +1,46 @@
# 基础包依赖及框架配置
#### 介绍
基础包,对工具类及框架代码进行封装
#### 功能
1. 封装Shiro权限部分通过接口继承即可
2. 对SwaggerUI部分封装可通过yml文件进行配置
3. 对Druid连接池部分进行封装可通过yml文件进行配置
4. 提供封装VO返回结果
5. 提供PageHelper方法封装
6. 将pageNum,pageSize,order,sort封装成对象并提供是否包含排序校验提供sql拼装校验
7. 异常统一封装
8. 通用mapper封装
9. 接口参数日志封装可通过yml文件进行配置
10. redis工具类封装可通过yml文件进行配置
11. Spring上下文工具类封装
12. 加密工具类封装
13. 日期工具类封装
#### 安装教程
1. git拉去目录
2. 发布达梦数据库驱动包
```bash
mvn install:install-file -Dfile=lib/Dm7JdbcDriver18.jar -DgroupId=com.dm -DartifactId=Dm7JdbcDriver -Dversion=1.8 -Dpackaging=jar
```
3. 发布oracle数据库驱动包
```bash
mvn install:install-file -Dfile=lib/ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.4 -Dpackaging=jar
```
4. 刷新maven依赖
5. 进入基础包目录
```bash
cd hcframe-parent/hcframe-base/
```
6. 执行``mvn install``
7. 刷新其他项目maven依赖
8. 进入starter目录
```bash
cd ../hcframe-starter
```
9. 执行 ``mvn install``
10. 刷新maven依赖

View File

@@ -0,0 +1,35 @@
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>parent</artifactId>
<groupId>com.hcframe</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hcframe-activiti</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.hcframe</groupId>
<artifactId>hcframe-starter</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.hcframe</groupId>
<artifactId>hcframe-base</artifactId>
<version>1.2.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring-boot-starter</artifactId>
<version>7.1.0.M1</version>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,26 @@
package com.hcframe.activiti;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableSwagger2
@ServletComponentScan
@EnableCaching
//@EnableDiscoveryClient
//@EnableFeignClients
@ComponentScan(basePackages = {"com.hcframe.**"})
public class ActivitiApplication {
public static void main(String[] args) {
SpringApplication.run(ActivitiApplication.class, args);
}
}

View File

@@ -0,0 +1,13 @@
package com.hcframe.activiti;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(ActivitiApplication.class);
}
}

View File

@@ -0,0 +1,514 @@
package com.hcframe.activiti.activiti;
import com.hcframe.base.common.ResultPageInfo;
import com.hcframe.base.common.ServiceException;
import com.hcframe.base.common.WebPageInfo;
import com.hcframe.base.common.utils.EmptyCheckUtils;
import org.activiti.engine.*;
import org.activiti.engine.impl.ProcessInstanceQueryProperty;
import org.activiti.engine.impl.TaskQueryProperty;
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.repository.ProcessDefinitionQuery;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.activiti.engine.task.TaskQuery;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.InputStream;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
/**
* @author lhc
* @date 2020-07-06
* @description activiti工具类
*/
@Component
public class ActivitiUtils {
private final static Logger logger = LoggerFactory.getLogger(ActivitiUtils.class);
@Resource
RuntimeService runtimeService;
@Resource
private RepositoryService repositoryService;
@Resource
private TaskService taskService;
@Resource
private HistoryService historyService;
@Resource
private ManagementService managementService;
/**
* 发布流程classpath
*
* @param name 流程名称
* @param classpath 流程文件地址,在项目classpath路径下的相对路径地址
* @return 流程信息
*/
public Deployment deployProcessFormClasspath(String name, String classpath) {
EmptyCheckUtils.checkWithException(name, "name不能为空");
EmptyCheckUtils.checkWithException(classpath, "classpath不能为空");
try {
Deployment deployment = repositoryService.createDeployment()
.addClasspathResource(classpath)
.name(name)
.deploy();
logger.info("流程ID" + deployment.getId());
logger.info("流程名称:" + deployment.getName());
return deployment;
} catch (Exception e) {
logger.error("流程发布失败", e);
throw new ServiceException("流程发布失败!");
}
}
/**
* 发布流程基于InputStream
*
* @param name 流程名称
* @param is 输入流
* @return 流程信息
*/
public Deployment deployProcessFormInputStream(String name, InputStream is, String fileName) {
EmptyCheckUtils.checkWithException(name, "name不能为空");
EmptyCheckUtils.checkWithException(fileName, "fileName不能为空");
try {
Deployment deployment = repositoryService.createDeployment()
.addInputStream(fileName, is)
.name(name)
.deploy();
logger.info("流程ID" + deployment.getId());
logger.info("流程名称:" + deployment.getName());
return deployment;
} catch (Exception e) {
logger.error("流程发布失败", e);
throw new ServiceException("流程发布失败!");
}
}
/**
* 删除一个process实例
*
* @param id processId
* @param flag 是否连级删除所有信息
* @return
*/
public boolean deleteDeploymenet(String id, boolean flag) {
EmptyCheckUtils.checkWithException(id, "id不能为空");
try {
repositoryService.deleteDeployment(id, flag);
return true;
} catch (Exception e) {
logger.error("删除失败", e);
throw new ServiceException("删除失败");
}
}
/**
* 获取流程列表
*
* @param commonProcessDefinition 查询参数可查询内容包括name,key,version
* @param webPageInfo 分页及排序参数
* @param isLatestVersion 是否只显示最新版本
* @return 返回结果列表
*/
public ResultPageInfo<CommonProcessDefinition> getDeployProcessList(CommonProcessDefinition commonProcessDefinition,
WebPageInfo webPageInfo, Boolean isLatestVersion) {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();
if (WebPageInfo.hasSort(webPageInfo)) {
ProcessInstanceQueryProperty queryProperty = new ProcessInstanceQueryProperty(webPageInfo.getSortField());
query = query.orderBy(queryProperty);
if (webPageInfo.getOrder().equals(WebPageInfo.ASC)) {
query = query.asc();
} else {
query = query.desc();
}
}
if (StringUtils.isNotEmpty(commonProcessDefinition.getName())) {
query = query.processDefinitionNameLike("%" + commonProcessDefinition.getName() + "%");
}
if (StringUtils.isNotEmpty(commonProcessDefinition.getKey())) {
query = query.processDefinitionNameLike("%" + commonProcessDefinition.getKey() + "%");
}
if (!org.springframework.util.StringUtils.isEmpty(commonProcessDefinition.getVersion())) {
query = query.processDefinitionVersion(commonProcessDefinition.getVersion());
}
if (isLatestVersion) {
query = query.latestVersion();
}
long total = query.count();
List<ProcessDefinition> list = query.listPage((webPageInfo.getPageNum() - 1) * webPageInfo.getPageSize(), webPageInfo.getPageSize());
List<CommonProcessDefinition> resultList = new LinkedList<>();
for (ProcessDefinition processDefinition : list) {
CommonProcessDefinition commonProcessDefinition1 = new CommonProcessDefinition();
BeanUtils.copyProperties(processDefinition, commonProcessDefinition1);
resultList.add(commonProcessDefinition1);
}
ResultPageInfo<CommonProcessDefinition> resultPageInfo = new ResultPageInfo<>();
resultPageInfo.setList(resultList);
resultPageInfo.setTotal(total);
return resultPageInfo;
}
/**
* 获取单个发布流程实例
*
* @param deploymentId 发布实例
* @return 返回单个实例结果
*/
public CommonProcessDefinition getSingleProcessById(String deploymentId) {
EmptyCheckUtils.checkWithException(deploymentId, "deploymentId不能为空");
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().deploymentId(deploymentId).singleResult();
CommonProcessDefinition commonProcessDefinition = new CommonProcessDefinition();
BeanUtils.copyProperties(processDefinition, commonProcessDefinition);
return commonProcessDefinition;
}
/**
* 通过Key开始一个流程
*
* @param key 流程key
* @param map 流程变量
* @return 流程实例
*/
public Map<String, Object> startProcessInstanceByKey(String key, Map<String, Object> map) {
EmptyCheckUtils.checkWithException(key, "key不能为空");
try {
ProcessInstance instance;
if (map == null || map.isEmpty()) {
instance = runtimeService.startProcessInstanceByKey(key);
} else {
instance = runtimeService.startProcessInstanceByKey(key, map);
}
logger.info("流程实例ID:" + instance.getId());
logger.info("流程定义ID:" + instance.getProcessDefinitionId());
logger.info("流程发布ID:" + instance.getDeploymentId());
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("id", instance.getId());
resultMap.put("processDefinitionId", instance.getProcessDefinitionId());
return resultMap;
} catch (Exception e) {
logger.error("流程开始失败:", e);
throw new ServiceException("流程开始失败!");
}
}
/**
* 通过Id开始一个流程
*
* @param id 流程Id
* @param map 流程变量
* @return 流程实例
*/
public Map<String, Object> startProcessInstanceById(String id, Map<String, Object> map) {
EmptyCheckUtils.checkWithException(id, "id不能为空");
try {
ProcessInstance instance;
if (map == null || map.isEmpty()) {
instance = runtimeService.startProcessInstanceById(id);
} else {
instance = runtimeService.startProcessInstanceByKey(id, map);
}
logger.info("流程实例ID:" + instance.getId());
logger.info("流程定义ID:" + instance.getProcessDefinitionId());
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("id", instance.getId());
resultMap.put("deploymentId", instance.getDeploymentId());
resultMap.put("processDefinitionId", instance.getProcessDefinitionId());
return resultMap;
} catch (Exception e) {
logger.error("流程开始失败:", e);
throw new ServiceException("流程开始失败!");
}
}
/**
* 执行任务
*
* @param taskId 任务Id
* @return 是否成功
*/
public boolean completeTask(String taskId) {
EmptyCheckUtils.checkWithException(taskId, "taskId不能为空");
try {
taskService.complete(taskId);
logger.info("完成任务任务ID" + taskId);
return true;
} catch (Exception e) {
logger.error("任务执行失败", e);
throw new ServiceException("任务执行失败!");
}
}
/**
* 获取任务列表
*
* @param commonTask
* @param webPageInfo
* @param map
* @return
*/
public ResultPageInfo<CommonTask> getTaskList(CommonTask commonTask, WebPageInfo webPageInfo, Map<String, Object> map) {
TaskQuery taskQuery = taskService.createTaskQuery();
if (WebPageInfo.hasSort(webPageInfo)) {
TaskQueryProperty queryProperty = new TaskQueryProperty(webPageInfo.getSortField());
taskQuery = taskQuery.orderBy(queryProperty);
if (webPageInfo.getOrder().equals(WebPageInfo.ASC)) {
taskQuery = taskQuery.asc();
} else {
taskQuery = taskQuery.desc();
}
}
if (StringUtils.isNotEmpty(commonTask.getAssignee())) {
taskQuery = taskQuery.taskAssignee(commonTask.getAssignee());
}
if (StringUtils.isNotEmpty(commonTask.getId())) {
taskQuery = taskQuery.taskId(commonTask.getId());
}
if (StringUtils.isNotEmpty(commonTask.getName())) {
taskQuery = taskQuery.taskName(commonTask.getName());
}
if (StringUtils.isNotEmpty(commonTask.getTaskDefinitionKey())) {
taskQuery = taskQuery.taskDefinitionKey(commonTask.getTaskDefinitionKey());
}
if (StringUtils.isNotEmpty(commonTask.getCategory())) {
taskQuery = taskQuery.taskCategory(commonTask.getCategory());
}
if (StringUtils.isNotEmpty(commonTask.getDescription())) {
taskQuery = taskQuery.taskCategory(commonTask.getCategory());
}
if (StringUtils.isNotEmpty(commonTask.getExecutionId())) {
taskQuery = taskQuery.taskCategory(commonTask.getExecutionId());
}
if (map != null && !map.isEmpty()) {
taskQuery = taskQuery.taskVariableValueEquals(map);
}
if (StringUtils.isNotEmpty(commonTask.getOwner())) {
taskQuery = taskQuery.taskOwner(commonTask.getOwner());
}
if (StringUtils.isNotEmpty(commonTask.getParentTaskId())) {
taskQuery = taskQuery.taskParentTaskId(commonTask.getParentTaskId());
}
long total = taskQuery.count();
List<Task> taskList = taskQuery.listPage((webPageInfo.getPageNum() - 1) * webPageInfo.getPageSize(), webPageInfo.getPageSize());
List<CommonTask> list = new LinkedList<>();
for (Task task : taskList) {
CommonTask resultTask = new CommonTask();
BeanUtils.copyProperties(task, resultTask);
String tableName= (String) taskService.getVariable(task.getId(),"tableName" );
resultTask.setTableName(tableName);
list.add(resultTask);
}
ResultPageInfo<CommonTask> resultPageInfo = new ResultPageInfo<>();
resultPageInfo.setTotal(total);
resultPageInfo.setList(list);
return resultPageInfo;
}
/**
* Description: 任务认领(加锁)
*
* @param taskId
* @param userId
*/
public synchronized boolean claimTask(String taskId, String userId) {
EmptyCheckUtils.checkWithException(taskId, "taskId不能为空");
EmptyCheckUtils.checkWithException(userId, "userId不能为空");
try {
taskService.claim(taskId, userId);
return true;
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw new ServiceException("任务不能加锁(taskId:" + taskId + ")");
}
}
/**
* Description: 任务解锁
*
* @param taskId 任务Id
*/
public synchronized boolean unClaimTask(String taskId) {
EmptyCheckUtils.checkWithException(taskId, "taskId不能为空");
try {
taskService.claim(taskId, null);
return true;
} catch (Exception e) {
throw new ServiceException("任务解锁失败任务Id:" + taskId);
}
}
/**
* 完成任务
*
* @return
*/
public boolean completeTask(String taskId, Map<String, Object> map) {
EmptyCheckUtils.checkWithException(taskId, "taskId不能为空");
try {
if (map == null || map.isEmpty()) {
taskService.complete(taskId);
} else {
taskService.complete(taskId, map);
}
return true;
} catch (Exception e) {
throw new ServiceException("任务提交失败");
}
}
/**
* 设置候选人(可设置多个)
*
* @param taskId
* @param userIds
*/
public boolean addCandidateUser(String taskId, String userIds) {
EmptyCheckUtils.checkWithException(taskId, "taskId不能为空");
EmptyCheckUtils.checkWithException(userIds, "userIds不能为空");
try {
taskService.addCandidateUser(taskId, userIds);
return true;
} catch (Exception e) {
throw new ServiceException("设置候选人失败");
}
}
/**
* 更新候选人
*
* @param taskId
* @param userIds
* @return
*/
public boolean updateCandidateUser(String taskId, String userIds) {
EmptyCheckUtils.checkWithException(taskId, "taskId不能为空");
EmptyCheckUtils.checkWithException(userIds, "userIds不能为空");
try {
taskService.addCandidateUser(taskId, null);
taskService.addCandidateUser(taskId, userIds);
return true;
} catch (Exception e) {
throw new ServiceException("更新候选人失败");
}
}
/**
* 校验名称是否唯一
*
* @param name name
* @return
*/
public boolean uniqueName(String name) {
List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery().processDefinitionName(name).list();
return list == null || list.size() == 0;
}
/**
* 校验key是否唯一
*
* @param key
* @return
*/
public boolean uniqueKey(String key) {
List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).list();
return list == null || list.size() == 0;
}
/**
* 删除未完成实例
* @param id id主键
* @param reason 删除原因
* @param flag 是否删除历史记录
* @return
*/
public boolean deleteProcessInstance(String id, String reason, boolean flag){
try {
runtimeService.deleteProcessInstance(id,reason);
if (flag) {
historyService.deleteHistoricProcessInstance(id);
}
return true;
} catch (Exception e) {
logger.error("删除流程失败",e);
throw new ServiceException("删除流程失败",e);
}
}
public void rollBackToAssignWoekFlow(String processInstanceId, String destTaskkey) {
// // 取得当前任务.当前任务节点
// destTaskkey ="usertask2";
// HistoricTaskInstance currTask = historyService.createHistoricTaskInstanceQuery().taskId(taskId).singleResult();
// Map<String, Object> variables;
ExecutionEntity entity = (ExecutionEntity) runtimeService.createExecutionQuery().executionId(processInstanceId).singleResult();
// ProcessDefinitionEntity definition = (ProcessDefinitionEntity)((RepositoryServiceImpl)repositoryService)
// .getDeployedProcessDefinition(entity.getProcessDefinitionId());
// variables = entity.getProcessVariables();
// //当前活动环节
// ActivityImpl currActivityImpl = definition.findActivity(entity.getActivityId());
// //目标活动节点
// ActivityImpl nextActivityImpl = ((ProcessDefinitionImpl) definition).findActivity(destTaskkey);
// if(currActivityImpl !=null){
// //所有的出口集合
// List<PvmTransition> pvmTransitions = currActivityImpl.getOutgoingTransitions();
// List<PvmTransition> oriPvmTransitions = new ArrayList<PvmTransition>();
// for(PvmTransition transition : pvmTransitions){
// oriPvmTransitions.add(transition);
// }
// //清除所有出口
// pvmTransitions.clear();
// //建立新的出口
// List<TransitionImpl> transitionImpls = new ArrayList<TransitionImpl>();
// TransitionImpl tImpl = currActivityImpl.createOutgoingTransition();
// tImpl.setDestination(nextActivityImpl);
// transitionImpls.add(tImpl);
//
// List<Task> list = taskService.createTaskQuery().processInstanceId(entity.getProcessInstanceId())
// .taskDefinitionKey(entity.getActivityId()).list();
// for(Task task:list){
// taskService.complete(task.getId(), variables);
// historyService.deleteHistoricTaskInstance(task.getId());
// }
//
// for(TransitionImpl transitionImpl:transitionImpls){
// currActivityImpl.getOutgoingTransitions().remove(transitionImpl);
// }
//
// for(PvmTransition pvmTransition:oriPvmTransitions){
// pvmTransitions.add(pvmTransition);
// }
// }
}
/**
* 删除一个历史流程
* @param instansId
* @return
*/
public boolean deleteProcessInstanceHistory(String instansId) {
try {
historyService.deleteHistoricProcessInstance(instansId);
return true;
} catch (Exception e) {
throw new ServiceException("删除流程历史记录失败!", e);
}
}
}

View File

@@ -0,0 +1,60 @@
package com.hcframe.activiti.activiti;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author lhc
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder(toBuilder = true)
@Data
@ApiModel("工具Process")
public class CommonProcessDefinition {
public static String BPMN = "bpmn";
@ApiModelProperty(hidden = true)
private String id;
@ApiModelProperty(hidden = true)
private String category;
@ApiModelProperty(
value="流程Process名称"
)
private String name;
@ApiModelProperty(
value="流程Process的KEY"
)
private String key;
@ApiModelProperty(hidden = true)
private String description;
@ApiModelProperty(
value="版本"
)
private Integer version;
@ApiModelProperty(hidden = true)
private String resourceName;
@ApiModelProperty(hidden = true)
private String deploymentId;
@ApiModelProperty(hidden = true)
private String diagramResourceName;
@ApiModelProperty(hidden = true)
private String tenantId;
@ApiModelProperty(hidden = true)
private String engineVersion;
}

View File

@@ -0,0 +1,79 @@
package com.hcframe.activiti.activiti;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.Map;
/**
* @author lhc
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder(toBuilder = true)
@Data
public class CommonTask {
private String id;
@ApiModelProperty(
value="流程名称"
)
private String name;
private String description;
private Integer priority;
private String owner;
@ApiModelProperty(
value="流程人"
)
private String assignee;
private String processInstanceId;
private String executionId;
private String processDefinitionId;
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private String taskDefinitionKey;
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date dueDate;
private String category;
private String parentTaskId;
private String tenantId;
private String formKey;
private Map<String, Object> taskLocalVariables;
private Map<String, Object> processVariables;
private Date claimTime;
@ApiModelProperty(
value="是否只显示未锁定条目",
allowableValues="true,false"
)
private Boolean isUnAssignee = false;
private String tableName;
}

View File

@@ -0,0 +1,77 @@
package com.hcframe.activiti.common;
import com.hcframe.base.module.auth.dao.FtUserDao;
import com.hcframe.base.module.shiro.service.ShiroType;
import com.hcframe.base.module.shiro.service.SystemRealm;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.LinkedHashMap;
/**
* @author lhc
* @date 2020-07-28
* @decription shiro 配置类
*/
@Component
public class ShiroRealmConfig implements SystemRealm {
@Resource
FtUserDao ftUserDao;
/**
* 根据用户信息注入权限
* @param user 用户信息
* @return 权限信息
*/
@Override
public SimpleAuthorizationInfo setAuthoriztion(Object user) {
return new SimpleAuthorizationInfo();
}
/**
* 根据用户Id查询用户信息并注入到shiro框架中
* @param userId 用户id
* @return 用户信息
*/
@Override
public Object findByUserId(String userId) {
// TODO 需要实现获取用户信息方法
return null;
}
/**
* 配置拦截及放行路径
* @return 返回拦截及放行路径Map
*/
@Override
public LinkedHashMap<String, String> setShiroUrl() {
LinkedHashMap<String, String> map = new LinkedHashMap<>();
// 用户登陆
map.put("/ftUser/login", ShiroType.ANON);
// Vue静态资源
map.put("/img/**", ShiroType.ANON);
map.put("/static/**", ShiroType.ANON);
map.put("/tinymce/**", ShiroType.ANON);
map.put("/favicon.ico", ShiroType.ANON);
map.put("/manifest.json", ShiroType.ANON);
map.put("/robots.txt", ShiroType.ANON);
map.put("/precache*", ShiroType.ANON);
map.put("/service-worker.js", ShiroType.ANON);
// swagger UI 静态资源
map.put("/swagger-ui.html", ShiroType.ANON);
map.put("/doc.html", ShiroType.ANON);
map.put("/swagger-resources/**", ShiroType.ANON);
map.put("/webjars/**", ShiroType.ANON);
map.put("/v2/api-docs", ShiroType.ANON);
map.put("/v2/api-docs-ext", ShiroType.ANON);
map.put("/swagger/**", ShiroType.ANON);
// druid 资源路径
map.put("/druid/**", ShiroType.ANON);
// 其余路径均拦截
map.put("/**", ShiroType.ANON);
return map;
}
}

View File

@@ -0,0 +1,102 @@
package com.hcframe.activiti.controller;
import com.hcframe.activiti.activiti.CommonProcessDefinition;
import com.hcframe.activiti.service.ProcessService;
import com.hcframe.base.common.ResultVO;
import com.hcframe.base.common.WebPageInfo;
import io.lettuce.core.dynamic.annotation.Param;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
/**
* @author lhc
*/
@Api(tags = "activiti操作接口")
@RequestMapping("/process")
@RestController
public class ProcessController {
@Resource
ProcessService processService;
@ApiOperation(value = "获取工作流Process列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "isLatestVersion", value = "是否只显示最新版", allowableValues = "true,false", defaultValue = "false")
})
@GetMapping("")
public ResultVO getProcessDefinitionList(CommonProcessDefinition processDefinition, WebPageInfo webPageInfo,
@RequestParam(defaultValue = "true") Boolean isLatestVersion) {
return processService.getProcessDefinitionList(processDefinition, webPageInfo, isLatestVersion);
}
@ApiOperation(value = "删除工作流列表Process列表")
@DeleteMapping("/{id}")
@ApiImplicitParams({
@ApiImplicitParam(name = "state", value = "状态为true则删除全部关联数据为false则只删除Process", required = true),
@ApiImplicitParam(name = "id", value = "获取流程的deploymentId", required = true)
})
public ResultVO deleteProcessDefinition(@PathVariable String id, boolean state) {
return processService.deleteProcessDefinitionList(id, state);
}
@ApiOperation(value = "新增/更新Process若为更新只需文件名和process名称保持一致即可")
@ApiImplicitParams({
@ApiImplicitParam(name = "name", value = "流程名称"),
@ApiImplicitParam(name = "file", value = "上传的文件")
})
@PostMapping("")
public ResultVO addProcessDefinition(@Param("file") MultipartFile file, String name) {
return processService.addProccessDefinition(file, name);
}
@ApiOperation(value = "新增Process通过xml字符串方式更新")
@ApiImplicitParams({
@ApiImplicitParam(name = "name", value = "流程名称",required = true),
@ApiImplicitParam(name = "file", value = "上传的文件",required = true),
@ApiImplicitParam(name = "fileName", value = "文件名称需要有后缀.bpmn",required = true)
})
@PostMapping("/byXml")
public ResultVO addProcessDefinitionByXMl(String file, String name,String fileName) {
return processService.addProccessDefinitionByXml(file, name,fileName);
}
@ApiOperation(value = "修改Process通过xml字符串方式更新")
@ApiImplicitParams({
@ApiImplicitParam(name = "name", value = "流程名称",required = true),
@ApiImplicitParam(name = "file", value = "上传的文件",required = true),
@ApiImplicitParam(name = "fileName", value = "文件名称需要有后缀.bpmn",required = true),
@ApiImplicitParam(name = "version", value = "当前版本(数字)",required = true)
})
@PutMapping("/byXml")
public ResultVO updateProcessDefinitionByXml(String file, String name, String fileName,Integer version) {
return processService.updateProcessDefinitionByXml(file, name, fileName,version);
}
@ApiOperation(value = "获取流程图bpmn流程图并展示")
@ApiImplicitParams({
@ApiImplicitParam(name = "deploymentId", value = "流程发布Id"),
@ApiImplicitParam(name = "resourceName", value = "流程发布Id")
})
@GetMapping("bpmn")
public ResultVO getBpmnFile(String deploymentId,String resourceName, HttpServletResponse response) {
return processService.getBpmnFile(deploymentId,resourceName, response);
}
@ApiOperation(value = "校验key和name是否唯一")
@ApiImplicitParams({
@ApiImplicitParam(name = "name", value = "名称", required = true),
@ApiImplicitParam(name = "key", value = "标识", required = true)
})
@PostMapping("unique")
public ResultVO uniqueRecord(String name, String key) {
return processService.uniqueRecord(name, key);
}
}

View File

@@ -0,0 +1,105 @@
package com.hcframe.activiti.controller;
import com.alibaba.fastjson.JSON;
import com.hcframe.activiti.activiti.CommonTask;
import com.hcframe.activiti.service.TaskSysService;
import com.hcframe.base.common.ResultVO;
import com.hcframe.base.common.WebPageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Map;
@Api(tags = "获取工作状态")
@RestController
@RequestMapping("/task")
public class TaskController {
@Resource
TaskSysService taskSysService;
@ApiOperation(value = "获取任务列表")
@GetMapping("")
public ResultVO getTaskList(CommonTask commonTask, WebPageInfo webPageInfo, String data) {
Map<String, Object> map = JSON.parseObject(data);
return taskSysService.getTaskList(commonTask, webPageInfo, map);
}
@ApiOperation(value = "开始一个流程设置流程人员参数等通过key")
@ApiImplicitParams({
@ApiImplicitParam(name = "tableName", value = "表名,与流程绑定", required = true),
@ApiImplicitParam(name = "tableId", value = "表Id,与流程绑定", required = true),
@ApiImplicitParam(name = "key", value = "ProcessInstance的key值", required = true),
@ApiImplicitParam(name = "...", value = "其余参数请根据需求,及设计好的流程图进行设计", required = true)
})
@PostMapping("/{key}/key")
public ResultVO startTaskByKey(@PathVariable String key, @RequestParam Map<String,Object> map) {
return taskSysService.startTaskByKey(key, map);
}
@ApiOperation(value = "开始一个流程设置人员参数等通过Id")
@ApiImplicitParams({
@ApiImplicitParam(name = "tableName", value = "表名,与流程绑定", required = true),
@ApiImplicitParam(name = "tableId", value = "表Id,与流程绑定", required = true),
@ApiImplicitParam(name = "id", value = "ProcessInstance的Id", required = true),
@ApiImplicitParam(name = "...", value = "其余参数请根据需求,及设计好的流程图进行设计", required = true)
})
@PostMapping("/{id}/id")
public ResultVO startTaskById(@PathVariable String id, Map<String, Object> map) {
return taskSysService.startTaskById(id, map);
}
@ApiOperation(value = "流程记录加锁")
@PostMapping("/claim")
public ResultVO claimTask(String taskId, String userId) {
return taskSysService.claimTask(taskId, userId);
}
@ApiOperation(value = "任务解锁")
@PostMapping("/unclaim")
public ResultVO unclaimTask(String taskId) {
return taskSysService.unclaimTask(taskId);
}
@ApiOperation(value = "完成任务")
@PostMapping("/{taskId}/commit")
public ResultVO commitTask(@PathVariable String taskId, String map,Boolean isBack,String reason) {
return taskSysService.commitTask(taskId, map,isBack,reason);
}
@ApiOperation(value = "设置候选人(可设置多个候选人,标识符逗号隔开即可)")
@PostMapping("/{taskId}/addCandidateUser")
public ResultVO addCandidateUser(@PathVariable String taskId, String names) {
return taskSysService.addCandidateUser(taskId, names);
}
@ApiOperation(value = "获取任务高亮json")
@PostMapping("/{taskId}/highLight")
public ResultVO getHighLightInfo(@PathVariable String taskId) {
return taskSysService.getHighLightInfo(taskId);
}
@ApiOperation(value = "删除一个进行中流程实例")
@DeleteMapping("/{instansId}")
public ResultVO deleteTaskInstans(@PathVariable String instansId,@RequestParam String reason,@RequestParam Boolean flag){
return taskSysService.deleteTaskIstans(instansId, reason,flag);
}
@ApiOperation(value = "删除一个历史流程实例")
@DeleteMapping("/{instansId}/history")
public ResultVO deleteTaskHisInstans(@PathVariable String instansId){
return taskSysService.deleteTaskIstansHitory(instansId);
}
@ApiOperation(value = "获取退回意见")
@GetMapping("/{taskId}/reason")
public ResultVO getBackReason(@PathVariable String taskId) {
return taskSysService.getBackReason(taskId);
}
}

View File

@@ -0,0 +1,15 @@
package com.hcframe.activiti.dao;
import com.hcframe.activiti.entity.BackReason;
import com.hcframe.base.common.Mapper;
/**
* (BackReason)表数据库访问层
*
* @author lhc
* @since 2020-09-04 09:54:13
*/
public interface BackReasonDao extends Mapper<BackReason> {
}

View File

@@ -0,0 +1,16 @@
package com.hcframe.activiti.dao;
import com.hcframe.activiti.entity.CandidateUser;
import com.hcframe.base.common.Mapper;
/**
* (CandidateUser)表数据库访问层
*
* @author lhc
* @since 2020-09-04 13:29:17
*/
public interface CandidateUserDao extends Mapper<CandidateUser> {
}

View File

@@ -0,0 +1,16 @@
package com.hcframe.activiti.dao;
import com.hcframe.activiti.entity.DataTask;
import com.hcframe.base.common.Mapper;
/**
* (DataTask)表数据库访问层
*
* @author lhc
* @since 2020-09-03 17:39:38
*/
public interface DataTaskDao extends Mapper<DataTask> {
}

View File

@@ -0,0 +1,15 @@
package com.hcframe.activiti.dao;
import com.hcframe.activiti.entity.DataTaskHis;
import com.hcframe.base.common.Mapper;
/**
* (DataTaskHis)表数据库访问层
*
* @author lhc
* @since 2020-09-04 08:58:42
*/
public interface DataTaskHisDao extends Mapper<DataTaskHis> {
}

View File

@@ -0,0 +1,31 @@
package com.hcframe.activiti.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* (BackReason)实体类
*
* @author lhc
* @since 2020-09-04 09:54:13
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder(toBuilder = true)
@Data
public class BackReason implements Serializable {
private static final long serialVersionUID = -15171833204492182L;
private Integer backId;
private String taskId;
private String reason;
private String title;
}

View File

@@ -0,0 +1,32 @@
package com.hcframe.activiti.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.io.Serializable;
/**
* (CandidateUser)实体类
*
* @author lhc
* @since 2020-09-04 13:29:17
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder(toBuilder = true)
@Data
public class CandidateUser implements Serializable {
private static final long serialVersionUID = -32069051744595036L;
@Id
@GeneratedValue(generator="JDBC")
private Integer caId;
private String taskId;
private String userId;
}

View File

@@ -0,0 +1,45 @@
package com.hcframe.activiti.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.io.Serializable;
/**
* (DataTask)实体类
*
* @author lhc
* @since 2020-09-03 17:39:38
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder(toBuilder = true)
@Data
public class DataTask implements Serializable {
private static final long serialVersionUID = -69233663931357928L;
@Id
@GeneratedValue(generator="JDBC")
private Integer dataTaskId;
private String tableName;
private String tableId;
private String taskId;
private String taskKey;
private String taskName;
private String processId;
private Integer isBack;
private String assignee;
}

View File

@@ -0,0 +1,46 @@
package com.hcframe.activiti.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.io.Serializable;
/**
* (DataTaskHis)实体类
*
* @author lhc
* @since 2020-09-04 08:58:42
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder(toBuilder = true)
@Data
public class DataTaskHis implements Serializable {
private static final long serialVersionUID = -66890927690522795L;
@Id
@GeneratedValue(generator="JDBC")
private Integer hisTaskId;
private String tableName;
private String tableId;
private String taskId;
private String taskKey;
private String processId;
private String taskName;
private Integer isBack;
private String assignee;
}

View File

@@ -0,0 +1,25 @@
package com.hcframe.activiti.service;
import com.hcframe.activiti.activiti.CommonProcessDefinition;
import com.hcframe.base.common.ResultVO;
import com.hcframe.base.common.WebPageInfo;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
public interface ProcessService {
ResultVO getProcessDefinitionList(CommonProcessDefinition processDefinition, WebPageInfo webPageInfo, Boolean isLatestVersion);
ResultVO deleteProcessDefinitionList(String id, boolean state);
ResultVO addProccessDefinition(MultipartFile file, String name);
ResultVO getBpmnFile(String deploymentId, String resourceName, HttpServletResponse response);
ResultVO addProccessDefinitionByXml(String file, String name,String fileName);
ResultVO updateProcessDefinitionByXml(String file, String name, String fileName, Integer version);
ResultVO uniqueRecord(String name, String key);
}

View File

@@ -0,0 +1,32 @@
package com.hcframe.activiti.service;
import com.hcframe.activiti.activiti.CommonTask;
import com.hcframe.base.common.ResultVO;
import com.hcframe.base.common.WebPageInfo;
import java.util.Map;
public interface TaskSysService {
ResultVO getTaskList(CommonTask commonTask, WebPageInfo webPageInfo, Map<String, Object> map);
ResultVO startTaskByKey(String key, Map<String, Object> map);
ResultVO startTaskById(String id, Map<String, Object> map);
ResultVO claimTask(String taskId, String userId);
ResultVO commitTask(String taskId,String map,Boolean isBack,String reason);
ResultVO unclaimTask(String taskId);
ResultVO addCandidateUser(String taskId, String names);
ResultVO getHighLightInfo(String taskId);
ResultVO deleteTaskIstans(String instansId, String reason, boolean flag);
ResultVO deleteTaskIstansHitory(String instansId);
ResultVO getBackReason(String taskId);
}

View File

@@ -0,0 +1,214 @@
package com.hcframe.activiti.service.impl;
import com.hcframe.activiti.activiti.ActivitiUtils;
import com.hcframe.activiti.activiti.CommonProcessDefinition;
import com.hcframe.activiti.service.ProcessService;
import com.hcframe.activiti.utils.FileUtil;
import com.hcframe.base.common.ResultVO;
import com.hcframe.base.common.ServiceException;
import com.hcframe.base.common.WebPageInfo;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.util.ResourceUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
@Service
public class ProcessServiceImpl implements ProcessService {
private final static Logger logger = LoggerFactory.getLogger(ProcessServiceImpl.class);
/**
* 获取编译后的文件路径
*/
public static String CLASSPATH;
static {
try {
CLASSPATH = ResourceUtils.getURL(ResourceUtils.CLASSPATH_URL_PREFIX + "bpmn").getPath() + "/";
} catch (FileNotFoundException e) {
throw new ServiceException("获取bpmn文件上传路径出错");
}
}
@Resource
private RepositoryService repositoryService;
@Resource
ActivitiUtils activitiUtils;
@Override
public ResultVO getProcessDefinitionList(CommonProcessDefinition commonProcessDefinition,
WebPageInfo webPageInfo, Boolean isLatestVersion) {
return ResultVO.getSuccess(activitiUtils.getDeployProcessList(commonProcessDefinition, webPageInfo, isLatestVersion));
}
@Override
public ResultVO deleteProcessDefinitionList(String id, boolean state) {
activitiUtils.deleteDeploymenet(id, true);
return ResultVO.getSuccess("删除成功");
}
@Override
public ResultVO addProccessDefinition(MultipartFile file, String name) {
if (file == null || file.isEmpty()) {
throw new ServiceException("bpmn文件为空");
}
String fileName = file.getOriginalFilename();
assert fileName != null : "文件名不存在";
String suffixName = fileName.substring(fileName.lastIndexOf("."));
assert !suffixName.equals(CommonProcessDefinition.BPMN) : "文件类型错误";
Map<String, Object> map = new HashMap<>(2);
try {
Deployment deployment = activitiUtils.deployProcessFormInputStream(name, file.getInputStream(), fileName);
map.put("流程名称", deployment.getName());
map.put("流程ID", deployment.getId());
} catch (IOException e) {
logger.error("bpmn文件持久化出错", e);
throw new ServiceException("文件持久化出错");
}
return ResultVO.getSuccess(map);
}
@Override
public ResultVO getBpmnFile(String deploymentId, String resourceName, HttpServletResponse response) {
response.addHeader("Content-Disposition", "attachment;fileName=" + resourceName);
byte[] buffer = new byte[1024];
BufferedInputStream bis = null;
InputStream bpmnIs = null;
try {
bpmnIs = repositoryService.getResourceAsStream(deploymentId, resourceName);
bis = new BufferedInputStream(bpmnIs);
OutputStream os = response.getOutputStream();
int i = bis.read(buffer);
while (i != -1) {
os.write(buffer, 0, i);
i = bis.read(buffer);
}
return null;
} catch (Exception e) {
throw new ServiceException("文件下载失败");
} finally {
if (bis != null) {
try {
bis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (bpmnIs != null) {
try {
bpmnIs.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
@Override
public ResultVO addProccessDefinitionByXml(String file, String name, String fileName) {
if (file == null || file.isEmpty()) {
throw new ServiceException("bpmn文件为空");
}
String filePath = CLASSPATH + fileName;
File dest = new File(filePath);
if (dest.exists()) {
dest.delete();
}
if (!activitiUtils.uniqueName(name)) {
throw new ServiceException("name已存在请重新命名");
}
Map<String, Object> map = new HashMap<>(2);
InputStream is = null;
try {
boolean flag = dest.createNewFile();
if (!flag) {
throw new ServiceException("创建文件失败!");
}
FileUtil.replaceContentToFile(file, filePath);
is= new FileInputStream(filePath);
Deployment deployment = activitiUtils.deployProcessFormInputStream(name, is, fileName);
map.put("流程名称", deployment.getName());
map.put("流程ID", deployment.getId());
} catch (IOException e) {
logger.error("bpmn文件持久化出错", e);
throw new ServiceException("文件持久化出错");
}finally {
if (is != null) {
try {
is.close();
dest.delete();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return ResultVO.getSuccess(map);
}
@Override
public ResultVO updateProcessDefinitionByXml(String file, String name, String fileName, Integer version) {
if (file == null || file.isEmpty()) {
throw new ServiceException("bpmn文件为空");
}
String filePath = CLASSPATH + fileName;
File dest = new File(filePath);
if (dest.exists()) {
dest.delete();
}
Map<String, Object> map = new HashMap<>(2);
InputStream is = null;
try {
boolean flag = dest.createNewFile();
if (!flag) {
throw new ServiceException("创建文件失败!");
}
FileUtil.replaceContentToFile(file, filePath);
is = new FileInputStream(filePath);
Deployment deployment = activitiUtils.deployProcessFormInputStream(name, is, fileName);
map.put("流程名称", deployment.getName());
map.put("流程ID", deployment.getId());
} catch (IOException e) {
logger.error("bpmn文件持久化出错", e);
throw new ServiceException("文件持久化出错");
} finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return ResultVO.getSuccess(map);
}
@Override
public ResultVO uniqueRecord(String name, String key) {
boolean flag = true;
flag = activitiUtils.uniqueName(name);
if (!flag) {
return ResultVO.getFailed("流程名称已存在!");
}
flag = activitiUtils.uniqueKey(key);
if (!flag) {
return ResultVO.getFailed("流程标识已存在!");
}
return ResultVO.getSuccess();
}
public static void main(String[] args) throws FileNotFoundException {
}
}

View File

@@ -0,0 +1,197 @@
package com.hcframe.activiti.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hcframe.activiti.activiti.ActivitiUtils;
import com.hcframe.activiti.activiti.CommonTask;
import com.hcframe.activiti.dao.BackReasonDao;
import com.hcframe.activiti.dao.CandidateUserDao;
import com.hcframe.activiti.dao.DataTaskDao;
import com.hcframe.activiti.dao.DataTaskHisDao;
import com.hcframe.activiti.entity.BackReason;
import com.hcframe.activiti.entity.CandidateUser;
import com.hcframe.activiti.entity.DataTask;
import com.hcframe.activiti.entity.DataTaskHis;
import com.hcframe.activiti.service.TaskSysService;
import com.hcframe.base.common.ResultVO;
import com.hcframe.base.common.ServiceException;
import com.hcframe.base.common.WebPageInfo;
import com.hcframe.base.common.utils.EmptyCheckUtils;
import org.activiti.engine.*;
import org.activiti.engine.task.Task;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service
public class TaskSysServiceImpl implements TaskSysService {
@Resource
ActivitiUtils activitiUtils;
@Resource
private TaskService taskService;
@Resource
DataTaskDao dataTaskDao;
@Resource
DataTaskHisDao dataTaskHisDao;
@Resource
BackReasonDao backReasonDao;
@Resource
CandidateUserDao candidateUserDao;
@Override
public ResultVO getTaskList(CommonTask commonTask, WebPageInfo webPageInfo, Map<String, Object> map) {
return ResultVO.getSuccess(activitiUtils.getTaskList(commonTask, webPageInfo, map));
}
@Override
@Transactional
public ResultVO startTaskByKey(String key, Map<String, Object> map) {
EmptyCheckUtils.checkWithException(map, "参数列表不能为空");
EmptyCheckUtils.checkWithException(map.get("tableName"), "tableName 不能为空!");
EmptyCheckUtils.checkWithException(map.get("tableId"), "tableId不能为空");
Map<String, Object> activitiMap = activitiUtils.startProcessInstanceByKey(key, map);
String processId = activitiMap.get("id").toString();
Task task = taskService.createTaskQuery().processInstanceId(processId).singleResult();
System.out.println(task.getAssignee());
String[] ids = map.get("tableId").toString().split(",");
for (String id : ids) {
DataTask dataTask = DataTask
.builder()
.taskId(task.getId())
.taskName(task.getName())
.taskKey(task.getTaskDefinitionKey())
.tableName(map.get("tableName").toString())
.tableId(id)
.processId(processId)
.assignee(task.getAssignee())
.build();
int i = dataTaskDao.insertSelective(dataTask);
if (i < 1) {
throw new ServiceException("开始流程失败");
}
}
activitiMap.put("taskId", task.getId());
return ResultVO.getSuccess(activitiMap);
}
@Override
public ResultVO startTaskById(String id, Map<String, Object> map) {
EmptyCheckUtils.checkWithException(map, "参数列表不能为空");
EmptyCheckUtils.checkWithException(map.get("tableName"), "tableName 不能为空!");
EmptyCheckUtils.checkWithException(map.get("tableId"), "tableId不能为空");
return ResultVO.getSuccess(activitiUtils.startProcessInstanceById(id, map));
}
@Override
@Transactional
public ResultVO claimTask(String taskId, String userId) {
Example example = new Example(DataTask.class);
example.createCriteria().andEqualTo("taskId",taskId);
dataTaskDao.updateByExampleSelective(DataTask.builder().assignee(userId).build(),example);
return ResultVO.getSuccess(activitiUtils.claimTask(taskId, userId));
}
@Override
@Transactional
public ResultVO commitTask(String taskId, String map, Boolean isBack, String reason) {
Map<String, Object> variables = JSONObject.parseObject(map);
if (activitiUtils.completeTask(taskId, variables)) {
DataTask dataTask = dataTaskDao.selectOne(DataTask.builder().taskId(taskId).build());
DataTaskHis dataTaskHis = new DataTaskHis();
BeanUtils.copyProperties(dataTask, dataTaskHis);
dataTaskHis.setHisTaskId(null);
int i = dataTaskHisDao.insertSelective(dataTaskHis);
if (i < 1) {
throw new ServiceException("任务提交失败");
}
List<DataTask> dataTaskList = dataTaskDao.select(DataTask.builder().processId(dataTask.getProcessId()).build());
List<Integer> list = new ArrayList<>();
for (DataTask data : dataTaskList) {
list.add(data.getDataTaskId());
}
Example dataExample = new Example(DataTask.class);
dataExample.createCriteria().andIn("dataTaskId", list);
dataTaskDao.deleteByExample(dataExample);
List<Task> taskList = taskService.createTaskQuery().processInstanceId(dataTask.getProcessId()).list();
for (Task task : taskList) {
DataTask dataTask1 = DataTask
.builder()
.taskId(task.getId())
.taskName(task.getName())
.taskKey(task.getTaskDefinitionKey())
.tableName((String) taskService.getVariable(task.getId(), "tableName"))
.tableId((String) taskService.getVariable(task.getId(), "tableId"))
.processId(task.getProcessInstanceId())
.assignee(task.getAssignee())
.build();
i = dataTaskDao.insertSelective(dataTask1);
if (i < 1) {
throw new ServiceException("任务提交失败");
}
}
return ResultVO.getSuccess();
} else {
return ResultVO.getFailed("完成任务失败");
}
}
@Override
@Transactional
public ResultVO unclaimTask(String taskId) {
Example example = new Example(DataTask.class);
example.createCriteria().andEqualTo("taskId",taskId);
dataTaskDao.updateByExampleSelective(DataTask.builder().assignee("0").build(),example);
return ResultVO.getSuccess(activitiUtils.unClaimTask(taskId));
}
@Override
@Transactional
public ResultVO addCandidateUser(String taskId, String names) {
for (String userId : names.split(",")) {
candidateUserDao.insert(CandidateUser.builder().taskId(taskId).userId(userId).build());
}
return ResultVO.getSuccess(activitiUtils.addCandidateUser(taskId, names));
}
@Override
public ResultVO getHighLightInfo(String taskId) {
return null;
}
@Override
@Transactional
public ResultVO deleteTaskIstans(String instansId, String reason, boolean flag) {
dataTaskDao.delete(DataTask.builder().processId(instansId).build());
if (flag) {
dataTaskHisDao.delete(DataTaskHis.builder().processId(instansId).build());
}
activitiUtils.deleteProcessInstance(instansId, reason, flag);
return ResultVO.getSuccess();
}
@Override
@Transactional
public ResultVO deleteTaskIstansHitory(String instansId) {
dataTaskHisDao.delete(DataTaskHis.builder().processId(instansId).build());
return ResultVO.getSuccess(activitiUtils.deleteProcessInstanceHistory(instansId));
}
@Override
public ResultVO getBackReason(String taskId) {
BackReason backReason=backReasonDao.selectOne(BackReason.builder().taskId(taskId).build());
return ResultVO.getSuccess(backReason);
}
}

View File

@@ -0,0 +1,16 @@
package com.hcframe.activiti.servicetask;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;
import java.io.Serializable;
public class TaskServe implements JavaDelegate, Serializable {
@Override
public void execute(DelegateExecution delegateExecution) {
}
}

View File

@@ -0,0 +1,74 @@
package com.hcframe.activiti.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
/***
* @author lhc
* @date 2020.1.2
*/
public class FileUtil {
private static Logger logger = LoggerFactory.getLogger(FileUtil.class);
/**
* 读取文件内容
* @param filePath 文件地址
* @return 文件内容
*/
public static String readFile(String filePath) {
String record = "";
// 创建文件记录读取数据最后一条的时间戳和id
InputStream is = null;
try {
is= new FileInputStream(filePath);
StringBuilder stringBuilder = new StringBuilder();
int temp;
//当temp等于-1时表示已经到了文件结尾停止读取
while ((temp = is.read()) != -1) {
stringBuilder.append((char) temp);
}
record = stringBuilder.toString();
} catch (IOException e) {
logger.error("File read Error!!!",e);
}finally {
try {
assert is != null;
is.close();
} catch (IOException e) {
logger.error("Cannot close File read Stream!!!",e);
}
}
return record;
}
/**
* 替换文件内容
* @param string ---需要替换的内容
* @return 是否成功
*/
public static boolean replaceContentToFile(String string,String filePath) {
File file = new File(filePath);
Writer out = null;
boolean flag = true;
try {
out = new FileWriter(file);
out.write(string);
} catch (IOException e) {
flag = false;
logger.error("Write string to file Error!!",e);
}finally {
try {
assert out != null;
out.close();
} catch (IOException e) {
logger.error("close replaceContentToFile Stream Error",e);
}
}
return flag;
}
}

View File

@@ -0,0 +1,697 @@
/*
Navicat Premium Data Transfer
Source Server : 192.168.4.119
Source Server Type : MySQL
Source Server Version : 50731
Source Host : 192.168.4.119:3306
Source Schema : activiti7
Target Server Type : MySQL
Target Server Version : 50731
File Encoding : 65001
Date: 04/09/2020 13:52:31
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for ACT_EVT_LOG
-- ----------------------------
DROP TABLE IF EXISTS `ACT_EVT_LOG`;
CREATE TABLE `ACT_EVT_LOG` (
`LOG_NR_` bigint(20) NOT NULL AUTO_INCREMENT,
`TYPE_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TIME_STAMP_` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
`USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`DATA_` longblob,
`LOCK_OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`LOCK_TIME_` timestamp(3) NULL DEFAULT NULL,
`IS_PROCESSED_` tinyint(4) DEFAULT '0',
PRIMARY KEY (`LOG_NR_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_GE_BYTEARRAY
-- ----------------------------
DROP TABLE IF EXISTS `ACT_GE_BYTEARRAY`;
CREATE TABLE `ACT_GE_BYTEARRAY` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`DEPLOYMENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`BYTES_` longblob,
`GENERATED_` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`ID_`),
KEY `ACT_FK_BYTEARR_DEPL` (`DEPLOYMENT_ID_`),
CONSTRAINT `ACT_FK_BYTEARR_DEPL` FOREIGN KEY (`DEPLOYMENT_ID_`) REFERENCES `ACT_RE_DEPLOYMENT` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_GE_PROPERTY
-- ----------------------------
DROP TABLE IF EXISTS `ACT_GE_PROPERTY`;
CREATE TABLE `ACT_GE_PROPERTY` (
`NAME_` varchar(64) COLLATE utf8_bin NOT NULL,
`VALUE_` varchar(300) COLLATE utf8_bin DEFAULT NULL,
`REV_` int(11) DEFAULT NULL,
PRIMARY KEY (`NAME_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_HI_ACTINST
-- ----------------------------
DROP TABLE IF EXISTS `ACT_HI_ACTINST`;
CREATE TABLE `ACT_HI_ACTINST` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`ACT_ID_` varchar(255) COLLATE utf8_bin NOT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`CALL_PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`ACT_NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`ACT_TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
`ASSIGNEE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`START_TIME_` datetime(3) NOT NULL,
`END_TIME_` datetime(3) DEFAULT NULL,
`DURATION_` bigint(20) DEFAULT NULL,
`DELETE_REASON_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_HI_ACT_INST_START` (`START_TIME_`),
KEY `ACT_IDX_HI_ACT_INST_END` (`END_TIME_`),
KEY `ACT_IDX_HI_ACT_INST_PROCINST` (`PROC_INST_ID_`,`ACT_ID_`),
KEY `ACT_IDX_HI_ACT_INST_EXEC` (`EXECUTION_ID_`,`ACT_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_HI_ATTACHMENT
-- ----------------------------
DROP TABLE IF EXISTS `ACT_HI_ATTACHMENT`;
CREATE TABLE `ACT_HI_ATTACHMENT` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`DESCRIPTION_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`URL_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`CONTENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TIME_` datetime(3) DEFAULT NULL,
PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_HI_COMMENT
-- ----------------------------
DROP TABLE IF EXISTS `ACT_HI_COMMENT`;
CREATE TABLE `ACT_HI_COMMENT` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TIME_` datetime(3) NOT NULL,
`USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`ACTION_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`MESSAGE_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`FULL_MSG_` longblob,
PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_HI_DETAIL
-- ----------------------------
DROP TABLE IF EXISTS `ACT_HI_DETAIL`;
CREATE TABLE `ACT_HI_DETAIL` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`ACT_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin NOT NULL,
`VAR_TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`REV_` int(11) DEFAULT NULL,
`TIME_` datetime(3) NOT NULL,
`BYTEARRAY_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`DOUBLE_` double DEFAULT NULL,
`LONG_` bigint(20) DEFAULT NULL,
`TEXT_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TEXT2_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_HI_DETAIL_PROC_INST` (`PROC_INST_ID_`),
KEY `ACT_IDX_HI_DETAIL_ACT_INST` (`ACT_INST_ID_`),
KEY `ACT_IDX_HI_DETAIL_TIME` (`TIME_`),
KEY `ACT_IDX_HI_DETAIL_NAME` (`NAME_`),
KEY `ACT_IDX_HI_DETAIL_TASK_ID` (`TASK_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_HI_IDENTITYLINK
-- ----------------------------
DROP TABLE IF EXISTS `ACT_HI_IDENTITYLINK`;
CREATE TABLE `ACT_HI_IDENTITYLINK` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`GROUP_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_HI_IDENT_LNK_USER` (`USER_ID_`),
KEY `ACT_IDX_HI_IDENT_LNK_TASK` (`TASK_ID_`),
KEY `ACT_IDX_HI_IDENT_LNK_PROCINST` (`PROC_INST_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_HI_PROCINST
-- ----------------------------
DROP TABLE IF EXISTS `ACT_HI_PROCINST`;
CREATE TABLE `ACT_HI_PROCINST` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`BUSINESS_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`START_TIME_` datetime(3) NOT NULL,
`END_TIME_` datetime(3) DEFAULT NULL,
`DURATION_` bigint(20) DEFAULT NULL,
`START_USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`START_ACT_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`END_ACT_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`SUPER_PROCESS_INSTANCE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`DELETE_REASON_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`),
UNIQUE KEY `PROC_INST_ID_` (`PROC_INST_ID_`),
KEY `ACT_IDX_HI_PRO_INST_END` (`END_TIME_`),
KEY `ACT_IDX_HI_PRO_I_BUSKEY` (`BUSINESS_KEY_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_HI_TASKINST
-- ----------------------------
DROP TABLE IF EXISTS `ACT_HI_TASKINST`;
CREATE TABLE `ACT_HI_TASKINST` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TASK_DEF_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`PARENT_TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`DESCRIPTION_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`ASSIGNEE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`START_TIME_` datetime(3) NOT NULL,
`CLAIM_TIME_` datetime(3) DEFAULT NULL,
`END_TIME_` datetime(3) DEFAULT NULL,
`DURATION_` bigint(20) DEFAULT NULL,
`DELETE_REASON_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`PRIORITY_` int(11) DEFAULT NULL,
`DUE_DATE_` datetime(3) DEFAULT NULL,
`FORM_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_HI_TASK_INST_PROCINST` (`PROC_INST_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_HI_VARINST
-- ----------------------------
DROP TABLE IF EXISTS `ACT_HI_VARINST`;
CREATE TABLE `ACT_HI_VARINST` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin NOT NULL,
`VAR_TYPE_` varchar(100) COLLATE utf8_bin DEFAULT NULL,
`REV_` int(11) DEFAULT NULL,
`BYTEARRAY_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`DOUBLE_` double DEFAULT NULL,
`LONG_` bigint(20) DEFAULT NULL,
`TEXT_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TEXT2_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`CREATE_TIME_` datetime(3) DEFAULT NULL,
`LAST_UPDATED_TIME_` datetime(3) DEFAULT NULL,
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_HI_PROCVAR_PROC_INST` (`PROC_INST_ID_`),
KEY `ACT_IDX_HI_PROCVAR_NAME_TYPE` (`NAME_`,`VAR_TYPE_`),
KEY `ACT_IDX_HI_PROCVAR_TASK_ID` (`TASK_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_PROCDEF_INFO
-- ----------------------------
DROP TABLE IF EXISTS `ACT_PROCDEF_INFO`;
CREATE TABLE `ACT_PROCDEF_INFO` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`INFO_JSON_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`),
UNIQUE KEY `ACT_UNIQ_INFO_PROCDEF` (`PROC_DEF_ID_`),
KEY `ACT_IDX_INFO_PROCDEF` (`PROC_DEF_ID_`),
KEY `ACT_FK_INFO_JSON_BA` (`INFO_JSON_ID_`),
CONSTRAINT `ACT_FK_INFO_JSON_BA` FOREIGN KEY (`INFO_JSON_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`),
CONSTRAINT `ACT_FK_INFO_PROCDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_RE_DEPLOYMENT
-- ----------------------------
DROP TABLE IF EXISTS `ACT_RE_DEPLOYMENT`;
CREATE TABLE `ACT_RE_DEPLOYMENT` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
`DEPLOY_TIME_` timestamp(3) NULL DEFAULT NULL,
`ENGINE_VERSION_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_RE_MODEL
-- ----------------------------
DROP TABLE IF EXISTS `ACT_RE_MODEL`;
CREATE TABLE `ACT_RE_MODEL` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`CREATE_TIME_` timestamp(3) NULL DEFAULT NULL,
`LAST_UPDATE_TIME_` timestamp(3) NULL DEFAULT NULL,
`VERSION_` int(11) DEFAULT NULL,
`META_INFO_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`DEPLOYMENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EDITOR_SOURCE_VALUE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EDITOR_SOURCE_EXTRA_VALUE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
PRIMARY KEY (`ID_`),
KEY `ACT_FK_MODEL_SOURCE` (`EDITOR_SOURCE_VALUE_ID_`),
KEY `ACT_FK_MODEL_SOURCE_EXTRA` (`EDITOR_SOURCE_EXTRA_VALUE_ID_`),
KEY `ACT_FK_MODEL_DEPLOYMENT` (`DEPLOYMENT_ID_`),
CONSTRAINT `ACT_FK_MODEL_DEPLOYMENT` FOREIGN KEY (`DEPLOYMENT_ID_`) REFERENCES `ACT_RE_DEPLOYMENT` (`ID_`),
CONSTRAINT `ACT_FK_MODEL_SOURCE` FOREIGN KEY (`EDITOR_SOURCE_VALUE_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`),
CONSTRAINT `ACT_FK_MODEL_SOURCE_EXTRA` FOREIGN KEY (`EDITOR_SOURCE_EXTRA_VALUE_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_RE_PROCDEF
-- ----------------------------
DROP TABLE IF EXISTS `ACT_RE_PROCDEF`;
CREATE TABLE `ACT_RE_PROCDEF` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`KEY_` varchar(255) COLLATE utf8_bin NOT NULL,
`VERSION_` int(11) NOT NULL,
`DEPLOYMENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`RESOURCE_NAME_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`DGRM_RESOURCE_NAME_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`DESCRIPTION_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`HAS_START_FORM_KEY_` tinyint(4) DEFAULT NULL,
`HAS_GRAPHICAL_NOTATION_` tinyint(4) DEFAULT NULL,
`SUSPENSION_STATE_` int(11) DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
`ENGINE_VERSION_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`),
UNIQUE KEY `ACT_UNIQ_PROCDEF` (`KEY_`,`VERSION_`,`TENANT_ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_RU_DEADLETTER_JOB
-- ----------------------------
DROP TABLE IF EXISTS `ACT_RU_DEADLETTER_JOB`;
CREATE TABLE `ACT_RU_DEADLETTER_JOB` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
`EXCLUSIVE_` tinyint(1) DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROCESS_INSTANCE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EXCEPTION_STACK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EXCEPTION_MSG_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`DUEDATE_` timestamp(3) NULL DEFAULT NULL,
`REPEAT_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`HANDLER_TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`HANDLER_CFG_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
PRIMARY KEY (`ID_`),
KEY `ACT_FK_DEADLETTER_JOB_EXECUTION` (`EXECUTION_ID_`),
KEY `ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE` (`PROCESS_INSTANCE_ID_`),
KEY `ACT_FK_DEADLETTER_JOB_PROC_DEF` (`PROC_DEF_ID_`),
KEY `ACT_FK_DEADLETTER_JOB_EXCEPTION` (`EXCEPTION_STACK_ID_`),
CONSTRAINT `ACT_FK_DEADLETTER_JOB_EXCEPTION` FOREIGN KEY (`EXCEPTION_STACK_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`),
CONSTRAINT `ACT_FK_DEADLETTER_JOB_EXECUTION` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`),
CONSTRAINT `ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE` FOREIGN KEY (`PROCESS_INSTANCE_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`),
CONSTRAINT `ACT_FK_DEADLETTER_JOB_PROC_DEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_RU_EVENT_SUBSCR
-- ----------------------------
DROP TABLE IF EXISTS `ACT_RU_EVENT_SUBSCR`;
CREATE TABLE `ACT_RU_EVENT_SUBSCR` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`EVENT_TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
`EVENT_NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`ACTIVITY_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`CONFIGURATION_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`CREATED_` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_EVENT_SUBSCR_CONFIG_` (`CONFIGURATION_`),
KEY `ACT_FK_EVENT_EXEC` (`EXECUTION_ID_`),
CONSTRAINT `ACT_FK_EVENT_EXEC` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_RU_EXECUTION
-- ----------------------------
DROP TABLE IF EXISTS `ACT_RU_EXECUTION`;
CREATE TABLE `ACT_RU_EXECUTION` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`BUSINESS_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`PARENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`SUPER_EXEC_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`ROOT_PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`ACT_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`IS_ACTIVE_` tinyint(4) DEFAULT NULL,
`IS_CONCURRENT_` tinyint(4) DEFAULT NULL,
`IS_SCOPE_` tinyint(4) DEFAULT NULL,
`IS_EVENT_SCOPE_` tinyint(4) DEFAULT NULL,
`IS_MI_ROOT_` tinyint(4) DEFAULT NULL,
`SUSPENSION_STATE_` int(11) DEFAULT NULL,
`CACHED_ENT_STATE_` int(11) DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`START_TIME_` datetime(3) DEFAULT NULL,
`START_USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`LOCK_TIME_` timestamp(3) NULL DEFAULT NULL,
`IS_COUNT_ENABLED_` tinyint(4) DEFAULT NULL,
`EVT_SUBSCR_COUNT_` int(11) DEFAULT NULL,
`TASK_COUNT_` int(11) DEFAULT NULL,
`JOB_COUNT_` int(11) DEFAULT NULL,
`TIMER_JOB_COUNT_` int(11) DEFAULT NULL,
`SUSP_JOB_COUNT_` int(11) DEFAULT NULL,
`DEADLETTER_JOB_COUNT_` int(11) DEFAULT NULL,
`VAR_COUNT_` int(11) DEFAULT NULL,
`ID_LINK_COUNT_` int(11) DEFAULT NULL,
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_EXEC_BUSKEY` (`BUSINESS_KEY_`),
KEY `ACT_IDC_EXEC_ROOT` (`ROOT_PROC_INST_ID_`),
KEY `ACT_FK_EXE_PROCINST` (`PROC_INST_ID_`),
KEY `ACT_FK_EXE_PARENT` (`PARENT_ID_`),
KEY `ACT_FK_EXE_SUPER` (`SUPER_EXEC_`),
KEY `ACT_FK_EXE_PROCDEF` (`PROC_DEF_ID_`),
CONSTRAINT `ACT_FK_EXE_PARENT` FOREIGN KEY (`PARENT_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`) ON DELETE CASCADE,
CONSTRAINT `ACT_FK_EXE_PROCDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`),
CONSTRAINT `ACT_FK_EXE_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `ACT_FK_EXE_SUPER` FOREIGN KEY (`SUPER_EXEC_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_RU_IDENTITYLINK
-- ----------------------------
DROP TABLE IF EXISTS `ACT_RU_IDENTITYLINK`;
CREATE TABLE `ACT_RU_IDENTITYLINK` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`GROUP_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_IDENT_LNK_USER` (`USER_ID_`),
KEY `ACT_IDX_IDENT_LNK_GROUP` (`GROUP_ID_`),
KEY `ACT_IDX_ATHRZ_PROCEDEF` (`PROC_DEF_ID_`),
KEY `ACT_FK_TSKASS_TASK` (`TASK_ID_`),
KEY `ACT_FK_IDL_PROCINST` (`PROC_INST_ID_`),
CONSTRAINT `ACT_FK_ATHRZ_PROCEDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`),
CONSTRAINT `ACT_FK_IDL_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`),
CONSTRAINT `ACT_FK_TSKASS_TASK` FOREIGN KEY (`TASK_ID_`) REFERENCES `ACT_RU_TASK` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_RU_INTEGRATION
-- ----------------------------
DROP TABLE IF EXISTS `ACT_RU_INTEGRATION`;
CREATE TABLE `ACT_RU_INTEGRATION` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROCESS_INSTANCE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`FLOW_NODE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`CREATED_DATE_` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
PRIMARY KEY (`ID_`),
KEY `ACT_FK_INT_EXECUTION` (`EXECUTION_ID_`),
KEY `ACT_FK_INT_PROC_INST` (`PROCESS_INSTANCE_ID_`),
KEY `ACT_FK_INT_PROC_DEF` (`PROC_DEF_ID_`),
CONSTRAINT `ACT_FK_INT_EXECUTION` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`) ON DELETE CASCADE,
CONSTRAINT `ACT_FK_INT_PROC_DEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`),
CONSTRAINT `ACT_FK_INT_PROC_INST` FOREIGN KEY (`PROCESS_INSTANCE_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_RU_JOB
-- ----------------------------
DROP TABLE IF EXISTS `ACT_RU_JOB`;
CREATE TABLE `ACT_RU_JOB` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
`LOCK_EXP_TIME_` timestamp(3) NULL DEFAULT NULL,
`LOCK_OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`EXCLUSIVE_` tinyint(1) DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROCESS_INSTANCE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`RETRIES_` int(11) DEFAULT NULL,
`EXCEPTION_STACK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EXCEPTION_MSG_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`DUEDATE_` timestamp(3) NULL DEFAULT NULL,
`REPEAT_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`HANDLER_TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`HANDLER_CFG_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
PRIMARY KEY (`ID_`),
KEY `ACT_FK_JOB_EXECUTION` (`EXECUTION_ID_`),
KEY `ACT_FK_JOB_PROCESS_INSTANCE` (`PROCESS_INSTANCE_ID_`),
KEY `ACT_FK_JOB_PROC_DEF` (`PROC_DEF_ID_`),
KEY `ACT_FK_JOB_EXCEPTION` (`EXCEPTION_STACK_ID_`),
CONSTRAINT `ACT_FK_JOB_EXCEPTION` FOREIGN KEY (`EXCEPTION_STACK_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`),
CONSTRAINT `ACT_FK_JOB_EXECUTION` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`),
CONSTRAINT `ACT_FK_JOB_PROCESS_INSTANCE` FOREIGN KEY (`PROCESS_INSTANCE_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`),
CONSTRAINT `ACT_FK_JOB_PROC_DEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_RU_SUSPENDED_JOB
-- ----------------------------
DROP TABLE IF EXISTS `ACT_RU_SUSPENDED_JOB`;
CREATE TABLE `ACT_RU_SUSPENDED_JOB` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
`EXCLUSIVE_` tinyint(1) DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROCESS_INSTANCE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`RETRIES_` int(11) DEFAULT NULL,
`EXCEPTION_STACK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EXCEPTION_MSG_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`DUEDATE_` timestamp(3) NULL DEFAULT NULL,
`REPEAT_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`HANDLER_TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`HANDLER_CFG_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
PRIMARY KEY (`ID_`),
KEY `ACT_FK_SUSPENDED_JOB_EXECUTION` (`EXECUTION_ID_`),
KEY `ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE` (`PROCESS_INSTANCE_ID_`),
KEY `ACT_FK_SUSPENDED_JOB_PROC_DEF` (`PROC_DEF_ID_`),
KEY `ACT_FK_SUSPENDED_JOB_EXCEPTION` (`EXCEPTION_STACK_ID_`),
CONSTRAINT `ACT_FK_SUSPENDED_JOB_EXCEPTION` FOREIGN KEY (`EXCEPTION_STACK_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`),
CONSTRAINT `ACT_FK_SUSPENDED_JOB_EXECUTION` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`),
CONSTRAINT `ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE` FOREIGN KEY (`PROCESS_INSTANCE_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`),
CONSTRAINT `ACT_FK_SUSPENDED_JOB_PROC_DEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_RU_TASK
-- ----------------------------
DROP TABLE IF EXISTS `ACT_RU_TASK`;
CREATE TABLE `ACT_RU_TASK` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`PARENT_TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`DESCRIPTION_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TASK_DEF_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`ASSIGNEE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`DELEGATION_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PRIORITY_` int(11) DEFAULT NULL,
`CREATE_TIME_` timestamp(3) NULL DEFAULT NULL,
`DUE_DATE_` datetime(3) DEFAULT NULL,
`CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`SUSPENSION_STATE_` int(11) DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
`FORM_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`CLAIM_TIME_` datetime(3) DEFAULT NULL,
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_TASK_CREATE` (`CREATE_TIME_`),
KEY `ACT_FK_TASK_EXE` (`EXECUTION_ID_`),
KEY `ACT_FK_TASK_PROCINST` (`PROC_INST_ID_`),
KEY `ACT_FK_TASK_PROCDEF` (`PROC_DEF_ID_`),
CONSTRAINT `ACT_FK_TASK_EXE` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`),
CONSTRAINT `ACT_FK_TASK_PROCDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`),
CONSTRAINT `ACT_FK_TASK_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_RU_TIMER_JOB
-- ----------------------------
DROP TABLE IF EXISTS `ACT_RU_TIMER_JOB`;
CREATE TABLE `ACT_RU_TIMER_JOB` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
`LOCK_EXP_TIME_` timestamp(3) NULL DEFAULT NULL,
`LOCK_OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`EXCLUSIVE_` tinyint(1) DEFAULT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROCESS_INSTANCE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`RETRIES_` int(11) DEFAULT NULL,
`EXCEPTION_STACK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`EXCEPTION_MSG_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`DUEDATE_` timestamp(3) NULL DEFAULT NULL,
`REPEAT_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`HANDLER_TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`HANDLER_CFG_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '',
PRIMARY KEY (`ID_`),
KEY `ACT_FK_TIMER_JOB_EXECUTION` (`EXECUTION_ID_`),
KEY `ACT_FK_TIMER_JOB_PROCESS_INSTANCE` (`PROCESS_INSTANCE_ID_`),
KEY `ACT_FK_TIMER_JOB_PROC_DEF` (`PROC_DEF_ID_`),
KEY `ACT_FK_TIMER_JOB_EXCEPTION` (`EXCEPTION_STACK_ID_`),
CONSTRAINT `ACT_FK_TIMER_JOB_EXCEPTION` FOREIGN KEY (`EXCEPTION_STACK_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`),
CONSTRAINT `ACT_FK_TIMER_JOB_EXECUTION` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`),
CONSTRAINT `ACT_FK_TIMER_JOB_PROCESS_INSTANCE` FOREIGN KEY (`PROCESS_INSTANCE_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`),
CONSTRAINT `ACT_FK_TIMER_JOB_PROC_DEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for ACT_RU_VARIABLE
-- ----------------------------
DROP TABLE IF EXISTS `ACT_RU_VARIABLE`;
CREATE TABLE `ACT_RU_VARIABLE` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin NOT NULL,
`NAME_` varchar(255) COLLATE utf8_bin NOT NULL,
`EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`BYTEARRAY_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`DOUBLE_` double DEFAULT NULL,
`LONG_` bigint(20) DEFAULT NULL,
`TEXT_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
`TEXT2_` varchar(4000) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`),
KEY `ACT_IDX_VARIABLE_TASK_ID` (`TASK_ID_`),
KEY `ACT_FK_VAR_EXE` (`EXECUTION_ID_`),
KEY `ACT_FK_VAR_PROCINST` (`PROC_INST_ID_`),
KEY `ACT_FK_VAR_BYTEARRAY` (`BYTEARRAY_ID_`),
CONSTRAINT `ACT_FK_VAR_BYTEARRAY` FOREIGN KEY (`BYTEARRAY_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`),
CONSTRAINT `ACT_FK_VAR_EXE` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`),
CONSTRAINT `ACT_FK_VAR_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for back_reason
-- ----------------------------
DROP TABLE IF EXISTS `back_reason`;
CREATE TABLE `back_reason` (
`back_id` int(11) NOT NULL AUTO_INCREMENT,
`task_id` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`reason` text COLLATE utf8_bin,
`title` varchar(2000) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`back_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for candidate_user
-- ----------------------------
DROP TABLE IF EXISTS `candidate_user`;
CREATE TABLE `candidate_user` (
`ca_id` int(11) NOT NULL AUTO_INCREMENT,
`task_id` varchar(225) COLLATE utf8_bin DEFAULT NULL,
`user_id` varchar(225) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ca_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for data_task
-- ----------------------------
DROP TABLE IF EXISTS `data_task`;
CREATE TABLE `data_task` (
`data_task_id` int(11) NOT NULL AUTO_INCREMENT,
`table_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`table_id` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`task_id` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`task_key` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`process_id` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`task_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`is_back` int(11) DEFAULT '0',
`assignee` varchar(255) COLLATE utf8_bin DEFAULT '0',
PRIMARY KEY (`data_task_id`),
KEY `tableid` (`table_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for data_task_his
-- ----------------------------
DROP TABLE IF EXISTS `data_task_his`;
CREATE TABLE `data_task_his` (
`his_task_id` int(11) NOT NULL AUTO_INCREMENT,
`table_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`table_id` varchar(2000) COLLATE utf8_bin DEFAULT NULL,
`task_id` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`task_key` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`process_id` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`task_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`is_back` int(11) DEFAULT '0',
`assignee` varchar(255) COLLATE utf8_bin DEFAULT '0',
PRIMARY KEY (`his_task_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@@ -0,0 +1,92 @@
spring:
application:
name: activiti-cloud
#Activiti property configuration
activiti:
database-schema-update: true
history-level: full
db-history-used: true
# redis:
# database: 0
# host: 192.168.100.145
# port: 6379
# password: root
# lettuce:
# pool:
# # 连接池中的最大空闲连接 默认8
# max-idle: 8
# # 连接池中的最小空闲连接 默认0
# min-idle: 0
# # 连接池最大连接数 默认8 ,负数表示没有限制
# max-active: 8
# # 连接池最大阻塞等待时间(使用负值表示没有限制) 默认-1
# max-wait: -1
# timeout: 30000
datasource:
url: jdbc:mysql://192.168.4.119:3306/activiti7?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
username: root
password: root
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
initialization-mode: always
initialSize: 5
minIdle: 5
maxActive: 20
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
filters: stat,wall,slf4j
maxPoolPreparedStatementPerConnectionSize: 20
useGlobalDataSourceStat: true
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
mvc:
view:
prefix: /templates/
suffix: .html
static-path-pattern: /static/**
mybatis:
mapper-locations: classpath:mapping/**
type-aliases-package: com.hcframe.activiti.entity
logging:
level:
com.hcframe.activiti: debug
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss.SSS} %clr(-%5p) %clr(${PID:- }){magenta} --- %clr([%15.15t]){faint} %highlight(%-80.80logger{300}){cyan} %clr(:) %m %n%wEx"
server:
port: 8080
servlet:
context-path: /activiti
# 是否开启redis 用户登录若开启此项需要配置redis节点及相关配置若不开启需要注释掉redis相关配置信息
isRedisLogin: true
# 用户登陆超时设置单位为小时此值不能为0
login-time-out: 4
swagger:
# 配置controller包路径
path: com.hcframe.activiti.controller
# 是否开启权限
enableAuth: false
# 用户名
username: admin
# 密码
password: admin
# Druid连接配置
druid:
# Druid用户名
username: test
# Druid密码
password: test
# Druid 允许访问的IP,默认全部允许
# allow: 127.0.0.1
# Druid 拒绝访问的IP,默认不拒绝全部
# deny: 10.0.0.2
# 是否开启controller 日志显示
show-controller-log: true
eureka:
client:
service-url:
defaultZone: http://admin:123456@192.168.4.119:8081/eureka/

View File

@@ -0,0 +1,25 @@
__ __ ______ ______
| \ | \ / \ / \
| $$ | $$| $$$$$$\ | $$$$$$\ ______ ______ ______ ____ ______
| $$__| $$| $$ \$$ | $$_ \$$/ \ | \ | \ \ / \
| $$ $$| $$ | $$ \ | $$$$$$\ \$$$$$$\| $$$$$$\$$$$\| $$$$$$\
| $$$$$$$$| $$ __ | $$$$ | $$ \$$/ $$| $$ | $$ | $$| $$ $$
| $$ | $$| $$__/ \ | $$ | $$ | $$$$$$$| $$ | $$ | $$| $$$$$$$$ __
| $$ | $$ \$$ $$ | $$ | $$ \$$ $$| $$ | $$ | $$ \$$ \| \
\$$ \$$ \$$$$$$ \$$ \$$ \$$$$$$$ \$$ \$$ \$$ \$$$$$$$ \$$
__ __ _______ __ __
| \ | \ | \ | \ | \
| $$\ | $$ ______ | $$$$$$$\ __ __ ______ | $$ | $$ ______ ______ ______
| $$$\| $$ / \ | $$__/ $$| \ | \ / \ | $$__| $$ / \ / \ / \
| $$$$\ $$| $$$$$$\ | $$ $$| $$ | $$| $$$$$$\ | $$ $$| $$$$$$\| $$$$$$\| $$$$$$\
| $$\$$ $$| $$ | $$ | $$$$$$$\| $$ | $$| $$ | $$ | $$$$$$$$| $$ | $$| $$ | $$| $$ $$
| $$ \$$$$| $$__/ $$ | $$__/ $$| $$__/ $$| $$__| $$ | $$ | $$| $$__/ $$| $$__/ $$| $$$$$$$$ __
| $$ \$$$ \$$ $$ | $$ $$ \$$ $$ \$$ $$ | $$ | $$ \$$ $$| $$ $$ \$$ \| \
\$$ \$$ \$$$$$$ \$$$$$$$ \$$$$$$ _\$$$$$$$ \$$ \$$ \$$$$$$ | $$$$$$$ \$$$$$$$ \$$
| \__| $$ | $$
\$$ $$ | $$
\$$$$$$ \$$

View File

@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" id="m1577635100724" name="" targetNamespace="http://www.activiti.org/testm1577635100724">
<process id="baoxiao" processType="None" isClosed="false" isExecutable="true">
<extensionElements>
<activiti:properties />
</extensionElements>
<startEvent id="_2" name="开始报销">
<outgoing>SequenceFlow_1tepjd8</outgoing>
</startEvent>
<sequenceFlow id="SequenceFlow_1tepjd8" sourceRef="_2" targetRef="Task_1fb3fdl" />
<exclusiveGateway id="ExclusiveGateway_0a4s16t">
<incoming>SequenceFlow_16kfu0c</incoming>
<outgoing>SequenceFlow_08rzzfi</outgoing>
<outgoing>SequenceFlow_16octdj</outgoing>
<outgoing>SequenceFlow_05mw1rb</outgoing>
</exclusiveGateway>
<sequenceFlow id="SequenceFlow_16kfu0c" sourceRef="Task_1fb3fdl" targetRef="ExclusiveGateway_0a4s16t" />
<sequenceFlow id="SequenceFlow_08rzzfi" name="金额大于5000" sourceRef="ExclusiveGateway_0a4s16t" targetRef="Task_0xnp5km">
<conditionExpression xsi:type="tFormalExpression">${money&gt;5000}</conditionExpression>
</sequenceFlow>
<sequenceFlow id="SequenceFlow_16octdj" name="金额大于2000" sourceRef="ExclusiveGateway_0a4s16t" targetRef="Task_0qrrn3k">
<conditionExpression xsi:type="tFormalExpression">${money&gt;2000}</conditionExpression>
</sequenceFlow>
<sequenceFlow id="SequenceFlow_05mw1rb" name="金额小于等于2000" sourceRef="ExclusiveGateway_0a4s16t" targetRef="Task_08d7vre">
<conditionExpression xsi:type="tFormalExpression">${money&lt;=2000}</conditionExpression>
</sequenceFlow>
<userTask id="Task_1fb3fdl" name="报销申请">
<incoming>SequenceFlow_1tepjd8</incoming>
<outgoing>SequenceFlow_16kfu0c</outgoing>
</userTask>
<userTask id="Task_0xnp5km" name="总经理">
<incoming>SequenceFlow_08rzzfi</incoming>
<outgoing>SequenceFlow_0fj2awn</outgoing>
</userTask>
<userTask id="Task_08d7vre" name="财务">
<incoming>SequenceFlow_05mw1rb</incoming>
<outgoing>SequenceFlow_0r5llta</outgoing>
</userTask>
<endEvent id="EndEvent_0vuejiy" name="结束报销">
<incoming>SequenceFlow_1isb5u2</incoming>
<incoming>SequenceFlow_0fj2awn</incoming>
<incoming>SequenceFlow_0r5llta</incoming>
</endEvent>
<sequenceFlow id="SequenceFlow_1isb5u2" sourceRef="Task_0qrrn3k" targetRef="EndEvent_0vuejiy" />
<sequenceFlow id="SequenceFlow_0fj2awn" sourceRef="Task_0xnp5km" targetRef="EndEvent_0vuejiy" />
<sequenceFlow id="SequenceFlow_0r5llta" sourceRef="Task_08d7vre" targetRef="EndEvent_0vuejiy" />
<userTask id="Task_0qrrn3k" name="副总经理">
<incoming>SequenceFlow_16octdj</incoming>
<outgoing>SequenceFlow_1isb5u2</outgoing>
</userTask>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_leave">
<bpmndi:BPMNPlane id="BPMNPlane_leave" bpmnElement="baoxiao">
<bpmndi:BPMNShape id="BPMNShape__2" bpmnElement="_2">
<omgdc:Bounds x="144" y="368" width="32" height="32" />
<bpmndi:BPMNLabel>
<omgdc:Bounds x="140" y="400" width="44" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1tepjd8_di" bpmnElement="SequenceFlow_1tepjd8">
<di:waypoint x="176" y="384" />
<di:waypoint x="230" y="384" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ExclusiveGateway_0a4s16t_di" bpmnElement="ExclusiveGateway_0a4s16t" isMarkerVisible="true">
<omgdc:Bounds x="385" y="359" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_16kfu0c_di" bpmnElement="SequenceFlow_16kfu0c">
<di:waypoint x="330" y="384" />
<di:waypoint x="385" y="384" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_08rzzfi_di" bpmnElement="SequenceFlow_08rzzfi">
<di:waypoint x="410" y="359" />
<di:waypoint x="410" y="240" />
<di:waypoint x="510" y="240" />
<bpmndi:BPMNLabel>
<omgdc:Bounds x="392" y="297" width="69" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_16octdj_di" bpmnElement="SequenceFlow_16octdj">
<di:waypoint x="435" y="384" />
<di:waypoint x="510" y="384" />
<bpmndi:BPMNLabel>
<omgdc:Bounds x="439" y="366" width="69" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_05mw1rb_di" bpmnElement="SequenceFlow_05mw1rb">
<di:waypoint x="410" y="409" />
<di:waypoint x="410" y="550" />
<di:waypoint x="510" y="550" />
<bpmndi:BPMNLabel>
<omgdc:Bounds x="385" y="477" width="85" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="UserTask_1g7xgb4_di" bpmnElement="Task_1fb3fdl">
<omgdc:Bounds x="230" y="344" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_0xmmeoo_di" bpmnElement="Task_0xnp5km">
<omgdc:Bounds x="510" y="200" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_0voal2f_di" bpmnElement="Task_08d7vre">
<omgdc:Bounds x="510" y="510" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_0vuejiy_di" bpmnElement="EndEvent_0vuejiy">
<omgdc:Bounds x="692" y="366" width="36" height="36" />
<bpmndi:BPMNLabel>
<omgdc:Bounds x="689" y="409" width="44" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1isb5u2_di" bpmnElement="SequenceFlow_1isb5u2">
<di:waypoint x="610" y="384" />
<di:waypoint x="692" y="384" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0fj2awn_di" bpmnElement="SequenceFlow_0fj2awn">
<di:waypoint x="610" y="240" />
<di:waypoint x="651" y="240" />
<di:waypoint x="651" y="384" />
<di:waypoint x="692" y="384" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0r5llta_di" bpmnElement="SequenceFlow_0r5llta">
<di:waypoint x="610" y="550" />
<di:waypoint x="651" y="550" />
<di:waypoint x="651" y="384" />
<di:waypoint x="692" y="384" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="UserTask_1kbkr67_di" bpmnElement="Task_0qrrn3k">
<omgdc:Bounds x="510" y="344" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" id="m1577635100724" name="" targetNamespace="http://www.activiti.org/testm1577635100724">
<process id="task__111" name="审批" processType="None" isClosed="false" isExecutable="true">
<extensionElements>
<activiti:properties />
</extensionElements>
<startEvent id="_2" name="start">
<outgoing>SequenceFlow_09zceg0</outgoing>
</startEvent>
<sequenceFlow id="SequenceFlow_09zceg0" sourceRef="_2" targetRef="Task_1ooumy6" />
<userTask id="Task_1ooumy6" name="审批1" activiti:assignee="tom">
<incoming>SequenceFlow_09zceg0</incoming>
<outgoing>SequenceFlow_13ur3ks</outgoing>
</userTask>
<endEvent id="EndEvent_1ur958c" name="结束">
<incoming>SequenceFlow_13ur3ks</incoming>
</endEvent>
<sequenceFlow id="SequenceFlow_13ur3ks" sourceRef="Task_1ooumy6" targetRef="EndEvent_1ur958c" />
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_leave">
<bpmndi:BPMNPlane id="BPMNPlane_leave" bpmnElement="task__111">
<bpmndi:BPMNShape id="BPMNShape__2" bpmnElement="_2">
<omgdc:Bounds x="144" y="368" width="32" height="32" />
<bpmndi:BPMNLabel>
<omgdc:Bounds x="149" y="400" width="23" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_09zceg0_di" bpmnElement="SequenceFlow_09zceg0">
<di:waypoint x="176" y="384" />
<di:waypoint x="230" y="384" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="UserTask_1aufmzl_di" bpmnElement="Task_1ooumy6">
<omgdc:Bounds x="230" y="344" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_1ur958c_di" bpmnElement="EndEvent_1ur958c">
<omgdc:Bounds x="392" y="366" width="36" height="36" />
<bpmndi:BPMNLabel>
<omgdc:Bounds x="399" y="409" width="22" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_13ur3ks_di" bpmnElement="SequenceFlow_13ur3ks">
<di:waypoint x="330" y="384" />
<di:waypoint x="392" y="384" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" id="m1577635100724" name="" targetNamespace="http://www.activiti.org/testm1577635100724">
<process id="task__111" name="审批" processType="None" isClosed="false" isExecutable="true">
<extensionElements>
<activiti:properties />
</extensionElements>
<startEvent id="_2" name="start">
<outgoing>SequenceFlow_09zceg0</outgoing>
</startEvent>
<sequenceFlow id="SequenceFlow_09zceg0" sourceRef="_2" targetRef="Task_1ooumy6" />
<userTask id="Task_1ooumy6" name="审批1" activiti:assignee="tom">
<incoming>SequenceFlow_09zceg0</incoming>
<outgoing>SequenceFlow_13ur3ks</outgoing>
</userTask>
<endEvent id="EndEvent_1ur958c" name="结束">
<incoming>SequenceFlow_13ur3ks</incoming>
</endEvent>
<sequenceFlow id="SequenceFlow_13ur3ks" sourceRef="Task_1ooumy6" targetRef="EndEvent_1ur958c" />
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_leave">
<bpmndi:BPMNPlane id="BPMNPlane_leave" bpmnElement="task__111">
<bpmndi:BPMNShape id="BPMNShape__2" bpmnElement="_2">
<omgdc:Bounds x="144" y="368" width="32" height="32" />
<bpmndi:BPMNLabel>
<omgdc:Bounds x="149" y="400" width="23" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_09zceg0_di" bpmnElement="SequenceFlow_09zceg0">
<di:waypoint x="176" y="384" />
<di:waypoint x="230" y="384" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="UserTask_1aufmzl_di" bpmnElement="Task_1ooumy6">
<omgdc:Bounds x="230" y="344" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_1ur958c_di" bpmnElement="EndEvent_1ur958c">
<omgdc:Bounds x="392" y="366" width="36" height="36" />
<bpmndi:BPMNLabel>
<omgdc:Bounds x="399" y="409" width="22" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_13ur3ks_di" bpmnElement="SequenceFlow_13ur3ks">
<di:waypoint x="330" y="384" />
<di:waypoint x="392" y="384" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

View File

@@ -0,0 +1,269 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.activiti.org/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1597912603209" name="" targetNamespace="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema">
<process id="gather-use" isClosed="false" isExecutable="true" name="采集审批业务流程" processType="None">
<startEvent id="startevent1" name="Start"/>
<userTask activiti:assignee="${processCreator}" activiti:exclusive="true" id="startTask" name="采集申请">
<extensionElements>
<activiti:taskListener event="create" expression="${gatherCreateListener.createStartTask(task)}"/>
</extensionElements>
</userTask>
<userTask activiti:exclusive="true" id="dgoTask" name="数据采集室科长审批">
<extensionElements>
<activiti:taskListener event="create" expression="${gatherCreateListener.createDgoTask(task)}"/>
</extensionElements>
</userTask>
<userTask activiti:exclusive="true" id="dmacTask" name="数据管理与分析中心主任审批">
<extensionElements>
<activiti:taskListener event="create" expression="${gatherCreateListener.createDmacTask(task)}"/>
</extensionElements>
</userTask>
<endEvent id="endevent1" name="End"/>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="startTask"/>
<exclusiveGateway gatewayDirection="Unspecified" id="exclusivegateway1" name="Exclusive Gateway"/>
<sequenceFlow id="flow4" name="通过" sourceRef="exclusivegateway1" targetRef="dmacTask">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${taskFlowType==1}]]>
</conditionExpression>
</sequenceFlow>
<exclusiveGateway gatewayDirection="Unspecified" id="exclusivegateway2" name="Exclusive Gateway"/>
<sequenceFlow id="flow5" sourceRef="dgoTask" targetRef="exclusivegateway1"/>
<sequenceFlow id="flow6" sourceRef="dmacTask" targetRef="exclusivegateway2"/>
<sequenceFlow id="flow7" name="不通过" sourceRef="exclusivegateway2" targetRef="dgoTask">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${taskFlowType==0}]]>
</conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow8" name="通过" sourceRef="exclusivegateway2" targetRef="oaTask">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${taskFlowType==1}]]>
</conditionExpression>
</sequenceFlow>
<exclusiveGateway gatewayDirection="Unspecified" id="exclusivegateway3" name="Exclusive Gateway"/>
<sequenceFlow id="flow9" sourceRef="oaTask" targetRef="exclusivegateway3"/>
<sequenceFlow id="flow10" name="不通过" sourceRef="exclusivegateway3" targetRef="dmacTask">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${taskFlowType==0}]]>
</conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow11" name="通过" sourceRef="exclusivegateway3" targetRef="endTask">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${taskFlowType==1}]]>
</conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow12" sourceRef="endTask" targetRef="endevent1"/>
<serviceTask activiti:exclusive="true" activiti:expression="${gatherOAService.execute(task)}" id="oaTask" name="接入OA系统进行保管部、文保院和分管副馆长、馆长审批"/>
<userTask activiti:exclusive="true" activiti:skipExpression="${processCreatorPosition=='科长'}" id="daoTask" name="数据应用室科长审批">
<extensionElements>
<activiti:taskListener event="create" expression="${gatherCreateListener.createDaoTask(task)}"/>
</extensionElements>
</userTask>
<sequenceFlow id="flow22" name="不通过" sourceRef="exclusivegateway1" targetRef="daoTask">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${taskFlowType==0}]]>
</conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow23" sourceRef="startTask" targetRef="daoTask"/>
<sequenceFlow id="flow25" name="不通过" sourceRef="exclusivegateway4" targetRef="startTask">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${taskFlowType==0}]]>
</conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow26" name="通过" sourceRef="exclusivegateway4" targetRef="dgoTask">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${taskFlowType==1}]]>
</conditionExpression>
</sequenceFlow>
<serviceTask activiti:exclusive="true" activiti:expression="${gatherArchiveService.execute(task)}" id="endTask" name="归档"/>
<exclusiveGateway gatewayDirection="Unspecified" id="exclusivegateway4" name="Exclusive Gateway"/>
<sequenceFlow id="flow27" sourceRef="daoTask" targetRef="exclusivegateway4"/>
</process>
<bpmndi:BPMNDiagram documentation="background=#292D3E;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0" id="Diagram-_1" name="New Diagram">
<bpmndi:BPMNPlane bpmnElement="gather-use">
<bpmndi:BPMNShape bpmnElement="startevent1" id="Shape-startevent1">
<omgdc:Bounds height="32.0" width="32.0" x="10.0" y="260.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="startTask" id="Shape-startTask">
<omgdc:Bounds height="71.0" width="105.0" x="90.0" y="242.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="71.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="dgoTask" id="Shape-dgoTask">
<omgdc:Bounds height="71.0" width="105.0" x="407.0" y="242.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="71.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="dmacTask" id="Shape-dmacTask">
<omgdc:Bounds height="71.0" width="121.0" x="577.0" y="242.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="71.0" width="121.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="Shape-endevent1">
<omgdc:Bounds height="32.0" width="32.0" x="1160.0" y="260.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="Shape-exclusivegateway1" isMarkerVisible="false">
<omgdc:Bounds height="32.0" width="32.0" x="439.0" y="148.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="Shape-exclusivegateway2" isMarkerVisible="false">
<omgdc:Bounds height="32.0" width="32.0" x="617.0" y="360.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway3" id="Shape-exclusivegateway3" isMarkerVisible="false">
<omgdc:Bounds height="32.0" width="32.0" x="843.0" y="148.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="oaTask" id="Shape-oaTask">
<omgdc:Bounds height="71.0" width="221.0" x="753.0" y="242.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="71.0" width="221.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="daoTask" id="Shape-daoTask">
<omgdc:Bounds height="71.0" width="105.0" x="247.0" y="242.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="71.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endTask" id="Shape-endTask">
<omgdc:Bounds height="71.0" width="105.0" x="1000.0" y="242.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="71.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway4" id="Shape-exclusivegateway4" isMarkerVisible="false">
<omgdc:Bounds height="32.0" width="32.0" x="279.0" y="360.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow25" id="BPMNEdge_flow25" sourceElement="exclusivegateway4" targetElement="startTask">
<omgdi:waypoint x="282.0" y="379.0"/>
<omgdi:waypoint x="142.0" y="379.0"/>
<omgdi:waypoint x="142.0" y="313.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="48.0" x="181.0" y="386.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow26" id="BPMNEdge_flow26" sourceElement="exclusivegateway4" targetElement="dgoTask">
<omgdi:waypoint x="307.0" y="380.0"/>
<omgdi:waypoint x="459.0" y="380.0"/>
<omgdi:waypoint x="459.0" y="313.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="32.0" x="350.0" y="385.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow27" id="BPMNEdge_flow27" sourceElement="daoTask" targetElement="exclusivegateway4">
<omgdi:waypoint x="295.0" y="313.0"/>
<omgdi:waypoint x="295.0" y="360.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1" sourceElement="startevent1" targetElement="startTask">
<omgdi:waypoint x="42.0" y="276.0"/>
<omgdi:waypoint x="90.0" y="277.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4" sourceElement="exclusivegateway1" targetElement="dmacTask">
<omgdi:waypoint x="468.0" y="167.0"/>
<omgdi:waypoint x="637.0" y="167.0"/>
<omgdi:waypoint x="637.0" y="242.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="32.0" x="508.0" y="149.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5" sourceElement="dgoTask" targetElement="exclusivegateway1">
<omgdi:waypoint x="455.0" y="242.0"/>
<omgdi:waypoint x="455.0" y="180.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6" sourceElement="dmacTask" targetElement="exclusivegateway2">
<omgdi:waypoint x="633.0" y="313.0"/>
<omgdi:waypoint x="633.0" y="360.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7" sourceElement="exclusivegateway2" targetElement="dgoTask">
<omgdi:waypoint x="620.0" y="379.0"/>
<omgdi:waypoint x="459.0" y="379.0"/>
<omgdi:waypoint x="459.0" y="313.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="48.0" x="518.0" y="386.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8" sourceElement="exclusivegateway2" targetElement="oaTask">
<omgdi:waypoint x="646.0" y="379.0"/>
<omgdi:waypoint x="863.0" y="379.0"/>
<omgdi:waypoint x="863.0" y="313.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="32.0" x="705.0" y="386.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow22" id="BPMNEdge_flow22" sourceElement="exclusivegateway1" targetElement="daoTask">
<omgdi:waypoint x="442.0" y="167.0"/>
<omgdi:waypoint x="299.0" y="167.0"/>
<omgdi:waypoint x="299.0" y="242.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="48.0" x="361.0" y="149.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9" sourceElement="oaTask" targetElement="exclusivegateway3">
<omgdi:waypoint x="859.0" y="242.0"/>
<omgdi:waypoint x="859.0" y="180.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow23" id="BPMNEdge_flow23" sourceElement="startTask" targetElement="daoTask">
<omgdi:waypoint x="195.0" y="277.5"/>
<omgdi:waypoint x="247.0" y="277.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10" sourceElement="exclusivegateway3" targetElement="dmacTask">
<omgdi:waypoint x="847.0" y="168.0"/>
<omgdi:waypoint x="637.0" y="168.0"/>
<omgdi:waypoint x="637.0" y="242.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="48.0" x="757.0" y="147.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11" sourceElement="exclusivegateway3" targetElement="endTask">
<omgdi:waypoint x="872.0" y="167.0"/>
<omgdi:waypoint x="1052.0" y="167.0"/>
<omgdi:waypoint x="1052.0" y="242.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="32.0" x="925.0" y="148.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12" sourceElement="endTask" targetElement="endevent1">
<omgdi:waypoint x="1105.0" y="277.5"/>
<omgdi:waypoint x="1160.0" y="276.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

View File

@@ -0,0 +1,196 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="gather-use" name="采集审批业务流程" isExecutable="true">
<startEvent id="startevent1" name="Start"></startEvent>
<userTask id="startTask" name="采集申请" activiti:assignee="${processCreator}">
<extensionElements>
<activiti:taskListener event="create" expression="${gatherCreateListener.createStartTask(task)}"></activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="dgoTask" name="数据采集室科长审批">
<extensionElements>
<activiti:taskListener event="create" expression="${gatherCreateListener.createDgoTask(task)}"></activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="dmacTask" name="数据管理与分析中心主任审批">
<extensionElements>
<activiti:taskListener event="create" expression="${gatherCreateListener.createDmacTask(task)}"></activiti:taskListener>
</extensionElements>
</userTask>
<endEvent id="endevent1" name="End"></endEvent>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="startTask"></sequenceFlow>
<exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow4" name="通过" sourceRef="exclusivegateway1" targetRef="dmacTask">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${taskFlowType==1}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow5" sourceRef="dgoTask" targetRef="exclusivegateway1"></sequenceFlow>
<sequenceFlow id="flow6" sourceRef="dmacTask" targetRef="exclusivegateway2"></sequenceFlow>
<sequenceFlow id="flow7" name="不通过" sourceRef="exclusivegateway2" targetRef="dgoTask">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${taskFlowType==0}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow8" name="通过" sourceRef="exclusivegateway2" targetRef="oaTask">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${taskFlowType==1}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="exclusivegateway3" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow9" sourceRef="oaTask" targetRef="exclusivegateway3"></sequenceFlow>
<sequenceFlow id="flow10" name="不通过" sourceRef="exclusivegateway3" targetRef="dmacTask">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${taskFlowType==0}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow11" name="通过" sourceRef="exclusivegateway3" targetRef="endTask">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${taskFlowType==1}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow12" sourceRef="endTask" targetRef="endevent1"></sequenceFlow>
<serviceTask id="oaTask" name="接入OA系统进行保管部、文保院和分管副馆长、馆长审批" activiti:expression="${gatherOAService.execute(task)}"></serviceTask>
<userTask id="daoTask" name="数据应用室科长审批" activiti:skipExpression="${processCreatorPosition=='科长'}">
<extensionElements>
<activiti:taskListener event="create" expression="${gatherCreateListener.createDaoTask(task)}"></activiti:taskListener>
</extensionElements>
</userTask>
<sequenceFlow id="flow22" name="不通过" sourceRef="exclusivegateway1" targetRef="daoTask">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${taskFlowType==0}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow23" sourceRef="startTask" targetRef="daoTask"></sequenceFlow>
<sequenceFlow id="flow25" name="不通过" sourceRef="exclusivegateway4" targetRef="startTask">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${taskFlowType==0}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow26" name="通过" sourceRef="exclusivegateway4" targetRef="dgoTask">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${taskFlowType==1}]]></conditionExpression>
</sequenceFlow>
<serviceTask id="endTask" name="归档" activiti:expression="${gatherArchiveService.execute(task)}"></serviceTask>
<exclusiveGateway id="exclusivegateway4" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow27" sourceRef="daoTask" targetRef="exclusivegateway4"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_gather-use">
<bpmndi:BPMNPlane bpmnElement="gather-use" id="BPMNPlane_gather-use">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35.0" width="35.0" x="10.0" y="260.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="startTask" id="BPMNShape_startTask">
<omgdc:Bounds height="71.0" width="105.0" x="90.0" y="242.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="dgoTask" id="BPMNShape_dgoTask">
<omgdc:Bounds height="71.0" width="105.0" x="407.0" y="242.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="dmacTask" id="BPMNShape_dmacTask">
<omgdc:Bounds height="71.0" width="121.0" x="577.0" y="242.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="1160.0" y="260.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
<omgdc:Bounds height="40.0" width="40.0" x="439.0" y="148.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2">
<omgdc:Bounds height="40.0" width="40.0" x="617.0" y="360.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway3" id="BPMNShape_exclusivegateway3">
<omgdc:Bounds height="40.0" width="40.0" x="843.0" y="148.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="oaTask" id="BPMNShape_oaTask">
<omgdc:Bounds height="71.0" width="221.0" x="753.0" y="242.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="daoTask" id="BPMNShape_daoTask">
<omgdc:Bounds height="71.0" width="105.0" x="247.0" y="242.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endTask" id="BPMNShape_endTask">
<omgdc:Bounds height="71.0" width="105.0" x="1000.0" y="242.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway4" id="BPMNShape_exclusivegateway4">
<omgdc:Bounds height="40.0" width="40.0" x="279.0" y="360.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="45.0" y="277.0"></omgdi:waypoint>
<omgdi:waypoint x="90.0" y="277.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="479.0" y="168.0"></omgdi:waypoint>
<omgdi:waypoint x="637.0" y="167.0"></omgdi:waypoint>
<omgdi:waypoint x="637.0" y="242.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="32.0" x="508.0" y="149.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="459.0" y="242.0"></omgdi:waypoint>
<omgdi:waypoint x="459.0" y="188.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="637.0" y="313.0"></omgdi:waypoint>
<omgdi:waypoint x="637.0" y="360.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
<omgdi:waypoint x="617.0" y="380.0"></omgdi:waypoint>
<omgdi:waypoint x="459.0" y="379.0"></omgdi:waypoint>
<omgdi:waypoint x="459.0" y="313.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="48.0" x="518.0" y="386.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
<omgdi:waypoint x="657.0" y="380.0"></omgdi:waypoint>
<omgdi:waypoint x="863.0" y="379.0"></omgdi:waypoint>
<omgdi:waypoint x="863.0" y="313.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="32.0" x="705.0" y="386.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
<omgdi:waypoint x="863.0" y="242.0"></omgdi:waypoint>
<omgdi:waypoint x="863.0" y="188.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
<omgdi:waypoint x="843.0" y="168.0"></omgdi:waypoint>
<omgdi:waypoint x="637.0" y="168.0"></omgdi:waypoint>
<omgdi:waypoint x="637.0" y="242.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="48.0" x="757.0" y="147.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
<omgdi:waypoint x="883.0" y="168.0"></omgdi:waypoint>
<omgdi:waypoint x="1052.0" y="167.0"></omgdi:waypoint>
<omgdi:waypoint x="1052.0" y="242.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="32.0" x="925.0" y="148.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
<omgdi:waypoint x="1105.0" y="277.0"></omgdi:waypoint>
<omgdi:waypoint x="1160.0" y="277.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow22" id="BPMNEdge_flow22">
<omgdi:waypoint x="439.0" y="168.0"></omgdi:waypoint>
<omgdi:waypoint x="299.0" y="167.0"></omgdi:waypoint>
<omgdi:waypoint x="299.0" y="242.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="48.0" x="361.0" y="149.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow23" id="BPMNEdge_flow23">
<omgdi:waypoint x="195.0" y="277.0"></omgdi:waypoint>
<omgdi:waypoint x="247.0" y="277.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow25" id="BPMNEdge_flow25">
<omgdi:waypoint x="279.0" y="380.0"></omgdi:waypoint>
<omgdi:waypoint x="142.0" y="379.0"></omgdi:waypoint>
<omgdi:waypoint x="142.0" y="313.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="48.0" x="181.0" y="386.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow26" id="BPMNEdge_flow26">
<omgdi:waypoint x="319.0" y="380.0"></omgdi:waypoint>
<omgdi:waypoint x="459.0" y="380.0"></omgdi:waypoint>
<omgdi:waypoint x="459.0" y="313.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="32.0" x="350.0" y="385.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow27" id="BPMNEdge_flow27">
<omgdi:waypoint x="299.0" y="313.0"></omgdi:waypoint>
<omgdi:waypoint x="299.0" y="360.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.common.com.hcframe.activiti.dao.BackReasonDao">
<resultMap type="com.hcframe.activiti.entity.BackReason" id="BackReasonMap">
<result property="backId" column="back_id" jdbcType="INTEGER"/>
<result property="taskId" column="task_id" jdbcType="VARCHAR"/>
<result property="reason" column="reason" jdbcType="VARCHAR"/>
<result property="title" column="title" jdbcType="VARCHAR"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.common.com.hcframe.activiti.dao.CandidateUserDao">
<resultMap type="com.hcframe.activiti.entity.CandidateUser" id="CandidateUserMap">
<result property="caId" column="ca_id" jdbcType="INTEGER"/>
<result property="taskId" column="task_id" jdbcType="VARCHAR"/>
<result property="userId" column="user_id" jdbcType="INTEGER"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.common.com.hcframe.activiti.dao.DataTaskDao">
<resultMap type="com.hcframe.activiti.entity.DataTask" id="DataTaskMap">
<result property="dataTaskId" column="data_task_id" jdbcType="INTEGER"/>
<result property="tableName" column="table_name" jdbcType="VARCHAR"/>
<result property="tableId" column="table_id" jdbcType="VARCHAR"/>
<result property="taskId" column="task_id" jdbcType="VARCHAR"/>
<result property="taskKey" column="task_key" jdbcType="VARCHAR"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.common.com.hcframe.activiti.dao.DataTaskHisDao">
<resultMap type="com.hcframe.activiti.entity.DataTaskHis" id="DataTaskHisMap">
<result property="dataTaskId" column="data_task_id" jdbcType="INTEGER"/>
<result property="tableName" column="table_name" jdbcType="VARCHAR"/>
<result property="tableId" column="table_id" jdbcType="VARCHAR"/>
<result property="taskId" column="task_id" jdbcType="VARCHAR"/>
<result property="taskKey" column="task_key" jdbcType="VARCHAR"/>
<result property="processId" column="process_id" jdbcType="VARCHAR"/>
<result property="taskName" column="task_name" jdbcType="VARCHAR"/>
<result property="isBack" column="is_back" jdbcType="INTEGER"/>
<result property="assignee" column="assignee" jdbcType="VARCHAR"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,56 @@
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>parent</artifactId>
<groupId>com.hcframe</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hcframe-es</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<elasticsearch.version>7.6.2</elasticsearch.version>
</properties>
<dependencies>
<dependency>
<groupId>com.hcframe</groupId>
<artifactId>hcframe-base</artifactId>
<version>1.2.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>${elasticsearch.version}</version>
<exclusions>
<exclusion>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId>
</exclusion>
<exclusion>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<dependency>
<groupId>com.hcframe</groupId>
<artifactId>hcframe-starter</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,27 @@
package com.hcframe.es;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableSwagger2
@ServletComponentScan
@EnableCaching
//@EnableDiscoveryClient
//@EnableFeignClients
@ComponentScan(basePackages = {"com.hcframe.**"})
public class EsApplication {
public static void main(String[] args) {
SpringApplication.run(EsApplication.class, args);
}
}

View File

@@ -0,0 +1,13 @@
package com.hcframe.es;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(EsApplication.class);
}
}

View File

@@ -0,0 +1,26 @@
package com.hcframe.es.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 日志注解
*
* @author lhc
*/
// 方法注解
@Target(ElementType.METHOD)
// 运行时可见
@Retention(RetentionPolicy.RUNTIME)
public @interface LogAnno {
// 记录日志的操作类型
String operateType();
// 记录日志主键
String primaryKey() default "id";
// 记录日志表
String tableName() default "-";
boolean isBefore() default false;
}

View File

@@ -0,0 +1,36 @@
package com.hcframe.es.config;
import com.hcframe.base.module.cache.CacheService;
import com.hcframe.base.module.datasource.utils.DataSourceUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author lhc
* @date 2020-10-09
* @description springboot启动执行配置类
*/
@Component
public class CommandLineRunnerImpl implements CommandLineRunner {
private static final Logger logger = LoggerFactory.getLogger(CommandLineRunnerImpl.class);
@Autowired
List<CacheService> cacheServices;
@Override
public void run(String... args) {
// DataSourceUtil.initDataSource();
// 初始化缓存
// for (CacheService cacheService : cacheServices) {
// cacheService.initTableCache();
// }
logger.info("start success");
}
}

View File

@@ -0,0 +1,77 @@
package com.hcframe.es.config;
import com.hcframe.base.module.auth.dao.FtUserDao;
import com.hcframe.base.module.auth.entity.FtUser;
import com.hcframe.base.module.shiro.service.ShiroType;
import com.hcframe.base.module.shiro.service.SystemRealm;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.LinkedHashMap;
/**
* @author lhc
* @date 2020-07-28
* @decription shiro 配置类
*/
@Component
public class ShiroRealmConfig implements SystemRealm {
@Resource
FtUserDao ftUserDao;
/**
* 根据用户信息注入权限
* @param user 用户信息
* @return 权限信息
*/
@Override
public SimpleAuthorizationInfo setAuthoriztion(Object user) {
return new SimpleAuthorizationInfo();
}
/**
* 根据用户Id查询用户信息并注入到shiro框架中
* @param userId 用户id
* @return 用户信息
*/
@Override
public Object findByUserId(String userId) {
return ftUserDao.selectOne(FtUser.builder().userId(Integer.parseInt(userId)).build());
}
/**
* 配置拦截及放行路径
* @return 返回拦截及放行路径Map
*/
@Override
public LinkedHashMap<String, String> setShiroUrl() {
LinkedHashMap<String, String> map = new LinkedHashMap<>();
// // 用户登陆
// map.put("/ftUser/login", ShiroType.ANON);
// // Vue静态资源
// map.put("/img/**", ShiroType.ANON);
// map.put("/static/**", ShiroType.ANON);
// map.put("/tinymce/**", ShiroType.ANON);
// map.put("/favicon.ico", ShiroType.ANON);
// map.put("/manifest.json", ShiroType.ANON);
// map.put("/robots.txt", ShiroType.ANON);
// map.put("/precache*", ShiroType.ANON);
// map.put("/service-worker.js", ShiroType.ANON);
// // swagger UI 静态资源
// map.put("/swagger-ui.html",ShiroType.ANON);
// map.put("/doc.html",ShiroType.ANON);
// map.put("/swagger-resources/**",ShiroType.ANON);
// map.put("/webjars/**",ShiroType.ANON);
// map.put("/v2/api-docs",ShiroType.ANON);
// map.put("/v2/api-docs-ext",ShiroType.ANON);
// map.put("/swagger/**",ShiroType.ANON);
// // druid 资源路径
// map.put("/druid/**",ShiroType.ANON);
// 其余路径均拦截
map.put("/**", ShiroType.ANON);
return map;
}
}

View File

@@ -0,0 +1,48 @@
package com.hcframe.es.controller;
import com.hcframe.base.common.ResultVO;
import com.hcframe.es.service.SearchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@RestController
@Api(tags = "ES搜索相关接口")
@RequestMapping("/search")
public class SearchController {
@Resource
SearchService searchService;
@ApiOperation(value = "全文检索接口样例")
@ApiImplicitParams({
@ApiImplicitParam(name = "text", value = "关键词", required = true),
@ApiImplicitParam(name = "pageNum", value = "页码", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", required = true),
@ApiImplicitParam(name = "indexType", value = "索引,以逗号隔开", required = true),
})
@GetMapping("/fulltext")
public ResultVO getFullText(HttpServletRequest request, String text, Integer pageNum, Integer pageSize, String indexType) {
return searchService.getFullText(request, text,pageNum,pageSize,indexType);
}
@ApiOperation(value = "高级检索接口样例")
@ApiImplicitParams({
@ApiImplicitParam(name = "data", value = "查询条件在前端将查询对象通过JSON.toString(obj)方法进行格式化成字符串", required = true),
@ApiImplicitParam(name = "pageNum", value = "页码", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", required = true),
@ApiImplicitParam(name = "index", value = "索引", required = true),
})
@GetMapping("/expertSearch")
public ResultVO expertSearch(HttpServletRequest request,String data,Integer pageNum,Integer pageSize,String index) {
return searchService.expertSearch(request, data, pageNum, pageSize, index);
}
}

View File

@@ -0,0 +1,76 @@
package com.hcframe.es.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;
/**
* (FtUser)实体类
*
* @author lhc
* @since 2020-02-11 19:29:10
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder(toBuilder = true)
@Data
public class FtUser implements Serializable {
private static final long serialVersionUID = 115625188750279606L;
/**
* 主键ID
*/
@Id
@GeneratedValue(
strategy = GenerationType.IDENTITY,
generator = "select USER_ID.nextval from dual")
private Integer userId;
/**
* 用户名
*/
private String username;
/**
* 密码
*/
private String password;
/**
* 手机号
*/
private String phone;
/**
* 用户类型
*/
private Integer userType;
/**
* 启用/禁用
*/
private Integer enabled;
/**
* 用户信息主键
*/
private Integer userInfoId;
/**
* 创建时间
*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 修改时间
*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
private Integer orgId;
}

View File

@@ -0,0 +1,14 @@
package com.hcframe.es.esmapper;
import org.elasticsearch.action.search.SearchResponse;
import java.util.Map;
public interface EsMapper {
SearchResponse fullTextSearch(String text, Integer pageNum, Integer pageSize, String[] indexArr, String[] includeFields, String[] excludeFields);
SearchResponse expertSearch(Map<String, Object> map, Integer pageNum, Integer pageSize, String indexArr, String[] includeFields, String[] excludeFields);
}

View File

@@ -0,0 +1,80 @@
package com.hcframe.es.esmapper.impl;
import com.hcframe.base.common.ServiceException;
import com.hcframe.es.esmapper.EsMapper;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.Map;
@Component
public class EsMapperImpl implements EsMapper {
@Autowired
private RestHighLevelClient client;
@Override
public SearchResponse fullTextSearch(String text, Integer pageNum,
Integer pageSize, String[] indexArr, String[] includeFields,
String[] excludeFields) {
// 设置高亮配置
HighlightBuilder highlightBuilder = new HighlightBuilder();
HighlightBuilder.Field highlight = new HighlightBuilder.Field("*");
highlight.highlighterType("unified");
highlightBuilder.field(highlight);
// 配置搜索条件
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
searchSourceBuilder
.highlighter(highlightBuilder)
.query(QueryBuilders.queryStringQuery(text))
.size(pageSize)
.from((pageNum - 1) * pageSize)
.fetchSource(includeFields,excludeFields);
// 建立搜索Request
SearchRequest searchRequest = new SearchRequest(indexArr);
searchRequest.source(searchSourceBuilder);
try {
// 通过客户端搜索
return client.search(searchRequest, RequestOptions.DEFAULT);
} catch (IOException e) {
e.printStackTrace();
throw new ServiceException("全文检索,全文检索服务器异常");
}
}
@Override
public SearchResponse expertSearch(Map<String, Object> map, Integer pageNum, Integer pageSize, String indexArr, String[] includeFields, String[] excludeFields) {
// 建立联合查询对象
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
// 遍历查询条件map进行模糊查询
for (Map.Entry<String, Object> entry : map.entrySet()) {
String key = entry.getKey();
key = key + ".keyword";
boolQueryBuilder.filter(QueryBuilders.wildcardQuery(key, "*" + entry.getValue() + "*"));
}
// 创建搜索builder对象
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
searchSourceBuilder
.query(boolQueryBuilder)
.size(pageSize)
.from((pageNum - 1) * pageSize)
.fetchSource(includeFields,excludeFields);
SearchRequest searchRequest = new SearchRequest(indexArr);
searchRequest.source(searchSourceBuilder);
try {
return client.search(searchRequest, RequestOptions.DEFAULT);
} catch (IOException e) {
throw new ServiceException("高级检索,全文检索服务器异常");
}
}
}

View File

@@ -0,0 +1,15 @@
package com.hcframe.es.service;
import com.hcframe.base.common.ResultVO;
import javax.servlet.http.HttpServletRequest;
public interface SearchService {
ResultVO getFullText(HttpServletRequest request, String text, Integer pageNum, Integer pageSize, String indexType);
ResultVO expertSearch(HttpServletRequest request, String data, Integer pageNum, Integer pageSize, String indexType);
}

View File

@@ -0,0 +1,98 @@
package com.hcframe.es.service.impl;
import com.alibaba.fastjson.JSON;
import com.hcframe.base.common.ResultVO;
import com.hcframe.es.esmapper.EsMapper;
import com.hcframe.es.service.SearchService;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.common.text.Text;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;
import org.elasticsearch.search.fetch.subphase.highlight.HighlightField;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@Service
public class SearchServiceImpl implements SearchService {
@Resource
EsMapper esMapper;
@Override
public ResultVO getFullText(HttpServletRequest request, String text, Integer pageNum,
Integer pageSize, String indexType) {
// 获取查询索引数组
String[] indexArr = indexType.split(",");
// 返回结果包含字段的数组默认返回全部需要返回全部时必须传null
String[] includeFields = null;
// 返回结果排除的字段数组不排除字段时必须传null
String[] excludeFields = null;
SearchResponse searchResponse = esMapper
.fullTextSearch(text, pageNum, pageSize,
indexArr, includeFields, excludeFields);
// 返回结果
Map<String, Object> resultMap = new HashMap<>(4);
// 返回结果列表
List<Map<String, Object>> list = new LinkedList<>();
// 返回高亮结果列表
List<Map<String, Object>> highLight = new LinkedList<>();
// 返回高亮结果
SearchHits searchHits = searchResponse.getHits();
for (SearchHit searchHit : searchHits) {
// 获取搜索结果转换成map
Map<String, Object> dataMap = searchHit.getSourceAsMap();
// 将map存入返回结果列表
list.add(dataMap);
// 获取高亮字段
Map<String, HighlightField> highlightFields = searchHit.getHighlightFields();
Map<String, Object> highLightMap = new HashMap<>(highlightFields.size());
for (Map.Entry<String, HighlightField> entry : highlightFields.entrySet()) {
HighlightField highlight = highlightFields.get(entry.getKey());
Text[] fragments = highlight.fragments();
String fragmentString = fragments[0].string();
highLightMap.put(entry.getKey(), fragmentString);
}
// 将高亮字段存入高亮List
highLight.add(highLightMap);
}
// 结果列表
resultMap.put("list", list);
// 高亮列表
resultMap.put("highLight", highLight);
// 返回总数
resultMap.put("total", searchHits.getTotalHits());
return ResultVO.getSuccess(resultMap);
}
@Override
public ResultVO expertSearch(HttpServletRequest request, String data, Integer pageNum,
Integer pageSize, String indexType) {
Map<String ,Object> map = JSON.parseObject(data);
// 返回结果包含字段的数组,默认返回全部
String[] includeFields = new String[]{};
// 返回结果排除的字段数组
String[] excludeFields = new String[]{};
// 将查询条件传给es
SearchResponse searchResponse = esMapper.expertSearch(map,pageNum,pageSize,indexType,includeFields,excludeFields);
// 得到返回结果中的查询条件
SearchHits searchHits = searchResponse.getHits();
// 返回结果的List
List<Map<String, Object>> list = new LinkedList<>();
// 遍历返回结果并放入返回结果list中
for (SearchHit searchHit : searchHits) {
list.add(searchHit.getSourceAsMap());
}
// 返回结果Map
Map<String, Object> resultMap = new HashMap<>();
// 将数据放入返回结果Map
resultMap.put("total", searchHits.getTotalHits());
resultMap.put("list", list);
return ResultVO.getSuccess(resultMap);
}
}

View File

@@ -0,0 +1,8 @@
{
"properties": [
{
"name": "spring.data.cluster-nodes",
"type": "java.lang.String",
"description": "Description for spring.data.cluster-nodes."
}
] }

View File

@@ -0,0 +1,115 @@
server:
port: 8080
servlet:
context-path: /es
spring:
cache:
# redis缓存
# type: redis
# redis:
# time-to-live: 1d
# use-key-prefix: true
# cache-null-values: true
# key-prefix: cache.
# ehcache缓存
type: ehcache
ehcache:
config: classpath:ehcache.xml
application:
name: cloud-elasticsearch
elasticsearch:
rest:
# es 地址,如果有多个地址,则逗号隔开
uris: http://192.168.4.119:9200
# 若有用户名密码,在此设置,
username: elastic
password: Y2l70uQ7l3Lu9n2tSIn1Bq39
# 若不使用redis需要注释掉此类信息
redis:
database: 0
host: 192.168.100.145
port: 6379
password: root
lettuce:
pool:
# 连接池中的最大空闲连接 默认8
max-idle: 8
# 连接池中的最小空闲连接 默认0
min-idle: 0
# 连接池最大连接数 默认8 ,负数表示没有限制
max-active: 8
# 连接池最大阻塞等待时间(使用负值表示没有限制) 默认-1
max-wait: -1
timeout: 30000
mvc:
view:
prefix: /templates/
suffix: .html
static-path-pattern: /static/**
datasource:
type: com.alibaba.druid.pool.DruidDataSource
# url: jdbc:mysql://192.168.100.145:3306/common?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
url: jdbc:mysql://127.0.0.1:3306/common?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username: root
password: root
driver-class-name: com.mysql.cj.jdbc.Driver
#使用Druid数据源
initialSize: 5
# 初始化大小,最小,最大
minIdle: 5
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
# 打开PSCache并且指定每个连接上PSCache的大小
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
# 配置监控统计拦截的filters去掉后监控界面sql无法统计'wall'用于防火墙
filters: stat,wall,slf4j
# 通过connectProperties属性来打开mergeSql功能慢SQL记录
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
mybatis:
mapper-locations: classpath*:mapping/**/*.xml
type-aliases-package: com.common.common.entity
logging:
level:
com.common.common.dao : debug
# 是否开启redis 用户登录若开启此项需要配置redis节点及相关配置若不开启需要注释掉redis相关配置信息
isRedisLogin: false
# 用户登陆超时设置单位为小时此值不能为0
login-time-out: 4
# swagger配置
swagger:
# 配置controller包路径
path: com.common.common.controller
# 是否开启权限
enableAuth: false
# 用户名
username: admin
# 密码
password: admin
# Druid连接配置
druid:
# Druid用户名
username: test
# Druid密码
password: test
# Druid 允许访问的IP,默认全部允许
# allow: 127.0.0.1
# Druid 拒绝访问的IP,默认不拒绝全部
# deny: 10.0.0.2
# 是否开启controller日志监控
show-controller-log: false
eureka:
client:
service-url:
defaultZone: http://admin:123456@192.168.4.119:8080/eureka/

View File

@@ -0,0 +1,25 @@
__ __ ______ ______
| \ | \ / \ / \
| $$ | $$| $$$$$$\ | $$$$$$\ ______ ______ ______ ____ ______
| $$__| $$| $$ \$$ | $$_ \$$/ \ | \ | \ \ / \
| $$ $$| $$ | $$ \ | $$$$$$\ \$$$$$$\| $$$$$$\$$$$\| $$$$$$\
| $$$$$$$$| $$ __ | $$$$ | $$ \$$/ $$| $$ | $$ | $$| $$ $$
| $$ | $$| $$__/ \ | $$ | $$ | $$$$$$$| $$ | $$ | $$| $$$$$$$$ __
| $$ | $$ \$$ $$ | $$ | $$ \$$ $$| $$ | $$ | $$ \$$ \| \
\$$ \$$ \$$$$$$ \$$ \$$ \$$$$$$$ \$$ \$$ \$$ \$$$$$$$ \$$
__ __ _______ __ __
| \ | \ | \ | \ | \
| $$\ | $$ ______ | $$$$$$$\ __ __ ______ | $$ | $$ ______ ______ ______
| $$$\| $$ / \ | $$__/ $$| \ | \ / \ | $$__| $$ / \ / \ / \
| $$$$\ $$| $$$$$$\ | $$ $$| $$ | $$| $$$$$$\ | $$ $$| $$$$$$\| $$$$$$\| $$$$$$\
| $$\$$ $$| $$ | $$ | $$$$$$$\| $$ | $$| $$ | $$ | $$$$$$$$| $$ | $$| $$ | $$| $$ $$
| $$ \$$$$| $$__/ $$ | $$__/ $$| $$__/ $$| $$__| $$ | $$ | $$| $$__/ $$| $$__/ $$| $$$$$$$$ __
| $$ \$$$ \$$ $$ | $$ $$ \$$ $$ \$$ $$ | $$ | $$ \$$ $$| $$ $$ \$$ \| \
\$$ \$$ \$$$$$$ \$$$$$$$ \$$$$$$ _\$$$$$$$ \$$ \$$ \$$$$$$ | $$$$$$$ \$$$$$$$ \$$
| \__| $$ | $$
\$$ $$ | $$
\$$$$$$ \$$

View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation = "http://ehcache.org/ehcache.xsd"
updateCheck = "false">
<!-- 指定一个文件目录当EHCache把数据写到硬盘上时将把数据写到这个文件目录下 -->
<diskStore path = "java.io.tmpdir"/>
<!-- 默认的管理策略 -->
<defaultCache
eternal = "false"
maxElementsInMemory = "10000"
overflowToDisk = "true"
diskPersistent = "false"
timeToIdleSeconds = "120"
timeToLiveSeconds = "120"
diskExpiryThreadIntervalSeconds = "120"
memoryStoreEvictionPolicy = "LRU"/>
<!-- 此缓存最多可以存活timeToLiveSeconds秒如果期间超过timeToIdleSeconds秒未访问缓存失效 -->
<cache
name = "tableCache"
eternal = "false"
maxElementsInMemory = "10000"
overflowToDisk = "true"
diskPersistent = "false"
timeToIdleSeconds = "120"
timeToLiveSeconds = "180"
memoryStoreEvictionPolicy = "LRU"/>
<cache
name = "baseCache"
eternal = "false"
maxElementsInMemory = "10000"
overflowToDisk = "true"
diskPersistent = "false"
timeToIdleSeconds = "120"
timeToLiveSeconds = "180"
memoryStoreEvictionPolicy = "LRU"/>
<cache
name = "datasourceCache"
eternal = "true"
maxElementsInMemory = "10000"
overflowToDisk = "true"
diskPersistent = "false"
timeToIdleSeconds = "120"
timeToLiveSeconds = "180"
memoryStoreEvictionPolicy = "LRU"/>
<!-- maxElementsInMemory 内存中最大缓存对象数看着自己的heap大小来搞 -->
<!-- eternaltrue表示对象永不过期此时会忽略timeToIdleSeconds和timeToLiveSeconds属性默认为false -->
<!-- maxElementsOnDisk硬盘中最大缓存对象数若是0表示无穷大 -->
<!-- overflowToDisktrue表示当内存缓存的对象数目达到了maxElementsInMemory界限后
会把溢出的对象写到硬盘缓存中。注意如果缓存的对象要写入到硬盘中的话则该对象必须实现了Serializable接口才行。-->
<!-- diskSpoolBufferSizeMB磁盘缓存区大小默认为30MB。每个Cache都应该有自己的一个缓存区。-->
<!-- diskPersistent是否缓存虚拟机重启期数据 -->
<!-- diskExpiryThreadIntervalSeconds磁盘失效线程运行时间间隔默认为120秒 -->
<!-- timeToIdleSeconds 设定允许对象处于空闲状态的最长时间,以秒为单位。当对象自从最近一次被访问后,
如果处于空闲状态的时间超过了timeToIdleSeconds属性值这个对象就会过期
EHCache将把它从缓存中清空。只有当eternal属性为false该属性才有效。如果该属性值为0
则表示对象可以无限期地处于空闲状态 -->
<!-- timeToLiveSeconds设定对象允许存在于缓存中的最长时间以秒为单位。当对象自从被存放到缓存中后
如果处于缓存中的时间超过了 timeToLiveSeconds属性值这个对象就会过期
EHCache将把它从缓存中清除。只有当eternal属性为false该属性才有效。如果该属性值为0
则表示对象可以无限期地存在于缓存中。timeToLiveSeconds必须大于timeToIdleSeconds属性才有意义 -->
<!-- memoryStoreEvictionPolicy当达到maxElementsInMemory限制时
Ehcache将会根据指定的策略去清理内存。可选策略有LRU最近最少使用默认策略
FIFO先进先出、LFU最少访问次数-->
</ehcache>

View File

@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<!-- mysql数据库-->
<classPathEntry location="C:\Users\wewe\Desktop\Dm7JdbcDriver18.jar"/>
<!-- mysql数据库-->
<!-- <classPathEntry location="/Users/mac/.m2/repository/mysql/mysql-connector-java/8.0.15/mysql-connector-java-8.0.15.jar"/>-->
<!-- oracle 数据库 -->
<!-- <classPathEntry location="/Users/mac/IdeaProjects/transdata/lib/ojdbc6.jar"/>-->
<context id="DB2Tables" targetRuntime="MyBatis3">
<commentGenerator>
<!-- 是否去除自动生成的注释 -->
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<!-- DM数据库连接的信息驱动类、连接地址、用户名、密码 -->
<jdbcConnection driverClass="dm.jdbc.driver.DmDriver"
connectionURL="jdbc:dm://192.168.100.179:5236/COLLECT"
userId="COLLECT"
password="123456789">
</jdbcConnection>
<!-- Mysql数据库连接的信息驱动类、连接地址、用户名、密码 -->
<!--
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://192.168.100.145:3306/scweb_op"
userId="root"
password="root">
</jdbcConnection> -->
<!-- Oracle数据库-->
<!-- <jdbcConnection driverClass="oracle.jdbc.OracleDriver"-->
<!-- connectionURL="jdbc:oracle:thin://@192.168.100.232:1521/orcl.oracle11g"-->
<!-- userId="cast"-->
<!-- password="123456">-->
<!-- </jdbcConnection>-->
<!-- 默认为false把JDBC DECIMAL 和NUMERIC类型解析为Integer为true时
把JDBC DECIMAL 和NUMERIC类型解析为java.math.BigDecimal -->
<javaTypeResolver >
<property name="forceBigDecimals" value="true" />
</javaTypeResolver>
<!-- targetProject生成POJO类的位置 -->
<!-- msyql-->
<javaModelGenerator targetPackage="com.collection.collection.entity" targetProject="./src/main/java">
<!-- oracle-->
<!-- <javaModelGenerator targetPackage="com.castmember.transdata.pojo.oldPojo" targetProject="./src/main/java">-->
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
<!-- 从数据库返回的值被清理前后的空格 -->
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- targetProjectmapper映射文件生成的位置 -->
<!-- mysql-->
<sqlMapGenerator targetPackage="mapping" targetProject="./src/main/resources">
<!-- oracle-->
<!-- <sqlMapGenerator targetPackage="mapping.olddata" targetProject="./src/main/resources">-->
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
</sqlMapGenerator>
<!-- targetProjectmapper接口生成的的位置 -->
<!-- mysql-->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.collection.collection.dao" targetProject="./src/main/java">
<!-- oracle-->
<!-- <javaClientGenerator type="XMLMAPPER" targetPackage="com.castmember.transdata.dao.olddata" targetProject="./src/main/java">-->
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
</javaClientGenerator>
<!-- 指定数据表 -->
<!-- <table schema="" tableName="SJZY_ATM_COMMON_RU_TASK"></table>
<table schema="" tableName="SJZY_ATM_COMMON_HI_TASK"></table>
<table schema="" tableName="SJZY_ATM_COMMON_FILE"></table>
<table schema="" tableName="SJZY_ATM_COMMON_COMMENT"></table>
<table schema="" tableName="SJZY_ATM_COMMON_RU_DELEGATE"></table>
<table schema="" tableName="SJZY_ATM_COMMON_HI_DELEGATE"></table>
<table schema="" tableName="SJZY_ATM_COMMON_DELEGATE_LOG"></table>
<table schema="" tableName="SJZY_ATM_GATHER_PROCESS"></table>
<table schema="" tableName="SJZY_ATM_GATHER_TASK"></table> -->
<table schema="" tableName="SJZY_ATM_GATHER_LIST_PROCESS"></table>
<table schema="" tableName="SJZY_ATM_GATHER_LIST_TASK"></table>
<!-- <table schema="" tableName="SJZY_ATM_SEARCH_PROCESS"></table>
<table schema="" tableName="SJZY_ATM_SEARCH_TASK"></table>
<table schema="" tableName="SJZY_ATM_SEARCH_LIST_PROCESS"></table>
<table schema="" tableName="SJZY_ATM_SEARCH_LIST_TASK"></table>
<table schema="" tableName="SJZY_ATM_USE_PROCESS"></table>
<table schema="" tableName="SJZY_ATM_USE_TASK"></table>
<table schema="" tableName="SJZY_ATM_USE_LIST_PROCESS"></table>
<table schema="" tableName="SJZY_ATM_USE_LIST_TASK"></table>
<table schema="" tableName="SJZY_BASE_POSITION"></table>
<table schema="" tableName="SJZY_BASE_RESOURCETYPE"></table>
<table schema="" tableName="SJZY_ORG"></table>
<table schema="" tableName="SJZY_USER"></table> -->
<!-- 有些表的字段需要指定java类型
<table schema="DB2ADMIN" tableName="ALLTYPES" domainObjectName="Customer" >
<property name="useActualColumnNames" value="true"/>
<generatedKey column="ID" sqlStatement="DB2" identity="true" />
<columnOverride column="DATE_FIELD" property="startDate" />
<ignoreColumn column="FRED" />
<columnOverride column="LONG_VARCHAR_FIELD" jdbcType="VARCHAR" />
</table> -->
</context>
</generatorConfiguration>

View File

@@ -0,0 +1,36 @@
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>parent</artifactId>
<groupId>com.hcframe</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hcframe-starter</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@@ -22,19 +22,9 @@
<version>1.2.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
<groupId>com.hcframe</groupId>
<artifactId>hcframe-starter</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>

View File

@@ -17,6 +17,9 @@
<module>hcframe-base</module>
<module>hcframe-user</module>
<module>storage</module>
<module>hcframe-activiti</module>
<module>hcframe-es</module>
<module>hcframe-starter</module>
</modules>
<properties>
<maven.compiler.source>8</maven.compiler.source>
@@ -25,15 +28,4 @@
<dependencies>
</dependencies>
<build>
<!-- <plugins>-->
<!-- <plugin>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <includeSystemScope>true</includeSystemScope>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- </plugins>-->
</build>
</project>

BIN
lib/Dm7JdbcDriver18.jar Normal file

Binary file not shown.

BIN
lib/ojdbc6.jar Normal file

Binary file not shown.