♻️ Refactoring code. 工作流适配达梦数据库

This commit is contained in:
lbw committed 2023-09-05 14:52:31 +08:00
1 parent d2f59a2592
commit 84005c9749
16 files changed
+2416 -166

No files matched your search

+6 -1
View File
@@ -26,7 +26,7 @@
<mysql.connector.version>8.0.32</mysql.connector.version>
<oracle.version>21.3.0.0</oracle.version>
<sqlserver.version>8.4.1.jre8</sqlserver.version>
<dm.version>8.1.2.79</dm.version>
<dm.version>8.1.2.192</dm.version>
<highgo.version>6.2.0</highgo.version>
<knife4j.version>3.0.3</knife4j.version>
<swagger.core.version>2.2.8</swagger.core.version>
@@ -253,6 +253,11 @@
<artifactId>DmJdbcDriver18</artifactId>
<version>${dm.version}</version>
</dependency>
<dependency>
<groupId>com.dameng</groupId>
<artifactId>DmDialect-for-hibernate5.3</artifactId>
<version>${dm.version}</version>
</dependency>
<dependency>
<groupId>com.highgo</groupId>
<artifactId>HgdbJdbc</artifactId>
@@ -118,6 +118,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>com.dameng</groupId>
<artifactId>DmJdbcDriver18</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
@@ -16,3 +16,5 @@ spring:
import:
- optional:nacos:application-@profiles.active@.yml
- optional:nacos:${spring.application.name}-@profiles.active@.yml
liquibase:
enabled: false
@@ -24,88 +24,88 @@ public class Process {
/**
* 表单ID
*/
@TableField("`flow_id`")
@TableField("flow_id")
private String flowId;
/**
* 表单名称
*/
@TableField("`name`")
@TableField("name")
private String name;
/**
* 图标配置
*/
@TableField("`logo`")
@TableField("logo")
private String logo;
/**
* 设置项
*/
@TableField("`settings`")
@TableField("settings")
private String settings;
/**
* 分组ID
*/
@TableField("`group_id`")
@TableField("group_id")
private Long groupId;
/**
* 表单设置内容
*/
@TableField("`form_items`")
@TableField("form_items")
private String formItems;
/**
* 流程设置内容
*/
@TableField("`process`")
@TableField("process")
private String process;
/**
* 备注
*/
@TableField("`remark`")
@TableField("remark")
private String remark;
@TableField("`sort`")
@TableField("sort")
private Integer sort;
/**
* 0 正常 1=隐藏
*/
@TableField("`is_hidden`")
@TableField("is_hidden")
private Boolean hidden;
/**
* 0 正常 1=停用
*/
@TableField("`is_stop`")
@TableField("is_stop")
private Boolean stop;
/**
* 流程管理员
*/
@TableField("`admin_id`")
@TableField("admin_id")
private Long adminId;
/**
* 唯一性id
*/
@TableField("`unique_id`")
@TableField("unique_id")
private String uniqueId;
/**
* 管理员
*/
@TableField("`admin`")
private String admin;
@TableField("admin_list")
private String adminList;
/**
* 范围描述显示
*/
@TableField("`range_show`")
@TableField("range_show")
private String rangeShow;
/**
@@ -30,73 +30,73 @@ public class ProcessCopy {
/**
* 流程发起时间
*/
@TableField("`start_time`")
@TableField("start_time")
private LocalDateTime startTime;
/**
* 当前节点时间
*/
@TableField("`node_time`")
@TableField("node_time")
private LocalDateTime nodeTime;
/**
* 发起人
*/
@TableField("`start_user_id`")
@TableField("start_user_id")
private Long startUserId;
/**
* 流程id
*/
@TableField("`flow_id`")
@TableField("flow_id")
private String flowId;
/**
* 实例id
*/
@TableField("`process_instance_id`")
@TableField("process_instance_id")
private String processInstanceId;
/**
* 节点id
*/
@TableField("`node_id`")
@TableField("node_id")
private String nodeId;
/**
* 分组id
*/
@TableField("`group_id`")
@TableField("group_id")
private Long groupId;
/**
* 分组名称
*/
@TableField("`group_name`")
@TableField("group_name")
private String groupName;
/**
* 流程名称
*/
@TableField("`process_name`")
@TableField("process_name")
private String processName;
/**
* 节点 名称
*/
@TableField("`node_name`")
@TableField("node_name")
private String nodeName;
/**
* 表单数据
*/
@TableField("`form_data`")
@TableField("form_data")
private String formData;
/**
* 抄送人id
*/
@TableField("`user_id`")
@TableField("user_id")
private Long userId;
/**
@@ -24,13 +24,13 @@ public class ProcessGroup {
/**
* 分组名
*/
@TableField("`group_name`")
@TableField("group_name")
private String groupName;
/**
* 排序
*/
@TableField("`sort`")
@TableField("sort")
private Integer sort;
/**
@@ -25,67 +25,67 @@ public class ProcessInstanceRecord {
/**
* 流程名字
*/
@TableField("`name`")
@TableField("name")
private String name;
/**
* 头像
*/
@TableField("`logo`")
@TableField("logo")
private String logo;
/**
* 用户id
*/
@TableField("`user_id`")
@TableField("user_id")
private Long userId;
/**
* 流程id
*/
@TableField("`flow_id`")
@TableField("flow_id")
private String flowId;
/**
* 流程实例id
*/
@TableField("`process_instance_id`")
@TableField("process_instance_id")
private String processInstanceId;
/**
* 表单数据
*/
@TableField("`form_data`")
@TableField("form_data")
private String formData;
/**
* 组id
*/
@TableField("`group_id`")
@TableField("group_id")
private Long groupId;
/**
* 组名称
*/
@TableField("`group_name`")
@TableField("group_name")
private String groupName;
/**
* 状态
*/
@TableField("`status`")
@TableField("status")
private Integer status;
/**
* 结束时间
*/
@TableField("`end_time`")
@TableField("end_time")
private Date endTime;
/**
* 上级流程实例id
*/
@TableField("`parent_process_instance_id`")
@TableField("parent_process_instance_id")
private String parentProcessInstanceId;
/**
@@ -24,16 +24,16 @@ public class ProcessNodeData {
/**
* 流程id
*/
@TableField("`flow_id`")
@TableField("flow_id")
private String flowId;
/**
* 表单数据
*/
@TableField("`data`")
@TableField("data")
private String data;
@TableField("`node_id`")
@TableField("node_id")
private String nodeId;
/**
@@ -25,58 +25,58 @@ public class ProcessNodeRecord {
/**
* 流程id
*/
@TableField("`flow_id`")
@TableField("flow_id")
private String flowId;
/**
* 流程实例id
*/
@TableField("`process_instance_id`")
@TableField("process_instance_id")
private String processInstanceId;
/**
* 表单数据
*/
@TableField("`data`")
@TableField("data")
private String data;
@TableField("`node_id`")
@TableField("node_id")
private String nodeId;
/**
* 节点类型
*/
@TableField("`node_type`")
@TableField("node_type")
private String nodeType;
/**
* 节点名字
*/
@TableField("`node_name`")
@TableField("node_name")
private String nodeName;
/**
* 节点状态
*/
@TableField("`status`")
@TableField("status")
private Integer status;
/**
* 开始时间
*/
@TableField("`start_time`")
@TableField("start_time")
private Date startTime;
/**
* 结束时间
*/
@TableField("`end_time`")
@TableField("end_time")
private Date endTime;
/**
* 执行id
*/
@TableField("`execution_id`")
@TableField("execution_id")
private String executionId;
/**
@@ -24,82 +24,82 @@ public class ProcessNodeRecordAssignUser {
/**
* 流程id
*/
@TableField("`flow_id`")
@TableField("flow_id")
private String flowId;
/**
* 流程实例id
*/
@TableField("`process_instance_id`")
@TableField("process_instance_id")
private String processInstanceId;
/**
* 表单数据
*/
@TableField("`data`")
@TableField("data")
private String data;
@TableField("`node_id`")
@TableField("node_id")
private String nodeId;
/**
* 用户id
*/
@TableField("`user_id`")
@TableField("user_id")
private String userId;
/**
* 节点状态
*/
@TableField("`status`")
@TableField("status")
private Integer status;
/**
* 开始时间
*/
@TableField("`start_time`")
@TableField("start_time")
private LocalDateTime startTime;
/**
* 结束时间
*/
@TableField("`end_time`")
@TableField("end_time")
private LocalDateTime endTime;
/**
* 执行id
*/
@TableField("`execution_id`")
@TableField("execution_id")
private String executionId;
/**
* 任务id
*/
@TableField("`task_id`")
@TableField("task_id")
private String taskId;
/**
* 审批意见
*/
@TableField("`approve_desc`")
@TableField("approve_desc")
private String approveDesc;
/**
* 节点名称
*/
@TableField("`node_name`")
@TableField("node_name")
private String nodeName;
/**
* 任务类型
*/
@TableField("`task_type`")
@TableField("task_type")
private String taskType;
/**
* 表单本地数据
*/
@TableField("`local_data`")
@TableField("local_data")
private String localData;
/**
@@ -24,19 +24,19 @@ public class ProcessStarter {
/**
* 用户id或者部门id
*/
@TableField("`type_id`")
@TableField("type_id")
private Long typeId;
/**
* 类型 user dept
*/
@TableField("`type`")
@TableField("type")
private String type;
/**
* 流程id
*/
@TableField("`process_id`")
@TableField("process_id")
private Long processId;
/**
@@ -98,6 +98,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>com.dameng</groupId>
<artifactId>DmJdbcDriver18</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
@@ -166,7 +166,7 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
return R.failed(r.getMsg());
}
String flowId = r.getData();
NodeUser nodeUser = objectMapper.readValue(process.getAdmin(), new TypeReference<List<NodeUser>>() {
NodeUser nodeUser = objectMapper.readValue(process.getAdminList(), new TypeReference<List<NodeUser>>() {
}).get(0);
// 更新流程
@@ -217,7 +217,7 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
p.setStop(false);
p.setAdminId(nodeUser.getId());
p.setUniqueId(IdUtil.fastSimpleUUID());
p.setAdmin(process.getAdmin());
p.setAdminList(process.getAdminList());
p.setRangeShow(stringBuilder.toString());
this.save(p);
+101 -88
View File
@@ -12,102 +12,115 @@
limitations under the License.
-->
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx</artifactId>
<version>5.2.0-snapshot</version>
</parent>
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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx</artifactId>
<version>5.2.0-snapshot</version>
</parent>
<artifactId>pigx-register</artifactId>
<packaging>jar</packaging>
<name>pigx-register</name>
<description>nacos 注册配置中心</description>
<artifactId>pigx-register</artifactId>
<packaging>jar</packaging>
<name>pigx-register</name>
<description>nacos 注册配置中心</description>
<properties>
<nacos.version>2.2.4-OEM</nacos.version>
</properties>
<properties>
<nacos.version>2.2.4-OEM</nacos.version>
</properties>
<dependencies>
<dependency>
<groupId>io.springboot.nacos</groupId>
<artifactId>nacos-config</artifactId>
<version>${nacos.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependencies>
<dependency>
<groupId>io.springboot.nacos</groupId>
<artifactId>nacos-config</artifactId>
<version>${nacos.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>io.springboot.nacos</groupId>
<artifactId>nacos-naming</artifactId>
<version>${nacos.version}</version>
</dependency>
<dependency>
<groupId>io.springboot.nacos</groupId>
<artifactId>nacos-naming</artifactId>
<version>${nacos.version}</version>
</dependency>
<dependency>
<groupId>io.springboot.nacos</groupId>
<artifactId>nacos-istio</artifactId>
<version>${nacos.version}</version>
</dependency>
<dependency>
<groupId>io.springboot.nacos</groupId>
<artifactId>nacos-istio</artifactId>
<version>${nacos.version}</version>
</dependency>
<dependency>
<groupId>io.springboot.nacos</groupId>
<artifactId>nacos-plugin-default-impl</artifactId>
<version>${nacos.version}</version>
</dependency>
<dependency>
<groupId>io.springboot.nacos</groupId>
<artifactId>nacos-plugin-default-impl</artifactId>
<version>${nacos.version}</version>
</dependency>
<dependency>
<groupId>io.springboot.nacos</groupId>
<artifactId>nacos-prometheus</artifactId>
<version>${nacos.version}</version>
</dependency>
<dependency>
<groupId>io.springboot.nacos</groupId>
<artifactId>nacos-prometheus</artifactId>
<version>${nacos.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-system</artifactId>
</dependency>
</dependencies>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-system</artifactId>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/*.woff</exclude>
<exclude>**/*.woff2</exclude>
<exclude>**/*.ttf</exclude>
<exclude>**/*.eot</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/*.woff</include>
<include>**/*.woff2</include>
<include>**/*.ttf</include>
<include>**/*.eot</include>
</includes>
</resource>
</resources>
</build>
<!--达梦数据库插件-->
<dependency>
<groupId>com.pig4cloud.plugin</groupId>
<artifactId>nacos-datasource-plugin-dm8</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.dameng</groupId>
<artifactId>DmJdbcDriver18</artifactId>
<version>8.1.1.193</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/*.woff</exclude>
<exclude>**/*.woff2</exclude>
<exclude>**/*.ttf</exclude>
<exclude>**/*.eot</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/*.woff</include>
<include>**/*.woff2</include>
<include>**/*.ttf</include>
<include>**/*.eot</include>
</includes>
</resource>
</resources>
</build>
</project>
@@ -6,10 +6,13 @@ server:
include-message: always
db:
num: 1
user: ${MYSQL_USER:root}
password: ${MYSQL_PWD:root}
user: SYSDBA
password: SYSDBA
url:
0: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_config}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
0: jdbc:dm://home:35236
pool:
config:
driver-class-name: dm.jdbc.driver.DmDriver
nacos:
core:
@@ -26,7 +29,7 @@ nacos:
spring:
datasource:
platform: mysql #这个过期属性不能修改,nacos 代码对此有硬编码
platform: dameng #这个过期属性不能修改,nacos 代码对此有硬编码
security:
enabled: true
boot: # 接入 spring boot admin