Bladeren bron

第一次提交

yq 3 jaren geleden
commit
ff5b627e84
70 gewijzigde bestanden met toevoegingen van 4837 en 0 verwijderingen
  1. 2 0
      .idea/.gitignore
  2. 25 0
      .idea/compiler.xml
  3. 9 0
      .idea/encodings.xml
  4. 36 0
      .idea/inspectionProfiles/Project_Default.xml
  5. 18 0
      .idea/misc.xml
  6. 124 0
      .idea/uiDesigner.xml
  7. 6 0
      .idea/vcs.xml
  8. 50 0
      pom.xml
  9. 147 0
      system-controller/pom.xml
  10. 73 0
      system-controller/src/main/java/com/bizmatics/system/controller/BaseController.java
  11. 19 0
      system-controller/src/main/java/com/bizmatics/system/controller/SystemControllerApplication.java
  12. 32 0
      system-controller/src/main/java/com/bizmatics/system/controller/web/SysAsyncController.java
  13. 95 0
      system-controller/src/main/java/com/bizmatics/system/controller/web/SysConfigController.java
  14. 79 0
      system-controller/src/main/java/com/bizmatics/system/controller/web/SysDictDataController.java
  15. 97 0
      system-controller/src/main/java/com/bizmatics/system/controller/web/SysDictTypeController.java
  16. 66 0
      system-controller/src/main/java/com/bizmatics/system/controller/web/SysFileController.java
  17. 93 0
      system-controller/src/main/resources/application-dev.properties
  18. 67 0
      system-controller/src/main/resources/application-prod.properties
  19. 67 0
      system-controller/src/main/resources/application-test.properties
  20. 10 0
      system-controller/src/main/resources/application.properties
  21. 18 0
      system-controller/src/main/resources/ehcache.xml
  22. 157 0
      system-controller/src/main/resources/log4j2-spring-dev.xml
  23. 131 0
      system-controller/src/main/resources/log4j2-spring-prod.xml
  24. 151 0
      system-controller/src/main/resources/log4j2-spring-test.xml
  25. 11 0
      system-controller/src/main/resources/smart-doc.json
  26. 0 0
      system-controller/src/main/resources/static/doc/AllInOne.css
  27. 0 0
      system-controller/src/main/resources/static/doc/index.html
  28. 116 0
      system-controller/src/main/resources/static/doc/search.js
  29. 13 0
      system-controller/src/test/java/com/bizmatics/system/controller/SystemControllerApplicationTests.java
  30. 24 0
      system-model/pom.xml
  31. 26 0
      system-model/src/main/java/com/bizmatics/model/SysAsyncTask.java
  32. 108 0
      system-model/src/main/java/com/bizmatics/model/SysConfig.java
  33. 171 0
      system-model/src/main/java/com/bizmatics/model/SysDictData.java
  34. 92 0
      system-model/src/main/java/com/bizmatics/model/SysDictType.java
  35. 76 0
      system-model/src/main/java/com/bizmatics/model/SysFile.java
  36. 137 0
      system-model/src/main/java/com/bizmatics/model/base/BaseEntity.java
  37. 23 0
      system-model/src/main/java/com/bizmatics/model/vo/SysAsyncTaskVo.java
  38. 42 0
      system-persistence/pom.xml
  39. 22 0
      system-persistence/src/main/java/com/bizmatics/persistence/mapper/FileMapper.java
  40. 24 0
      system-persistence/src/main/java/com/bizmatics/persistence/mapper/SysAsyncTaskMapper.java
  41. 68 0
      system-persistence/src/main/java/com/bizmatics/persistence/mapper/SysConfigMapper.java
  42. 105 0
      system-persistence/src/main/java/com/bizmatics/persistence/mapper/SysDictDataMapper.java
  43. 82 0
      system-persistence/src/main/java/com/bizmatics/persistence/mapper/SysDictTypeMapper.java
  44. 12 0
      system-persistence/src/main/resources/mapper/mysql/SysAsyncTaskMapper.xml
  45. 123 0
      system-persistence/src/main/resources/mapper/mysql/SysConfigMapper.xml
  46. 146 0
      system-persistence/src/main/resources/mapper/mysql/SysDictDataMapper.xml
  47. 107 0
      system-persistence/src/main/resources/mapper/mysql/SysDictTypeMapper.xml
  48. 18 0
      system-persistence/src/main/resources/mapper/mysql/SysFileMapper.xml
  49. 90 0
      system-service/pom.xml
  50. 115 0
      system-service/src/main/java/com/bizmatics/service/FileSerivce.java
  51. 53 0
      system-service/src/main/java/com/bizmatics/service/ISysAsyncTaskService.java
  52. 72 0
      system-service/src/main/java/com/bizmatics/service/ISysConfigService.java
  53. 69 0
      system-service/src/main/java/com/bizmatics/service/ISysDictDataService.java
  54. 91 0
      system-service/src/main/java/com/bizmatics/service/ISysDictTypeService.java
  55. 21 0
      system-service/src/main/java/com/bizmatics/service/constants/CacheConst.java
  56. 13 0
      system-service/src/main/java/com/bizmatics/service/constants/ErrorCodeConst.java
  57. 103 0
      system-service/src/main/java/com/bizmatics/service/constants/SystemConst.java
  58. 11 0
      system-service/src/main/java/com/bizmatics/service/dto/SysAsyncTaskDTO.java
  59. 34 0
      system-service/src/main/java/com/bizmatics/service/dto/SysFileDTO.java
  60. 21 0
      system-service/src/main/java/com/bizmatics/service/dto/SysFileQueryRequest.java
  61. 30 0
      system-service/src/main/java/com/bizmatics/service/dto/SysFileUploadRequest.java
  62. 23 0
      system-service/src/main/java/com/bizmatics/service/enums/UploadType.java
  63. 33 0
      system-service/src/main/java/com/bizmatics/service/expcetion/AsyncErrorCode.java
  64. 33 0
      system-service/src/main/java/com/bizmatics/service/expcetion/FileErrorCode.java
  65. 280 0
      system-service/src/main/java/com/bizmatics/service/impl/FileServiceImpl.java
  66. 102 0
      system-service/src/main/java/com/bizmatics/service/impl/SysAsyncTaskServiceImpl.java
  67. 167 0
      system-service/src/main/java/com/bizmatics/service/impl/SysConfigServiceImpl.java
  68. 105 0
      system-service/src/main/java/com/bizmatics/service/impl/SysDictDataServiceImpl.java
  69. 184 0
      system-service/src/main/java/com/bizmatics/service/impl/SysDictTypeServiceImpl.java
  70. 69 0
      system-service/src/main/java/com/bizmatics/service/util/DictUtils.java

+ 2 - 0
.idea/.gitignore

@@ -0,0 +1,2 @@
+# Default ignored files
+/workspace.xml

+ 25 - 0
.idea/compiler.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <annotationProcessing>
+      <profile default="true" name="Default" enabled="true" />
+      <profile name="Maven default annotation processors profile" enabled="true">
+        <sourceOutputDir name="target/generated-sources/annotations" />
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
+        <outputRelativeToContentRoot value="true" />
+        <module name="system-service" />
+        <module name="system-controller" />
+        <module name="system-model" />
+        <module name="system-persistence" />
+      </profile>
+    </annotationProcessing>
+  </component>
+  <component name="JavacSettings">
+    <option name="ADDITIONAL_OPTIONS_OVERRIDE">
+      <module name="system-controller" options="-parameters" />
+      <module name="system-model" options="-parameters" />
+      <module name="system-persistence" options="-parameters" />
+      <module name="system-service" options="-parameters" />
+    </option>
+  </component>
+</project>

+ 9 - 0
.idea/encodings.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding">
+    <file url="file://$PROJECT_DIR$/system-controller/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/system-model/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/system-persistence/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/system-service/src/main/java" charset="UTF-8" />
+  </component>
+</project>

+ 36 - 0
.idea/inspectionProfiles/Project_Default.xml

@@ -0,0 +1,36 @@
+<component name="InspectionProjectProfileManager">
+  <profile version="1.0">
+    <option name="myName" value="Project Default" />
+    <inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="TOP_LEVEL_CLASS_OPTIONS">
+        <value>
+          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+          <option name="REQUIRED_TAGS" value="" />
+        </value>
+      </option>
+      <option name="INNER_CLASS_OPTIONS">
+        <value>
+          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+          <option name="REQUIRED_TAGS" value="" />
+        </value>
+      </option>
+      <option name="METHOD_OPTIONS">
+        <value>
+          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+          <option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
+        </value>
+      </option>
+      <option name="FIELD_OPTIONS">
+        <value>
+          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+          <option name="REQUIRED_TAGS" value="" />
+        </value>
+      </option>
+      <option name="IGNORE_DEPRECATED" value="false" />
+      <option name="IGNORE_JAVADOC_PERIOD" value="true" />
+      <option name="IGNORE_DUPLICATED_THROWS" value="false" />
+      <option name="IGNORE_POINT_TO_ITSELF" value="false" />
+      <option name="myAdditionalJavadocTags" value="date" />
+    </inspection_tool>
+  </profile>
+</component>

+ 18 - 0
.idea/misc.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
+  <component name="JavaScriptSettings">
+    <option name="languageLevel" value="ES6" />
+  </component>
+  <component name="MavenProjectsManager">
+    <option name="originalFiles">
+      <list>
+        <option value="$PROJECT_DIR$/pom.xml" />
+        <option value="$PROJECT_DIR$/system-controller/pom.xml" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>

+ 124 - 0
.idea/uiDesigner.xml

@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Palette2">
+    <group name="Swing">
+      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
+      </item>
+      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
+        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
+        <initial-values>
+          <property name="text" value="Button" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="RadioButton" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="CheckBox" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="Label" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+          <preferred-size width="-1" height="20" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+      </item>
+    </group>
+  </component>
+</project>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 50 - 0
pom.xml

@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<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>base-pom</artifactId>
+        <groupId>com.bizmatics</groupId>
+        <version>0.0.1</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>system</artifactId>
+    <packaging>pom</packaging>
+    <version>0.0.1</version>
+
+    <name>system</name>
+    <description>system</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.bizmatics</groupId>
+            <artifactId>common-mvc</artifactId>
+        </dependency>
+    </dependencies>
+
+    <modules>
+        <module>system-controller</module>
+        <module>system-service</module>
+        <module>system-persistence</module>
+        <module>system-model</module>
+    </modules>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>com.github.shalousun</groupId>
+                <artifactId>smart-doc-maven-plugin</artifactId>
+                <version>2.1.1</version>
+                <configuration>
+                    <!--指定生成文档的使用的配置文件,配置文件放在自己的项目中-->
+                    <configFile>./src/main/resources/smart-doc.json</configFile>
+                    <!--指定项目名称-->
+                    <projectName>System</projectName>
+                    <excludes>
+                        <exclude>com.bizmatics:system-service-provider</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 147 - 0
system-controller/pom.xml

@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>system-controller</artifactId>
+    <version>0.0.1</version>
+    <name>system-controller</name>
+
+    <properties>
+        <project.name>${parent.name}</project.name>
+    </properties>
+    <parent>
+        <artifactId>system</artifactId>
+        <groupId>com.bizmatics</groupId>
+        <version>0.0.1</version>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.bizmatics</groupId>
+            <artifactId>system-service</artifactId>
+            <version>0.0.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-logging</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-log4j2</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+            <version>5.2.7.RELEASE</version>
+        </dependency>
+
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.cloud</groupId>-->
+<!--            <artifactId>spring-cloud-starter</artifactId>-->
+<!--        </dependency>-->
+
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.cloud</groupId>-->
+<!--            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>-->
+<!--        </dependency>-->
+
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.cloud</groupId>-->
+<!--            <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>-->
+<!--            <exclusions>-->
+<!--                <exclusion>-->
+<!--                    <artifactId>HdrHistogram</artifactId>-->
+<!--                    <groupId>org.hdrhistogram</groupId>-->
+<!--                </exclusion>-->
+<!--            </exclusions>-->
+<!--        </dependency>-->
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.cloud</groupId>-->
+<!--            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>-->
+<!--            <exclusions>-->
+<!--                <exclusion>-->
+<!--                    <artifactId>HdrHistogram</artifactId>-->
+<!--                    <groupId>org.hdrhistogram</groupId>-->
+<!--                </exclusion>-->
+<!--            </exclusions>-->
+<!--        </dependency>-->
+
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.cloud</groupId>-->
+<!--            <artifactId>spring-cloud-starter-openfeign</artifactId>-->
+<!--            <exclusions>-->
+<!--                <exclusion>-->
+<!--                    <artifactId>HdrHistogram</artifactId>-->
+<!--                    <groupId>org.hdrhistogram</groupId>-->
+<!--                </exclusion>-->
+<!--            </exclusions>-->
+<!--        </dependency>-->
+
+    </dependencies>
+
+    <build>
+        <finalName>${parent.artifactId}</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <testFailureIgnore>true</testFailureIgnore>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+        </plugins>
+        <resources>
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.xml</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <includes>
+                    <include>**/*.xml</include>
+                    <include>**/*.properties</include>
+                    <include>**/*.yml</include>
+                </includes>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+    </build>
+
+</project>

+ 73 - 0
system-controller/src/main/java/com/bizmatics/system/controller/BaseController.java

@@ -0,0 +1,73 @@
+package com.bizmatics.system.controller;
+
+import com.bizmatics.common.core.bean.ApiResult;
+import com.bizmatics.common.core.exception.BusinessErrorCode;
+import com.bizmatics.common.core.util.DateUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.WebDataBinder;
+import org.springframework.web.bind.annotation.InitBinder;
+
+import java.beans.PropertyEditorSupport;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * web层通用数据处理
+ */
+public class BaseController {
+    protected final Logger logger = LoggerFactory.getLogger(BaseController.class);
+
+    /**
+     * 将前台传递过来的日期格式的字符串,自动转化为Date类型
+     */
+    @InitBinder
+    public void initBinder(WebDataBinder binder) {
+        // Date 类型转换
+        binder.registerCustomEditor(Date.class, new PropertyEditorSupport() {
+            @Override
+            public void setAsText(String text) {
+                setValue(DateUtils.parseDate(text));
+            }
+        });
+    }
+
+    /**
+     * 设置请求分页数据
+     */
+    protected void startPage() {
+        PageDomain pageDomain = TableSupport.buildPageRequest();
+        Integer pageNum = pageDomain.getPageNum();
+        Integer pageSize = pageDomain.getPageSize();
+        if (Objects.nonNull(pageNum) && Objects.nonNull(pageSize)) {
+            String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
+            PageHelper.startPage(pageNum, pageSize, orderBy);
+        }
+    }
+
+    /**
+     * 响应请求分页数据
+     */
+    @SuppressWarnings({"rawtypes", "unchecked"})
+    protected TableDataInfo getDataTable(List<?> list) {
+        TableDataInfo rspData = new TableDataInfo();
+        rspData.setCode(HttpStatus.OK.value());
+        rspData.setRows(list);
+        rspData.setMsg("查询成功");
+        rspData.setTotal(new PageInfo(list).getTotal());
+        return rspData;
+    }
+
+    /**
+     * 响应返回结果
+     *
+     * @param rows 影响行数
+     * @return 操作结果
+     */
+    protected ApiResult toAjax(int rows) {
+        return rows > 0 ? ApiResult.success() : ApiResult.error(BusinessErrorCode.BIZ_MODIFY_FAIL.getCode(), BusinessErrorCode.BIZ_MODIFY_FAIL.getDefaultMessage());
+    }
+}

+ 19 - 0
system-controller/src/main/java/com/bizmatics/system/controller/SystemControllerApplication.java

@@ -0,0 +1,19 @@
+package com.bizmatics.system.controller;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+@EnableFeignClients("com.bizmatics")
+@ComponentScan("com.bizmatics")
+@SpringBootApplication
+@EnableTransactionManagement
+public class SystemControllerApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(SystemControllerApplication.class, args);
+    }
+
+}

+ 32 - 0
system-controller/src/main/java/com/bizmatics/system/controller/web/SysAsyncController.java

@@ -0,0 +1,32 @@
+package com.bizmatics.system.controller.web;
+
+import com.bizmatics.common.core.bean.ApiResult;
+import com.bizmatics.common.core.bean.CommonPage;
+import com.bizmatics.model.vo.SysAsyncTaskVo;
+import com.bizmatics.service.ISysAsyncTaskService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Date;
+
+/**
+ * @author fzq
+ */
+@RestController
+@RequestMapping("/async")
+public class SysAsyncController {
+
+    @Autowired
+    private ISysAsyncTaskService iSysAsyncTaskService;
+
+    @GetMapping
+    public ApiResult<CommonPage<SysAsyncTaskVo>> getList(@RequestParam(required = false) Long asyncTaskId, @RequestParam(required = false) Date startTime,
+                                                         @RequestParam(required = false) Date endTime, @RequestParam(required = false) String funcType, @RequestParam(required = false) Boolean user, Integer current,
+                                                         Integer size) {
+        return ApiResult.success(iSysAsyncTaskService.getList(asyncTaskId, startTime, endTime, funcType, user, current, size));
+    }
+
+}

+ 95 - 0
system-controller/src/main/java/com/bizmatics/system/controller/web/SysConfigController.java

@@ -0,0 +1,95 @@
+package com.bizmatics.system.controller.web;
+
+import com.bizmatics.common.core.bean.ApiResult;
+import com.bizmatics.common.core.exception.BusinessErrorCode;
+import com.bizmatics.model.SysConfig;
+import com.bizmatics.service.ISysConfigService;
+import com.bizmatics.service.constants.SystemConst;
+import com.bizmatics.system.controller.BaseController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 参数配置 信息操作处理
+ */
+@RestController
+@RequestMapping("/config")
+public class SysConfigController extends BaseController {
+    @Autowired
+    private ISysConfigService configService;
+
+    /**
+     * 获取参数配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:config:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysConfig config) {
+        startPage();
+        List<SysConfig> list = configService.selectConfigList(config);
+        return getDataTable(list);
+    }
+
+    /**
+     * 根据参数编号获取详细信息
+     */
+    @GetMapping(value = "/{configId}")
+    public ApiResult getInfo(@PathVariable Long configId) {
+        return ApiResult.success(configService.selectConfigById(configId));
+    }
+
+    /**
+     * 根据参数键名查询参数值
+     */
+    @GetMapping(value = "/configKey/{configKey}")
+    public ApiResult getConfigKey(@PathVariable String configKey) {
+        return ApiResult.success(configService.selectConfigByKey(configKey));
+    }
+
+    /**
+     * 新增参数配置
+     */
+    @PreAuthorize("@ss.hasPermi('system:config:add')")
+    @PostMapping
+    public ApiResult add(@Validated @RequestBody SysConfig config) {
+        if (SystemConst.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
+            return ApiResult.error(BusinessErrorCode.BIZ_BUSINESS_ERROR.getCode(), "新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
+        }
+        config.setCreateBy(SecurityUtils.getUser().getName());
+        return toAjax(configService.insertConfig(config));
+    }
+
+    /**
+     * 修改参数配置
+     */
+    @PreAuthorize("@ss.hasPermi('system:config:edit')")
+    @PutMapping
+    public ApiResult edit(@Validated @RequestBody SysConfig config) {
+        if (SystemConst.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
+            return ApiResult.error(BusinessErrorCode.BIZ_BUSINESS_ERROR.getCode(), "修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
+        }
+        config.setUpdateBy(SecurityUtils.getUser().getName());
+        return toAjax(configService.updateConfig(config));
+    }
+
+    /**
+     * 删除参数配置
+     */
+    @PreAuthorize("@ss.hasPermi('system:config:remove')")
+    @DeleteMapping("/{configIds}")
+    public ApiResult remove(@PathVariable Long[] configIds) {
+        return toAjax(configService.deleteConfigByIds(configIds));
+    }
+
+    /**
+     * 清空缓存
+     */
+    @PreAuthorize("@ss.hasPermi('system:config:remove')")
+    @DeleteMapping("/clearCache")
+    public ApiResult clearCache() {
+        configService.clearCache();
+        return ApiResult.success();
+    }
+}

+ 79 - 0
system-controller/src/main/java/com/bizmatics/system/controller/web/SysDictDataController.java

@@ -0,0 +1,79 @@
+package com.bizmatics.system.controller.web;
+
+import com.bizmatics.common.core.bean.ApiResult;
+import com.bizmatics.model.SysDictData;
+import com.bizmatics.service.ISysDictDataService;
+import com.bizmatics.service.ISysDictTypeService;
+import com.bizmatics.system.controller.BaseController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 数据字典信息
+ */
+@RestController
+@RequestMapping("/dict/data")
+public class SysDictDataController extends BaseController {
+    @Autowired
+    private ISysDictDataService dictDataService;
+
+    @Autowired
+    private ISysDictTypeService dictTypeService;
+
+    @PreAuthorize("@ss.hasPermi('system:dict:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysDictData dictData) {
+        startPage();
+        List<SysDictData> list = dictDataService.selectDictDataList(dictData);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询字典数据详细
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:query')")
+    @GetMapping(value = "/{dictCode}")
+    public ApiResult getInfo(@PathVariable Long dictCode) {
+        return ApiResult.success(dictDataService.selectDictDataById(dictCode));
+    }
+
+    /**
+     * 根据字典类型查询字典数据信息
+     */
+    @GetMapping(value = "/type/{dictType}")
+    public ApiResult dictType(@PathVariable String dictType) {
+        return ApiResult.success(dictTypeService.selectDictDataByType(dictType));
+    }
+
+    /**
+     * 新增字典类型
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:add')")
+    @PostMapping
+    public ApiResult add(@Validated @RequestBody SysDictData dict) {
+        dict.setCreateBy(SecurityUtils.getUser().getName());
+        return toAjax(dictDataService.insertDictData(dict));
+    }
+
+    /**
+     * 修改保存字典类型
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:edit')")
+    @PutMapping
+    public ApiResult edit(@Validated @RequestBody SysDictData dict) {
+        dict.setUpdateBy(SecurityUtils.getUser().getName());
+        return toAjax(dictDataService.updateDictData(dict));
+    }
+
+    /**
+     * 删除字典类型
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
+    @DeleteMapping("/{dictCodes}")
+    public ApiResult remove(@PathVariable Long[] dictCodes) {
+        return toAjax(dictDataService.deleteDictDataByIds(dictCodes));
+    }
+}

+ 97 - 0
system-controller/src/main/java/com/bizmatics/system/controller/web/SysDictTypeController.java

@@ -0,0 +1,97 @@
+package com.bizmatics.system.controller.web;
+
+import com.bizmatics.common.core.bean.ApiResult;
+import com.bizmatics.common.core.exception.BusinessErrorCode;
+import com.bizmatics.security.utils.SecurityUtils;
+import com.bizmatics.system.controller.BaseController;
+import com.bizmatics.system.model.SysDictType;
+import com.bizmatics.system.model.page.TableDataInfo;
+import com.bizmatics.system.service.ISysDictTypeService;
+import com.bizmatics.system.service.constants.SystemConst;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 数据字典信息
+ */
+@RestController
+@RequestMapping("/dict/type")
+public class SysDictTypeController extends BaseController {
+    @Autowired
+    private ISysDictTypeService dictTypeService;
+
+    @PreAuthorize("@ss.hasPermi('system:dict:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysDictType dictType) {
+        startPage();
+        List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询字典类型详细
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:query')")
+    @GetMapping(value = "/{dictId}")
+    public ApiResult getInfo(@PathVariable Long dictId) {
+        return ApiResult.success(dictTypeService.selectDictTypeById(dictId));
+    }
+
+    /**
+     * 新增字典类型
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:add')")
+    @PostMapping
+    public ApiResult add(@Validated @RequestBody SysDictType dict) {
+        if (SystemConst.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) {
+            return ApiResult.error(BusinessErrorCode.BIZ_BUSINESS_ERROR.getCode(), "新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
+        }
+        dict.setCreateBy(SecurityUtils.getUser().getName());
+        return toAjax(dictTypeService.insertDictType(dict));
+    }
+
+    /**
+     * 修改字典类型
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:edit')")
+    @PutMapping
+    public ApiResult edit(@Validated @RequestBody SysDictType dict) {
+        if (SystemConst.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) {
+            return ApiResult.error(BusinessErrorCode.BIZ_BUSINESS_ERROR.getCode(), "修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
+        }
+        dict.setUpdateBy(SecurityUtils.getUser().getName());
+        return toAjax(dictTypeService.updateDictType(dict));
+    }
+
+    /**
+     * 删除字典类型
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
+    @DeleteMapping("/{dictIds}")
+    public ApiResult remove(@PathVariable Long[] dictIds) {
+        return toAjax(dictTypeService.deleteDictTypeByIds(dictIds));
+    }
+
+    /**
+     * 清空缓存
+     */
+    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
+    @DeleteMapping("/clearCache")
+    public ApiResult clearCache() {
+        dictTypeService.clearCache();
+        return ApiResult.success();
+    }
+
+    /**
+     * 获取字典选择框列表
+     */
+    @GetMapping("/optionselect")
+    public ApiResult optionselect() {
+        List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
+        return ApiResult.success(dictTypes);
+    }
+}

+ 66 - 0
system-controller/src/main/java/com/bizmatics/system/controller/web/SysFileController.java

@@ -0,0 +1,66 @@
+package com.bizmatics.system.controller.web;
+
+import com.bizmatics.common.core.bean.ApiResult;
+import com.bizmatics.common.core.util.BeanMapperUtils;
+import com.bizmatics.model.SysFile;
+import com.bizmatics.service.FileSerivce;
+import com.bizmatics.service.dto.SysFileDTO;
+import com.bizmatics.service.dto.SysFileQueryRequest;
+import com.bizmatics.service.dto.SysFileUploadRequest;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+@Controller
+@RequestMapping("sysFile")
+public class SysFileController {
+
+    private final FileSerivce fileSerivce;
+
+    public SysFileController(FileSerivce fileSerivce) {
+        this.fileSerivce = fileSerivce;
+    }
+
+    @PostMapping
+    @ResponseBody
+    public ApiResult<List<SysFileDTO>> uploadFile(
+            @RequestParam("files") CommonsMultipartFile[] multipartFiles,
+            @RequestParam("batchNo") String batchNo,
+            @RequestParam("businessType") String businessType,
+            @RequestParam(value = "ossacl", required = false) OSSACL ossacl,
+            @RequestParam(name = "uploadType", required = false) UploadType uploadType,
+            @RequestParam(name = "expireAt", required = false) Date expireAt) {
+        SysFileUploadRequest request = SysFileUploadRequest.builder()
+                .multipartFiles(Arrays.asList(multipartFiles))
+                .batchNo(batchNo)
+                .businessType(businessType)
+                .ossAcl(ossacl)
+                .uploadType(uploadType)
+                .expireAt(expireAt)
+                .build();
+        if (uploadType == null) {
+            request.setUploadType(UploadType.File);
+        }
+        List<com.bizmatics.system.service.dto.SysFileDTO> sysFileDTOList = fileSerivce.addFile(request);
+        List<SysFileDTO> sysFileDTOS = BeanMapperUtils.mapList(sysFileDTOList, com.bizmatics.system.service.dto.SysFileDTO.class, SysFileDTO.class);
+        return ApiResult.success(sysFileDTOS);
+    }
+
+    @GetMapping
+    @ResponseBody
+    public ApiResult<List<SysFile>> getFile(SysFileQueryRequest sysFileQueryRequest) {
+        List<SysFile> sysFileList = BeanMapperUtils.mapList(fileSerivce.getFile(sysFileQueryRequest), com.bizmatics.system.model.SysFile.class, SysFile.class);
+        return ApiResult.success(sysFileList);
+    }
+
+    @GetMapping("/generateBatchNo")
+    @ResponseBody
+    public ApiResult<String> generateBatchNo() {
+        return ApiResult.success(fileSerivce.generateBatchNo());
+    }
+
+}

+ 93 - 0
system-controller/src/main/resources/application-dev.properties

@@ -0,0 +1,93 @@
+debug=true
+spring.main.lazy-initialization=false
+spring.main.allow-bean-definition-overriding=true
+# application
+server.port=8082
+# mybatis-plus
+mybatis-plus.mapper-locations=classpath*:mapper/**/*.xml
+mybatis-plus.configuration.lazy-loading-enabled=true
+mybatis-plus.configuration.map-underscore-to-camel-case=true
+mybatis-plus.global-config.db-config.id-type=auto
+mybatis-plus.global-config.mapperRegistryCache=true
+mybatis-plus.configuration.defaultStatementTimeout=3
+mybatis.refresh.enabled=true
+mybatis.refresh.delay-seconds=10
+mybatis.refresh.sleep-seconds=20
+# datasource
+spring.autoconfigure.exclude=com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
+spring.datasource.dynamic.primary=newtest
+#spring.datasource.dynamic.strict=true
+#spring.datasource.dynamic.seata=true
+#spring.datasource.dynamic.seata-mode=at
+#spring.datasource.dynamic.datasource.test.url=jdbc:mysql://localhost:3306/test?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
+#spring.datasource.dynamic.datasource.test.username=root
+#spring.datasource.dynamic.datasource.test.password=
+#老库
+spring.datasource.dynamic.datasource.newtest.url=jdbc:mysql://120.55.70.156:3306/newtest?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
+spring.datasource.dynamic.datasource.newtest.username=root
+spring.datasource.dynamic.datasource.newtest.password=123456
+spring.datasource.dynamic.druid.initial-size=5                                                                       
+spring.datasource.dynamic.druid.min-idle=5
+spring.datasource.dynamic.druid.max-active=30
+spring.datasource.dynamic.druid.max-wait=60000
+spring.datasource.dynamic.druid.validation-query=select 1
+spring.datasource.dynamic.druid.test-while-idle=true
+spring.datasource.dynamic.druid.test-on-borrow=true
+spring.datasource.dynamic.druid.test-on-return=false
+spring.datasource.dynamic.druid.pool-prepared-statements=true
+spring.datasource.dynamic.druid.max-pool-prepared-statement-per-connection-size=20
+spring.datasource.dynamic.druid.time-between-eviction-runs-millis=60000
+spring.datasource.dynamic.druid.min-evictable-idle-time-millis=300000
+spring.datasource.dynamic.druid.filters=wall,stat,log4j2
+# druid \u76D1\u63A7 WebStatFilter\u914D\u7F6E
+spring.datasource.druid.web-stat-filter.enabled=true
+spring.datasource.druid.web-stat-filter.url-pattern=/*
+spring.datasource.druid.web-stat-filter.exclusions=*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*
+spring.datasource.druid.web-stat-filter.profile-enable=true
+# druid \u89C6\u56FE StatViewServlet\u914D\u7F6E
+spring.datasource.druid.stat-view-servlet.enabled=true
+spring.datasource.druid.stat-view-servlet.url-pattern=/druid/*
+spring.datasource.druid.stat-view-servlet.reset-enable=true
+spring.datasource.druid.stat-view-servlet.login-username=admin
+spring.datasource.druid.stat-view-servlet.login-password=@dmin1234
+# datasource log
+spring.datasource.druid.filter.slf4j.enabled=true
+spring.datasource.druid.filter.slf4j.statement-create-after-log-enabled=false
+spring.datasource.druid.filter.slf4j.statement-close-after-log-enabled=false
+spring.datasource.druid.filter.slf4j.result-set-open-after-log-enabled=false
+spring.datasource.druid.filter.slf4j.result-set-close-after-log-enabled=false
+# jackson
+spring.jackson.date-format=yyyy-MM-dd'T'HH:mm:ssZ
+spring.jackson.time-zone=GMT+0
+spring.jackson.default-property-inclusion=always
+#spring.jackson.serialization.indent_output=true
+spring.jackson.serialization.fail-on-empty-beans=false
+spring.jackson.deserialization.fail-on-unknown-properties=false
+spring.jackson.parser.allow-unquoted-control-chars=true
+spring.jackson.parser.allow-single-quotes=true
+# gzip
+server.compression.enabled=true
+server.compression.mime-types=application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
+
+#seata.enabled=true
+#seata.application-id=applicationName
+#seata.tx-service-group=my_test_tx_group
+#seata.enable-auto-data-source-proxy=false
+#seata.service.vgroup-mapping.my_test_tx_group=default
+#seata.service.grouplist.default=127.0.0.1:8091
+#seata.config.type=file
+#seata.registry.type=file
+
+
+# eureka
+#eureka.client.service-url.defaultZone=http://172.31.101.251:8099/eureka/,http://172.31.101.252:8099/eureka/
+#eureka.client.service-url.defaultZone=http://localhost:8088/eureka/
+##eureka.client.healthcheck.enabled=true
+#eureka.instance.prefer-ip-address=true
+#eureka.instance.instance-id=${spring.application.name}:${spring.cloud.client.ip-address}:${server.port}
+#eureka.instance.lease-renewal-interval-in-seconds=30
+#eureka.instance.lease-expiration-duration-in-seconds=90
+#eureka.client.registryFetchIntervalSeconds=30
+
+
+spring.data.mongodb.uri= mongodb://120.55.70.156:27017/test

+ 67 - 0
system-controller/src/main/resources/application-prod.properties

@@ -0,0 +1,67 @@
+debug=true
+spring.main.lazy-initialization=false
+spring.main.allow-bean-definition-overriding=true
+# application
+server.port=8082
+# mybatis-plus
+mybatis-plus.mapper-locations=classpath*:mapper/**/*.xml
+mybatis-plus.configuration.lazy-loading-enabled=true
+mybatis-plus.configuration.map-underscore-to-camel-case=true
+mybatis-plus.global-config.db-config.id-type=auto
+mybatis-plus.global-config.mapperRegistryCache=true
+mybatis-plus.configuration.defaultStatementTimeout=3
+mybatis.refresh.enabled=true
+mybatis.refresh.delay-seconds=10
+mybatis.refresh.sleep-seconds=20
+# datasource
+spring.autoconfigure.exclude=com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
+spring.datasource.dynamic.primary=product
+spring.datasource.dynamic.datasource.product.url=jdbc:mysql://dev1.shuqian.com:3306/product?allowMultiQueries=true&createDatabaseIfNotExist=true&autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=false&rewriteBatchedStatements=true&useCompression=true
+spring.datasource.dynamic.datasource.product.username=dev
+spring.datasource.dynamic.datasource.product.password=Coozo0628
+#老库
+spring.datasource.dynamic.datasource.old.url=jdbc:mysql://dev1.shuqian.com:3306/amazonold?allowMultiQueries=true&createDatabaseIfNotExist=true&autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=false&rewriteBatchedStatements=true
+spring.datasource.dynamic.datasource.old.username=dev
+spring.datasource.dynamic.datasource.old.password=Coozo0628
+spring.datasource.dynamic.druid.initial-size=5
+spring.datasource.dynamic.druid.min-idle=5
+spring.datasource.dynamic.druid.max-active=30
+spring.datasource.dynamic.druid.max-wait=60000
+spring.datasource.dynamic.druid.validation-query=select 1
+spring.datasource.dynamic.druid.test-while-idle=true
+spring.datasource.dynamic.druid.test-on-borrow=true
+spring.datasource.dynamic.druid.test-on-return=false
+spring.datasource.dynamic.druid.pool-prepared-statements=true
+spring.datasource.dynamic.druid.max-pool-prepared-statement-per-connection-size=20
+spring.datasource.dynamic.druid.time-between-eviction-runs-millis=60000
+spring.datasource.dynamic.druid.min-evictable-idle-time-millis=300000
+spring.datasource.dynamic.druid.filters=wall,stat,log4j2
+# druid \u76D1\u63A7 WebStatFilter\u914D\u7F6E
+spring.datasource.druid.web-stat-filter.enabled=true
+spring.datasource.druid.web-stat-filter.url-pattern=/*
+spring.datasource.druid.web-stat-filter.exclusions=*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*
+spring.datasource.druid.web-stat-filter.profile-enable=true
+# druid \u89C6\u56FE StatViewServlet\u914D\u7F6E
+spring.datasource.druid.stat-view-servlet.enabled=true
+spring.datasource.druid.stat-view-servlet.url-pattern=/druid/*
+spring.datasource.druid.stat-view-servlet.reset-enable=true
+spring.datasource.druid.stat-view-servlet.login-username=admin
+spring.datasource.druid.stat-view-servlet.login-password=@dmin1234
+# datasource log
+spring.datasource.druid.filter.slf4j.enabled=true
+spring.datasource.druid.filter.slf4j.statement-create-after-log-enabled=false
+spring.datasource.druid.filter.slf4j.statement-close-after-log-enabled=false
+spring.datasource.druid.filter.slf4j.result-set-open-after-log-enabled=false
+spring.datasource.druid.filter.slf4j.result-set-close-after-log-enabled=false
+# jackson
+spring.jackson.date-format=yyyy-MM-dd'T'HH:mm:ssZ
+spring.jackson.time-zone=GMT+0
+spring.jackson.default-property-inclusion=always
+#spring.jackson.serialization.indent_output=true
+spring.jackson.serialization.fail-on-empty-beans=false
+spring.jackson.deserialization.fail-on-unknown-properties=false
+spring.jackson.parser.allow-unquoted-control-chars=true
+spring.jackson.parser.allow-single-quotes=true
+# gzip
+server.compression.enabled=true
+server.compression.mime-types=application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain

+ 67 - 0
system-controller/src/main/resources/application-test.properties

@@ -0,0 +1,67 @@
+debug=true
+spring.main.lazy-initialization=false
+spring.main.allow-bean-definition-overriding=true
+# application
+server.port=8082
+# mybatis-plus
+mybatis-plus.mapper-locations=classpath*:mapper/**/*.xml
+mybatis-plus.configuration.lazy-loading-enabled=true
+mybatis-plus.configuration.map-underscore-to-camel-case=true
+mybatis-plus.global-config.db-config.id-type=auto
+mybatis-plus.global-config.mapperRegistryCache=true
+mybatis-plus.configuration.defaultStatementTimeout=3
+mybatis.refresh.enabled=true
+mybatis.refresh.delay-seconds=10
+mybatis.refresh.sleep-seconds=20
+# datasource
+spring.autoconfigure.exclude=com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
+spring.datasource.dynamic.primary=product
+spring.datasource.dynamic.datasource.product.url=jdbc:mysql://dev1.shuqian.com:3306/product?allowMultiQueries=true&createDatabaseIfNotExist=true&autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=false&rewriteBatchedStatements=true&useCompression=true
+spring.datasource.dynamic.datasource.product.username=dev
+spring.datasource.dynamic.datasource.product.password=Coozo0628
+#老库
+spring.datasource.dynamic.datasource.old.url=jdbc:mysql://dev1.shuqian.com:3306/amazonold?allowMultiQueries=true&createDatabaseIfNotExist=true&autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=false&rewriteBatchedStatements=true
+spring.datasource.dynamic.datasource.old.username=dev
+spring.datasource.dynamic.datasource.old.password=Coozo0628
+spring.datasource.dynamic.druid.initial-size=5
+spring.datasource.dynamic.druid.min-idle=5
+spring.datasource.dynamic.druid.max-active=30
+spring.datasource.dynamic.druid.max-wait=60000
+spring.datasource.dynamic.druid.validation-query=select 1
+spring.datasource.dynamic.druid.test-while-idle=true
+spring.datasource.dynamic.druid.test-on-borrow=true
+spring.datasource.dynamic.druid.test-on-return=false
+spring.datasource.dynamic.druid.pool-prepared-statements=true
+spring.datasource.dynamic.druid.max-pool-prepared-statement-per-connection-size=20
+spring.datasource.dynamic.druid.time-between-eviction-runs-millis=60000
+spring.datasource.dynamic.druid.min-evictable-idle-time-millis=300000
+spring.datasource.dynamic.druid.filters=wall,stat,log4j2
+# druid \u76D1\u63A7 WebStatFilter\u914D\u7F6E
+spring.datasource.druid.web-stat-filter.enabled=true
+spring.datasource.druid.web-stat-filter.url-pattern=/*
+spring.datasource.druid.web-stat-filter.exclusions=*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*
+spring.datasource.druid.web-stat-filter.profile-enable=true
+# druid \u89C6\u56FE StatViewServlet\u914D\u7F6E
+spring.datasource.druid.stat-view-servlet.enabled=true
+spring.datasource.druid.stat-view-servlet.url-pattern=/druid/*
+spring.datasource.druid.stat-view-servlet.reset-enable=true
+spring.datasource.druid.stat-view-servlet.login-username=admin
+spring.datasource.druid.stat-view-servlet.login-password=@dmin1234
+# datasource log
+spring.datasource.druid.filter.slf4j.enabled=true
+spring.datasource.druid.filter.slf4j.statement-create-after-log-enabled=false
+spring.datasource.druid.filter.slf4j.statement-close-after-log-enabled=false
+spring.datasource.druid.filter.slf4j.result-set-open-after-log-enabled=false
+spring.datasource.druid.filter.slf4j.result-set-close-after-log-enabled=false
+# jackson
+spring.jackson.date-format=yyyy-MM-dd'T'HH:mm:ssZ
+spring.jackson.time-zone=GMT+0
+spring.jackson.default-property-inclusion=always
+#spring.jackson.serialization.indent_output=true
+spring.jackson.serialization.fail-on-empty-beans=false
+spring.jackson.deserialization.fail-on-unknown-properties=false
+spring.jackson.parser.allow-unquoted-control-chars=true
+spring.jackson.parser.allow-single-quotes=true
+# gzip
+server.compression.enabled=true
+server.compression.mime-types=application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain

+ 10 - 0
system-controller/src/main/resources/application.properties

@@ -0,0 +1,10 @@
+# common
+spring.profiles.active=dev
+spring.application.name=system
+spring.main.banner-mode=off
+mybatis-plus.global-config.banner=false
+# log4j2
+logging.config=classpath:log4j2-spring-${spring.profiles.active}.xml
+spring.servlet.multipart.max-file-size=10MB
+spring.servlet.multipart.max-request-size=10MB
+id.workerId=${random.long(1,63)}

+ 18 - 0
system-controller/src/main/resources/ehcache.xml

@@ -0,0 +1,18 @@
+<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">
+
+    <cache name="specValueCode"
+           maxElementsInMemory="20000"
+           eternal="false"
+           timeToLiveSeconds="3600"
+    >
+    </cache>
+
+    <cache name="brandNameCode"
+           maxElementsInMemory="1000"
+           eternal="false"
+           timeToLiveSeconds="3600"
+    >
+    </cache>
+
+</ehcache>

+ 157 - 0
system-controller/src/main/resources/log4j2-spring-dev.xml

@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration status="OFF">
+    <properties>
+        <property name="LOG_HOME">./logs/product</property>
+        <Property name="CONSOLE_LOG_PATTERN">%clr{%d{yyyy-MM-dd HH:mm:ss.SSS}}{blue} %clr{%-5level}
+            %clr{${sys:PID}}{magenta} %clr{---}{faint} %clr{[%15.15t]}{faint} %clr{%l}{cyan} %clr{:}{faint} %m%n%xwEx
+        </Property>
+    </properties>
+    <appenders>
+        <!-- 日志级别:ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < OFF -->
+        <Console name="Console" target="SYSTEM_OUT">
+            <!--只接受程序中INFO级别的日志进行处理-->
+            <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
+            <PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss.SSS}]-[%-5level]-[%class{36} %L %M - %msg%xEx]%n"/>
+        </Console>
+
+        <!--处理DEBUG级别的日志,并把该日志放到logs/debug.log文件中-->
+        <!--打印出DEBUG级别日志,每次大小超过size,则这size大小的日志会自动存入按年份-月份建立的文件夹下面并进行压缩,作为存档-->
+        <RollingFile name="RollingFileDebug" fileName="${LOG_HOME}/debug.log"
+                     filePattern="${LOG_HOME}/$${date:yyyy-MM}/debug-%d{yyyy-MM-dd}-%i.log.gz">
+            <Filters>
+                <ThresholdFilter level="DEBUG"/>
+                <ThresholdFilter level="INFO" onMatch="DENY" onMismatch="NEUTRAL"/>
+            </Filters>
+            <PatternLayout
+                    pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %class{36} %L %M - %msg%xEx%n"/>
+            <Policies>
+                <SizeBasedTriggeringPolicy size="200 MB"/>
+                <TimeBasedTriggeringPolicy interval="1"/>
+            </Policies>
+            <DefaultRolloverStrategy max="30">
+                <Delete basePath="${LOG_HOME}/$${date:yyyy-MM}/" maxDepth="2">
+                    <IfFileName glob="*.log.gz"/>
+                    <!-- 这里的age必须和filePattern协调, 后者是精确到HH, 这里就要写成xH, xd就不起作用
+                    另外, 数字最好>2, 否则可能造成删除的时候, 最近的文件还处于被占用状态,导致删除不成功!-->
+                    <!--30天-->
+                    <IfLastModified age="30d"/>
+                </Delete>
+            </DefaultRolloverStrategy>
+        </RollingFile>
+
+        <!--处理INFO级别的日志,并把该日志放到logs/info.log文件中-->
+        <RollingFile name="RollingFileInfo" fileName="${LOG_HOME}/info.log"
+                     filePattern="${LOG_HOME}/$${date:yyyy-MM}/info-%d{yyyy-MM-dd}-%i.log.gz">
+            <Filters>
+                <!--只接受INFO级别的日志,其余的全部拒绝处理-->
+                <LevelRangeFilter maxLevel="INFO" minLevel="ERROR" onMatch="ACCEPT" onMismatch="DENY"/>
+            </Filters>
+            <PatternLayout
+                    pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %class{36} %L %M - %msg%xEx%n"/>
+            <Policies>
+                <SizeBasedTriggeringPolicy size="200 MB"/>
+                <TimeBasedTriggeringPolicy interval="1"/>
+            </Policies>
+            <DefaultRolloverStrategy max="30">
+                <Delete basePath="${LOG_HOME}/$${date:yyyy-MM}/" maxDepth="2">
+                    <IfFileName glob="*.log.gz"/>
+                    <!-- 这里的age必须和filePattern协调, 后者是精确到HH, 这里就要写成xH, xd就不起作用
+                    另外, 数字最好>2, 否则可能造成删除的时候, 最近的文件还处于被占用状态,导致删除不成功!-->
+                    <!--30天-->
+                    <IfLastModified age="30d"/>
+                </Delete>
+            </DefaultRolloverStrategy>
+        </RollingFile>
+
+        <!--处理WARN级别的日志,并把该日志放到logs/warn.log文件中-->
+        <RollingFile name="RollingFileWarn" fileName="${LOG_HOME}/warn.log"
+                     filePattern="${LOG_HOME}/$${date:yyyy-MM}/warn-%d{yyyy-MM-dd}-%i.log.gz">
+            <Filters>
+                <ThresholdFilter level="WARN"/>
+                <ThresholdFilter level="ERROR" onMatch="DENY" onMismatch="NEUTRAL"/>
+            </Filters>
+            <PatternLayout
+                    pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %class{36} %L %M - %msg%xEx%n"/>
+            <Policies>
+                <SizeBasedTriggeringPolicy size="200 MB"/>
+                <TimeBasedTriggeringPolicy interval="1"/>
+            </Policies>
+            <DefaultRolloverStrategy max="30">
+                <Delete basePath="${LOG_HOME}/$${date:yyyy-MM}/" maxDepth="2">
+                    <IfFileName glob="*.log.gz"/>
+                    <!-- 这里的age必须和filePattern协调, 后者是精确到HH, 这里就要写成xH, xd就不起作用
+                    另外, 数字最好>2, 否则可能造成删除的时候, 最近的文件还处于被占用状态,导致删除不成功!-->
+                    <!--30天-->
+                    <IfLastModified age="30d"/>
+                </Delete>
+            </DefaultRolloverStrategy>
+        </RollingFile>
+
+        <!--处理error级别的日志,并把该日志放到logs/error.log文件中-->
+        <RollingFile name="RollingFileError" fileName="${LOG_HOME}/error.log"
+                     filePattern="${LOG_HOME}/$${date:yyyy-MM}/error-%d{yyyy-MM-dd}-%i.log.gz">
+            <ThresholdFilter level="ERROR"/>
+            <PatternLayout
+                    pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %class{36} %L %M - %msg%xEx%n"/>
+            <Policies>
+                <SizeBasedTriggeringPolicy size="200 MB"/>
+                <TimeBasedTriggeringPolicy interval="1"/>
+            </Policies>
+            <DefaultRolloverStrategy max="30">
+                <Delete basePath="${LOG_HOME}/$${date:yyyy-MM}/" maxDepth="2">
+                    <IfFileName glob="*.log.gz"/>
+                    <!-- 这里的age必须和filePattern协调, 后者是精确到HH, 这里就要写成xH, xd就不起作用
+                    另外, 数字最好>2, 否则可能造成删除的时候, 最近的文件还处于被占用状态,导致删除不成功!-->
+                    <!--30天-->
+                    <IfLastModified age="30d"/>
+                </Delete>
+            </DefaultRolloverStrategy>
+        </RollingFile>
+
+        <!--sql的日志记录追加器-->
+        <RollingFile name="druidSqlRollingFile" fileName="${LOG_HOME}/sql.log"
+                     filePattern="${LOG_HOME}/$${date:yyyy-MM}/sql-%d{yyyy-MM-dd}-%i.log.gz">
+            <PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %L %M - %msg%xEx%n"/>
+            <Policies>
+                <SizeBasedTriggeringPolicy size="200 MB"/>
+                <TimeBasedTriggeringPolicy interval="1"/>
+            </Policies>
+            <DefaultRolloverStrategy max="30">
+                <Delete basePath="${LOG_HOME}/$${date:yyyy-MM}/" maxDepth="2">
+                    <IfFileName glob="*.log.gz"/>
+                    <!-- 这里的age必须和filePattern协调, 后者是精确到HH, 这里就要写成xH, xd就不起作用
+                    另外, 数字最好>2, 否则可能造成删除的时候, 最近的文件还处于被占用状态,导致删除不成功!-->
+                    <!--30天-->
+                    <IfLastModified age="30d"/>
+                </Delete>
+            </DefaultRolloverStrategy>
+        </RollingFile>
+    </appenders>
+
+    <loggers>
+        <root level="INFO">
+            <appender-ref ref="Console"/>
+            <appender-ref ref="RollingFileInfo"/>
+            <appender-ref ref="RollingFileWarn"/>
+            <appender-ref ref="RollingFileError"/>
+            <appender-ref ref="RollingFileDebug"/>
+        </root>
+
+        <!--记录druid-sql的记录-->
+        <logger name="druid.sql.Statement" level="INFO" additivity="false">
+            <appender-ref ref="druidSqlRollingFile"/>
+        </logger>
+
+        <!--log4j2 自带过滤日志-->
+        <Logger name="org.apache.catalina.startup.DigesterFactory" level="error"/>
+        <Logger name="org.apache.catalina.util.LifecycleBase" level="error"/>
+        <Logger name="org.apache.coyote.http11.Http11NioProtocol" level="warn"/>
+        <logger name="org.apache.sshd.common.util.SecurityUtils" level="warn"/>
+        <Logger name="org.apache.tomcat.util.net.NioSelectorPool" level="warn"/>
+        <Logger name="org.eclipse.jetty.util.component.AbstractLifeCycle" level="error"/>
+        <Logger name="org.hibernate.validator.internal.util.Version" level="warn"/>
+        <logger name="org.springframework.boot.actuate.autoconfigure.CrshAutoConfiguration" level="warn"/>
+        <logger name="org.springframework.boot.actuate.endpoint.jmx" level="warn"/>
+        <logger name="org.thymeleaf" level="warn"/>
+    </loggers>
+</configuration>

+ 131 - 0
system-controller/src/main/resources/log4j2-spring-prod.xml

@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration status="OFF">
+
+    <properties>
+        <property name="LOG_HOME">/data/logs/product</property>
+        <Property name="CONSOLE_LOG_PATTERN">%clr{%d{yyyy-MM-dd HH:mm:ss.SSS}}{blue} %clr{%-5level}
+            %clr{${sys:PID}}{magenta} %clr{---}{faint} %clr{[%15.15t]}{faint} %clr{%l}{cyan} %clr{:}{faint} %m%n%xwEx
+        </Property>
+    </properties>
+
+    <appenders>
+        <!-- 日志级别:ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < OFF -->
+        <Console name="Console" target="SYSTEM_OUT">
+            <!--只接受程序中INFO级别的日志进行处理-->
+            <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
+            <PatternLayout pattern="${CONSOLE_LOG_PATTERN}"/>
+        </Console>
+
+        <!--处理INFO级别的日志,并把该日志放到logs/info.log文件中-->
+        <RollingFile name="RollingFileInfo" fileName="${LOG_HOME}/info.log"
+                     filePattern="${LOG_HOME}/$${date:yyyy-MM}/info-%d{yyyy-MM-dd}-%i.log.gz">
+            <Filters>
+                <!--只接受INFO级别的日志,其余的全部拒绝处理-->
+                <LevelRangeFilter maxLevel="INFO" minLevel="ERROR" onMatch="ACCEPT" onMismatch="DENY"/>
+            </Filters>
+            <PatternLayout
+                    pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %class{36} %L %M - %msg%xEx%n"/>
+            <Policies>
+                <SizeBasedTriggeringPolicy size="200 MB"/>
+                <TimeBasedTriggeringPolicy interval="1"/>
+            </Policies>
+            <DefaultRolloverStrategy max="30">
+                <Delete basePath="${LOG_HOME}/$${date:yyyy-MM}/" maxDepth="2">
+                    <IfFileName glob="*.log.gz"/>
+                    <!-- 这里的age必须和filePattern协调, 后者是精确到HH, 这里就要写成xH, xd就不起作用
+                    另外, 数字最好>2, 否则可能造成删除的时候, 最近的文件还处于被占用状态,导致删除不成功!-->
+                    <!--30天-->
+                    <IfLastModified age="30d"/>
+                </Delete>
+            </DefaultRolloverStrategy>
+        </RollingFile>
+
+        <!--处理WARN级别的日志,并把该日志放到logs/warn.log文件中-->
+        <RollingFile name="RollingFileWarn" fileName="${LOG_HOME}/warn.log"
+                     filePattern="${LOG_HOME}/$${date:yyyy-MM}/warn-%d{yyyy-MM-dd}-%i.log.gz">
+            <Filters>
+                <ThresholdFilter level="WARN"/>
+                <ThresholdFilter level="ERROR" onMatch="DENY" onMismatch="NEUTRAL"/>
+            </Filters>
+            <PatternLayout
+                    pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %class{36} %L %M - %msg%xEx%n"/>
+            <Policies>
+                <SizeBasedTriggeringPolicy size="200 MB"/>
+                <TimeBasedTriggeringPolicy interval="1"/>
+            </Policies>
+            <DefaultRolloverStrategy max="30">
+                <Delete basePath="${LOG_HOME}/$${date:yyyy-MM}/" maxDepth="2">
+                    <IfFileName glob="*.log.gz"/>
+                    <!-- 这里的age必须和filePattern协调, 后者是精确到HH, 这里就要写成xH, xd就不起作用
+                    另外, 数字最好>2, 否则可能造成删除的时候, 最近的文件还处于被占用状态,导致删除不成功!-->
+                    <!--30天-->
+                    <IfLastModified age="30d"/>
+                </Delete>
+            </DefaultRolloverStrategy>
+        </RollingFile>
+
+        <!--处理error级别的日志,并把该日志放到logs/error.log文件中-->
+        <RollingFile name="RollingFileError" fileName="${LOG_HOME}/error.log"
+                     filePattern="${LOG_HOME}/$${date:yyyy-MM}/error-%d{yyyy-MM-dd}-%i.log.gz">
+            <ThresholdFilter level="ERROR"/>
+            <PatternLayout
+                    pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %class{36} %L %M - %msg%xEx%n"/>
+            <Policies>
+                <SizeBasedTriggeringPolicy size="200 MB"/>
+                <TimeBasedTriggeringPolicy interval="1"/>
+            </Policies>
+            <DefaultRolloverStrategy max="30">
+                <Delete basePath="${LOG_HOME}/$${date:yyyy-MM}/" maxDepth="2">
+                    <IfFileName glob="*.log.gz"/>
+                    <!-- 这里的age必须和filePattern协调, 后者是精确到HH, 这里就要写成xH, xd就不起作用
+                    另外, 数字最好>2, 否则可能造成删除的时候, 最近的文件还处于被占用状态,导致删除不成功!-->
+                    <!--30天-->
+                    <IfLastModified age="30d"/>
+                </Delete>
+            </DefaultRolloverStrategy>
+        </RollingFile>
+
+        <!--sql的日志记录追加器-->
+        <RollingFile name="druidSqlRollingFile" fileName="${LOG_HOME}/sql.log"
+                     filePattern="${LOG_HOME}/$${date:yyyy-MM}/sql-%d{yyyy-MM-dd}-%i.log.gz">
+            <PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %L %M - %msg%xEx%n"/>
+            <Policies>
+                <SizeBasedTriggeringPolicy size="200 MB"/>
+                <TimeBasedTriggeringPolicy interval="1"/>
+            </Policies>
+            <DefaultRolloverStrategy max="30">
+                <Delete basePath="${LOG_HOME}/$${date:yyyy-MM}/" maxDepth="2">
+                    <IfFileName glob="*.log.gz"/>
+                    <!-- 这里的age必须和filePattern协调, 后者是精确到HH, 这里就要写成xH, xd就不起作用
+                    另外, 数字最好>2, 否则可能造成删除的时候, 最近的文件还处于被占用状态,导致删除不成功!-->
+                    <!--30天-->
+                    <IfLastModified age="30d"/>
+                </Delete>
+            </DefaultRolloverStrategy>
+        </RollingFile>
+
+    </appenders>
+
+    <loggers>
+        <root level="INFO">
+            <appender-ref ref="Console"/>
+            <appender-ref ref="RollingFileInfo"/>
+            <appender-ref ref="RollingFileWarn"/>
+            <appender-ref ref="RollingFileError"/>
+        </root>
+
+        <!--记录druid-sql的记录-->
+        <logger name="druid.sql.Statement" level="INFO" additivity="false">
+            <appender-ref ref="druidSqlRollingFile"/>
+        </logger>
+
+        <!--log4j2 自带过滤日志-->
+        <Logger name="org.apache.catalina.util.LifecycleBase" level="error"/>
+        <Logger name="org.apache.coyote.http11.Http11NioProtocol" level="warn"/>
+        <Logger name="org.apache.tomcat.util.net.NioSelectorPool" level="warn"/>
+        <Logger name="org.eclipse.jetty.util.component.AbstractLifeCycle" level="error"/>
+        <Logger name="org.hibernate.validator.internal.util.Version" level="warn"/>
+        <logger name="org.springframework.boot.actuate.endpoint.jmx" level="warn"/>
+        <logger name="org.thymeleaf" level="warn"/>
+    </loggers>
+</configuration>

+ 151 - 0
system-controller/src/main/resources/log4j2-spring-test.xml

@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration status="OFF">
+    <properties>
+        <property name="LOG_HOME">/data/logs/product</property>
+    </properties>
+    <appenders>
+        <!-- 日志级别:ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < OFF -->
+        <Console name="Console" target="SYSTEM_OUT">
+            <!--只接受程序中INFO级别的日志进行处理-->
+            <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
+            <PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss.SSS}]-[%-5level]-[%class{36} %L %M - %msg%xEx]%n"/>
+        </Console>
+
+        <!--处理DEBUG级别的日志,并把该日志放到logs/debug.log文件中-->
+        <!--打印出DEBUG级别日志,每次大小超过size,则这size大小的日志会自动存入按年份-月份建立的文件夹下面并进行压缩,作为存档-->
+        <RollingFile name="RollingFileDebug" fileName="${LOG_HOME}/debug-${LOCAL_IP}.log"
+                     filePattern="${LOG_HOME}/$${date:yyyy-MM}/debug-%d{yyyy-MM-dd}-%i.log.gz">
+            <Filters>
+                <ThresholdFilter level="DEBUG"/>
+                <ThresholdFilter level="INFO" onMatch="DENY" onMismatch="NEUTRAL"/>
+            </Filters>
+            <PatternLayout
+                    pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %class{36} %L %M - %msg%xEx%n"/>
+            <Policies>
+                <SizeBasedTriggeringPolicy size="200 MB"/>
+                <TimeBasedTriggeringPolicy interval="1"/>
+            </Policies>
+            <DefaultRolloverStrategy max="30">
+                <Delete basePath="${LOG_HOME}/$${date:yyyy-MM}/" maxDepth="2">
+                    <IfFileName glob="*.log.gz"/>
+                    <!-- 这里的age必须和filePattern协调, 后者是精确到HH, 这里就要写成xH, xd就不起作用
+                    另外, 数字最好>2, 否则可能造成删除的时候, 最近的文件还处于被占用状态,导致删除不成功!-->
+                    <!--30天-->
+                    <IfLastModified age="30d"/>
+                </Delete>
+            </DefaultRolloverStrategy>
+        </RollingFile>
+
+        <!--处理INFO级别的日志,并把该日志放到logs/info.log文件中-->
+        <RollingFile name="RollingFileInfo" fileName="${LOG_HOME}/info.log"
+                     filePattern="${LOG_HOME}/$${date:yyyy-MM}/info-%d{yyyy-MM-dd}-%i.log.gz">
+            <Filters>
+                <!--只接受INFO级别的日志,其余的全部拒绝处理-->
+                <LevelRangeFilter maxLevel="INFO" minLevel="ERROR" onMatch="ACCEPT" onMismatch="DENY"/>
+            </Filters>
+            <PatternLayout
+                    pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %class{36} %L %M - %msg%xEx%n"/>
+            <Policies>
+                <SizeBasedTriggeringPolicy size="200 MB"/>
+                <TimeBasedTriggeringPolicy interval="1"/>
+            </Policies>
+            <DefaultRolloverStrategy max="30">
+                <Delete basePath="${LOG_HOME}/$${date:yyyy-MM}/" maxDepth="2">
+                    <IfFileName glob="*.log.gz"/>
+                    <!-- 这里的age必须和filePattern协调, 后者是精确到HH, 这里就要写成xH, xd就不起作用
+                    另外, 数字最好>2, 否则可能造成删除的时候, 最近的文件还处于被占用状态,导致删除不成功!-->
+                    <!--30天-->
+                    <IfLastModified age="30d"/>
+                </Delete>
+            </DefaultRolloverStrategy>
+        </RollingFile>
+
+        <!--处理WARN级别的日志,并把该日志放到logs/warn.log文件中-->
+        <RollingFile name="RollingFileWarn" fileName="${LOG_HOME}/warn.log"
+                     filePattern="${LOG_HOME}/$${date:yyyy-MM}/warn-%d{yyyy-MM-dd}-%i.log.gz">
+            <Filters>
+                <ThresholdFilter level="WARN"/>
+                <ThresholdFilter level="ERROR" onMatch="DENY" onMismatch="NEUTRAL"/>
+            </Filters>
+            <PatternLayout
+                    pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %class{36} %L %M - %msg%xEx%n"/>
+            <Policies>
+                <SizeBasedTriggeringPolicy size="200 MB"/>
+                <TimeBasedTriggeringPolicy interval="1"/>
+            </Policies>
+            <DefaultRolloverStrategy max="30">
+                <Delete basePath="${LOG_HOME}/$${date:yyyy-MM}/" maxDepth="2">
+                    <IfFileName glob="*.log.gz"/>
+                    <!-- 这里的age必须和filePattern协调, 后者是精确到HH, 这里就要写成xH, xd就不起作用
+                    另外, 数字最好>2, 否则可能造成删除的时候, 最近的文件还处于被占用状态,导致删除不成功!-->
+                    <!--30天-->
+                    <IfLastModified age="30d"/>
+                </Delete>
+            </DefaultRolloverStrategy>
+        </RollingFile>
+
+        <!--处理error级别的日志,并把该日志放到logs/error.log文件中-->
+        <RollingFile name="RollingFileError" fileName="${LOG_HOME}/error.log"
+                     filePattern="${LOG_HOME}/$${date:yyyy-MM}/error-%d{yyyy-MM-dd}-%i.log.gz">
+            <ThresholdFilter level="ERROR"/>
+            <PatternLayout
+                    pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %class{36} %L %M - %msg%xEx%n"/>
+            <Policies>
+                <SizeBasedTriggeringPolicy size="200 MB"/>
+                <TimeBasedTriggeringPolicy interval="1"/>
+            </Policies>
+            <DefaultRolloverStrategy max="30">
+                <Delete basePath="${LOG_HOME}/$${date:yyyy-MM}/" maxDepth="2">
+                    <IfFileName glob="*.log.gz"/>
+                    <!-- 这里的age必须和filePattern协调, 后者是精确到HH, 这里就要写成xH, xd就不起作用
+                    另外, 数字最好>2, 否则可能造成删除的时候, 最近的文件还处于被占用状态,导致删除不成功!-->
+                    <!--30天-->
+                    <IfLastModified age="30d"/>
+                </Delete>
+            </DefaultRolloverStrategy>
+        </RollingFile>
+
+        <!--sql的日志记录追加器-->
+        <RollingFile name="druidSqlRollingFile" fileName="${LOG_HOME}/sql.log"
+                     filePattern="${LOG_HOME}/$${date:yyyy-MM}/sql-%d{yyyy-MM-dd}-%i.log.gz">
+            <PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss}] %-5level %L %M - %msg%xEx%n"/>
+            <Policies>
+                <SizeBasedTriggeringPolicy size="200 MB"/>
+                <TimeBasedTriggeringPolicy interval="1"/>
+            </Policies>
+            <DefaultRolloverStrategy max="30">
+                <Delete basePath="${LOG_HOME}/$${date:yyyy-MM}/" maxDepth="2">
+                    <IfFileName glob="*.log.gz"/>
+                    <!-- 这里的age必须和filePattern协调, 后者是精确到HH, 这里就要写成xH, xd就不起作用
+                    另外, 数字最好>2, 否则可能造成删除的时候, 最近的文件还处于被占用状态,导致删除不成功!-->
+                    <!--30天-->
+                    <IfLastModified age="30d"/>
+                </Delete>
+            </DefaultRolloverStrategy>
+        </RollingFile>
+    </appenders>
+
+    <loggers>
+        <root level="info">
+            <appender-ref ref="Console"/>
+            <appender-ref ref="RollingFileInfo"/>
+            <appender-ref ref="RollingFileWarn"/>
+            <appender-ref ref="RollingFileError"/>
+            <appender-ref ref="RollingFileDebug"/>
+        </root>
+
+        <!--记录druid-sql的记录-->
+        <logger name="druid.sql.Statement" level="debug" additivity="false">
+            <appender-ref ref="druidSqlRollingFile"/>
+        </logger>
+
+        <!--log4j2 自带过滤日志-->
+        <Logger name="org.apache.catalina.util.LifecycleBase" level="error"/>
+        <Logger name="org.apache.coyote.http11.Http11NioProtocol" level="warn"/>
+        <Logger name="org.apache.tomcat.util.net.NioSelectorPool" level="warn"/>
+        <Logger name="org.eclipse.jetty.util.component.AbstractLifeCycle" level="error"/>
+        <Logger name="org.hibernate.validator.internal.util.Version" level="warn"/>
+        <logger name="org.springframework.boot.actuate.endpoint.jmx" level="warn"/>
+        <logger name="org.thymeleaf" level="warn"/>
+    </loggers>
+</configuration>

+ 11 - 0
system-controller/src/main/resources/smart-doc.json

@@ -0,0 +1,11 @@
+{
+  "outPath":"./src/main/resources/static/doc",
+  "serverUrl": "http://127.0.0.1:8082/test",
+  "isStrict": false,
+  "coverOld": true,
+  "allInOne": true,
+  "packageFilters": "com.bizmatics.demo.controller.web",
+  "requestExample":"false",
+  "responseExample":"true",
+  "projectName": "test"
+}

File diff suppressed because it is too large
+ 0 - 0
system-controller/src/main/resources/static/doc/AllInOne.css


File diff suppressed because it is too large
+ 0 - 0
system-controller/src/main/resources/static/doc/index.html


+ 116 - 0
system-controller/src/main/resources/static/doc/search.js

@@ -0,0 +1,116 @@
+let api = [];
+api.push({
+    alias: 'TestController',
+    order: '1',
+    link: '',
+    desc: '',
+    list: []
+})
+api[0].list.push({
+    order: '1',
+    desc: '测试参数和返回值',
+});
+api[0].list.push({
+    order: '2',
+    desc: '测试多数据源事务',
+});
+api[0].list.push({
+    order: '3',
+    desc: '查询全部信息',
+});
+api.push({
+    alias: 'dict',
+    order: '2',
+    link: 'dict_list',
+    desc: '数据字典',
+    list: []
+})
+document.onkeydown = keyDownSearch;
+function keyDownSearch(e) {
+    const theEvent = e;
+    const code = theEvent.keyCode || theEvent.which || theEvent.charCode;
+    if (code == 13) {
+        const search = document.getElementById('search');
+        const searchValue = search.value;
+        let searchArr = [];
+        for (let i = 0; i < api.length; i++) {
+            let apiData = api[i];
+            const desc = apiData.desc;
+            if (desc.indexOf(searchValue) > -1) {
+                searchArr.push({
+                    order: apiData.order,
+                    desc: apiData.desc,
+                    link: apiData.link,
+                    list: apiData.list
+                });
+            } else {
+                let methodList = apiData.list || [];
+                let methodListTemp = [];
+                for (let j = 0; j < methodList.length; j++) {
+                    const methodData = methodList[j];
+                    const methodDesc = methodData.desc;
+                    if (methodDesc.indexOf(searchValue) > -1) {
+                        methodListTemp.push(methodData);
+                        break;
+                    }
+                }
+                if (methodListTemp.length > 0) {
+                    const data = {
+                        order: apiData.order,
+                        desc: apiData.desc,
+                        link: apiData.link,
+                        list: methodListTemp
+                    };
+                    searchArr.push(data);
+                }
+            }
+        }
+        let html;
+        if (searchValue == '') {
+            const liClass = "";
+            const display = "display: none";
+            html = buildAccordion(api,liClass,display);
+            document.getElementById('accordion').innerHTML = html;
+        } else {
+            const liClass = "open";
+            const display = "display: block";
+            html = buildAccordion(searchArr,liClass,display);
+            document.getElementById('accordion').innerHTML = html;
+        }
+        const Accordion = function (el, multiple) {
+            this.el = el || {};
+            this.multiple = multiple || false;
+            const links = this.el.find('.dd');
+            links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown);
+        };
+        Accordion.prototype.dropdown = function (e) {
+            const $el = e.data.el;
+            $this = $(this), $next = $this.next();
+            $next.slideToggle();
+            $this.parent().toggleClass('open');
+            if (!e.data.multiple) {
+                $el.find('.submenu').not($next).slideUp("20").parent().removeClass('open');
+            }
+        };
+        new Accordion($('#accordion'), false);
+    }
+}
+
+function buildAccordion(apiData, liClass, display) {
+    let html = "";
+    let doc;
+    if (apiData.length > 0) {
+        for (let j = 0; j < apiData.length; j++) {
+            html += '<li class="'+liClass+'">';
+            html += '<a class="dd" href="#_' + apiData[j].link + '">' + apiData[j].order + '.&nbsp;' + apiData[j].desc + '</a>';
+            html += '<ul class="sectlevel2" style="'+display+'">';
+            doc = apiData[j].list;
+            for (let m = 0; m < doc.length; m++) {
+                html += '<li><a href="#_' + apiData[j].order + '_' + doc[m].order + '_' + doc[m].desc + '">' + apiData[j].order + '.' + doc[m].order + '.&nbsp;' + doc[m].desc + '</a> </li>';
+            }
+            html += '</ul>';
+            html += '</li>';
+        }
+    }
+    return html;
+}

+ 13 - 0
system-controller/src/test/java/com/bizmatics/system/controller/SystemControllerApplicationTests.java

@@ -0,0 +1,13 @@
+package com.bizmatics.system.controller;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class SystemControllerApplicationTests {
+
+    @Test
+    void contextLoads() {
+    }
+
+}

+ 24 - 0
system-model/pom.xml

@@ -0,0 +1,24 @@
+<?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>system</artifactId>
+        <groupId>com.bizmatics</groupId>
+        <version>0.0.1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>system-model</artifactId>
+    <name>system-model</name>
+    <version>0.0.1</version>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+        </dependency>
+
+    </dependencies>
+
+
+</project>

+ 26 - 0
system-model/src/main/java/com/bizmatics/model/SysAsyncTask.java

@@ -0,0 +1,26 @@
+package com.bizmatics.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author fzq
+ */
+@Data
+public class SysAsyncTask {
+    @TableId(type = IdType.ASSIGN_ID)
+    private Long id;
+    private String funcType;
+    private Date startTime;
+    private Date endTime;
+    private Boolean isSuccess;
+    private String resultType;
+    private String resultKey;
+    private String result;
+    private String createUserId;
+    private String createUserName;
+    private Date createTime;
+}

+ 108 - 0
system-model/src/main/java/com/bizmatics/model/SysConfig.java

@@ -0,0 +1,108 @@
+package com.bizmatics.model;
+
+
+import com.bizmatics.model.base.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+
+/**
+ * 参数配置表 sys_config
+ */
+public class SysConfig extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 参数主键
+     */
+
+    private Long configId;
+
+    /**
+     * 参数名称
+     */
+
+    private String configName;
+
+    /**
+     * 参数键名
+     */
+
+    private String configKey;
+
+    /**
+     * 参数键值
+     */
+
+    private String configValue;
+
+    /**
+     * 系统内置(Y是 N否)
+     */
+
+    private String configType;
+
+    public Long getConfigId() {
+        return configId;
+    }
+
+    public void setConfigId(Long configId) {
+        this.configId = configId;
+    }
+
+    @NotBlank(message = "参数名称不能为空")
+    @Size(min = 0, max = 100, message = "参数名称不能超过100个字符")
+    public String getConfigName() {
+        return configName;
+    }
+
+    public void setConfigName(String configName) {
+        this.configName = configName;
+    }
+
+    @NotBlank(message = "参数键名长度不能为空")
+    @Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符")
+    public String getConfigKey() {
+        return configKey;
+    }
+
+    public void setConfigKey(String configKey) {
+        this.configKey = configKey;
+    }
+
+    @NotBlank(message = "参数键值不能为空")
+    @Size(min = 0, max = 2000, message = "参数键值长度不能超过2000个字符")
+    public String getConfigValue() {
+        return configValue;
+    }
+
+    public void setConfigValue(String configValue) {
+        this.configValue = configValue;
+    }
+
+    public String getConfigType() {
+        return configType;
+    }
+
+    public void setConfigType(String configType) {
+        this.configType = configType;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("configId", getConfigId())
+                .append("configName", getConfigName())
+                .append("configKey", getConfigKey())
+                .append("configValue", getConfigValue())
+                .append("configType", getConfigType())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 171 - 0
system-model/src/main/java/com/bizmatics/model/SysDictData.java

@@ -0,0 +1,171 @@
+package com.bizmatics.model;
+
+import com.bizmatics.common.core.constants.CommonConst;
+import com.bizmatics.model.base.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+
+/**
+ * 字典数据表 sys_dict_data
+ */
+public class SysDictData extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 字典编码
+     */
+
+    private Long dictCode;
+
+    /**
+     * 字典排序
+     */
+
+    private Long dictSort;
+
+    /**
+     * 字典标签
+     */
+
+    private String dictLabel;
+
+    /**
+     * 字典键值
+     */
+
+    private String dictValue;
+
+    /**
+     * 字典类型
+     */
+
+    private String dictType;
+
+    /**
+     * 样式属性(其他样式扩展)
+     */
+    private String cssClass;
+
+    /**
+     * 表格字典样式
+     */
+    private String listClass;
+
+    /**
+     * 是否默认(Y是 N否)
+     */
+
+    private String isDefault;
+
+    /**
+     * 状态(0正常 1停用)
+     */
+
+    private String status;
+
+    public Long getDictCode() {
+        return dictCode;
+    }
+
+    public void setDictCode(Long dictCode) {
+        this.dictCode = dictCode;
+    }
+
+    public Long getDictSort() {
+        return dictSort;
+    }
+
+    public void setDictSort(Long dictSort) {
+        this.dictSort = dictSort;
+    }
+
+    @NotBlank(message = "字典标签不能为空")
+    @Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
+    public String getDictLabel() {
+        return dictLabel;
+    }
+
+    public void setDictLabel(String dictLabel) {
+        this.dictLabel = dictLabel;
+    }
+
+    @NotBlank(message = "字典键值不能为空")
+    @Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
+    public String getDictValue() {
+        return dictValue;
+    }
+
+    public void setDictValue(String dictValue) {
+        this.dictValue = dictValue;
+    }
+
+    @NotBlank(message = "字典类型不能为空")
+    @Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
+    public String getDictType() {
+        return dictType;
+    }
+
+    public void setDictType(String dictType) {
+        this.dictType = dictType;
+    }
+
+    @Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
+    public String getCssClass() {
+        return cssClass;
+    }
+
+    public void setCssClass(String cssClass) {
+        this.cssClass = cssClass;
+    }
+
+    public String getListClass() {
+        return listClass;
+    }
+
+    public void setListClass(String listClass) {
+        this.listClass = listClass;
+    }
+
+    public boolean getDefault() {
+        return CommonConst.YES_STR_CODE.equals(this.isDefault) ? true : false;
+    }
+
+    public String getIsDefault() {
+        return isDefault;
+    }
+
+    public void setIsDefault(String isDefault) {
+        this.isDefault = isDefault;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("dictCode", getDictCode())
+                .append("dictSort", getDictSort())
+                .append("dictLabel", getDictLabel())
+                .append("dictValue", getDictValue())
+                .append("dictType", getDictType())
+                .append("cssClass", getCssClass())
+                .append("listClass", getListClass())
+                .append("isDefault", getIsDefault())
+                .append("status", getStatus())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 92 - 0
system-model/src/main/java/com/bizmatics/model/SysDictType.java

@@ -0,0 +1,92 @@
+package com.bizmatics.model;
+
+
+
+import com.bizmatics.model.base.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+
+/**
+ * 字典类型表 sys_dict_type
+ */
+public class SysDictType extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 字典主键
+     */
+
+    private Long dictId;
+
+    /**
+     * 字典名称
+     */
+
+    private String dictName;
+
+    /**
+     * 字典类型
+     */
+
+    private String dictType;
+
+    /**
+     * 状态(0正常 1停用)
+     */
+
+    private String status;
+
+    public Long getDictId() {
+        return dictId;
+    }
+
+    public void setDictId(Long dictId) {
+        this.dictId = dictId;
+    }
+
+    @NotBlank(message = "字典名称不能为空")
+    @Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
+    public String getDictName() {
+        return dictName;
+    }
+
+    public void setDictName(String dictName) {
+        this.dictName = dictName;
+    }
+
+    @NotBlank(message = "字典类型不能为空")
+    @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
+    public String getDictType() {
+        return dictType;
+    }
+
+    public void setDictType(String dictType) {
+        this.dictType = dictType;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("dictId", getDictId())
+                .append("dictName", getDictName())
+                .append("dictType", getDictType())
+                .append("status", getStatus())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 76 - 0
system-model/src/main/java/com/bizmatics/model/SysFile.java

@@ -0,0 +1,76 @@
+package com.bizmatics.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.bizmatics.common.mvc.base.BaseModel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author chen
+ */
+@Data
+@TableName("sys_file")
+public class SysFile extends BaseModel {
+    /**
+     * 文件id
+     */
+    @TableId(type = IdType.INPUT)
+    private String id;
+    /**
+     * 文件批次
+     */
+    private String batchNo;
+    /**
+     * 文件类型 pdf,html,jpg,mp3
+     */
+    private String fileType;
+    /**
+     * 原文件名
+     */
+    private String oriName;
+    /**
+     * 文件上传后, 生成的key
+     */
+    private String ossKey;
+    /**
+     * 文件的外网访问url
+     */
+    private String url;
+    /**
+     * 使用该文件的功能
+     * 业务模块
+     */
+    private String businessType;
+    /**
+     * 存储该文件的OSS平台
+     */
+    private String ossPlat;
+    /**
+     * 文件的读写权限
+     */
+    private String ossAcl;
+    /**
+     * 文件大小
+     */
+    private Integer fileSize;
+    /**
+     * 文件过期时间
+     */
+    private Date expireAt;
+    /**
+     * 文件是否有效 0 无效, 1有效
+     */
+    private Integer activeFlag;
+    /**
+     * 文件是否已删除 0未删除 1已删除
+     */
+    private String delFlag;
+
+    @TableField(exist = false)
+    private String internalUrl;
+
+}

+ 137 - 0
system-model/src/main/java/com/bizmatics/model/base/BaseEntity.java

@@ -0,0 +1,137 @@
+package com.bizmatics.model.base;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Entity基类
+ */
+public class BaseEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 搜索值
+     */
+    private String searchValue;
+
+    /**
+     * 创建者
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 更新者
+     */
+    private String updateBy;
+
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 开始时间
+     */
+    @JsonIgnore
+    private String beginTime;
+
+    /**
+     * 结束时间
+     */
+    @JsonIgnore
+    private String endTime;
+
+    /**
+     * 请求参数
+     */
+    private Map<String, Object> params;
+
+    public String getSearchValue() {
+        return searchValue;
+    }
+
+    public void setSearchValue(String searchValue) {
+        this.searchValue = searchValue;
+    }
+
+    public String getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(String createBy) {
+        this.createBy = createBy;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getUpdateBy() {
+        return updateBy;
+    }
+
+    public void setUpdateBy(String updateBy) {
+        this.updateBy = updateBy;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getBeginTime() {
+        return beginTime;
+    }
+
+    public void setBeginTime(String beginTime) {
+        this.beginTime = beginTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public Map<String, Object> getParams() {
+        if (params == null) {
+            params = new HashMap<>();
+        }
+        return params;
+    }
+
+    public void setParams(Map<String, Object> params) {
+        this.params = params;
+    }
+}

+ 23 - 0
system-model/src/main/java/com/bizmatics/model/vo/SysAsyncTaskVo.java

@@ -0,0 +1,23 @@
+package com.bizmatics.model.vo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author fzq
+ */
+@Data
+public class SysAsyncTaskVo {
+    private String idStr;
+    private String funcType;
+    private Date startTime;
+    private Date endTime;
+    private Boolean isSuccess;
+    private String resultType;
+    private String result;
+    private String resultKey;
+    private String createUserId;
+    private String createUserName;
+    private Date createTime;
+}

+ 42 - 0
system-persistence/pom.xml

@@ -0,0 +1,42 @@
+<?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>system</artifactId>
+        <groupId>com.bizmatics</groupId>
+        <version>0.0.1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+
+    <artifactId>system-persistence</artifactId>
+    <name>system-persistence</name>
+    <version>0.0.1</version>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>com.bizmatics</groupId>
+            <artifactId>system-model</artifactId>
+            <version>0.0.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.bizmatics</groupId>
+            <artifactId>common-mvc</artifactId>
+            <version>0.0.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-mongodb</artifactId>
+        </dependency>
+
+    </dependencies>
+
+
+</project>

+ 22 - 0
system-persistence/src/main/java/com/bizmatics/persistence/mapper/FileMapper.java

@@ -0,0 +1,22 @@
+package com.bizmatics.persistence.mapper;
+
+import com.bizmatics.common.mvc.base.CrudMapper;
+import com.bizmatics.model.SysFile;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.Date;
+import java.util.List;
+
+@Repository
+public interface FileMapper extends CrudMapper<SysFile> {
+
+
+    /**
+     * 根据失效时间获取记录
+     *
+     * @param expireAt
+     * @return
+     */
+    List<SysFile> selectByExpireAt(@Param("expireAt") Date expireAt);
+}

+ 24 - 0
system-persistence/src/main/java/com/bizmatics/persistence/mapper/SysAsyncTaskMapper.java

@@ -0,0 +1,24 @@
+package com.bizmatics.persistence.mapper;
+
+import com.bizmatics.common.mvc.base.CrudMapper;
+import com.bizmatics.model.SysAsyncTask;
+import org.springframework.stereotype.Repository;
+
+import java.util.Date;
+
+/**
+ * @author fanzhiqiang
+ */
+@Repository
+public interface SysAsyncTaskMapper extends CrudMapper<SysAsyncTask> {
+
+    /**
+     * 查询某个用户一小时内调用次数
+     *
+     * @param userId  用户ID
+     * @param endTime now()-1h
+     * @return 调用次数
+     */
+    Integer getCountByUserIdAndFuncTypeAndCreateTime(String userId, String funcType, Date endTime);
+
+}

+ 68 - 0
system-persistence/src/main/java/com/bizmatics/persistence/mapper/SysConfigMapper.java

@@ -0,0 +1,68 @@
+package com.bizmatics.persistence.mapper;
+
+
+
+import com.bizmatics.model.SysConfig;
+
+import java.util.List;
+
+/**
+ * 参数配置 数据层
+ */
+public interface SysConfigMapper {
+    /**
+     * 查询参数配置信息
+     *
+     * @param config 参数配置信息
+     * @return 参数配置信息
+     */
+    public SysConfig selectConfig(SysConfig config);
+
+    /**
+     * 查询参数配置列表
+     *
+     * @param config 参数配置信息
+     * @return 参数配置集合
+     */
+    public List<SysConfig> selectConfigList(SysConfig config);
+
+    /**
+     * 根据键名查询参数配置信息
+     *
+     * @param configKey 参数键名
+     * @return 参数配置信息
+     */
+    public SysConfig checkConfigKeyUnique(String configKey);
+
+    /**
+     * 新增参数配置
+     *
+     * @param config 参数配置信息
+     * @return 结果
+     */
+    public int insertConfig(SysConfig config);
+
+    /**
+     * 修改参数配置
+     *
+     * @param config 参数配置信息
+     * @return 结果
+     */
+    public int updateConfig(SysConfig config);
+
+    /**
+     * 删除参数配置
+     *
+     * @param configId 参数ID
+     * @return 结果
+     */
+    public int deleteConfigById(Long configId);
+
+    /**
+     * 批量删除参数信息
+     *
+     * @param configIds 需要删除的参数ID
+     * @return 结果
+     */
+    public int deleteConfigByIds(Long[] configIds);
+}

+ 105 - 0
system-persistence/src/main/java/com/bizmatics/persistence/mapper/SysDictDataMapper.java

@@ -0,0 +1,105 @@
+package com.bizmatics.persistence.mapper;
+
+
+import com.bizmatics.model.SysDictData;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 字典表 数据层
+ */
+public interface SysDictDataMapper {
+    /**
+     * 根据条件分页查询字典数据
+     *
+     * @param dictData 字典数据信息
+     * @return 字典数据集合信息
+     */
+    public List<SysDictData> selectDictDataList(SysDictData dictData);
+
+    /**
+     * 根据字典类型查询字典数据
+     *
+     * @param dictType 字典类型
+     * @return 字典数据集合信息
+     */
+    public List<SysDictData> selectDictDataByType(String dictType);
+
+    /**
+     * 根据字典类型和字典键值查询字典数据信息
+     *
+     * @param dictType  字典类型
+     * @param dictValue 字典键值
+     * @return 字典标签
+     */
+    public SysDictData selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue);
+
+    /**
+     * 根据字典和
+     *
+     * @param dictType
+     * @param dictLabel
+     * @return
+     */
+    public SysDictData selectDictValue(@Param("dictType") String dictType, @Param("dictLabel") String dictLabel);
+
+    /**
+     * 根据字典数据ID查询信息
+     *
+     * @param dictCode 字典数据ID
+     * @return 字典数据
+     */
+    public SysDictData selectDictDataById(Long dictCode);
+
+    /**
+     * 查询字典数据
+     *
+     * @param dictType 字典类型
+     * @return 字典数据
+     */
+    public int countDictDataByType(String dictType);
+
+    /**
+     * 通过字典ID删除字典数据信息
+     *
+     * @param dictCode 字典数据ID
+     * @return 结果
+     */
+    public int deleteDictDataById(Long dictCode);
+
+    /**
+     * 批量删除字典数据信息
+     *
+     * @param dictCodes 需要删除的字典数据ID
+     * @return 结果
+     */
+    public int deleteDictDataByIds(Long[] dictCodes);
+
+    /**
+     * 新增字典数据信息
+     *
+     * @param dictData 字典数据信息
+     * @return 结果
+     */
+    public int insertDictData(SysDictData dictData);
+
+    /**
+     * 修改字典数据信息
+     *
+     * @param dictData 字典数据信息
+     * @return 结果
+     */
+    public int updateDictData(SysDictData dictData);
+
+    /**
+     * 同步修改字典类型
+     *
+     * @param oldDictType 旧字典类型
+     * @param newDictType 新旧字典类型
+     * @return 结果
+     */
+    public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType);
+
+
+}

+ 82 - 0
system-persistence/src/main/java/com/bizmatics/persistence/mapper/SysDictTypeMapper.java

@@ -0,0 +1,82 @@
+package com.bizmatics.persistence.mapper;
+
+
+import com.bizmatics.model.SysDictType;
+
+import java.util.List;
+
+/**
+ * 字典表 数据层
+ */
+public interface SysDictTypeMapper {
+    /**
+     * 根据条件分页查询字典类型
+     *
+     * @param dictType 字典类型信息
+     * @return 字典类型集合信息
+     */
+    public List<SysDictType> selectDictTypeList(SysDictType dictType);
+
+    /**
+     * 根据所有字典类型
+     *
+     * @return 字典类型集合信息
+     */
+    public List<SysDictType> selectDictTypeAll();
+
+    /**
+     * 根据字典类型ID查询信息
+     *
+     * @param dictId 字典类型ID
+     * @return 字典类型
+     */
+    public SysDictType selectDictTypeById(Long dictId);
+
+    /**
+     * 根据字典类型查询信息
+     *
+     * @param dictType 字典类型
+     * @return 字典类型
+     */
+    public SysDictType selectDictTypeByType(String dictType);
+
+    /**
+     * 通过字典ID删除字典信息
+     *
+     * @param dictId 字典ID
+     * @return 结果
+     */
+    public int deleteDictTypeById(Long dictId);
+
+    /**
+     * 批量删除字典类型信息
+     *
+     * @param dictIds 需要删除的字典ID
+     * @return 结果
+     */
+    public int deleteDictTypeByIds(Long[] dictIds);
+
+    /**
+     * 新增字典类型信息
+     *
+     * @param dictType 字典类型信息
+     * @return 结果
+     */
+    public int insertDictType(SysDictType dictType);
+
+    /**
+     * 修改字典类型信息
+     *
+     * @param dictType 字典类型信息
+     * @return 结果
+     */
+    public int updateDictType(SysDictType dictType);
+
+    /**
+     * 校验字典类型称是否唯一
+     *
+     * @param dictType 字典类型
+     * @return 结果
+     */
+    public SysDictType checkDictTypeUnique(String dictType);
+}

+ 12 - 0
system-persistence/src/main/resources/mapper/mysql/SysAsyncTaskMapper.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.bizmatics.persistence.mapper.SysAsyncTaskMapper">
+
+    <select id="getCountByUserIdAndFuncTypeAndCreateTime" resultType="java.lang.Integer">
+        select count(1)
+        from sys_async_task
+        where create_user_id = #{userId}
+          and func_type = #{funcType}
+          and create_time &gt; #{endTime}
+    </select>
+</mapper>

+ 123 - 0
system-persistence/src/main/resources/mapper/mysql/SysConfigMapper.xml

@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.bizmatics.persistence.mapper.SysConfigMapper">
+
+    <resultMap type="SysConfig" id="SysConfigResult">
+        <id property="configId" column="config_id"/>
+        <result property="configName" column="config_name"/>
+        <result property="configKey" column="config_key"/>
+        <result property="configValue" column="config_value"/>
+        <result property="configType" column="config_type"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectConfigVo">
+        select config_id,
+               config_name,
+               config_key,
+               config_value,
+               config_type,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from sys_config
+    </sql>
+
+    <!-- 查询条件 -->
+    <sql id="sqlwhereSearch">
+        <where>
+            <if test="configId !=null">
+                and config_id = #{configId}
+            </if>
+            <if test="configKey !=null and configKey != ''">
+                and config_key = #{configKey}
+            </if>
+        </where>
+    </sql>
+
+    <select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
+        <include refid="selectConfigVo"/>
+        <include refid="sqlwhereSearch"/>
+    </select>
+
+    <select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
+        <include refid="selectConfigVo"/>
+        <where>
+            <if test="configName != null and configName != ''">
+                AND config_name like concat('%', #{configName}, '%')
+            </if>
+            <if test="configType != null and configType != ''">
+                AND config_type = #{configType}
+            </if>
+            <if test="configKey != null and configKey != ''">
+                AND config_key like concat('%', #{configKey}, '%')
+            </if>
+            <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+                and date_format(create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
+            </if>
+            <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+                and date_format(create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
+            </if>
+        </where>
+    </select>
+
+    <select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
+        <include refid="selectConfigVo"/>
+        where config_key = #{configKey}
+    </select>
+
+    <insert id="insertConfig" parameterType="SysConfig">
+        insert into sys_config (
+        <if test="configName != null and configName != '' ">config_name,</if>
+        <if test="configKey != null and configKey != '' ">config_key,</if>
+        <if test="configValue != null and configValue != '' ">config_value,</if>
+        <if test="configType != null and configType != '' ">config_type,</if>
+        <if test="createBy != null and createBy != ''">create_by,</if>
+        <if test="remark != null and remark != ''">remark,</if>
+        create_time
+        )values(
+        <if test="configName != null and configName != ''">#{configName},</if>
+        <if test="configKey != null and configKey != ''">#{configKey},</if>
+        <if test="configValue != null and configValue != ''">#{configValue},</if>
+        <if test="configType != null and configType != ''">#{configType},</if>
+        <if test="createBy != null and createBy != ''">#{createBy},</if>
+        <if test="remark != null and remark != ''">#{remark},</if>
+        sysdate()
+        )
+    </insert>
+
+    <update id="updateConfig" parameterType="SysConfig">
+        update sys_config
+        <set>
+            <if test="configName != null and configName != ''">config_name = #{configName},</if>
+            <if test="configKey != null and configKey != ''">config_key = #{configKey},</if>
+            <if test="configValue != null and configValue != ''">config_value = #{configValue},</if>
+            <if test="configType != null and configType != ''">config_type = #{configType},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            update_time = sysdate()
+        </set>
+        where config_id = #{configId}
+    </update>
+
+    <delete id="deleteConfigById" parameterType="Long">
+        delete
+        from sys_config
+        where config_id = #{configId}
+    </delete>
+
+    <delete id="deleteConfigByIds" parameterType="Long">
+        delete from sys_config where config_id in
+        <foreach item="configId" collection="array" open="(" separator="," close=")">
+            #{configId}
+        </foreach>
+    </delete>
+
+</mapper>

+ 146 - 0
system-persistence/src/main/resources/mapper/mysql/SysDictDataMapper.xml

@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.bizmatics.persistence.mapper.SysDictDataMapper">
+
+    <resultMap type="SysDictData" id="SysDictDataResult">
+        <id property="dictCode" column="dict_code"/>
+        <result property="dictSort" column="dict_sort"/>
+        <result property="dictLabel" column="dict_label"/>
+        <result property="dictValue" column="dict_value"/>
+        <result property="dictType" column="dict_type"/>
+        <result property="cssClass" column="css_class"/>
+        <result property="listClass" column="list_class"/>
+        <result property="isDefault" column="is_default"/>
+        <result property="status" column="status"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectDictDataVo">
+        select dict_code,
+               dict_sort,
+               dict_label,
+               dict_value,
+               dict_type,
+               css_class,
+               list_class,
+               is_default,
+               status,
+               create_by,
+               create_time,
+               remark
+        from sys_dict_data
+    </sql>
+
+    <select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
+        <include refid="selectDictDataVo"/>
+        <where>
+            <if test="dictType != null and dictType != ''">
+                AND dict_type = #{dictType}
+            </if>
+            <if test="dictLabel != null and dictLabel != ''">
+                AND dict_label like concat('%', #{dictLabel}, '%')
+            </if>
+            <if test="status != null and status != ''">
+                AND status = #{status}
+            </if>
+        </where>
+        order by dict_sort asc
+    </select>
+
+    <select id="selectDictDataByType" parameterType="SysDictData" resultMap="SysDictDataResult">
+        <include refid="selectDictDataVo"/>
+        where status = '0' and dict_type = #{dictType} order by dict_sort asc
+    </select>
+
+    <select id="selectDictLabel" resultMap="SysDictDataResult">
+        <include refid="selectDictDataVo"/>
+        where dict_type = #{dictType} and dict_value = #{dictValue}
+    </select>
+
+    <select id="selectDictValue" resultMap="SysDictDataResult">
+        <include refid="selectDictDataVo"/>
+        where dict_type = #{dictType} and dict_label = #{dictLabel}
+    </select>
+
+    <select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult">
+        <include refid="selectDictDataVo"/>
+        where dict_code = #{dictCode}
+    </select>
+
+    <select id="countDictDataByType" resultType="Integer">
+        select count(1)
+        from sys_dict_data
+        where dict_type = #{dictType}
+    </select>
+
+    <delete id="deleteDictDataById" parameterType="Long">
+        delete
+        from sys_dict_data
+        where dict_code = #{dictCode}
+    </delete>
+
+    <delete id="deleteDictDataByIds" parameterType="Long">
+        delete from sys_dict_data where dict_code in
+        <foreach collection="array" item="dictCode" open="(" separator="," close=")">
+            #{dictCode}
+        </foreach>
+    </delete>
+
+    <update id="updateDictData" parameterType="SysDictData">
+        update sys_dict_data
+        <set>
+            <if test="dictSort != null">dict_sort = #{dictSort},</if>
+            <if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if>
+            <if test="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if>
+            <if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
+            <if test="cssClass != null">css_class = #{cssClass},</if>
+            <if test="listClass != null">list_class = #{listClass},</if>
+            <if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            update_time = sysdate()
+        </set>
+        where dict_code = #{dictCode}
+    </update>
+
+    <update id="updateDictDataType" parameterType="String">
+        update sys_dict_data
+        set dict_type = #{newDictType}
+        where dict_type = #{oldDictType}
+    </update>
+
+    <insert id="insertDictData" parameterType="SysDictData">
+        insert into sys_dict_data(
+        <if test="dictSort != null">dict_sort,</if>
+        <if test="dictLabel != null and dictLabel != ''">dict_label,</if>
+        <if test="dictValue != null and dictValue != ''">dict_value,</if>
+        <if test="dictType != null and dictType != ''">dict_type,</if>
+        <if test="cssClass != null and cssClass != ''">css_class,</if>
+        <if test="listClass != null and listClass != ''">list_class,</if>
+        <if test="isDefault != null and isDefault != ''">is_default,</if>
+        <if test="status != null">status,</if>
+        <if test="remark != null and remark != ''">remark,</if>
+        <if test="createBy != null and createBy != ''">create_by,</if>
+        create_time
+        )values(
+        <if test="dictSort != null">#{dictSort},</if>
+        <if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
+        <if test="dictValue != null and dictValue != ''">#{dictValue},</if>
+        <if test="dictType != null and dictType != ''">#{dictType},</if>
+        <if test="cssClass != null and cssClass != ''">#{cssClass},</if>
+        <if test="listClass != null and listClass != ''">#{listClass},</if>
+        <if test="isDefault != null and isDefault != ''">#{isDefault},</if>
+        <if test="status != null">#{status},</if>
+        <if test="remark != null and remark != ''">#{remark},</if>
+        <if test="createBy != null and createBy != ''">#{createBy},</if>
+        sysdate()
+        )
+    </insert>
+
+</mapper>

+ 107 - 0
system-persistence/src/main/resources/mapper/mysql/SysDictTypeMapper.xml

@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.bizmatics.persistence.mapper.SysDictTypeMapper">
+
+    <resultMap type="SysDictType" id="SysDictTypeResult">
+        <id property="dictId" column="dict_id"/>
+        <result property="dictName" column="dict_name"/>
+        <result property="dictType" column="dict_type"/>
+        <result property="status" column="status"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectDictTypeVo">
+        select dict_id, dict_name, dict_type, status, create_by, create_time, remark
+        from sys_dict_type
+    </sql>
+
+    <select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
+        <include refid="selectDictTypeVo"/>
+        <where>
+            <if test="dictName != null and dictName != ''">
+                AND dict_name like concat('%', #{dictName}, '%')
+            </if>
+            <if test="status != null and status != ''">
+                AND status = #{status}
+            </if>
+            <if test="dictType != null and dictType != ''">
+                AND dict_type like concat('%', #{dictType}, '%')
+            </if>
+            <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+                and date_format(create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
+            </if>
+            <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+                and date_format(create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
+            </if>
+        </where>
+    </select>
+
+    <select id="selectDictTypeAll" resultMap="SysDictTypeResult">
+        <include refid="selectDictTypeVo"/>
+    </select>
+
+    <select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
+        <include refid="selectDictTypeVo"/>
+        where dict_id = #{dictId}
+    </select>
+
+    <select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
+        <include refid="selectDictTypeVo"/>
+        where dict_type = #{dictType}
+    </select>
+
+    <select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
+        <include refid="selectDictTypeVo"/>
+        where dict_type = #{dictType}
+    </select>
+
+    <delete id="deleteDictTypeById" parameterType="Long">
+        delete
+        from sys_dict_type
+        where dict_id = #{dictId}
+    </delete>
+
+    <delete id="deleteDictTypeByIds" parameterType="Long">
+        delete from sys_dict_type where dict_id in
+        <foreach collection="array" item="dictId" open="(" separator="," close=")">
+            #{dictId}
+        </foreach>
+    </delete>
+
+    <update id="updateDictType" parameterType="SysDictType">
+        update sys_dict_type
+        <set>
+            <if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
+            <if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            update_time = sysdate()
+        </set>
+        where dict_id = #{dictId}
+    </update>
+
+    <insert id="insertDictType" parameterType="SysDictType">
+        insert into sys_dict_type(
+        <if test="dictName != null and dictName != ''">dict_name,</if>
+        <if test="dictType != null and dictType != ''">dict_type,</if>
+        <if test="status != null">status,</if>
+        <if test="remark != null and remark != ''">remark,</if>
+        <if test="createBy != null and createBy != ''">create_by,</if>
+        create_time
+        )values(
+        <if test="dictName != null and dictName != ''">#{dictName},</if>
+        <if test="dictType != null and dictType != ''">#{dictType},</if>
+        <if test="status != null">#{status},</if>
+        <if test="remark != null and remark != ''">#{remark},</if>
+        <if test="createBy != null and createBy != ''">#{createBy},</if>
+        sysdate()
+        )
+    </insert>
+
+</mapper>

+ 18 - 0
system-persistence/src/main/resources/mapper/mysql/SysFileMapper.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.bizmatics.persistence.mapper.FileMapper">
+
+
+    <select id="selectByExpireAt" resultType="com.bizmatics.model.SysFile">
+        select id, batch_no, oss_key
+        from sys_file
+        where del_flag = 0
+          and active_flag = 0
+        union all
+        select id, batch_no, oss_key
+        from sys_file
+        where del_flag = 0
+          and active_flag = 1
+          and expire_at between '0' and #{expireAt}
+    </select>
+</mapper>

+ 90 - 0
system-service/pom.xml

@@ -0,0 +1,90 @@
+<?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>system</artifactId>
+        <groupId>com.bizmatics</groupId>
+        <version>0.0.1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>system-service</artifactId>
+    <name>system-service</name>
+    <version>0.0.1</version>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-csv</artifactId>
+            <version>1.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-text</artifactId>
+            <version>1.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-cache</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.bizmatics</groupId>
+            <artifactId>system-persistence</artifactId>
+            <version>0.0.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>redis.clients</groupId>
+            <artifactId>jedis</artifactId>
+            <version>2.9.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-core</artifactId>
+            <version>3.3.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>io.seata</groupId>
+            <artifactId>seata-spring-boot-starter</artifactId>
+            <version>1.4.2</version>
+            <!--            <exclusions>-->
+            <!--                <exclusion>-->
+            <!--                    <artifactId>guava</artifactId>-->
+            <!--                    <groupId>com.google.guava</groupId>-->
+            <!--                </exclusion>-->
+            <!--                <exclusion>-->
+            <!--                    <artifactId>druid</artifactId>-->
+            <!--                    <groupId>com.alibaba</groupId>-->
+            <!--                </exclusion>-->
+            <!--            </exclusions>-->
+        </dependency>
+
+<!--        <dependency>-->
+<!--            <groupId>com.bizmatics</groupId>-->
+<!--            <artifactId>mhfire-provider</artifactId>-->
+<!--            <version>0.0.1</version>-->
+<!--        </dependency>-->
+
+
+    </dependencies>
+
+
+</project>

+ 115 - 0
system-service/src/main/java/com/bizmatics/service/FileSerivce.java

@@ -0,0 +1,115 @@
+package com.bizmatics.service;
+
+import com.bizmatics.common.mvc.base.CrudService;
+import com.bizmatics.model.SysFile;
+import com.bizmatics.service.dto.SysFileDTO;
+import com.bizmatics.service.dto.SysFileQueryRequest;
+import com.bizmatics.service.dto.SysFileUploadRequest;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 文件服务
+ */
+public interface FileSerivce extends CrudService<SysFile> {
+    /**
+     * 添加文件到sysfile
+     * 可以同时长传多个文件. 但相比V2,不能够指定key. key随机生成.
+     * @param sysFileUploadRequest
+     * @return
+     */
+    List<SysFileDTO> addFile(SysFileUploadRequest sysFileUploadRequest);
+
+    /**
+     * 添加文件. V2
+     * <p>
+     * 字段multipartFiles/urls的元素个数只能有1个.
+     * 允许调用方指定key.
+     * 如果一个批次需要上传多个文件, 则多次调用.
+     *
+     * @param sysFileUploadRequest
+     * @return
+     */
+    SysFileDTO addFileV2(SysFileUploadRequest sysFileUploadRequest);
+
+    /**
+     * 添加multipart file
+     * @param m
+     * @param sysFileUploadRequest
+     * @return
+     */
+    SysFileDTO uploadMultipartFile(CommonsMultipartFile m, SysFileUploadRequest sysFileUploadRequest);
+
+    /**
+     * 添加链接
+     * @param url
+     * @param sysFileUploadRequest
+     * @return
+     */
+    SysFileDTO addExternalLink(String url, SysFileUploadRequest sysFileUploadRequest);
+
+    /**
+     * 添加链接对应的文件
+     * @param url
+     * @param sysFileUploadRequest
+     * @return
+     */
+    SysFileDTO uploadExternalFile(String url, SysFileUploadRequest sysFileUploadRequest);
+
+    /**
+     * 生成新的batchNo
+     * @return
+     */
+    String generateBatchNo();
+
+    /**
+     * 确认文件生效
+     * @param batchNo
+     * @param fileIds
+     * @return
+     */
+    Boolean active(String batchNo, List<String> fileIds);
+
+    /**
+     * 获取文件
+     * @param sysFileRequest
+     * @return
+     */
+    List<SysFile> getFile(SysFileQueryRequest sysFileRequest);
+
+
+    /**
+     * 根据时间获取失效文件
+     *
+     * @param date
+     * @return
+     */
+    List<SysFile> getFileByExpireAt(Date date);
+
+    /**
+     * 批量删除文件(更新文件删除状态)
+     *
+     * @param sysFiles
+     * @return
+     */
+    Integer deleteFiles(List<SysFile> sysFiles);
+
+    /**
+     * 清理垃圾文件.
+     *
+     * @param fileList
+     * @return
+     */
+    Integer clearFiles(List<SysFile> fileList);
+
+    /**
+     * 通过batchNo删除
+     *
+     * @param batchNo
+     * @return
+     */
+    Integer removeByBatchNo(String batchNo);
+
+}

+ 53 - 0
system-service/src/main/java/com/bizmatics/service/ISysAsyncTaskService.java

@@ -0,0 +1,53 @@
+package com.bizmatics.service;
+
+import com.bizmatics.common.core.bean.CommonPage;
+import com.bizmatics.common.mvc.base.CrudService;
+import com.bizmatics.model.SysAsyncTask;
+import com.bizmatics.model.vo.SysAsyncTaskVo;
+import com.bizmatics.service.dto.SysAsyncTaskDTO;
+
+import java.util.Date;
+
+/**
+ * @author fanzhiqiang
+ */
+public interface ISysAsyncTaskService extends CrudService<SysAsyncTask> {
+
+    /**
+     * 返回执行ID
+     *
+     * @param userId
+     * @param userName
+     * @param funcType
+     * @return
+     */
+    Long getId(String userId, String userName, String funcType);
+
+    /**
+     * 分页查询
+     *
+     * @param asyncTaskId
+     * @param startTime
+     * @param endTime
+     * @param funcType
+     * @param current
+     * @param size
+     * @return
+     */
+    CommonPage<SysAsyncTaskVo> getList(Long asyncTaskId, Date startTime, Date endTime, String funcType, Boolean user, Integer current, Integer size);
+
+    /**
+     * 回传返回结果
+     *
+     * @param isSuccess
+     * @param result
+     * @param resultType
+     */
+    void sendResult(Long id, Boolean isSuccess, String result, AsyncResultType resultType);
+
+    /**
+     * 回传返回结果
+     */
+    void sendResult(SysAsyncTaskDTO sysAsyncTask);
+
+}

+ 72 - 0
system-service/src/main/java/com/bizmatics/service/ISysConfigService.java

@@ -0,0 +1,72 @@
+package com.bizmatics.service;
+
+
+import com.bizmatics.model.SysConfig;
+
+import java.util.List;
+
+/**
+ * 参数配置 服务层
+ */
+public interface ISysConfigService {
+    /**
+     * 查询参数配置信息
+     *
+     * @param configId 参数配置ID
+     * @return 参数配置信息
+     */
+    public SysConfig selectConfigById(Long configId);
+
+    /**
+     * 根据键名查询参数配置信息
+     *
+     * @param configKey 参数键名
+     * @return 参数键值
+     */
+    public String selectConfigByKey(String configKey);
+
+    /**
+     * 查询参数配置列表
+     *
+     * @param config 参数配置信息
+     * @return 参数配置集合
+     */
+    public List<SysConfig> selectConfigList(SysConfig config);
+
+    /**
+     * 新增参数配置
+     *
+     * @param config 参数配置信息
+     * @return 结果
+     */
+    public int insertConfig(SysConfig config);
+
+    /**
+     * 修改参数配置
+     *
+     * @param config 参数配置信息
+     * @return 结果
+     */
+    public int updateConfig(SysConfig config);
+
+    /**
+     * 批量删除参数信息
+     *
+     * @param configIds 需要删除的参数ID
+     * @return 结果
+     */
+    public int deleteConfigByIds(Long[] configIds);
+
+    /**
+     * 清空缓存数据
+     */
+    public void clearCache();
+
+    /**
+     * 校验参数键名是否唯一
+     *
+     * @param config 参数信息
+     * @return 结果
+     */
+    public String checkConfigKeyUnique(SysConfig config);
+}

+ 69 - 0
system-service/src/main/java/com/bizmatics/service/ISysDictDataService.java

@@ -0,0 +1,69 @@
+package com.bizmatics.service;
+
+
+import com.bizmatics.model.SysDictData;
+
+import java.util.List;
+
+/**
+ * 字典 业务层
+ */
+public interface ISysDictDataService {
+    /**
+     * 根据条件分页查询字典数据
+     *
+     * @param dictData 字典数据信息
+     * @return 字典数据集合信息
+     */
+    public List<SysDictData> selectDictDataList(SysDictData dictData);
+
+    /**
+     * 根据字典类型和字典键值查询字典数据信息
+     *
+     * @param dictType  字典类型
+     * @param dictValue 字典键值
+     * @return 字典标签
+     */
+    public SysDictData selectDictLabel(String dictType, String dictValue);
+
+    /**
+     * 根据字典类型和字典键值查询字典数据信息
+     *
+     * @param dictType
+     * @param dictLabel
+     * @return
+     */
+    public SysDictData selectDictValue(String dictType, String dictLabel);
+
+    /**
+     * 根据字典数据ID查询信息
+     *
+     * @param dictCode 字典数据ID
+     * @return 字典数据
+     */
+    public SysDictData selectDictDataById(Long dictCode);
+
+    /**
+     * 批量删除字典数据信息
+     *
+     * @param dictCodes 需要删除的字典数据ID
+     * @return 结果
+     */
+    public int deleteDictDataByIds(Long[] dictCodes);
+
+    /**
+     * 新增保存字典数据信息
+     *
+     * @param dictData 字典数据信息
+     * @return 结果
+     */
+    public int insertDictData(SysDictData dictData);
+
+    /**
+     * 修改保存字典数据信息
+     *
+     * @param dictData 字典数据信息
+     * @return 结果
+     */
+    public int updateDictData(SysDictData dictData);
+}

+ 91 - 0
system-service/src/main/java/com/bizmatics/service/ISysDictTypeService.java

@@ -0,0 +1,91 @@
+package com.bizmatics.service;
+
+
+import com.bizmatics.model.SysDictData;
+import com.bizmatics.model.SysDictType;
+
+import javax.annotation.Nullable;
+import java.util.List;
+
+/**
+ * @author barry chen
+ * 字典 业务层
+ */
+public interface ISysDictTypeService {
+    /**
+     * 根据条件分页查询字典类型
+     *
+     * @param dictType 字典类型信息
+     * @return 字典类型集合信息
+     */
+    List<SysDictType> selectDictTypeList(SysDictType dictType);
+
+    /**
+     * 根据所有字典类型
+     *
+     * @return 字典类型集合信息
+     */
+    List<SysDictType> selectDictTypeAll();
+
+    /**
+     * 根据字典类型查询字典数据
+     *
+     * @param dictType 字典类型
+     * @return 字典数据集合信息
+     */
+    @Nullable
+    List<SysDictData> selectDictDataByType(String dictType);
+
+    /**
+     * 根据字典类型ID查询信息
+     *
+     * @param dictId 字典类型ID
+     * @return 字典类型
+     */
+    SysDictType selectDictTypeById(Long dictId);
+
+    /**
+     * 根据字典类型查询信息
+     *
+     * @param dictType 字典类型
+     * @return 字典类型
+     */
+    SysDictType selectDictTypeByType(String dictType);
+
+    /**
+     * 批量删除字典信息
+     *
+     * @param dictIds 需要删除的字典ID
+     * @return 结果
+     */
+    int deleteDictTypeByIds(Long[] dictIds);
+
+    /**
+     * 清空缓存数据
+     */
+    void clearCache();
+
+    /**
+     * 新增保存字典类型信息
+     *
+     * @param dictType 字典类型信息
+     * @return 结果
+     */
+    int insertDictType(SysDictType dictType);
+
+    /**
+     * 修改保存字典类型信息
+     *
+     * @param dictType 字典类型信息
+     * @return 结果
+     */
+    int updateDictType(SysDictType dictType);
+
+    /**
+     * 校验字典类型称是否唯一
+     *
+     * @param dictType 字典类型
+     * @return 结果
+     */
+    String checkDictTypeUnique(SysDictType dictType);
+}

+ 21 - 0
system-service/src/main/java/com/bizmatics/service/constants/CacheConst.java

@@ -0,0 +1,21 @@
+package com.bizmatics.service.constants;
+
+/**
+ * 缓存的key 常量
+ */
+public class CacheConst {
+    /**
+     * oauth 客户端信息
+     */
+    public static final String CLIENT_DETAILS_KEY = "oauth:client:details";
+
+    /**
+     * system config cache key
+     */
+    public static final String SYS_CONFIG_KEY = "sys_config:";
+
+    /**
+     * 字典管理 cache key
+     */
+    public static final String SYS_DICT_KEY = "sys_dict:";
+}

+ 13 - 0
system-service/src/main/java/com/bizmatics/service/constants/ErrorCodeConst.java

@@ -0,0 +1,13 @@
+package com.bizmatics.service.constants;
+
+public class ErrorCodeConst {
+
+    /**
+     * error prefix
+     */
+    public static final String SYSTEM_FILE_ERROR_CODE_PREFIX = "SYSTEM.FILE-";
+    public static final String SYSTEM_DICT_ERROR_CODE_PREFIX = "SYSTEM.DICT-";
+    public static final String SYSTEM_ASYNC_ERROR_CODE_PREFIX = "SYSTEM.ASYNC-";
+    public static final String SYSTEM_ALIYUN_ERROR_CODE_PREFIX = "SYSTEM.aliyun-";
+
+}

+ 103 - 0
system-service/src/main/java/com/bizmatics/service/constants/SystemConst.java

@@ -0,0 +1,103 @@
+package com.bizmatics.service.constants;
+
+/**
+ * 用户常量信息
+ */
+public class SystemConst {
+
+    /**
+     * 登录成功
+     */
+    public static final String LOGIN_SUCCESS = "Success";
+
+    /**
+     * 注销
+     */
+    public static final String LOGOUT = "Logout";
+
+    /**
+     * 注册
+     */
+    public static final String REGISTER = "Register";
+
+    /**
+     * 登录失败
+     */
+    public static final String LOGIN_FAIL = "Error";
+
+    /**
+     * 平台内系统用户的唯一标志
+     */
+    public static final String SYS_USER = "SYS_USER";
+
+    /**
+     * 正常状态
+     */
+    public static final String NORMAL = "0";
+
+    /**
+     * 异常状态
+     */
+    public static final String EXCEPTION = "1";
+
+    /**
+     * 用户封禁状态
+     */
+    public static final String USER_DISABLE = "1";
+
+    /**
+     * 角色封禁状态
+     */
+    public static final String ROLE_DISABLE = "1";
+
+    /**
+     * 部门正常状态
+     */
+    public static final String DEPT_NORMAL = "0";
+
+    /**
+     * 部门停用状态
+     */
+    public static final String DEPT_DISABLE = "1";
+
+    /**
+     * 字典正常状态
+     */
+    public static final String DICT_NORMAL = "0";
+
+    /**
+     * 是否菜单外链(是)
+     */
+    public static final String YES_FRAME = "0";
+
+    /**
+     * 是否菜单外链(否)
+     */
+    public static final String NO_FRAME = "1";
+
+    /**
+     * 菜单类型(目录)
+     */
+    public static final String TYPE_DIR = "M";
+
+    /**
+     * 菜单类型(菜单)
+     */
+    public static final String TYPE_MENU = "C";
+
+    /**
+     * 菜单类型(按钮)
+     */
+    public static final String TYPE_BUTTON = "F";
+
+    /**
+     * Layout组件标识
+     */
+    public final static String LAYOUT = "Layout";
+
+    /**
+     * 校验返回结果码
+     */
+    public final static String UNIQUE = "0";
+    public final static String NOT_UNIQUE = "1";
+}

+ 11 - 0
system-service/src/main/java/com/bizmatics/service/dto/SysAsyncTaskDTO.java

@@ -0,0 +1,11 @@
+package com.bizmatics.service.dto;
+
+import lombok.Data;
+
+/**
+ * @author yq
+ * @date 2021/6/30 15:00
+ */
+@Data
+public class SysAsyncTaskDTO {
+}

+ 34 - 0
system-service/src/main/java/com/bizmatics/service/dto/SysFileDTO.java

@@ -0,0 +1,34 @@
+package com.bizmatics.service.dto;
+
+import com.bizmatics.common.mvc.base.BaseModel;
+import lombok.Builder;
+import lombok.Data;
+import lombok.experimental.Tolerate;
+
+import java.util.Date;
+
+@Data
+@Builder
+public class SysFileDTO extends BaseModel {
+    private String id;
+    private String batchNo;
+    private String fileType;
+    private String oriName;
+    private String ossKey;
+    private String url;
+    private String businessType;
+    private Integer fileSize;
+    private Date expireAt;
+    private Integer activeFlag;
+    private Integer delFlag;
+
+    private Boolean success;
+    private String message;
+    private Date beginTime;
+    private Date endTime;
+    private Integer timeCost;
+
+    @Tolerate
+    public SysFileDTO() {
+    }
+}

+ 21 - 0
system-service/src/main/java/com/bizmatics/service/dto/SysFileQueryRequest.java

@@ -0,0 +1,21 @@
+package com.bizmatics.service.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author yq
+ * @date 2021/6/30 14:42
+ */
+@Data
+public class SysFileQueryRequest {
+
+    private String batchNo;
+
+    private List<String> fileIds;
+
+    private String duration;
+
+    private String
+}

+ 30 - 0
system-service/src/main/java/com/bizmatics/service/dto/SysFileUploadRequest.java

@@ -0,0 +1,30 @@
+package com.bizmatics.service.dto;
+
+import com.bizmatics.service.enums.UploadType;
+import lombok.Data;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author yq
+ * @date 2021/6/30 14:45
+ */
+@Data
+public class SysFileUploadRequest {
+
+    private List<CommonsMultipartFile> multipartFiles;
+
+    private List<String> urls;
+
+    private UploadType uploadType;
+
+    private String key;
+
+    private String batchNo;
+
+    private String businessType;
+
+    private Date expireAt;
+}

+ 23 - 0
system-service/src/main/java/com/bizmatics/service/enums/UploadType.java

@@ -0,0 +1,23 @@
+package com.bizmatics.service.enums;
+
+/**
+ * @author yq
+ * @date 2021/7/1 8:49
+ */
+public enum UploadType {
+
+    /**
+     * 文件
+     */
+    FILE,
+    /**
+     * url
+     */
+    URL,
+    /**
+     * url对应的地址
+     */
+    URLBYOSS;
+
+
+}

+ 33 - 0
system-service/src/main/java/com/bizmatics/service/expcetion/AsyncErrorCode.java

@@ -0,0 +1,33 @@
+package com.bizmatics.service.expcetion;
+
+import com.bizmatics.common.core.exception.ErrorCode;
+import com.bizmatics.service.constants.ErrorCodeConst;
+
+/**
+ * @author fanzhiqiang
+ */
+
+public enum AsyncErrorCode implements ErrorCode {
+
+    ASYNC_OUT_OF_OPERATIONS(ErrorCodeConst.SYSTEM_ASYNC_ERROR_CODE_PREFIX + "001", "No more than 2 operations in an hour"),
+    OPERATION_TYPE_NOT_EXIST(ErrorCodeConst.SYSTEM_ASYNC_ERROR_CODE_PREFIX + "002", "operation type not exist"),
+    ;
+
+    private final String code;
+    private final String defaultMessage;
+
+    AsyncErrorCode(String code, String defaultMessage) {
+        this.code = code;
+        this.defaultMessage = defaultMessage;
+    }
+
+    @Override
+    public String getCode() {
+        return this.code;
+    }
+
+    @Override
+    public String getDefaultMessage() {
+        return this.defaultMessage;
+    }
+}

+ 33 - 0
system-service/src/main/java/com/bizmatics/service/expcetion/FileErrorCode.java

@@ -0,0 +1,33 @@
+package com.bizmatics.service.expcetion;
+
+import com.bizmatics.common.core.exception.ErrorCode;
+import com.bizmatics.service.constants.ErrorCodeConst;
+
+
+public enum FileErrorCode implements ErrorCode {
+
+    FILE_UPLOAD_FILE_ERROR(ErrorCodeConst.SYSTEM_FILE_ERROR_CODE_PREFIX + "001", "file upload error"),
+    FILE_TRANSFER_TO_LOCAL_ERROR(ErrorCodeConst.SYSTEM_FILE_ERROR_CODE_PREFIX + "002", "multipartfill transfer to local error"),
+    FILE_SET_ACL_IS_NULL_ERROR(ErrorCodeConst.SYSTEM_FILE_ERROR_CODE_PREFIX + "003", "set acl error, input ossAcl is null"),
+    FILE_DOWNLOAD_ERROR(ErrorCodeConst.SYSTEM_FILE_ERROR_CODE_PREFIX + "004", "Failed to download file from url"),
+    FILE_DELETE_ERROR(ErrorCodeConst.SYSTEM_FILE_ERROR_CODE_PREFIX + "005", "Delete oss file error"),
+    FILE_GET_ERROR(ErrorCodeConst.SYSTEM_FILE_ERROR_CODE_PREFIX + "006", "Get file error"),;
+
+    private final String code;
+    private final String defaultMessage;
+
+    FileErrorCode(String code, String defaultMessage) {
+        this.code = code;
+        this.defaultMessage = defaultMessage;
+    }
+
+    @Override
+    public String getCode() {
+        return code;
+    }
+
+    @Override
+    public String getDefaultMessage() {
+        return defaultMessage;
+    }
+}

+ 280 - 0
system-service/src/main/java/com/bizmatics/service/impl/FileServiceImpl.java

@@ -0,0 +1,280 @@
+package com.bizmatics.service.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.bizmatics.common.core.bean.UnifiedUser;
+import com.bizmatics.common.core.constants.CommonConst;
+import com.bizmatics.common.core.exception.BusinessException;
+import com.bizmatics.common.core.util.*;
+import com.bizmatics.common.mvc.base.AbstractCrudService;
+import com.bizmatics.common.spring.injectself.BeanSelfAware;
+import com.bizmatics.common.spring.util.GlobalUtils;
+import com.bizmatics.model.SysFile;
+import com.bizmatics.persistence.mapper.FileMapper;
+import com.bizmatics.service.FileSerivce;
+import com.bizmatics.service.dto.SysFileDTO;
+import com.bizmatics.service.dto.SysFileQueryRequest;
+import com.bizmatics.service.dto.SysFileUploadRequest;
+import com.bizmatics.service.enums.UploadType;
+import com.bizmatics.service.expcetion.FileErrorCode;
+import com.google.common.collect.Lists;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import javax.annotation.Nullable;
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.*;
+
+import static java.util.stream.Collectors.toList;
+
+/**
+ * @author barry chen
+ */
+@Service
+@Slf4j
+public class FileServiceImpl extends AbstractCrudService<FileMapper, SysFile> implements FileSerivce, BeanSelfAware {
+    public static final String OSS_KEY_FILE_NAME_DATE_PATTERN = "yyyy-MM";
+    public static final String SYS_FILE_TEMP_DIR = "file";
+    public static final String DOT = ".";
+    private final Logger logger = LoggerFactory.getLogger(FileServiceImpl.class);
+
+    private FileSerivce self;
+
+    @Override
+    public void setSelf(Object bean) {
+        this.self = (FileSerivce) bean;
+    }
+
+    @Override
+    public String generateBatchNo() {
+        return UUIDUtils.shortUUID();
+    }
+
+    @Override
+    public List<SysFile> getFile(SysFileQueryRequest req) {
+        if(StringUtils.isBlank(req.getBatchNo()) && CollectionUtils.isEmpty(req.getFileIds())){
+            throw new BusinessException(FileErrorCode.FILE_GET_ERROR, "At least one of batchNo and fileIds is required.");
+        }
+        return this.list(Wrappers.lambdaQuery(SysFile.class)
+                .eq(StringUtils.isNotBlank(req.getBatchNo()), SysFile::getBatchNo, req.getBatchNo())
+                .eq(SysFile::getActiveFlag, CommonConst.TRUE_NUM)
+                .in(CollectionUtils.isNotEmpty(req.getFileIds()), SysFile::getId, req.getFileIds()));
+    }
+
+    @Override
+    @Nullable
+    public List<SysFileDTO> addFile(SysFileUploadRequest sysFileUploadRequest) {
+        if (StringUtils.isNotBlank(sysFileUploadRequest.getKey())) {
+            throw new BusinessException(FileErrorCode.FILE_UPLOAD_FILE_ERROR, "V1 upload api doesn't support [key]");
+        }
+        if (Objects.isNull(sysFileUploadRequest.getUploadType())) {
+            sysFileUploadRequest.setUploadType(UploadType.FILE);
+        }
+        switch (sysFileUploadRequest.getUploadType()) {
+            case FILE:
+                return sysFileUploadRequest.getMultipartFiles().stream().map(m -> self.uploadMultipartFile(m, sysFileUploadRequest)).collect(toList());
+            case URL:
+                return sysFileUploadRequest.getUrls().stream().map(m -> self.addExternalLink(m, sysFileUploadRequest)).collect(toList());
+            case URLBYOSS:
+                return sysFileUploadRequest.getUrls().stream().map(m -> self.uploadExternalFile(m, sysFileUploadRequest)).collect(toList());
+            default:
+                break;
+        }
+        return null;
+    }
+
+    @Override
+    @Nullable
+    public SysFileDTO addFileV2(SysFileUploadRequest sysFileUploadRequest) {
+        if (CollectionUtils.isNotEmpty(sysFileUploadRequest.getMultipartFiles()) && sysFileUploadRequest.getMultipartFiles().size() > 1) {
+            throw new BusinessException(FileErrorCode.FILE_UPLOAD_FILE_ERROR, "V2 upload api only support single file");
+        }
+        if (CollectionUtils.isNotEmpty(sysFileUploadRequest.getUrls()) && sysFileUploadRequest.getUrls().size() > 1) {
+            throw new BusinessException(FileErrorCode.FILE_UPLOAD_FILE_ERROR, "V2 upload api only support single file");
+        }
+        if (Objects.isNull(sysFileUploadRequest.getUploadType())) {
+            sysFileUploadRequest.setUploadType(UploadType.FILE);
+        }
+        //如果key以"/"开头, 则去掉
+        String key = sysFileUploadRequest.getKey();
+        if (StringUtils.isNotBlank(key) && StringUtils.startsWith(key, File.separator)) {
+            sysFileUploadRequest.setKey(key.substring(1));
+        }
+        switch (sysFileUploadRequest.getUploadType()) {
+            case FILE:
+                return self.uploadMultipartFile(sysFileUploadRequest.getMultipartFiles().get(0), sysFileUploadRequest);
+            case URL:
+                String u = sysFileUploadRequest.getUrls().get(0);
+                return self.addExternalLink(u, sysFileUploadRequest);
+            case URLBYOSS:
+                return self.uploadExternalFile(sysFileUploadRequest.getUrls().get(0), sysFileUploadRequest);
+            default:
+                break;
+        }
+        return null;
+    }
+
+    @Override
+    @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
+    public SysFileDTO uploadMultipartFile(CommonsMultipartFile multipartFile,
+            SysFileUploadRequest sysFileUploadRequest) {
+        SysFileDTO sysFileDTO = new SysFileDTO();
+        File file = FileUtils.getFile(GlobalUtils.getTempBaseDir(), SYS_FILE_TEMP_DIR, multipartFile.getOriginalFilename());
+        try {
+            try {
+                multipartFile.transferTo(file);
+            } catch (IOException e) {
+                throw new BusinessException(FileErrorCode.FILE_TRANSFER_TO_LOCAL_ERROR, e);
+            }
+            sysFileDTO = uploadToOss(file, sysFileDTO, sysFileUploadRequest);
+        } catch (Exception e) {
+            sysFileDTO.setSuccess(false);
+            sysFileDTO.setMessage(e.getMessage());
+        }
+        return sysFileDTO;
+    }
+
+    @Override
+    public SysFileDTO uploadExternalFile(String u, SysFileUploadRequest sysFileUploadRequest) {
+        SysFileDTO sysFileDTO = new SysFileDTO();
+        try {
+            URL url = URLUtils.url(u);
+            File file = FileUtils.downloadRemoteFile(url.toString(), FileUtils.getFile(GlobalUtils.getTempBaseDir(), SYS_FILE_TEMP_DIR).getAbsolutePath());
+            if (file == null || !file.exists()) {
+                throw new BusinessException(FileErrorCode.FILE_DOWNLOAD_ERROR);
+            }
+            uploadToOss(file, sysFileDTO, sysFileUploadRequest);
+        } catch (Exception e) {
+            sysFileDTO.setSuccess(false);
+            sysFileDTO.setMessage(e.getMessage());
+        }
+        return sysFileDTO;
+    }
+
+    @Override
+    public SysFileDTO addExternalLink(String u, SysFileUploadRequest sysFileUploadRequest) {
+        SysFileDTO sysFileDTO = BeanMapperUtils.map(sysFileUploadRequest, SysFileDTO.class);
+        sysFileDTO.setUrl(u);
+        try {
+            URL url = URLUtils.url(u);
+            SysFile sysFile = new SysFile();
+            sysFile.setId(UUIDUtils.shortUUID());
+            sysFile.setBatchNo(sysFileUploadRequest.getBatchNo());
+            sysFile.setBusinessType(sysFileUploadRequest.getBusinessType());
+            sysFile.setUrl(url.toString());
+            fillNecessaryOperatorProperty(sysFile, null, false);
+            if (save(sysFile)) {
+                sysFileDTO.setSuccess(true);
+                sysFileDTO.setId(sysFile.getId());
+            }
+        } catch (Exception e) {
+            sysFileDTO.setSuccess(false);
+            sysFileDTO.setMessage(e.getMessage());
+        }
+        return sysFileDTO;
+    }
+
+    public SysFileDTO uploadToOss(File file, SysFileDTO sysFileDTO, SysFileUploadRequest sysFileUploadRequest) {
+        try {
+            prepareMetadata(file, sysFileDTO, sysFileUploadRequest);
+            if (sysFileDTO.getSuccess()) {
+                sysFileDTO.setId(UUIDUtils.shortUUID());
+                SysFile sysfile = BeanMapperUtils.map(sysFileDTO, SysFile.class);
+                fillNecessaryOperatorProperty(sysfile, null, false);
+                save(sysfile);
+            }
+        } catch (Exception e) {
+            logger.error("增加文件失败,error: {}", e.getMessage());
+            sysFileDTO.setSuccess(false);
+            sysFileDTO.setMessage(e.getMessage());
+        }
+        boolean delete = file.delete();
+        return sysFileDTO;
+    }
+
+    @Override
+    @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
+    public Boolean active(String batchNo, List<String> fileIds) {
+        if (CollectionUtils.isEmpty(fileIds)) {
+            return false;
+        }
+        this.update(Wrappers.lambdaUpdate(SysFile.class)
+                .set(SysFile::getActiveFlag, CommonConst.FALSE_NUM)
+                .eq(SysFile::getBatchNo, batchNo));
+        return this.update(Wrappers.lambdaUpdate(SysFile.class)
+                .set(SysFile::getActiveFlag, CommonConst.TRUE_NUM)
+                .eq(SysFile::getBatchNo, batchNo)
+                .in(SysFile::getId, fileIds));
+    }
+
+
+    @Override
+    public List<SysFile> getFileByExpireAt(Date expireAt) {
+        return baseMapper.selectByExpireAt(expireAt);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public Integer deleteFiles(List<SysFile> sysFiles) {
+        Date now = new Date();
+        sysFiles = sysFiles.stream().peek(s -> {
+            s.setDelFlag(CommonConst.TRUE_NUM.toString());
+            s.setActiveFlag(CommonConst.FALSE_NUM);
+            s.setExpireAt(now);
+        }).collect(toList());
+        return updateBatchById(sysFiles) ? sysFiles.size() : 0;
+    }
+
+    @Override
+    public Integer clearFiles(List<SysFile> fileList) {
+        return null;
+    }
+
+
+    @Override
+    public Integer removeByBatchNo(String batchNo) {
+        List<SysFile> sysFileList = list(Wrappers.lambdaQuery(SysFile.class).eq(SysFile::getBatchNo, batchNo));
+        return this.deleteFiles(sysFileList);
+    }
+
+    private SysFileDTO prepareMetadata(File file, SysFileDTO sysFileDTO, SysFileUploadRequest sysFileUploadRequest) {
+        String ossKey;
+        if (StringUtils.isNotBlank(sysFileUploadRequest.getKey())) {
+            ossKey = sysFileUploadRequest.getKey();
+        } else {
+            ossKey = generateKey(file, sysFileUploadRequest.getBusinessType());
+        }
+        sysFileDTO.setOssKey(ossKey);
+        sysFileDTO.setOriName(file.getName());
+        sysFileDTO.setBatchNo(sysFileUploadRequest.getBatchNo());
+        sysFileDTO.setBusinessType(sysFileUploadRequest.getBusinessType());
+        sysFileDTO.setActiveFlag(0);
+        sysFileDTO.setFileSize((int) file.length());
+        sysFileDTO.setFileType((StringUtils.isNotBlank(ossKey) && ossKey.lastIndexOf(".") > 0) ? ossKey.substring(ossKey.lastIndexOf(".") + 1) : "");
+        sysFileDTO.setExpireAt(sysFileUploadRequest.getExpireAt());
+        return sysFileDTO;
+    }
+
+    private String generateKey(File file, String businessType) {
+        String newFileName;
+        String dateTimeStr = DateUtils.format(new Date(), OSS_KEY_FILE_NAME_DATE_PATTERN);
+        String fileName = file.getName();
+        String random = UUIDUtils.shortUUID();
+        if (fileName.indexOf(DOT) > 0) {
+            String name = StringUtils.substring(fileName, 0, fileName.indexOf(DOT));
+            String suffix = StringUtils.substring(fileName, fileName.indexOf(DOT) + 1, fileName.length());
+            newFileName = String.format("%s-%s.%s", name, random, suffix);
+        } else {
+            newFileName = String.format("%s-%s", fileName, random);
+        }
+        return String.format("%s/%s/%s", businessType, dateTimeStr, newFileName);
+    }
+
+}

+ 102 - 0
system-service/src/main/java/com/bizmatics/service/impl/SysAsyncTaskServiceImpl.java

@@ -0,0 +1,102 @@
+package com.bizmatics.service.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.bizmatics.common.core.bean.CommonPage;
+import com.bizmatics.common.core.exception.BusinessException;
+import com.bizmatics.common.core.util.BeanMapperUtils;
+import com.bizmatics.common.core.util.StringUtils;
+import com.bizmatics.common.core.util.id.IdWorker;
+
+import com.bizmatics.common.mvc.base.AbstractCrudService;
+import com.bizmatics.model.SysAsyncTask;
+import com.bizmatics.model.SysDictData;
+import com.bizmatics.model.vo.SysAsyncTaskVo;
+import com.bizmatics.persistence.mapper.SysAsyncTaskMapper;
+import com.bizmatics.service.ISysAsyncTaskService;
+import com.bizmatics.service.ISysConfigService;
+import com.bizmatics.service.ISysDictDataService;
+import com.bizmatics.service.dto.SysAsyncTaskDTO;
+import com.bizmatics.service.expcetion.AsyncErrorCode;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+/**
+ * @author fanzhiqiang
+ */
+@Service
+@AllArgsConstructor
+public class SysAsyncTaskServiceImpl extends AbstractCrudService<SysAsyncTaskMapper, SysAsyncTask> implements ISysAsyncTaskService {
+
+    private final IdWorker idWorker;
+    private final ISysDictDataService dictDataService;
+    private final ISysConfigService sysConfigService;
+
+    @Override
+    public Long getId(String userId, String userName, String funcType) {
+        SysDictData sysDictData = dictDataService.selectDictLabel("sys.async.funcType", funcType);
+        if (sysDictData == null) {
+            throw new BusinessException(AsyncErrorCode.OPERATION_TYPE_NOT_EXIST, "sys.async.funcType");
+        }
+        int limit = Integer.parseInt(sysConfigService.selectConfigByKey("sys.async.operationLimit"));
+        Long id;
+        Calendar c = Calendar.getInstance();
+        c.setTime(new Date());
+        c.add(Calendar.HOUR, -1);
+        Integer count = baseMapper.getCountByUserIdAndFuncTypeAndCreateTime(userId, funcType, c.getTime());
+        if (count != null && count >= limit) {
+            throw new BusinessException(AsyncErrorCode.ASYNC_OUT_OF_OPERATIONS);
+        }
+        id = idWorker.nextId();
+        SysAsyncTask sysAsyncTask = new SysAsyncTask();
+        sysAsyncTask.setStartTime(new Date());
+        sysAsyncTask.setId(id);
+        sysAsyncTask.setCreateUserId(userId);
+        sysAsyncTask.setCreateUserName(userName);
+        sysAsyncTask.setFuncType(funcType);
+        save(sysAsyncTask);
+        return id;
+    }
+
+
+    @Override
+    public CommonPage<SysAsyncTaskVo> getList(Long asyncTaskId, Date startTime, Date endTime, String funcType, Boolean user, Integer current, Integer size) {
+        Page<SysAsyncTask> page = new Page<>(current, size);
+        String loginUserId = null;
+        page = page(page, Wrappers.lambdaQuery(SysAsyncTask.class).eq(asyncTaskId != null, SysAsyncTask::getId, asyncTaskId).ge(startTime != null, SysAsyncTask::getStartTime,
+                startTime).le(endTime != null, SysAsyncTask::getStartTime, endTime).eq(StringUtils.isNotBlank(funcType), SysAsyncTask::getFuncType, funcType).eq(user != null && user, SysAsyncTask::getCreateUserId, loginUserId));
+
+        List<SysAsyncTaskVo> voList = new ArrayList<>();
+        for (SysAsyncTask record : page.getRecords()) {
+            SysAsyncTaskVo vo = new SysAsyncTaskVo();
+            BeanMapperUtils.copy(record, vo);
+            vo.setIdStr(String.valueOf(record.getId()));
+            voList.add(vo);
+        }
+        return new CommonPage<>(voList, page.getTotal(), page.getSize(), page.getCurrent());
+    }
+
+    @Override
+    public void sendResult(Long id, Boolean isSuccess, String result, AsyncResultType resultType) {
+        SysAsyncTask sysAsyncTask = new SysAsyncTask();
+        sysAsyncTask.setId(id);
+        sysAsyncTask.setIsSuccess(isSuccess);
+        sysAsyncTask.setResult(result);
+        sysAsyncTask.setResultType(resultType.name());
+        if (Objects.equals(AsyncResultType.FILE, resultType)) {
+            sysAsyncTask.setResultKey(result);
+        }
+        sysAsyncTask.setEndTime(new Date());
+        baseMapper.updateById(sysAsyncTask);
+    }
+
+    @Override
+    public void sendResult(SysAsyncTaskDTO dto) {
+        SysAsyncTask sysAsyncTask = new SysAsyncTask();
+        BeanMapperUtils.copy(dto, sysAsyncTask);
+        sysAsyncTask.setEndTime(new Date());
+        baseMapper.updateById(sysAsyncTask);
+    }
+}

+ 167 - 0
system-service/src/main/java/com/bizmatics/service/impl/SysConfigServiceImpl.java

@@ -0,0 +1,167 @@
+package com.bizmatics.service.impl;
+
+import com.bizmatics.common.core.util.Convert;
+import com.bizmatics.common.core.util.StringUtils;
+import com.bizmatics.common.spring.config.redis.RedisHelper;
+import com.bizmatics.model.SysConfig;
+import com.bizmatics.persistence.mapper.SysConfigMapper;
+import com.bizmatics.service.ISysConfigService;
+import com.bizmatics.service.constants.CacheConst;
+import com.bizmatics.service.constants.SystemConst;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 参数配置 服务层实现
+ */
+@Service
+public class SysConfigServiceImpl implements ISysConfigService {
+    @Autowired
+    private SysConfigMapper configMapper;
+
+    @Autowired
+    private RedisHelper redisHelper;
+
+    /**
+     * 项目启动时,初始化参数到缓存
+     */
+    @PostConstruct
+    public void init() {
+        List<SysConfig> configsList = configMapper.selectConfigList(new SysConfig());
+        for (SysConfig config : configsList) {
+            redisHelper.set(getCacheKey(config.getConfigKey()), config.getConfigValue());
+        }
+    }
+
+    /**
+     * 查询参数配置信息
+     *
+     * @param configId 参数配置ID
+     * @return 参数配置信息
+     */
+    @Override
+    public SysConfig selectConfigById(Long configId) {
+        SysConfig config = new SysConfig();
+        config.setConfigId(configId);
+        return configMapper.selectConfig(config);
+    }
+
+    /**
+     * 根据键名查询参数配置信息
+     *
+     * @param configKey 参数key
+     * @return 参数键值
+     */
+    @Override
+    public String selectConfigByKey(String configKey) {
+        String configValue = Convert.toStr(redisHelper.get(getCacheKey(configKey)));
+        if (StringUtils.isNotEmpty(configValue)) {
+            return configValue;
+        }
+        SysConfig config = new SysConfig();
+        config.setConfigKey(configKey);
+        SysConfig retConfig = configMapper.selectConfig(config);
+        if (Objects.nonNull(retConfig)) {
+            redisHelper.set(getCacheKey(configKey), retConfig.getConfigValue());
+            return retConfig.getConfigValue();
+        }
+        return StringUtils.EMPTY;
+    }
+
+    /**
+     * 查询参数配置列表
+     *
+     * @param config 参数配置信息
+     * @return 参数配置集合
+     */
+    @Override
+    public List<SysConfig> selectConfigList(SysConfig config) {
+        return configMapper.selectConfigList(config);
+    }
+
+    /**
+     * 新增参数配置
+     *
+     * @param config 参数配置信息
+     * @return 结果
+     */
+    @Override
+    public int insertConfig(SysConfig config) {
+        int row = configMapper.insertConfig(config);
+        if (row > 0) {
+            redisHelper.set(getCacheKey(config.getConfigKey()), config.getConfigValue());
+        }
+        return row;
+    }
+
+    /**
+     * 修改参数配置
+     *
+     * @param config 参数配置信息
+     * @return 结果
+     */
+    @Override
+    public int updateConfig(SysConfig config) {
+        int row = configMapper.updateConfig(config);
+        if (row > 0) {
+            redisHelper.set(getCacheKey(config.getConfigKey()), config.getConfigValue());
+        }
+        return row;
+    }
+
+    /**
+     * 批量删除参数信息
+     *
+     * @param configIds 需要删除的参数ID
+     * @return 结果
+     */
+    @Override
+    public int deleteConfigByIds(Long[] configIds) {
+        int count = configMapper.deleteConfigByIds(configIds);
+        if (count > 0) {
+            Collection<String> keys = redisHelper.keys(CacheConst.SYS_CONFIG_KEY + "*");
+            redisHelper.delete(keys);
+        }
+        return count;
+    }
+
+    /**
+     * 清空缓存数据
+     */
+    @Override
+    public void clearCache() {
+        Collection<String> keys = redisHelper.keys(CacheConst.SYS_CONFIG_KEY + "*");
+        redisHelper.delete(keys);
+    }
+
+    /**
+     * 校验参数键名是否唯一
+     *
+     * @param config 参数配置信息
+     * @return 结果
+     */
+    @Override
+    public String checkConfigKeyUnique(SysConfig config) {
+        long configId = Objects.isNull(config.getConfigId()) ? -1L : config.getConfigId();
+        SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey());
+        if (Objects.nonNull(info) && info.getConfigId() != configId) {
+            return SystemConst.NOT_UNIQUE;
+        }
+        return SystemConst.UNIQUE;
+    }
+
+    /**
+     * 设置cache key
+     *
+     * @param configKey 参数键
+     * @return 缓存键key
+     */
+    private String getCacheKey(String configKey) {
+        return CacheConst.SYS_CONFIG_KEY + configKey;
+    }
+}

+ 105 - 0
system-service/src/main/java/com/bizmatics/service/impl/SysDictDataServiceImpl.java

@@ -0,0 +1,105 @@
+package com.bizmatics.service.impl;
+
+
+import com.bizmatics.model.SysDictData;
+import com.bizmatics.persistence.mapper.SysDictDataMapper;
+import com.bizmatics.service.ISysDictDataService;
+import com.bizmatics.service.util.DictUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author
+ * 字典 业务层处理
+ */
+@Service
+public class SysDictDataServiceImpl implements ISysDictDataService {
+    @Autowired
+    private SysDictDataMapper dictDataMapper;
+
+    /**
+     * 根据条件分页查询字典数据
+     *
+     * @param dictData 字典数据信息
+     * @return 字典数据集合信息
+     */
+    @Override
+    public List<SysDictData> selectDictDataList(SysDictData dictData) {
+        return dictDataMapper.selectDictDataList(dictData);
+    }
+
+    /**
+     * 根据字典类型和字典键值查询字典数据信息
+     *
+     * @param dictType  字典类型
+     * @param dictValue 字典键值
+     * @return 字典标签
+     */
+    @Override
+    public SysDictData selectDictLabel(String dictType, String dictValue) {
+        return dictDataMapper.selectDictLabel(dictType, dictValue);
+    }
+
+    @Override
+    public SysDictData selectDictValue(String dictType, String dictLabel) {
+        return dictDataMapper.selectDictValue(dictType, dictLabel);
+    }
+
+    /**
+     * 根据字典数据ID查询信息
+     *
+     * @param dictCode 字典数据ID
+     * @return 字典数据
+     */
+    @Override
+    public SysDictData selectDictDataById(Long dictCode) {
+        return dictDataMapper.selectDictDataById(dictCode);
+    }
+
+    /**
+     * 批量删除字典数据信息
+     *
+     * @param dictCodes 需要删除的字典数据ID
+     * @return 结果
+     */
+    @Override
+    public int deleteDictDataByIds(Long[] dictCodes) {
+        int row = dictDataMapper.deleteDictDataByIds(dictCodes);
+        if (row > 0) {
+            DictUtils.clearDictCache();
+        }
+        return row;
+    }
+
+    /**
+     * 新增保存字典数据信息
+     *
+     * @param dictData 字典数据信息
+     * @return 结果
+     */
+    @Override
+    public int insertDictData(SysDictData dictData) {
+        int row = dictDataMapper.insertDictData(dictData);
+        if (row > 0) {
+            DictUtils.clearDictCache();
+        }
+        return row;
+    }
+
+    /**
+     * 修改保存字典数据信息
+     *
+     * @param dictData 字典数据信息
+     * @return 结果
+     */
+    @Override
+    public int updateDictData(SysDictData dictData) {
+        int row = dictDataMapper.updateDictData(dictData);
+        if (row > 0) {
+            DictUtils.clearDictCache();
+        }
+        return row;
+    }
+}

+ 184 - 0
system-service/src/main/java/com/bizmatics/service/impl/SysDictTypeServiceImpl.java

@@ -0,0 +1,184 @@
+package com.bizmatics.service.impl;
+
+import com.bizmatics.common.core.exception.BusinessException;
+import com.bizmatics.model.SysDictData;
+import com.bizmatics.model.SysDictType;
+import com.bizmatics.persistence.mapper.SysDictDataMapper;
+import com.bizmatics.persistence.mapper.SysDictTypeMapper;
+import com.bizmatics.service.ISysDictTypeService;
+import com.bizmatics.service.constants.SystemConst;
+import com.bizmatics.service.util.DictUtils;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.PostConstruct;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * @author barry chen
+ * 字典 业务层处理
+ */
+@Service
+public class SysDictTypeServiceImpl implements ISysDictTypeService {
+    @Autowired
+    private SysDictTypeMapper dictTypeMapper;
+
+    @Autowired
+    private SysDictDataMapper dictDataMapper;
+
+    /**
+     * 项目启动时,初始化字典到缓存
+     */
+    @PostConstruct
+    public void init() {
+        List<SysDictType> dictTypeList = dictTypeMapper.selectDictTypeAll();
+        for (SysDictType dictType : dictTypeList) {
+            List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType());
+            DictUtils.setDictCache(dictType.getDictType(), dictDatas);
+        }
+    }
+
+    /**
+     * 根据条件分页查询字典类型
+     *
+     * @param dictType 字典类型信息
+     * @return 字典类型集合信息
+     */
+    @Override
+    public List<SysDictType> selectDictTypeList(SysDictType dictType) {
+        return dictTypeMapper.selectDictTypeList(dictType);
+    }
+
+    /**
+     * 根据所有字典类型
+     *
+     * @return 字典类型集合信息
+     */
+    @Override
+    public List<SysDictType> selectDictTypeAll() {
+        return dictTypeMapper.selectDictTypeAll();
+    }
+
+    /**
+     * 根据字典类型查询字典数据
+     *
+     * @param dictType 字典类型
+     * @return 字典数据集合信息
+     */
+    @Override
+    public List<SysDictData> selectDictDataByType(String dictType) {
+        List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
+        if (CollectionUtils.isNotEmpty(dictDatas)) {
+            return dictDatas;
+        }
+        dictDatas = dictDataMapper.selectDictDataByType(dictType);
+        if (Objects.nonNull(dictDatas)) {
+            DictUtils.setDictCache(dictType, dictDatas);
+            return dictDatas;
+        }
+        return null;
+    }
+
+    /**
+     * 根据字典类型ID查询信息
+     *
+     * @param dictId 字典类型ID
+     * @return 字典类型
+     */
+    @Override
+    public SysDictType selectDictTypeById(Long dictId) {
+        return dictTypeMapper.selectDictTypeById(dictId);
+    }
+
+    /**
+     * 根据字典类型查询信息
+     *
+     * @param dictType 字典类型
+     * @return 字典类型
+     */
+    @Override
+    public SysDictType selectDictTypeByType(String dictType) {
+        return dictTypeMapper.selectDictTypeByType(dictType);
+    }
+
+    /**
+     * 批量删除字典类型信息
+     *
+     * @param dictIds 需要删除的字典ID
+     * @return 结果
+     */
+    @Override
+    public int deleteDictTypeByIds(Long[] dictIds) {
+        for (Long dictId : dictIds) {
+            SysDictType dictType = selectDictTypeById(dictId);
+            if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) {
+                throw new BusinessException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
+            }
+        }
+        int count = dictTypeMapper.deleteDictTypeByIds(dictIds);
+        if (count > 0) {
+            DictUtils.clearDictCache();
+        }
+        return count;
+    }
+
+    /**
+     * 清空缓存数据
+     */
+    @Override
+    public void clearCache() {
+        DictUtils.clearDictCache();
+    }
+
+    /**
+     * 新增保存字典类型信息
+     *
+     * @param dictType 字典类型信息
+     * @return 结果
+     */
+    @Override
+    public int insertDictType(SysDictType dictType) {
+        int row = dictTypeMapper.insertDictType(dictType);
+        if (row > 0) {
+            DictUtils.clearDictCache();
+        }
+        return row;
+    }
+
+    /**
+     * 修改保存字典类型信息
+     *
+     * @param dictType 字典类型信息
+     * @return 结果
+     */
+    @Override
+    @Transactional
+    public int updateDictType(SysDictType dictType) {
+        SysDictType oldDict = dictTypeMapper.selectDictTypeById(dictType.getDictId());
+        dictDataMapper.updateDictDataType(oldDict.getDictType(), dictType.getDictType());
+        int row = dictTypeMapper.updateDictType(dictType);
+        if (row > 0) {
+            DictUtils.clearDictCache();
+        }
+        return row;
+    }
+
+    /**
+     * 校验字典类型称是否唯一
+     *
+     * @param dict 字典类型
+     * @return 结果
+     */
+    @Override
+    public String checkDictTypeUnique(SysDictType dict) {
+        Long dictId = Objects.isNull(dict.getDictId()) ? -1L : dict.getDictId();
+        SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
+        if (Objects.nonNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
+            return SystemConst.NOT_UNIQUE;
+        }
+        return SystemConst.UNIQUE;
+    }
+}

+ 69 - 0
system-service/src/main/java/com/bizmatics/service/util/DictUtils.java

@@ -0,0 +1,69 @@
+package com.bizmatics.service.util;
+
+import com.bizmatics.common.spring.config.redis.RedisHelper;
+import com.bizmatics.common.spring.util.SpringContextUtils;
+import com.bizmatics.model.SysDictData;
+import com.bizmatics.service.constants.CacheConst;
+import org.springframework.stereotype.Component;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 字典工具类
+ */
+@Component
+public class DictUtils {
+
+    private static RedisHelper redisHelper;
+
+    /**
+     * 设置字典缓存
+     *
+     * @param key       参数键
+     * @param dictDatas 字典数据列表
+     */
+    public static void setDictCache(String key, List<SysDictData> dictDatas) {
+        RedisHelper redisHelper = getRedisHelper();
+        redisHelper.set(getCacheKey(key), dictDatas);
+    }
+
+    /**
+     * 获取字典缓存
+     *
+     * @param key 参数键
+     * @return dictDatas 字典数据列表
+     */
+    public static List<SysDictData> getDictCache(String key) {
+        Object cacheObj = getRedisHelper().get(getCacheKey(key));
+        if (Objects.nonNull(cacheObj)) {
+            List<SysDictData> DictDatas = (List<SysDictData>) cacheObj;
+            return DictDatas;
+        }
+        return null;
+    }
+
+    /**
+     * 清空字典缓存
+     */
+    public static void clearDictCache() {
+        Collection<String> keys = getRedisHelper().keys(CacheConst.SYS_DICT_KEY + "*");
+        getRedisHelper().delete(keys);
+    }
+
+    /**
+     * 设置cache key
+     *
+     * @param configKey 参数键
+     * @return 缓存键key
+     */
+    public static String getCacheKey(String configKey) {
+        return CacheConst.SYS_DICT_KEY + configKey;
+    }
+
+    private static RedisHelper getRedisHelper() {
+        return DictUtils.redisHelper == null ? SpringContextUtils.getBean(RedisHelper.class) : DictUtils.redisHelper;
+    }
+
+}

Some files were not shown because too many files changed in this diff