提交 99a89b3a authored 作者: 黄夏豪's avatar 黄夏豪

[项目总体] 1.修改了项目中部分拼写错误的文件夹名

[项目总体] 2.优化项目中的包结构 [项目总体] 3.新增了README.md
上级 84ac5a5c
# 工作流项目核心
## 项目简介
### 环境要求
- Maven3+
- Jdk1.8+
- springboot 2.4.1 以下 2.1.4 以上 (包含所提到的版本)
### 代码结构
```
├─src
│ ├─main
│ │ ├─java
│ │ │ └─com
│ │ │ └─tykj
│ │ │ └─workflowcore
│ │ │ ├─api
│ │ │ ├─base --系统基础模块
│ │ │ │ ├─annotations --注解类
│ │ │ │ ├─aop
│ │ │ │ ├─config
│ │ │ │ ├─entity
│ │ │ │ ├─page
│ │ │ │ ├─result
│ │ │ │ └─util
│ │ │ ├─model_layer --数据模型
│ │ │ │ ├─annotations
│ │ │ │ ├─controller
│ │ │ │ ├─dao
│ │ │ │ ├─entity
│ │ │ │ │ └─vo
│ │ │ │ ├─service
│ │ │ │ │ └─impl
│ │ │ │ ├─util
│ │ │ ├─workflow_editor --工作流编辑器
│ │ │ │ ├─config
│ │ │ │ ├─controller
│ │ │ │ ├─dao
│ │ │ │ ├─entity
│ │ │ │ │ └─vo
│ │ │ │ ├─enums
│ │ │ │ ├─listener
│ │ │ │ ├─service
│ │ │ │ │ └─impl
│ │ │ │ ├─util
│ │ │ └─WorkflowCoreApplication --SpringBoot启动类
│ │ └─resources --核心配置所在位置
│ │ ├─mapper
│ │ ├─template
│ │ └─ui
│ │ └─images
│ └─test
│ └─java
│ └─org
│ └─yaukie
│ └─frame --核心逻辑所在位置
```
## 使用方式
### 安装
#### maven
```
<dependency>
<groupId>com.tykj</groupId>
<artifactId>workflow-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
```
#### 本地引入
1. 获取 workflow-core-0.0.1-SNAPSHOT.jar
2. 在你自己项目的根目录下创建lib文件夹 并将 jar 包放入
3. pom 添加 如下
```
<dependency>
<groupId>com.tykj</groupId>
<artifactId>workflow-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${basedir}/lib/workflow-core-0.0.1-SNAPSHOT.jar</systemPath>
</dependency>
```
### 调用
1. 在springboot 启动类上添加注解 @EnableWorkFlowCore
```
@EnableWorkFlowCore
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(WorkflowCoreApplication.class, args);
}
}
```
2. 如需要使用工作流的审批人功能请实现 UserService
例如:
```
@Service
@Primary
public class FlowUserServiceImpl implements UserService {
@Override
public WorkFlowUser getCurrentUser() {
WorkFlowUser workFlowUser = new WorkFlowUser();
workFlowUser.setId(1L);
workFlowUser.setUserName("张三");
return workFlowUser;
}
@Override
public List<WorkFlowUser> getAllUser() {
List<WorkFlowUser> workFlowUsers = new ArrayList<>();
for (int i = 0; i < 10; i++) {
WorkFlowUser workFlowUser = new WorkFlowUser();
workFlowUser.setUserName("张1");
workFlowUser.setId((long) i);
workFlowUsers.add(workFlowUser);
}
return workFlowUsers;
}
@Override
public List<WorkFlowRole> getAllRole(String roleType) {
List<WorkFlowRole> workFlowUsers = new ArrayList<>();
if (roleType.equals("department")){
workFlowUsers.add(new WorkFlowRole("开发部","department","1"));
workFlowUsers.add(new WorkFlowRole("运营部","department","2"));
workFlowUsers.add(new WorkFlowRole("测试部","department","3"));
}else {
workFlowUsers.add(new WorkFlowRole("管理员","role","1"));
workFlowUsers.add(new WorkFlowRole("普通用户","role","2"));
workFlowUsers.add(new WorkFlowRole("运维人员","role","3"));
}
return workFlowUsers;
}
@Override
public List<WorkFlowRoleType> getRoleType() {
List<WorkFlowRoleType> workFlowRoleTypes = new ArrayList<>();
workFlowRoleTypes.add(new WorkFlowRoleType("部门","department"));
workFlowRoleTypes.add(new WorkFlowRoleType("角色","role"));
return workFlowRoleTypes;
}
}
```
package com.tykj.workflowcore;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
/**
* 这个类里面配置了当项目被启动后需要扫描的包
* @author HuangXiahao
* @version V1.0
* @class WorkFlowCoreConfiger
* @packageName com.tykj.workflwcore.union
**/
@Configuration
@ComponentScan(
basePackages = {"com.tykj.*"}
)
public class WorkFlowCoreConfigure {
public WorkFlowCoreConfigure() {
}
}
......@@ -10,7 +10,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class WorkflowCoreApplication {
public static void main(String[] args) {
SpringApplication.run(WorkflowCoreApplication.class, args);
}
......
package com.tykj.workflowcore.annotation;
package com.tykj.workflowcore.base.annotations;
import com.tykj.workflowcore.WorkFlowCoreConfigure;
import com.tykj.workflowcore.base.config.WorkflowCoreRunner;
import org.springframework.context.annotation.Import;
import java.lang.annotation.*;
......@@ -11,6 +11,6 @@ import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
@Documented
@Import({WorkFlowCoreConfigure.class})
@Import({WorkflowCoreRunner.class})
public @interface EnableWorkFlowCore {
}
......@@ -21,11 +21,13 @@ public class EntityHandle {
public void checkTimes(JoinPoint point) {
Object[] args = point.getArgs();
for (Object arg : args) {
BaseEntity entity = (BaseEntity) arg;
if (isNull(entity.getCreatedTime())){
entity.setCreatedTime(new Date());
if (arg instanceof BaseEntity){
BaseEntity entity = (BaseEntity) arg;
if (isNull(entity.getCreatedTime())){
entity.setCreatedTime(new Date());
}
entity.setUpdatedTime(new Date());
}
entity.setUpdatedTime(new Date());
}
}
......
package com.tykj.workflowcore.config;
package com.tykj.workflowcore.base.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
......@@ -31,6 +30,11 @@ public WebMvcConfigurer corsConfigurer() {
.maxAge(3600);
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/xml/**")
.addResourceLocations("file:"+System.getProperty("user.dir")+"\\xml\\");
}
};
}
......
package com.tykj.workflowcore;
package com.tykj.workflowcore.base.config;
import com.tykj.workflowcore.model_layer.service.ModelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import java.io.File;
......@@ -19,7 +22,10 @@ import java.util.List;
* @class Comm
* @packageName com.tykj.workflwcore
**/
@Component
@Configuration
@ComponentScan(
basePackages = {"com.tykj.*"}
)
public class WorkflowCoreRunner implements CommandLineRunner {
@Autowired
......
package com.tykj.workflowcore.model_layer.annotatiion;
package com.tykj.workflowcore.model_layer.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
......
......@@ -3,10 +3,10 @@ package com.tykj.workflowcore.model_layer.controller;
import com.tykj.workflowcore.base.result.ResultUtil;
import com.tykj.workflowcore.model_layer.model.QueryCondition;
import com.tykj.workflowcore.model_layer.model.SearchTableInfoVo;
import com.tykj.workflowcore.model_layer.model.TableInfo;
import com.tykj.workflowcore.model_layer.model.TableVO;
import com.tykj.workflowcore.model_layer.entity.vo.QueryCondition;
import com.tykj.workflowcore.model_layer.entity.vo.SearchTableInfoVo;
import com.tykj.workflowcore.model_layer.entity.TableInfo;
import com.tykj.workflowcore.model_layer.entity.vo.TableVO;
import com.tykj.workflowcore.model_layer.service.ModelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......
package com.tykj.workflowcore.model_layer.dao;
import com.tykj.workflowcore.model_layer.model.ColumnInfo;
import com.tykj.workflowcore.model_layer.entity.ColumnInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
......@@ -12,5 +12,5 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
* @Date 2021/2/24 11:22
* @Version 1.0
*/
public interface ColumnInfoDao extends JpaRepository<ColumnInfo,Long>, JpaSpecificationExecutor<ColumnInfo> {
public interface ColumnInfoDao extends JpaRepository<ColumnInfo,Integer>, JpaSpecificationExecutor<ColumnInfo> {
}
package com.tykj.workflowcore.model_layer.dao;
import com.tykj.workflowcore.model_layer.model.TableInfo;
import com.tykj.workflowcore.model_layer.entity.TableInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
......@@ -12,6 +12,6 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
* @Date 2021/2/24 11:20
* @Version 1.0
*/
public interface TableInfoDao extends JpaRepository<TableInfo,Long>, JpaSpecificationExecutor<TableInfo> {
public interface TableInfoDao extends JpaRepository<TableInfo,Integer>, JpaSpecificationExecutor<TableInfo> {
}
package com.tykj.workflowcore.model_layer.model;
package com.tykj.workflowcore.model_layer.entity;
import com.tykj.workflowcore.base.entity.BaseEntity;
import com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan;
import com.tykj.workflowcore.model_layer.annotations.WorkFlowCoreNoScan;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
package com.tykj.workflowcore.model_layer.model;
package com.tykj.workflowcore.model_layer.entity;
import com.tykj.workflowcore.base.entity.BaseEntity;
import com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan;
import com.tykj.workflowcore.model_layer.annotations.WorkFlowCoreNoScan;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.*;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import javax.persistence.Entity;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
/**
* @ClassName TableInfo
......
package com.tykj.workflowcore.model_layer.model;
package com.tykj.workflowcore.model_layer.entity.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......
package com.tykj.workflowcore.model_layer.model;
package com.tykj.workflowcore.model_layer.entity.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
......
package com.tykj.workflowcore.model_layer.model;
package com.tykj.workflowcore.model_layer.entity.vo;
import com.tykj.workflowcore.base.page.JpaCustomPage;
import lombok.AllArgsConstructor;
......
package com.tykj.workflowcore.model_layer.service;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.tykj.workflowcore.model_layer.model.*;
import com.tykj.workflowcore.model_layer.entity.*;
import com.tykj.workflowcore.model_layer.entity.vo.QueryCondition;
import com.tykj.workflowcore.model_layer.entity.vo.SearchTableInfoVo;
import com.tykj.workflowcore.model_layer.entity.vo.TableVO;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.sql.SQLException;
......
......@@ -4,12 +4,16 @@ import cn.hutool.db.Db;
import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications;
import com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan;
import com.tykj.workflowcore.model_layer.annotations.WorkFlowCoreNoScan;
import com.tykj.workflowcore.model_layer.dao.ColumnInfoDao;
import com.tykj.workflowcore.model_layer.dao.TableInfoDao;
import com.tykj.workflowcore.model_layer.model.*;
import com.tykj.workflowcore.model_layer.entity.*;
import com.tykj.workflowcore.model_layer.entity.vo.ColumnVO;
import com.tykj.workflowcore.model_layer.entity.vo.QueryCondition;
import com.tykj.workflowcore.model_layer.entity.vo.SearchTableInfoVo;
import com.tykj.workflowcore.model_layer.entity.vo.TableVO;
import com.tykj.workflowcore.model_layer.service.ModelService;
import com.tykj.workflowcore.model_layer.utils.CreatTableUtil;
import com.tykj.workflowcore.model_layer.utils.CreateTableUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.extern.slf4j.Slf4j;
......@@ -25,13 +29,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.Entity;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Id;
import javax.persistence.criteria.*;
import java.lang.reflect.Field;
......@@ -40,7 +42,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import static com.tykj.workflowcore.model_layer.utils.CreatTableUtil.*;
import static com.tykj.workflowcore.model_layer.utils.CreateTableUtil.*;
import static com.tykj.workflowcore.model_layer.utils.HqlUtil.createQuery;
......@@ -105,7 +107,7 @@ public class ModelImpl implements ModelService {
/**
* @param tableVO
* @return com.tykj.workflowcore.model_layer.model.TableVO
* @return com.tykj.workflowcore.model_layer.model.vo.TableVO
* @Author WWW
* @Description 新建一张表
* @Date 16:16 2021/3/5
......@@ -113,9 +115,9 @@ public class ModelImpl implements ModelService {
@Override
public TableVO newTable(TableVO tableVO) {
String xmlMapping = creatTable(tableVO);
CreatTableUtil creatTableUtil = new CreatTableUtil();
Session session = creatTableUtil.getSession(entityManagerFactory, xmlMapping);
String xmlMapping = createTable(tableVO);
CreateTableUtil createTableUtil = new CreateTableUtil();
Session session = createTableUtil.getSession(entityManagerFactory, xmlMapping);
List<ColumnVO> dataList = tableVO.getDataList();
TableInfo tableInfo = new TableInfo();
......@@ -189,8 +191,8 @@ public class ModelImpl implements ModelService {
* @Date 16:17 2021/3/5
**/
public void insertValue(String tableName, String xml, Map map) {
CreatTableUtil creatTableUtil = new CreatTableUtil();
Session newSession = creatTableUtil.getSession(entityManagerFactory, xml);
CreateTableUtil createTableUtil = new CreateTableUtil();
Session newSession = createTableUtil.getSession(entityManagerFactory, xml);
SessionImpl session = (SessionImpl) newSession;
EntityPersister entityPersister = session.getEntityPersister(tableName, map);
Type[] propertyTypes = entityPersister.getPropertyTypes();
......@@ -285,7 +287,7 @@ public class ModelImpl implements ModelService {
list.add(columnVO);
}
tableVO.setDataList(list);
String xml = creatTable(tableVO);
String xml = createTable(tableVO);
tableInfo.setName(tableVO.getModelName());
tableInfo.setCnName(tableVO.getModelTitle());
tableInfo.setXml(xml);
......
package com.tykj.workflowcore.model_layer.utils;
import cn.hutool.json.XML;
import com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan;
import com.tykj.workflowcore.model_layer.model.ColumnVO;
import com.tykj.workflowcore.model_layer.model.TableInfo;
import com.tykj.workflowcore.model_layer.model.TableVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.tykj.workflowcore.model_layer.entity.vo.ColumnVO;
import com.tykj.workflowcore.model_layer.entity.vo.TableVO;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.boot.Metadata;
......@@ -16,24 +11,20 @@ import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.tool.hbm2ddl.SchemaUpdate;
import org.hibernate.tool.schema.TargetType;
import javax.persistence.Entity;
import javax.persistence.EntityManagerFactory;
import java.io.ByteArrayInputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
/**
* @ClassName CreatTableUtil
* @ClassName CreateTableUtil
* @Description TODO
* @Author WWW
* @Date 2021/3/1 14:35
* @Version 1.0
*/
public class CreatTableUtil {
public static String creatTable(TableVO tableVO){
public class CreateTableUtil {
public static String createTable(TableVO tableVO){
List<ColumnVO> dataList = tableVO.getDataList();
String xmlMapping = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<!DOCTYPE hibernate-mapping PUBLIC\n" +
......@@ -42,7 +33,7 @@ public class CreatTableUtil {
"<hibernate-mapping>\n" +
" <class entity-name=\"" + tableVO.getModelName() + "\" table=\"" + tableVO.getModelName() + "\">\n";
xmlMapping += " <id name=\"id\" type=\"java.lang.Long\" length=\"64\" unsaved-value=\"null\">\n" +
xmlMapping += " <id name=\"id\" type=\"java.lang.Integer\" length=\"64\" unsaved-value=\"null\">\n" +
" <generator class=\"identity\" />\n" +
" </id>";
for (ColumnVO columnVO : dataList) {
......
package com.tykj.workflowcore.model_layer.utils;
import com.tykj.workflowcore.model_layer.model.QueryCondition;
import com.tykj.workflowcore.model_layer.entity.vo.QueryCondition;
import java.util.List;
import java.util.Objects;
......
package com.tykj.workflowcore.workflow_editer.controller;
import com.tykj.workflowcore.base.result.ResultObj;
import com.tykj.workflowcore.base.result.ResultUtil;
import com.tykj.workflowcore.workflow_editer.entity.FlowsInfo;
import com.tykj.workflowcore.workflow_editer.entity.VariableStorage;
import com.tykj.workflowcore.workflow_editer.entity.vo.SearchFlowInfoVo;
import com.tykj.workflowcore.workflow_editer.entity.vo.VariableStorageVo;
import com.tykj.workflowcore.workflow_editer.service.*;
import com.tykj.workflowcore.workflow_editer.vo.DeployedVo;
import com.tykj.workflowcore.workflow_editer.vo.FlowsInfoVo;
import com.tykj.workflowcore.workflow_editer.vo.PageVo;
import com.tykj.workflowcore.workflow_editer.entity.vo.FlowsInfoVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
/**
......
package com.tykj.workflowcore.workflow_editer.controller;
import com.tykj.workflowcore.base.result.ResultObj;
import com.tykj.workflowcore.base.result.ResultUtil;
import com.tykj.workflowcore.model_layer.model.TableInfo;
import com.tykj.workflowcore.model_layer.entity.TableInfo;
import com.tykj.workflowcore.workflow_editer.entity.FormPage;
//import com.tykj.workflowcore.workflow_editer.entity.PageEntity;
import com.tykj.workflowcore.workflow_editer.service.FormPageService;
//import com.tykj.workflowcore.workflow_editer.service.PageEntityService;
import com.tykj.workflowcore.workflow_editer.vo.InFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.OutFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.PageFormPageVo;
import com.tykj.workflowcore.workflow_editer.entity.vo.InFormPageVo;
import com.tykj.workflowcore.workflow_editer.entity.vo.PageFormPageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
......@@ -53,7 +50,7 @@ public class FormPageController {
}
@ApiOperation("回显页面")
@GetMapping("/EchoPage")
public FormPage EchoPage(Long id){
public FormPage EchoPage(Integer id){
return formPageService.getPage(id);
}
......@@ -66,13 +63,13 @@ public class FormPageController {
@ApiOperation("删除页面")
@DeleteMapping("deletePage")
public ResponseEntity deletePage(Long id){
public ResponseEntity deletePage(Integer id){
formPageService.deletePage(id);
return ResultUtil.success("删除页面成功");
}
@PostMapping("/findByPages")
public List<TableInfo> findByPages(@RequestBody List<Long> pageIds){
public List<TableInfo> findByPages(@RequestBody List<Integer> pageIds){
return formPageService.findByPageIds(pageIds);
}
......
package com.tykj.workflowcore.workflow_editer.controller;
import com.tykj.workflowcore.api.entity.InvokeRequest;
import com.tykj.workflowcore.base.result.ResultUtil;
import com.tykj.workflowcore.workflow_editer.entity.FlowsInfo;
import com.tykj.workflowcore.workflow_editer.entity.vo.*;
import com.tykj.workflowcore.workflow_editer.service.FlowInfoService;
import com.tykj.workflowcore.workflow_editer.service.WorkFlowService;
import com.tykj.workflowcore.workflow_editer.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.flowable.task.api.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;
import java.util.Map;
......
package com.tykj.workflowcore.workflow_editer.mapper;
package com.tykj.workflowcore.workflow_editer.dao;
import com.tykj.workflowcore.workflow_editer.entity.FlowsInfo;
......
package com.tykj.workflowcore.workflow_editer.mapper;
package com.tykj.workflowcore.workflow_editer.dao;
import com.tykj.workflowcore.workflow_editer.entity.FormPage;
import org.springframework.data.jpa.repository.JpaRepository;
......@@ -12,7 +12,7 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
*
* @Author: zsp
*/
public interface FormPageMapper extends JpaRepository<FormPage,Long> , JpaSpecificationExecutor<FormPage> {
public interface FormPageMapper extends JpaRepository<FormPage,Integer> , JpaSpecificationExecutor<FormPage> {
//增删改查
}
package com.tykj.workflowcore.workflow_editer.mapper;
package com.tykj.workflowcore.workflow_editer.dao;
import com.tykj.workflowcore.workflow_editer.entity.NodeInfo;
import org.springframework.data.jpa.repository.JpaRepository;
......@@ -12,14 +12,14 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
*
* @Author: zsp
*/
public interface NodePageMapper extends JpaRepository<NodeInfo,Long>, JpaSpecificationExecutor<NodeInfo> {
public interface NodePageMapper extends JpaRepository<NodeInfo,Integer>, JpaSpecificationExecutor<NodeInfo> {
/**
* 通过节点id得到pageId
* @param nodeId 节点id
* @return 返回页面id
*/
Long findByNodeId(String nodeId);
Integer findByNodeId(String nodeId);
}
package com.tykj.workflowcore.workflow_editer.mapper;
package com.tykj.workflowcore.workflow_editer.dao;
import com.tykj.workflowcore.workflow_editer.entity.VariableStorage;
import org.springframework.data.jpa.repository.JpaRepository;
......@@ -14,7 +14,7 @@ import java.util.List;
*
* @Author: zsp
*/
public interface VariableStorageMapper extends JpaRepository<VariableStorage,Long>, JpaSpecificationExecutor<VariableStorage> {
public interface VariableStorageMapper extends JpaRepository<VariableStorage,Integer>, JpaSpecificationExecutor<VariableStorage> {
/**
* 通过流程主键获取变量池
......
package com.tykj.workflowcore.workflow_editer.entity;
import com.tykj.workflowcore.base.entity.BaseEntity;
import com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan;
import com.tykj.workflowcore.model_layer.annotations.WorkFlowCoreNoScan;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -11,10 +11,6 @@ import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Date;
/**
* ClassName: FlowsInfo
......@@ -35,10 +31,10 @@ import java.util.Date;
public class FlowsInfo extends BaseEntity {
@ApiModelProperty("发起人的Id")
private Long userId;
private Integer userId;
@ApiModelProperty("发起人的名字")
private Long userName;
private String userName;
@ApiModelProperty("流程名称")
private String flowName;
......
package com.tykj.workflowcore.workflow_editer.entity;
import com.tykj.workflowcore.base.entity.BaseEntity;
import com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan;
import com.tykj.workflowcore.workflow_editer.vo.InFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.OutFormPageVo;
import com.tykj.workflowcore.model_layer.annotations.WorkFlowCoreNoScan;
import com.tykj.workflowcore.workflow_editer.entity.vo.OutFormPageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......
package com.tykj.workflowcore.workflow_editer.entity;
import com.tykj.workflowcore.base.entity.BaseEntity;
import com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan;
import com.tykj.workflowcore.model_layer.annotations.WorkFlowCoreNoScan;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -9,9 +9,6 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
/**
* ClassName: NodePage
......@@ -34,7 +31,7 @@ public class NodeInfo extends BaseEntity {
private String nodeId;
@ApiModelProperty("页面id")
private long pageId;
private Integer pageId;
@ApiModelProperty("流程key")
private String flowKey;
......
package com.tykj.workflowcore.workflow_editer.entity;
import com.tykj.workflowcore.base.entity.BaseEntity;
import com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan;
import com.tykj.workflowcore.model_layer.annotations.WorkFlowCoreNoScan;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
/**
* ClassName: VariableStorage
......
......@@ -25,7 +25,7 @@ import java.io.Serializable;
@Api("用户表")
public class WorkFlowUser implements Serializable {
private Long id;
private Integer id;
private String userName;
......
package com.tykj.workflowcore.workflow_editer.vo;
package com.tykj.workflowcore.workflow_editer.entity.vo;
import io.swagger.annotations.ApiModelProperty;
......@@ -24,7 +24,7 @@ public class DeployedVo {
private FlowsInfoVo flowsInfoVo;
@ApiModelProperty("节点的第一个绑定的页面id")
private Long pageId;
private Integer pageId;
@ApiModelProperty("流程主键")
private String flowKey;
......
package com.tykj.workflowcore.workflow_editer.vo;
package com.tykj.workflowcore.workflow_editer.entity.vo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
......
package com.tykj.workflowcore.workflow_editer.vo;
package com.tykj.workflowcore.workflow_editer.entity.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.workflowcore.workflow_editer.entity.FlowsInfo;
......@@ -29,7 +29,7 @@ public class FlowsInfoVo {
private Integer id;
@ApiModelProperty("发起人的名字")
private Long userName;
private Integer userName;
@ApiModelProperty("流程名称")
private String flowName;
......
package com.tykj.workflowcore.workflow_editer.vo;
package com.tykj.workflowcore.workflow_editer.entity.vo;
import com.tykj.workflowcore.workflow_editer.entity.FormPage;
import io.swagger.annotations.ApiModelProperty;
......@@ -25,7 +25,8 @@ import java.util.List;
public class InFormPageVo {
@ApiModelProperty("页面id")
private Long id;
private Integer id;
@ApiModelProperty("页面名称")
private String pageName;
......
package com.tykj.workflowcore.workflow_editer.vo;
package com.tykj.workflowcore.workflow_editer.entity.vo;
import com.tykj.workflowcore.api.entity.InvokeRequest;
import com.tykj.workflowcore.api.entity.Parameter;
......
package com.tykj.workflowcore.workflow_editer.vo;
package com.tykj.workflowcore.workflow_editer.entity.vo;
import com.tykj.workflowcore.base.page.JpaCustomOrder;
import lombok.AllArgsConstructor;
......
......@@ -17,7 +17,7 @@ import lombok.NoArgsConstructor;
public class NodeInfoVo {
@ApiModelProperty("主键id")
private Long id;
private Integer id;
@ApiModelProperty("节点id")
private String nodeId;
......
package com.tykj.workflowcore.workflow_editer.vo;
package com.tykj.workflowcore.workflow_editer.entity.vo;
import com.tykj.workflowcore.base.page.JpaCustomOrder;
import com.tykj.workflowcore.base.page.JpaCustomPage;
......@@ -26,7 +26,7 @@ import java.util.List;
public class OutFormPageVo {
@ApiModelProperty("主键id")
private Long id;
private Integer id;
@ApiModelProperty("页面名称")
private String pageName;
......
package com.tykj.workflowcore.workflow_editer.entity.vo;
import com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -20,7 +19,7 @@ import java.util.List;
@Data
public class PageEntityVo {
private Long pageId;
private Integer pageId;
private List<String> entityIds;
}
package com.tykj.workflowcore.workflow_editer.vo;
package com.tykj.workflowcore.workflow_editer.entity.vo;
import com.tykj.workflowcore.base.page.JpaCustomPage;
import io.swagger.annotations.Api;
......
package com.tykj.workflowcore.workflow_editer.vo;
package com.tykj.workflowcore.workflow_editer.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -21,7 +21,7 @@ import java.util.List;
public class PageVo {
@ApiModelProperty("用户id")
private Long userId;
private Integer userId;
@ApiModelProperty("list集合")
private List list;
......
package com.tykj.workflowcore.workflow_editer.vo;
package com.tykj.workflowcore.workflow_editer.entity.vo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
......
package com.tykj.workflowcore.workflow_editer.vo;
package com.tykj.workflowcore.workflow_editer.entity.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
......@@ -20,7 +20,7 @@ public class SuspendVo {
/**
* 流程id
*/
private Long id;
private Integer id;
/**
* 是否可用 0 挂起 1 激活
......
package com.tykj.workflowcore.workflow_editer.vo;
package com.tykj.workflowcore.workflow_editer.entity.vo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
......@@ -29,13 +29,13 @@ public class TaskVo {
private String comments;
@ApiModelProperty("用户id")
private Long userId;
private Integer userId;
@ApiModelProperty(value = "是否同意",notes = "0 同意, 1拒绝 ")
private Integer handlingOpinion;
@ApiModelProperty("转交人的id")
private Long toUserId;
private Integer toUserId;
private Map<String,Object> map;
......
package com.tykj.workflowcore.workflow_editer.vo;
package com.tykj.workflowcore.workflow_editer.entity.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
......
package com.tykj.workflowcore.workflow_editer.entity.vo;
import com.tykj.workflowcore.workflow_editer.entity.VariableStorage;
import com.tykj.workflowcore.workflow_editer.vo.OutFormPageVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
/**
* @author HuangXiahao
* @version V1.0
......@@ -23,7 +17,7 @@ import javax.persistence.Id;
@NoArgsConstructor
public class VariableStorageVo {
private Long id;
private Integer id;
private String flowKey;
......
package com.tykj.workflowcore.workflow_editer.vo;
package com.tykj.workflowcore.workflow_editer.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......
//package com.tykj.workflowcore.workflow_editer.mapper;
//
//import com.tykj.workflowcore.model_layer.model.TableInfo;
//import com.tykj.workflowcore.workflow_editer.entity.PageEntity;
//import org.springframework.data.jpa.repository.JpaRepository;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//
//import java.util.List;
//
///**
// * ClassName: PageEntityMapper
// * Package: com.tykj.mapper
// * Description:
// * Datetime: 2021/3/4 9:53
// *
// * @Author: zsp
// */
//public interface PageEntityMapper extends JpaRepository<PageEntity,Long>, JpaSpecificationExecutor<PageEntity> {
//
// /**
// * 根据页面id查询
// * @param pageId 页面id
// * @return
// */
// PageEntity findByPageId(Integer pageId);
//}
//
......@@ -2,13 +2,10 @@ package com.tykj.workflowcore.workflow_editer.service;
import com.tykj.workflowcore.workflow_editer.entity.FlowsInfo;
import com.tykj.workflowcore.workflow_editer.entity.vo.SearchFlowInfoVo;
import com.tykj.workflowcore.workflow_editer.vo.FlowsInfoVo;
import com.tykj.workflowcore.workflow_editer.vo.PageVo;
import com.tykj.workflowcore.workflow_editer.entity.vo.FlowsInfoVo;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* ClassName: FlowInfoService
* Package: com.tykj.service
......
package com.tykj.workflowcore.workflow_editer.service;
import com.tykj.workflowcore.model_layer.model.TableInfo;
import com.tykj.workflowcore.model_layer.entity.TableInfo;
import com.tykj.workflowcore.workflow_editer.entity.FormPage;
import com.tykj.workflowcore.workflow_editer.vo.InFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.OutFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.PageFormPageVo;
import com.tykj.workflowcore.workflow_editer.entity.vo.InFormPageVo;
import com.tykj.workflowcore.workflow_editer.entity.vo.PageFormPageVo;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -39,13 +38,13 @@ public interface FormPageService {
* @param id 页面id
* @return 页面信息
*/
FormPage getPage(@PathVariable("id") Long id);
FormPage getPage(@PathVariable("id") Integer id);
/**
* 根据页面id删除页面
* @param id 页面id
*/
void deletePage(Long id);
void deletePage(Integer id);
/**
* 查询全部页面
......@@ -59,5 +58,5 @@ public interface FormPageService {
* @param pageIds 页面id
* @return
*/
List<TableInfo> findByPageIds(List<Long> pageIds);
List<TableInfo> findByPageIds(List<Integer> pageIds);
}
......@@ -18,7 +18,7 @@ public interface NodeInfoService {
* @param nodeId 节点id
* @return 返回页面id
*/
Long findByNodeId(String nodeId);
Integer findByNodeId(String nodeId);
/**
* 保存节点和页面的关系
......
package com.tykj.workflowcore.workflow_editer.service;
import com.tykj.workflowcore.workflow_editer.entity.FlowsInfo;
import com.tykj.workflowcore.workflow_editer.vo.*;
import com.tykj.workflowcore.workflow_editer.entity.vo.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
......@@ -98,7 +98,7 @@ public interface WorkFlowService {
* @param userId 用户Id
*/
void claimTask(String taskId, Long userId);
void claimTask(String taskId, Integer userId);
//历史查询
......
......@@ -23,7 +23,7 @@ public class DefaultUserServiceImpl implements UserService {
@Override
public WorkFlowUser getCurrentUser() {
WorkFlowUser workFlowUser = new WorkFlowUser();
workFlowUser.setId(1L);
workFlowUser.setId(1);
workFlowUser.setUserName("张三");
return workFlowUser;
}
......@@ -34,7 +34,7 @@ public class DefaultUserServiceImpl implements UserService {
for (int i = 0; i < 10; i++) {
WorkFlowUser workFlowUser = new WorkFlowUser();
workFlowUser.setUserName("张1");
workFlowUser.setId((long) i);
workFlowUser.setId(i);
workFlowUsers.add(workFlowUser);
}
return workFlowUsers;
......
......@@ -5,18 +5,14 @@ import com.github.wenhao.jpa.Specifications;
import com.tykj.workflowcore.base.result.ApiException;
import com.tykj.workflowcore.workflow_editer.entity.FlowsInfo;
import com.tykj.workflowcore.workflow_editer.entity.vo.SearchFlowInfoVo;
import com.tykj.workflowcore.workflow_editer.mapper.FlowsInfoMapper;
import com.tykj.workflowcore.workflow_editer.dao.FlowsInfoMapper;
import com.tykj.workflowcore.workflow_editer.service.FlowInfoService;
import com.tykj.workflowcore.workflow_editer.vo.FlowsInfoVo;
import com.tykj.workflowcore.workflow_editer.vo.PageVo;
import com.tykj.workflowcore.workflow_editer.entity.vo.FlowsInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import java.util.Optional;
/**
......
......@@ -4,14 +4,12 @@ package com.tykj.workflowcore.workflow_editer.service.impl;
import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications;
import com.tykj.workflowcore.model_layer.dao.TableInfoDao;
import com.tykj.workflowcore.model_layer.model.TableInfo;
import com.tykj.workflowcore.workflow_editer.entity.FlowsInfo;
import com.tykj.workflowcore.model_layer.entity.TableInfo;
import com.tykj.workflowcore.workflow_editer.entity.FormPage;
import com.tykj.workflowcore.workflow_editer.mapper.FormPageMapper;
import com.tykj.workflowcore.workflow_editer.dao.FormPageMapper;
import com.tykj.workflowcore.workflow_editer.service.FormPageService;
import com.tykj.workflowcore.workflow_editer.vo.InFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.OutFormPageVo;
import com.tykj.workflowcore.workflow_editer.vo.PageFormPageVo;
import com.tykj.workflowcore.workflow_editer.entity.vo.InFormPageVo;
import com.tykj.workflowcore.workflow_editer.entity.vo.PageFormPageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
......@@ -52,7 +50,7 @@ public class FormPageServiceImpl implements FormPageService {
}
@Override
public FormPage getPage(@PathVariable("id") Long id) {
public FormPage getPage(@PathVariable("id") Integer id) {
FormPage formPage = formPageMapper.findById(id).get();
//时间排序
......@@ -60,7 +58,7 @@ public class FormPageServiceImpl implements FormPageService {
}
@Override
public void deletePage(Long id) {
public void deletePage(Integer id) {
FormPage formPage = formPageMapper.findById(id).get();
formPage.setDeleted(1);
formPageMapper.save(formPage);
......@@ -80,9 +78,9 @@ public class FormPageServiceImpl implements FormPageService {
}
@Override
public List<TableInfo> findByPageIds(List<Long> pageIds) {
public List<TableInfo> findByPageIds(List<Integer> pageIds) {
ArrayList<TableInfo> list = new ArrayList<>();
for (Long pageId : pageIds) {
for (Integer pageId : pageIds) {
//通过pageId 查询出表id
String entityId = formPageMapper.findById(pageId).get().getEntityId();
//根据entityId查询出表
......
package com.tykj.workflowcore.workflow_editer.service.impl;
import com.tykj.workflowcore.workflow_editer.entity.NodeInfo;
import com.tykj.workflowcore.workflow_editer.mapper.NodePageMapper;
import com.tykj.workflowcore.workflow_editer.dao.NodePageMapper;
import com.tykj.workflowcore.workflow_editer.service.NodeInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -22,7 +22,7 @@ public class NodeInfoServiceImpl implements NodeInfoService {
@Autowired
private NodePageMapper nodePageMapper;
@Override
public Long findByNodeId(String nodeId) {
public Integer findByNodeId(String nodeId) {
return nodePageMapper.findByNodeId(nodeId);
}
......
package com.tykj.workflowcore.workflow_editer.service.impl;
import com.tykj.workflowcore.workflow_editer.entity.VariableStorage;
import com.tykj.workflowcore.workflow_editer.mapper.VariableStorageMapper;
import com.tykj.workflowcore.workflow_editer.dao.VariableStorageMapper;
import com.tykj.workflowcore.workflow_editer.service.VariableStorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......
......@@ -5,13 +5,12 @@ import com.tykj.workflowcore.api.entity.InvokeRequest;
import com.tykj.workflowcore.api.entity.Parameter;
import com.tykj.workflowcore.api.service.SpringBeanService;
import com.tykj.workflowcore.workflow_editer.entity.*;
import com.tykj.workflowcore.workflow_editer.mapper.FlowsInfoMapper;
import com.tykj.workflowcore.workflow_editer.service.NodeInfoService;
import com.tykj.workflowcore.workflow_editer.dao.FlowsInfoMapper;
import com.tykj.workflowcore.workflow_editer.entity.vo.*;
import com.tykj.workflowcore.workflow_editer.service.UserService;
import com.tykj.workflowcore.workflow_editer.service.VariableStorageService;
import com.tykj.workflowcore.workflow_editer.service.WorkFlowService;
import com.tykj.workflowcore.workflow_editer.util.UserServiceBeanUtil;
import com.tykj.workflowcore.workflow_editer.vo.*;
import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.DocumentException;
......@@ -23,7 +22,6 @@ import org.flowable.common.engine.impl.identity.Authentication;
import org.flowable.engine.*;
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.flowable.engine.repository.Deployment;
import org.flowable.engine.repository.DeploymentBuilder;
import org.flowable.engine.runtime.Execution;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.image.ProcessDiagramGenerator;
......@@ -31,8 +29,6 @@ import org.flowable.task.api.Task;
import org.flowable.task.api.TaskQuery;
import org.flowable.task.api.history.HistoricTaskInstance;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -323,9 +319,9 @@ public class WorkFlowServiceImpl implements WorkFlowService {
}
@Override
public void claimTask(String taskId, Long userId) {
public void claimTask(String taskId, Integer userId) {
//当前登录人的Id
taskService.claim(taskId,Long.toString(userId));
taskService.claim(taskId,Integer.toString(userId));
}
@Override
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论