Browse Source

Merge remote-tracking branch 'origin/master'

yaoll 3 years ago
parent
commit
f573ba09c0
69 changed files with 4588 additions and 106 deletions
  1. 46 46
      dmp-alarm/pom.xml
  2. 1 2
      dmp-alarm/src/script/start.sh
  3. 21 0
      dmp-common/src/main/java/com/persagy/common/criteria/CriteriaUtils.java
  4. 47 47
      dmp-dic/pom.xml
  5. 0 1
      dmp-dic/src/script/start.sh
  6. 10 10
      dmp-model/src/main/java/com/persagy/dmp/rwd/enums/FuncidDataType.java
  7. 132 0
      dmp-rwd-edit/pom.xml
  8. 60 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/EditApp.java
  9. 126 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/config/shiro/DmpAccessControlFilter.java
  10. 24 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/config/shiro/DmpAuthorizationFilter.java
  11. 75 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/config/shiro/DmpRealm.java
  12. 82 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/config/shiro/ShiroConfig.java
  13. 7 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/config/shiro/ShiroContants.java
  14. 16 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/config/shiro/UserModel.java
  15. 40 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/config/web/UserUtils.java
  16. 54 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/config/web/WebConfig.java
  17. 40 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/AdminRoleController.java
  18. 40 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/AdminUserController.java
  19. 45 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/ClassDefChangeRecordController.java
  20. 28 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/ClassDefController.java
  21. 24 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/DtDataController.java
  22. 44 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/FuncidDefChangeRecordController.java
  23. 23 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/FuncidDefController.java
  24. 40 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/RwdeditRefTypeController.java
  25. 40 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/RwdeditRefTypeInfoController.java
  26. 45 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/RwdeditVersionController.java
  27. 34 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/UserController.java
  28. 30 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/AdminPermission.java
  29. 41 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/AdminRole.java
  30. 47 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/AdminUser.java
  31. 27 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/AdminUserProject.java
  32. 70 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/ClassDef.java
  33. 52 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/ClassDefChangeRecord.java
  34. 73 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/DtData.java
  35. 114 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/FuncidDef.java
  36. 71 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/FuncidDefChangeRecord.java
  37. 48 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/GroupPK.java
  38. 48 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/RefTypeInfoPK.java
  39. 59 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/RwdeditRefType.java
  40. 37 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/RwdeditRefTypeInfos.java
  41. 26 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/RwdeditVersion.java
  42. 7 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/enumeration/EnumOperationType.java
  43. 42 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/model/ClassDefChangeRecordModel.java
  44. 26 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/model/DtDataModel.java
  45. 21 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/model/RwdeditRefTypeModel.java
  46. 27 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/AdminPermissionRepository.java
  47. 9 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/AdminRoleRepository.java
  48. 9 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/AdminUserProjectRepository.java
  49. 9 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/AdminUserRepository.java
  50. 17 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/ClassDefChangeRecordRepository.java
  51. 17 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/FuncidDefChangeRecordRepository.java
  52. 9 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/RwdeditRefTypeInfosRepository.java
  53. 9 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/RwdeditRefTypeRepository.java
  54. 9 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/RwdeditVersionRepository.java
  55. 152 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/AdminRoleService.java
  56. 143 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/AdminUserService.java
  57. 308 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/ClassDefChangeRecordService.java
  58. 71 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/ClassDefService.java
  59. 45 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/DtDataService.java
  60. 410 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/FuncidDefChangeRecordService.java
  61. 124 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/FuncidDefService.java
  62. 129 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/RwdeditRefTypeInfosService.java
  63. 116 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/RwdeditRefTypeService.java
  64. 173 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/RwdeditVersionService.java
  65. 120 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/UserService.java
  66. 65 0
      dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/util/ClassCodeUtils.java
  67. 43 0
      dmp-rwd-edit/src/main/resources/application.yml
  68. 590 0
      dmp-rwd-edit/数据字典编辑工具接口文档.md
  69. 1 0
      pom.xml

+ 46 - 46
dmp-alarm/pom.xml

@@ -147,24 +147,24 @@
 
             <!-- 按照测试要求打成zip需要的配置 -->
             <!--获取git信息-->
-            <plugin>
-                <groupId>pl.project13.maven</groupId>
-                <artifactId>git-commit-id-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>revision</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <verbose>true</verbose>
-                    <dateFormat>yyyyMMddHHmm</dateFormat>
-                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
-                    <!--<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>-->
-                    <generateGitPropertiesFilename>target/git.properties</generateGitPropertiesFilename>
-                </configuration>
-            </plugin>
+<!--            <plugin>-->
+<!--                <groupId>pl.project13.maven</groupId>-->
+<!--                <artifactId>git-commit-id-plugin</artifactId>-->
+<!--                <executions>-->
+<!--                    <execution>-->
+<!--                        <goals>-->
+<!--                            <goal>revision</goal>-->
+<!--                        </goals>-->
+<!--                    </execution>-->
+<!--                </executions>-->
+<!--                <configuration>-->
+<!--                    <verbose>true</verbose>-->
+<!--                    <dateFormat>yyyyMMddHHmm</dateFormat>-->
+<!--                    <generateGitPropertiesFile>true</generateGitPropertiesFile>-->
+<!--                    &lt;!&ndash;<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>&ndash;&gt;-->
+<!--                    <generateGitPropertiesFilename>target/git.properties</generateGitPropertiesFilename>-->
+<!--                </configuration>-->
+<!--            </plugin>-->
             <plugin>
                 <groupId>com.coderplus.maven.plugins</groupId>
                 <artifactId>copy-rename-maven-plugin</artifactId>
@@ -177,7 +177,7 @@
                             <goal>rename</goal>
                         </goals>
                         <configuration>
-                            <sourceFile>${project.build.directory}/git.properties</sourceFile>
+<!--                            <sourceFile>${project.build.directory}/git.properties</sourceFile>-->
                             <destinationFile>${project.build.directory}/version.txt</destinationFile>
                         </configuration>
                     </execution>
@@ -230,33 +230,33 @@
                 </executions>
             </plugin>
 
-            <!-- 打包压缩 -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>make-assembly</id>
-                        <!-- 当执行mvn package时才会打包 -->
-                        <phase>package</phase>
-                        <goals>
-                            <goal>single</goal>
-                        </goals>
-                        <configuration>
-                            <finalName>
-                                ${project.artifactId}_${git.commit.time}_git_${git.branch}_${git.commit.id.abbrev}
-                            </finalName>
-                            <!--不包含assembly id-->
-                            <appendAssemblyId>false</appendAssemblyId>
-                            <!--输出路径-->
-                            <!--<outputDirectory>../target/co_search-${project.version}</outputDirectory>-->
-                            <descriptors>
-                                <descriptor>src/script/zip.xml</descriptor>
-                            </descriptors>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
+<!--            &lt;!&ndash; 打包压缩 &ndash;&gt;-->
+<!--            <plugin>-->
+<!--                <groupId>org.apache.maven.plugins</groupId>-->
+<!--                <artifactId>maven-assembly-plugin</artifactId>-->
+<!--                <executions>-->
+<!--                    <execution>-->
+<!--                        <id>make-assembly</id>-->
+<!--                        &lt;!&ndash; 当执行mvn package时才会打包 &ndash;&gt;-->
+<!--                        <phase>package</phase>-->
+<!--                        <goals>-->
+<!--                            <goal>single</goal>-->
+<!--                        </goals>-->
+<!--                        <configuration>-->
+<!--                            <finalName>-->
+<!--                                ${project.artifactId}_${git.commit.time}_git_${git.branch}_${git.commit.id.abbrev}-->
+<!--                            </finalName>-->
+<!--                            &lt;!&ndash;不包含assembly id&ndash;&gt;-->
+<!--                            <appendAssemblyId>false</appendAssemblyId>-->
+<!--                            &lt;!&ndash;输出路径&ndash;&gt;-->
+<!--                            &lt;!&ndash;<outputDirectory>../target/co_search-${project.version}</outputDirectory>&ndash;&gt;-->
+<!--                            <descriptors>-->
+<!--                                <descriptor>src/script/zip.xml</descriptor>-->
+<!--                            </descriptors>-->
+<!--                        </configuration>-->
+<!--                    </execution>-->
+<!--                </executions>-->
+<!--            </plugin>-->
         </plugins>
     </build>
 </project>

+ 1 - 2
dmp-alarm/src/script/start.sh

@@ -2,5 +2,4 @@
 # 根据情况使用内存限制 命令为:
 # nohup java -jar -Xms500m -Xmx1024m -Dfile.encoding=utf-8 dmp-alarm.jar >/dev/null 2>&1 &
 nohup java -jar -Xms500m -Xmx4096m -Dfile.encoding=utf-8 -DCONFIG_FILE_PATH=/mnt/data/SpringCloud dmp-alarm.jar >/dev/null 2>&1 &
-sleep 2
-tail -f ../logs/dmp-alarm/log.log
+sleep 2

+ 21 - 0
dmp-common/src/main/java/com/persagy/common/criteria/CriteriaUtils.java

@@ -451,4 +451,25 @@ public class CriteriaUtils {
 		}
 		return values;
 	}
+
+	public static List<BooleanExpression> parse(BooleanPath path, JsonNode node, Boolean defaultValue) {
+		List<BooleanExpression> result = new LinkedList<>();
+		if (node == null) {
+			if (defaultValue != null) {
+				result.add(path.eq(defaultValue));
+			}
+			return result;
+		}
+		JsonNodeType nodeType = node.getNodeType();
+		if (nodeType == JsonNodeType.STRING) {
+			result.add(path.eq(Boolean.valueOf(node.asText())));
+		} else if (nodeType == JsonNodeType.BOOLEAN) {
+			result.add(path.eq(node.asBoolean()));
+		}
+		return result;
+	}
+
+	public static List<BooleanExpression> parse(BooleanPath path, JsonNode node) {
+		return parse(path, node, null);
+	}
 }

+ 47 - 47
dmp-dic/pom.xml

@@ -112,25 +112,25 @@
             </plugin>
 
             <!-- 按照测试要求打成zip需要的配置 -->
-            <!--获取git信息-->
-            <plugin>
-                <groupId>pl.project13.maven</groupId>
-                <artifactId>git-commit-id-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>revision</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <verbose>true</verbose>
-                    <dateFormat>yyyyMMddHHmm</dateFormat>
-                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
-                    <!--<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>-->
-                    <generateGitPropertiesFilename>target/git.properties</generateGitPropertiesFilename>
-                </configuration>
-            </plugin>
+<!--            &lt;!&ndash;获取git信息&ndash;&gt;-->
+<!--            <plugin>-->
+<!--                <groupId>pl.project13.maven</groupId>-->
+<!--                <artifactId>git-commit-id-plugin</artifactId>-->
+<!--                <executions>-->
+<!--                    <execution>-->
+<!--                        <goals>-->
+<!--                            <goal>revision</goal>-->
+<!--                        </goals>-->
+<!--                    </execution>-->
+<!--                </executions>-->
+<!--                <configuration>-->
+<!--                    <verbose>true</verbose>-->
+<!--                    <dateFormat>yyyyMMddHHmm</dateFormat>-->
+<!--                    <generateGitPropertiesFile>true</generateGitPropertiesFile>-->
+<!--                    &lt;!&ndash;<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>&ndash;&gt;-->
+<!--                    <generateGitPropertiesFilename>target/git.properties</generateGitPropertiesFilename>-->
+<!--                </configuration>-->
+<!--            </plugin>-->
             <plugin>
                 <groupId>com.coderplus.maven.plugins</groupId>
                 <artifactId>copy-rename-maven-plugin</artifactId>
@@ -143,7 +143,7 @@
                             <goal>rename</goal>
                         </goals>
                         <configuration>
-                            <sourceFile>${project.build.directory}/git.properties</sourceFile>
+<!--                            <sourceFile>${project.build.directory}/git.properties</sourceFile>-->
                             <destinationFile>${project.build.directory}/version.txt</destinationFile>
                         </configuration>
                     </execution>
@@ -196,33 +196,33 @@
                 </executions>
             </plugin>
 
-            <!-- 打包压缩 -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>make-assembly</id>
-                        <!-- 当执行mvn package时才会打包 -->
-                        <phase>package</phase>
-                        <goals>
-                            <goal>single</goal>
-                        </goals>
-                        <configuration>
-                            <finalName>
-                                ${project.artifactId}_${git.commit.time}_git_${git.branch}_${git.commit.id.abbrev}
-                            </finalName>
-                            <!--不包含assembly id-->
-                            <appendAssemblyId>false</appendAssemblyId>
-                            <!--输出路径-->
-                            <!--<outputDirectory>../target/co_search-${project.version}</outputDirectory>-->
-                            <descriptors>
-                                <descriptor>src/script/zip.xml</descriptor>
-                            </descriptors>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
+<!--            &lt;!&ndash; 打包压缩 &ndash;&gt;-->
+<!--            <plugin>-->
+<!--                <groupId>org.apache.maven.plugins</groupId>-->
+<!--                <artifactId>maven-assembly-plugin</artifactId>-->
+<!--                <executions>-->
+<!--                    <execution>-->
+<!--                        <id>make-assembly</id>-->
+<!--                        &lt;!&ndash; 当执行mvn package时才会打包 &ndash;&gt;-->
+<!--                        <phase>package</phase>-->
+<!--                        <goals>-->
+<!--                            <goal>single</goal>-->
+<!--                        </goals>-->
+<!--                        <configuration>-->
+<!--                            <finalName>-->
+<!--                                ${project.artifactId}_${git.commit.time}_git_${git.branch}_${git.commit.id.abbrev}-->
+<!--                            </finalName>-->
+<!--                            &lt;!&ndash;不包含assembly id&ndash;&gt;-->
+<!--                            <appendAssemblyId>false</appendAssemblyId>-->
+<!--                            &lt;!&ndash;输出路径&ndash;&gt;-->
+<!--                            &lt;!&ndash;<outputDirectory>../target/co_search-${project.version}</outputDirectory>&ndash;&gt;-->
+<!--                            <descriptors>-->
+<!--                                <descriptor>src/script/zip.xml</descriptor>-->
+<!--                            </descriptors>-->
+<!--                        </configuration>-->
+<!--                    </execution>-->
+<!--                </executions>-->
+<!--            </plugin>-->
         </plugins>
     </build>
 

+ 0 - 1
dmp-dic/src/script/start.sh

@@ -3,4 +3,3 @@
 # nohup java -jar -Xms500m -Xmx1024m -Dfile.encoding=utf-8 dmp-dic.jar >/dev/null 2>&1 &
 nohup java -jar -Xms500m -Xmx4096m -Dfile.encoding=utf-8 -DCONFIG_FILE_PATH=/mnt/data/SpringCloud dmp-dic.jar >/dev/null 2>&1 &
 sleep 2
-tail -f ../logs/dmp-dic/dic-(date "+%Y%m%d").log

+ 10 - 10
dmp-model/src/main/java/com/persagy/dmp/rwd/enums/FuncidDataType.java

@@ -2,16 +2,16 @@ package com.persagy.dmp.rwd.enums;
 
 public enum FuncidDataType {
 
-	INTEGER,
-	DOUBLE,
-	BOOLEAN,
-	STRING,
-	DATETIME,
-	ENUM,
-	MENUM,
-	ATTACHMENT,
-	OBJECT,
-	ENUMREF
+    INTEGER,
+    DOUBLE,
+    BOOLEAN,
+    STRING,
+    DATETIME,
+    ENUM,
+    MENUM,
+    ATTACHMENT,
+    OBJECT,
+    REFENUM
 
 }
 

+ 132 - 0
dmp-rwd-edit/pom.xml

@@ -0,0 +1,132 @@
+<?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>dmp</artifactId>
+        <groupId>com.persagy</groupId>
+        <version>4.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.persagy</groupId>
+    <artifactId>dmp-rwd-edit</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.persagy</groupId>
+            <artifactId>dmp-model</artifactId>
+            <version>4.0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.vladmihalcea</groupId>
+            <artifactId>hibernate-types-52</artifactId>
+            <version>2.9.13</version>
+        </dependency>
+        <dependency>
+            <groupId>com.querydsl</groupId>
+            <artifactId>querydsl-sql</artifactId>
+            <version>${querydsl.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.querydsl</groupId>
+            <artifactId>querydsl-apt</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid</artifactId>
+            <version>1.1.21</version>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.querydsl</groupId>
+            <artifactId>querydsl-jpa</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.persagy</groupId>
+            <artifactId>dmp-common</artifactId>
+            <version>4.0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.shiro</groupId>
+            <artifactId>shiro-spring</artifactId>
+            <version>1.4.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>dmp-rwd-edit</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <fork>true</fork>
+                    <jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <!--
+            -->
+            <plugin>
+                <groupId>com.mysema.maven</groupId>
+                <artifactId>apt-maven-plugin</artifactId>
+                <version>1.1.3</version>
+                <executions>
+                    <execution>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>process</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>target/generated-sources</outputDirectory>
+                            <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 60 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/EditApp.java

@@ -0,0 +1,60 @@
+package com.persagy.dmp.rwd.edit;
+
+import com.persagy.common.criteria.CriteriaUtils;
+import com.persagy.common.criteria.JpaUtils;
+import com.persagy.dmp.common.SpringUtils;
+import com.persagy.dmp.common.http.HttpUtils;
+import com.querydsl.jpa.impl.JPAQueryFactory;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.mgt.SecurityManager;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.annotation.Bean;
+
+import javax.persistence.EntityManager;
+
+/**
+ * @author: yaoll
+ * @date: 2020-10-22
+ * @verison: 1.0
+ */
+@Slf4j
+@SpringBootApplication
+public class EditApp {
+
+    public static void main(String[] args) {
+        SpringApplication app = new SpringApplication(EditApp.class);
+        ConfigurableApplicationContext ctx = app.run(args);
+
+        SecurityManager securityManager = ctx.getBean(SecurityManager.class);
+        SecurityUtils.setSecurityManager(securityManager);
+    }
+
+    @Bean
+    public JPAQueryFactory jpaQueryFactory(EntityManager entityManager) {
+        return new JPAQueryFactory(entityManager);
+    }
+
+    @Bean
+    public CriteriaUtils criteriaUtils(@Autowired JPAQueryFactory jpaQueryFactory) {
+        return new CriteriaUtils(jpaQueryFactory);
+    }
+
+    @Bean
+    public JpaUtils jpaUtils(@Autowired EntityManager entityManager) {
+        return new JpaUtils(entityManager);
+    }
+
+    @Bean
+    public HttpUtils httpUtils() {
+        return new HttpUtils();
+    }
+
+    @Bean
+    public SpringUtils springUtils() {
+        return new SpringUtils();
+    }
+}

+ 126 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/config/shiro/DmpAccessControlFilter.java

@@ -0,0 +1,126 @@
+package com.persagy.dmp.rwd.edit.config.shiro;
+
+import com.persagy.common.web.ServletUtils;
+import com.persagy.dmp.rwd.edit.entity.AdminUser;
+import com.persagy.dmp.rwd.edit.entity.QAdminUser;
+import com.persagy.dmp.rwd.edit.repository.AdminUserRepository;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.subject.Subject;
+import org.apache.shiro.web.filter.AccessControlFilter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Optional;
+
+@Component("authc")
+public class DmpAccessControlFilter extends AccessControlFilter {
+
+    public final Logger logger = LoggerFactory.getLogger(DmpAccessControlFilter.class);
+
+    private final static String HEADER_TOKEN = "dmp-token";
+
+    @Autowired
+    private StringRedisTemplate redis;
+
+    @Autowired
+    private AdminUserRepository userRepository;
+
+    //判断是否拦截,false为拦截,true为允许继续访问
+    @Override
+    protected boolean isAccessAllowed(ServletRequest req, ServletResponse resp, Object mappedValue) throws Exception {
+        HttpServletRequest request = (HttpServletRequest) req;
+        HttpServletResponse response = (HttpServletResponse) resp;
+        logger.info("===================================== isAccessAllowed");
+        String uri = request.getRequestURI();
+        logger.info("开始请求地址拦截 {}", uri);
+//		ServletUtils.showHeaders(request);
+//		ServletUtils.showCookies(request);
+
+        if (uri.equals(this.getLoginUrl())) {
+            // 登录地址,直接放行
+            return true;
+        }
+
+        String token = request.getHeader(HEADER_TOKEN);
+        if (token == null) {
+            ServletUtils.writeJson(response, "{\"result\":\"no_token\",\"message\":\"no token\"}");
+            return false;
+        }
+
+        // token不存在
+        String key = ShiroContants.KEY_TOKEN_USER + token;
+        if (!redis.hasKey(key)) {
+            ServletUtils.writeJson(response, "{\"result\":\"unauthc\",\"message\":\"token invalid\"}");
+            return false;
+        }
+
+        try {
+            Subject subject = SecurityUtils.getSubject();
+            if (subject.isAuthenticated()) {
+                Object principal = subject.getPrincipal();
+                if (principal instanceof UserModel) {
+                    // 防止前端切换用户, 用token做密码
+                    UserModel userModel = (UserModel) principal;
+                    if (!userModel.getToken().equalsIgnoreCase(token)) {
+                        return checkToken(subject, token, response);
+                    }
+                } else {
+                    return checkToken(subject, token, response);
+                }
+            } else {
+                return checkToken(subject, token, response);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            logger.error("login check error: {}", e);
+            return false;
+        }
+        return true;
+    }
+
+    private boolean checkToken(Subject subject, String token, HttpServletResponse response) {
+
+        String key = ShiroContants.KEY_TOKEN_USER + token;
+        String userIdStr = redis.opsForValue().get(key);
+        Integer userId = Integer.valueOf(userIdStr);
+
+
+        Optional<AdminUser> one = userRepository.findOne(QAdminUser.adminUser.id.eq(userId));
+        if (!one.isPresent()) {
+            // 用户不存在
+            ServletUtils.writeJson(response, "{\"result\": \"no_user\"}");
+            return false;
+        }
+        AdminUser user = one.get();
+        if (user.getStatus() != 1) {
+            // 用户被禁用
+            ServletUtils.writeJson(response, "{\"result\": \"invalid_user\"}");
+            return false;
+        } else {
+            // 更新用户名
+            String name = user.getRealname() == null ? user.getUsername() : user.getRealname();
+
+            // 用ssoId作为用户名
+            UsernamePasswordToken shiroToken = new UsernamePasswordToken(user.getUsername(), token);
+            subject.login(shiroToken);
+        }
+        return true;
+    }
+
+    //上面的方法返回false后(被拦截),会进入这个方法;这个方法返回false表示处理完毕(不放行);返回true表示需要继续处理(放行)
+    // 身份认证逻辑已在isAccessAllowed处理,这里直接返回false
+    @Override
+    protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
+        HttpServletRequest req = (HttpServletRequest) request;
+        logger.info("===================================== onAccessDenied {}", req.getRequestURI());
+        return false;
+    }
+}

+ 24 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/config/shiro/DmpAuthorizationFilter.java

@@ -0,0 +1,24 @@
+package com.persagy.dmp.rwd.edit.config.shiro;
+
+import com.persagy.common.web.ServletUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.web.filter.authz.PermissionsAuthorizationFilter;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+@Slf4j
+public class DmpAuthorizationFilter extends PermissionsAuthorizationFilter {
+
+	private static final String ERROR_RESULT = "{\"result\": \"fail\", \"message\": \"no authorization info\"}";
+
+	@Override
+	protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws IOException {
+		log.error("======================= shiro authorization error");
+		ServletUtils.writeJson((HttpServletResponse) response, ERROR_RESULT);
+		return false;
+	}
+
+}

+ 75 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/config/shiro/DmpRealm.java

@@ -0,0 +1,75 @@
+package com.persagy.dmp.rwd.edit.config.shiro;
+
+import com.persagy.common.json.JacksonMapper;
+import com.persagy.dmp.rwd.edit.entity.AdminUser;
+import com.persagy.dmp.rwd.edit.entity.QAdminUser;
+import com.persagy.dmp.rwd.edit.repository.AdminPermissionRepository;
+import com.persagy.dmp.rwd.edit.repository.AdminUserRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.authc.*;
+import org.apache.shiro.authz.AuthorizationInfo;
+import org.apache.shiro.authz.SimpleAuthorizationInfo;
+import org.apache.shiro.realm.AuthorizingRealm;
+import org.apache.shiro.subject.PrincipalCollection;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Optional;
+
+@Slf4j
+@Component
+public class DmpRealm extends AuthorizingRealm {
+
+    @Autowired
+    private AdminUserRepository userRepository;
+
+    @Autowired
+    private AdminPermissionRepository permissionRepository;
+
+    /**
+     * 校验身份信息
+     *
+     * @param authenticationToken
+     * @return
+     * @throws AuthenticationException
+     */
+    @Override
+    protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException {
+        UsernamePasswordToken token = (UsernamePasswordToken) authenticationToken;
+        String ssoToken = new String(token.getPassword());
+        log.info("身份认证 --> {} {}", token.getUsername(), ssoToken);
+        Optional<AdminUser> one = userRepository.findOne(QAdminUser.adminUser.username.eq(token.getUsername()));
+        if (!one.isPresent()) {
+            return null;
+        }
+        AdminUser user = one.get();
+
+        UserModel userModel = new UserModel();
+        userModel.setId(user.getId());
+        userModel.setUsername(user.getUsername());
+        userModel.setToken(ssoToken);
+        List<String> permissions = permissionRepository.queryForUser(user.getId());
+        userModel.setPermissions(permissions);
+        log.info("身份认证 --> {}", JacksonMapper.toFormatJson(userModel));
+        SimpleAuthenticationInfo result = new SimpleAuthenticationInfo(userModel, ssoToken, "dmpRealm");
+        return result;
+    }
+
+    /**
+     * 校验权限
+     *
+     * @param principals
+     * @return
+     */
+    @Override
+    protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
+        UserModel userModel = (UserModel) principals.getPrimaryPrincipal();
+        log.info("权限配置--> {} {}", userModel.getUsername(), JacksonMapper.toSimpleJson(userModel.getPermissions()));
+        SimpleAuthorizationInfo authorizationInfo = new SimpleAuthorizationInfo();
+        authorizationInfo.addStringPermissions(userModel.getPermissions());
+        return authorizationInfo;
+    }
+
+}
+

+ 82 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/config/shiro/ShiroConfig.java

@@ -0,0 +1,82 @@
+package com.persagy.dmp.rwd.edit.config.shiro;
+
+import org.apache.shiro.mgt.SecurityManager;
+import org.apache.shiro.session.mgt.SessionManager;
+import org.apache.shiro.spring.LifecycleBeanPostProcessor;
+import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor;
+import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
+import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
+import org.apache.shiro.web.servlet.Cookie;
+import org.apache.shiro.web.session.mgt.DefaultWebSessionManager;
+import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.DependsOn;
+
+import javax.servlet.Filter;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+@Configuration
+public class ShiroConfig {
+
+    @Bean
+    public SessionManager sessionManager() {
+        DefaultWebSessionManager sessionManager = new DefaultWebSessionManager();
+        Cookie sessionIdCookie = sessionManager.getSessionIdCookie();
+        sessionIdCookie.setName("dmp-admin");
+        sessionManager.setGlobalSessionTimeout(120 * 1000); // 超时时间
+        sessionManager.setDeleteInvalidSessions(true);
+        return sessionManager;
+    }
+
+    @Bean
+    public SecurityManager securityManager(@Autowired DmpRealm sagacloudRealm) {
+        DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
+        securityManager.setRealm(sagacloudRealm);
+        securityManager.setSessionManager(sessionManager());
+        return securityManager;
+    }
+
+    @Bean("shiroFilter")
+    public ShiroFilterFactoryBean shiroFilterFactoryBean(SecurityManager securityManager) {
+        ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
+        shiroFilterFactoryBean.setSecurityManager(securityManager);
+        //拦截器.
+        Map<String, Filter> filters = new LinkedHashMap<>();
+        filters.put("perms", new DmpAuthorizationFilter());
+        shiroFilterFactoryBean.setFilters(filters);
+
+        Map<String, String> filterChainDefinitionMap = new LinkedHashMap<String, String>();
+        filterChainDefinitionMap.put("/rwdedit/login", "anon");
+        filterChainDefinitionMap.put("/system/user/update", "authc,perms[system:user:update]");
+        filterChainDefinitionMap.put("/**", "authc");
+        shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap);
+
+        shiroFilterFactoryBean.setLoginUrl("/rwdedit/login");
+        return shiroFilterFactoryBean;
+    }
+
+
+    @Bean
+    public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(SecurityManager securityManager) {
+        AuthorizationAttributeSourceAdvisor advisor = new AuthorizationAttributeSourceAdvisor();
+        advisor.setSecurityManager(securityManager);
+        return advisor;
+    }
+
+    @Bean
+    @DependsOn("lifecycleBeanPostProcessor")
+    public DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator() {
+        DefaultAdvisorAutoProxyCreator creator = new DefaultAdvisorAutoProxyCreator();
+        creator.setProxyTargetClass(true);
+        return creator;
+    }
+
+    @Bean
+    public LifecycleBeanPostProcessor lifecycleBeanPostProcessor() {
+        return new LifecycleBeanPostProcessor();
+    }
+
+}

+ 7 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/config/shiro/ShiroContants.java

@@ -0,0 +1,7 @@
+package com.persagy.dmp.rwd.edit.config.shiro;
+
+public class ShiroContants {
+
+	public static final String KEY_USER_TOKEN = "system_user_token_"; // + userId
+	public static final String KEY_TOKEN_USER = "system_token_user_"; // + token
+}

+ 16 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/config/shiro/UserModel.java

@@ -0,0 +1,16 @@
+package com.persagy.dmp.rwd.edit.config.shiro;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class UserModel {
+
+	private Integer id;
+	private String token;
+	private String username;
+	private String password;
+	private List<String> permissions;
+
+}

+ 40 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/config/web/UserUtils.java

@@ -0,0 +1,40 @@
+package com.persagy.dmp.rwd.edit.config.web;
+
+import com.persagy.dmp.rwd.edit.config.shiro.UserModel;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.subject.Subject;
+import org.springframework.stereotype.Component;
+import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@Component
+public class UserUtils extends HandlerInterceptorAdapter {
+
+    private static final ThreadLocal<Integer> THREAD_LOCAL_USER = new ThreadLocal<Integer>();
+
+    @Override
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+        Subject currentUser = SecurityUtils.getSubject();
+        if (currentUser.isAuthenticated()) {
+            UserModel userModel = (UserModel) currentUser.getPrincipal();
+            THREAD_LOCAL_USER.set(userModel.getId());
+        }
+        return true;
+    }
+
+    @Override
+    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
+        clear();
+    }
+
+    public static Integer currentUserId() {
+        return THREAD_LOCAL_USER.get();
+    }
+
+    public static final void clear() {
+        THREAD_LOCAL_USER.remove();
+    }
+
+}

+ 54 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/config/web/WebConfig.java

@@ -0,0 +1,54 @@
+package com.persagy.dmp.rwd.edit.config.web;
+
+import com.persagy.common.json.JacksonMapper;
+import com.persagy.dmp.rwd.edit.config.shiro.DmpAccessControlFilter;
+import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
+import org.springframework.amqp.support.converter.MessageConverter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * @author: yaoll
+ * @date: 2020-12-29
+ * @verison: 1.0
+ */
+@Configuration
+public class WebConfig implements WebMvcConfigurer {
+
+    @Autowired
+    private UserUtils userUtils;
+
+    /**
+     * 登录拦截器
+     */
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) { // 设置拦截的路径、不拦截的路径、优先级等等
+        registry.addInterceptor(userUtils).addPathPatterns("/**");
+    }
+
+    @Bean
+    public HttpMessageConverters customConverters() {
+        MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
+        converter.setObjectMapper(JacksonMapper.nonEmptyMapper);
+        return new HttpMessageConverters(converter);
+    }
+
+    @Bean
+    public FilterRegistrationBean registration(DmpAccessControlFilter filter) {
+        FilterRegistrationBean registration = new FilterRegistrationBean(filter);
+        registration.setEnabled(false);
+        return registration;
+    }
+
+    @Bean
+    public MessageConverter customMessageConvert() {
+        return new Jackson2JsonMessageConverter();
+    }
+
+}

+ 40 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/AdminRoleController.java

@@ -0,0 +1,40 @@
+package com.persagy.dmp.rwd.edit.controller;
+
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.web.MapResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.entity.AdminRole;
+import com.persagy.dmp.rwd.edit.service.AdminRoleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/rwdedit/system/role")
+public class AdminRoleController {
+    @Autowired
+    private AdminRoleService service;
+
+    @PostMapping("/query")
+    public PagedResponse<AdminRole> query(@RequestBody JacksonCriteria criteria) {
+        return service.query(criteria);
+    }
+
+    @PostMapping("/create")
+    public MapResponse create(@RequestBody AdminRole param) {
+        return service.create(param);
+    }
+
+    @PostMapping("/update")
+    public MapResponse update(@RequestBody AdminRole param) {
+        return service.update(param);
+    }
+
+    @PostMapping("/delete")
+    public MapResponse delete(@RequestBody AdminRole param) {
+        return service.delete(param);
+    }
+
+}

+ 40 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/AdminUserController.java

@@ -0,0 +1,40 @@
+package com.persagy.dmp.rwd.edit.controller;
+
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.web.MapResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.entity.AdminUser;
+import com.persagy.dmp.rwd.edit.service.AdminUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/rwdedit/system/user")
+public class AdminUserController {
+    @Autowired
+    private AdminUserService service;
+
+    @PostMapping("/query")
+    public PagedResponse<AdminUser> query(@RequestBody JacksonCriteria criteria) {
+        return service.query(criteria);
+    }
+
+    @PostMapping("/create")
+    public MapResponse create(@RequestBody AdminUser param) {
+        return service.create(param);
+    }
+
+    @PostMapping("/update")
+    public MapResponse update(@RequestBody AdminUser param) {
+        return service.update(param);
+    }
+
+    @PostMapping("/delete")
+    public MapResponse delete(@RequestBody AdminUser param) {
+        return service.delete(param);
+    }
+
+}

+ 45 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/ClassDefChangeRecordController.java

@@ -0,0 +1,45 @@
+package com.persagy.dmp.rwd.edit.controller;
+
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.web.MapResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.entity.ClassDefChangeRecord;
+import com.persagy.dmp.rwd.edit.service.ClassDefChangeRecordService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/rwdedit/classDef/changeRecord")
+public class ClassDefChangeRecordController {
+
+    @Autowired
+    private ClassDefChangeRecordService service;
+
+    @PostMapping("/query")
+    public PagedResponse<ClassDefChangeRecord> query(@RequestBody JacksonCriteria criteria) {
+        return service.query(criteria);
+    }
+
+    @PostMapping("/create")
+    public MapResponse create(@RequestBody ClassDefChangeRecord param) {
+        return service.create(param);
+    }
+
+    @PostMapping("/update")
+    public MapResponse update(@RequestBody ClassDefChangeRecord param) {
+        return service.update(param);
+    }
+
+    @PostMapping("/delete")
+    public MapResponse delete(@RequestBody ClassDefChangeRecord param) {
+        return service.delete(param);
+    }
+
+    @PostMapping("/addVersion")
+    public MapResponse addVersion(@RequestParam String version, @RequestBody List<Integer> idList) {
+        return service.addVersion(version, idList);
+    }
+
+}

+ 28 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/ClassDefController.java

@@ -0,0 +1,28 @@
+package com.persagy.dmp.rwd.edit.controller;
+
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.json.JacksonMapper;
+import com.persagy.common.web.ListResponse;
+import com.persagy.dmp.rwd.edit.service.ClassDefService;
+import com.persagy.dmp.rwd.model.ClassDefModel;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Slf4j
+@RestController
+@RequestMapping("/rwdedit/def/class")
+public class ClassDefController {
+    @Autowired
+    private ClassDefService service;
+
+    @PostMapping("")
+    public ListResponse<ClassDefModel> queryClass(@RequestBody JacksonCriteria criteria) {
+        log.info("/class/query: {}", JacksonMapper.toSimpleJson(criteria));
+        return service.queryClass(criteria);
+    }
+
+}

+ 24 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/DtDataController.java

@@ -0,0 +1,24 @@
+package com.persagy.dmp.rwd.edit.controller;
+
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.model.DtDataModel;
+import com.persagy.dmp.rwd.edit.service.DtDataService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/rwdedit/dt/data")
+public class DtDataController {
+
+    @Autowired
+    private DtDataService service;
+
+    @PostMapping("/query")
+    public PagedResponse<DtDataModel> query(@RequestBody JacksonCriteria criteria) {
+        return service.query(criteria);
+    }
+}

+ 44 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/FuncidDefChangeRecordController.java

@@ -0,0 +1,44 @@
+package com.persagy.dmp.rwd.edit.controller;
+
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.web.MapResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.entity.FuncidDefChangeRecord;
+import com.persagy.dmp.rwd.edit.service.FuncidDefChangeRecordService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/rwdedit/funcidDef/changeRecord")
+public class FuncidDefChangeRecordController {
+
+    @Autowired
+    private FuncidDefChangeRecordService service;
+
+    @PostMapping("/query")
+    public PagedResponse<FuncidDefChangeRecord> query(@RequestBody JacksonCriteria criteria) {
+        return service.query(criteria);
+    }
+
+    @PostMapping("/create")
+    public MapResponse create(@RequestBody FuncidDefChangeRecord param) {
+        return service.create(param);
+    }
+
+    @PostMapping("/update")
+    public MapResponse update(@RequestBody FuncidDefChangeRecord param) {
+        return service.update(param);
+    }
+
+    @PostMapping("/delete")
+    public MapResponse delete(@RequestBody FuncidDefChangeRecord param) {
+        return service.delete(param);
+    }
+
+    @PostMapping("/addVersion")
+    public MapResponse addVersion(@RequestParam String version, @RequestBody List<Integer> idList) {
+        return service.addVersion(version, idList);
+    }
+}

+ 23 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/FuncidDefController.java

@@ -0,0 +1,23 @@
+package com.persagy.dmp.rwd.edit.controller;
+
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.web.ListResponse;
+import com.persagy.dmp.rwd.edit.service.FuncidDefService;
+import com.persagy.dmp.rwd.model.FuncidDefModel;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/rwdedit/def/funcid")
+public class FuncidDefController {
+    @Autowired
+    private FuncidDefService service;
+
+    @PostMapping("")
+    public ListResponse<FuncidDefModel> query(@RequestBody JacksonCriteria criteria) {
+        return service.queryFuncid(criteria);
+    }
+}

+ 40 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/RwdeditRefTypeController.java

@@ -0,0 +1,40 @@
+package com.persagy.dmp.rwd.edit.controller;
+
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.web.MapResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.model.RwdeditRefTypeModel;
+import com.persagy.dmp.rwd.edit.service.RwdeditRefTypeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/rwdedit/ref/type")
+public class RwdeditRefTypeController {
+
+    @Autowired
+    private RwdeditRefTypeService service;
+
+    @PostMapping("/query")
+    public PagedResponse<RwdeditRefTypeModel> query(@RequestBody JacksonCriteria criteria) {
+        return service.query(criteria);
+    }
+
+    @PostMapping("/create")
+    public MapResponse create(@RequestBody RwdeditRefTypeModel params) {
+        return service.create(params);
+    }
+
+    @PostMapping("/update")
+    public MapResponse update(@RequestBody RwdeditRefTypeModel params) {
+        return service.update(params);
+    }
+
+    @PostMapping("/delete")
+    public MapResponse delete(@RequestBody RwdeditRefTypeModel params) {
+        return service.delete(params);
+    }
+}

+ 40 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/RwdeditRefTypeInfoController.java

@@ -0,0 +1,40 @@
+package com.persagy.dmp.rwd.edit.controller;
+
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.web.MapResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.entity.RwdeditRefTypeInfos;
+import com.persagy.dmp.rwd.edit.service.RwdeditRefTypeInfosService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/rwdedit/ref/type/infos")
+public class RwdeditRefTypeInfoController {
+
+    @Autowired
+    private RwdeditRefTypeInfosService service;
+
+    @PostMapping("/query")
+    public PagedResponse<RwdeditRefTypeInfos> query(@RequestBody JacksonCriteria criteria) {
+        return service.query(criteria);
+    }
+
+    @PostMapping("/create")
+    public MapResponse create(@RequestBody RwdeditRefTypeInfos params) {
+        return service.create(params);
+    }
+
+    @PostMapping("/update")
+    public MapResponse update(@RequestBody RwdeditRefTypeInfos params) {
+        return service.update(params);
+    }
+
+    @PostMapping("/delete")
+    public MapResponse delete(@RequestBody RwdeditRefTypeInfos params) {
+        return service.delete(params);
+    }
+}

+ 45 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/RwdeditVersionController.java

@@ -0,0 +1,45 @@
+package com.persagy.dmp.rwd.edit.controller;
+
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.web.MapResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.entity.RwdeditVersion;
+import com.persagy.dmp.rwd.edit.service.RwdeditVersionService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+
+@RestController
+@RequestMapping("/rwdedit/version")
+public class RwdeditVersionController {
+
+    @Autowired
+    private RwdeditVersionService service;
+
+    @PostMapping("/query")
+    public PagedResponse<RwdeditVersion> query(@RequestBody JacksonCriteria criteria) {
+        return service.query(criteria);
+    }
+
+    @PostMapping("/create")
+    public MapResponse create(@RequestBody RwdeditVersion param) {
+        return service.create(param);
+    }
+
+    @PostMapping("/update")
+    public MapResponse update(@RequestBody RwdeditVersion param) {
+        return service.update(param);
+    }
+
+    @PostMapping("/delete")
+    public MapResponse delete(@RequestBody RwdeditVersion param) {
+        return service.delete(param);
+    }
+
+    @PostMapping("/download")
+    public void download(@RequestParam String version, HttpServletResponse response) {
+        service.download(response, version);
+    }
+
+}

+ 34 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/UserController.java

@@ -0,0 +1,34 @@
+package com.persagy.dmp.rwd.edit.controller;
+
+import com.persagy.common.web.MapResponse;
+import com.persagy.dmp.rwd.edit.config.shiro.UserModel;
+import com.persagy.dmp.rwd.edit.service.UserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/rwdedit")
+public class UserController {
+
+    @Autowired
+    private UserService userService;
+
+    @PostMapping("/login")
+    public MapResponse login(@RequestBody UserModel userModel) {
+        System.out.println("controller : /rwdedit/login");
+        return userService.login(userModel);
+    }
+
+    @PostMapping("/logout")
+    public MapResponse login() {
+        return userService.logout();
+    }
+
+    @PostMapping("/userInfo")
+    public MapResponse userInfo() {
+        return userService.userInfo();
+    }
+}

+ 30 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/AdminPermission.java

@@ -0,0 +1,30 @@
+package com.persagy.dmp.rwd.edit.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.hibernate.annotations.CreationTimestamp;
+import org.hibernate.annotations.UpdateTimestamp;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "admin_permission")
+public class AdminPermission {
+
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	private Integer id;
+	private String sign;
+	private String name;
+	private String remark;
+	private Integer status;
+	@CreationTimestamp
+	@Column(updatable = false)
+	private Date createTime;
+	@UpdateTimestamp
+	private Date updateTime;
+
+}

+ 41 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/AdminRole.java

@@ -0,0 +1,41 @@
+package com.persagy.dmp.rwd.edit.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.hibernate.annotations.CreationTimestamp;
+import org.hibernate.annotations.UpdateTimestamp;
+
+import javax.persistence.*;
+import java.util.Date;
+import java.util.List;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "admin_role")
+public class AdminRole {
+
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	private Integer id;
+	private String name;
+	private String remark;
+	private Integer status;
+	@Column(updatable = false)
+	private Integer createUser;
+	@CreationTimestamp
+	@Column(updatable = false)
+	private Date createTime;
+	private Integer updateUser;
+	@UpdateTimestamp
+	private Date updateTime;
+
+	@JoinTable(name = "admin_role_permission", joinColumns = {
+			@JoinColumn(name = "role_id", referencedColumnName = "id")},
+			inverseJoinColumns = {
+					@JoinColumn(name = "permission_id", referencedColumnName = "id")
+			})
+	@ManyToMany(targetEntity = AdminPermission.class, fetch = FetchType.LAZY)
+	@OrderBy("id")
+	private List<AdminPermission> permissions;
+}

+ 47 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/AdminUser.java

@@ -0,0 +1,47 @@
+package com.persagy.dmp.rwd.edit.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.hibernate.annotations.CreationTimestamp;
+import org.hibernate.annotations.UpdateTimestamp;
+
+import javax.persistence.*;
+import java.util.Date;
+import java.util.List;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "admin_user")
+public class AdminUser {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+    private String username;
+    private String password;
+    private String realname;
+    private String phone;
+    private String remark;
+    private Integer status;
+    @Column(updatable = false)
+    private Integer createUser;
+    @CreationTimestamp
+    @Column(updatable = false)
+    private Date createTime;
+    private Integer updateUser;
+    @UpdateTimestamp
+    private Date updateTime;
+
+    @JoinTable(name = "admin_user_role", joinColumns = {
+            @JoinColumn(name = "user_id", referencedColumnName = "id")},
+            inverseJoinColumns = {
+                    @JoinColumn(name = "role_id", referencedColumnName = "id")
+            })
+    @ManyToMany(targetEntity = AdminRole.class, fetch = FetchType.LAZY)
+    @OrderBy("id")
+    private List<AdminRole> roles;
+
+    @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, mappedBy = "user")
+    private List<AdminUserProject> projects;
+}

+ 27 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/AdminUserProject.java

@@ -0,0 +1,27 @@
+package com.persagy.dmp.rwd.edit.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.persistence.*;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "admin_user_project")
+public class AdminUserProject {
+
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	private Integer id;
+
+	@JsonIgnore
+	@ManyToOne
+	@JoinColumn(name = "user_id")
+	private AdminUser user;
+
+	private String groupCode;
+	private String projectId;
+
+}

+ 70 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/ClassDef.java

@@ -0,0 +1,70 @@
+package com.persagy.dmp.rwd.edit.entity;
+
+import com.persagy.dmp.rwd.enums.ObjType;
+import com.persagy.dmp.rwd.model.ClassDefModel;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.persistence.*;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "rwd_def_class")
+@IdClass(GroupPK.class)
+public class ClassDef {
+
+	@Id
+	private String id;
+	@Id
+	private String groupCode;
+	private String code;
+	@Enumerated(value = EnumType.STRING)
+	private ObjType objType;
+	private String name;
+	private String aliasCode;
+	private String aliasName;
+	private String type;
+	private String projectId;
+	private String majorCode;
+	private String systemCode;
+	private String equipmentCode;
+	private String parentCode;
+
+	public static ClassDef fromModel(ClassDefModel model) {
+		ClassDef entity = new ClassDef();
+		entity.setId(model.getId());
+		entity.setCode(model.getCode());
+		entity.setObjType(model.getObjType());
+		entity.setName(model.getName());
+		entity.setAliasCode(model.getAliasCode());
+		entity.setAliasName(model.getAliasName());
+		entity.setType(model.getType());
+		entity.setGroupCode(model.getGroupCode());
+		entity.setProjectId(model.getProjectId());
+		entity.setMajorCode(model.getMajorCode());
+		entity.setSystemCode(model.getSystemCode());
+		entity.setEquipmentCode(model.getEquipmentCode());
+		entity.setParentCode(model.getParentCode());
+		return entity;
+	}
+
+	public ClassDefModel toModel() {
+		ClassDefModel model = new ClassDefModel();
+		model.setId(this.getId());
+		model.setCode(this.getCode());
+		model.setObjType(this.getObjType());
+		model.setName(this.getName());
+		model.setAliasCode(this.getAliasCode());
+		model.setAliasName(this.getAliasName());
+		model.setType(this.getType());
+		model.setGroupCode(this.getGroupCode());
+		model.setProjectId(this.getProjectId());
+		model.setMajorCode(this.getMajorCode());
+		model.setSystemCode(this.getSystemCode());
+		model.setEquipmentCode(this.getEquipmentCode());
+		model.setParentCode(this.getParentCode());
+		return model;
+	}
+
+}

+ 52 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/ClassDefChangeRecord.java

@@ -0,0 +1,52 @@
+package com.persagy.dmp.rwd.edit.entity;
+
+import com.persagy.dmp.rwd.edit.enumeration.EnumOperationType;
+import com.persagy.dmp.rwd.enums.ObjType;
+import com.vladmihalcea.hibernate.type.json.JsonStringType;
+import lombok.Getter;
+import lombok.Setter;
+import org.hibernate.annotations.SQLDelete;
+import org.hibernate.annotations.TypeDef;
+import org.hibernate.annotations.Where;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "rwd_def_class_change_record")
+@TypeDef(name = "json", typeClass = JsonStringType.class)
+@Where(clause = "valid = 1")
+@SQLDelete(sql = "update rwd_def_class_change_record set valid = 0 where id = ?")
+public class ClassDefChangeRecord {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+    private String code;
+    private String groupCode;
+    @Enumerated(value = EnumType.STRING)
+    private ObjType objType;
+    private String name;
+    private String aliasCode;
+    private String aliasName;
+    private String type;
+    private String projectId;
+    private String majorCode;
+    private String systemCode;
+    private String equipmentCode;
+    private String parentCode;
+    @Enumerated(EnumType.STRING)
+    private EnumOperationType operationType;//操作类型
+    private String operationUser;//操作人
+    private Date operationTime;//操作时间
+    private String confirmUser;//确认人
+    private Date confirmTime;//确认时间
+    private String publishUser;//发布人
+    private Date publishTime;//发布时间
+    private Date finishTime;//完成时间
+    private Boolean valid;//true 正常 false 失效
+    private Integer state;//状态 0.取消 1.初始化 2.确认 3.发布 4.完成
+    private String version;//版本
+}

+ 73 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/DtData.java

@@ -0,0 +1,73 @@
+package com.persagy.dmp.rwd.edit.entity;
+
+import com.persagy.dmp.rwd.edit.model.DtDataModel;
+import lombok.Getter;
+import lombok.Setter;
+import org.hibernate.annotations.GenericGenerator;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.util.Date;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "dic_dt_data")
+public class DtData {
+
+    @Id
+    @GeneratedValue(generator = "assignedId")
+    @GenericGenerator(name = "assignedId", strategy = "assigned")
+    private String id;
+    private String dictTypeId;
+    private String parentId;
+    private String type;
+    private String code;
+    private String label;
+    private Integer orderNum;
+    private Integer status;
+    private Date createTime;
+    private String createUser;
+    private Date updateTime;
+    private String updateUser;
+    private String remark;
+
+    public static DtData fromModel(DtDataModel model) {
+        DtData entity = new DtData();
+        entity.setId(model.getId());
+        entity.setDictTypeId(model.getDictTypeId());
+        entity.setParentId(model.getParentId());
+        entity.setType(model.getType());
+        entity.setCode(model.getCode());
+        entity.setLabel(model.getLabel());
+        entity.setOrderNum(model.getOrderNum());
+        entity.setStatus(model.getStatus());
+        entity.setCreateTime(model.getCreateTime());
+        entity.setCreateUser(model.getCreateUser());
+        entity.setUpdateTime(model.getUpdateTime());
+        entity.setUpdateUser(model.getUpdateUser());
+        entity.setRemark(model.getRemark());
+        return entity;
+    }
+
+    public DtDataModel toModel() {
+        DtDataModel model = new DtDataModel();
+        model.setId(this.id);
+        model.setDictTypeId(this.getDictTypeId());
+        model.setParentId(this.getParentId());
+        model.setType(this.getType());
+        model.setCode(this.getCode());
+        model.setLabel(this.getLabel());
+        model.setOrderNum(this.getOrderNum());
+        model.setStatus(this.getStatus());
+        model.setCreateTime(this.getCreateTime());
+        model.setCreateUser(this.getCreateUser());
+        model.setUpdateTime(this.getUpdateTime());
+        model.setUpdateUser(this.getUpdateUser());
+        model.setRemark(this.getRemark());
+        return model;
+    }
+
+}

+ 114 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/FuncidDef.java

@@ -0,0 +1,114 @@
+package com.persagy.dmp.rwd.edit.entity;
+
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.persagy.dmp.rwd.enums.FuncidCategory;
+import com.persagy.dmp.rwd.enums.FuncidDataType;
+import com.persagy.dmp.rwd.model.FuncidDefModel;
+import lombok.Getter;
+import lombok.Setter;
+import org.hibernate.annotations.Type;
+
+import javax.persistence.*;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "rwd_def_funcid")
+@IdClass(GroupPK.class)
+public class FuncidDef {
+
+    @Id
+    private String id;
+    @Id
+    private String groupCode;
+    @Column(updatable = false)
+    private String projectId;
+    private String code;
+    private String origCode;
+    private String name;
+    private String aliasCode;
+    private String aliasName;
+    @Column(updatable = false)
+    private String classCode;
+    @Enumerated(EnumType.STRING)
+    private FuncidCategory category;
+    private String type;
+    private String firstTag;
+    private String secondTag;
+    private String priority;
+    private String inputMode;
+    private String unit;
+    @Enumerated(EnumType.STRING)
+    private FuncidDataType dataType;
+    private String origDataType;
+    private Boolean isMultiple = false;
+    private Boolean isRegion = false;
+    private String formater;
+
+    @Type(type = "json")
+    private ArrayNode dataSource;
+    private String note;
+    private Boolean subFlag;
+    private Boolean weakPoint;
+
+    public static FuncidDef fromModel(FuncidDefModel model) {
+        FuncidDef entity = new FuncidDef();
+        entity.setId(model.getId());
+        entity.setCode(model.getCode());
+        entity.setOrigCode(model.getOrigCode());
+        entity.setName(model.getName());
+        entity.setAliasCode(model.getAliasCode());
+        entity.setAliasName(model.getAliasName());
+        entity.setClassCode(model.getClassCode());
+        entity.setCategory(model.getCategory());
+        entity.setType(model.getType());
+        entity.setGroupCode(model.getGroupCode());
+        entity.setProjectId(model.getProjectId());
+        entity.setFirstTag(model.getFirstTag());
+        entity.setSecondTag(model.getSecondTag());
+        entity.setPriority(model.getPriority());
+        entity.setInputMode(model.getInputMode());
+        entity.setUnit(model.getUnit());
+        entity.setDataType(model.getDataType());
+        entity.setOrigDataType(model.getOrigDataType());
+        entity.setIsMultiple(model.getIsMultiple());
+        entity.setIsRegion(model.getIsRegion());
+        entity.setFormater(model.getFormater());
+        entity.setDataSource(model.getDataSource());
+        entity.setNote(model.getNote());
+        entity.setSubFlag(model.getSubFlag());
+        entity.setWeakPoint(model.getWeakPoint());
+        return entity;
+    }
+
+    public FuncidDefModel toModel() {
+        FuncidDefModel model = new FuncidDefModel();
+        model.setId(this.id);
+        model.setCode(this.getCode());
+        model.setOrigCode(this.getOrigCode());
+        model.setName(this.getName());
+        model.setAliasCode(this.aliasCode);
+        model.setAliasName(this.aliasName);
+        model.setClassCode(this.getClassCode());
+        model.setCategory(this.getCategory());
+        model.setType(this.getType());
+        model.setGroupCode(this.getGroupCode());
+        model.setProjectId(this.getProjectId());
+        model.setFirstTag(this.getFirstTag());
+        model.setSecondTag(this.getSecondTag());
+        model.setPriority(this.getPriority());
+        model.setInputMode(this.getInputMode());
+        model.setUnit(this.getUnit());
+        model.setDataType(this.getDataType());
+        model.setOrigDataType(this.getOrigDataType());
+        model.setIsMultiple(this.getIsMultiple());
+        model.setIsRegion(this.getIsRegion());
+        model.setFormater(this.getFormater());
+        model.setDataSource(this.getDataSource());
+        model.setNote(this.getNote());
+        model.setSubFlag(this.getSubFlag());
+        model.setWeakPoint(this.getWeakPoint());
+        return model;
+    }
+
+}

+ 71 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/FuncidDefChangeRecord.java

@@ -0,0 +1,71 @@
+package com.persagy.dmp.rwd.edit.entity;
+
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.persagy.dmp.rwd.edit.enumeration.EnumOperationType;
+import com.persagy.dmp.rwd.enums.FuncidCategory;
+import com.persagy.dmp.rwd.enums.FuncidDataType;
+import com.vladmihalcea.hibernate.type.json.JsonStringType;
+import lombok.Getter;
+import lombok.Setter;
+import org.hibernate.annotations.SQLDelete;
+import org.hibernate.annotations.Type;
+import org.hibernate.annotations.TypeDef;
+import org.hibernate.annotations.Where;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "rwd_def_funcid_change_record")
+@TypeDef(name = "json", typeClass = JsonStringType.class)
+@Where(clause = "valid = 1")
+@SQLDelete(sql = "update rwd_def_funcid_change_record set valid = 0 where id = ?")
+public class FuncidDefChangeRecord {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+    private String code;
+    private String groupCode;
+    @Column(updatable = false)
+    private String projectId;
+    private String origCode;
+    private String name;
+    private String aliasCode;
+    private String aliasName;
+    @Column(updatable = false)
+    private String classCode;
+    @Enumerated(EnumType.STRING)
+    private FuncidCategory category;
+    private String type;
+    private String firstTag;
+    private String secondTag;
+    private String priority;
+    private String inputMode;
+    private String unit;
+    @Enumerated(EnumType.STRING)
+    private FuncidDataType dataType;
+    private String origDataType;
+    private Boolean isMultiple = false;
+    private Boolean isRegion = false;
+    private String formater;
+    @Type(type = "json")
+    private ArrayNode dataSource;
+    private String note;
+    private Boolean subFlag;
+    private Boolean weakPoint;
+    @Enumerated(EnumType.STRING)
+    private EnumOperationType operationType;//操作类型
+    private String operationUser;//操作人
+    private Date operationTime;//操作时间
+    private String confirmUser;//确认人
+    private Date confirmTime;//确认时间
+    private String publishUser;//发布人
+    private Date publishTime;//发布时间
+    private Date finishTime;//完成时间
+    private Boolean valid;//true 正常 false 失效
+    private Integer state;//状态 0.取消 1.初始化 2.确认 3.发布 4.完成
+    private String version;//版本
+}

+ 48 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/GroupPK.java

@@ -0,0 +1,48 @@
+package com.persagy.dmp.rwd.edit.entity;
+
+import javax.persistence.Column;
+import javax.persistence.Embeddable;
+import java.io.Serializable;
+import java.util.Objects;
+
+/**
+ * @author: yaoll
+ * @date: 2020-11-01
+ * @verison: 1.0
+ */
+@Embeddable
+public class GroupPK implements Serializable {
+
+	@Column
+	private String id;
+
+	@Column
+	private String groupCode;
+
+	public GroupPK() {
+	}
+
+	public GroupPK(String id, String groupCode) {
+		this.id = id;
+		this.groupCode = groupCode;
+	}
+
+	@Override
+	public boolean equals(Object o) {
+		if (this == o) return true;
+		if (o == null || getClass() != o.getClass()) return false;
+		GroupPK groupPK = (GroupPK) o;
+		return id.equals(groupPK.id) &&
+				groupCode.equals(groupPK.groupCode);
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(id, groupCode);
+	}
+
+	@Override
+	public String toString() {
+		return "GroupPK{id=\"" + id + "\", groupCode=\"" + groupCode + "\"}";
+	}
+}

+ 48 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/RefTypeInfoPK.java

@@ -0,0 +1,48 @@
+package com.persagy.dmp.rwd.edit.entity;
+
+import javax.persistence.Column;
+import javax.persistence.Embeddable;
+import java.io.Serializable;
+import java.util.Objects;
+
+/**
+ * @author: yaoll
+ * @date: 2020-11-01
+ * @verison: 1.0
+ */
+@Embeddable
+public class RefTypeInfoPK implements Serializable {
+
+    @Column
+    private String refKey;
+
+    @Column
+    private String code;
+
+    public RefTypeInfoPK() {
+    }
+
+    public RefTypeInfoPK(String refKey, String code) {
+        this.refKey = refKey;
+        this.code = code;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        RefTypeInfoPK groupPK = (RefTypeInfoPK) o;
+        return refKey.equals(groupPK.refKey) &&
+                code.equals(groupPK.code);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(refKey, code);
+    }
+
+    @Override
+    public String toString() {
+        return "GroupPK{id=\"" + refKey + "\", groupCode=\"" + code + "\"}";
+    }
+}

+ 59 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/RwdeditRefType.java

@@ -0,0 +1,59 @@
+package com.persagy.dmp.rwd.edit.entity;
+
+import com.persagy.dmp.rwd.edit.model.RwdeditRefTypeModel;
+import lombok.Getter;
+import lombok.Setter;
+import org.hibernate.annotations.CreationTimestamp;
+import org.hibernate.annotations.GenericGenerator;
+import org.hibernate.annotations.UpdateTimestamp;
+
+import javax.persistence.*;
+import java.util.Date;
+import java.util.List;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "rwdedit_ref_type")
+public class RwdeditRefType {
+
+    @Id
+    @GeneratedValue(generator = "assignedId")
+    @GenericGenerator(name = "assignedId", strategy = "assigned")
+    private String refKey;
+    private String name;
+    @Column(updatable = false)
+    private Integer createUser;
+    @CreationTimestamp
+    @Column(updatable = false)
+    private Date createTime;
+    private Integer updateUser;
+    @UpdateTimestamp
+    private Date updateTime;
+
+    @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, mappedBy = "refKey")
+    private List<RwdeditRefTypeInfos> infos;
+
+    public static RwdeditRefType fromModel(RwdeditRefTypeModel model) {
+        RwdeditRefType entity = new RwdeditRefType();
+        entity.setRefKey(model.getRefKey());
+        entity.setName(model.getName());
+        entity.setCreateTime(model.getCreateTime());
+        entity.setUpdateTime(model.getUpdateTime());
+        entity.setCreateUser(model.getCreateUser());
+        entity.setUpdateUser(model.getUpdateUser());
+        entity.setInfos(model.getInfos());
+        return entity;
+    }
+
+    public RwdeditRefTypeModel toModel() {
+        RwdeditRefTypeModel model = new RwdeditRefTypeModel();
+        model.setRefKey(this.getRefKey());
+        model.setName(this.getName());
+        model.setCreateTime(this.getCreateTime());
+        model.setUpdateTime(this.getUpdateTime());
+        model.setCreateUser(this.getCreateUser());
+        model.setUpdateUser(this.getUpdateUser());
+        return model;
+    }
+}

+ 37 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/RwdeditRefTypeInfos.java

@@ -0,0 +1,37 @@
+package com.persagy.dmp.rwd.edit.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import lombok.Getter;
+import lombok.Setter;
+import org.hibernate.annotations.CreationTimestamp;
+import org.hibernate.annotations.Type;
+import org.hibernate.annotations.UpdateTimestamp;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "rwdedit_ref_type_infos")
+@IdClass(RefTypeInfoPK.class)
+public class RwdeditRefTypeInfos {
+
+    @Id
+    private String refKey;
+    @Id
+    private String code;
+    private String name;
+    private String parentCode;
+    @Type(type = "json")
+    private ObjectNode dataSource;
+    @Column(updatable = false)
+    private Integer createUser;
+    @CreationTimestamp
+    @Column(updatable = false)
+    private Date createTime;
+    private Integer updateUser;
+    @UpdateTimestamp
+    private Date updateTime;
+}

+ 26 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/entity/RwdeditVersion.java

@@ -0,0 +1,26 @@
+package com.persagy.dmp.rwd.edit.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.util.Date;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "rwdedit_version")
+public class RwdeditVersion {
+
+    @Id
+    private String version;
+
+    @Column(name = "create_time", insertable = false, updatable = false)
+    private Date createTime;
+    private String createUser;
+    private Integer state;
+
+}

+ 7 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/enumeration/EnumOperationType.java

@@ -0,0 +1,7 @@
+package com.persagy.dmp.rwd.edit.enumeration;
+
+public enum EnumOperationType {
+    create,
+    update,
+    delete
+}

+ 42 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/model/ClassDefChangeRecordModel.java

@@ -0,0 +1,42 @@
+package com.persagy.dmp.rwd.edit.model;
+
+import com.persagy.dmp.rwd.edit.enumeration.EnumOperationType;
+import com.persagy.dmp.rwd.enums.ObjType;
+import com.persagy.dmp.rwd.model.FuncidDefModel;
+import com.vladmihalcea.hibernate.type.json.JsonStringType;
+import lombok.Getter;
+import lombok.Setter;
+import org.hibernate.annotations.SQLDelete;
+import org.hibernate.annotations.TypeDef;
+import org.hibernate.annotations.Where;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Setter
+@Getter
+public class ClassDefChangeRecordModel {
+    private Integer id;
+    private String code;
+    private String groupCode;
+    private ObjType objType;
+    private String name;
+    private String aliasCode;
+    private String aliasName;
+    private String type;
+    private String projectId;
+    private String majorCode;
+    private String systemCode;
+    private String equipmentCode;
+    private String parentCode;
+    private EnumOperationType operationType;//操作类型
+    private String operationUser;//操作人
+    private Date operationTime;//操作时间
+    private String confirmUser;//确认人
+    private Date confirmTime;//确认时间
+    private String publishUser;//发布人
+    private Date publishTime;//发布时间
+    private Date finishTime;//完成时间
+    private Boolean valid;//true 正常 false 失效
+    private Integer state;//状态 0.取消 1.初始化 2.确认 3.发布 4.完成
+}

+ 26 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/model/DtDataModel.java

@@ -0,0 +1,26 @@
+package com.persagy.dmp.rwd.edit.model;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+@Setter
+@Getter
+public class DtDataModel {
+
+    private String id;
+    private String dictTypeId;
+    private String parentId;
+    private String type;
+    private String code;
+    private String label;
+    private Integer orderNum;
+    private Integer status;
+    private Date createTime;
+    private String createUser;
+    private Date updateTime;
+    private String updateUser;
+    private String remark;
+
+}

+ 21 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/model/RwdeditRefTypeModel.java

@@ -0,0 +1,21 @@
+package com.persagy.dmp.rwd.edit.model;
+
+import com.persagy.dmp.rwd.edit.entity.RwdeditRefTypeInfos;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+import java.util.List;
+
+@Setter
+@Getter
+public class RwdeditRefTypeModel {
+
+    private String refKey;
+    private String name;
+    private Integer createUser;
+    private Date createTime;
+    private Integer updateUser;
+    private Date updateTime;
+    private List<RwdeditRefTypeInfos> infos;
+}

+ 27 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/AdminPermissionRepository.java

@@ -0,0 +1,27 @@
+package com.persagy.dmp.rwd.edit.repository;
+
+import com.persagy.dmp.rwd.edit.entity.AdminPermission;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.querydsl.QuerydslPredicateExecutor;
+
+import java.util.List;
+
+public interface AdminPermissionRepository extends JpaRepository<AdminPermission, Integer>, QuerydslPredicateExecutor<AdminPermission> {
+
+    @Query(nativeQuery = true,
+            value = "" +
+                    " select distinct sign                                                   " +
+                    "   from admin_permission p                                              " +
+                    "   join admin_role_permission rp on p.id = rp.permission_id             " +
+                    "   join admin_role r on rp.role_id = r.id                               " +
+                    "   join admin_user_role ur on ur.role_id = r.id                         " +
+                    "  where ur.user_id = ?                                                  " +
+                    "    and p.status = 1                                                    " +
+                    "    and r.status = 1                                                    " +
+                    "  order by sign                                                         ")
+    List<String> queryForUser(Integer userId);
+
+
+}
+

+ 9 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/AdminRoleRepository.java

@@ -0,0 +1,9 @@
+package com.persagy.dmp.rwd.edit.repository;
+
+import com.persagy.dmp.rwd.edit.entity.AdminRole;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.querydsl.QuerydslPredicateExecutor;
+
+public interface AdminRoleRepository extends JpaRepository<AdminRole, Integer>, QuerydslPredicateExecutor<AdminRole> {
+}
+

+ 9 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/AdminUserProjectRepository.java

@@ -0,0 +1,9 @@
+package com.persagy.dmp.rwd.edit.repository;
+
+import com.persagy.dmp.rwd.edit.entity.AdminUserProject;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.querydsl.QuerydslPredicateExecutor;
+
+public interface AdminUserProjectRepository extends JpaRepository<AdminUserProject, Integer>, QuerydslPredicateExecutor<AdminUserProject> {
+}
+

+ 9 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/AdminUserRepository.java

@@ -0,0 +1,9 @@
+package com.persagy.dmp.rwd.edit.repository;
+
+import com.persagy.dmp.rwd.edit.entity.AdminUser;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.querydsl.QuerydslPredicateExecutor;
+
+public interface AdminUserRepository extends JpaRepository<AdminUser, Integer>, QuerydslPredicateExecutor<AdminUser> {
+}
+

+ 17 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/ClassDefChangeRecordRepository.java

@@ -0,0 +1,17 @@
+package com.persagy.dmp.rwd.edit.repository;
+
+import com.persagy.dmp.rwd.edit.entity.ClassDefChangeRecord;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.querydsl.QuerydslPredicateExecutor;
+
+import java.util.List;
+
+public interface ClassDefChangeRecordRepository extends JpaRepository<ClassDefChangeRecord, Integer>, QuerydslPredicateExecutor<ClassDefChangeRecord> {
+
+    @Modifying
+    @Query(nativeQuery = true, value = "update rwd_def_class_change_record set version = ?1 where version is null and id in (?2)")
+    Integer addVersion(String version, List<Integer> idList);
+}
+

+ 17 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/FuncidDefChangeRecordRepository.java

@@ -0,0 +1,17 @@
+package com.persagy.dmp.rwd.edit.repository;
+
+import com.persagy.dmp.rwd.edit.entity.FuncidDefChangeRecord;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.querydsl.QuerydslPredicateExecutor;
+
+import java.util.List;
+
+public interface FuncidDefChangeRecordRepository extends JpaRepository<FuncidDefChangeRecord, Integer>, QuerydslPredicateExecutor<FuncidDefChangeRecord> {
+
+    @Modifying
+    @Query(nativeQuery = true, value = "update rwd_def_funcid_change_record set version = ?1 where version is null and id in (?2)")
+    Integer addVersion(String version, List<Integer> idList);
+}
+

+ 9 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/RwdeditRefTypeInfosRepository.java

@@ -0,0 +1,9 @@
+package com.persagy.dmp.rwd.edit.repository;
+
+import com.persagy.dmp.rwd.edit.entity.RwdeditRefTypeInfos;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.querydsl.QuerydslPredicateExecutor;
+
+public interface RwdeditRefTypeInfosRepository extends JpaRepository<RwdeditRefTypeInfos, String>, QuerydslPredicateExecutor<RwdeditRefTypeInfos> {
+}
+

+ 9 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/RwdeditRefTypeRepository.java

@@ -0,0 +1,9 @@
+package com.persagy.dmp.rwd.edit.repository;
+
+import com.persagy.dmp.rwd.edit.entity.RwdeditRefType;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.querydsl.QuerydslPredicateExecutor;
+
+public interface RwdeditRefTypeRepository extends JpaRepository<RwdeditRefType, String>, QuerydslPredicateExecutor<RwdeditRefType> {
+}
+

+ 9 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/repository/RwdeditVersionRepository.java

@@ -0,0 +1,9 @@
+package com.persagy.dmp.rwd.edit.repository;
+
+import com.persagy.dmp.rwd.edit.entity.RwdeditVersion;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.querydsl.QuerydslPredicateExecutor;
+
+public interface RwdeditVersionRepository extends JpaRepository<RwdeditVersion, String>, QuerydslPredicateExecutor<RwdeditVersion> {
+}
+

+ 152 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/AdminRoleService.java

@@ -0,0 +1,152 @@
+package com.persagy.dmp.rwd.edit.service;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.common.criteria.CriteriaUtils;
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.web.MapResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.config.web.UserUtils;
+import com.persagy.dmp.rwd.edit.entity.AdminPermission;
+import com.persagy.dmp.rwd.edit.entity.AdminRole;
+import com.persagy.dmp.rwd.edit.entity.QAdminPermission;
+import com.persagy.dmp.rwd.edit.entity.QAdminRole;
+import com.persagy.dmp.rwd.edit.repository.AdminPermissionRepository;
+import com.persagy.dmp.rwd.edit.repository.AdminRoleRepository;
+import com.querydsl.core.types.dsl.BooleanExpression;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.transaction.Transactional;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+
+@Service
+public class AdminRoleService {
+
+    @Autowired
+    private AdminRoleRepository adminRoleRepository;
+
+    @Autowired
+    private AdminPermissionRepository permissionRepository;
+
+    @Autowired
+    private CriteriaUtils criteriaUtils;
+
+    private List<BooleanExpression> parse(ObjectNode criteria) {
+        // TODO
+        return null;
+    }
+
+    public PagedResponse<AdminRole> query(JacksonCriteria criteria) {
+        PagedResponse<AdminRole> query = criteriaUtils.query(QAdminRole.adminRole, this::parse, criteria);
+
+        // permissions
+        PagedResponse<AdminRole> resp = new PagedResponse<>();
+        resp.setCount(query.getCount());
+        List<AdminRole> data = query.getData();
+        if (data != null) {
+            boolean withPermissions = criteria.withColumn("permissions");
+            List<AdminRole> list = new ArrayList<>(data.size());
+            for (AdminRole role : data) {
+                AdminRole model = new AdminRole();
+                BeanUtils.copyProperties(role, model, "permissions");
+                if (withPermissions) {
+                    model.setPermissions(role.getPermissions());
+                }
+                list.add(model);
+            }
+            resp.setData(list);
+        }
+        return resp;
+    }
+
+    @Transactional
+    public MapResponse create(AdminRole param) {
+        MapResponse response = new MapResponse();
+        // TODO
+        String name = param.getName();
+        if (name == null) {
+            response.setFail("name is required");
+            return response;
+        }
+
+        long count = adminRoleRepository.count(QAdminRole.adminRole.name.eq(name));
+        if (count > 0) {
+            response.setFail("name is exists");
+            return response;
+        }
+
+        AdminRole role = new AdminRole();
+        role.setName(param.getName());
+        role.setRemark(param.getRemark());
+        role.setCreateUser(UserUtils.currentUserId());
+        role.setStatus(1);
+        adminRoleRepository.save(role);
+        response.add("id", role.getId());
+        return response;
+    }
+
+    @Transactional
+    public MapResponse update(AdminRole param) {
+        MapResponse response = new MapResponse();
+        // TODO
+        Integer roleId = param.getId();
+        Optional<AdminRole> opt = adminRoleRepository.findById(roleId);
+        if (!opt.isPresent()) {
+            response.setFail("data not exists");
+            return response;
+        }
+
+        AdminRole role = opt.get();
+        if (param.getRemark() != null) {
+            role.setRemark(param.getRemark());
+        }
+
+        // TODO
+        List<AdminPermission> permissions = param.getPermissions();
+        if (permissions != null) {
+            role.getPermissions().clear();
+            for (AdminPermission permission : permissions) {
+                if (permission.getSign() == null) {
+                    continue;
+                }
+
+                AdminPermission entity;
+                Optional<AdminPermission> optp = permissionRepository.findOne(QAdminPermission.adminPermission.sign.eq(permission.getSign()));
+                if (!optp.isPresent()) {
+                    entity = new AdminPermission();
+                    entity.setSign(permission.getSign());
+                    entity.setStatus(1);
+                    permissionRepository.save(entity);
+                } else {
+                    entity = optp.get();
+                    if (entity.getStatus() != 1) {
+                        continue;
+                    }
+                }
+                role.getPermissions().add(entity);
+            }
+        }
+        role.setUpdateUser(UserUtils.currentUserId());
+        adminRoleRepository.save(role);
+        return response;
+    }
+
+    @Transactional
+    public MapResponse delete(AdminRole param) {
+        MapResponse response = new MapResponse();
+        // TODO
+        Integer userId = param.getId();
+        Optional<AdminRole> opt = adminRoleRepository.findById(userId);
+        if (opt.isPresent()) {
+            AdminRole role = opt.get();
+            role.setStatus(0);
+            role.setUpdateUser(UserUtils.currentUserId());
+            adminRoleRepository.save(role);
+        }
+        return response;
+    }
+}
+

+ 143 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/AdminUserService.java

@@ -0,0 +1,143 @@
+package com.persagy.dmp.rwd.edit.service;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.common.criteria.CriteriaUtils;
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.security.MD5Utils;
+import com.persagy.common.web.MapResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.config.web.UserUtils;
+import com.persagy.dmp.rwd.edit.entity.AdminRole;
+import com.persagy.dmp.rwd.edit.entity.AdminUser;
+import com.persagy.dmp.rwd.edit.entity.AdminUserProject;
+import com.persagy.dmp.rwd.edit.entity.QAdminUser;
+import com.persagy.dmp.rwd.edit.repository.AdminUserRepository;
+import com.querydsl.core.types.dsl.BooleanExpression;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.transaction.Transactional;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+@Service
+public class AdminUserService {
+
+    @Autowired
+    private AdminUserRepository adminUserRepository;
+
+    @Autowired
+    private CriteriaUtils criteriaUtils;
+
+    private List<BooleanExpression> parse(ObjectNode criteria) {
+        // TODO
+        return null;
+    }
+
+    public PagedResponse<AdminUser> query(JacksonCriteria criteria) {
+        PagedResponse<AdminUser> query = criteriaUtils.query(QAdminUser.adminUser, this::parse, criteria);
+        PagedResponse<AdminUser> resp = new PagedResponse<>();
+        resp.setCount(query.getCount());
+        List<AdminUser> data = query.getData();
+        if (data != null && data.size() > 0) {
+            Set<String> withColumns = criteria.getWithColumns();
+            List<AdminUser> list = new ArrayList<>(data.size());
+            boolean withRoles = withColumns != null && withColumns.contains("roles");
+            boolean withProjects = withColumns != null && withColumns.contains("projects");
+            for (AdminUser user : data) {
+                AdminUser model = new AdminUser();
+                BeanUtils.copyProperties(user, model, "password", "roles", "projects");
+                if (withRoles) {
+                    model.setRoles(user.getRoles());
+                }
+                if (withProjects) {
+                    model.setProjects(user.getProjects());
+                }
+                list.add(model);
+            }
+            resp.setData(list);
+        }
+        return resp;
+    }
+
+    @Transactional
+    public MapResponse create(AdminUser param) {
+        MapResponse response = new MapResponse();
+        // TODO
+        String username = param.getUsername();
+        if (username == null) {
+            response.setFail("账号不可为空!");
+            return response;
+        }
+        long count = adminUserRepository.count(QAdminUser.adminUser.username.eq(username));
+        if (count > 0) {
+            response.setFail("账号已存在!");
+            return response;
+        }
+
+        AdminUser entity = new AdminUser();
+        entity.setUsername(username);
+        entity.setRealname(param.getRealname());
+        entity.setPassword(MD5Utils.getSign(username + "123456"));
+        entity.setCreateUser(UserUtils.currentUserId());
+        entity.setStatus(1);
+        adminUserRepository.save(entity);
+        response.add("id", entity.getId());
+        return response;
+    }
+
+    @Transactional
+    public MapResponse update(AdminUser param) {
+        MapResponse response = new MapResponse();
+        // TODO
+        Integer userId = param.getId();
+        AdminUser user = adminUserRepository.findById(userId).get();
+        String realname = param.getRealname();
+        if (realname != null) {
+            user.setRealname(realname);
+        }
+        String phone = param.getPhone();
+        if (phone != null) {
+            user.setPhone(phone);
+        }
+        String remark = param.getRemark();
+        if (remark != null) {
+            user.setRemark(remark);
+        }
+
+        List<AdminRole> roles = param.getRoles();
+        if (roles != null) {
+            user.getRoles().clear();
+            user.getRoles().addAll(roles);
+        }
+
+        List<AdminUserProject> projects = param.getProjects();
+        if (projects != null) {
+            user.getProjects().clear();
+            for (AdminUserProject project : projects) {
+                project.setUser(user);
+            }
+            user.getProjects().addAll(projects);
+        }
+
+        adminUserRepository.save(user);
+        response.add("id", userId);
+        return response;
+    }
+
+    @Transactional
+    public MapResponse delete(AdminUser param) {
+        MapResponse response = new MapResponse();
+        // TODO
+
+        Integer id = param.getId();
+        AdminUser user = adminUserRepository.findById(id).get();
+        user.setStatus(0);
+        user.setUpdateUser(UserUtils.currentUserId());
+        adminUserRepository.save(user);
+        return response;
+    }
+}
+

+ 308 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/ClassDefChangeRecordService.java

@@ -0,0 +1,308 @@
+package com.persagy.dmp.rwd.edit.service;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.common.criteria.CriteriaUtils;
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.web.MapResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.config.web.UserUtils;
+import com.persagy.dmp.rwd.edit.entity.ClassDefChangeRecord;
+import com.persagy.dmp.rwd.edit.entity.QClassDefChangeRecord;
+import com.persagy.dmp.rwd.edit.enumeration.EnumOperationType;
+import com.persagy.dmp.rwd.edit.repository.ClassDefChangeRecordRepository;
+import com.persagy.dmp.rwd.model.ClassDefModel;
+import com.querydsl.core.types.dsl.BooleanExpression;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.transaction.Transactional;
+import java.util.*;
+
+@Slf4j
+@Service
+public class ClassDefChangeRecordService {
+
+    @Autowired
+    ClassDefChangeRecordRepository repository;
+
+    @Autowired
+    ClassDefService classDefService;
+
+    @Autowired
+    CriteriaUtils criteriaUtils;
+
+    private List<BooleanExpression> parse(ObjectNode object) {
+        List<BooleanExpression> list = new LinkedList<>();
+        QClassDefChangeRecord qt = QClassDefChangeRecord.classDefChangeRecord;
+        list.addAll(CriteriaUtils.parse(qt.id, object.get("id")));
+        list.addAll(CriteriaUtils.parse(qt.code, object.get("code")));
+        list.addAll(CriteriaUtils.parse(qt.majorCode, object.get("majorCode")));
+        list.addAll(CriteriaUtils.parse(qt.systemCode, object.get("systemCode")));
+        list.addAll(CriteriaUtils.parse(qt.equipmentCode, object.get("equipmentCode")));
+        list.addAll(CriteriaUtils.parse(qt.parentCode, object.get("parentCode")));
+        list.addAll(CriteriaUtils.parse(qt.operationType, object.get("operationType"), EnumOperationType.class));
+        list.addAll(CriteriaUtils.parse(qt.operationUser, object.get("operationUser")));
+        list.addAll(CriteriaUtils.parse(qt.operationTime, object.get("operationTime")));
+        list.addAll(CriteriaUtils.parse(qt.confirmUser, object.get("confirmUser")));
+        list.addAll(CriteriaUtils.parse(qt.confirmTime, object.get("confirmTime")));
+        list.addAll(CriteriaUtils.parse(qt.publishUser, object.get("publishUser")));
+        list.addAll(CriteriaUtils.parse(qt.publishTime, object.get("publishTime")));
+        list.addAll(CriteriaUtils.parse(qt.finishTime, object.get("finishTime")));
+        list.addAll(CriteriaUtils.parse(qt.state, object.get("state")));
+        list.addAll(CriteriaUtils.parse(qt.version, object.get("version")));
+        return list;
+    }
+
+    public PagedResponse<ClassDefChangeRecord> query(JacksonCriteria criteria) {
+        return criteriaUtils.query(QClassDefChangeRecord.classDefChangeRecord, this::parse, criteria);
+    }
+
+    @Transactional
+    public MapResponse create(ClassDefChangeRecord param) {
+        MapResponse response = new MapResponse();
+        String code = param.getCode();
+        if (code == null) {
+            response.setFail("code is required");
+            return response;
+        }
+        List<ClassDefModel> classDefList = queryClassDef(code);
+        if (EnumOperationType.create.equals(param.getOperationType())) {
+            if (classDefList.size() > 0) {
+                response.setFail("code is exists");
+                return response;
+            }
+        } else {
+            if (classDefList.size() == 0) {
+                response.setFail("code not exists");
+                return response;
+            }
+            ClassDefModel classDef = classDefList.get(0);
+            param.setGroupCode(classDef.getGroupCode());
+            param.setObjType(classDef.getObjType());
+            param.setName(classDef.getName());
+            if (param.getAliasCode() == null) {
+                param.setAliasCode(classDef.getAliasCode());
+            }
+            if (param.getAliasName() == null) {
+                param.setAliasName(classDef.getAliasName());
+            }
+            param.setType(classDef.getType());
+            param.setProjectId(classDef.getProjectId());
+            param.setMajorCode(classDef.getMajorCode());
+            param.setSystemCode(classDef.getSystemCode());
+            param.setEquipmentCode(classDef.getEquipmentCode());
+            param.setParentCode(classDef.getParentCode());
+        }
+        QClassDefChangeRecord qt = QClassDefChangeRecord.classDefChangeRecord;
+        BooleanExpression ex = qt.code.eq(code).and(qt.state.eq(1)).and(qt.version.isNull());
+        Iterable<ClassDefChangeRecord> all = repository.findAll(ex);
+        List<ClassDefChangeRecord> list = new ArrayList<>();
+        all.forEach(list::add);
+        if (list.size() > 0) {
+            repository.deleteAll(list);
+        }
+        param.setOperationUser(UserUtils.currentUserId() + "");
+        param.setOperationTime(new Date());
+        param.setValid(true);
+        param.setState(1);
+        repository.save(param);
+        response.add("id", param.getId());
+        return response;
+    }
+
+    private List<ClassDefModel> queryClassDef(String code) {
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.add("type", "common");
+        criteria.add("code", code);
+        PagedResponse<ClassDefModel> query = classDefService.query(criteria);
+        List<ClassDefModel> data = query.getData();
+        return data;
+    }
+
+    @Transactional
+    public MapResponse update(ClassDefChangeRecord param) {
+        MapResponse response = new MapResponse();
+        Optional<ClassDefChangeRecord> optional = repository.findById(param.getId());
+        if (!optional.isPresent()) {
+            response.setFail("code not exists");
+            return response;
+        }
+        ClassDefChangeRecord changeRecord = optional.get();
+        if (changeRecord.getState() == 1 && changeRecord.getVersion() == null) {
+            if (param.getAliasCode() != null) {
+                changeRecord.setAliasCode(param.getAliasCode());
+            }
+            if (param.getAliasName() != null) {
+                changeRecord.setAliasName(param.getAliasName());
+            }
+        }
+        if (param.getState() != null) {
+            switch (param.getState()) {
+                case 2: {
+                    changeRecord.setConfirmUser(UserUtils.currentUserId() + "");
+                    changeRecord.setConfirmTime(new Date());
+                    break;
+                }
+                case 3: {
+                    changeRecord.setPublishUser(UserUtils.currentUserId() + "");
+                    changeRecord.setPublishTime(new Date());
+                    break;
+                }
+                case 4: {
+                    changeRecord.setFinishTime(new Date());
+                    break;
+                }
+                default: {
+                    break;
+                }
+            }
+        }
+        repository.save(changeRecord);
+        return response;
+    }
+
+    @Transactional
+    public void updateStateByVersion(Integer state, String version) {
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.add("version", version);
+        PagedResponse<ClassDefChangeRecord> query = query(criteria);
+        if (query.getCount() == 0) {
+            return;
+        }
+        List<ClassDefChangeRecord> data = query.getData();
+        switch (state) {
+            case 2: {
+                for (ClassDefChangeRecord changeRecord : data) {
+                    changeRecord.setConfirmUser(UserUtils.currentUserId() + "");
+                    changeRecord.setConfirmTime(new Date());
+                }
+                break;
+            }
+            case 3: {
+                for (ClassDefChangeRecord changeRecord : data) {
+                    changeRecord.setPublishUser(UserUtils.currentUserId() + "");
+                    changeRecord.setPublishTime(new Date());
+                }
+                break;
+            }
+            case 4: {
+                for (ClassDefChangeRecord changeRecord : data) {
+                    changeRecord.setFinishTime(new Date());
+                }
+                break;
+            }
+            default: {
+                break;
+            }
+        }
+        repository.saveAll(data);
+    }
+
+    @Transactional
+    public MapResponse addVersion(String version, List<Integer> idList) {
+        MapResponse response = new MapResponse();
+//        JacksonCriteria criteria = JacksonCriteria.newInstance();
+//        criteria.add("version", version);
+//        Long count = rwdeditVersionService.query(criteria).getCount();
+//        if (count == 0) {
+//            response.setFail("version not exists");
+//            return response;
+//        }
+        Integer num = repository.addVersion(version, idList);
+        response.setMessage("update num: " + num);
+        return response;
+    }
+
+    @Transactional
+    public MapResponse delete(ClassDefChangeRecord param) {
+        MapResponse response = new MapResponse();
+        Optional<ClassDefChangeRecord> optional = repository.findById(param.getId());
+        if (optional.isPresent()) {
+            ClassDefChangeRecord changeRecord = optional.get();
+            if (changeRecord.getState() != 1 || changeRecord.getVersion() != null) {
+                response.setFail(changeRecord.getId() + " 不可删除!");
+                return response;
+            }
+        }
+        repository.delete(param);
+        return response;
+    }
+
+    public List<String> getSqlList(String version) {
+        List<String> sqlList = new ArrayList<>();
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.add("version", version);
+        PagedResponse<ClassDefChangeRecord> response = query(criteria);
+        List<ClassDefChangeRecord> data = response.getData();
+        for (ClassDefChangeRecord changeRecord : data) {
+            StringBuilder sql = new StringBuilder();
+            switch (changeRecord.getOperationType()) {
+                case create: {
+                    String uuid = UUID.randomUUID().toString().replace("-", "");
+                    sql.append("INSERT INTO `rwd_def_class` (`id`,`code`,`obj_type`,`name`,`type`,`group_code`,`project_id`,`alias_code`,`alias_name`,`major_code`,`system_code`,`equipment_code`,`parent_code`) VALUES (");
+                    sql.append("'" + uuid + "',");
+                    sql.append("'" + changeRecord.getCode() + "',");
+                    if (changeRecord.getObjType() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getObjType().name() + "',");
+                    }
+                    sql.append("'" + changeRecord.getName() + "',");
+                    if (changeRecord.getType() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getType() + "',");
+                    }
+                    sql.append("'" + changeRecord.getGroupCode() + "',");
+                    sql.append("'" + changeRecord.getProjectId() + "',");
+                    sql.append("'" + changeRecord.getAliasCode() + "',");
+                    sql.append("'" + changeRecord.getAliasName() + "',");
+                    if (changeRecord.getMajorCode() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getMajorCode() + "',");
+                    }
+                    if (changeRecord.getSystemCode() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getSystemCode() + "',");
+                    }
+                    if (changeRecord.getEquipmentCode() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getEquipmentCode() + "',");
+                    }
+                    if (changeRecord.getParentCode() == null) {
+                        sql.append("null);");
+                    } else {
+                        sql.append("'" + changeRecord.getParentCode() + "');");
+                    }
+                    break;
+                }
+                case update: {
+                    sql.append("UPDATE `rwd_def_class` SET");
+                    sql.append(" `alias_code` = '" + changeRecord.getAliasCode() + "',");
+                    sql.append(" `alias_name` = '" + changeRecord.getAliasName() + "'");
+                    sql.append(" WHERE `code` = '" + changeRecord.getCode() + "'");
+                    sql.append(" and `group_code` = '" + changeRecord.getGroupCode() + "'");
+                    sql.append(" and `project_id` = '" + changeRecord.getProjectId() + "';");
+                    break;
+                }
+                case delete: {
+                    sql.append("DELETE FROM `rwd_def_class`");
+                    sql.append(" WHERE `code` = '" + changeRecord.getCode() + "'");
+                    sql.append(" and `group_code` = '" + changeRecord.getGroupCode() + "'");
+                    sql.append(" and `project_id` = '" + changeRecord.getProjectId() + "';");
+                    break;
+                }
+                default: {
+                    break;
+                }
+            }
+            sqlList.add(sql.toString());
+        }
+        return sqlList;
+    }
+}
+

+ 71 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/ClassDefService.java

@@ -0,0 +1,71 @@
+package com.persagy.dmp.rwd.edit.service;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.common.criteria.CriteriaUtils;
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.web.ListResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.entity.ClassDef;
+import com.persagy.dmp.rwd.edit.entity.QClassDef;
+import com.persagy.dmp.rwd.enums.ObjType;
+import com.persagy.dmp.rwd.model.ClassDefModel;
+import com.querydsl.core.types.dsl.BooleanExpression;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class ClassDefService {
+
+    @Autowired
+    private CriteriaUtils criteriaUtils;
+
+    public ListResponse<ClassDefModel> queryClass(JacksonCriteria criteria) {
+        ListResponse<ClassDefModel> resp = new ListResponse<>();
+
+        Map<String, ClassDefModel> map = new HashMap<>();
+        // 查询平台级
+        JacksonCriteria jacksonCriteria = JacksonCriteria.newInstance();
+        jacksonCriteria.getCriteria().setAll(criteria.getCriteria());
+        jacksonCriteria.add("type", "common");
+        jacksonCriteria.add("groupCode", "0");
+        jacksonCriteria.setWithoutCount(true);
+        PagedResponse<ClassDefModel> queryResponse = query(jacksonCriteria);
+        for (ClassDefModel model : queryResponse.getData()) {
+            map.put(model.getCode(), model);
+        }
+
+        List<ClassDefModel> data = new ArrayList<>(map.size());
+        data.addAll(map.values());
+        resp.setData(data);
+        return resp;
+    }
+
+    private List<BooleanExpression> parse(ObjectNode object) {
+        List<BooleanExpression> list = new LinkedList<>();
+        QClassDef qt = QClassDef.classDef;
+        list.addAll(CriteriaUtils.parse(qt.objType, object.get("objType"), ObjType.class));
+        list.addAll(CriteriaUtils.parse(qt.code, object.get("code")));
+        return list;
+    }
+
+    public PagedResponse<ClassDefModel> query(JacksonCriteria criteria) {
+        PagedResponse<ClassDef> resp = criteriaUtils.query(QClassDef.classDef, this::parse, criteria);
+        PagedResponse<ClassDefModel> result = new PagedResponse<>();
+        result.setCount(resp.getCount());
+        List<ClassDef> dataList = resp.getData();
+        if (dataList != null && dataList.size() > 0) {
+            List<ClassDefModel> collect = dataList.stream().map(entity -> {
+                ClassDefModel model = entity.toModel();
+                return model;
+            }).collect(Collectors.toList());
+            result.setData(collect);
+        }
+        return result;
+    }
+}
+

+ 45 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/DtDataService.java

@@ -0,0 +1,45 @@
+package com.persagy.dmp.rwd.edit.service;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.common.criteria.CriteriaUtils;
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.web.MapResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.entity.DtData;
+import com.persagy.dmp.rwd.edit.entity.QDtData;
+import com.persagy.dmp.rwd.edit.model.DtDataModel;
+import com.querydsl.core.types.dsl.BooleanExpression;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class DtDataService {
+
+    @Autowired
+    private CriteriaUtils criteriaUtils;
+
+    private List<BooleanExpression> parse(ObjectNode criteria) {
+        // TODO
+        return null;
+    }
+
+    public PagedResponse<DtDataModel> query(JacksonCriteria criteria) {
+        PagedResponse<DtDataModel> result = new PagedResponse<>();
+
+        PagedResponse<DtData> resp = criteriaUtils.query(QDtData.dtData, this::parse, criteria);
+        result.setCount(resp.getCount());
+        List<DtData> dataList = resp.getData();
+        if (dataList != null && dataList.size() > 0) {
+            List<DtDataModel> collect = dataList.stream().map(entity -> {
+                DtDataModel model = entity.toModel();
+                return model;
+            }).collect(Collectors.toList());
+            result.setData(collect);
+        }
+        return result;
+    }
+}
+

+ 410 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/FuncidDefChangeRecordService.java

@@ -0,0 +1,410 @@
+package com.persagy.dmp.rwd.edit.service;
+
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.common.criteria.CriteriaUtils;
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.json.JacksonMapper;
+import com.persagy.common.web.MapResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.config.web.UserUtils;
+import com.persagy.dmp.rwd.edit.entity.FuncidDefChangeRecord;
+import com.persagy.dmp.rwd.edit.entity.QFuncidDefChangeRecord;
+import com.persagy.dmp.rwd.edit.entity.RwdeditRefTypeInfos;
+import com.persagy.dmp.rwd.edit.enumeration.EnumOperationType;
+import com.persagy.dmp.rwd.edit.repository.FuncidDefChangeRecordRepository;
+import com.persagy.dmp.rwd.enums.FuncidDataType;
+import com.persagy.dmp.rwd.model.FuncidDefModel;
+import com.querydsl.core.types.dsl.BooleanExpression;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.transaction.Transactional;
+import java.util.*;
+
+@Slf4j
+@Service
+public class FuncidDefChangeRecordService {
+
+    @Autowired
+    FuncidDefChangeRecordRepository repository;
+
+    @Autowired
+    FuncidDefService funcidDefService;
+
+    @Autowired
+    RwdeditRefTypeInfosService rwdeditRefTypeInfosService;
+
+    @Autowired
+    CriteriaUtils criteriaUtils;
+
+    private List<BooleanExpression> parse(ObjectNode object) {
+        List<BooleanExpression> list = new LinkedList<>();
+        QFuncidDefChangeRecord qt = QFuncidDefChangeRecord.funcidDefChangeRecord;
+        list.addAll(CriteriaUtils.parse(qt.id, object.get("id")));
+        list.addAll(CriteriaUtils.parse(qt.code, object.get("code")));
+        list.addAll(CriteriaUtils.parse(qt.operationType, object.get("operationType"), EnumOperationType.class));
+        list.addAll(CriteriaUtils.parse(qt.operationUser, object.get("operationUser")));
+        list.addAll(CriteriaUtils.parse(qt.operationTime, object.get("operationTime")));
+        list.addAll(CriteriaUtils.parse(qt.confirmUser, object.get("confirmUser")));
+        list.addAll(CriteriaUtils.parse(qt.confirmTime, object.get("confirmTime")));
+        list.addAll(CriteriaUtils.parse(qt.publishUser, object.get("publishUser")));
+        list.addAll(CriteriaUtils.parse(qt.publishTime, object.get("publishTime")));
+        list.addAll(CriteriaUtils.parse(qt.finishTime, object.get("finishTime")));
+        list.addAll(CriteriaUtils.parse(qt.state, object.get("state")));
+        list.addAll(CriteriaUtils.parse(qt.version, object.get("version")));
+        return list;
+    }
+
+    public PagedResponse<FuncidDefChangeRecord> query(JacksonCriteria criteria) {
+        PagedResponse<FuncidDefChangeRecord> result = criteriaUtils.query(QFuncidDefChangeRecord.funcidDefChangeRecord, this::parse, criteria);
+        return result;
+    }
+
+    @Transactional
+    public MapResponse create(FuncidDefChangeRecord param) {
+        MapResponse response = new MapResponse();
+        String code = param.getCode();
+        String classCode = param.getClassCode();
+        if (code == null) {
+            response.setFail("code is required");
+            return response;
+        }
+        if (classCode == null) {
+            response.setFail("classCode is required");
+            return response;
+        }
+        List<FuncidDefModel> funcidDefList = queryFuncidDef(code, classCode);
+        if (EnumOperationType.create.equals(param.getOperationType())) {
+            if (funcidDefList.size() > 0) {
+                response.setFail("code is exists");
+                return response;
+            }
+        } else {
+            if (funcidDefList.size() == 0) {
+                response.setFail("code not exists");
+                return response;
+            }
+            FuncidDefModel funcidDef = funcidDefList.get(0);
+            param.setOrigCode(funcidDef.getOrigCode());
+            param.setName(funcidDef.getName());
+            if (param.getAliasCode() == null) {
+                param.setAliasCode(funcidDef.getAliasCode());
+            }
+            if (param.getAliasName() == null) {
+                param.setAliasName(funcidDef.getAliasName());
+            }
+            param.setClassCode(funcidDef.getClassCode());
+            param.setCategory(funcidDef.getCategory());
+            param.setType(funcidDef.getType());
+            param.setGroupCode(funcidDef.getGroupCode());
+            param.setProjectId(funcidDef.getProjectId());
+            if (param.getFirstTag() == null) {
+                param.setFirstTag(funcidDef.getFirstTag());
+            }
+            if (param.getSecondTag() == null) {
+                param.setSecondTag(funcidDef.getSecondTag());
+            }
+            param.setPriority(funcidDef.getPriority());
+            param.setInputMode(funcidDef.getInputMode());
+            param.setUnit(funcidDef.getUnit());
+            param.setDataType(funcidDef.getDataType());
+            param.setOrigDataType(funcidDef.getOrigDataType());
+            param.setIsMultiple(funcidDef.getIsMultiple());
+            param.setIsRegion(funcidDef.getIsRegion());
+            param.setFormater(funcidDef.getFormater());
+            param.setDataSource(funcidDef.getDataSource());
+            if (param.getNote() == null) {
+                param.setNote(funcidDef.getNote());
+            }
+            param.setSubFlag(funcidDef.getSubFlag());
+            param.setWeakPoint(funcidDef.getWeakPoint());
+        }
+        QFuncidDefChangeRecord qt = QFuncidDefChangeRecord.funcidDefChangeRecord;
+        BooleanExpression ex = qt.code.eq(code).and(qt.state.eq(1)).and(qt.version.isNull());
+        Iterable<FuncidDefChangeRecord> all = repository.findAll(ex);
+        List<FuncidDefChangeRecord> list = new ArrayList<>();
+        all.forEach(list::add);
+        if (list.size() > 0) {
+            repository.deleteAll(list);
+        }
+        param.setOperationUser(UserUtils.currentUserId() + "");
+        param.setOperationTime(new Date());
+        param.setValid(true);
+        param.setState(1);
+        repository.save(param);
+        response.add("id", param.getId());
+        return response;
+    }
+
+    private List<FuncidDefModel> queryFuncidDef(String code, String classCode) {
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.add("type", "common");
+        criteria.add("code", code);
+        criteria.add("classCode", classCode);
+        PagedResponse<FuncidDefModel> query = funcidDefService.query(criteria);
+        List<FuncidDefModel> data = query.getData();
+        return data;
+    }
+
+    @Transactional
+    public MapResponse update(FuncidDefChangeRecord param) {
+        MapResponse response = new MapResponse();
+        Optional<FuncidDefChangeRecord> optional = repository.findById(param.getId());
+        if (!optional.isPresent()) {
+            response.setFail("code not exists");
+            return response;
+        }
+        FuncidDefChangeRecord changeRecord = optional.get();
+        if (changeRecord.getState() == 1 && changeRecord.getVersion() == null) {
+            if (param.getAliasCode() != null) {
+                changeRecord.setAliasCode(param.getAliasCode());
+            }
+            if (param.getAliasName() != null) {
+                changeRecord.setAliasName(param.getAliasName());
+            }
+            if (param.getFirstTag() != null) {
+                changeRecord.setFirstTag(param.getFirstTag());
+            }
+            if (param.getSecondTag() != null) {
+                changeRecord.setSecondTag(param.getSecondTag());
+            }
+            if (param.getNote() != null) {
+                changeRecord.setNote(param.getNote());
+            }
+        }
+        if (param.getState() != null) {
+            switch (param.getState()) {
+                case 2: {
+                    changeRecord.setConfirmUser(UserUtils.currentUserId() + "");
+                    changeRecord.setConfirmTime(new Date());
+                    break;
+                }
+                case 3: {
+                    changeRecord.setPublishUser(UserUtils.currentUserId() + "");
+                    changeRecord.setPublishTime(new Date());
+                    break;
+                }
+                case 4: {
+                    changeRecord.setFinishTime(new Date());
+                    break;
+                }
+                default: {
+                    break;
+                }
+            }
+        }
+        repository.save(changeRecord);
+        return response;
+    }
+
+    @Transactional
+    public void updateStateByVersion(Integer state, String version) {
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.add("version", version);
+        PagedResponse<FuncidDefChangeRecord> query = query(criteria);
+        if (query.getCount() == 0) {
+            return;
+        }
+        List<FuncidDefChangeRecord> data = query.getData();
+        switch (state) {
+            case 2: {
+                for (FuncidDefChangeRecord changeRecord : data) {
+                    changeRecord.setConfirmUser(UserUtils.currentUserId() + "");
+                    changeRecord.setConfirmTime(new Date());
+                }
+                break;
+            }
+            case 3: {
+                for (FuncidDefChangeRecord changeRecord : data) {
+                    changeRecord.setPublishUser(UserUtils.currentUserId() + "");
+                    changeRecord.setPublishTime(new Date());
+                }
+                break;
+            }
+            case 4: {
+                for (FuncidDefChangeRecord changeRecord : data) {
+                    changeRecord.setFinishTime(new Date());
+                }
+                break;
+            }
+            default: {
+                break;
+            }
+        }
+        repository.saveAll(data);
+    }
+
+    @Transactional
+    public MapResponse addVersion(String version, List<Integer> idList) {
+        MapResponse response = new MapResponse();
+//        JacksonCriteria criteria = JacksonCriteria.newInstance();
+//        criteria.add("version", version);
+//        Long count = rwdeditVersionService.query(criteria).getCount();
+//        if (count == 0) {
+//            response.setFail("version not exists");
+//            return response;
+//        }
+        Integer num = repository.addVersion(version, idList);
+        response.setMessage("update num: " + num);
+        return response;
+    }
+
+    @Transactional
+    public MapResponse delete(FuncidDefChangeRecord param) {
+        MapResponse response = new MapResponse();
+        Optional<FuncidDefChangeRecord> optional = repository.findById(param.getId());
+        if (optional.isPresent()) {
+            FuncidDefChangeRecord changeRecord = optional.get();
+            if (changeRecord.getState() != 1 || changeRecord.getVersion() != null) {
+                response.setFail(changeRecord.getId() + " 不可删除!");
+                return response;
+            }
+        }
+        repository.delete(param);
+        return response;
+    }
+
+    public List<String> getSqlList(String version) {
+        List<String> sqlList = new ArrayList<>();
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.add("version", version);
+        PagedResponse<FuncidDefChangeRecord> response = query(criteria);
+        List<FuncidDefChangeRecord> data = response.getData();
+        for (FuncidDefChangeRecord changeRecord : data) {
+            StringBuilder sql = new StringBuilder();
+            switch (changeRecord.getOperationType()) {
+                case create: {
+                    String uuid = UUID.randomUUID().toString().replace("-", "");
+                    sql.append("INSERT INTO `rwd_def_funcid`(`id`,`code`,`orig_code`,`name`,`alias_code`,`alias_name`,`class_code`,`type`," +
+                            "`group_code`,`project_id`,`category`,`first_tag`,`second_tag`,`priority`,`input_mode`,`unit`,`data_type`,`orig_data_type`," +
+                            "`is_multiple`,`is_region`,`formater`,`data_source`,`note`,`sub_flag`,`weak_point`) VALUES (");
+                    sql.append("'" + uuid + "',");
+                    sql.append("'" + changeRecord.getCode() + "',");
+                    if (changeRecord.getOrigCode() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getOrigCode() + "',");
+                    }
+                    sql.append("'" + changeRecord.getName() + "',");
+                    sql.append("'" + changeRecord.getAliasCode() + "',");
+                    sql.append("'" + changeRecord.getAliasName() + "',");
+                    sql.append("'" + changeRecord.getClassCode() + "',");
+                    if (changeRecord.getType() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getType() + "',");
+                    }
+                    sql.append("'" + changeRecord.getGroupCode() + "',");
+                    sql.append("'" + changeRecord.getProjectId() + "',");
+                    if (changeRecord.getCategory() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getCategory().name() + "',");
+                    }
+                    if (changeRecord.getFirstTag() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getFirstTag() + "',");
+                    }
+                    if (changeRecord.getSecondTag() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getSecondTag() + "',");
+                    }
+                    if (changeRecord.getPriority() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getPriority() + "',");
+                    }
+                    if (changeRecord.getInputMode() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getInputMode() + "',");
+                    }
+                    if (changeRecord.getUnit() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getUnit() + "',");
+                    }
+                    boolean refenumBool = FuncidDataType.REFENUM.equals(changeRecord.getDataType());
+                    if (refenumBool) {
+                        sql.append("'ENUM',");
+                    } else {
+                        sql.append("'" + changeRecord.getDataType().name() + "',");
+                    }
+                    if (changeRecord.getOrigDataType() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getOrigDataType() + "',");
+                    }
+                    if (changeRecord.getIsMultiple() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getIsMultiple() + "',");
+                    }
+                    if (changeRecord.getFormater() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getFormater() + "')");
+                    }
+                    if (refenumBool) {
+                        ArrayNode dataSource = changeRecord.getDataSource();
+                        String refKey = dataSource.get(0).get("refKey").asText();
+                        JacksonCriteria queryRef = JacksonCriteria.newInstance();
+                        queryRef.add("refKey", refKey);
+                        List<RwdeditRefTypeInfos> refInfos = rwdeditRefTypeInfosService.query(queryRef).getData();
+                        sql.append("'" + JacksonMapper.toSimpleJson(refInfos) + "')");
+                    } else {
+                        if (changeRecord.getDataSource() == null) {
+                            sql.append("null,");
+                        } else {
+                            sql.append("'" + JacksonMapper.toSimpleJson(changeRecord.getDataSource()) + "')");
+                        }
+                    }
+                    if (changeRecord.getNote() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getNote() + "')");
+                    }
+                    if (changeRecord.getSubFlag() == null) {
+                        sql.append("null,");
+                    } else {
+                        sql.append("'" + changeRecord.getSubFlag() + "')");
+                    }
+                    if (changeRecord.getWeakPoint() == null) {
+                        sql.append("null);");
+                    } else {
+                        sql.append("'" + changeRecord.getWeakPoint() + "');");
+                    }
+                    break;
+                }
+                case update: {
+                    sql.append("UPDATE `rwd_def_funcid` SET");
+                    sql.append(" `alias_code` = '" + changeRecord.getAliasCode() + "',");
+                    sql.append(" `alias_name` = '" + changeRecord.getAliasName() + "'");
+                    sql.append(" WHERE `code` = '" + changeRecord.getCode() + "'");
+                    sql.append(" WHERE `class_code` = '" + changeRecord.getClassCode() + "'");
+                    sql.append(" and `group_code` = '" + changeRecord.getGroupCode() + "'");
+                    sql.append(" and `project_id` = '" + changeRecord.getProjectId() + "';");
+                    break;
+                }
+                case delete: {
+                    sql.append("DELETE FROM `rwd_def_funcid`");
+                    sql.append(" WHERE `code` = '" + changeRecord.getCode() + "'");
+                    sql.append(" WHERE `class_code` = '" + changeRecord.getClassCode() + "'");
+                    sql.append(" and `group_code` = '" + changeRecord.getGroupCode() + "'");
+                    sql.append(" and `project_id` = '" + changeRecord.getProjectId() + "';");
+                    break;
+                }
+                default: {
+                    break;
+                }
+            }
+            sqlList.add(sql.toString());
+        }
+        return sqlList;
+    }
+}
+

+ 124 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/FuncidDefService.java

@@ -0,0 +1,124 @@
+package com.persagy.dmp.rwd.edit.service;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.common.criteria.CriteriaUtils;
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.web.ListResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.entity.FuncidDef;
+import com.persagy.dmp.rwd.edit.entity.QFuncidDef;
+import com.persagy.dmp.rwd.edit.util.ClassCodeUtils;
+import com.persagy.dmp.rwd.enums.FuncidCategory;
+import com.persagy.dmp.rwd.enums.FuncidDataType;
+import com.persagy.dmp.rwd.model.ClassDefModel;
+import com.persagy.dmp.rwd.model.FuncidDefModel;
+import com.querydsl.core.types.dsl.BooleanExpression;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class FuncidDefService {
+
+    @Autowired
+    private ClassDefService classDefService;
+
+    @Autowired
+    private ClassCodeUtils classCodeUtils;
+
+    @Autowired
+    private CriteriaUtils criteriaUtils;
+
+
+    public ListResponse<FuncidDefModel> queryFuncid(JacksonCriteria request) {
+        ListResponse<FuncidDefModel> resp = new ListResponse<>();
+        List<FuncidDefModel> list = null;
+        boolean hasClassCode = request.getCriteria().has("classCode");
+        if (hasClassCode) {
+            list = queryWithClassCode(request);
+        }
+
+        resp.setData(list);
+        return resp;
+    }
+
+    public PagedResponse<FuncidDefModel> query(JacksonCriteria criteria) {
+        // 预处理criteria
+        classCodeUtils.prepareCriteriaForFuncid(criteria, "classCode");
+
+        PagedResponse<FuncidDef> resp = criteriaUtils.query(QFuncidDef.funcidDef, this::parse, criteria);
+        PagedResponse<FuncidDefModel> result = new PagedResponse<>();
+        result.setCount(resp.getCount());
+        List<FuncidDef> dataList = resp.getData();
+        if (dataList != null && dataList.size() > 0) {
+            List<FuncidDefModel> collect = dataList.stream().map(entity -> {
+                FuncidDefModel model = entity.toModel();
+                return model;
+            }).collect(Collectors.toList());
+            result.setData(collect);
+        }
+        return result;
+    }
+
+    private List<BooleanExpression> parse(ObjectNode object) {
+        // TODO
+        List<BooleanExpression> list = new LinkedList<>();
+        QFuncidDef qt = QFuncidDef.funcidDef;
+        list.addAll(criteriaUtils.parse(qt.category, object.get("category"), FuncidCategory.class));
+        list.addAll(criteriaUtils.parse(qt.dataType, object.get("dataType"), FuncidDataType.class));
+        return list;
+    }
+
+    private List<FuncidDefModel> queryWithClassCode(JacksonCriteria request) {
+        JsonNode classCode = request.getCriteria().get("classCode");
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.getCriteria().set("code", classCode);
+        criteria.setWithoutCount(true);
+        ListResponse<ClassDefModel> classDefModelListResponse = classDefService.queryClass(criteria);
+        List<ClassDefModel> classDefModelList = classDefModelListResponse.getData();
+        List<FuncidDefModel> list = new LinkedList<>();
+        if (classDefModelList.size() > 0) {
+            for (ClassDefModel classDefModel : classDefModelList) {
+                JacksonCriteria funcidCriteria = JacksonCriteria.newInstance();
+                funcidCriteria.getCriteria().setAll(request.getCriteria());
+                if (classDefModel.getParentCode() != null) {
+                    funcidCriteria.add("classCode").in(Arrays.asList(classDefModel.getCode(), classDefModel.getParentCode()));
+                } else {
+                    funcidCriteria.add("classCode", classDefModel.getCode());
+                }
+                List<FuncidDefModel> funcidDefModels = queryWithoutClassCode(funcidCriteria);
+                funcidDefModels.forEach(model -> model.setClassCode(classDefModel.getCode()));
+                list.addAll(funcidDefModels);
+            }
+        }
+        return list;
+    }
+
+    private List<FuncidDefModel> queryWithoutClassCode(JacksonCriteria request) {
+        Map<String, FuncidDefModel> cache = new HashMap<>();
+        // 预处理criteria
+        classCodeUtils.prepareCriteriaForFuncid(request, "classCode");
+
+        ObjectNode requestCriteria = request.getCriteria();
+        // 查询平台级
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.getCriteria().setAll(requestCriteria);
+        criteria.add("type", "common");
+        criteria.add("groupCode", "0");
+        criteria.setWithoutCount(true);
+        PagedResponse<FuncidDefModel> queryResp = query(criteria);
+
+        queryResp.getData().forEach(model -> cache.put(model.getClassCode() + "-" + model.getCode(), model));
+
+        // 继承父级信息点
+        List<FuncidDefModel> list = new LinkedList<>();
+        list.addAll(cache.values());
+        return list;
+    }
+}
+

+ 129 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/RwdeditRefTypeInfosService.java

@@ -0,0 +1,129 @@
+package com.persagy.dmp.rwd.edit.service;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.common.criteria.CriteriaUtils;
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.web.MapResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.config.web.UserUtils;
+import com.persagy.dmp.rwd.edit.entity.QRwdeditRefTypeInfos;
+import com.persagy.dmp.rwd.edit.entity.RwdeditRefTypeInfos;
+import com.persagy.dmp.rwd.edit.repository.RwdeditRefTypeInfosRepository;
+import com.querydsl.core.types.dsl.BooleanExpression;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.transaction.Transactional;
+import java.util.LinkedList;
+import java.util.List;
+
+@Slf4j
+@Service
+public class RwdeditRefTypeInfosService {
+
+    @Autowired
+    private CriteriaUtils criteriaUtils;
+
+    @Autowired
+    RwdeditRefTypeInfosRepository repository;
+
+    private List<BooleanExpression> parse(ObjectNode object) {
+        List<BooleanExpression> list = new LinkedList<>();
+        QRwdeditRefTypeInfos qt = QRwdeditRefTypeInfos.rwdeditRefTypeInfos;
+        list.addAll(CriteriaUtils.parse(qt.refKey, object.get("refKey")));
+        list.addAll(CriteriaUtils.parse(qt.code, object.get("code")));
+        list.addAll(CriteriaUtils.parse(qt.createUser, object.get("createUser")));
+        list.addAll(CriteriaUtils.parse(qt.updateUser, object.get("updateUser")));
+        return list;
+    }
+
+    public PagedResponse<RwdeditRefTypeInfos> query(JacksonCriteria criteria) {
+        return criteriaUtils.query(QRwdeditRefTypeInfos.rwdeditRefTypeInfos, this::parse, criteria);
+    }
+
+    @Transactional
+    public MapResponse create(RwdeditRefTypeInfos refTypeInfos) {
+        MapResponse response = new MapResponse();
+        String refKey = refTypeInfos.getRefKey();
+        String code = refTypeInfos.getCode();
+        if (refKey == null) {
+            response.setFail("refKey is required");
+            return response;
+        }
+        if (code == null) {
+            response.setFail("code is required");
+            return response;
+        }
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.add("refKey", refKey);
+        criteria.add("code", code);
+        Long count = query(criteria).getCount();
+        if (count != 0L) {
+            response.setFail("refKey and code is exists");
+            return response;
+        }
+        refTypeInfos.setCreateUser(UserUtils.currentUserId());
+        repository.save(refTypeInfos);
+        response.add("refKey", refKey);
+        response.add("code", code);
+        return response;
+    }
+
+    @Transactional
+    public MapResponse update(RwdeditRefTypeInfos refTypeInfos) {
+        MapResponse response = new MapResponse();
+        String refKey = refTypeInfos.getRefKey();
+        String code = refTypeInfos.getCode();
+        if (refKey == null) {
+            response.setFail("refKey is required");
+            return response;
+        }
+        if (code == null) {
+            response.setFail("code is required");
+            return response;
+        }
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.add("refKey", refKey);
+        criteria.add("code", code);
+        Long count = query(criteria).getCount();
+        if (count == 0L) {
+            response.setFail("refKey and code not exists");
+            return response;
+        }
+        RwdeditRefTypeInfos entity = query(criteria).getData().get(0);
+        entity.setUpdateUser(UserUtils.currentUserId());
+        if (refTypeInfos.getName() != null) {
+            entity.setName(refTypeInfos.getName());
+        }
+        repository.save(entity);
+        return response;
+    }
+
+    @Transactional
+    public MapResponse delete(RwdeditRefTypeInfos refTypeInfos) {
+        MapResponse response = new MapResponse();
+        String refKey = refTypeInfos.getRefKey();
+        String code = refTypeInfos.getCode();
+        if (refKey == null) {
+            response.setFail("refKey is required");
+            return response;
+        }
+        if (code == null) {
+            response.setFail("code is required");
+            return response;
+        }
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.add("refKey", refKey);
+        criteria.add("code", code);
+        PagedResponse<RwdeditRefTypeInfos> query = query(criteria);
+        Long count = query.getCount();
+        if (count == 0L) {
+            response.setFail("refKey and code not exists");
+            return response;
+        }
+        repository.delete(query.getData().get(0));
+        return response;
+    }
+}
+

+ 116 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/RwdeditRefTypeService.java

@@ -0,0 +1,116 @@
+package com.persagy.dmp.rwd.edit.service;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.common.criteria.CriteriaUtils;
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.web.MapResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.config.web.UserUtils;
+import com.persagy.dmp.rwd.edit.entity.QRwdeditRefType;
+import com.persagy.dmp.rwd.edit.entity.RwdeditRefType;
+import com.persagy.dmp.rwd.edit.model.RwdeditRefTypeModel;
+import com.persagy.dmp.rwd.edit.repository.RwdeditRefTypeRepository;
+import com.querydsl.core.types.dsl.BooleanExpression;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.transaction.Transactional;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class RwdeditRefTypeService {
+
+    @Autowired
+    private CriteriaUtils criteriaUtils;
+
+    @Autowired
+    RwdeditRefTypeRepository repository;
+
+    private List<BooleanExpression> parse(ObjectNode object) {
+        List<BooleanExpression> list = new LinkedList<>();
+        QRwdeditRefType qt = QRwdeditRefType.rwdeditRefType;
+        list.addAll(CriteriaUtils.parse(qt.refKey, object.get("refKey")));
+        list.addAll(CriteriaUtils.parse(qt.createUser, object.get("createUser")));
+        list.addAll(CriteriaUtils.parse(qt.updateUser, object.get("updateUser")));
+        return list;
+    }
+
+    public PagedResponse<RwdeditRefTypeModel> query(JacksonCriteria criteria) {
+        PagedResponse<RwdeditRefType> resp = criteriaUtils.query(QRwdeditRefType.rwdeditRefType, this::parse, criteria);
+        PagedResponse<RwdeditRefTypeModel> result = new PagedResponse<>();
+        result.setCount(resp.getCount());
+        List<RwdeditRefType> dataList = resp.getData();
+        Set<String> withColumns = criteria.getWithColumns();
+        if (dataList != null && dataList.size() > 0) {
+            List<RwdeditRefTypeModel> collect = dataList.stream().map(entity -> {
+                RwdeditRefTypeModel model = entity.toModel();
+                if (withColumns != null && withColumns.contains("infos")) {
+                    model.setInfos(entity.getInfos());
+                }
+                return model;
+            }).collect(Collectors.toList());
+            result.setData(collect);
+        }
+        return result;
+    }
+
+    @Transactional
+    public MapResponse create(RwdeditRefTypeModel param) {
+        MapResponse response = new MapResponse();
+        String refKey = param.getRefKey();
+        if (refKey == null) {
+            response.setFail("refKey is required");
+            return response;
+        }
+        if (repository.findById(refKey).isPresent()) {
+            response.setFail("refKey is exists");
+            return response;
+        }
+        RwdeditRefType refType = RwdeditRefType.fromModel(param);
+        refType.setCreateUser(UserUtils.currentUserId());
+        repository.save(refType);
+        response.add("refKey", refKey);
+        return response;
+    }
+
+    @Transactional
+    public MapResponse update(RwdeditRefTypeModel param) {
+        MapResponse response = new MapResponse();
+        if (param.getRefKey() == null) {
+            response.setFail("refKey is required");
+            return response;
+        }
+        Optional<RwdeditRefType> optional = repository.findById(param.getRefKey());
+        if (!optional.isPresent()) {
+            response.setFail("refKey is exists");
+            return response;
+        }
+        RwdeditRefType refType = optional.get();
+        if (param.getName() != null) {
+            refType.setName(param.getName());
+            refType.setUpdateUser(UserUtils.currentUserId());
+        }
+        repository.save(refType);
+        response.add("refKey", refType.getRefKey());
+        return response;
+    }
+
+    @Transactional
+    public MapResponse delete(RwdeditRefTypeModel param) {
+        MapResponse response = new MapResponse();
+        String refKey = param.getRefKey();
+        if (refKey == null) {
+            response.setFail("refKey is required");
+            return response;
+        }
+        repository.deleteById(param.getRefKey());
+        return response;
+    }
+}
+

+ 173 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/RwdeditVersionService.java

@@ -0,0 +1,173 @@
+package com.persagy.dmp.rwd.edit.service;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.common.criteria.CriteriaUtils;
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.date.DateUtils;
+import com.persagy.common.web.MapResponse;
+import com.persagy.common.web.PagedResponse;
+import com.persagy.dmp.rwd.edit.config.web.UserUtils;
+import com.persagy.dmp.rwd.edit.entity.ClassDefChangeRecord;
+import com.persagy.dmp.rwd.edit.entity.FuncidDefChangeRecord;
+import com.persagy.dmp.rwd.edit.entity.QRwdeditVersion;
+import com.persagy.dmp.rwd.edit.entity.RwdeditVersion;
+import com.persagy.dmp.rwd.edit.repository.RwdeditVersionRepository;
+import com.querydsl.core.types.dsl.BooleanExpression;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.transaction.Transactional;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.URLEncoder;
+import java.util.*;
+
+@Service
+public class RwdeditVersionService {
+
+    @Autowired
+    private CriteriaUtils criteriaUtils;
+
+    @Autowired
+    private RwdeditVersionRepository repository;
+
+    @Autowired
+    private ClassDefChangeRecordService classDefChangeRecordService;
+
+    @Autowired
+    private FuncidDefChangeRecordService funcidDefChangeRecordService;
+
+    private List<BooleanExpression> parse(ObjectNode criteria) {
+        List<BooleanExpression> list = new LinkedList<>();
+        QRwdeditVersion qt = QRwdeditVersion.rwdeditVersion;
+        list.addAll(CriteriaUtils.parse(qt.version, criteria.get("version")));
+        list.addAll(CriteriaUtils.parse(qt.createTime, criteria.get("createTime")));
+        list.addAll(CriteriaUtils.parse(qt.createUser, criteria.get("createUser")));
+        list.addAll(CriteriaUtils.parse(qt.state, criteria.get("state")));
+        return list;
+    }
+
+    public PagedResponse<RwdeditVersion> query(JacksonCriteria criteria) {
+        return criteriaUtils.query(QRwdeditVersion.rwdeditVersion, this::parse, criteria);
+    }
+
+    @Transactional
+    public MapResponse create(RwdeditVersion param) {
+        MapResponse response = new MapResponse();
+        // TODO
+        String version = param.getVersion();
+        if (version == null) {
+            response.setFail("版本编号不可为空!");
+            return response;
+        }
+        long count = repository.count(QRwdeditVersion.rwdeditVersion.version.eq(version));
+        if (count > 0) {
+            response.setFail("版本编号已存在!");
+            return response;
+        }
+
+        RwdeditVersion entity = new RwdeditVersion();
+        entity.setVersion(version);
+        entity.setState(1);
+        entity.setCreateTime(new Date());
+        entity.setCreateUser(UserUtils.currentUserId() + "");
+        repository.save(entity);
+        response.add("id", entity.getVersion());
+        return response;
+    }
+
+    @Transactional
+    public MapResponse update(RwdeditVersion param) {
+        MapResponse response = new MapResponse();
+        String version = param.getVersion();
+        Integer state = param.getState();
+        if (version == null) {
+            response.setFail("version is required");
+            return response;
+        }
+        if (state == null) {
+            response.setFail("state is required");
+            return response;
+        }
+        Optional<RwdeditVersion> data = repository.findById(version);
+        if (!data.isPresent()) {
+            response.setFail("version not exists");
+            return response;
+        }
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.add("version", version);
+        //修改类型变更记录状态
+        classDefChangeRecordService.updateStateByVersion(state, version);
+        //修改信息点变更记录状态
+        funcidDefChangeRecordService.updateStateByVersion(state, version);
+        RwdeditVersion rwdeditVersion = data.get();
+        rwdeditVersion.setState(state);
+        repository.save(rwdeditVersion);
+        return response;
+    }
+
+    @Transactional
+    public MapResponse delete(RwdeditVersion param) {
+        MapResponse response = new MapResponse();
+        String version = param.getVersion();
+        Integer state = param.getState();
+        if (version == null) {
+            response.setFail("version is required");
+            return response;
+        }
+        Optional<RwdeditVersion> data = repository.findById(version);
+        if (!data.isPresent()) {
+            response.setFail("version not exists");
+            return response;
+        }
+        RwdeditVersion rwdeditVersion = data.get();
+        if (state == 1) {
+            repository.delete(rwdeditVersion);
+        } else {
+            JacksonCriteria criteria = JacksonCriteria.newInstance();
+            criteria.add("version", rwdeditVersion.getVersion());
+            PagedResponse<ClassDefChangeRecord> classDefResponse = classDefChangeRecordService.query(criteria);
+            PagedResponse<FuncidDefChangeRecord> funcidDefResponse = funcidDefChangeRecordService.query(criteria);
+            if (classDefResponse.getCount() == 0 && funcidDefResponse.getCount() == 0) {
+                repository.delete(rwdeditVersion);
+            } else {
+                response.setFail("该版本有变更记录不可直接删除");
+            }
+        }
+        return response;
+    }
+
+    @Transactional
+    public void download(HttpServletResponse resp, String version) {
+        String fileName = DateUtils.format(new Date()) + ".sql";
+        List<String> sqlList = new ArrayList<>();
+        sqlList.addAll(classDefChangeRecordService.getSqlList(version));
+        sqlList.addAll(funcidDefChangeRecordService.getSqlList(version));
+
+        OutputStream out = null;
+        try {
+            String resultFileName = URLEncoder.encode(fileName, "UTF-8");
+            resp.reset();// 清空输出流
+            resp.setCharacterEncoding("UTF-8");
+            resp.setHeader("Content-disposition", "attachment; filename=" + resultFileName);
+            resp.setContentType("application/txt");
+            out = resp.getOutputStream();
+            for (String sql : sqlList) {
+                out.write(sql.getBytes());
+            }
+            out.flush();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (out != null) {
+                    out.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+}
+

+ 120 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/UserService.java

@@ -0,0 +1,120 @@
+package com.persagy.dmp.rwd.edit.service;
+
+import com.persagy.common.security.MD5Utils;
+import com.persagy.common.web.MapResponse;
+import com.persagy.dmp.rwd.edit.config.shiro.ShiroContants;
+import com.persagy.dmp.rwd.edit.config.shiro.UserModel;
+import com.persagy.dmp.rwd.edit.config.web.UserUtils;
+import com.persagy.dmp.rwd.edit.entity.AdminUser;
+import com.persagy.dmp.rwd.edit.entity.QAdminUser;
+import com.persagy.dmp.rwd.edit.repository.AdminPermissionRepository;
+import com.persagy.dmp.rwd.edit.repository.AdminUserRepository;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.subject.Subject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Optional;
+import java.util.UUID;
+
+@Service
+public class UserService {
+
+    @Autowired
+    private AdminUserRepository userRepository;
+
+    @Autowired
+    private AdminPermissionRepository permissionRepository;
+
+    @Autowired
+    private StringRedisTemplate redis;
+
+    public MapResponse login(UserModel userModel) {
+        MapResponse resp = new MapResponse();
+
+        String username = userModel.getUsername();
+        String password = userModel.getPassword();
+        if (username == null || password == null) {
+            resp.setFail("username and password is required");
+            return resp;
+        }
+
+        Optional<AdminUser> one = userRepository.findOne(QAdminUser.adminUser.username.eq(username));
+        if (!one.isPresent()) {
+            resp.setFail("username or password error!");
+            return resp;
+        }
+        AdminUser user = one.get();
+        if (user.getStatus() != 1) {
+            resp.setFail("user is invalid!");
+            return resp;
+        }
+
+        if (!MD5Utils.getSign(user.getUsername() + password).equalsIgnoreCase(user.getPassword())) {
+            resp.setFail("username or password error!");
+            return resp;
+        }
+
+        String token = UUID.randomUUID().toString().replace("-", "");
+
+        redis.opsForValue().set(ShiroContants.KEY_TOKEN_USER + token, user.getId() + "");
+        redis.opsForValue().set(ShiroContants.KEY_USER_TOKEN + user.getId(), token);
+
+        Subject subject = SecurityUtils.getSubject();
+        UsernamePasswordToken shiroToken = new UsernamePasswordToken(user.getUsername(), token);
+        subject.login(shiroToken);
+
+        resp.add("token", token);
+        return resp;
+    }
+
+    public MapResponse logout() {
+        MapResponse resp = new MapResponse();
+        Integer userId = UserUtils.currentUserId();
+        if (userId == null) {
+            return resp;
+        }
+
+        String token = redis.opsForValue().get(ShiroContants.KEY_USER_TOKEN + userId);
+        if (token != null) {
+            redis.delete(ShiroContants.KEY_TOKEN_USER + token);
+        }
+        redis.delete(ShiroContants.KEY_USER_TOKEN + userId);
+
+        Subject subject = SecurityUtils.getSubject();
+        if (subject.isAuthenticated()) {
+            subject.logout();
+        }
+        return resp;
+    }
+
+    public MapResponse userInfo() {
+        MapResponse resp = new MapResponse();
+        Integer userId = UserUtils.currentUserId();
+        Optional<AdminUser> one = userRepository.findOne(QAdminUser.adminUser.id.eq(userId));
+        if (!one.isPresent()) {
+            resp.setFail("username or password error!");
+            return resp;
+        }
+        AdminUser user = one.get();
+        if (user.getStatus() != 1) {
+            resp.setFail("user is invalid!");
+            return resp;
+        }
+
+        resp.add("userId", user.getId());
+        resp.add("username", user.getUsername());
+        resp.add("realname", user.getRealname());
+        resp.add("projects", user.getProjects());
+
+        List<String> permissions = permissionRepository.queryForUser(userId);
+        resp.add("permissions", permissions);
+
+
+        return resp;
+    }
+}
+

+ 65 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/util/ClassCodeUtils.java

@@ -0,0 +1,65 @@
+package com.persagy.dmp.rwd.edit.util;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import com.fasterxml.jackson.databind.node.JsonNodeType;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.common.criteria.JacksonCriteria;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author: yaoll
+ * @date: 2020-09-22
+ * @verison: 1.0
+ */
+@Component
+public class ClassCodeUtils {
+
+    public void prepareCriteriaForFuncid(JacksonCriteria criteria, String codeName) {
+        ObjectNode objectNode = criteria.getCriteria();
+        if (objectNode.has(codeName)) {
+            JsonNode classCodeNode = objectNode.get(codeName);
+            JsonNodeType nodeType = classCodeNode.getNodeType();
+            if (nodeType == JsonNodeType.ARRAY) {
+                ArrayNode array = JsonNodeFactory.instance.arrayNode();
+                for (JsonNode jsonNode : ((ArrayNode) classCodeNode)) {
+                    String str = jsonNode.asText();
+                    if (str.indexOf("&") == -1) {
+                        array.add(str);
+                    } else {
+                        array.add(str.substring(str.indexOf("&")));
+                    }
+                }
+                objectNode.remove(codeName);
+                objectNode.set(codeName, array);
+            } else if (nodeType == JsonNodeType.OBJECT) {
+                ObjectNode obj = (ObjectNode) classCodeNode;
+                if (obj.has("$in")) {
+                    JsonNode $in = obj.get("$in");
+                    if ($in.getNodeType() == JsonNodeType.ARRAY) {
+                        ArrayNode array = JsonNodeFactory.instance.arrayNode();
+                        for (JsonNode jsonNode : ((ArrayNode) $in)) {
+                            String str = jsonNode.asText();
+                            if (str.indexOf("&") == -1) {
+                                array.add(str);
+                            } else {
+                                array.add(str.substring(str.indexOf("&")));
+                            }
+                        }
+                        obj.remove("$in");
+                        obj.set("$in", array);
+                    }
+                }
+            } else if (nodeType == JsonNodeType.STRING) {
+                String code = classCodeNode.asText();
+                int idx = code.indexOf("&");
+                if (idx > -1) {
+                    criteria.add(codeName, code.substring(0, idx));
+                }
+            }
+        }
+    }
+
+
+}

+ 43 - 0
dmp-rwd-edit/src/main/resources/application.yml

@@ -0,0 +1,43 @@
+server:
+  port: 8838
+persagy:
+  dmp:
+    server: http://192.168.64.18:9930
+#    server: http://39.102.40.239:9970
+    exchange: exchange-dmp
+    admin:
+      routingKey: routing-dmp-rwdedit
+      queue: queue-dmp-rwdedit
+spring:
+  application:
+    name: dmp-rwdedit
+  profiles:
+    active:
+    - dev,log-dev
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://192.168.64.15:9934/dmp_rwdedit?useUnicode=true&characterEncoding=utf-8&mysqlEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
+    username: root
+    password: brzj123456
+    type: com.alibaba.druid.pool.DruidDataSource
+  jpa:
+    show-sql: true
+    hibernate:
+      ddl-auto: none
+  rabbitmq:
+    host: 192.168.64.15
+    port: 9936
+    username: admin
+    password: brzj123456
+    virtual-host: /test
+  redis:
+    database: 10
+    host: 192.168.64.15
+    password: brzj123456
+    port: 9944
+    timeout: 6000
+    pool:
+      max-idle: 200
+      min-idle: 5
+      max-active: 1024
+      max-wait: 1000

+ 590 - 0
dmp-rwd-edit/数据字典编辑工具接口文档.md

@@ -0,0 +1,590 @@
+## 类型
+### 类型-查询变更记录
+
+地址:POST /rwdedit/classDef/changeRecord/query
+
+参数
+
+```json
+{
+    "criteria":{
+        "id":1,
+        "code":"project",//类型编码
+        "operationType":"create",//创建:create 修改:update 删除:delete
+        "operationUser":"90000000",//操作人
+        "operationTime":1611295200000,//操作时间
+        "confirmUser":"90000000",//确认人
+        "confirmTime":1611295200000,//确认时间
+        "publishUser":"90000000",//发布人
+        "publishTime":1611295200000,//发布时间
+        "finishTime":1611295200000,//完成时间
+        "state":0,//状态 0.取消 1.初始化 2.确认 3.发布 4.完成
+        "version":"3.1.3"//版本编号
+    },
+    "page":1,
+    "size":10
+}
+```
+
+返回结果
+
+```json
+{
+    "result": "success",
+    "data": [
+        {
+            "id": 1,
+            "code": "project",
+            "operationType": "update",
+            "operationUser": "90000000",
+            "operationTime": 1611295200000,
+            "confirmUser": "90000000",
+            "confirmTime": 1611295200000,
+            "publishUser": "90000000",
+            "publishTime": 1611295200000,
+            "finishTime": 1611312582000,
+            "valid": true,
+            "state": 4
+        }
+    ],
+    "count": 1
+}
+```
+
+### 类型-新增变更记录
+
+地址:POST /rwdedit/classDef/changeRecord/create
+
+参数
+
+ ```json
+{
+    "code": "projectItem",//必传 信息点编码
+    //参考物理世界-类型定义接口文档
+    "operationType": "create"
+}
+ ```
+
+返回结果
+
+```json
+{
+    "result": "success",
+    "data": {
+        "id": 2
+    }
+}
+```
+
+### 类型-修改变更记录
+
+地址:POST /rwdedit/classDef/changeRecord/update
+
+ 参数
+
+```json
+{
+      "id":"1",//必传
+      "aliasCode":"project",//选填 别编码
+      "aliasName":"项目",//选填 别名称
+}  
+```
+
+ 返回结果
+
+```json
+{
+    "result": "success"
+}
+```
+### 类型-删除变更记录
+
+
+地址:POST /rwdedit/classDef/changeRecord/delete
+
+参数
+
+```json
+    {
+        "id":1 //变更记录id
+    }
+```
+
+返回结果
+
+```json
+{
+    "result": "success"
+}
+```
+
+
+### 类型-加入版本号
+
+
+地址:POST /rwdedit/classDef/changeRecord/addVersion?version=3.1.1
+
+路径参数说明
+```
+   version:版本编号id
+```
+
+参数
+
+```json
+    [
+        1,2,3 //变更记录id
+    ]
+```
+
+返回结果
+
+```json
+{
+    "result": "success"
+}
+```
+ 
+## 信息点
+ 
+### 信息点-查询变更记录
+
+地址:POST /rwdedit/funcidDef/changeRecord/query
+
+参数
+
+```json
+{
+    "criteria":{
+        "id":1,
+        "code":"project",//类型编码
+        "operationType":"create",//创建:create 修改:update 删除:delete
+        "operationUser":"90000000",//操作人
+        "operationTime":1611295200000,//操作时间
+        "confirmUser":"90000000",//确认人
+        "confirmTime":1611295200000,//确认时间
+        "publishUser":"90000000",//发布人
+        "publishTime":1611295200000,//发布时间
+        "finishTime":1611295200000,//完成时间
+        "state":0,//状态 0.取消 1.初始化 2.确认 3.发布 4.完成
+        "version":"3.1.3"//版本编号
+    },
+    "page":1,
+    "size":10
+}
+```
+
+返回结果
+
+```json
+{
+    "result": "success",
+    "data": [
+        {
+            "id": 1,
+            "code": "project",
+            "operationType": "update",
+            "operationUser": "90000000",
+            "operationTime": 1611295200000,
+            "confirmUser": "90000000",
+            "confirmTime": 1611295200000,
+            "publishUser": "90000000",
+            "publishTime": 1611295200000,
+            "finishTime": 1611312582000,
+            "valid": true,
+            "state": 4
+        }
+    ],
+    "count": 1
+}
+```
+
+### 信息点-新增变更记录
+
+地址:POST /rwdedit/funcidDef/changeRecord/create
+
+参数
+
+ ```json
+{
+    "code": "projectItem",//必传 信息点编码
+    "classCode": "projectItem",//必传 类型编码
+    //参考物理世界-信息点定义接口文档
+    "operationType": "create"
+}
+ ```
+
+返回结果
+
+```json
+{
+    "result": "success",
+    "data": {
+        "id": 2
+    }
+}
+```
+
+### 信息点-修改变更记录
+
+地址:POST /rwdedit/funcidDef/changeRecord/update
+
+ 参数
+
+```json
+{
+      "id":"1",//必传
+      "aliasCode":"project",//选填 别编码
+      "aliasName":"项目",//选填 别名称
+      "firstTag":"建筑信息",//选填 一级标签
+      "secondTag":"结构参数",//选填 二级标签
+      "note":"备注",//选填 备注
+}   
+```
+
+返回结果
+
+```json
+{
+    "result": "success"
+}
+```
+### 信息点-删除变更记录
+
+
+地址:POST /rwdedit/funcidDef/changeRecord/delete
+
+参数
+
+```json
+    {
+        "id":1 //变更记录id
+    }
+```
+
+返回结果
+
+```json
+{
+    "result": "success"
+}
+```
+
+### 信息点-加入版本号
+
+
+地址:POST /rwdedit/funcidDef/changeRecord/addVersion?version=3.1.1
+
+路径参数说明
+```
+   version:版本编号id
+```
+
+参数
+
+```json
+    [
+        1,2,3 //变更记录id
+    ]
+```
+
+返回结果
+
+```json
+{
+    "result": "success"
+}
+```
+### 信息点-查询所有引用类型
+
+
+地址:POST /rwdedit/ref/type/query
+
+参数
+
+```json
+    {
+    "criteria":{}
+}
+```
+
+返回结果
+
+```json
+{
+    {
+    "result": "success",
+    "data": [
+        {
+            "refKey": "airWindRating", //引用类型键
+            "name": "空气风力等级",//引用类型名称
+            "createUser": 0,
+            "createTime": 1614046154000,
+            "updateUser": 0,
+            "updateTime": 1614046241000
+        }
+    ],
+    "count": 1
+}
+}
+```
+
+## 版本
+
+### 版本号查询
+
+
+地址:POST /rwdedit/version/query
+
+参数
+
+```json
+{
+    "criteria":{
+        "id":1,
+        "version":"3.1.1",//版本编号
+        "createTime":"1611295200000",//创建时间
+        "createUser":"90000000",//创建人
+    },
+    "page":1,
+    "size":10
+}
+```
+
+返回结果
+
+```json
+{
+    "result": "success",
+    "data": [
+        {
+            "id":1,
+            "version":"3.1.1",//版本编号
+            "createTime":"1611295200000",//创建时间
+            "createUser":"90000000",//创建人
+         }
+    ],
+    "count": 1
+}
+```
+### 新增版本号
+
+
+地址:POST /rwdedit/version/create
+
+参数
+
+```json
+{
+    "version":"3.1.1"//版本编号
+}
+```
+
+返回结果
+
+```json
+{
+    "result": "success"
+}
+```
+### 修改版本状态
+
+
+地址:POST /rwdedit/version/update
+
+参数
+
+```json
+    {
+        "version":"1.1.1",
+        "state":3
+    }
+```
+
+返回结果
+
+```json
+{
+    "result": "success"
+}
+```
+
+### 发布下载
+
+地址:POST /rwdedit/version/download?version=1.1.1
+
+ 返回结果 sql文件
+
+## 知识库
+
+### 知识库-创建知识库引用
+
+
+地址:POST /rwdedit/ref/type/create
+
+参数
+
+```json
+{
+    "refKey": "test",//必填
+    "name":"test"
+}
+```
+
+返回结果
+
+```json
+{
+    "result": "success",
+    "data": {
+        "refKey": "test"
+    }
+}
+```
+
+### 知识库-修改知识库引用
+
+
+地址:POST /rwdedit/ref/type/update
+
+参数
+
+```json
+{
+    "refKey": "test",//必填
+    "name":"test2"
+}
+```
+
+返回结果
+
+```json
+{
+    "result": "success",
+    "data": {
+        "refKey": "test"
+    }
+}
+```
+### 知识库-删除知识库引用
+
+
+地址:POST /rwdedit/ref/type/delete
+
+参数
+
+```json
+{
+    "refKey": "test"//必填
+}
+```
+
+返回结果
+
+```json
+{
+    "result": "success",
+    "data": {
+        "refKey": "test"
+    }
+}
+```
+### 知识库信息-查询知识库详情
+
+
+地址:POST /rwdedit/ref/type/infos/query
+
+参数
+
+```json
+{
+    "refKey": "test",//必填
+    "name":"test"
+}
+```
+
+返回结果
+
+```json
+{
+    "result": "success",
+    "data": {
+        "refKey": "test"
+    }
+}
+```
+### 知识库-创建知识库详情
+
+
+地址:POST /rwdedit/ref/type/infos/create
+
+参数
+
+```json
+{
+    "refKey": "test",//必填
+    "code": "test",//必填
+    "name":"test"
+}
+```
+
+返回结果
+
+```json
+{
+    "result": "success",
+    "data": {
+        "refKey": "test"
+    }
+}
+```
+
+### 知识库-修改知识库详情
+
+
+地址:POST /rwdedit/ref/type/infos/update
+
+参数
+
+```json
+{
+    "refKey": "test",//必填
+    "code": "test",//必填
+    "name":"test2"
+}
+```
+
+返回结果
+
+```json
+{
+    "result": "success",
+    "data": {
+        "refKey": "test"
+    }
+}
+```
+### 知识库-删除知识库详情
+
+
+地址:POST /rwdedit/ref/type/infos/delete
+
+参数
+
+```json
+{
+    "refKey": "test",//必填
+    "code": "test"//必填
+}
+```
+
+返回结果
+
+```json
+{
+    "result": "success",
+    "data": {
+        "refKey": "test"
+    }
+}
+```

+ 1 - 0
pom.xml

@@ -19,6 +19,7 @@
         <module>dmp-task</module>
         <module>dmp-alarm</module>
         <module>dmp-admin</module>
+        <module>dmp-rwd-edit</module>
     </modules>
 
     <packaging>pom</packaging>