소스 검색

中制平台初始版本

wangqiong 2 년 전
부모
커밋
bdc6582074
100개의 변경된 파일20592개의 추가작업 그리고 9172개의 파일을 삭제
  1. 31
    33
      .gitignore
  2. 0
    20
      LICENSE
  3. 0
    3
      README.md
  4. 152
    202
      pom.xml
  5. 55
    0
      qomo-kn-financial-forecast-start/pom.xml
  6. 41
    0
      qomo-kn-financial-forecast-start/src/main/assembly/package.xml
  7. 46
    0
      qomo-kn-financial-forecast-start/src/main/java/com/zzsmart/qomo/kn/forecast/financial/QomoForecastApplication.java
  8. 456
    0
      qomo-kn-financial-forecast-start/src/main/resources/application-dev.yml
  9. 451
    0
      qomo-kn-financial-forecast-start/src/main/resources/application-prod.yml
  10. 5
    0
      qomo-kn-financial-forecast-start/src/main/resources/application.yml
  11. 29
    0
      qomo-kn-financial-forecast-start/src/main/resources/jeecg/jeecg_config.properties
  12. 27
    0
      qomo-kn-financial-forecast-start/src/main/resources/jeecg/jeecg_database.properties
  13. 96
    0
      qomo-kn-financial-forecast-start/src/main/resources/liquibase/changelogs/change.sql
  14. 19122
    0
      qomo-kn-financial-forecast-start/src/main/resources/liquibase/changelogs/qomo-boot-init.sql
  15. 9
    0
      qomo-kn-financial-forecast-start/src/main/resources/liquibase/master.xml
  16. 28
    0
      qomo-kn-financial-forecast/pom.xml
  17. 44
    0
      qomo-kn-financial-forecast/src/main/java/com/zzsmart/qomo/kn/forecast/financial/constants/Constants.java
  18. 0
    96
      ruoyi-admin/pom.xml
  19. 0
    29
      ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
  20. 0
    18
      ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java
  21. 0
    94
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java
  22. 0
    163
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
  23. 0
    121
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java
  24. 0
    27
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java
  25. 0
    82
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java
  26. 0
    69
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java
  27. 0
    83
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java
  28. 0
    133
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
  29. 0
    132
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
  30. 0
    121
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java
  31. 0
    131
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java
  32. 0
    29
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java
  33. 0
    86
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
  34. 0
    142
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java
  35. 0
    91
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java
  36. 0
    129
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
  37. 0
    137
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
  38. 0
    38
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java
  39. 0
    262
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
  40. 0
    256
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
  41. 0
    183
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java
  42. 0
    125
      ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
  43. 0
    1
      ruoyi-admin/src/main/resources/META-INF/spring-devtools.properties
  44. 0
    61
      ruoyi-admin/src/main/resources/application-druid.yml
  45. 0
    129
      ruoyi-admin/src/main/resources/application.yml
  46. 0
    2
      ruoyi-admin/src/main/resources/banner.txt
  47. 0
    38
      ruoyi-admin/src/main/resources/i18n/messages.properties
  48. 0
    93
      ruoyi-admin/src/main/resources/logback.xml
  49. 0
    20
      ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml
  50. 0
    131
      ruoyi-common/pom.xml
  51. 0
    19
      ruoyi-common/src/main/java/com/ruoyi/common/annotation/Anonymous.java
  52. 0
    33
      ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java
  53. 0
    28
      ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java
  54. 0
    187
      ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java
  55. 0
    18
      ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excels.java
  56. 0
    51
      ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java
  57. 0
    40
      ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java
  58. 0
    31
      ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java
  59. 0
    24
      ruoyi-common/src/main/java/com/ruoyi/common/annotation/Sensitive.java
  60. 0
    122
      ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java
  61. 0
    67
      ruoyi-common/src/main/java/com/ruoyi/common/config/serializer/SensitiveJsonSerializer.java
  62. 0
    44
      ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java
  63. 0
    173
      ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
  64. 0
    117
      ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java
  65. 0
    94
      ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java
  66. 0
    50
      ruoyi-common/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java
  67. 0
    78
      ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java
  68. 0
    202
      ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java
  69. 0
    216
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java
  70. 0
    118
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java
  71. 0
    115
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java
  72. 0
    79
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java
  73. 0
    77
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java
  74. 0
    203
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java
  75. 0
    176
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java
  76. 0
    96
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java
  77. 0
    259
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java
  78. 0
    241
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java
  79. 0
    324
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
  80. 0
    69
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java
  81. 0
    266
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java
  82. 0
    11
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/RegisterBody.java
  83. 0
    101
      ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java
  84. 0
    85
      ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java
  85. 0
    56
      ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java
  86. 0
    268
      ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
  87. 0
    86
      ruoyi-common/src/main/java/com/ruoyi/common/core/text/CharsetKit.java
  88. 0
    1006
      ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java
  89. 0
    92
      ruoyi-common/src/main/java/com/ruoyi/common/core/text/StrFormatter.java
  90. 0
    20
      ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java
  91. 0
    59
      ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java
  92. 0
    19
      ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java
  93. 0
    59
      ruoyi-common/src/main/java/com/ruoyi/common/enums/DesensitizedType.java
  94. 0
    36
      ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java
  95. 0
    20
      ruoyi-common/src/main/java/com/ruoyi/common/enums/LimitType.java
  96. 0
    24
      ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java
  97. 0
    30
      ruoyi-common/src/main/java/com/ruoyi/common/enums/UserStatus.java
  98. 0
    15
      ruoyi-common/src/main/java/com/ruoyi/common/exception/DemoModeException.java
  99. 0
    58
      ruoyi-common/src/main/java/com/ruoyi/common/exception/GlobalException.java
  100. 0
    0
      ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java

+ 31
- 33
.gitignore 파일 보기

@@ -1,47 +1,45 @@
1
-######################################################################
2
-# Build Tools
3
-
4
-.gradle
5
-/build/
6
-!gradle/wrapper/gradle-wrapper.jar
7
-
8 1
 target/
9 2
 !.mvn/wrapper/maven-wrapper.jar
3
+!**/src/main/**/target/
4
+!**/src/test/**/target/
10 5
 
11
-######################################################################
12
-# IDE
6
+### IntelliJ IDEA ###
7
+.idea
8
+*.iws
9
+*.iml
10
+*.ipr
13 11
 
14
-### STS ###
12
+### Eclipse ###
15 13
 .apt_generated
16 14
 .classpath
17 15
 .factorypath
18 16
 .project
19 17
 .settings
20 18
 .springBeans
21
-
22
-### IntelliJ IDEA ###
23
-.idea
24
-*.iws
25
-*.iml
26
-*.ipr
27
-
28
-### JRebel ###
29
-rebel.xml
19
+.sts4-cache
30 20
 
31 21
 ### NetBeans ###
32
-nbproject/private/
33
-build/*
34
-nbbuild/
35
-dist/
36
-nbdist/
37
-.nb-gradle/
38
-
39
-######################################################################
40
-# Others
22
+/nbproject/private/
23
+/nbbuild/
24
+/dist/
25
+/nbdist/
26
+/.nb-gradle/
27
+build/
28
+!**/src/main/**/build/
29
+!**/src/test/**/build/
30
+
31
+### VS Code ###
32
+.vscode/
33
+
34
+### Mac OS ###
35
+.DS_Store
36
+
37
+## backend
38
+**/target
39
+**/logs
41 40
 *.log
42
-*.xml.versionsBackup
43
-*.swp
44 41
 
45
-!*/build/*.java
46
-!*/build/*.html
47
-!*/build/*.xml
42
+## front
43
+**/*.lock
44
+
45
+*.flattened-pom.xml

+ 0
- 20
LICENSE 파일 보기

@@ -1,20 +0,0 @@
1
-The MIT License (MIT)
2
-
3
-Copyright (c) 2018 RuoYi
4
-
5
-Permission is hereby granted, free of charge, to any person obtaining a copy of
6
-this software and associated documentation files (the "Software"), to deal in
7
-the Software without restriction, including without limitation the rights to
8
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
-the Software, and to permit persons to whom the Software is furnished to do so,
10
-subject to the following conditions:
11
-
12
-The above copyright notice and this permission notice shall be included in all
13
-copies or substantial portions of the Software.
14
-
15
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0
- 3
README.md 파일 보기

@@ -1,3 +0,0 @@
1
-# cost-backend
2
-## 后端服务
3
-

+ 152
- 202
pom.xml 파일 보기

@@ -1,228 +1,178 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project xmlns="http://maven.apache.org/POM/4.0.0"
3
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
-	<modelVersion>4.0.0</modelVersion>
6
-	
7
-    <groupId>com.ruoyi</groupId>
8
-    <artifactId>ruoyi</artifactId>
9
-    <version>3.8.7</version>
1
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
+    <modelVersion>4.0.0</modelVersion>
4
+    <groupId>com.zzsmart.qomo</groupId>
5
+    <artifactId>qomo-kn-forecast</artifactId>
6
+    <version>${revision}</version>
7
+    <packaging>pom</packaging>
8
+    <name>QOMO FORECAST</name>
9
+
10
+    <developers>
11
+        <developer>
12
+            <name>武汉中制智造</name>
13
+            <email>qomo@163.com</email>
14
+        </developer>
15
+    </developers>
16
+
17
+    <parent>
18
+        <groupId>org.qomo.boot</groupId>
19
+        <artifactId>qomo-base</artifactId>
20
+        <version>2.0.1-SNAPSHOT</version>
21
+        <relativePath/>
22
+    </parent>
10 23
 
11
-    <name>ruoyi</name>
12
-    <url>http://www.ruoyi.vip</url>
13
-    <description>若依管理系统</description>
14
-    
15 24
     <properties>
16
-        <ruoyi.version>3.8.7</ruoyi.version>
17
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18
-        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
19
-        <java.version>1.8</java.version>
20
-        <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
21
-        <spring-framework.version>5.3.33</spring-framework.version>
22
-        <druid.version>1.2.20</druid.version>
23
-        <bitwalker.version>1.21</bitwalker.version>
24
-        <swagger.version>3.0.0</swagger.version>
25
-        <kaptcha.version>2.3.3</kaptcha.version>
26
-        <pagehelper.boot.version>1.4.7</pagehelper.boot.version>
27
-        <fastjson.version>2.0.43</fastjson.version>
28
-        <oshi.version>6.5.0</oshi.version>
29
-        <commons.io.version>2.13.0</commons.io.version>
30
-        <poi.version>4.1.2</poi.version>
31
-        <velocity.version>2.3</velocity.version>
32
-        <jwt.version>0.9.1</jwt.version>
25
+        <revision>2.0.0-SNAPSHOT</revision>
26
+        <adp.version>2.0.0-SNAPSHOT</adp.version>
33 27
     </properties>
34 28
 
35
-    <!-- 依赖声明 -->
36
-    <dependencyManagement>
37
-        <dependencies>
38
-
39
-            <!-- SpringFramework的依赖配置-->
40
-            <dependency>
41
-                <groupId>org.springframework</groupId>
42
-                <artifactId>spring-framework-bom</artifactId>
43
-                <version>${spring-framework.version}</version>
44
-                <type>pom</type>
45
-                <scope>import</scope>
46
-            </dependency>
47
-
48
-            <!-- SpringBoot的依赖配置-->
49
-            <dependency>
50
-                <groupId>org.springframework.boot</groupId>
51
-                <artifactId>spring-boot-dependencies</artifactId>
52
-                <version>2.5.15</version>
53
-                <type>pom</type>
54
-                <scope>import</scope>
55
-            </dependency>
56
-
57
-            <!-- 阿里数据库连接池 -->
58
-            <dependency>
59
-                <groupId>com.alibaba</groupId>
60
-                <artifactId>druid-spring-boot-starter</artifactId>
61
-                <version>${druid.version}</version>
62
-            </dependency>
63
-
64
-            <!-- 解析客户端操作系统、浏览器等 -->
65
-            <dependency>
66
-                <groupId>eu.bitwalker</groupId>
67
-                <artifactId>UserAgentUtils</artifactId>
68
-                <version>${bitwalker.version}</version>
69
-            </dependency>
70
-
71
-            <!-- pagehelper 分页插件 -->
72
-            <dependency>
73
-                <groupId>com.github.pagehelper</groupId>
74
-                <artifactId>pagehelper-spring-boot-starter</artifactId>
75
-                <version>${pagehelper.boot.version}</version>
76
-            </dependency>
77
-
78
-            <!-- 获取系统信息 -->
79
-            <dependency>
80
-                <groupId>com.github.oshi</groupId>
81
-                <artifactId>oshi-core</artifactId>
82
-                <version>${oshi.version}</version>
83
-            </dependency>
84
-
85
-            <!-- Swagger3依赖 -->
86
-            <dependency>
87
-                <groupId>io.springfox</groupId>
88
-                <artifactId>springfox-boot-starter</artifactId>
89
-                <version>${swagger.version}</version>
90
-                <exclusions>
91
-                    <exclusion>
92
-                        <groupId>io.swagger</groupId>
93
-                        <artifactId>swagger-models</artifactId>
94
-                    </exclusion>
95
-                </exclusions>
96
-            </dependency>
97
-
98
-            <!-- io常用工具类 -->
99
-            <dependency>
100
-                <groupId>commons-io</groupId>
101
-                <artifactId>commons-io</artifactId>
102
-                <version>${commons.io.version}</version>
103
-            </dependency>
104
-
105
-            <!-- excel工具 -->
106
-            <dependency>
107
-                <groupId>org.apache.poi</groupId>
108
-                <artifactId>poi-ooxml</artifactId>
109
-                <version>${poi.version}</version>
110
-            </dependency>
111
-
112
-            <!-- velocity代码生成使用模板 -->
113
-            <dependency>
114
-                <groupId>org.apache.velocity</groupId>
115
-                <artifactId>velocity-engine-core</artifactId>
116
-                <version>${velocity.version}</version>
117
-            </dependency>
118
-
119
-            <!-- 阿里JSON解析器 -->
120
-            <dependency>
121
-                <groupId>com.alibaba.fastjson2</groupId>
122
-                <artifactId>fastjson2</artifactId>
123
-                <version>${fastjson.version}</version>
124
-            </dependency>
125
-
126
-            <!-- Token生成与解析-->
127
-            <dependency>
128
-                <groupId>io.jsonwebtoken</groupId>
129
-                <artifactId>jjwt</artifactId>
130
-                <version>${jwt.version}</version>
131
-            </dependency>
132
-
133
-            <!-- 验证码 -->
134
-            <dependency>
135
-                <groupId>pro.fessional</groupId>
136
-                <artifactId>kaptcha</artifactId>
137
-                <version>${kaptcha.version}</version>
138
-            </dependency>
139
-
140
-            <!-- 定时任务-->
141
-            <dependency>
142
-                <groupId>com.ruoyi</groupId>
143
-                <artifactId>ruoyi-quartz</artifactId>
144
-                <version>${ruoyi.version}</version>
145
-            </dependency>
146
-
147
-            <!-- 代码生成-->
148
-            <dependency>
149
-                <groupId>com.ruoyi</groupId>
150
-                <artifactId>ruoyi-generator</artifactId>
151
-                <version>${ruoyi.version}</version>
152
-            </dependency>
153
-
154
-            <!-- 核心模块-->
155
-            <dependency>
156
-                <groupId>com.ruoyi</groupId>
157
-                <artifactId>ruoyi-framework</artifactId>
158
-                <version>${ruoyi.version}</version>
159
-            </dependency>
160
-
161
-            <!-- 系统模块-->
162
-            <dependency>
163
-                <groupId>com.ruoyi</groupId>
164
-                <artifactId>ruoyi-system</artifactId>
165
-                <version>${ruoyi.version}</version>
166
-            </dependency>
167
-
168
-            <!-- 通用工具-->
169
-            <dependency>
170
-                <groupId>com.ruoyi</groupId>
171
-                <artifactId>ruoyi-common</artifactId>
172
-                <version>${ruoyi.version}</version>
173
-            </dependency>
174
-
175
-        </dependencies>
176
-    </dependencyManagement>
177
-
178 29
     <modules>
179
-        <module>ruoyi-admin</module>
180
-        <module>ruoyi-framework</module>
181
-        <module>ruoyi-system</module>
182
-        <module>ruoyi-quartz</module>
183
-        <module>ruoyi-generator</module>
184
-        <module>ruoyi-common</module>
30
+        <module>qomo-kn-financial-forecast-start</module>
31
+        <module>qomo-kn-financial-forecast</module>
185 32
     </modules>
186
-    <packaging>pom</packaging>
187
-
188
-    <build>
189
-        <plugins>
190
-            <plugin>
191
-                <groupId>org.apache.maven.plugins</groupId>
192
-                <artifactId>maven-compiler-plugin</artifactId>
193
-                <version>3.1</version>
194
-                <configuration>
195
-                    <source>${java.version}</source>
196
-                    <target>${java.version}</target>
197
-                    <encoding>${project.build.sourceEncoding}</encoding>
198
-                </configuration>
199
-            </plugin>
200
-        </plugins>
201
-    </build>
202 33
 
203 34
     <repositories>
204 35
         <repository>
205
-            <id>public</id>
206
-            <name>aliyun nexus</name>
207
-            <url>https://maven.aliyun.com/repository/public</url>
36
+            <id>zzzz</id>
37
+            <name>zzzz Repository</name>
38
+            <url>http://192.168.50.9:8091/repository/maven-public/</url>
208 39
             <releases>
209 40
                 <enabled>true</enabled>
210 41
             </releases>
42
+            <snapshots>
43
+                <enabled>true</enabled>
44
+            </snapshots>
45
+        </repository>
46
+
47
+        <repository>
48
+            <id>aliyun</id>
49
+            <name>aliyun Repository</name>
50
+            <url>https://maven.aliyun.com/repository/public</url>
51
+            <snapshots>
52
+                <enabled>false</enabled>
53
+            </snapshots>
211 54
         </repository>
212 55
     </repositories>
213 56
 
57
+    <distributionManagement>
58
+        <repository>
59
+            <id>zzzz-releases</id>
60
+            <name>zzzz-releases Repository</name>
61
+            <url>http://192.168.50.9:8091/repository/zzzz-releases/</url>
62
+        </repository>
63
+
64
+        <snapshotRepository>
65
+            <id>zzzz-snapshots</id>
66
+            <name>zzzz Snapshot Repository</name>
67
+            <url>http://192.168.50.9:8091/repository/zzzz-snapshots/</url>
68
+        </snapshotRepository>
69
+    </distributionManagement>
70
+
214 71
     <pluginRepositories>
215 72
         <pluginRepository>
216
-            <id>public</id>
217
-            <name>aliyun nexus</name>
218
-            <url>https://maven.aliyun.com/repository/public</url>
73
+            <id>zzzz</id>
74
+            <name>zzzz Repository</name>
75
+            <url>http://192.168.50.9:8091/repository/maven-public/</url>
219 76
             <releases>
220 77
                 <enabled>true</enabled>
221 78
             </releases>
79
+            <snapshots>
80
+                <enabled>true</enabled>
81
+            </snapshots>
82
+        </pluginRepository>
83
+
84
+        <pluginRepository>
85
+            <id>aliyun</id>
86
+            <name>aliyun Repository</name>
87
+            <url>https://maven.aliyun.com/repository/public</url>
222 88
             <snapshots>
223 89
                 <enabled>false</enabled>
224 90
             </snapshots>
225 91
         </pluginRepository>
226 92
     </pluginRepositories>
227 93
 
228
-</project>
94
+    <dependencyManagement>
95
+        <dependencies>
96
+            <dependency>
97
+                <groupId>com.zzsmart.qomo</groupId>
98
+                <artifactId>qomo-kn-financial-forecast</artifactId>
99
+                <version>${revision}</version>
100
+            </dependency>
101
+        </dependencies>
102
+    </dependencyManagement>
103
+
104
+    <!-- 环境 -->
105
+    <profiles>
106
+        <!-- 开发 -->
107
+        <profile>
108
+            <id>dev</id>
109
+            <activation>
110
+                <!--默认激活配置-->
111
+                <activeByDefault>true</activeByDefault>
112
+            </activation>
113
+            <properties>
114
+                <!--当前环境-->
115
+                <profile.name>dev</profile.name>
116
+                <!--Nacos服务地址-->
117
+                <config.server-addr>jeecg-boot-nacos:8848</config.server-addr>
118
+                <!--Nacos配置中心命名空间,用于支持多环境.这里必须使用ID,不能使用名称,默认为空-->
119
+                <config.namespace></config.namespace>
120
+                <!--Nacos配置分组名称-->
121
+                <config.group>DEFAULT_GROUP</config.group>
122
+                <!--Nacos用户名-->
123
+                <config.username></config.username>
124
+                <!--Nacos密码-->
125
+                <config.password></config.password>
126
+            </properties>
127
+        </profile>
128
+        <!-- 测试Nacos开启鉴权、设置分组和命名空间
129
+        <profile>
130
+            <id>dev</id>
131
+            <properties>
132
+                <profile.name>dev</profile.name>
133
+                <config.server-addr>jeecg-boot-nacos:8848</config.server-addr>
134
+                <config.namespace>ac14ab82-51f8-4f0c-aa5b-25fb8384bfb6</config.namespace>
135
+                <config.group>JEECGDEV_GROUP</config.group>
136
+                <config.username>nacos</config.username>
137
+                <config.password>nacos</config.password>
138
+            </properties>
139
+        </profile> -->
140
+        <!-- 测试 -->
141
+        <profile>
142
+            <id>test</id>
143
+            <properties>
144
+                <!--当前环境-->
145
+                <profile.name>test</profile.name>
146
+                <!--Nacos服务地址-->
147
+                <config.server-addr>jeecg-boot-nacos:8848</config.server-addr>
148
+                <!--Nacos配置中心命名空间,用于支持多环境.这里必须使用ID,不能使用名称,默认为空-->
149
+                <config.namespace></config.namespace>
150
+                <!--Nacos配置分组名称-->
151
+                <config.group>DEFAULT_GROUP</config.group>
152
+                <!--Nacos用户名-->
153
+                <config.username></config.username>
154
+                <!--Nacos密码-->
155
+                <config.password></config.password>
156
+            </properties>
157
+        </profile>
158
+        <!-- 生产 -->
159
+        <profile>
160
+            <id>prod</id>
161
+            <properties>
162
+                <!--当前环境-->
163
+                <profile.name>prod</profile.name>
164
+                <!--Nacos服务地址-->
165
+                <config.server-addr>jeecg-boot-nacos:8848</config.server-addr>
166
+                <!--Nacos配置中心命名空间,用于支持多环境.这里必须使用ID,不能使用名称,默认为空-->
167
+                <config.namespace></config.namespace>
168
+                <!--Nacos配置分组名称-->
169
+                <config.group>DEFAULT_GROUP</config.group>
170
+                <!--Nacos用户名-->
171
+                <config.username></config.username>
172
+                <!--Nacos密码-->
173
+                <config.password></config.password>
174
+            </properties>
175
+        </profile>
176
+        <!-- SpringCloud运行环境 -->
177
+    </profiles>
178
+</project>

+ 55
- 0
qomo-kn-financial-forecast-start/pom.xml 파일 보기

@@ -0,0 +1,55 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0"
3
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+    <parent>
6
+        <groupId>com.zzsmart.qomo</groupId>
7
+        <artifactId>qomo-kn-forecast</artifactId>
8
+        <version>${revision}</version>
9
+    </parent>
10
+    <modelVersion>4.0.0</modelVersion>
11
+
12
+    <artifactId>qomo-kn-financial-forecast-start</artifactId>
13
+
14
+    <properties>
15
+        <maven.deploy.skip>true</maven.deploy.skip>
16
+    </properties>
17
+
18
+    <dependencies>
19
+        <dependency>
20
+            <groupId>org.springframework.boot</groupId>
21
+            <artifactId>spring-boot-starter-test</artifactId>
22
+            <scope>test</scope>
23
+            <exclusions>
24
+                <exclusion>
25
+                    <artifactId>spring-boot-starter-logging</artifactId>
26
+                    <groupId>org.springframework.boot</groupId>
27
+                </exclusion>
28
+            </exclusions>
29
+        </dependency>
30
+
31
+        <dependency>
32
+            <groupId>junit</groupId>
33
+            <artifactId>junit</artifactId>
34
+            <scope>test</scope>
35
+        </dependency>
36
+
37
+        <dependency>
38
+            <groupId>com.zzsmart.qomo</groupId>
39
+            <artifactId>qomo-kn-financial-forecast</artifactId>
40
+        </dependency>
41
+    </dependencies>
42
+
43
+    <build>
44
+        <plugins>
45
+            <plugin>
46
+                <groupId>org.springframework.boot</groupId>
47
+                <artifactId>spring-boot-maven-plugin</artifactId>
48
+                <configuration>
49
+                    <!--                    <fork>true</fork> &lt;!&ndash; 如果没有该配置,devtools不会生效 &ndash;&gt;-->
50
+                    <includeSystemScope>true</includeSystemScope>
51
+                </configuration>
52
+            </plugin>
53
+        </plugins>
54
+    </build>
55
+</project>

+ 41
- 0
qomo-kn-financial-forecast-start/src/main/assembly/package.xml 파일 보기

@@ -0,0 +1,41 @@
1
+<assembly>
2
+    <id>dist</id>
3
+    <formats>
4
+        <format>dir</format>
5
+    </formats>
6
+    <includeBaseDirectory>false</includeBaseDirectory>
7
+    <fileSets>
8
+        <fileSet>
9
+            <directory>${basedir}/src/main/bin</directory>
10
+            <lineEnding>unix</lineEnding>
11
+            <outputDirectory/>
12
+            <fileMode>755</fileMode>
13
+            <includes>
14
+                <include>*.sh</include>
15
+            </includes>
16
+        </fileSet>
17
+        <fileSet>
18
+            <directory>${basedir}/src/main/bin</directory>
19
+            <lineEnding>windows</lineEnding>
20
+            <outputDirectory/>
21
+            <includes>
22
+                <include>*.bat</include>
23
+            </includes>
24
+        </fileSet>
25
+        <fileSet>
26
+            <directory>target/classes</directory>
27
+            <outputDirectory>config</outputDirectory>
28
+            <includes>
29
+                <include>**/*.yml</include>
30
+                <include>**/*.yaml</include>
31
+                <include>**/logback-spring.xml</include>
32
+            </includes>
33
+        </fileSet>
34
+    </fileSets>
35
+    <dependencySets>
36
+        <dependencySet>
37
+            <outputDirectory>lib</outputDirectory>
38
+            <unpack>false</unpack>
39
+        </dependencySet>
40
+    </dependencySets>
41
+</assembly>

+ 46
- 0
qomo-kn-financial-forecast-start/src/main/java/com/zzsmart/qomo/kn/forecast/financial/QomoForecastApplication.java 파일 보기

@@ -0,0 +1,46 @@
1
+package com.zzsmart.qomo.kn.forecast.financial;
2
+
3
+import lombok.extern.slf4j.Slf4j;
4
+import org.jeecg.common.util.oConvertUtils;
5
+import org.springframework.boot.SpringApplication;
6
+import org.springframework.boot.autoconfigure.SpringBootApplication;
7
+import org.springframework.boot.builder.SpringApplicationBuilder;
8
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
9
+import org.springframework.context.ConfigurableApplicationContext;
10
+import org.springframework.core.env.Environment;
11
+import org.springframework.scheduling.annotation.EnableAsync;
12
+
13
+import java.net.InetAddress;
14
+import java.net.UnknownHostException;
15
+
16
+/**
17
+* 单体启动类
18
+* 报错提醒: 未集成mongo报错,可以打开启动类上面的注释 exclude={MongoAutoConfiguration.class}
19
+*/
20
+@Slf4j
21
+@SpringBootApplication (scanBasePackages ={"org.jeecg", "com.zzsmart.qomo"})
22
+//@EnableAutoConfiguration(exclude={MongoAutoConfiguration.class})
23
+@EnableAsync
24
+public class QomoForecastApplication extends SpringBootServletInitializer {
25
+
26
+    @Override
27
+    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
28
+        return application.sources(QomoForecastApplication.class);
29
+    }
30
+
31
+    public static void main(String[] args) throws UnknownHostException {
32
+        ConfigurableApplicationContext application = SpringApplication.run(QomoForecastApplication.class, args);
33
+        Environment env = application.getEnvironment();
34
+        String ip = InetAddress.getLocalHost().getHostAddress();
35
+        String port = env.getProperty("server.port");
36
+        String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
37
+        log.info("\n----------------------------------------------------------\n\t" +
38
+                "Application Jeecg-Boot is running! Access URLs:\n\t" +
39
+                "Local: \t\thttp://localhost:" + port + path + "/\n\t" +
40
+                "External: \thttp://" + ip + ":" + port + path + "/\n\t" +
41
+                "Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n" +
42
+                "----------------------------------------------------------");
43
+
44
+    }
45
+
46
+}

+ 456
- 0
qomo-kn-financial-forecast-start/src/main/resources/application-dev.yml 파일 보기

@@ -0,0 +1,456 @@
1
+v2:
2
+  #虚拟路径映射路径 2个文件路径一一对应 第一个为主存储,其他为配置相关
3
+  xnljmap:
4
+    #win服务器  本地 注意!! 记住这个结尾有一个/
5
+    oss: file:/data/qomo-boot/oss/
6
+#    oss: file:D:/upload/
7
+    #linux服务器
8
+    #oss: file:/home/webapps/oss/
9
+  #虚拟路径映射路径 end
10
+  #本地存放地址 注意!! 记住这个结尾没有/
11
+  fileurl: /data/qomo-boot/oss
12
+#  fileurl: D:/upload
13
+  #http://127.0.0.1:8080/oss/{yy}/2022-12-22/c83a77ae134a540c30daa6a0666fa945.md
14
+  httpurl: /qomo/
15
+  defaultFormat: .png
16
+
17
+server:
18
+  port: 8095
19
+  tomcat:
20
+    max-swallow-size: -1
21
+  error:
22
+    include-exception: true
23
+    include-stacktrace: ALWAYS
24
+    include-message: ALWAYS
25
+  servlet:
26
+    context-path: /qomo
27
+  compression:
28
+    enabled: true
29
+    min-response-size: 1024
30
+    mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
31
+
32
+management:
33
+  endpoints:
34
+    web:
35
+      exposure:
36
+        include: metrics,httptrace
37
+
38
+spring:
39
+  servlet:
40
+    multipart:
41
+      max-file-size: 10MB
42
+      max-request-size: 10MB
43
+  mail:
44
+    host: smtp.163.com
45
+    username: jeecgos@163.com
46
+    password: ??
47
+    properties:
48
+      mail:
49
+        smtp:
50
+          auth: true
51
+          starttls:
52
+            enable: true
53
+            required: true
54
+  ## quartz定时任务,采用数据库方式
55
+  quartz:
56
+    job-store-type: jdbc
57
+    initialize-schema: embedded
58
+    #定时任务启动开关,true-开  false-关
59
+    auto-startup: true
60
+    #延迟1秒启动定时任务
61
+    startup-delay: 1s
62
+    #启动时更新己存在的Job
63
+    overwrite-existing-jobs: true
64
+    properties:
65
+      org:
66
+        quartz:
67
+          scheduler:
68
+            instanceName: MyScheduler
69
+            instanceId: AUTO
70
+          jobStore:
71
+            class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
72
+            driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
73
+            tablePrefix: QRTZ_
74
+            isClustered: true
75
+            misfireThreshold: 12000
76
+            clusterCheckinInterval: 15000
77
+          threadPool:
78
+            class: org.quartz.simpl.SimpleThreadPool
79
+            threadCount: 10
80
+            threadPriority: 5
81
+            threadsInheritContextClassLoaderOfInitializingThread: true
82
+  #json 时间戳统一转换
83
+  jackson:
84
+    date-format: yyyy-MM-dd HH:mm:ss
85
+    time-zone: GMT+8
86
+  jpa:
87
+    open-in-view: false
88
+
89
+  # http请求配置
90
+  rest:
91
+    livy:
92
+      server: http://192.168.50.9:7997
93
+      spark:
94
+        # 组件部署路径,默认是部署在hdfs 如果是本地路径则在前面加上local:
95
+        main-jar: local:/opt/services/deploy-jars/dev/qomo-data-component-${Qomo.version}-jar-with-dependencies.jar
96
+        main-class: com.zzsmart.qomo.QomoSparkStarter
97
+        # spark默认运行参数
98
+        deploy-mode: cluster
99
+        queue: default
100
+        num-executors: 2
101
+        executor-cores: 1
102
+        executor-memory: 1G
103
+        driver-cores: 1
104
+        driver-memory: 512M
105
+    # 客户端类型
106
+    client-type: urlconnection
107
+    # URLConnection配置
108
+    url-connection:
109
+      # 客户端和服务器建立连接超时时间
110
+      connect-timeout: 2000
111
+      # 客户端从服务器读取数据包超时时间
112
+      read-timeout: 30000
113
+      # 是否长链接
114
+      keep-alive: false
115
+    # HttpClient配置
116
+    http-client:
117
+      # 连接池的最大连接数
118
+      max-total-connect: 200
119
+      # 相同域名允许创建的最大连接数
120
+      max-connect-per-route: 10
121
+      # 客户端和服务器建立连接超时时间
122
+      connect-timeout: 2000
123
+      # 读数据的超时时间
124
+      socket-timeout: 30000
125
+      # 连接池创建连接时的超时时间
126
+      connection-request-timout: 200
127
+    # OKHttp配置
128
+    ok-http:
129
+      # 失败后是否重试
130
+      retry-on-connection-failure: false
131
+      # 链接超时时间
132
+      connect-timeout: 2000
133
+      # 读超时时间
134
+      read-timeout: 10000
135
+      # 写超时时间
136
+      write-timeout: 10000
137
+      # 最大空闲的连接数
138
+      max-idle-connections: 5
139
+      # 最大的空闲时间
140
+      keep-alive-duration-ns: 3000
141
+
142
+  aop:
143
+    proxy-target-class: true
144
+  #配置freemarker
145
+  freemarker:
146
+    # 设置模板后缀名
147
+    suffix: .ftl
148
+    # 设置文档类型
149
+    content-type: text/html
150
+    # 设置页面编码格式
151
+    charset: UTF-8
152
+    # 设置页面缓存
153
+    cache: false
154
+    prefer-file-system-access: false
155
+    # 设置ftl文件路径
156
+    template-loader-path:
157
+      - classpath:/template
158
+#      - d:/data
159
+    template_update_delay: 0
160
+  # 设置静态文件路径,js,css等
161
+  mvc:
162
+    static-path-pattern: /**
163
+    #Spring Boot 2.6+后映射匹配的默认策略已从AntPathMatcher更改为PathPatternParser,需要手动指定为ant-path-matcher
164
+    pathmatch:
165
+      matching-strategy: ant_path_matcher
166
+  resource:
167
+    static-locations: classpath:/static/,classpath:/public/
168
+  autoconfigure:
169
+    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
170
+  datasource:
171
+    druid:
172
+      stat-view-servlet:
173
+        enabled: true
174
+        loginUsername: admin
175
+        loginPassword: 123456
176
+        allow:
177
+      web-stat-filter:
178
+        enabled: true
179
+    dynamic:
180
+      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
181
+        # 连接池的配置信息
182
+        # 初始化大小,最小,最大
183
+        initial-size: 5
184
+        min-idle: 5
185
+        maxActive: 20
186
+        # 配置获取连接等待超时的时间
187
+        maxWait: 60000
188
+        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
189
+        timeBetweenEvictionRunsMillis: 60000
190
+        # 配置一个连接在池中最小生存的时间,单位是毫秒
191
+        minEvictableIdleTimeMillis: 300000
192
+        validationQuery: SELECT 1
193
+        testWhileIdle: true
194
+        testOnBorrow: false
195
+        testOnReturn: false
196
+        # 打开PSCache,并且指定每个连接上PSCache的大小
197
+        poolPreparedStatements: true
198
+        maxPoolPreparedStatementPerConnectionSize: 20
199
+        # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
200
+        filters: stat,slf4j
201
+        filter:
202
+          wall:
203
+            config:
204
+              none-base-statement-allow: true
205
+              multi-statement-allow: true
206
+        # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
207
+        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
208
+      datasource:
209
+        master:
210
+          url: jdbc:mysql://121.40.189.20:3306/costmanage?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai
211
+          username: root
212
+          password: YMzc157#
213
+          driver-class-name: com.mysql.cj.jdbc.Driver
214
+#          url: jdbc:mysql://192.168.50.9:2212/selef_report?useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false
215
+#          username: root
216
+#          password: root
217
+          # 多数据源配置
218
+          #multi-datasource1:
219
+          #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
220
+          #username: root
221
+          #password: root
222
+          #driver-class-name: com.mysql.cj.jdbc.Driver
223
+  #redis 配置
224
+  redis:
225
+    database: 5
226
+#    host: 192.168.50.9
227
+#    port: 7379
228
+#    password: 'zzboard'
229
+    host: 121.40.189.20
230
+    port: 6389
231
+    main:
232
+      allow-circular-references: true
233
+
234
+  #rabbitmq 配置
235
+  rabbitmq:
236
+    host: 192.168.50.9
237
+    port: 5672
238
+    virtual-host: /qomoflow-dev
239
+    username: admin
240
+    password: kncloud
241
+    connection-timeout: 5000
242
+    listener:
243
+      simple:
244
+        concurrency: 5 # 并发数量
245
+        max-concurrency: 10 # 最大并发数量
246
+        acknowledge-mode: manual # 开启手动签收
247
+        prefetch: 1 # 限制每次只消费一个(一个线程)
248
+
249
+#mybatis plus 设置
250
+mybatis-plus:
251
+  mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml,classpath*:/mapper/*.xml,classpath*:com/zzsmart/qomo/**/mapper/xml/*.xml
252
+  global-config:
253
+    # 关闭MP3.0自带的banner
254
+    banner: false
255
+    db-config:
256
+      #主键类型  0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
257
+      id-type: ASSIGN_ID
258
+      # 默认数据库表下划线命名
259
+      table-underline: true
260
+  configuration:
261
+    # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
262
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
263
+#    log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
264
+    # 返回类型为Map,显示null对应的字段
265
+    call-setters-on-nulls: true
266
+#jeecg专用配置
267
+minidao:
268
+  base-package: org.jeecg.modules.jmreport.*,org.jeecg.modules.drag.*
269
+jeecg:
270
+  # 是否启用安全模式
271
+  safeMode: false
272
+  # 签名密钥串(前后端要一致,正式发布请自行修改)
273
+  signatureSecret: dd05f1c54d63749eda95f9fa6d49v442a
274
+  # 签名拦截接口
275
+  signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys
276
+  #local、minio、alioss
277
+  uploadType: local
278
+  # 前端访问地址
279
+  domainUrl:
280
+    pc: http://localhost:3100
281
+    app: http://localhost:8051
282
+  path:
283
+    #文件上传根目录 设置
284
+    upload: /opt/upFiles
285
+    #webapp文件路径
286
+    webapp: /opt/webapp
287
+  shiro:
288
+#    excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**
289
+    excludeUrls: /**/**,/**/**/**
290
+
291
+  #阿里云oss存储和大鱼短信秘钥配置
292
+  oss:
293
+    accessKey: ??
294
+    secretKey: ??
295
+    endpoint: oss-cn-beijing.aliyuncs.com
296
+    bucketName: jeecgdev
297
+  minio:
298
+    minio_url: http://192.168.50.102:9000
299
+    minio_name: admin
300
+    minio_pass: minioadmin
301
+    bucketName: bucket803
302
+  # ElasticSearch 6设置
303
+  elasticsearch:
304
+    cluster-name: elasticsearch-cluster
305
+    cluster-nodes: 192.168.50.9:9200
306
+    check-enabled: false
307
+    task-data-index: task_data_dev/_doc
308
+    task-data-struct-index: task_data_struct_dev/_doc
309
+    task-data-temp-index: task_data_temp_dev/_doc
310
+    task-log-index: task_log_dev/_doc
311
+  # 在线预览文件服务器地址配置
312
+  file-view-domain: http://fileview.jeecg.com
313
+  # minio文件上传
314
+#  minio:
315
+#    minio_url: http://minio.jeecg.com
316
+#    minio_name: ??
317
+#    minio_pass: ??
318
+#    bucketName: otatest
319
+  #大屏报表参数设置
320
+  jmreport:
321
+    mode: dev
322
+    #数据字典是否进行saas数据隔离,自己看自己的字典
323
+    saas: false
324
+  #xxl-job配置
325
+  xxljob:
326
+    enabled: false
327
+    adminAddresses: http://127.0.0.1:9080/xxl-job-admin
328
+    appname: ${spring.application.name}
329
+    accessToken: ''
330
+    address: 127.0.0.1:30007
331
+    ip: 127.0.0.1
332
+    port: 30007
333
+    logPath: logs/jeecg/job/jobhandler/
334
+    logRetentionDays: 30
335
+  #分布式锁配置
336
+  redisson:
337
+    address: 127.0.0.1:6379
338
+    password:
339
+    type: STANDALONE
340
+    enabled: true
341
+#cas单点登录
342
+cas:
343
+  server:
344
+    host:
345
+      #CAS服务地址
346
+      url: http://192.168.50.9:8167/cas
347
+#Mybatis输出sql日志
348
+logging:
349
+  level:
350
+    org.jeecg.modules.system.mapper: info
351
+#swagger
352
+knife4j:
353
+  #开启增强配置
354
+  enable: true
355
+  #开启生产环境屏蔽
356
+  production: false
357
+  basic:
358
+    enable: false
359
+    username: jeecg
360
+    password: jeecg1314
361
+#第三方登录
362
+justauth:
363
+  enabled: true
364
+  type:
365
+    GITHUB:
366
+      client-id: ??
367
+      client-secret: ??
368
+      redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/github/callback
369
+    WECHAT_ENTERPRISE:
370
+      client-id: ??
371
+      client-secret: ??
372
+      redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_enterprise/callback
373
+      agent-id: ??
374
+    DINGTALK:
375
+      client-id: ??
376
+      client-secret: ??
377
+      redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/dingtalk/callback
378
+    WECHAT_OPEN:
379
+      client-id: ??
380
+      client-secret: ??
381
+      redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_open/callback
382
+  cache:
383
+    type: default
384
+    prefix: 'demo::'
385
+    timeout: 1h
386
+#第三方APP对接
387
+third-app:
388
+  enabled: false
389
+  type:
390
+    #企业微信
391
+    WECHAT_ENTERPRISE:
392
+      enabled: false
393
+      #CORP_ID
394
+      client-id: ??
395
+      #SECRET
396
+      client-secret: ??
397
+      #自建应用id
398
+      agent-id: ??
399
+      #自建应用秘钥(新版企微需要配置)
400
+      # agent-app-secret: ??
401
+    #钉钉
402
+    DINGTALK:
403
+      enabled: false
404
+      # appKey
405
+      client-id: ??
406
+      # appSecret
407
+      client-secret: ??
408
+      agent-id: ??
409
+
410
+spark:
411
+  app:
412
+    name: yl
413
+  home: 127.0.0.1
414
+  master:
415
+    uri: local[*]
416
+  driver:
417
+    memory: 2g
418
+  worker:
419
+    memory: 2g
420
+  executor:
421
+    memory: 1g
422
+  rpc:
423
+    message:
424
+      maxSize: 1024
425
+
426
+flowable:
427
+  process:
428
+    definition-cache-limit: -1
429
+  database-schema-update: true
430
+  activity-font-name: 宋体
431
+  label-font-name: 宋体
432
+  annotation-font-name: 宋体
433
+  #关闭定时任务JOB
434
+  async-executor-activate: false
435
+  #消息链接基地址
436
+  message-base-url: http://192.168.50.9:3000/flowable/task/record/
437
+
438
+Qomo:
439
+  version: @project.version@
440
+
441
+modelPath: /opt/services/deploy-jars/algo/model
442
+seaTunnelHome: /opt/service/apache-seatunnel-2.3.4
443
+hiveMetastoreUri: thrift://192.168.50.102:9083
444
+
445
+minio:
446
+  server: http://192.168.50.102
447
+  port: 9000
448
+  access-key: admin
449
+  secret-key: minioadmin
450
+  bucketName: bucket1
451
+
452
+condaEnv: py310
453
+
454
+analysis:
455
+  consistency:
456
+    url: http://192.168.50.9:1314/analysis

+ 451
- 0
qomo-kn-financial-forecast-start/src/main/resources/application-prod.yml 파일 보기

@@ -0,0 +1,451 @@
1
+v2:
2
+  #虚拟路径映射路径 2个文件路径一一对应 第一个为主存储,其他为配置相关
3
+  xnljmap:
4
+    #win服务器  本地 注意!! 记住这个结尾有一个/
5
+    oss: file:/data/qomo-boot/oss/
6
+    #    oss: file:D:/upload/
7
+    #linux服务器
8
+    #oss: file:/home/webapps/oss/
9
+  #虚拟路径映射路径 end
10
+  #本地存放地址 注意!! 记住这个结尾没有/
11
+  fileurl: /data/qomo-boot/oss
12
+  #  fileurl: D:/upload
13
+  #http://127.0.0.1:8080/oss/{yy}/2022-12-22/c83a77ae134a540c30daa6a0666fa945.md
14
+  httpurl: /qomo/
15
+  defaultFormat: .png
16
+
17
+server:
18
+  port: 8095
19
+  tomcat:
20
+    max-swallow-size: -1
21
+  error:
22
+    include-exception: true
23
+    include-stacktrace: ALWAYS
24
+    include-message: ALWAYS
25
+  servlet:
26
+    context-path: /qomo
27
+  compression:
28
+    enabled: true
29
+    min-response-size: 1024
30
+    mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
31
+
32
+management:
33
+  endpoints:
34
+    web:
35
+      exposure:
36
+        include: metrics,httptrace
37
+
38
+spring:
39
+  servlet:
40
+    multipart:
41
+      max-file-size: 10MB
42
+      max-request-size: 10MB
43
+  mail:
44
+    host: smtp.163.com
45
+    username: jeecgos@163.com
46
+    password: ??
47
+    properties:
48
+      mail:
49
+        smtp:
50
+          auth: true
51
+          starttls:
52
+            enable: true
53
+            required: true
54
+  ## quartz定时任务,采用数据库方式
55
+  quartz:
56
+    job-store-type: jdbc
57
+    initialize-schema: embedded
58
+    #定时任务启动开关,true-开  false-关
59
+    auto-startup: true
60
+    #延迟1秒启动定时任务
61
+    startup-delay: 1s
62
+    #启动时更新己存在的Job
63
+    overwrite-existing-jobs: true
64
+    properties:
65
+      org:
66
+        quartz:
67
+          scheduler:
68
+            instanceName: MyScheduler
69
+            instanceId: AUTO
70
+          jobStore:
71
+            class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
72
+            driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
73
+            tablePrefix: QRTZ_
74
+            isClustered: true
75
+            misfireThreshold: 12000
76
+            clusterCheckinInterval: 15000
77
+          threadPool:
78
+            class: org.quartz.simpl.SimpleThreadPool
79
+            threadCount: 10
80
+            threadPriority: 5
81
+            threadsInheritContextClassLoaderOfInitializingThread: true
82
+  #json 时间戳统一转换
83
+  jackson:
84
+    date-format: yyyy-MM-dd HH:mm:ss
85
+    time-zone: GMT+8
86
+  jpa:
87
+    open-in-view: false
88
+
89
+  # http请求配置
90
+  rest:
91
+    livy:
92
+      server: http://192.168.50.9:7997
93
+      spark:
94
+        # 组件部署路径,默认是部署在hdfs 如果是本地路径则在前面加上local:
95
+        main-jar: local:/opt/services/deploy-jars/dev/qomo-data-component-${Qomo.version}-jar-with-dependencies.jar
96
+        main-class: com.zzsmart.qomo.QomoSparkStarter
97
+        # spark默认运行参数
98
+        deploy-mode: cluster
99
+        queue: default
100
+        num-executors: 2
101
+        executor-cores: 1
102
+        executor-memory: 1G
103
+        driver-cores: 1
104
+        driver-memory: 512M
105
+    # 客户端类型
106
+    client-type: urlconnection
107
+    # URLConnection配置
108
+    url-connection:
109
+      # 客户端和服务器建立连接超时时间
110
+      connect-timeout: 2000
111
+      # 客户端从服务器读取数据包超时时间
112
+      read-timeout: 30000
113
+      # 是否长链接
114
+      keep-alive: false
115
+    # HttpClient配置
116
+    http-client:
117
+      # 连接池的最大连接数
118
+      max-total-connect: 200
119
+      # 相同域名允许创建的最大连接数
120
+      max-connect-per-route: 10
121
+      # 客户端和服务器建立连接超时时间
122
+      connect-timeout: 2000
123
+      # 读数据的超时时间
124
+      socket-timeout: 30000
125
+      # 连接池创建连接时的超时时间
126
+      connection-request-timout: 200
127
+    # OKHttp配置
128
+    ok-http:
129
+      # 失败后是否重试
130
+      retry-on-connection-failure: false
131
+      # 链接超时时间
132
+      connect-timeout: 2000
133
+      # 读超时时间
134
+      read-timeout: 10000
135
+      # 写超时时间
136
+      write-timeout: 10000
137
+      # 最大空闲的连接数
138
+      max-idle-connections: 5
139
+      # 最大的空闲时间
140
+      keep-alive-duration-ns: 3000
141
+
142
+  aop:
143
+    proxy-target-class: true
144
+  #配置freemarker
145
+  freemarker:
146
+    # 设置模板后缀名
147
+    suffix: .ftl
148
+    # 设置文档类型
149
+    content-type: text/html
150
+    # 设置页面编码格式
151
+    charset: UTF-8
152
+    # 设置页面缓存
153
+    cache: false
154
+    prefer-file-system-access: false
155
+    # 设置ftl文件路径
156
+    template-loader-path:
157
+      - classpath:/template
158
+    #      - d:/data
159
+    template_update_delay: 0
160
+  # 设置静态文件路径,js,css等
161
+  mvc:
162
+    static-path-pattern: /**
163
+    #Spring Boot 2.6+后映射匹配的默认策略已从AntPathMatcher更改为PathPatternParser,需要手动指定为ant-path-matcher
164
+    pathmatch:
165
+      matching-strategy: ant_path_matcher
166
+  resource:
167
+    static-locations: classpath:/static/,classpath:/public/
168
+  autoconfigure:
169
+    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
170
+  datasource:
171
+    druid:
172
+      stat-view-servlet:
173
+        enabled: true
174
+        loginUsername: admin
175
+        loginPassword: 123456
176
+        allow:
177
+      web-stat-filter:
178
+        enabled: true
179
+    dynamic:
180
+      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
181
+        # 连接池的配置信息
182
+        # 初始化大小,最小,最大
183
+        initial-size: 5
184
+        min-idle: 5
185
+        maxActive: 20
186
+        # 配置获取连接等待超时的时间
187
+        maxWait: 60000
188
+        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
189
+        timeBetweenEvictionRunsMillis: 60000
190
+        # 配置一个连接在池中最小生存的时间,单位是毫秒
191
+        minEvictableIdleTimeMillis: 300000
192
+        validationQuery: SELECT 1
193
+        testWhileIdle: true
194
+        testOnBorrow: false
195
+        testOnReturn: false
196
+        # 打开PSCache,并且指定每个连接上PSCache的大小
197
+        poolPreparedStatements: true
198
+        maxPoolPreparedStatementPerConnectionSize: 20
199
+        # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
200
+        filters: stat,slf4j
201
+        filter:
202
+          wall:
203
+            config:
204
+              none-base-statement-allow: true
205
+              multi-statement-allow: true
206
+        # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
207
+        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
208
+      datasource:
209
+        master:
210
+          url: jdbc:mysql://192.168.50.9:2212/otd?useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false
211
+          username: root
212
+          password: root
213
+          driver-class-name: com.mysql.cj.jdbc.Driver
214
+          # 多数据源配置
215
+          #multi-datasource1:
216
+          #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
217
+          #username: root
218
+          #password: root
219
+          #driver-class-name: com.mysql.cj.jdbc.Driver
220
+  #redis 配置
221
+  redis:
222
+    database: 9
223
+    host: 192.168.50.9
224
+    port: 7379
225
+    password: 'zzboard'
226
+    main:
227
+      allow-circular-references: true
228
+
229
+  #rabbitmq 配置
230
+  rabbitmq:
231
+    host: 192.168.50.9
232
+    port: 5672
233
+    virtual-host: /qomoflow-dev
234
+    username: admin
235
+    password: kncloud
236
+    connection-timeout: 5000
237
+    listener:
238
+      simple:
239
+        concurrency: 5 # 并发数量
240
+        max-concurrency: 10 # 最大并发数量
241
+        acknowledge-mode: manual # 开启手动签收
242
+        prefetch: 1 # 限制每次只消费一个(一个线程)
243
+
244
+#mybatis plus 设置
245
+mybatis-plus:
246
+  mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml,classpath*:/mapper/*.xml,classpath*:com/zzsmart/qomo/**/mapper/xml/*.xml
247
+  global-config:
248
+    # 关闭MP3.0自带的banner
249
+    banner: false
250
+    db-config:
251
+      #主键类型  0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
252
+      id-type: ASSIGN_ID
253
+      # 默认数据库表下划线命名
254
+      table-underline: true
255
+  configuration:
256
+    # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
257
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
258
+    #    log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
259
+    # 返回类型为Map,显示null对应的字段
260
+    call-setters-on-nulls: true
261
+#jeecg专用配置
262
+minidao:
263
+  base-package: org.jeecg.modules.jmreport.*,org.jeecg.modules.drag.*
264
+jeecg:
265
+  # 是否启用安全模式
266
+  safeMode: false
267
+  # 签名密钥串(前后端要一致,正式发布请自行修改)
268
+  signatureSecret: dd05f1c54d63749eda95f9fa6d49v442a
269
+  # 签名拦截接口
270
+  signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys
271
+  #local、minio、alioss
272
+  uploadType: local
273
+  # 前端访问地址
274
+  domainUrl:
275
+    pc: http://localhost:3100
276
+    app: http://localhost:8051
277
+  path:
278
+    #文件上传根目录 设置
279
+    upload: /opt/upFiles
280
+    #webapp文件路径
281
+    webapp: /opt/webapp
282
+  shiro:
283
+    #    excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**
284
+    excludeUrls: /**/**,/**/**/**
285
+
286
+  #阿里云oss存储和大鱼短信秘钥配置
287
+  oss:
288
+    accessKey: ??
289
+    secretKey: ??
290
+    endpoint: oss-cn-beijing.aliyuncs.com
291
+    bucketName: jeecgdev
292
+  minio:
293
+    minio_url: http://192.168.50.102:9000
294
+    minio_name: admin
295
+    minio_pass: minioadmin
296
+    bucketName: bucket803
297
+  # ElasticSearch 6设置
298
+  elasticsearch:
299
+    cluster-name: elasticsearch-cluster
300
+    cluster-nodes: 192.168.50.9:9200
301
+    check-enabled: false
302
+    task-data-index: task_data_dev/_doc
303
+    task-data-struct-index: task_data_struct_dev/_doc
304
+    task-data-temp-index: task_data_temp_dev/_doc
305
+    task-log-index: task_log_dev/_doc
306
+  # 在线预览文件服务器地址配置
307
+  file-view-domain: http://fileview.jeecg.com
308
+  # minio文件上传
309
+  #  minio:
310
+  #    minio_url: http://minio.jeecg.com
311
+  #    minio_name: ??
312
+  #    minio_pass: ??
313
+  #    bucketName: otatest
314
+  #大屏报表参数设置
315
+  jmreport:
316
+    mode: dev
317
+    #数据字典是否进行saas数据隔离,自己看自己的字典
318
+    saas: false
319
+  #xxl-job配置
320
+  xxljob:
321
+    enabled: false
322
+    adminAddresses: http://127.0.0.1:9080/xxl-job-admin
323
+    appname: ${spring.application.name}
324
+    accessToken: ''
325
+    address: 127.0.0.1:30007
326
+    ip: 127.0.0.1
327
+    port: 30007
328
+    logPath: logs/jeecg/job/jobhandler/
329
+    logRetentionDays: 30
330
+  #分布式锁配置
331
+  redisson:
332
+    address: 127.0.0.1:6379
333
+    password:
334
+    type: STANDALONE
335
+    enabled: true
336
+#cas单点登录
337
+cas:
338
+  server:
339
+    host:
340
+      #CAS服务地址
341
+      url: http://192.168.50.9:8167/cas
342
+#Mybatis输出sql日志
343
+logging:
344
+  level:
345
+    org.jeecg.modules.system.mapper: info
346
+#swagger
347
+knife4j:
348
+  #开启增强配置
349
+  enable: true
350
+  #开启生产环境屏蔽
351
+  production: false
352
+  basic:
353
+    enable: false
354
+    username: jeecg
355
+    password: jeecg1314
356
+#第三方登录
357
+justauth:
358
+  enabled: true
359
+  type:
360
+    GITHUB:
361
+      client-id: ??
362
+      client-secret: ??
363
+      redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/github/callback
364
+    WECHAT_ENTERPRISE:
365
+      client-id: ??
366
+      client-secret: ??
367
+      redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_enterprise/callback
368
+      agent-id: ??
369
+    DINGTALK:
370
+      client-id: ??
371
+      client-secret: ??
372
+      redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/dingtalk/callback
373
+    WECHAT_OPEN:
374
+      client-id: ??
375
+      client-secret: ??
376
+      redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_open/callback
377
+  cache:
378
+    type: default
379
+    prefix: 'demo::'
380
+    timeout: 1h
381
+#第三方APP对接
382
+third-app:
383
+  enabled: false
384
+  type:
385
+    #企业微信
386
+    WECHAT_ENTERPRISE:
387
+      enabled: false
388
+      #CORP_ID
389
+      client-id: ??
390
+      #SECRET
391
+      client-secret: ??
392
+      #自建应用id
393
+      agent-id: ??
394
+      #自建应用秘钥(新版企微需要配置)
395
+      # agent-app-secret: ??
396
+    #钉钉
397
+    DINGTALK:
398
+      enabled: false
399
+      # appKey
400
+      client-id: ??
401
+      # appSecret
402
+      client-secret: ??
403
+      agent-id: ??
404
+
405
+spark:
406
+  app:
407
+    name: yl
408
+  home: 127.0.0.1
409
+  master:
410
+    uri: local[*]
411
+  driver:
412
+    memory: 2g
413
+  worker:
414
+    memory: 2g
415
+  executor:
416
+    memory: 1g
417
+  rpc:
418
+    message:
419
+      maxSize: 1024
420
+
421
+flowable:
422
+  process:
423
+    definition-cache-limit: -1
424
+  database-schema-update: true
425
+  activity-font-name: 宋体
426
+  label-font-name: 宋体
427
+  annotation-font-name: 宋体
428
+  #关闭定时任务JOB
429
+  async-executor-activate: false
430
+  #消息链接基地址
431
+  message-base-url: http://192.168.50.9:3000/flowable/task/record/
432
+
433
+Qomo:
434
+  version: @project.version@
435
+
436
+modelPath: /opt/services/deploy-jars/algo/model
437
+seaTunnelHome: /opt/service/apache-seatunnel-2.3.4
438
+hiveMetastoreUri: thrift://192.168.50.102:9083
439
+
440
+minio:
441
+  server: http://192.168.50.102
442
+  port: 9000
443
+  access-key: admin
444
+  secret-key: minioadmin
445
+  bucketName: bucket1
446
+
447
+condaEnv: py310
448
+
449
+analysis:
450
+  consistency:
451
+    url: http://192.168.50.9:1314/analysis

+ 5
- 0
qomo-kn-financial-forecast-start/src/main/resources/application.yml 파일 보기

@@ -0,0 +1,5 @@
1
+spring:
2
+  application:
3
+    name: qomo-forecast
4
+  profiles:
5
+    active: dev

+ 29
- 0
qomo-kn-financial-forecast-start/src/main/resources/jeecg/jeecg_config.properties 파일 보기

@@ -0,0 +1,29 @@
1
+#code_generate_project_path
2
+project_path=E:\\workspace\\qomoai
3
+#bussi_package[User defined]
4
+bussi_package=com.zzsmart.qomo.modules.demo
5
+
6
+
7
+#default code path
8
+#source_root_package=src
9
+#webroot_package=WebRoot
10
+
11
+#maven code path
12
+source_root_package=src.main.java
13
+webroot_package=src.main.webapp
14
+
15
+#ftl resource url
16
+templatepath=/jeecg/code-template
17
+system_encoding=utf-8
18
+
19
+#db Table id [User defined]
20
+db_table_id=id
21
+
22
+#db convert flag[true/false]
23
+db_filed_convert=true
24
+
25
+#page Search Field num [User defined]
26
+page_search_filed_num=1
27
+#page_filter_fields
28
+page_filter_fields=create_time,create_by,update_time,update_by
29
+exclude_table=act_,ext_act_,design_,onl_,sys_,qrtz_

+ 27
- 0
qomo-kn-financial-forecast-start/src/main/resources/jeecg/jeecg_database.properties 파일 보기

@@ -0,0 +1,27 @@
1
+#mysql
2
+diver_name=com.mysql.jdbc.Driver
3
+url=jdbc:mysql://localhost:3306/qomo?useUnicode=true&characterEncoding=UTF-8
4
+username=root
5
+password=root
6
+database_name=qomo
7
+
8
+#oracle
9
+#diver_name=oracle.jdbc.driver.OracleDriver
10
+#url=jdbc:oracle:thin:@192.168.1.200:1521:ORCL
11
+#username=scott
12
+#password=tiger
13
+#database_name=ORCL
14
+
15
+#postgre
16
+#diver_name=org.postgresql.Driver
17
+#url=jdbc:postgresql://localhost:5432/qomo
18
+#username=postgres
19
+#password=postgres
20
+#database_name=qomo
21
+
22
+#SQLServer2005以上
23
+#diver_name=org.hibernate.dialect.SQLServerDialect
24
+#url=jdbc:sqlserver://192.168.1.200:1433;DatabaseName=qomo
25
+#username=sa
26
+#password=SA
27
+#database_name=qomo

+ 96
- 0
qomo-kn-financial-forecast-start/src/main/resources/liquibase/changelogs/change.sql 파일 보기

@@ -0,0 +1,96 @@
1
+ALTER TABLE `sys_permission`
2
+    ADD COLUMN `type` varchar(255) NULL COMMENT '类型 CDM 公共层 ADS 应用层' AFTER `middle`;
3
+
4
+CREATE TABLE `sys_application`
5
+(
6
+    `id`              varchar(255)                                                 NOT NULL COMMENT '主键',
7
+    `app_name`        varchar(255)                                                 NULL COMMENT '应用名称',
8
+    `app_code`        varchar(255)                                                 NULL COMMENT '应用编码',
9
+    `app_icon`        varchar(255)                                                 NULL COMMENT '应用图标',
10
+    `app_color`       varchar(255)                                                 NULL COMMENT '应用颜色',
11
+    `app_belong`      varchar(255)                                                 NULL COMMENT '应用所属',
12
+    `app_kind`        varchar(255)                                                 NULL COMMENT '应用种类',
13
+    `app_type`        varchar(255)                                                 NULL COMMENT '应用类型',
14
+    `function_module` varchar(255)                                                 NULL COMMENT '功能模块',
15
+    `main_menu_url`   varchar(255)                                                 NULL COMMENT '主菜单路径',
16
+    `main_menu_name`  varchar(255)                                                 NULL COMMENT '主菜单名称',
17
+    `sort`            int                                                          NULL COMMENT '排序',
18
+    `create_by`       varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'creator id',
19
+    `create_time`     datetime(0)                                                  NULL DEFAULT NULL COMMENT 'create time',
20
+    `update_by`       varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'updator id',
21
+    `update_time`     datetime(0)                                                  NULL DEFAULT NULL COMMENT 'update time',
22
+    PRIMARY KEY (`id`)
23
+) COMMENT = '系统应用表';
24
+
25
+
26
+CREATE TABLE `sys_app_menu`
27
+(
28
+    `id`           varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键',
29
+    `app_id`       varchar(255)                                                  NULL COMMENT '应用id',
30
+    `menu_id`      varchar(255)                                                  NULL COMMENT '菜单id',
31
+    `create_by`    varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  NULL DEFAULT NULL COMMENT 'creator id',
32
+    `create_time`  datetime(0)                                                   NULL DEFAULT NULL COMMENT 'create time',
33
+    `update_by`    varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  NULL DEFAULT NULL COMMENT 'updator id',
34
+    `update_time`  datetime(0)                                                   NULL DEFAULT NULL COMMENT 'update time',
35
+    PRIMARY KEY (`id`)
36
+) COMMENT = '应用菜单';
37
+
38
+ALTER TABLE `qomo_database_file`
39
+    ADD COLUMN `record_count` bigint NULL COMMENT '记录数' AFTER `absolute_path`;
40
+
41
+CREATE TABLE `qomo_python_package`  (
42
+                                            `id` varchar(255) NOT NULL COMMENT '主键',
43
+                                            `package_name` varchar(255) NULL COMMENT '包名',
44
+                                            `version` varchar(255) NULL COMMENT '版本',
45
+                                            `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'creator id',
46
+                                            `create_time` datetime(0) NULL DEFAULT NULL COMMENT 'create time',
47
+                                            `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'updator id',
48
+                                            `update_time` datetime(0) NULL DEFAULT NULL COMMENT 'update time',
49
+                                            PRIMARY KEY (`id`)
50
+) COMMENT = 'python包管理';
51
+
52
+CREATE TABLE `sys_org`  (
53
+                                            `id` varchar(255) NOT NULL COMMENT 'ID',
54
+                                            `org_name` varchar(255) NULL COMMENT '组织名称',
55
+                                            `org_code` varchar(255) NULL COMMENT '组织编码',
56
+                                            `org_Industry` varchar(255) NULL COMMENT '所属行业',
57
+                                            `org_scale` varchar(255) NULL COMMENT '公司规模',
58
+                                            `org_addr` varchar(255) NULL COMMENT '公司地址',
59
+                                            `org_logo` varchar(255) NULL COMMENT '组织logo',
60
+                                            `org_state` varchar(255) NULL COMMENT '公司状态',
61
+                                            `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'creator id',
62
+                                            `create_time` datetime(0) NULL DEFAULT NULL COMMENT 'create time',
63
+                                            `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'updator id',
64
+                                            `update_time` datetime(0) NULL DEFAULT NULL COMMENT 'update time',
65
+                                            PRIMARY KEY (`id`)
66
+) COMMENT = '组织';
67
+
68
+CREATE TABLE `sys_app_org`  (
69
+                                            `id` varchar(255) NOT NULL COMMENT 'ID',
70
+                                            `app_id` varchar(255) NULL COMMENT '应用ID',
71
+                                            `org_id` varchar(255) NULL COMMENT '组织ID',
72
+                                            `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'creator id',
73
+                                            `create_time` datetime(0) NULL DEFAULT NULL COMMENT 'create time',
74
+                                            `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'updator id',
75
+                                            `update_time` datetime(0) NULL DEFAULT NULL COMMENT 'update time',
76
+                                            PRIMARY KEY (`id`)
77
+) COMMENT = '应用组织关联表';
78
+
79
+# 2024-03-27
80
+ALTER TABLE `sys_org`
81
+    ADD COLUMN `org_desc` varchar(255) NULL COMMENT '描述' AFTER `org_state`;
82
+
83
+# 2024-03-29
84
+ALTER TABLE `sys_depart`
85
+    MODIFY COLUMN `org_category` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT '1' COMMENT '机构类别 1公司,2组织机构,2岗位' AFTER `description`,
86
+    ADD COLUMN `org_id` varchar(255) NULL COMMENT '组织ID' AFTER `org_code`,
87
+    ADD COLUMN `depart_code` varchar(255) NULL COMMENT '组织ID' AFTER `org_code`;
88
+
89
+ALTER TABLE `sys_role`
90
+    ADD COLUMN `org_id` varchar(255) NULL COMMENT '组织ID' AFTER `role_code`;
91
+
92
+ALTER TABLE `sys_user`
93
+    ADD COLUMN `org_id` varchar(255) NULL COMMENT '组织ID' AFTER `bpm_status`;
94
+
95
+ALTER TABLE `sys_user`
96
+    ADD COLUMN `depart_code` varchar(255) NULL COMMENT '登录会话的部门编码' AFTER `org_code`;

+ 19122
- 0
qomo-kn-financial-forecast-start/src/main/resources/liquibase/changelogs/qomo-boot-init.sql
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 9
- 0
qomo-kn-financial-forecast-start/src/main/resources/liquibase/master.xml 파일 보기

@@ -0,0 +1,9 @@
1
+<databaseChangeLog
2
+        xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
3
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
5
+   http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
6
+
7
+<!--    <include file="liquibase/changelogs/qomo-boot-init.sql" relativeToChangelogFile="false"/>-->
8
+<!--    <include file="liquibase/changelogs/change.sql" relativeToChangelogFile="false"/>-->
9
+</databaseChangeLog>

+ 28
- 0
qomo-kn-financial-forecast/pom.xml 파일 보기

@@ -0,0 +1,28 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0"
3
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+    <parent>
6
+        <groupId>com.zzsmart.qomo</groupId>
7
+        <artifactId>qomo-kn-forecast</artifactId>
8
+        <version>${revision}</version>
9
+    </parent>
10
+    <modelVersion>4.0.0</modelVersion>
11
+
12
+    <artifactId>qomo-kn-financial-forecast</artifactId>
13
+
14
+    <properties>
15
+        <maven.compiler.source>8</maven.compiler.source>
16
+        <maven.compiler.target>8</maven.compiler.target>
17
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18
+    </properties>
19
+
20
+    <dependencies>
21
+        <dependency>
22
+            <groupId>org.qomo.boot</groupId>
23
+            <artifactId>qomo-system-biz</artifactId>
24
+            <version>2.0.1-SNAPSHOT</version>
25
+        </dependency>
26
+    </dependencies>
27
+
28
+</project>

+ 44
- 0
qomo-kn-financial-forecast/src/main/java/com/zzsmart/qomo/kn/forecast/financial/constants/Constants.java 파일 보기

@@ -0,0 +1,44 @@
1
+package com.zzsmart.qomo.kn.forecast.financial.constants;
2
+
3
+import cn.hutool.core.collection.CollUtil;
4
+
5
+import java.util.List;
6
+
7
+/**
8
+ * @author WangBo
9
+ * @since 2024/5/17 下午3:05
10
+ */
11
+public interface Constants {
12
+
13
+    String TRACK = "轨道总部";
14
+
15
+    List<String> BUSINESS_SEGMENTS = CollUtil.newArrayList("国内业务", "维保业务", "海外业务", "安全门业务", "汽车门业务", "内装业务");
16
+
17
+    List<String> PROFIT_ITEM_NAMES = CollUtil.newArrayList(
18
+            "一、营业总收入",
19
+            "其中:营业成本",
20
+            "税金及附加",
21
+            "销售费用",
22
+            "管理费用",
23
+            "研发费用",
24
+            "财务费用",
25
+            "二、营业总成本",
26
+            "加:其他收益",
27
+            "投资收益(损失以“-”号填列)",
28
+            "公允价值变动收益(损失以“-”号填列)",
29
+            "信用减值损失(损失以“-”号填列)",
30
+            "资产减值损失(损失以“-”号填列)",
31
+            "资产处置收益(损失以“-”号填列)",
32
+            "三、营业利润",
33
+            "加:营业外收入",
34
+            "减:营业外支出",
35
+            "四、利润总额",
36
+            "减:所得税费用",
37
+            "五、净利润",
38
+            "六、归属于母公司的净利润",
39
+            "八、关键指标",
40
+            "产品毛利率",
41
+            "期间费用",
42
+            "期间费用率",
43
+            "净利率");
44
+}

+ 0
- 96
ruoyi-admin/pom.xml 파일 보기

@@ -1,96 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project xmlns="http://maven.apache.org/POM/4.0.0"
3
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
-    <parent>
6
-        <artifactId>ruoyi</artifactId>
7
-        <groupId>com.ruoyi</groupId>
8
-        <version>3.8.7</version>
9
-    </parent>
10
-    <modelVersion>4.0.0</modelVersion>
11
-    <packaging>jar</packaging>
12
-    <artifactId>ruoyi-admin</artifactId>
13
-
14
-    <description>
15
-        web服务入口
16
-    </description>
17
-
18
-    <dependencies>
19
-
20
-        <!-- spring-boot-devtools -->
21
-        <dependency>
22
-            <groupId>org.springframework.boot</groupId>
23
-            <artifactId>spring-boot-devtools</artifactId>
24
-            <optional>true</optional> <!-- 表示依赖不会传递 -->
25
-        </dependency>
26
-
27
-        <!-- swagger3-->
28
-        <dependency>
29
-            <groupId>io.springfox</groupId>
30
-            <artifactId>springfox-boot-starter</artifactId>
31
-        </dependency>
32
-
33
-        <!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
34
-        <dependency>
35
-            <groupId>io.swagger</groupId>
36
-            <artifactId>swagger-models</artifactId>
37
-            <version>1.6.2</version>
38
-        </dependency>
39
-
40
-         <!-- Mysql驱动包 -->
41
-        <dependency>
42
-            <groupId>mysql</groupId>
43
-            <artifactId>mysql-connector-java</artifactId>
44
-        </dependency>
45
-
46
-        <!-- 核心模块-->
47
-        <dependency>
48
-            <groupId>com.ruoyi</groupId>
49
-            <artifactId>ruoyi-framework</artifactId>
50
-        </dependency>
51
-
52
-        <!-- 定时任务-->
53
-        <dependency>
54
-            <groupId>com.ruoyi</groupId>
55
-            <artifactId>ruoyi-quartz</artifactId>
56
-        </dependency>
57
-
58
-        <!-- 代码生成-->
59
-        <dependency>
60
-            <groupId>com.ruoyi</groupId>
61
-            <artifactId>ruoyi-generator</artifactId>
62
-        </dependency>
63
-
64
-    </dependencies>
65
-
66
-    <build>
67
-        <plugins>
68
-            <plugin>
69
-                <groupId>org.springframework.boot</groupId>
70
-                <artifactId>spring-boot-maven-plugin</artifactId>
71
-                <version>2.5.15</version>
72
-                <configuration>
73
-                    <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
74
-                </configuration>
75
-                <executions>
76
-                    <execution>
77
-                        <goals>
78
-                            <goal>repackage</goal>
79
-                        </goals>
80
-                    </execution>
81
-                </executions>
82
-            </plugin>
83
-            <plugin>   
84
-                <groupId>org.apache.maven.plugins</groupId>   
85
-                <artifactId>maven-war-plugin</artifactId>   
86
-                <version>3.1.0</version>   
87
-                <configuration>
88
-                    <failOnMissingWebXml>false</failOnMissingWebXml>
89
-                    <warName>${project.artifactId}</warName>
90
-                </configuration>   
91
-           </plugin>   
92
-        </plugins>
93
-        <finalName>${project.artifactId}</finalName>
94
-    </build>
95
-
96
-</project>

+ 0
- 29
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java 파일 보기

@@ -1,29 +0,0 @@
1
-package com.ruoyi;
2
-
3
-import org.springframework.boot.SpringApplication;
4
-import org.springframework.boot.autoconfigure.SpringBootApplication;
5
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
6
-
7
-/**
8
- * 启动程序
9
- * 
10
- * @author ruoyi
11
- */
12
-@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
13
-
14
-public class RuoYiApplication
15
-{
16
-    public static void main(String[] args)
17
-    {
18
-        // System.setProperty("spring.devtools.restart.enabled", "false");
19
-        SpringApplication.run(RuoYiApplication.class, args);
20
-        System.out.println("(♥◠‿◠)ノ゙  启动成功   ლ(´ڡ`ლ)゙  \n" +
21
-                "  _                          _   \n" +
22
-                " | |                        | |  \n" +
23
-                " | | ___ __     ___ ___  ___| |_ \n" +
24
-                " | |/ / '_ \\   / __/ _ \\/ __| __|\n" +
25
-                " |   <| | | | | (_| (_) \\__ \\ |_ \n" +
26
-                " |_|\\_\\_| |_|  \\___\\___/|___/\\__|\n" +
27
-                "                                 ");
28
-    }
29
-}

+ 0
- 18
ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java 파일 보기

@@ -1,18 +0,0 @@
1
-package com.ruoyi;
2
-
3
-import org.springframework.boot.builder.SpringApplicationBuilder;
4
-import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
5
-
6
-/**
7
- * web容器中进行部署
8
- * 
9
- * @author ruoyi
10
- */
11
-public class RuoYiServletInitializer extends SpringBootServletInitializer
12
-{
13
-    @Override
14
-    protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
15
-    {
16
-        return application.sources(RuoYiApplication.class);
17
-    }
18
-}

+ 0
- 94
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java 파일 보기

@@ -1,94 +0,0 @@
1
-package com.ruoyi.web.controller.common;
2
-
3
-import java.awt.image.BufferedImage;
4
-import java.io.IOException;
5
-import java.util.concurrent.TimeUnit;
6
-import javax.annotation.Resource;
7
-import javax.imageio.ImageIO;
8
-import javax.servlet.http.HttpServletResponse;
9
-import org.springframework.beans.factory.annotation.Autowired;
10
-import org.springframework.util.FastByteArrayOutputStream;
11
-import org.springframework.web.bind.annotation.GetMapping;
12
-import org.springframework.web.bind.annotation.RestController;
13
-import com.google.code.kaptcha.Producer;
14
-import com.ruoyi.common.config.RuoYiConfig;
15
-import com.ruoyi.common.constant.CacheConstants;
16
-import com.ruoyi.common.constant.Constants;
17
-import com.ruoyi.common.core.domain.AjaxResult;
18
-import com.ruoyi.common.core.redis.RedisCache;
19
-import com.ruoyi.common.utils.sign.Base64;
20
-import com.ruoyi.common.utils.uuid.IdUtils;
21
-import com.ruoyi.system.service.ISysConfigService;
22
-
23
-/**
24
- * 验证码操作处理
25
- * 
26
- * @author ruoyi
27
- */
28
-@RestController
29
-public class CaptchaController
30
-{
31
-    @Resource(name = "captchaProducer")
32
-    private Producer captchaProducer;
33
-
34
-    @Resource(name = "captchaProducerMath")
35
-    private Producer captchaProducerMath;
36
-
37
-    @Autowired
38
-    private RedisCache redisCache;
39
-    
40
-    @Autowired
41
-    private ISysConfigService configService;
42
-    /**
43
-     * 生成验证码
44
-     */
45
-    @GetMapping("/captchaImage")
46
-    public AjaxResult getCode(HttpServletResponse response) throws IOException
47
-    {
48
-        AjaxResult ajax = AjaxResult.success();
49
-        boolean captchaEnabled = configService.selectCaptchaEnabled();
50
-        ajax.put("captchaEnabled", captchaEnabled);
51
-        if (!captchaEnabled)
52
-        {
53
-            return ajax;
54
-        }
55
-
56
-        // 保存验证码信息
57
-        String uuid = IdUtils.simpleUUID();
58
-        String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
59
-
60
-        String capStr = null, code = null;
61
-        BufferedImage image = null;
62
-
63
-        // 生成验证码
64
-        String captchaType = RuoYiConfig.getCaptchaType();
65
-        if ("math".equals(captchaType))
66
-        {
67
-            String capText = captchaProducerMath.createText();
68
-            capStr = capText.substring(0, capText.lastIndexOf("@"));
69
-            code = capText.substring(capText.lastIndexOf("@") + 1);
70
-            image = captchaProducerMath.createImage(capStr);
71
-        }
72
-        else if ("char".equals(captchaType))
73
-        {
74
-            capStr = code = captchaProducer.createText();
75
-            image = captchaProducer.createImage(capStr);
76
-        }
77
-
78
-        redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
79
-        // 转换流信息写出
80
-        FastByteArrayOutputStream os = new FastByteArrayOutputStream();
81
-        try
82
-        {
83
-            ImageIO.write(image, "jpg", os);
84
-        }
85
-        catch (IOException e)
86
-        {
87
-            return AjaxResult.error(e.getMessage());
88
-        }
89
-
90
-        ajax.put("uuid", uuid);
91
-        ajax.put("img", Base64.encode(os.toByteArray()));
92
-        return ajax;
93
-    }
94
-}

+ 0
- 163
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java 파일 보기

@@ -1,163 +0,0 @@
1
-package com.ruoyi.web.controller.common;
2
-
3
-import java.util.ArrayList;
4
-import java.util.List;
5
-import javax.servlet.http.HttpServletRequest;
6
-import javax.servlet.http.HttpServletResponse;
7
-import org.slf4j.Logger;
8
-import org.slf4j.LoggerFactory;
9
-import org.springframework.beans.factory.annotation.Autowired;
10
-import org.springframework.http.MediaType;
11
-import org.springframework.web.bind.annotation.GetMapping;
12
-import org.springframework.web.bind.annotation.PostMapping;
13
-import org.springframework.web.bind.annotation.RequestMapping;
14
-import org.springframework.web.bind.annotation.RestController;
15
-import org.springframework.web.multipart.MultipartFile;
16
-import com.ruoyi.common.config.RuoYiConfig;
17
-import com.ruoyi.common.constant.Constants;
18
-import com.ruoyi.common.core.domain.AjaxResult;
19
-import com.ruoyi.common.utils.StringUtils;
20
-import com.ruoyi.common.utils.file.FileUploadUtils;
21
-import com.ruoyi.common.utils.file.FileUtils;
22
-import com.ruoyi.framework.config.ServerConfig;
23
-
24
-/**
25
- * 通用请求处理
26
- * 
27
- * @author ruoyi
28
- */
29
-@RestController
30
-@RequestMapping("/common")
31
-public class CommonController
32
-{
33
-    private static final Logger log = LoggerFactory.getLogger(CommonController.class);
34
-
35
-    @Autowired
36
-    private ServerConfig serverConfig;
37
-
38
-    private static final String FILE_DELIMETER = ",";
39
-
40
-    /**
41
-     * 通用下载请求
42
-     * 
43
-     * @param fileName 文件名称
44
-     * @param delete 是否删除
45
-     */
46
-    @GetMapping("/download")
47
-    public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
48
-    {
49
-        try
50
-        {
51
-            if (!FileUtils.checkAllowDownload(fileName))
52
-            {
53
-                throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
54
-            }
55
-            String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
56
-            String filePath = RuoYiConfig.getDownloadPath() + fileName;
57
-
58
-            response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
59
-            FileUtils.setAttachmentResponseHeader(response, realFileName);
60
-            FileUtils.writeBytes(filePath, response.getOutputStream());
61
-            if (delete)
62
-            {
63
-                FileUtils.deleteFile(filePath);
64
-            }
65
-        }
66
-        catch (Exception e)
67
-        {
68
-            log.error("下载文件失败", e);
69
-        }
70
-    }
71
-
72
-    /**
73
-     * 通用上传请求(单个)
74
-     */
75
-    @PostMapping("/upload")
76
-    public AjaxResult uploadFile(MultipartFile file) throws Exception
77
-    {
78
-        try
79
-        {
80
-            // 上传文件路径
81
-            String filePath = RuoYiConfig.getUploadPath();
82
-            // 上传并返回新文件名称
83
-            String fileName = FileUploadUtils.upload(filePath, file);
84
-            String url = serverConfig.getUrl() + fileName;
85
-            AjaxResult ajax = AjaxResult.success();
86
-            ajax.put("url", url);
87
-            ajax.put("fileName", fileName);
88
-            ajax.put("newFileName", FileUtils.getName(fileName));
89
-            ajax.put("originalFilename", file.getOriginalFilename());
90
-            return ajax;
91
-        }
92
-        catch (Exception e)
93
-        {
94
-            return AjaxResult.error(e.getMessage());
95
-        }
96
-    }
97
-
98
-    /**
99
-     * 通用上传请求(多个)
100
-     */
101
-    @PostMapping("/uploads")
102
-    public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
103
-    {
104
-        try
105
-        {
106
-            // 上传文件路径
107
-            String filePath = RuoYiConfig.getUploadPath();
108
-            List<String> urls = new ArrayList<String>();
109
-            List<String> fileNames = new ArrayList<String>();
110
-            List<String> newFileNames = new ArrayList<String>();
111
-            List<String> originalFilenames = new ArrayList<String>();
112
-            for (MultipartFile file : files)
113
-            {
114
-                // 上传并返回新文件名称
115
-                String fileName = FileUploadUtils.upload(filePath, file);
116
-                String url = serverConfig.getUrl() + fileName;
117
-                urls.add(url);
118
-                fileNames.add(fileName);
119
-                newFileNames.add(FileUtils.getName(fileName));
120
-                originalFilenames.add(file.getOriginalFilename());
121
-            }
122
-            AjaxResult ajax = AjaxResult.success();
123
-            ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
124
-            ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
125
-            ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
126
-            ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
127
-            return ajax;
128
-        }
129
-        catch (Exception e)
130
-        {
131
-            return AjaxResult.error(e.getMessage());
132
-        }
133
-    }
134
-
135
-    /**
136
-     * 本地资源通用下载
137
-     */
138
-    @GetMapping("/download/resource")
139
-    public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
140
-            throws Exception
141
-    {
142
-        try
143
-        {
144
-            if (!FileUtils.checkAllowDownload(resource))
145
-            {
146
-                throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
147
-            }
148
-            // 本地资源路径
149
-            String localPath = RuoYiConfig.getProfile();
150
-            // 数据库资源地址
151
-            String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
152
-            // 下载名称
153
-            String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
154
-            response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
155
-            FileUtils.setAttachmentResponseHeader(response, downloadName);
156
-            FileUtils.writeBytes(downloadPath, response.getOutputStream());
157
-        }
158
-        catch (Exception e)
159
-        {
160
-            log.error("下载文件失败", e);
161
-        }
162
-    }
163
-}

+ 0
- 121
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java 파일 보기

@@ -1,121 +0,0 @@
1
-package com.ruoyi.web.controller.monitor;
2
-
3
-import java.util.ArrayList;
4
-import java.util.Collection;
5
-import java.util.HashMap;
6
-import java.util.List;
7
-import java.util.Map;
8
-import java.util.Properties;
9
-import java.util.Set;
10
-import java.util.TreeSet;
11
-import org.springframework.beans.factory.annotation.Autowired;
12
-import org.springframework.data.redis.core.RedisCallback;
13
-import org.springframework.data.redis.core.RedisTemplate;
14
-import org.springframework.security.access.prepost.PreAuthorize;
15
-import org.springframework.web.bind.annotation.DeleteMapping;
16
-import org.springframework.web.bind.annotation.GetMapping;
17
-import org.springframework.web.bind.annotation.PathVariable;
18
-import org.springframework.web.bind.annotation.RequestMapping;
19
-import org.springframework.web.bind.annotation.RestController;
20
-import com.ruoyi.common.constant.CacheConstants;
21
-import com.ruoyi.common.core.domain.AjaxResult;
22
-import com.ruoyi.common.utils.StringUtils;
23
-import com.ruoyi.system.domain.SysCache;
24
-
25
-/**
26
- * 缓存监控
27
- * 
28
- * @author ruoyi
29
- */
30
-@RestController
31
-@RequestMapping("/monitor/cache")
32
-public class CacheController
33
-{
34
-    @Autowired
35
-    private RedisTemplate<String, String> redisTemplate;
36
-
37
-    private final static List<SysCache> caches = new ArrayList<SysCache>();
38
-    {
39
-        caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息"));
40
-        caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息"));
41
-        caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典"));
42
-        caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码"));
43
-        caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
44
-        caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
45
-        caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
46
-    }
47
-
48
-    @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
49
-    @GetMapping()
50
-    public AjaxResult getInfo() throws Exception
51
-    {
52
-        Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info());
53
-        Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
54
-        Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize());
55
-
56
-        Map<String, Object> result = new HashMap<>(3);
57
-        result.put("info", info);
58
-        result.put("dbSize", dbSize);
59
-
60
-        List<Map<String, String>> pieList = new ArrayList<>();
61
-        commandStats.stringPropertyNames().forEach(key -> {
62
-            Map<String, String> data = new HashMap<>(2);
63
-            String property = commandStats.getProperty(key);
64
-            data.put("name", StringUtils.removeStart(key, "cmdstat_"));
65
-            data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
66
-            pieList.add(data);
67
-        });
68
-        result.put("commandStats", pieList);
69
-        return AjaxResult.success(result);
70
-    }
71
-
72
-    @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
73
-    @GetMapping("/getNames")
74
-    public AjaxResult cache()
75
-    {
76
-        return AjaxResult.success(caches);
77
-    }
78
-
79
-    @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
80
-    @GetMapping("/getKeys/{cacheName}")
81
-    public AjaxResult getCacheKeys(@PathVariable String cacheName)
82
-    {
83
-        Set<String> cacheKeys = redisTemplate.keys(cacheName + "*");
84
-        return AjaxResult.success(new TreeSet<>(cacheKeys));
85
-    }
86
-
87
-    @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
88
-    @GetMapping("/getValue/{cacheName}/{cacheKey}")
89
-    public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey)
90
-    {
91
-        String cacheValue = redisTemplate.opsForValue().get(cacheKey);
92
-        SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue);
93
-        return AjaxResult.success(sysCache);
94
-    }
95
-
96
-    @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
97
-    @DeleteMapping("/clearCacheName/{cacheName}")
98
-    public AjaxResult clearCacheName(@PathVariable String cacheName)
99
-    {
100
-        Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*");
101
-        redisTemplate.delete(cacheKeys);
102
-        return AjaxResult.success();
103
-    }
104
-
105
-    @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
106
-    @DeleteMapping("/clearCacheKey/{cacheKey}")
107
-    public AjaxResult clearCacheKey(@PathVariable String cacheKey)
108
-    {
109
-        redisTemplate.delete(cacheKey);
110
-        return AjaxResult.success();
111
-    }
112
-
113
-    @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
114
-    @DeleteMapping("/clearCacheAll")
115
-    public AjaxResult clearCacheAll()
116
-    {
117
-        Collection<String> cacheKeys = redisTemplate.keys("*");
118
-        redisTemplate.delete(cacheKeys);
119
-        return AjaxResult.success();
120
-    }
121
-}

+ 0
- 27
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java 파일 보기

@@ -1,27 +0,0 @@
1
-package com.ruoyi.web.controller.monitor;
2
-
3
-import org.springframework.security.access.prepost.PreAuthorize;
4
-import org.springframework.web.bind.annotation.GetMapping;
5
-import org.springframework.web.bind.annotation.RequestMapping;
6
-import org.springframework.web.bind.annotation.RestController;
7
-import com.ruoyi.common.core.domain.AjaxResult;
8
-import com.ruoyi.framework.web.domain.Server;
9
-
10
-/**
11
- * 服务器监控
12
- * 
13
- * @author ruoyi
14
- */
15
-@RestController
16
-@RequestMapping("/monitor/server")
17
-public class ServerController
18
-{
19
-    @PreAuthorize("@ss.hasPermi('monitor:server:list')")
20
-    @GetMapping()
21
-    public AjaxResult getInfo() throws Exception
22
-    {
23
-        Server server = new Server();
24
-        server.copyTo();
25
-        return AjaxResult.success(server);
26
-    }
27
-}

+ 0
- 82
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java 파일 보기

@@ -1,82 +0,0 @@
1
-package com.ruoyi.web.controller.monitor;
2
-
3
-import java.util.List;
4
-import javax.servlet.http.HttpServletResponse;
5
-import org.springframework.beans.factory.annotation.Autowired;
6
-import org.springframework.security.access.prepost.PreAuthorize;
7
-import org.springframework.web.bind.annotation.DeleteMapping;
8
-import org.springframework.web.bind.annotation.GetMapping;
9
-import org.springframework.web.bind.annotation.PathVariable;
10
-import org.springframework.web.bind.annotation.PostMapping;
11
-import org.springframework.web.bind.annotation.RequestMapping;
12
-import org.springframework.web.bind.annotation.RestController;
13
-import com.ruoyi.common.annotation.Log;
14
-import com.ruoyi.common.core.controller.BaseController;
15
-import com.ruoyi.common.core.domain.AjaxResult;
16
-import com.ruoyi.common.core.page.TableDataInfo;
17
-import com.ruoyi.common.enums.BusinessType;
18
-import com.ruoyi.common.utils.poi.ExcelUtil;
19
-import com.ruoyi.framework.web.service.SysPasswordService;
20
-import com.ruoyi.system.domain.SysLogininfor;
21
-import com.ruoyi.system.service.ISysLogininforService;
22
-
23
-/**
24
- * 系统访问记录
25
- * 
26
- * @author ruoyi
27
- */
28
-@RestController
29
-@RequestMapping("/monitor/logininfor")
30
-public class SysLogininforController extends BaseController
31
-{
32
-    @Autowired
33
-    private ISysLogininforService logininforService;
34
-
35
-    @Autowired
36
-    private SysPasswordService passwordService;
37
-
38
-    @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
39
-    @GetMapping("/list")
40
-    public TableDataInfo list(SysLogininfor logininfor)
41
-    {
42
-        startPage();
43
-        List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
44
-        return getDataTable(list);
45
-    }
46
-
47
-    @Log(title = "登录日志", businessType = BusinessType.EXPORT)
48
-    @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
49
-    @PostMapping("/export")
50
-    public void export(HttpServletResponse response, SysLogininfor logininfor)
51
-    {
52
-        List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
53
-        ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
54
-        util.exportExcel(response, list, "登录日志");
55
-    }
56
-
57
-    @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
58
-    @Log(title = "登录日志", businessType = BusinessType.DELETE)
59
-    @DeleteMapping("/{infoIds}")
60
-    public AjaxResult remove(@PathVariable Long[] infoIds)
61
-    {
62
-        return toAjax(logininforService.deleteLogininforByIds(infoIds));
63
-    }
64
-
65
-    @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
66
-    @Log(title = "登录日志", businessType = BusinessType.CLEAN)
67
-    @DeleteMapping("/clean")
68
-    public AjaxResult clean()
69
-    {
70
-        logininforService.cleanLogininfor();
71
-        return success();
72
-    }
73
-
74
-    @PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')")
75
-    @Log(title = "账户解锁", businessType = BusinessType.OTHER)
76
-    @GetMapping("/unlock/{userName}")
77
-    public AjaxResult unlock(@PathVariable("userName") String userName)
78
-    {
79
-        passwordService.clearLoginRecordCache(userName);
80
-        return success();
81
-    }
82
-}

+ 0
- 69
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java 파일 보기

@@ -1,69 +0,0 @@
1
-package com.ruoyi.web.controller.monitor;
2
-
3
-import java.util.List;
4
-import javax.servlet.http.HttpServletResponse;
5
-import org.springframework.beans.factory.annotation.Autowired;
6
-import org.springframework.security.access.prepost.PreAuthorize;
7
-import org.springframework.web.bind.annotation.DeleteMapping;
8
-import org.springframework.web.bind.annotation.GetMapping;
9
-import org.springframework.web.bind.annotation.PathVariable;
10
-import org.springframework.web.bind.annotation.PostMapping;
11
-import org.springframework.web.bind.annotation.RequestMapping;
12
-import org.springframework.web.bind.annotation.RestController;
13
-import com.ruoyi.common.annotation.Log;
14
-import com.ruoyi.common.core.controller.BaseController;
15
-import com.ruoyi.common.core.domain.AjaxResult;
16
-import com.ruoyi.common.core.page.TableDataInfo;
17
-import com.ruoyi.common.enums.BusinessType;
18
-import com.ruoyi.common.utils.poi.ExcelUtil;
19
-import com.ruoyi.system.domain.SysOperLog;
20
-import com.ruoyi.system.service.ISysOperLogService;
21
-
22
-/**
23
- * 操作日志记录
24
- * 
25
- * @author ruoyi
26
- */
27
-@RestController
28
-@RequestMapping("/monitor/operlog")
29
-public class SysOperlogController extends BaseController
30
-{
31
-    @Autowired
32
-    private ISysOperLogService operLogService;
33
-
34
-    @PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
35
-    @GetMapping("/list")
36
-    public TableDataInfo list(SysOperLog operLog)
37
-    {
38
-        startPage();
39
-        List<SysOperLog> list = operLogService.selectOperLogList(operLog);
40
-        return getDataTable(list);
41
-    }
42
-
43
-    @Log(title = "操作日志", businessType = BusinessType.EXPORT)
44
-    @PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
45
-    @PostMapping("/export")
46
-    public void export(HttpServletResponse response, SysOperLog operLog)
47
-    {
48
-        List<SysOperLog> list = operLogService.selectOperLogList(operLog);
49
-        ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
50
-        util.exportExcel(response, list, "操作日志");
51
-    }
52
-
53
-    @Log(title = "操作日志", businessType = BusinessType.DELETE)
54
-    @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
55
-    @DeleteMapping("/{operIds}")
56
-    public AjaxResult remove(@PathVariable Long[] operIds)
57
-    {
58
-        return toAjax(operLogService.deleteOperLogByIds(operIds));
59
-    }
60
-
61
-    @Log(title = "操作日志", businessType = BusinessType.CLEAN)
62
-    @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
63
-    @DeleteMapping("/clean")
64
-    public AjaxResult clean()
65
-    {
66
-        operLogService.cleanOperLog();
67
-        return success();
68
-    }
69
-}

+ 0
- 83
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java 파일 보기

@@ -1,83 +0,0 @@
1
-package com.ruoyi.web.controller.monitor;
2
-
3
-import java.util.ArrayList;
4
-import java.util.Collection;
5
-import java.util.Collections;
6
-import java.util.List;
7
-import org.springframework.beans.factory.annotation.Autowired;
8
-import org.springframework.security.access.prepost.PreAuthorize;
9
-import org.springframework.web.bind.annotation.DeleteMapping;
10
-import org.springframework.web.bind.annotation.GetMapping;
11
-import org.springframework.web.bind.annotation.PathVariable;
12
-import org.springframework.web.bind.annotation.RequestMapping;
13
-import org.springframework.web.bind.annotation.RestController;
14
-import com.ruoyi.common.annotation.Log;
15
-import com.ruoyi.common.constant.CacheConstants;
16
-import com.ruoyi.common.core.controller.BaseController;
17
-import com.ruoyi.common.core.domain.AjaxResult;
18
-import com.ruoyi.common.core.domain.model.LoginUser;
19
-import com.ruoyi.common.core.page.TableDataInfo;
20
-import com.ruoyi.common.core.redis.RedisCache;
21
-import com.ruoyi.common.enums.BusinessType;
22
-import com.ruoyi.common.utils.StringUtils;
23
-import com.ruoyi.system.domain.SysUserOnline;
24
-import com.ruoyi.system.service.ISysUserOnlineService;
25
-
26
-/**
27
- * 在线用户监控
28
- * 
29
- * @author ruoyi
30
- */
31
-@RestController
32
-@RequestMapping("/monitor/online")
33
-public class SysUserOnlineController extends BaseController
34
-{
35
-    @Autowired
36
-    private ISysUserOnlineService userOnlineService;
37
-
38
-    @Autowired
39
-    private RedisCache redisCache;
40
-
41
-    @PreAuthorize("@ss.hasPermi('monitor:online:list')")
42
-    @GetMapping("/list")
43
-    public TableDataInfo list(String ipaddr, String userName)
44
-    {
45
-        Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*");
46
-        List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
47
-        for (String key : keys)
48
-        {
49
-            LoginUser user = redisCache.getCacheObject(key);
50
-            if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName))
51
-            {
52
-                userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
53
-            }
54
-            else if (StringUtils.isNotEmpty(ipaddr))
55
-            {
56
-                userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
57
-            }
58
-            else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser()))
59
-            {
60
-                userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
61
-            }
62
-            else
63
-            {
64
-                userOnlineList.add(userOnlineService.loginUserToUserOnline(user));
65
-            }
66
-        }
67
-        Collections.reverse(userOnlineList);
68
-        userOnlineList.removeAll(Collections.singleton(null));
69
-        return getDataTable(userOnlineList);
70
-    }
71
-
72
-    /**
73
-     * 强退用户
74
-     */
75
-    @PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
76
-    @Log(title = "在线用户", businessType = BusinessType.FORCE)
77
-    @DeleteMapping("/{tokenId}")
78
-    public AjaxResult forceLogout(@PathVariable String tokenId)
79
-    {
80
-        redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId);
81
-        return success();
82
-    }
83
-}

+ 0
- 133
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java 파일 보기

@@ -1,133 +0,0 @@
1
-package com.ruoyi.web.controller.system;
2
-
3
-import java.util.List;
4
-import javax.servlet.http.HttpServletResponse;
5
-import org.springframework.beans.factory.annotation.Autowired;
6
-import org.springframework.security.access.prepost.PreAuthorize;
7
-import org.springframework.validation.annotation.Validated;
8
-import org.springframework.web.bind.annotation.DeleteMapping;
9
-import org.springframework.web.bind.annotation.GetMapping;
10
-import org.springframework.web.bind.annotation.PathVariable;
11
-import org.springframework.web.bind.annotation.PostMapping;
12
-import org.springframework.web.bind.annotation.PutMapping;
13
-import org.springframework.web.bind.annotation.RequestBody;
14
-import org.springframework.web.bind.annotation.RequestMapping;
15
-import org.springframework.web.bind.annotation.RestController;
16
-import com.ruoyi.common.annotation.Log;
17
-import com.ruoyi.common.core.controller.BaseController;
18
-import com.ruoyi.common.core.domain.AjaxResult;
19
-import com.ruoyi.common.core.page.TableDataInfo;
20
-import com.ruoyi.common.enums.BusinessType;
21
-import com.ruoyi.common.utils.poi.ExcelUtil;
22
-import com.ruoyi.system.domain.SysConfig;
23
-import com.ruoyi.system.service.ISysConfigService;
24
-
25
-/**
26
- * 参数配置 信息操作处理
27
- * 
28
- * @author ruoyi
29
- */
30
-@RestController
31
-@RequestMapping("/system/config")
32
-public class SysConfigController extends BaseController
33
-{
34
-    @Autowired
35
-    private ISysConfigService configService;
36
-
37
-    /**
38
-     * 获取参数配置列表
39
-     */
40
-    @PreAuthorize("@ss.hasPermi('system:config:list')")
41
-    @GetMapping("/list")
42
-    public TableDataInfo list(SysConfig config)
43
-    {
44
-        startPage();
45
-        List<SysConfig> list = configService.selectConfigList(config);
46
-        return getDataTable(list);
47
-    }
48
-
49
-    @Log(title = "参数管理", businessType = BusinessType.EXPORT)
50
-    @PreAuthorize("@ss.hasPermi('system:config:export')")
51
-    @PostMapping("/export")
52
-    public void export(HttpServletResponse response, SysConfig config)
53
-    {
54
-        List<SysConfig> list = configService.selectConfigList(config);
55
-        ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
56
-        util.exportExcel(response, list, "参数数据");
57
-    }
58
-
59
-    /**
60
-     * 根据参数编号获取详细信息
61
-     */
62
-    @PreAuthorize("@ss.hasPermi('system:config:query')")
63
-    @GetMapping(value = "/{configId}")
64
-    public AjaxResult getInfo(@PathVariable Long configId)
65
-    {
66
-        return success(configService.selectConfigById(configId));
67
-    }
68
-
69
-    /**
70
-     * 根据参数键名查询参数值
71
-     */
72
-    @GetMapping(value = "/configKey/{configKey}")
73
-    public AjaxResult getConfigKey(@PathVariable String configKey)
74
-    {
75
-        return success(configService.selectConfigByKey(configKey));
76
-    }
77
-
78
-    /**
79
-     * 新增参数配置
80
-     */
81
-    @PreAuthorize("@ss.hasPermi('system:config:add')")
82
-    @Log(title = "参数管理", businessType = BusinessType.INSERT)
83
-    @PostMapping
84
-    public AjaxResult add(@Validated @RequestBody SysConfig config)
85
-    {
86
-        if (!configService.checkConfigKeyUnique(config))
87
-        {
88
-            return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
89
-        }
90
-        config.setCreateBy(getUsername());
91
-        return toAjax(configService.insertConfig(config));
92
-    }
93
-
94
-    /**
95
-     * 修改参数配置
96
-     */
97
-    @PreAuthorize("@ss.hasPermi('system:config:edit')")
98
-    @Log(title = "参数管理", businessType = BusinessType.UPDATE)
99
-    @PutMapping
100
-    public AjaxResult edit(@Validated @RequestBody SysConfig config)
101
-    {
102
-        if (!configService.checkConfigKeyUnique(config))
103
-        {
104
-            return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
105
-        }
106
-        config.setUpdateBy(getUsername());
107
-        return toAjax(configService.updateConfig(config));
108
-    }
109
-
110
-    /**
111
-     * 删除参数配置
112
-     */
113
-    @PreAuthorize("@ss.hasPermi('system:config:remove')")
114
-    @Log(title = "参数管理", businessType = BusinessType.DELETE)
115
-    @DeleteMapping("/{configIds}")
116
-    public AjaxResult remove(@PathVariable Long[] configIds)
117
-    {
118
-        configService.deleteConfigByIds(configIds);
119
-        return success();
120
-    }
121
-
122
-    /**
123
-     * 刷新参数缓存
124
-     */
125
-    @PreAuthorize("@ss.hasPermi('system:config:remove')")
126
-    @Log(title = "参数管理", businessType = BusinessType.CLEAN)
127
-    @DeleteMapping("/refreshCache")
128
-    public AjaxResult refreshCache()
129
-    {
130
-        configService.resetConfigCache();
131
-        return success();
132
-    }
133
-}

+ 0
- 132
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java 파일 보기

@@ -1,132 +0,0 @@
1
-package com.ruoyi.web.controller.system;
2
-
3
-import java.util.List;
4
-import org.apache.commons.lang3.ArrayUtils;
5
-import org.springframework.beans.factory.annotation.Autowired;
6
-import org.springframework.security.access.prepost.PreAuthorize;
7
-import org.springframework.validation.annotation.Validated;
8
-import org.springframework.web.bind.annotation.DeleteMapping;
9
-import org.springframework.web.bind.annotation.GetMapping;
10
-import org.springframework.web.bind.annotation.PathVariable;
11
-import org.springframework.web.bind.annotation.PostMapping;
12
-import org.springframework.web.bind.annotation.PutMapping;
13
-import org.springframework.web.bind.annotation.RequestBody;
14
-import org.springframework.web.bind.annotation.RequestMapping;
15
-import org.springframework.web.bind.annotation.RestController;
16
-import com.ruoyi.common.annotation.Log;
17
-import com.ruoyi.common.constant.UserConstants;
18
-import com.ruoyi.common.core.controller.BaseController;
19
-import com.ruoyi.common.core.domain.AjaxResult;
20
-import com.ruoyi.common.core.domain.entity.SysDept;
21
-import com.ruoyi.common.enums.BusinessType;
22
-import com.ruoyi.common.utils.StringUtils;
23
-import com.ruoyi.system.service.ISysDeptService;
24
-
25
-/**
26
- * 部门信息
27
- * 
28
- * @author ruoyi
29
- */
30
-@RestController
31
-@RequestMapping("/system/dept")
32
-public class SysDeptController extends BaseController
33
-{
34
-    @Autowired
35
-    private ISysDeptService deptService;
36
-
37
-    /**
38
-     * 获取部门列表
39
-     */
40
-    @PreAuthorize("@ss.hasPermi('system:dept:list')")
41
-    @GetMapping("/list")
42
-    public AjaxResult list(SysDept dept)
43
-    {
44
-        List<SysDept> depts = deptService.selectDeptList(dept);
45
-        return success(depts);
46
-    }
47
-
48
-    /**
49
-     * 查询部门列表(排除节点)
50
-     */
51
-    @PreAuthorize("@ss.hasPermi('system:dept:list')")
52
-    @GetMapping("/list/exclude/{deptId}")
53
-    public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
54
-    {
55
-        List<SysDept> depts = deptService.selectDeptList(new SysDept());
56
-        depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
57
-        return success(depts);
58
-    }
59
-
60
-    /**
61
-     * 根据部门编号获取详细信息
62
-     */
63
-    @PreAuthorize("@ss.hasPermi('system:dept:query')")
64
-    @GetMapping(value = "/{deptId}")
65
-    public AjaxResult getInfo(@PathVariable Long deptId)
66
-    {
67
-        deptService.checkDeptDataScope(deptId);
68
-        return success(deptService.selectDeptById(deptId));
69
-    }
70
-
71
-    /**
72
-     * 新增部门
73
-     */
74
-    @PreAuthorize("@ss.hasPermi('system:dept:add')")
75
-    @Log(title = "部门管理", businessType = BusinessType.INSERT)
76
-    @PostMapping
77
-    public AjaxResult add(@Validated @RequestBody SysDept dept)
78
-    {
79
-        if (!deptService.checkDeptNameUnique(dept))
80
-        {
81
-            return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
82
-        }
83
-        dept.setCreateBy(getUsername());
84
-        return toAjax(deptService.insertDept(dept));
85
-    }
86
-
87
-    /**
88
-     * 修改部门
89
-     */
90
-    @PreAuthorize("@ss.hasPermi('system:dept:edit')")
91
-    @Log(title = "部门管理", businessType = BusinessType.UPDATE)
92
-    @PutMapping
93
-    public AjaxResult edit(@Validated @RequestBody SysDept dept)
94
-    {
95
-        Long deptId = dept.getDeptId();
96
-        deptService.checkDeptDataScope(deptId);
97
-        if (!deptService.checkDeptNameUnique(dept))
98
-        {
99
-            return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
100
-        }
101
-        else if (dept.getParentId().equals(deptId))
102
-        {
103
-            return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
104
-        }
105
-        else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0)
106
-        {
107
-            return error("该部门包含未停用的子部门!");
108
-        }
109
-        dept.setUpdateBy(getUsername());
110
-        return toAjax(deptService.updateDept(dept));
111
-    }
112
-
113
-    /**
114
-     * 删除部门
115
-     */
116
-    @PreAuthorize("@ss.hasPermi('system:dept:remove')")
117
-    @Log(title = "部门管理", businessType = BusinessType.DELETE)
118
-    @DeleteMapping("/{deptId}")
119
-    public AjaxResult remove(@PathVariable Long deptId)
120
-    {
121
-        if (deptService.hasChildByDeptId(deptId))
122
-        {
123
-            return warn("存在下级部门,不允许删除");
124
-        }
125
-        if (deptService.checkDeptExistUser(deptId))
126
-        {
127
-            return warn("部门存在用户,不允许删除");
128
-        }
129
-        deptService.checkDeptDataScope(deptId);
130
-        return toAjax(deptService.deleteDeptById(deptId));
131
-    }
132
-}

+ 0
- 121
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java 파일 보기

@@ -1,121 +0,0 @@
1
-package com.ruoyi.web.controller.system;
2
-
3
-import java.util.ArrayList;
4
-import java.util.List;
5
-import javax.servlet.http.HttpServletResponse;
6
-import org.springframework.beans.factory.annotation.Autowired;
7
-import org.springframework.security.access.prepost.PreAuthorize;
8
-import org.springframework.validation.annotation.Validated;
9
-import org.springframework.web.bind.annotation.DeleteMapping;
10
-import org.springframework.web.bind.annotation.GetMapping;
11
-import org.springframework.web.bind.annotation.PathVariable;
12
-import org.springframework.web.bind.annotation.PostMapping;
13
-import org.springframework.web.bind.annotation.PutMapping;
14
-import org.springframework.web.bind.annotation.RequestBody;
15
-import org.springframework.web.bind.annotation.RequestMapping;
16
-import org.springframework.web.bind.annotation.RestController;
17
-import com.ruoyi.common.annotation.Log;
18
-import com.ruoyi.common.core.controller.BaseController;
19
-import com.ruoyi.common.core.domain.AjaxResult;
20
-import com.ruoyi.common.core.domain.entity.SysDictData;
21
-import com.ruoyi.common.core.page.TableDataInfo;
22
-import com.ruoyi.common.enums.BusinessType;
23
-import com.ruoyi.common.utils.StringUtils;
24
-import com.ruoyi.common.utils.poi.ExcelUtil;
25
-import com.ruoyi.system.service.ISysDictDataService;
26
-import com.ruoyi.system.service.ISysDictTypeService;
27
-
28
-/**
29
- * 数据字典信息
30
- * 
31
- * @author ruoyi
32
- */
33
-@RestController
34
-@RequestMapping("/system/dict/data")
35
-public class SysDictDataController extends BaseController
36
-{
37
-    @Autowired
38
-    private ISysDictDataService dictDataService;
39
-
40
-    @Autowired
41
-    private ISysDictTypeService dictTypeService;
42
-
43
-    @PreAuthorize("@ss.hasPermi('system:dict:list')")
44
-    @GetMapping("/list")
45
-    public TableDataInfo list(SysDictData dictData)
46
-    {
47
-        startPage();
48
-        List<SysDictData> list = dictDataService.selectDictDataList(dictData);
49
-        return getDataTable(list);
50
-    }
51
-
52
-    @Log(title = "字典数据", businessType = BusinessType.EXPORT)
53
-    @PreAuthorize("@ss.hasPermi('system:dict:export')")
54
-    @PostMapping("/export")
55
-    public void export(HttpServletResponse response, SysDictData dictData)
56
-    {
57
-        List<SysDictData> list = dictDataService.selectDictDataList(dictData);
58
-        ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
59
-        util.exportExcel(response, list, "字典数据");
60
-    }
61
-
62
-    /**
63
-     * 查询字典数据详细
64
-     */
65
-    @PreAuthorize("@ss.hasPermi('system:dict:query')")
66
-    @GetMapping(value = "/{dictCode}")
67
-    public AjaxResult getInfo(@PathVariable Long dictCode)
68
-    {
69
-        return success(dictDataService.selectDictDataById(dictCode));
70
-    }
71
-
72
-    /**
73
-     * 根据字典类型查询字典数据信息
74
-     */
75
-    @GetMapping(value = "/type/{dictType}")
76
-    public AjaxResult dictType(@PathVariable String dictType)
77
-    {
78
-        List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
79
-        if (StringUtils.isNull(data))
80
-        {
81
-            data = new ArrayList<SysDictData>();
82
-        }
83
-        return success(data);
84
-    }
85
-
86
-    /**
87
-     * 新增字典类型
88
-     */
89
-    @PreAuthorize("@ss.hasPermi('system:dict:add')")
90
-    @Log(title = "字典数据", businessType = BusinessType.INSERT)
91
-    @PostMapping
92
-    public AjaxResult add(@Validated @RequestBody SysDictData dict)
93
-    {
94
-        dict.setCreateBy(getUsername());
95
-        return toAjax(dictDataService.insertDictData(dict));
96
-    }
97
-
98
-    /**
99
-     * 修改保存字典类型
100
-     */
101
-    @PreAuthorize("@ss.hasPermi('system:dict:edit')")
102
-    @Log(title = "字典数据", businessType = BusinessType.UPDATE)
103
-    @PutMapping
104
-    public AjaxResult edit(@Validated @RequestBody SysDictData dict)
105
-    {
106
-        dict.setUpdateBy(getUsername());
107
-        return toAjax(dictDataService.updateDictData(dict));
108
-    }
109
-
110
-    /**
111
-     * 删除字典类型
112
-     */
113
-    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
114
-    @Log(title = "字典类型", businessType = BusinessType.DELETE)
115
-    @DeleteMapping("/{dictCodes}")
116
-    public AjaxResult remove(@PathVariable Long[] dictCodes)
117
-    {
118
-        dictDataService.deleteDictDataByIds(dictCodes);
119
-        return success();
120
-    }
121
-}

+ 0
- 131
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java 파일 보기

@@ -1,131 +0,0 @@
1
-package com.ruoyi.web.controller.system;
2
-
3
-import java.util.List;
4
-import javax.servlet.http.HttpServletResponse;
5
-import org.springframework.beans.factory.annotation.Autowired;
6
-import org.springframework.security.access.prepost.PreAuthorize;
7
-import org.springframework.validation.annotation.Validated;
8
-import org.springframework.web.bind.annotation.DeleteMapping;
9
-import org.springframework.web.bind.annotation.GetMapping;
10
-import org.springframework.web.bind.annotation.PathVariable;
11
-import org.springframework.web.bind.annotation.PostMapping;
12
-import org.springframework.web.bind.annotation.PutMapping;
13
-import org.springframework.web.bind.annotation.RequestBody;
14
-import org.springframework.web.bind.annotation.RequestMapping;
15
-import org.springframework.web.bind.annotation.RestController;
16
-import com.ruoyi.common.annotation.Log;
17
-import com.ruoyi.common.core.controller.BaseController;
18
-import com.ruoyi.common.core.domain.AjaxResult;
19
-import com.ruoyi.common.core.domain.entity.SysDictType;
20
-import com.ruoyi.common.core.page.TableDataInfo;
21
-import com.ruoyi.common.enums.BusinessType;
22
-import com.ruoyi.common.utils.poi.ExcelUtil;
23
-import com.ruoyi.system.service.ISysDictTypeService;
24
-
25
-/**
26
- * 数据字典信息
27
- * 
28
- * @author ruoyi
29
- */
30
-@RestController
31
-@RequestMapping("/system/dict/type")
32
-public class SysDictTypeController extends BaseController
33
-{
34
-    @Autowired
35
-    private ISysDictTypeService dictTypeService;
36
-
37
-    @PreAuthorize("@ss.hasPermi('system:dict:list')")
38
-    @GetMapping("/list")
39
-    public TableDataInfo list(SysDictType dictType)
40
-    {
41
-        startPage();
42
-        List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
43
-        return getDataTable(list);
44
-    }
45
-
46
-    @Log(title = "字典类型", businessType = BusinessType.EXPORT)
47
-    @PreAuthorize("@ss.hasPermi('system:dict:export')")
48
-    @PostMapping("/export")
49
-    public void export(HttpServletResponse response, SysDictType dictType)
50
-    {
51
-        List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
52
-        ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
53
-        util.exportExcel(response, list, "字典类型");
54
-    }
55
-
56
-    /**
57
-     * 查询字典类型详细
58
-     */
59
-    @PreAuthorize("@ss.hasPermi('system:dict:query')")
60
-    @GetMapping(value = "/{dictId}")
61
-    public AjaxResult getInfo(@PathVariable Long dictId)
62
-    {
63
-        return success(dictTypeService.selectDictTypeById(dictId));
64
-    }
65
-
66
-    /**
67
-     * 新增字典类型
68
-     */
69
-    @PreAuthorize("@ss.hasPermi('system:dict:add')")
70
-    @Log(title = "字典类型", businessType = BusinessType.INSERT)
71
-    @PostMapping
72
-    public AjaxResult add(@Validated @RequestBody SysDictType dict)
73
-    {
74
-        if (!dictTypeService.checkDictTypeUnique(dict))
75
-        {
76
-            return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
77
-        }
78
-        dict.setCreateBy(getUsername());
79
-        return toAjax(dictTypeService.insertDictType(dict));
80
-    }
81
-
82
-    /**
83
-     * 修改字典类型
84
-     */
85
-    @PreAuthorize("@ss.hasPermi('system:dict:edit')")
86
-    @Log(title = "字典类型", businessType = BusinessType.UPDATE)
87
-    @PutMapping
88
-    public AjaxResult edit(@Validated @RequestBody SysDictType dict)
89
-    {
90
-        if (!dictTypeService.checkDictTypeUnique(dict))
91
-        {
92
-            return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
93
-        }
94
-        dict.setUpdateBy(getUsername());
95
-        return toAjax(dictTypeService.updateDictType(dict));
96
-    }
97
-
98
-    /**
99
-     * 删除字典类型
100
-     */
101
-    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
102
-    @Log(title = "字典类型", businessType = BusinessType.DELETE)
103
-    @DeleteMapping("/{dictIds}")
104
-    public AjaxResult remove(@PathVariable Long[] dictIds)
105
-    {
106
-        dictTypeService.deleteDictTypeByIds(dictIds);
107
-        return success();
108
-    }
109
-
110
-    /**
111
-     * 刷新字典缓存
112
-     */
113
-    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
114
-    @Log(title = "字典类型", businessType = BusinessType.CLEAN)
115
-    @DeleteMapping("/refreshCache")
116
-    public AjaxResult refreshCache()
117
-    {
118
-        dictTypeService.resetDictCache();
119
-        return success();
120
-    }
121
-
122
-    /**
123
-     * 获取字典选择框列表
124
-     */
125
-    @GetMapping("/optionselect")
126
-    public AjaxResult optionselect()
127
-    {
128
-        List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
129
-        return success(dictTypes);
130
-    }
131
-}

+ 0
- 29
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java 파일 보기

@@ -1,29 +0,0 @@
1
-package com.ruoyi.web.controller.system;
2
-
3
-import org.springframework.beans.factory.annotation.Autowired;
4
-import org.springframework.web.bind.annotation.RequestMapping;
5
-import org.springframework.web.bind.annotation.RestController;
6
-import com.ruoyi.common.config.RuoYiConfig;
7
-import com.ruoyi.common.utils.StringUtils;
8
-
9
-/**
10
- * 首页
11
- *
12
- * @author ruoyi
13
- */
14
-@RestController
15
-public class SysIndexController
16
-{
17
-    /** 系统基础配置 */
18
-    @Autowired
19
-    private RuoYiConfig ruoyiConfig;
20
-
21
-    /**
22
-     * 访问首页,提示语
23
-     */
24
-    @RequestMapping("/")
25
-    public String index()
26
-    {
27
-        return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
28
-    }
29
-}

+ 0
- 86
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java 파일 보기

@@ -1,86 +0,0 @@
1
-package com.ruoyi.web.controller.system;
2
-
3
-import java.util.List;
4
-import java.util.Set;
5
-import org.springframework.beans.factory.annotation.Autowired;
6
-import org.springframework.web.bind.annotation.GetMapping;
7
-import org.springframework.web.bind.annotation.PostMapping;
8
-import org.springframework.web.bind.annotation.RequestBody;
9
-import org.springframework.web.bind.annotation.RestController;
10
-import com.ruoyi.common.constant.Constants;
11
-import com.ruoyi.common.core.domain.AjaxResult;
12
-import com.ruoyi.common.core.domain.entity.SysMenu;
13
-import com.ruoyi.common.core.domain.entity.SysUser;
14
-import com.ruoyi.common.core.domain.model.LoginBody;
15
-import com.ruoyi.common.utils.SecurityUtils;
16
-import com.ruoyi.framework.web.service.SysLoginService;
17
-import com.ruoyi.framework.web.service.SysPermissionService;
18
-import com.ruoyi.system.service.ISysMenuService;
19
-
20
-/**
21
- * 登录验证
22
- * 
23
- * @author ruoyi
24
- */
25
-@RestController
26
-public class SysLoginController
27
-{
28
-    @Autowired
29
-    private SysLoginService loginService;
30
-
31
-    @Autowired
32
-    private ISysMenuService menuService;
33
-
34
-    @Autowired
35
-    private SysPermissionService permissionService;
36
-
37
-    /**
38
-     * 登录方法
39
-     * 
40
-     * @param loginBody 登录信息
41
-     * @return 结果
42
-     */
43
-    @PostMapping("/login")
44
-    public AjaxResult login(@RequestBody LoginBody loginBody)
45
-    {
46
-        AjaxResult ajax = AjaxResult.success();
47
-        // 生成令牌
48
-        String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
49
-                loginBody.getUuid());
50
-        ajax.put(Constants.TOKEN, token);
51
-        return ajax;
52
-    }
53
-
54
-    /**
55
-     * 获取用户信息
56
-     * 
57
-     * @return 用户信息
58
-     */
59
-    @GetMapping("getInfo")
60
-    public AjaxResult getInfo()
61
-    {
62
-        SysUser user = SecurityUtils.getLoginUser().getUser();
63
-        // 角色集合
64
-        Set<String> roles = permissionService.getRolePermission(user);
65
-        // 权限集合
66
-        Set<String> permissions = permissionService.getMenuPermission(user);
67
-        AjaxResult ajax = AjaxResult.success();
68
-        ajax.put("user", user);
69
-        ajax.put("roles", roles);
70
-        ajax.put("permissions", permissions);
71
-        return ajax;
72
-    }
73
-
74
-    /**
75
-     * 获取路由信息
76
-     * 
77
-     * @return 路由信息
78
-     */
79
-    @GetMapping("getRouters")
80
-    public AjaxResult getRouters()
81
-    {
82
-        Long userId = SecurityUtils.getUserId();
83
-        List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
84
-        return AjaxResult.success(menuService.buildMenus(menus));
85
-    }
86
-}

+ 0
- 142
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java 파일 보기

@@ -1,142 +0,0 @@
1
-package com.ruoyi.web.controller.system;
2
-
3
-import java.util.List;
4
-import org.springframework.beans.factory.annotation.Autowired;
5
-import org.springframework.security.access.prepost.PreAuthorize;
6
-import org.springframework.validation.annotation.Validated;
7
-import org.springframework.web.bind.annotation.DeleteMapping;
8
-import org.springframework.web.bind.annotation.GetMapping;
9
-import org.springframework.web.bind.annotation.PathVariable;
10
-import org.springframework.web.bind.annotation.PostMapping;
11
-import org.springframework.web.bind.annotation.PutMapping;
12
-import org.springframework.web.bind.annotation.RequestBody;
13
-import org.springframework.web.bind.annotation.RequestMapping;
14
-import org.springframework.web.bind.annotation.RestController;
15
-import com.ruoyi.common.annotation.Log;
16
-import com.ruoyi.common.constant.UserConstants;
17
-import com.ruoyi.common.core.controller.BaseController;
18
-import com.ruoyi.common.core.domain.AjaxResult;
19
-import com.ruoyi.common.core.domain.entity.SysMenu;
20
-import com.ruoyi.common.enums.BusinessType;
21
-import com.ruoyi.common.utils.StringUtils;
22
-import com.ruoyi.system.service.ISysMenuService;
23
-
24
-/**
25
- * 菜单信息
26
- * 
27
- * @author ruoyi
28
- */
29
-@RestController
30
-@RequestMapping("/system/menu")
31
-public class SysMenuController extends BaseController
32
-{
33
-    @Autowired
34
-    private ISysMenuService menuService;
35
-
36
-    /**
37
-     * 获取菜单列表
38
-     */
39
-    @PreAuthorize("@ss.hasPermi('system:menu:list')")
40
-    @GetMapping("/list")
41
-    public AjaxResult list(SysMenu menu)
42
-    {
43
-        List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
44
-        return success(menus);
45
-    }
46
-
47
-    /**
48
-     * 根据菜单编号获取详细信息
49
-     */
50
-    @PreAuthorize("@ss.hasPermi('system:menu:query')")
51
-    @GetMapping(value = "/{menuId}")
52
-    public AjaxResult getInfo(@PathVariable Long menuId)
53
-    {
54
-        return success(menuService.selectMenuById(menuId));
55
-    }
56
-
57
-    /**
58
-     * 获取菜单下拉树列表
59
-     */
60
-    @GetMapping("/treeselect")
61
-    public AjaxResult treeselect(SysMenu menu)
62
-    {
63
-        List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
64
-        return success(menuService.buildMenuTreeSelect(menus));
65
-    }
66
-
67
-    /**
68
-     * 加载对应角色菜单列表树
69
-     */
70
-    @GetMapping(value = "/roleMenuTreeselect/{roleId}")
71
-    public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
72
-    {
73
-        List<SysMenu> menus = menuService.selectMenuList(getUserId());
74
-        AjaxResult ajax = AjaxResult.success();
75
-        ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
76
-        ajax.put("menus", menuService.buildMenuTreeSelect(menus));
77
-        return ajax;
78
-    }
79
-
80
-    /**
81
-     * 新增菜单
82
-     */
83
-    @PreAuthorize("@ss.hasPermi('system:menu:add')")
84
-    @Log(title = "菜单管理", businessType = BusinessType.INSERT)
85
-    @PostMapping
86
-    public AjaxResult add(@Validated @RequestBody SysMenu menu)
87
-    {
88
-        if (!menuService.checkMenuNameUnique(menu))
89
-        {
90
-            return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
91
-        }
92
-        else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
93
-        {
94
-            return error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
95
-        }
96
-        menu.setCreateBy(getUsername());
97
-        return toAjax(menuService.insertMenu(menu));
98
-    }
99
-
100
-    /**
101
-     * 修改菜单
102
-     */
103
-    @PreAuthorize("@ss.hasPermi('system:menu:edit')")
104
-    @Log(title = "菜单管理", businessType = BusinessType.UPDATE)
105
-    @PutMapping
106
-    public AjaxResult edit(@Validated @RequestBody SysMenu menu)
107
-    {
108
-        if (!menuService.checkMenuNameUnique(menu))
109
-        {
110
-            return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
111
-        }
112
-        else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
113
-        {
114
-            return error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
115
-        }
116
-        else if (menu.getMenuId().equals(menu.getParentId()))
117
-        {
118
-            return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
119
-        }
120
-        menu.setUpdateBy(getUsername());
121
-        return toAjax(menuService.updateMenu(menu));
122
-    }
123
-
124
-    /**
125
-     * 删除菜单
126
-     */
127
-    @PreAuthorize("@ss.hasPermi('system:menu:remove')")
128
-    @Log(title = "菜单管理", businessType = BusinessType.DELETE)
129
-    @DeleteMapping("/{menuId}")
130
-    public AjaxResult remove(@PathVariable("menuId") Long menuId)
131
-    {
132
-        if (menuService.hasChildByMenuId(menuId))
133
-        {
134
-            return warn("存在子菜单,不允许删除");
135
-        }
136
-        if (menuService.checkMenuExistRole(menuId))
137
-        {
138
-            return warn("菜单已分配,不允许删除");
139
-        }
140
-        return toAjax(menuService.deleteMenuById(menuId));
141
-    }
142
-}

+ 0
- 91
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java 파일 보기

@@ -1,91 +0,0 @@
1
-package com.ruoyi.web.controller.system;
2
-
3
-import java.util.List;
4
-import org.springframework.beans.factory.annotation.Autowired;
5
-import org.springframework.security.access.prepost.PreAuthorize;
6
-import org.springframework.validation.annotation.Validated;
7
-import org.springframework.web.bind.annotation.DeleteMapping;
8
-import org.springframework.web.bind.annotation.GetMapping;
9
-import org.springframework.web.bind.annotation.PathVariable;
10
-import org.springframework.web.bind.annotation.PostMapping;
11
-import org.springframework.web.bind.annotation.PutMapping;
12
-import org.springframework.web.bind.annotation.RequestBody;
13
-import org.springframework.web.bind.annotation.RequestMapping;
14
-import org.springframework.web.bind.annotation.RestController;
15
-import com.ruoyi.common.annotation.Log;
16
-import com.ruoyi.common.core.controller.BaseController;
17
-import com.ruoyi.common.core.domain.AjaxResult;
18
-import com.ruoyi.common.core.page.TableDataInfo;
19
-import com.ruoyi.common.enums.BusinessType;
20
-import com.ruoyi.system.domain.SysNotice;
21
-import com.ruoyi.system.service.ISysNoticeService;
22
-
23
-/**
24
- * 公告 信息操作处理
25
- * 
26
- * @author ruoyi
27
- */
28
-@RestController
29
-@RequestMapping("/system/notice")
30
-public class SysNoticeController extends BaseController
31
-{
32
-    @Autowired
33
-    private ISysNoticeService noticeService;
34
-
35
-    /**
36
-     * 获取通知公告列表
37
-     */
38
-    @PreAuthorize("@ss.hasPermi('system:notice:list')")
39
-    @GetMapping("/list")
40
-    public TableDataInfo list(SysNotice notice)
41
-    {
42
-        startPage();
43
-        List<SysNotice> list = noticeService.selectNoticeList(notice);
44
-        return getDataTable(list);
45
-    }
46
-
47
-    /**
48
-     * 根据通知公告编号获取详细信息
49
-     */
50
-    @PreAuthorize("@ss.hasPermi('system:notice:query')")
51
-    @GetMapping(value = "/{noticeId}")
52
-    public AjaxResult getInfo(@PathVariable Long noticeId)
53
-    {
54
-        return success(noticeService.selectNoticeById(noticeId));
55
-    }
56
-
57
-    /**
58
-     * 新增通知公告
59
-     */
60
-    @PreAuthorize("@ss.hasPermi('system:notice:add')")
61
-    @Log(title = "通知公告", businessType = BusinessType.INSERT)
62
-    @PostMapping
63
-    public AjaxResult add(@Validated @RequestBody SysNotice notice)
64
-    {
65
-        notice.setCreateBy(getUsername());
66
-        return toAjax(noticeService.insertNotice(notice));
67
-    }
68
-
69
-    /**
70
-     * 修改通知公告
71
-     */
72
-    @PreAuthorize("@ss.hasPermi('system:notice:edit')")
73
-    @Log(title = "通知公告", businessType = BusinessType.UPDATE)
74
-    @PutMapping
75
-    public AjaxResult edit(@Validated @RequestBody SysNotice notice)
76
-    {
77
-        notice.setUpdateBy(getUsername());
78
-        return toAjax(noticeService.updateNotice(notice));
79
-    }
80
-
81
-    /**
82
-     * 删除通知公告
83
-     */
84
-    @PreAuthorize("@ss.hasPermi('system:notice:remove')")
85
-    @Log(title = "通知公告", businessType = BusinessType.DELETE)
86
-    @DeleteMapping("/{noticeIds}")
87
-    public AjaxResult remove(@PathVariable Long[] noticeIds)
88
-    {
89
-        return toAjax(noticeService.deleteNoticeByIds(noticeIds));
90
-    }
91
-}

+ 0
- 129
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java 파일 보기

@@ -1,129 +0,0 @@
1
-package com.ruoyi.web.controller.system;
2
-
3
-import java.util.List;
4
-import javax.servlet.http.HttpServletResponse;
5
-import org.springframework.beans.factory.annotation.Autowired;
6
-import org.springframework.security.access.prepost.PreAuthorize;
7
-import org.springframework.validation.annotation.Validated;
8
-import org.springframework.web.bind.annotation.DeleteMapping;
9
-import org.springframework.web.bind.annotation.GetMapping;
10
-import org.springframework.web.bind.annotation.PathVariable;
11
-import org.springframework.web.bind.annotation.PostMapping;
12
-import org.springframework.web.bind.annotation.PutMapping;
13
-import org.springframework.web.bind.annotation.RequestBody;
14
-import org.springframework.web.bind.annotation.RequestMapping;
15
-import org.springframework.web.bind.annotation.RestController;
16
-import com.ruoyi.common.annotation.Log;
17
-import com.ruoyi.common.core.controller.BaseController;
18
-import com.ruoyi.common.core.domain.AjaxResult;
19
-import com.ruoyi.common.core.page.TableDataInfo;
20
-import com.ruoyi.common.enums.BusinessType;
21
-import com.ruoyi.common.utils.poi.ExcelUtil;
22
-import com.ruoyi.system.domain.SysPost;
23
-import com.ruoyi.system.service.ISysPostService;
24
-
25
-/**
26
- * 岗位信息操作处理
27
- * 
28
- * @author ruoyi
29
- */
30
-@RestController
31
-@RequestMapping("/system/post")
32
-public class SysPostController extends BaseController
33
-{
34
-    @Autowired
35
-    private ISysPostService postService;
36
-
37
-    /**
38
-     * 获取岗位列表
39
-     */
40
-    @PreAuthorize("@ss.hasPermi('system:post:list')")
41
-    @GetMapping("/list")
42
-    public TableDataInfo list(SysPost post)
43
-    {
44
-        startPage();
45
-        List<SysPost> list = postService.selectPostList(post);
46
-        return getDataTable(list);
47
-    }
48
-    
49
-    @Log(title = "岗位管理", businessType = BusinessType.EXPORT)
50
-    @PreAuthorize("@ss.hasPermi('system:post:export')")
51
-    @PostMapping("/export")
52
-    public void export(HttpServletResponse response, SysPost post)
53
-    {
54
-        List<SysPost> list = postService.selectPostList(post);
55
-        ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
56
-        util.exportExcel(response, list, "岗位数据");
57
-    }
58
-
59
-    /**
60
-     * 根据岗位编号获取详细信息
61
-     */
62
-    @PreAuthorize("@ss.hasPermi('system:post:query')")
63
-    @GetMapping(value = "/{postId}")
64
-    public AjaxResult getInfo(@PathVariable Long postId)
65
-    {
66
-        return success(postService.selectPostById(postId));
67
-    }
68
-
69
-    /**
70
-     * 新增岗位
71
-     */
72
-    @PreAuthorize("@ss.hasPermi('system:post:add')")
73
-    @Log(title = "岗位管理", businessType = BusinessType.INSERT)
74
-    @PostMapping
75
-    public AjaxResult add(@Validated @RequestBody SysPost post)
76
-    {
77
-        if (!postService.checkPostNameUnique(post))
78
-        {
79
-            return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
80
-        }
81
-        else if (!postService.checkPostCodeUnique(post))
82
-        {
83
-            return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
84
-        }
85
-        post.setCreateBy(getUsername());
86
-        return toAjax(postService.insertPost(post));
87
-    }
88
-
89
-    /**
90
-     * 修改岗位
91
-     */
92
-    @PreAuthorize("@ss.hasPermi('system:post:edit')")
93
-    @Log(title = "岗位管理", businessType = BusinessType.UPDATE)
94
-    @PutMapping
95
-    public AjaxResult edit(@Validated @RequestBody SysPost post)
96
-    {
97
-        if (!postService.checkPostNameUnique(post))
98
-        {
99
-            return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
100
-        }
101
-        else if (!postService.checkPostCodeUnique(post))
102
-        {
103
-            return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
104
-        }
105
-        post.setUpdateBy(getUsername());
106
-        return toAjax(postService.updatePost(post));
107
-    }
108
-
109
-    /**
110
-     * 删除岗位
111
-     */
112
-    @PreAuthorize("@ss.hasPermi('system:post:remove')")
113
-    @Log(title = "岗位管理", businessType = BusinessType.DELETE)
114
-    @DeleteMapping("/{postIds}")
115
-    public AjaxResult remove(@PathVariable Long[] postIds)
116
-    {
117
-        return toAjax(postService.deletePostByIds(postIds));
118
-    }
119
-
120
-    /**
121
-     * 获取岗位选择框列表
122
-     */
123
-    @GetMapping("/optionselect")
124
-    public AjaxResult optionselect()
125
-    {
126
-        List<SysPost> posts = postService.selectPostAll();
127
-        return success(posts);
128
-    }
129
-}

+ 0
- 137
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java 파일 보기

@@ -1,137 +0,0 @@
1
-package com.ruoyi.web.controller.system;
2
-
3
-import org.springframework.beans.factory.annotation.Autowired;
4
-import org.springframework.web.bind.annotation.GetMapping;
5
-import org.springframework.web.bind.annotation.PostMapping;
6
-import org.springframework.web.bind.annotation.PutMapping;
7
-import org.springframework.web.bind.annotation.RequestBody;
8
-import org.springframework.web.bind.annotation.RequestMapping;
9
-import org.springframework.web.bind.annotation.RequestParam;
10
-import org.springframework.web.bind.annotation.RestController;
11
-import org.springframework.web.multipart.MultipartFile;
12
-import com.ruoyi.common.annotation.Log;
13
-import com.ruoyi.common.config.RuoYiConfig;
14
-import com.ruoyi.common.core.controller.BaseController;
15
-import com.ruoyi.common.core.domain.AjaxResult;
16
-import com.ruoyi.common.core.domain.entity.SysUser;
17
-import com.ruoyi.common.core.domain.model.LoginUser;
18
-import com.ruoyi.common.enums.BusinessType;
19
-import com.ruoyi.common.utils.SecurityUtils;
20
-import com.ruoyi.common.utils.StringUtils;
21
-import com.ruoyi.common.utils.file.FileUploadUtils;
22
-import com.ruoyi.common.utils.file.MimeTypeUtils;
23
-import com.ruoyi.framework.web.service.TokenService;
24
-import com.ruoyi.system.service.ISysUserService;
25
-
26
-/**
27
- * 个人信息 业务处理
28
- * 
29
- * @author ruoyi
30
- */
31
-@RestController
32
-@RequestMapping("/system/user/profile")
33
-public class SysProfileController extends BaseController
34
-{
35
-    @Autowired
36
-    private ISysUserService userService;
37
-
38
-    @Autowired
39
-    private TokenService tokenService;
40
-
41
-    /**
42
-     * 个人信息
43
-     */
44
-    @GetMapping
45
-    public AjaxResult profile()
46
-    {
47
-        LoginUser loginUser = getLoginUser();
48
-        SysUser user = loginUser.getUser();
49
-        AjaxResult ajax = AjaxResult.success(user);
50
-        ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
51
-        ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
52
-        return ajax;
53
-    }
54
-
55
-    /**
56
-     * 修改用户
57
-     */
58
-    @Log(title = "个人信息", businessType = BusinessType.UPDATE)
59
-    @PutMapping
60
-    public AjaxResult updateProfile(@RequestBody SysUser user)
61
-    {
62
-        LoginUser loginUser = getLoginUser();
63
-        SysUser currentUser = loginUser.getUser();
64
-        currentUser.setNickName(user.getNickName());
65
-        currentUser.setEmail(user.getEmail());
66
-        currentUser.setPhonenumber(user.getPhonenumber());
67
-        currentUser.setSex(user.getSex());
68
-        if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
69
-        {
70
-            return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在");
71
-        }
72
-        if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser))
73
-        {
74
-            return error("修改用户'" + loginUser.getUsername() + "'失败,邮箱账号已存在");
75
-        }
76
-        if (userService.updateUserProfile(currentUser) > 0)
77
-        {
78
-            // 更新缓存用户信息
79
-            tokenService.setLoginUser(loginUser);
80
-            return success();
81
-        }
82
-        return error("修改个人信息异常,请联系管理员");
83
-    }
84
-
85
-    /**
86
-     * 重置密码
87
-     */
88
-    @Log(title = "个人信息", businessType = BusinessType.UPDATE)
89
-    @PutMapping("/updatePwd")
90
-    public AjaxResult updatePwd(String oldPassword, String newPassword)
91
-    {
92
-        LoginUser loginUser = getLoginUser();
93
-        String userName = loginUser.getUsername();
94
-        String password = loginUser.getPassword();
95
-        if (!SecurityUtils.matchesPassword(oldPassword, password))
96
-        {
97
-            return error("修改密码失败,旧密码错误");
98
-        }
99
-        if (SecurityUtils.matchesPassword(newPassword, password))
100
-        {
101
-            return error("新密码不能与旧密码相同");
102
-        }
103
-        newPassword = SecurityUtils.encryptPassword(newPassword);
104
-        if (userService.resetUserPwd(userName, newPassword) > 0)
105
-        {
106
-            // 更新缓存用户密码
107
-            loginUser.getUser().setPassword(newPassword);
108
-            tokenService.setLoginUser(loginUser);
109
-            return success();
110
-        }
111
-        return error("修改密码异常,请联系管理员");
112
-    }
113
-
114
-    /**
115
-     * 头像上传
116
-     */
117
-    @Log(title = "用户头像", businessType = BusinessType.UPDATE)
118
-    @PostMapping("/avatar")
119
-    public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception
120
-    {
121
-        if (!file.isEmpty())
122
-        {
123
-            LoginUser loginUser = getLoginUser();
124
-            String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
125
-            if (userService.updateUserAvatar(loginUser.getUsername(), avatar))
126
-            {
127
-                AjaxResult ajax = AjaxResult.success();
128
-                ajax.put("imgUrl", avatar);
129
-                // 更新缓存用户头像
130
-                loginUser.getUser().setAvatar(avatar);
131
-                tokenService.setLoginUser(loginUser);
132
-                return ajax;
133
-            }
134
-        }
135
-        return error("上传图片异常,请联系管理员");
136
-    }
137
-}

+ 0
- 38
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java 파일 보기

@@ -1,38 +0,0 @@
1
-package com.ruoyi.web.controller.system;
2
-
3
-import org.springframework.beans.factory.annotation.Autowired;
4
-import org.springframework.web.bind.annotation.PostMapping;
5
-import org.springframework.web.bind.annotation.RequestBody;
6
-import org.springframework.web.bind.annotation.RestController;
7
-import com.ruoyi.common.core.controller.BaseController;
8
-import com.ruoyi.common.core.domain.AjaxResult;
9
-import com.ruoyi.common.core.domain.model.RegisterBody;
10
-import com.ruoyi.common.utils.StringUtils;
11
-import com.ruoyi.framework.web.service.SysRegisterService;
12
-import com.ruoyi.system.service.ISysConfigService;
13
-
14
-/**
15
- * 注册验证
16
- * 
17
- * @author ruoyi
18
- */
19
-@RestController
20
-public class SysRegisterController extends BaseController
21
-{
22
-    @Autowired
23
-    private SysRegisterService registerService;
24
-
25
-    @Autowired
26
-    private ISysConfigService configService;
27
-
28
-    @PostMapping("/register")
29
-    public AjaxResult register(@RequestBody RegisterBody user)
30
-    {
31
-        if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
32
-        {
33
-            return error("当前系统没有开启注册功能!");
34
-        }
35
-        String msg = registerService.register(user);
36
-        return StringUtils.isEmpty(msg) ? success() : error(msg);
37
-    }
38
-}

+ 0
- 262
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java 파일 보기

@@ -1,262 +0,0 @@
1
-package com.ruoyi.web.controller.system;
2
-
3
-import java.util.List;
4
-import javax.servlet.http.HttpServletResponse;
5
-import org.springframework.beans.factory.annotation.Autowired;
6
-import org.springframework.security.access.prepost.PreAuthorize;
7
-import org.springframework.validation.annotation.Validated;
8
-import org.springframework.web.bind.annotation.DeleteMapping;
9
-import org.springframework.web.bind.annotation.GetMapping;
10
-import org.springframework.web.bind.annotation.PathVariable;
11
-import org.springframework.web.bind.annotation.PostMapping;
12
-import org.springframework.web.bind.annotation.PutMapping;
13
-import org.springframework.web.bind.annotation.RequestBody;
14
-import org.springframework.web.bind.annotation.RequestMapping;
15
-import org.springframework.web.bind.annotation.RestController;
16
-import com.ruoyi.common.annotation.Log;
17
-import com.ruoyi.common.core.controller.BaseController;
18
-import com.ruoyi.common.core.domain.AjaxResult;
19
-import com.ruoyi.common.core.domain.entity.SysDept;
20
-import com.ruoyi.common.core.domain.entity.SysRole;
21
-import com.ruoyi.common.core.domain.entity.SysUser;
22
-import com.ruoyi.common.core.domain.model.LoginUser;
23
-import com.ruoyi.common.core.page.TableDataInfo;
24
-import com.ruoyi.common.enums.BusinessType;
25
-import com.ruoyi.common.utils.StringUtils;
26
-import com.ruoyi.common.utils.poi.ExcelUtil;
27
-import com.ruoyi.framework.web.service.SysPermissionService;
28
-import com.ruoyi.framework.web.service.TokenService;
29
-import com.ruoyi.system.domain.SysUserRole;
30
-import com.ruoyi.system.service.ISysDeptService;
31
-import com.ruoyi.system.service.ISysRoleService;
32
-import com.ruoyi.system.service.ISysUserService;
33
-
34
-/**
35
- * 角色信息
36
- * 
37
- * @author ruoyi
38
- */
39
-@RestController
40
-@RequestMapping("/system/role")
41
-public class SysRoleController extends BaseController
42
-{
43
-    @Autowired
44
-    private ISysRoleService roleService;
45
-
46
-    @Autowired
47
-    private TokenService tokenService;
48
-
49
-    @Autowired
50
-    private SysPermissionService permissionService;
51
-
52
-    @Autowired
53
-    private ISysUserService userService;
54
-
55
-    @Autowired
56
-    private ISysDeptService deptService;
57
-
58
-    @PreAuthorize("@ss.hasPermi('system:role:list')")
59
-    @GetMapping("/list")
60
-    public TableDataInfo list(SysRole role)
61
-    {
62
-        startPage();
63
-        List<SysRole> list = roleService.selectRoleList(role);
64
-        return getDataTable(list);
65
-    }
66
-
67
-    @Log(title = "角色管理", businessType = BusinessType.EXPORT)
68
-    @PreAuthorize("@ss.hasPermi('system:role:export')")
69
-    @PostMapping("/export")
70
-    public void export(HttpServletResponse response, SysRole role)
71
-    {
72
-        List<SysRole> list = roleService.selectRoleList(role);
73
-        ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
74
-        util.exportExcel(response, list, "角色数据");
75
-    }
76
-
77
-    /**
78
-     * 根据角色编号获取详细信息
79
-     */
80
-    @PreAuthorize("@ss.hasPermi('system:role:query')")
81
-    @GetMapping(value = "/{roleId}")
82
-    public AjaxResult getInfo(@PathVariable Long roleId)
83
-    {
84
-        roleService.checkRoleDataScope(roleId);
85
-        return success(roleService.selectRoleById(roleId));
86
-    }
87
-
88
-    /**
89
-     * 新增角色
90
-     */
91
-    @PreAuthorize("@ss.hasPermi('system:role:add')")
92
-    @Log(title = "角色管理", businessType = BusinessType.INSERT)
93
-    @PostMapping
94
-    public AjaxResult add(@Validated @RequestBody SysRole role)
95
-    {
96
-        if (!roleService.checkRoleNameUnique(role))
97
-        {
98
-            return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
99
-        }
100
-        else if (!roleService.checkRoleKeyUnique(role))
101
-        {
102
-            return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
103
-        }
104
-        role.setCreateBy(getUsername());
105
-        return toAjax(roleService.insertRole(role));
106
-
107
-    }
108
-
109
-    /**
110
-     * 修改保存角色
111
-     */
112
-    @PreAuthorize("@ss.hasPermi('system:role:edit')")
113
-    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
114
-    @PutMapping
115
-    public AjaxResult edit(@Validated @RequestBody SysRole role)
116
-    {
117
-        roleService.checkRoleAllowed(role);
118
-        roleService.checkRoleDataScope(role.getRoleId());
119
-        if (!roleService.checkRoleNameUnique(role))
120
-        {
121
-            return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
122
-        }
123
-        else if (!roleService.checkRoleKeyUnique(role))
124
-        {
125
-            return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
126
-        }
127
-        role.setUpdateBy(getUsername());
128
-        
129
-        if (roleService.updateRole(role) > 0)
130
-        {
131
-            // 更新缓存用户权限
132
-            LoginUser loginUser = getLoginUser();
133
-            if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
134
-            {
135
-                loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
136
-                loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
137
-                tokenService.setLoginUser(loginUser);
138
-            }
139
-            return success();
140
-        }
141
-        return error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
142
-    }
143
-
144
-    /**
145
-     * 修改保存数据权限
146
-     */
147
-    @PreAuthorize("@ss.hasPermi('system:role:edit')")
148
-    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
149
-    @PutMapping("/dataScope")
150
-    public AjaxResult dataScope(@RequestBody SysRole role)
151
-    {
152
-        roleService.checkRoleAllowed(role);
153
-        roleService.checkRoleDataScope(role.getRoleId());
154
-        return toAjax(roleService.authDataScope(role));
155
-    }
156
-
157
-    /**
158
-     * 状态修改
159
-     */
160
-    @PreAuthorize("@ss.hasPermi('system:role:edit')")
161
-    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
162
-    @PutMapping("/changeStatus")
163
-    public AjaxResult changeStatus(@RequestBody SysRole role)
164
-    {
165
-        roleService.checkRoleAllowed(role);
166
-        roleService.checkRoleDataScope(role.getRoleId());
167
-        role.setUpdateBy(getUsername());
168
-        return toAjax(roleService.updateRoleStatus(role));
169
-    }
170
-
171
-    /**
172
-     * 删除角色
173
-     */
174
-    @PreAuthorize("@ss.hasPermi('system:role:remove')")
175
-    @Log(title = "角色管理", businessType = BusinessType.DELETE)
176
-    @DeleteMapping("/{roleIds}")
177
-    public AjaxResult remove(@PathVariable Long[] roleIds)
178
-    {
179
-        return toAjax(roleService.deleteRoleByIds(roleIds));
180
-    }
181
-
182
-    /**
183
-     * 获取角色选择框列表
184
-     */
185
-    @PreAuthorize("@ss.hasPermi('system:role:query')")
186
-    @GetMapping("/optionselect")
187
-    public AjaxResult optionselect()
188
-    {
189
-        return success(roleService.selectRoleAll());
190
-    }
191
-
192
-    /**
193
-     * 查询已分配用户角色列表
194
-     */
195
-    @PreAuthorize("@ss.hasPermi('system:role:list')")
196
-    @GetMapping("/authUser/allocatedList")
197
-    public TableDataInfo allocatedList(SysUser user)
198
-    {
199
-        startPage();
200
-        List<SysUser> list = userService.selectAllocatedList(user);
201
-        return getDataTable(list);
202
-    }
203
-
204
-    /**
205
-     * 查询未分配用户角色列表
206
-     */
207
-    @PreAuthorize("@ss.hasPermi('system:role:list')")
208
-    @GetMapping("/authUser/unallocatedList")
209
-    public TableDataInfo unallocatedList(SysUser user)
210
-    {
211
-        startPage();
212
-        List<SysUser> list = userService.selectUnallocatedList(user);
213
-        return getDataTable(list);
214
-    }
215
-
216
-    /**
217
-     * 取消授权用户
218
-     */
219
-    @PreAuthorize("@ss.hasPermi('system:role:edit')")
220
-    @Log(title = "角色管理", businessType = BusinessType.GRANT)
221
-    @PutMapping("/authUser/cancel")
222
-    public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole)
223
-    {
224
-        return toAjax(roleService.deleteAuthUser(userRole));
225
-    }
226
-
227
-    /**
228
-     * 批量取消授权用户
229
-     */
230
-    @PreAuthorize("@ss.hasPermi('system:role:edit')")
231
-    @Log(title = "角色管理", businessType = BusinessType.GRANT)
232
-    @PutMapping("/authUser/cancelAll")
233
-    public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds)
234
-    {
235
-        return toAjax(roleService.deleteAuthUsers(roleId, userIds));
236
-    }
237
-
238
-    /**
239
-     * 批量选择用户授权
240
-     */
241
-    @PreAuthorize("@ss.hasPermi('system:role:edit')")
242
-    @Log(title = "角色管理", businessType = BusinessType.GRANT)
243
-    @PutMapping("/authUser/selectAll")
244
-    public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds)
245
-    {
246
-        roleService.checkRoleDataScope(roleId);
247
-        return toAjax(roleService.insertAuthUsers(roleId, userIds));
248
-    }
249
-
250
-    /**
251
-     * 获取对应角色部门树列表
252
-     */
253
-    @PreAuthorize("@ss.hasPermi('system:role:query')")
254
-    @GetMapping(value = "/deptTree/{roleId}")
255
-    public AjaxResult deptTree(@PathVariable("roleId") Long roleId)
256
-    {
257
-        AjaxResult ajax = AjaxResult.success();
258
-        ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
259
-        ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
260
-        return ajax;
261
-    }
262
-}

+ 0
- 256
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java 파일 보기

@@ -1,256 +0,0 @@
1
-package com.ruoyi.web.controller.system;
2
-
3
-import java.util.List;
4
-import java.util.stream.Collectors;
5
-import javax.servlet.http.HttpServletResponse;
6
-import org.apache.commons.lang3.ArrayUtils;
7
-import org.springframework.beans.factory.annotation.Autowired;
8
-import org.springframework.security.access.prepost.PreAuthorize;
9
-import org.springframework.validation.annotation.Validated;
10
-import org.springframework.web.bind.annotation.DeleteMapping;
11
-import org.springframework.web.bind.annotation.GetMapping;
12
-import org.springframework.web.bind.annotation.PathVariable;
13
-import org.springframework.web.bind.annotation.PostMapping;
14
-import org.springframework.web.bind.annotation.PutMapping;
15
-import org.springframework.web.bind.annotation.RequestBody;
16
-import org.springframework.web.bind.annotation.RequestMapping;
17
-import org.springframework.web.bind.annotation.RestController;
18
-import org.springframework.web.multipart.MultipartFile;
19
-import com.ruoyi.common.annotation.Log;
20
-import com.ruoyi.common.core.controller.BaseController;
21
-import com.ruoyi.common.core.domain.AjaxResult;
22
-import com.ruoyi.common.core.domain.entity.SysDept;
23
-import com.ruoyi.common.core.domain.entity.SysRole;
24
-import com.ruoyi.common.core.domain.entity.SysUser;
25
-import com.ruoyi.common.core.page.TableDataInfo;
26
-import com.ruoyi.common.enums.BusinessType;
27
-import com.ruoyi.common.utils.SecurityUtils;
28
-import com.ruoyi.common.utils.StringUtils;
29
-import com.ruoyi.common.utils.poi.ExcelUtil;
30
-import com.ruoyi.system.service.ISysDeptService;
31
-import com.ruoyi.system.service.ISysPostService;
32
-import com.ruoyi.system.service.ISysRoleService;
33
-import com.ruoyi.system.service.ISysUserService;
34
-
35
-/**
36
- * 用户信息
37
- * 
38
- * @author ruoyi
39
- */
40
-@RestController
41
-@RequestMapping("/system/user")
42
-public class SysUserController extends BaseController
43
-{
44
-    @Autowired
45
-    private ISysUserService userService;
46
-
47
-    @Autowired
48
-    private ISysRoleService roleService;
49
-
50
-    @Autowired
51
-    private ISysDeptService deptService;
52
-
53
-    @Autowired
54
-    private ISysPostService postService;
55
-
56
-    /**
57
-     * 获取用户列表
58
-     */
59
-    @PreAuthorize("@ss.hasPermi('system:user:list')")
60
-    @GetMapping("/list")
61
-    public TableDataInfo list(SysUser user)
62
-    {
63
-        startPage();
64
-        List<SysUser> list = userService.selectUserList(user);
65
-        return getDataTable(list);
66
-    }
67
-
68
-    @Log(title = "用户管理", businessType = BusinessType.EXPORT)
69
-    @PreAuthorize("@ss.hasPermi('system:user:export')")
70
-    @PostMapping("/export")
71
-    public void export(HttpServletResponse response, SysUser user)
72
-    {
73
-        List<SysUser> list = userService.selectUserList(user);
74
-        ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
75
-        util.exportExcel(response, list, "用户数据");
76
-    }
77
-
78
-    @Log(title = "用户管理", businessType = BusinessType.IMPORT)
79
-    @PreAuthorize("@ss.hasPermi('system:user:import')")
80
-    @PostMapping("/importData")
81
-    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
82
-    {
83
-        ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
84
-        List<SysUser> userList = util.importExcel(file.getInputStream());
85
-        String operName = getUsername();
86
-        String message = userService.importUser(userList, updateSupport, operName);
87
-        return success(message);
88
-    }
89
-
90
-    @PostMapping("/importTemplate")
91
-    public void importTemplate(HttpServletResponse response)
92
-    {
93
-        ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
94
-        util.importTemplateExcel(response, "用户数据");
95
-    }
96
-
97
-    /**
98
-     * 根据用户编号获取详细信息
99
-     */
100
-    @PreAuthorize("@ss.hasPermi('system:user:query')")
101
-    @GetMapping(value = { "/", "/{userId}" })
102
-    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
103
-    {
104
-        userService.checkUserDataScope(userId);
105
-        AjaxResult ajax = AjaxResult.success();
106
-        List<SysRole> roles = roleService.selectRoleAll();
107
-        ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
108
-        ajax.put("posts", postService.selectPostAll());
109
-        if (StringUtils.isNotNull(userId))
110
-        {
111
-            SysUser sysUser = userService.selectUserById(userId);
112
-            ajax.put(AjaxResult.DATA_TAG, sysUser);
113
-            ajax.put("postIds", postService.selectPostListByUserId(userId));
114
-            ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
115
-        }
116
-        return ajax;
117
-    }
118
-
119
-    /**
120
-     * 新增用户
121
-     */
122
-    @PreAuthorize("@ss.hasPermi('system:user:add')")
123
-    @Log(title = "用户管理", businessType = BusinessType.INSERT)
124
-    @PostMapping
125
-    public AjaxResult add(@Validated @RequestBody SysUser user)
126
-    {
127
-        deptService.checkDeptDataScope(user.getDeptId());
128
-        roleService.checkRoleDataScope(user.getRoleIds());
129
-        if (!userService.checkUserNameUnique(user))
130
-        {
131
-            return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
132
-        }
133
-        else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
134
-        {
135
-            return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
136
-        }
137
-        else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
138
-        {
139
-            return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
140
-        }
141
-        user.setCreateBy(getUsername());
142
-        user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
143
-        return toAjax(userService.insertUser(user));
144
-    }
145
-
146
-    /**
147
-     * 修改用户
148
-     */
149
-    @PreAuthorize("@ss.hasPermi('system:user:edit')")
150
-    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
151
-    @PutMapping
152
-    public AjaxResult edit(@Validated @RequestBody SysUser user)
153
-    {
154
-        userService.checkUserAllowed(user);
155
-        userService.checkUserDataScope(user.getUserId());
156
-        deptService.checkDeptDataScope(user.getDeptId());
157
-        roleService.checkRoleDataScope(user.getRoleIds());
158
-        if (!userService.checkUserNameUnique(user))
159
-        {
160
-            return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
161
-        }
162
-        else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
163
-        {
164
-            return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
165
-        }
166
-        else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
167
-        {
168
-            return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
169
-        }
170
-        user.setUpdateBy(getUsername());
171
-        return toAjax(userService.updateUser(user));
172
-    }
173
-
174
-    /**
175
-     * 删除用户
176
-     */
177
-    @PreAuthorize("@ss.hasPermi('system:user:remove')")
178
-    @Log(title = "用户管理", businessType = BusinessType.DELETE)
179
-    @DeleteMapping("/{userIds}")
180
-    public AjaxResult remove(@PathVariable Long[] userIds)
181
-    {
182
-        if (ArrayUtils.contains(userIds, getUserId()))
183
-        {
184
-            return error("当前用户不能删除");
185
-        }
186
-        return toAjax(userService.deleteUserByIds(userIds));
187
-    }
188
-
189
-    /**
190
-     * 重置密码
191
-     */
192
-    @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
193
-    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
194
-    @PutMapping("/resetPwd")
195
-    public AjaxResult resetPwd(@RequestBody SysUser user)
196
-    {
197
-        userService.checkUserAllowed(user);
198
-        userService.checkUserDataScope(user.getUserId());
199
-        user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
200
-        user.setUpdateBy(getUsername());
201
-        return toAjax(userService.resetPwd(user));
202
-    }
203
-
204
-    /**
205
-     * 状态修改
206
-     */
207
-    @PreAuthorize("@ss.hasPermi('system:user:edit')")
208
-    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
209
-    @PutMapping("/changeStatus")
210
-    public AjaxResult changeStatus(@RequestBody SysUser user)
211
-    {
212
-        userService.checkUserAllowed(user);
213
-        userService.checkUserDataScope(user.getUserId());
214
-        user.setUpdateBy(getUsername());
215
-        return toAjax(userService.updateUserStatus(user));
216
-    }
217
-
218
-    /**
219
-     * 根据用户编号获取授权角色
220
-     */
221
-    @PreAuthorize("@ss.hasPermi('system:user:query')")
222
-    @GetMapping("/authRole/{userId}")
223
-    public AjaxResult authRole(@PathVariable("userId") Long userId)
224
-    {
225
-        AjaxResult ajax = AjaxResult.success();
226
-        SysUser user = userService.selectUserById(userId);
227
-        List<SysRole> roles = roleService.selectRolesByUserId(userId);
228
-        ajax.put("user", user);
229
-        ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
230
-        return ajax;
231
-    }
232
-
233
-    /**
234
-     * 用户授权角色
235
-     */
236
-    @PreAuthorize("@ss.hasPermi('system:user:edit')")
237
-    @Log(title = "用户管理", businessType = BusinessType.GRANT)
238
-    @PutMapping("/authRole")
239
-    public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
240
-    {
241
-        userService.checkUserDataScope(userId);
242
-        roleService.checkRoleDataScope(roleIds);
243
-        userService.insertUserAuth(userId, roleIds);
244
-        return success();
245
-    }
246
-
247
-    /**
248
-     * 获取部门树列表
249
-     */
250
-    @PreAuthorize("@ss.hasPermi('system:user:list')")
251
-    @GetMapping("/deptTree")
252
-    public AjaxResult deptTree(SysDept dept)
253
-    {
254
-        return success(deptService.selectDeptTreeList(dept));
255
-    }
256
-}

+ 0
- 183
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java 파일 보기

@@ -1,183 +0,0 @@
1
-package com.ruoyi.web.controller.tool;
2
-
3
-import java.util.ArrayList;
4
-import java.util.LinkedHashMap;
5
-import java.util.List;
6
-import java.util.Map;
7
-import org.springframework.web.bind.annotation.DeleteMapping;
8
-import org.springframework.web.bind.annotation.GetMapping;
9
-import org.springframework.web.bind.annotation.PathVariable;
10
-import org.springframework.web.bind.annotation.PostMapping;
11
-import org.springframework.web.bind.annotation.PutMapping;
12
-import org.springframework.web.bind.annotation.RequestBody;
13
-import org.springframework.web.bind.annotation.RequestMapping;
14
-import org.springframework.web.bind.annotation.RestController;
15
-import com.ruoyi.common.core.controller.BaseController;
16
-import com.ruoyi.common.core.domain.R;
17
-import com.ruoyi.common.utils.StringUtils;
18
-import io.swagger.annotations.Api;
19
-import io.swagger.annotations.ApiImplicitParam;
20
-import io.swagger.annotations.ApiImplicitParams;
21
-import io.swagger.annotations.ApiModel;
22
-import io.swagger.annotations.ApiModelProperty;
23
-import io.swagger.annotations.ApiOperation;
24
-
25
-/**
26
- * swagger 用户测试方法
27
- * 
28
- * @author ruoyi
29
- */
30
-@Api("用户信息管理")
31
-@RestController
32
-@RequestMapping("/test/user")
33
-public class TestController extends BaseController
34
-{
35
-    private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
36
-    {
37
-        users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
38
-        users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
39
-    }
40
-
41
-    @ApiOperation("获取用户列表")
42
-    @GetMapping("/list")
43
-    public R<List<UserEntity>> userList()
44
-    {
45
-        List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
46
-        return R.ok(userList);
47
-    }
48
-
49
-    @ApiOperation("获取用户详细")
50
-    @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
51
-    @GetMapping("/{userId}")
52
-    public R<UserEntity> getUser(@PathVariable Integer userId)
53
-    {
54
-        if (!users.isEmpty() && users.containsKey(userId))
55
-        {
56
-            return R.ok(users.get(userId));
57
-        }
58
-        else
59
-        {
60
-            return R.fail("用户不存在");
61
-        }
62
-    }
63
-
64
-    @ApiOperation("新增用户")
65
-    @ApiImplicitParams({
66
-        @ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class),
67
-        @ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class),
68
-        @ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class),
69
-        @ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class)
70
-    })
71
-    @PostMapping("/save")
72
-    public R<String> save(UserEntity user)
73
-    {
74
-        if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
75
-        {
76
-            return R.fail("用户ID不能为空");
77
-        }
78
-        users.put(user.getUserId(), user);
79
-        return R.ok();
80
-    }
81
-
82
-    @ApiOperation("更新用户")
83
-    @PutMapping("/update")
84
-    public R<String> update(@RequestBody UserEntity user)
85
-    {
86
-        if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
87
-        {
88
-            return R.fail("用户ID不能为空");
89
-        }
90
-        if (users.isEmpty() || !users.containsKey(user.getUserId()))
91
-        {
92
-            return R.fail("用户不存在");
93
-        }
94
-        users.remove(user.getUserId());
95
-        users.put(user.getUserId(), user);
96
-        return R.ok();
97
-    }
98
-
99
-    @ApiOperation("删除用户信息")
100
-    @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
101
-    @DeleteMapping("/{userId}")
102
-    public R<String> delete(@PathVariable Integer userId)
103
-    {
104
-        if (!users.isEmpty() && users.containsKey(userId))
105
-        {
106
-            users.remove(userId);
107
-            return R.ok();
108
-        }
109
-        else
110
-        {
111
-            return R.fail("用户不存在");
112
-        }
113
-    }
114
-}
115
-
116
-@ApiModel(value = "UserEntity", description = "用户实体")
117
-class UserEntity
118
-{
119
-    @ApiModelProperty("用户ID")
120
-    private Integer userId;
121
-
122
-    @ApiModelProperty("用户名称")
123
-    private String username;
124
-
125
-    @ApiModelProperty("用户密码")
126
-    private String password;
127
-
128
-    @ApiModelProperty("用户手机")
129
-    private String mobile;
130
-
131
-    public UserEntity()
132
-    {
133
-
134
-    }
135
-
136
-    public UserEntity(Integer userId, String username, String password, String mobile)
137
-    {
138
-        this.userId = userId;
139
-        this.username = username;
140
-        this.password = password;
141
-        this.mobile = mobile;
142
-    }
143
-
144
-    public Integer getUserId()
145
-    {
146
-        return userId;
147
-    }
148
-
149
-    public void setUserId(Integer userId)
150
-    {
151
-        this.userId = userId;
152
-    }
153
-
154
-    public String getUsername()
155
-    {
156
-        return username;
157
-    }
158
-
159
-    public void setUsername(String username)
160
-    {
161
-        this.username = username;
162
-    }
163
-
164
-    public String getPassword()
165
-    {
166
-        return password;
167
-    }
168
-
169
-    public void setPassword(String password)
170
-    {
171
-        this.password = password;
172
-    }
173
-
174
-    public String getMobile()
175
-    {
176
-        return mobile;
177
-    }
178
-
179
-    public void setMobile(String mobile)
180
-    {
181
-        this.mobile = mobile;
182
-    }
183
-}

+ 0
- 125
ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java 파일 보기

@@ -1,125 +0,0 @@
1
-package com.ruoyi.web.core.config;
2
-
3
-import java.util.ArrayList;
4
-import java.util.List;
5
-import org.springframework.beans.factory.annotation.Autowired;
6
-import org.springframework.beans.factory.annotation.Value;
7
-import org.springframework.context.annotation.Bean;
8
-import org.springframework.context.annotation.Configuration;
9
-import com.ruoyi.common.config.RuoYiConfig;
10
-import io.swagger.annotations.ApiOperation;
11
-import io.swagger.models.auth.In;
12
-import springfox.documentation.builders.ApiInfoBuilder;
13
-import springfox.documentation.builders.PathSelectors;
14
-import springfox.documentation.builders.RequestHandlerSelectors;
15
-import springfox.documentation.service.ApiInfo;
16
-import springfox.documentation.service.ApiKey;
17
-import springfox.documentation.service.AuthorizationScope;
18
-import springfox.documentation.service.Contact;
19
-import springfox.documentation.service.SecurityReference;
20
-import springfox.documentation.service.SecurityScheme;
21
-import springfox.documentation.spi.DocumentationType;
22
-import springfox.documentation.spi.service.contexts.SecurityContext;
23
-import springfox.documentation.spring.web.plugins.Docket;
24
-
25
-/**
26
- * Swagger2的接口配置
27
- * 
28
- * @author ruoyi
29
- */
30
-@Configuration
31
-public class SwaggerConfig
32
-{
33
-    /** 系统基础配置 */
34
-    @Autowired
35
-    private RuoYiConfig ruoyiConfig;
36
-
37
-    /** 是否开启swagger */
38
-    @Value("${swagger.enabled}")
39
-    private boolean enabled;
40
-
41
-    /** 设置请求的统一前缀 */
42
-    @Value("${swagger.pathMapping}")
43
-    private String pathMapping;
44
-
45
-    /**
46
-     * 创建API
47
-     */
48
-    @Bean
49
-    public Docket createRestApi()
50
-    {
51
-        return new Docket(DocumentationType.OAS_30)
52
-                // 是否启用Swagger
53
-                .enable(enabled)
54
-                // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
55
-                .apiInfo(apiInfo())
56
-                // 设置哪些接口暴露给Swagger展示
57
-                .select()
58
-                // 扫描所有有注解的api,用这种方式更灵活
59
-                .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
60
-                // 扫描指定包中的swagger注解
61
-                // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger"))
62
-                // 扫描所有 .apis(RequestHandlerSelectors.any())
63
-                .paths(PathSelectors.any())
64
-                .build()
65
-                /* 设置安全模式,swagger可以设置访问token */
66
-                .securitySchemes(securitySchemes())
67
-                .securityContexts(securityContexts())
68
-                .pathMapping(pathMapping);
69
-    }
70
-
71
-    /**
72
-     * 安全模式,这里指定token通过Authorization头请求头传递
73
-     */
74
-    private List<SecurityScheme> securitySchemes()
75
-    {
76
-        List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
77
-        apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
78
-        return apiKeyList;
79
-    }
80
-
81
-    /**
82
-     * 安全上下文
83
-     */
84
-    private List<SecurityContext> securityContexts()
85
-    {
86
-        List<SecurityContext> securityContexts = new ArrayList<>();
87
-        securityContexts.add(
88
-                SecurityContext.builder()
89
-                        .securityReferences(defaultAuth())
90
-                        .operationSelector(o -> o.requestMappingPattern().matches("/.*"))
91
-                        .build());
92
-        return securityContexts;
93
-    }
94
-
95
-    /**
96
-     * 默认的安全上引用
97
-     */
98
-    private List<SecurityReference> defaultAuth()
99
-    {
100
-        AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
101
-        AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
102
-        authorizationScopes[0] = authorizationScope;
103
-        List<SecurityReference> securityReferences = new ArrayList<>();
104
-        securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
105
-        return securityReferences;
106
-    }
107
-
108
-    /**
109
-     * 添加摘要信息
110
-     */
111
-    private ApiInfo apiInfo()
112
-    {
113
-        // 用ApiInfoBuilder进行定制
114
-        return new ApiInfoBuilder()
115
-                // 设置标题
116
-                .title("标题:若依管理系统_接口文档")
117
-                // 描述
118
-                .description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
119
-                // 作者信息
120
-                .contact(new Contact(ruoyiConfig.getName(), null, null))
121
-                // 版本
122
-                .version("版本号:" + ruoyiConfig.getVersion())
123
-                .build();
124
-    }
125
-}

+ 0
- 1
ruoyi-admin/src/main/resources/META-INF/spring-devtools.properties 파일 보기

@@ -1 +0,0 @@
1
-restart.include.json=/com.alibaba.fastjson2.*.jar

+ 0
- 61
ruoyi-admin/src/main/resources/application-druid.yml 파일 보기

@@ -1,61 +0,0 @@
1
-# 数据源配置
2
-spring:
3
-    datasource:
4
-        type: com.alibaba.druid.pool.DruidDataSource
5
-        driverClassName: com.mysql.cj.jdbc.Driver
6
-        druid:
7
-            # 主库数据源
8
-            master:
9
-                url: jdbc:mysql://121.40.189.20:3306/costmanage?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai
10
-                username: root
11
-                password: YMzc157#
12
-            # 从库数据源
13
-            slave:
14
-                # 从数据源开关/默认关闭
15
-                enabled: false
16
-                url: 
17
-                username: 
18
-                password: 
19
-            # 初始连接数
20
-            initialSize: 5
21
-            # 最小连接池数量
22
-            minIdle: 10
23
-            # 最大连接池数量
24
-            maxActive: 20
25
-            # 配置获取连接等待超时的时间
26
-            maxWait: 60000
27
-            # 配置连接超时时间
28
-            connectTimeout: 30000
29
-            # 配置网络超时时间
30
-            socketTimeout: 60000
31
-            # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
32
-            timeBetweenEvictionRunsMillis: 60000
33
-            # 配置一个连接在池中最小生存的时间,单位是毫秒
34
-            minEvictableIdleTimeMillis: 300000
35
-            # 配置一个连接在池中最大生存的时间,单位是毫秒
36
-            maxEvictableIdleTimeMillis: 900000
37
-            # 配置检测连接是否有效
38
-            validationQuery: SELECT 1 FROM DUAL
39
-            testWhileIdle: true
40
-            testOnBorrow: false
41
-            testOnReturn: false
42
-            webStatFilter: 
43
-                enabled: true
44
-            statViewServlet:
45
-                enabled: true
46
-                # 设置白名单,不填则允许所有访问
47
-                allow:
48
-                url-pattern: /druid/*
49
-                # 控制台管理用户名和密码
50
-                login-username: ruoyi
51
-                login-password: 123456
52
-            filter:
53
-                stat:
54
-                    enabled: true
55
-                    # 慢SQL记录
56
-                    log-slow-sql: true
57
-                    slow-sql-millis: 1000
58
-                    merge-sql: true
59
-                wall:
60
-                    config:
61
-                        multi-statement-allow: true

+ 0
- 129
ruoyi-admin/src/main/resources/application.yml 파일 보기

@@ -1,129 +0,0 @@
1
-# 项目相关配置
2
-ruoyi:
3
-  # 名称
4
-  name: RuoYi
5
-  # 版本
6
-  version: 3.8.7
7
-  # 版权年份
8
-  copyrightYear: 2024
9
-  # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
10
-  profile: D:/ruoyi/uploadPath
11
-  # 获取ip地址开关
12
-  addressEnabled: false
13
-  # 验证码类型 math 数字计算 char 字符验证
14
-  captchaType: math
15
-
16
-# 开发环境配置
17
-server:
18
-  # 服务器的HTTP端口,默认为8080
19
-  port: 8080
20
-  servlet:
21
-    # 应用的访问路径
22
-    context-path: /
23
-  tomcat:
24
-    # tomcat的URI编码
25
-    uri-encoding: UTF-8
26
-    # 连接数满后的排队数,默认为100
27
-    accept-count: 1000
28
-    threads:
29
-      # tomcat最大线程数,默认为200
30
-      max: 800
31
-      # Tomcat启动初始化的线程数,默认值10
32
-      min-spare: 100
33
-
34
-# 日志配置
35
-logging:
36
-  level:
37
-    com.ruoyi: debug
38
-    org.springframework: warn
39
-
40
-# 用户配置
41
-user:
42
-  password:
43
-    # 密码最大错误次数
44
-    maxRetryCount: 5
45
-    # 密码锁定时间(默认10分钟)
46
-    lockTime: 10
47
-
48
-# Spring配置
49
-spring:
50
-  # 资源信息
51
-  messages:
52
-    # 国际化资源文件路径
53
-    basename: i18n/messages
54
-  profiles:
55
-    active: druid
56
-  # 文件上传
57
-  servlet:
58
-    multipart:
59
-      # 单个文件大小
60
-      max-file-size: 10MB
61
-      # 设置总上传的文件大小
62
-      max-request-size: 20MB
63
-  # 服务模块
64
-  devtools:
65
-    restart:
66
-      # 热部署开关
67
-      enabled: true
68
-  # redis 配置
69
-  redis:
70
-    # 地址
71
-    host: 121.40.189.20
72
-    # 端口,默认为6379
73
-    port: 6389
74
-    # 数据库索引
75
-    database: 5
76
-    # 密码
77
-    password:
78
-    # 连接超时时间
79
-    timeout: 10s
80
-    lettuce:
81
-      pool:
82
-        # 连接池中的最小空闲连接
83
-        min-idle: 0
84
-        # 连接池中的最大空闲连接
85
-        max-idle: 8
86
-        # 连接池的最大数据库连接数
87
-        max-active: 8
88
-        # #连接池最大阻塞等待时间(使用负值表示没有限制)
89
-        max-wait: -1ms
90
-
91
-# token配置
92
-token:
93
-  # 令牌自定义标识
94
-  header: Authorization
95
-  # 令牌密钥
96
-  secret: abcdefghijklmnopqrstuvwxyz
97
-  # 令牌有效期(默认30分钟)
98
-  expireTime: 30
99
-
100
-# MyBatis配置
101
-mybatis:
102
-  # 搜索指定包别名
103
-  typeAliasesPackage: com.ruoyi.**.domain
104
-  # 配置mapper的扫描,找到所有的mapper.xml映射文件
105
-  mapperLocations: classpath*:mapper/**/*Mapper.xml
106
-  # 加载全局的配置文件
107
-  configLocation: classpath:mybatis/mybatis-config.xml
108
-
109
-# PageHelper分页插件
110
-pagehelper:
111
-  helperDialect: mysql
112
-  supportMethodsArguments: true
113
-  params: count=countSql
114
-
115
-# Swagger配置
116
-swagger:
117
-  # 是否开启swagger
118
-  enabled: true
119
-  # 请求前缀
120
-  pathMapping: /dev-api
121
-
122
-# 防止XSS攻击
123
-xss:
124
-  # 过滤开关
125
-  enabled: true
126
-  # 排除链接(多个用逗号分隔)
127
-  excludes: /system/notice
128
-  # 匹配链接
129
-  urlPatterns: /system/*,/monitor/*,/tool/*

+ 0
- 2
ruoyi-admin/src/main/resources/banner.txt 파일 보기

@@ -1,2 +0,0 @@
1
-Application Version: ${ruoyi.version}
2
-Spring Boot Version: ${spring-boot.version}

+ 0
- 38
ruoyi-admin/src/main/resources/i18n/messages.properties 파일 보기

@@ -1,38 +0,0 @@
1
-#错误消息
2
-not.null=* 必须填写
3
-user.jcaptcha.error=验证码错误
4
-user.jcaptcha.expire=验证码已失效
5
-user.not.exists=用户不存在/密码错误
6
-user.password.not.match=用户不存在/密码错误
7
-user.password.retry.limit.count=密码输入错误{0}次
8
-user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
9
-user.password.delete=对不起,您的账号已被删除
10
-user.blocked=用户已封禁,请联系管理员
11
-role.blocked=角色已封禁,请联系管理员
12
-login.blocked=很遗憾,访问IP已被列入系统黑名单
13
-user.logout.success=退出成功
14
-
15
-length.not.valid=长度必须在{min}到{max}个字符之间
16
-
17
-user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
18
-user.password.not.valid=* 5-50个字符
19
- 
20
-user.email.not.valid=邮箱格式错误
21
-user.mobile.phone.number.not.valid=手机号格式错误
22
-user.login.success=登录成功
23
-user.register.success=注册成功
24
-user.notfound=请重新登录
25
-user.forcelogout=管理员强制退出,请重新登录
26
-user.unknown.error=未知错误,请重新登录
27
-
28
-##文件上传消息
29
-upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
30
-upload.filename.exceed.length=上传的文件名最长{0}个字符
31
-
32
-##权限
33
-no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
34
-no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
35
-no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
36
-no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
37
-no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
38
-no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]

+ 0
- 93
ruoyi-admin/src/main/resources/logback.xml 파일 보기

@@ -1,93 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<configuration>
3
-    <!-- 日志存放路径 -->
4
-	<property name="log.path" value="/home/ruoyi/logs" />
5
-    <!-- 日志输出格式 -->
6
-	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
7
-
8
-	<!-- 控制台输出 -->
9
-	<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
10
-		<encoder>
11
-			<pattern>${log.pattern}</pattern>
12
-		</encoder>
13
-	</appender>
14
-	
15
-	<!-- 系统日志输出 -->
16
-	<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
17
-	    <file>${log.path}/sys-info.log</file>
18
-        <!-- 循环政策:基于时间创建日志文件 -->
19
-		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
20
-            <!-- 日志文件名格式 -->
21
-			<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
22
-			<!-- 日志最大的历史 60天 -->
23
-			<maxHistory>60</maxHistory>
24
-		</rollingPolicy>
25
-		<encoder>
26
-			<pattern>${log.pattern}</pattern>
27
-		</encoder>
28
-		<filter class="ch.qos.logback.classic.filter.LevelFilter">
29
-            <!-- 过滤的级别 -->
30
-            <level>INFO</level>
31
-            <!-- 匹配时的操作:接收(记录) -->
32
-            <onMatch>ACCEPT</onMatch>
33
-            <!-- 不匹配时的操作:拒绝(不记录) -->
34
-            <onMismatch>DENY</onMismatch>
35
-        </filter>
36
-	</appender>
37
-	
38
-	<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
39
-	    <file>${log.path}/sys-error.log</file>
40
-        <!-- 循环政策:基于时间创建日志文件 -->
41
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
42
-            <!-- 日志文件名格式 -->
43
-            <fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
44
-			<!-- 日志最大的历史 60天 -->
45
-			<maxHistory>60</maxHistory>
46
-        </rollingPolicy>
47
-        <encoder>
48
-            <pattern>${log.pattern}</pattern>
49
-        </encoder>
50
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
51
-            <!-- 过滤的级别 -->
52
-            <level>ERROR</level>
53
-			<!-- 匹配时的操作:接收(记录) -->
54
-            <onMatch>ACCEPT</onMatch>
55
-			<!-- 不匹配时的操作:拒绝(不记录) -->
56
-            <onMismatch>DENY</onMismatch>
57
-        </filter>
58
-    </appender>
59
-	
60
-	<!-- 用户访问日志输出  -->
61
-    <appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
62
-		<file>${log.path}/sys-user.log</file>
63
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
64
-            <!-- 按天回滚 daily -->
65
-            <fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
66
-            <!-- 日志最大的历史 60天 -->
67
-            <maxHistory>60</maxHistory>
68
-        </rollingPolicy>
69
-        <encoder>
70
-            <pattern>${log.pattern}</pattern>
71
-        </encoder>
72
-    </appender>
73
-	
74
-	<!-- 系统模块日志级别控制  -->
75
-	<logger name="com.ruoyi" level="info" />
76
-	<!-- Spring日志级别控制  -->
77
-	<logger name="org.springframework" level="warn" />
78
-
79
-	<root level="info">
80
-		<appender-ref ref="console" />
81
-	</root>
82
-	
83
-	<!--系统操作日志-->
84
-    <root level="info">
85
-        <appender-ref ref="file_info" />
86
-        <appender-ref ref="file_error" />
87
-    </root>
88
-	
89
-	<!--系统用户操作日志-->
90
-    <logger name="sys-user" level="info">
91
-        <appender-ref ref="sys-user"/>
92
-    </logger>
93
-</configuration> 

+ 0
- 20
ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml 파일 보기

@@ -1,20 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" ?>
2
-<!DOCTYPE configuration
3
-PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
4
-"http://mybatis.org/dtd/mybatis-3-config.dtd">
5
-<configuration>
6
-    <!-- 全局参数 -->
7
-    <settings>
8
-        <!-- 使全局的映射器启用或禁用缓存 -->
9
-        <setting name="cacheEnabled"             value="true"   />
10
-        <!-- 允许JDBC 支持自动生成主键 -->
11
-        <setting name="useGeneratedKeys"         value="true"   />
12
-        <!-- 配置默认的执行器.SIMPLE就是普通执行器;REUSE执行器会重用预处理语句(prepared statements);BATCH执行器将重用语句并执行批量更新 -->
13
-        <setting name="defaultExecutorType"      value="SIMPLE" />
14
-		<!-- 指定 MyBatis 所用日志的具体实现 -->
15
-        <setting name="logImpl"                  value="SLF4J"  />
16
-        <!-- 使用驼峰命名法转换字段 -->
17
-		<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
18
-	</settings>
19
-	
20
-</configuration>

+ 0
- 131
ruoyi-common/pom.xml 파일 보기

@@ -1,131 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project xmlns="http://maven.apache.org/POM/4.0.0"
3
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
-    <parent>
6
-        <artifactId>ruoyi</artifactId>
7
-        <groupId>com.ruoyi</groupId>
8
-        <version>3.8.7</version>
9
-    </parent>
10
-    <modelVersion>4.0.0</modelVersion>
11
-
12
-    <artifactId>ruoyi-common</artifactId>
13
-
14
-    <description>
15
-        common通用工具
16
-    </description>
17
-
18
-    <dependencies>
19
-
20
-        <!-- Spring框架基本的核心工具 -->
21
-        <dependency>
22
-            <groupId>org.springframework</groupId>
23
-            <artifactId>spring-context-support</artifactId>
24
-        </dependency>
25
-
26
-        <!-- SpringWeb模块 -->
27
-        <dependency>
28
-            <groupId>org.springframework</groupId>
29
-            <artifactId>spring-web</artifactId>
30
-        </dependency>
31
-
32
-        <!-- spring security 安全认证 -->
33
-        <dependency>
34
-            <groupId>org.springframework.boot</groupId>
35
-            <artifactId>spring-boot-starter-security</artifactId>
36
-        </dependency>
37
-
38
-        <!-- pagehelper 分页插件 -->
39
-        <dependency>
40
-            <groupId>com.github.pagehelper</groupId>
41
-            <artifactId>pagehelper-spring-boot-starter</artifactId>
42
-        </dependency>
43
-
44
-        <!-- 自定义验证注解 -->
45
-        <dependency>
46
-            <groupId>org.springframework.boot</groupId>
47
-            <artifactId>spring-boot-starter-validation</artifactId>
48
-        </dependency>
49
-
50
-        <!--常用工具类 -->
51
-        <dependency>
52
-            <groupId>org.apache.commons</groupId>
53
-            <artifactId>commons-lang3</artifactId>
54
-        </dependency>
55
-  
56
-        <!-- JSON工具类 -->
57
-        <dependency>
58
-            <groupId>com.fasterxml.jackson.core</groupId>
59
-            <artifactId>jackson-databind</artifactId>
60
-        </dependency>
61
-        
62
-        <!-- 动态数据源 -->
63
-		<dependency>
64
-			<groupId>com.baomidou</groupId>
65
-			<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
66
-			<version>3.5.2</version>
67
-		</dependency>
68
-
69
-        <!-- 阿里JSON解析器 -->
70
-        <dependency>
71
-            <groupId>com.alibaba.fastjson2</groupId>
72
-            <artifactId>fastjson2</artifactId>
73
-        </dependency>
74
-
75
-        <!-- io常用工具类 -->
76
-        <dependency>
77
-            <groupId>commons-io</groupId>
78
-            <artifactId>commons-io</artifactId>
79
-        </dependency>
80
-
81
-        <!-- excel工具 -->
82
-        <dependency>
83
-            <groupId>org.apache.poi</groupId>
84
-            <artifactId>poi-ooxml</artifactId>
85
-        </dependency>
86
-
87
-        <!-- yml解析器 -->
88
-        <dependency>
89
-            <groupId>org.yaml</groupId>
90
-            <artifactId>snakeyaml</artifactId>
91
-        </dependency>
92
-
93
-        <!-- Token生成与解析-->
94
-        <dependency>
95
-            <groupId>io.jsonwebtoken</groupId>
96
-            <artifactId>jjwt</artifactId>
97
-        </dependency>
98
-
99
-        <!-- Jaxb -->
100
-        <dependency>
101
-            <groupId>javax.xml.bind</groupId>
102
-            <artifactId>jaxb-api</artifactId>
103
-        </dependency>
104
-
105
-        <!-- redis 缓存操作 -->
106
-        <dependency>
107
-            <groupId>org.springframework.boot</groupId>
108
-            <artifactId>spring-boot-starter-data-redis</artifactId>
109
-        </dependency>
110
-
111
-        <!-- pool 对象池 -->
112
-        <dependency>
113
-            <groupId>org.apache.commons</groupId>
114
-            <artifactId>commons-pool2</artifactId>
115
-        </dependency>
116
-
117
-        <!-- 解析客户端操作系统、浏览器等 -->
118
-        <dependency>
119
-            <groupId>eu.bitwalker</groupId>
120
-            <artifactId>UserAgentUtils</artifactId>
121
-        </dependency>
122
-
123
-        <!-- servlet包 -->
124
-        <dependency>
125
-            <groupId>javax.servlet</groupId>
126
-            <artifactId>javax.servlet-api</artifactId>
127
-        </dependency>
128
-
129
-    </dependencies>
130
-
131
-</project>

+ 0
- 19
ruoyi-common/src/main/java/com/ruoyi/common/annotation/Anonymous.java 파일 보기

@@ -1,19 +0,0 @@
1
-package com.ruoyi.common.annotation;
2
-
3
-import java.lang.annotation.Documented;
4
-import java.lang.annotation.ElementType;
5
-import java.lang.annotation.Retention;
6
-import java.lang.annotation.RetentionPolicy;
7
-import java.lang.annotation.Target;
8
-
9
-/**
10
- * 匿名访问不鉴权注解
11
- * 
12
- * @author ruoyi
13
- */
14
-@Target({ ElementType.METHOD, ElementType.TYPE })
15
-@Retention(RetentionPolicy.RUNTIME)
16
-@Documented
17
-public @interface Anonymous
18
-{
19
-}

+ 0
- 33
ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java 파일 보기

@@ -1,33 +0,0 @@
1
-package com.ruoyi.common.annotation;
2
-
3
-import java.lang.annotation.Documented;
4
-import java.lang.annotation.ElementType;
5
-import java.lang.annotation.Retention;
6
-import java.lang.annotation.RetentionPolicy;
7
-import java.lang.annotation.Target;
8
-
9
-/**
10
- * 数据权限过滤注解
11
- * 
12
- * @author ruoyi
13
- */
14
-@Target(ElementType.METHOD)
15
-@Retention(RetentionPolicy.RUNTIME)
16
-@Documented
17
-public @interface DataScope
18
-{
19
-    /**
20
-     * 部门表的别名
21
-     */
22
-    public String deptAlias() default "";
23
-
24
-    /**
25
-     * 用户表的别名
26
-     */
27
-    public String userAlias() default "";
28
-
29
-    /**
30
-     * 权限字符(用于多个角色匹配符合要求的权限)默认根据权限注解@ss获取,多个权限用逗号分隔开来
31
-     */
32
-    public String permission() default "";
33
-}

+ 0
- 28
ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java 파일 보기

@@ -1,28 +0,0 @@
1
-package com.ruoyi.common.annotation;
2
-
3
-import java.lang.annotation.Documented;
4
-import java.lang.annotation.ElementType;
5
-import java.lang.annotation.Inherited;
6
-import java.lang.annotation.Retention;
7
-import java.lang.annotation.RetentionPolicy;
8
-import java.lang.annotation.Target;
9
-import com.ruoyi.common.enums.DataSourceType;
10
-
11
-/**
12
- * 自定义多数据源切换注解
13
- *
14
- * 优先级:先方法,后类,如果方法覆盖了类上的数据源类型,以方法的为准,否则以类上的为准
15
- *
16
- * @author ruoyi
17
- */
18
-@Target({ ElementType.METHOD, ElementType.TYPE })
19
-@Retention(RetentionPolicy.RUNTIME)
20
-@Documented
21
-@Inherited
22
-public @interface DataSource
23
-{
24
-    /**
25
-     * 切换数据源名称
26
-     */
27
-    public DataSourceType value() default DataSourceType.MASTER;
28
-}

+ 0
- 187
ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java 파일 보기

@@ -1,187 +0,0 @@
1
-package com.ruoyi.common.annotation;
2
-
3
-import java.lang.annotation.ElementType;
4
-import java.lang.annotation.Retention;
5
-import java.lang.annotation.RetentionPolicy;
6
-import java.lang.annotation.Target;
7
-import java.math.BigDecimal;
8
-import org.apache.poi.ss.usermodel.HorizontalAlignment;
9
-import org.apache.poi.ss.usermodel.IndexedColors;
10
-import com.ruoyi.common.utils.poi.ExcelHandlerAdapter;
11
-
12
-/**
13
- * 自定义导出Excel数据注解
14
- * 
15
- * @author ruoyi
16
- */
17
-@Retention(RetentionPolicy.RUNTIME)
18
-@Target(ElementType.FIELD)
19
-public @interface Excel
20
-{
21
-    /**
22
-     * 导出时在excel中排序
23
-     */
24
-    public int sort() default Integer.MAX_VALUE;
25
-
26
-    /**
27
-     * 导出到Excel中的名字.
28
-     */
29
-    public String name() default "";
30
-
31
-    /**
32
-     * 日期格式, 如: yyyy-MM-dd
33
-     */
34
-    public String dateFormat() default "";
35
-
36
-    /**
37
-     * 如果是字典类型,请设置字典的type值 (如: sys_user_sex)
38
-     */
39
-    public String dictType() default "";
40
-
41
-    /**
42
-     * 读取内容转表达式 (如: 0=男,1=女,2=未知)
43
-     */
44
-    public String readConverterExp() default "";
45
-
46
-    /**
47
-     * 分隔符,读取字符串组内容
48
-     */
49
-    public String separator() default ",";
50
-
51
-    /**
52
-     * BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
53
-     */
54
-    public int scale() default -1;
55
-
56
-    /**
57
-     * BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
58
-     */
59
-    public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
60
-
61
-    /**
62
-     * 导出时在excel中每个列的高度
63
-     */
64
-    public double height() default 14;
65
-
66
-    /**
67
-     * 导出时在excel中每个列的宽度
68
-     */
69
-    public double width() default 16;
70
-
71
-    /**
72
-     * 文字后缀,如% 90 变成90%
73
-     */
74
-    public String suffix() default "";
75
-
76
-    /**
77
-     * 当值为空时,字段的默认值
78
-     */
79
-    public String defaultValue() default "";
80
-
81
-    /**
82
-     * 提示信息
83
-     */
84
-    public String prompt() default "";
85
-
86
-    /**
87
-     * 设置只能选择不能输入的列内容.
88
-     */
89
-    public String[] combo() default {};
90
-
91
-    /**
92
-     * 是否需要纵向合并单元格,应对需求:含有list集合单元格)
93
-     */
94
-    public boolean needMerge() default false;
95
-
96
-    /**
97
-     * 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
98
-     */
99
-    public boolean isExport() default true;
100
-
101
-    /**
102
-     * 另一个类中的属性名称,支持多级获取,以小数点隔开
103
-     */
104
-    public String targetAttr() default "";
105
-
106
-    /**
107
-     * 是否自动统计数据,在最后追加一行统计数据总和
108
-     */
109
-    public boolean isStatistics() default false;
110
-
111
-    /**
112
-     * 导出类型(0数字 1字符串 2图片)
113
-     */
114
-    public ColumnType cellType() default ColumnType.STRING;
115
-
116
-    /**
117
-     * 导出列头背景颜色
118
-     */
119
-    public IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT;
120
-
121
-    /**
122
-     * 导出列头字体颜色
123
-     */
124
-    public IndexedColors headerColor() default IndexedColors.WHITE;
125
-
126
-    /**
127
-     * 导出单元格背景颜色
128
-     */
129
-    public IndexedColors backgroundColor() default IndexedColors.WHITE;
130
-
131
-    /**
132
-     * 导出单元格字体颜色
133
-     */
134
-    public IndexedColors color() default IndexedColors.BLACK;
135
-
136
-    /**
137
-     * 导出字段对齐方式
138
-     */
139
-    public HorizontalAlignment align() default HorizontalAlignment.CENTER;
140
-
141
-    /**
142
-     * 自定义数据处理器
143
-     */
144
-    public Class<?> handler() default ExcelHandlerAdapter.class;
145
-
146
-    /**
147
-     * 自定义数据处理器参数
148
-     */
149
-    public String[] args() default {};
150
-
151
-    /**
152
-     * 字段类型(0:导出导入;1:仅导出;2:仅导入)
153
-     */
154
-    Type type() default Type.ALL;
155
-
156
-    public enum Type
157
-    {
158
-        ALL(0), EXPORT(1), IMPORT(2);
159
-        private final int value;
160
-
161
-        Type(int value)
162
-        {
163
-            this.value = value;
164
-        }
165
-
166
-        public int value()
167
-        {
168
-            return this.value;
169
-        }
170
-    }
171
-
172
-    public enum ColumnType
173
-    {
174
-        NUMERIC(0), STRING(1), IMAGE(2), TEXT(3);
175
-        private final int value;
176
-
177
-        ColumnType(int value)
178
-        {
179
-            this.value = value;
180
-        }
181
-
182
-        public int value()
183
-        {
184
-            return this.value;
185
-        }
186
-    }
187
-}

+ 0
- 18
ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excels.java 파일 보기

@@ -1,18 +0,0 @@
1
-package com.ruoyi.common.annotation;
2
-
3
-import java.lang.annotation.ElementType;
4
-import java.lang.annotation.Retention;
5
-import java.lang.annotation.RetentionPolicy;
6
-import java.lang.annotation.Target;
7
-
8
-/**
9
- * Excel注解集
10
- * 
11
- * @author ruoyi
12
- */
13
-@Target(ElementType.FIELD)
14
-@Retention(RetentionPolicy.RUNTIME)
15
-public @interface Excels
16
-{
17
-    public Excel[] value();
18
-}

+ 0
- 51
ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java 파일 보기

@@ -1,51 +0,0 @@
1
-package com.ruoyi.common.annotation;
2
-
3
-import java.lang.annotation.Documented;
4
-import java.lang.annotation.ElementType;
5
-import java.lang.annotation.Retention;
6
-import java.lang.annotation.RetentionPolicy;
7
-import java.lang.annotation.Target;
8
-import com.ruoyi.common.enums.BusinessType;
9
-import com.ruoyi.common.enums.OperatorType;
10
-
11
-/**
12
- * 自定义操作日志记录注解
13
- * 
14
- * @author ruoyi
15
- *
16
- */
17
-@Target({ ElementType.PARAMETER, ElementType.METHOD })
18
-@Retention(RetentionPolicy.RUNTIME)
19
-@Documented
20
-public @interface Log
21
-{
22
-    /**
23
-     * 模块
24
-     */
25
-    public String title() default "";
26
-
27
-    /**
28
-     * 功能
29
-     */
30
-    public BusinessType businessType() default BusinessType.OTHER;
31
-
32
-    /**
33
-     * 操作人类别
34
-     */
35
-    public OperatorType operatorType() default OperatorType.MANAGE;
36
-
37
-    /**
38
-     * 是否保存请求的参数
39
-     */
40
-    public boolean isSaveRequestData() default true;
41
-
42
-    /**
43
-     * 是否保存响应的参数
44
-     */
45
-    public boolean isSaveResponseData() default true;
46
-
47
-    /**
48
-     * 排除指定的请求参数
49
-     */
50
-    public String[] excludeParamNames() default {};
51
-}

+ 0
- 40
ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java 파일 보기

@@ -1,40 +0,0 @@
1
-package com.ruoyi.common.annotation;
2
-
3
-import java.lang.annotation.Documented;
4
-import java.lang.annotation.ElementType;
5
-import java.lang.annotation.Retention;
6
-import java.lang.annotation.RetentionPolicy;
7
-import java.lang.annotation.Target;
8
-import com.ruoyi.common.constant.CacheConstants;
9
-import com.ruoyi.common.enums.LimitType;
10
-
11
-/**
12
- * 限流注解
13
- * 
14
- * @author ruoyi
15
- */
16
-@Target(ElementType.METHOD)
17
-@Retention(RetentionPolicy.RUNTIME)
18
-@Documented
19
-public @interface RateLimiter
20
-{
21
-    /**
22
-     * 限流key
23
-     */
24
-    public String key() default CacheConstants.RATE_LIMIT_KEY;
25
-
26
-    /**
27
-     * 限流时间,单位秒
28
-     */
29
-    public int time() default 60;
30
-
31
-    /**
32
-     * 限流次数
33
-     */
34
-    public int count() default 100;
35
-
36
-    /**
37
-     * 限流类型
38
-     */
39
-    public LimitType limitType() default LimitType.DEFAULT;
40
-}

+ 0
- 31
ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java 파일 보기

@@ -1,31 +0,0 @@
1
-package com.ruoyi.common.annotation;
2
-
3
-import java.lang.annotation.Documented;
4
-import java.lang.annotation.ElementType;
5
-import java.lang.annotation.Inherited;
6
-import java.lang.annotation.Retention;
7
-import java.lang.annotation.RetentionPolicy;
8
-import java.lang.annotation.Target;
9
-
10
-/**
11
- * 自定义注解防止表单重复提交
12
- * 
13
- * @author ruoyi
14
- *
15
- */
16
-@Inherited
17
-@Target(ElementType.METHOD)
18
-@Retention(RetentionPolicy.RUNTIME)
19
-@Documented
20
-public @interface RepeatSubmit
21
-{
22
-    /**
23
-     * 间隔时间(ms),小于此时间视为重复提交
24
-     */
25
-    public int interval() default 5000;
26
-
27
-    /**
28
-     * 提示消息
29
-     */
30
-    public String message() default "不允许重复提交,请稍候再试";
31
-}

+ 0
- 24
ruoyi-common/src/main/java/com/ruoyi/common/annotation/Sensitive.java 파일 보기

@@ -1,24 +0,0 @@
1
-package com.ruoyi.common.annotation;
2
-
3
-import java.lang.annotation.ElementType;
4
-import java.lang.annotation.Retention;
5
-import java.lang.annotation.RetentionPolicy;
6
-import java.lang.annotation.Target;
7
-import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
8
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
9
-import com.ruoyi.common.config.serializer.SensitiveJsonSerializer;
10
-import com.ruoyi.common.enums.DesensitizedType;
11
-
12
-/**
13
- * 数据脱敏注解
14
- *
15
- * @author ruoyi
16
- */
17
-@Retention(RetentionPolicy.RUNTIME)
18
-@Target(ElementType.FIELD)
19
-@JacksonAnnotationsInside
20
-@JsonSerialize(using = SensitiveJsonSerializer.class)
21
-public @interface Sensitive
22
-{
23
-    DesensitizedType desensitizedType();
24
-}

+ 0
- 122
ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java 파일 보기

@@ -1,122 +0,0 @@
1
-package com.ruoyi.common.config;
2
-
3
-import org.springframework.boot.context.properties.ConfigurationProperties;
4
-import org.springframework.stereotype.Component;
5
-
6
-/**
7
- * 读取项目相关配置
8
- * 
9
- * @author ruoyi
10
- */
11
-@Component
12
-@ConfigurationProperties(prefix = "ruoyi")
13
-public class RuoYiConfig
14
-{
15
-    /** 项目名称 */
16
-    private String name;
17
-
18
-    /** 版本 */
19
-    private String version;
20
-
21
-    /** 版权年份 */
22
-    private String copyrightYear;
23
-
24
-    /** 上传路径 */
25
-    private static String profile;
26
-
27
-    /** 获取地址开关 */
28
-    private static boolean addressEnabled;
29
-
30
-    /** 验证码类型 */
31
-    private static String captchaType;
32
-
33
-    public String getName()
34
-    {
35
-        return name;
36
-    }
37
-
38
-    public void setName(String name)
39
-    {
40
-        this.name = name;
41
-    }
42
-
43
-    public String getVersion()
44
-    {
45
-        return version;
46
-    }
47
-
48
-    public void setVersion(String version)
49
-    {
50
-        this.version = version;
51
-    }
52
-
53
-    public String getCopyrightYear()
54
-    {
55
-        return copyrightYear;
56
-    }
57
-
58
-    public void setCopyrightYear(String copyrightYear)
59
-    {
60
-        this.copyrightYear = copyrightYear;
61
-    }
62
-
63
-    public static String getProfile()
64
-    {
65
-        return profile;
66
-    }
67
-
68
-    public void setProfile(String profile)
69
-    {
70
-        RuoYiConfig.profile = profile;
71
-    }
72
-
73
-    public static boolean isAddressEnabled()
74
-    {
75
-        return addressEnabled;
76
-    }
77
-
78
-    public void setAddressEnabled(boolean addressEnabled)
79
-    {
80
-        RuoYiConfig.addressEnabled = addressEnabled;
81
-    }
82
-
83
-    public static String getCaptchaType() {
84
-        return captchaType;
85
-    }
86
-
87
-    public void setCaptchaType(String captchaType) {
88
-        RuoYiConfig.captchaType = captchaType;
89
-    }
90
-
91
-    /**
92
-     * 获取导入上传路径
93
-     */
94
-    public static String getImportPath()
95
-    {
96
-        return getProfile() + "/import";
97
-    }
98
-
99
-    /**
100
-     * 获取头像上传路径
101
-     */
102
-    public static String getAvatarPath()
103
-    {
104
-        return getProfile() + "/avatar";
105
-    }
106
-
107
-    /**
108
-     * 获取下载路径
109
-     */
110
-    public static String getDownloadPath()
111
-    {
112
-        return getProfile() + "/download/";
113
-    }
114
-
115
-    /**
116
-     * 获取上传路径
117
-     */
118
-    public static String getUploadPath()
119
-    {
120
-        return getProfile() + "/upload";
121
-    }
122
-}

+ 0
- 67
ruoyi-common/src/main/java/com/ruoyi/common/config/serializer/SensitiveJsonSerializer.java 파일 보기

@@ -1,67 +0,0 @@
1
-package com.ruoyi.common.config.serializer;
2
-
3
-import java.io.IOException;
4
-import java.util.Objects;
5
-import com.fasterxml.jackson.core.JsonGenerator;
6
-import com.fasterxml.jackson.databind.BeanProperty;
7
-import com.fasterxml.jackson.databind.JsonMappingException;
8
-import com.fasterxml.jackson.databind.JsonSerializer;
9
-import com.fasterxml.jackson.databind.SerializerProvider;
10
-import com.fasterxml.jackson.databind.ser.ContextualSerializer;
11
-import com.ruoyi.common.annotation.Sensitive;
12
-import com.ruoyi.common.core.domain.model.LoginUser;
13
-import com.ruoyi.common.enums.DesensitizedType;
14
-import com.ruoyi.common.utils.SecurityUtils;
15
-
16
-/**
17
- * 数据脱敏序列化过滤
18
- *
19
- * @author ruoyi
20
- */
21
-public class SensitiveJsonSerializer extends JsonSerializer<String> implements ContextualSerializer
22
-{
23
-    private DesensitizedType desensitizedType;
24
-
25
-    @Override
26
-    public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException
27
-    {
28
-        if (desensitization())
29
-        {
30
-            gen.writeString(desensitizedType.desensitizer().apply(value));
31
-        }
32
-        else
33
-        {
34
-            gen.writeString(value);
35
-        }
36
-    }
37
-
38
-    @Override
39
-    public JsonSerializer<?> createContextual(SerializerProvider prov, BeanProperty property)
40
-            throws JsonMappingException
41
-    {
42
-        Sensitive annotation = property.getAnnotation(Sensitive.class);
43
-        if (Objects.nonNull(annotation) && Objects.equals(String.class, property.getType().getRawClass()))
44
-        {
45
-            this.desensitizedType = annotation.desensitizedType();
46
-            return this;
47
-        }
48
-        return prov.findValueSerializer(property.getType(), property);
49
-    }
50
-
51
-    /**
52
-     * 是否需要脱敏处理
53
-     */
54
-    private boolean desensitization()
55
-    {
56
-        try
57
-        {
58
-            LoginUser securityUser = SecurityUtils.getLoginUser();
59
-            // 管理员不脱敏
60
-            return !securityUser.getUser().isAdmin();
61
-        }
62
-        catch (Exception e)
63
-        {
64
-            return true;
65
-        }
66
-    }
67
-}

+ 0
- 44
ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java 파일 보기

@@ -1,44 +0,0 @@
1
-package com.ruoyi.common.constant;
2
-
3
-/**
4
- * 缓存的key 常量
5
- * 
6
- * @author ruoyi
7
- */
8
-public class CacheConstants
9
-{
10
-    /**
11
-     * 登录用户 redis key
12
-     */
13
-    public static final String LOGIN_TOKEN_KEY = "login_tokens:";
14
-
15
-    /**
16
-     * 验证码 redis key
17
-     */
18
-    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
19
-
20
-    /**
21
-     * 参数管理 cache key
22
-     */
23
-    public static final String SYS_CONFIG_KEY = "sys_config:";
24
-
25
-    /**
26
-     * 字典管理 cache key
27
-     */
28
-    public static final String SYS_DICT_KEY = "sys_dict:";
29
-
30
-    /**
31
-     * 防重提交 redis key
32
-     */
33
-    public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";
34
-
35
-    /**
36
-     * 限流 redis key
37
-     */
38
-    public static final String RATE_LIMIT_KEY = "rate_limit:";
39
-
40
-    /**
41
-     * 登录账户密码错误次数 redis key
42
-     */
43
-    public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
44
-}

+ 0
- 173
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java 파일 보기

@@ -1,173 +0,0 @@
1
-package com.ruoyi.common.constant;
2
-
3
-import java.util.Locale;
4
-import io.jsonwebtoken.Claims;
5
-
6
-/**
7
- * 通用常量信息
8
- * 
9
- * @author ruoyi
10
- */
11
-public class Constants
12
-{
13
-    /**
14
-     * UTF-8 字符集
15
-     */
16
-    public static final String UTF8 = "UTF-8";
17
-
18
-    /**
19
-     * GBK 字符集
20
-     */
21
-    public static final String GBK = "GBK";
22
-
23
-    /**
24
-     * 系统语言
25
-     */
26
-    public static final Locale DEFAULT_LOCALE = Locale.SIMPLIFIED_CHINESE;
27
-
28
-    /**
29
-     * www主域
30
-     */
31
-    public static final String WWW = "www.";
32
-
33
-    /**
34
-     * http请求
35
-     */
36
-    public static final String HTTP = "http://";
37
-
38
-    /**
39
-     * https请求
40
-     */
41
-    public static final String HTTPS = "https://";
42
-
43
-    /**
44
-     * 通用成功标识
45
-     */
46
-    public static final String SUCCESS = "0";
47
-
48
-    /**
49
-     * 通用失败标识
50
-     */
51
-    public static final String FAIL = "1";
52
-
53
-    /**
54
-     * 登录成功
55
-     */
56
-    public static final String LOGIN_SUCCESS = "Success";
57
-
58
-    /**
59
-     * 注销
60
-     */
61
-    public static final String LOGOUT = "Logout";
62
-
63
-    /**
64
-     * 注册
65
-     */
66
-    public static final String REGISTER = "Register";
67
-
68
-    /**
69
-     * 登录失败
70
-     */
71
-    public static final String LOGIN_FAIL = "Error";
72
-
73
-    /**
74
-     * 所有权限标识
75
-     */
76
-    public static final String ALL_PERMISSION = "*:*:*";
77
-
78
-    /**
79
-     * 管理员角色权限标识
80
-     */
81
-    public static final String SUPER_ADMIN = "admin";
82
-
83
-    /**
84
-     * 角色权限分隔符
85
-     */
86
-    public static final String ROLE_DELIMETER = ",";
87
-
88
-    /**
89
-     * 权限标识分隔符
90
-     */
91
-    public static final String PERMISSION_DELIMETER = ",";
92
-
93
-    /**
94
-     * 验证码有效期(分钟)
95
-     */
96
-    public static final Integer CAPTCHA_EXPIRATION = 2;
97
-
98
-    /**
99
-     * 令牌
100
-     */
101
-    public static final String TOKEN = "token";
102
-
103
-    /**
104
-     * 令牌前缀
105
-     */
106
-    public static final String TOKEN_PREFIX = "Bearer ";
107
-
108
-    /**
109
-     * 令牌前缀
110
-     */
111
-    public static final String LOGIN_USER_KEY = "login_user_key";
112
-
113
-    /**
114
-     * 用户ID
115
-     */
116
-    public static final String JWT_USERID = "userid";
117
-
118
-    /**
119
-     * 用户名称
120
-     */
121
-    public static final String JWT_USERNAME = Claims.SUBJECT;
122
-
123
-    /**
124
-     * 用户头像
125
-     */
126
-    public static final String JWT_AVATAR = "avatar";
127
-
128
-    /**
129
-     * 创建时间
130
-     */
131
-    public static final String JWT_CREATED = "created";
132
-
133
-    /**
134
-     * 用户权限
135
-     */
136
-    public static final String JWT_AUTHORITIES = "authorities";
137
-
138
-    /**
139
-     * 资源映射路径 前缀
140
-     */
141
-    public static final String RESOURCE_PREFIX = "/profile";
142
-
143
-    /**
144
-     * RMI 远程方法调用
145
-     */
146
-    public static final String LOOKUP_RMI = "rmi:";
147
-
148
-    /**
149
-     * LDAP 远程方法调用
150
-     */
151
-    public static final String LOOKUP_LDAP = "ldap:";
152
-
153
-    /**
154
-     * LDAPS 远程方法调用
155
-     */
156
-    public static final String LOOKUP_LDAPS = "ldaps:";
157
-
158
-    /**
159
-     * 自动识别json对象白名单配置(仅允许解析的包名,范围越小越安全)
160
-     */
161
-    public static final String[] JSON_WHITELIST_STR = { "org.springframework", "com.ruoyi" };
162
-
163
-    /**
164
-     * 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
165
-     */
166
-    public static final String[] JOB_WHITELIST_STR = { "com.ruoyi.quartz.task" };
167
-
168
-    /**
169
-     * 定时任务违规的字符
170
-     */
171
-    public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
172
-            "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config", "com.ruoyi.generator" };
173
-}

+ 0
- 117
ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java 파일 보기

@@ -1,117 +0,0 @@
1
-package com.ruoyi.common.constant;
2
-
3
-/**
4
- * 代码生成通用常量
5
- * 
6
- * @author ruoyi
7
- */
8
-public class GenConstants
9
-{
10
-    /** 单表(增删改查) */
11
-    public static final String TPL_CRUD = "crud";
12
-
13
-    /** 树表(增删改查) */
14
-    public static final String TPL_TREE = "tree";
15
-
16
-    /** 主子表(增删改查) */
17
-    public static final String TPL_SUB = "sub";
18
-
19
-    /** 树编码字段 */
20
-    public static final String TREE_CODE = "treeCode";
21
-
22
-    /** 树父编码字段 */
23
-    public static final String TREE_PARENT_CODE = "treeParentCode";
24
-
25
-    /** 树名称字段 */
26
-    public static final String TREE_NAME = "treeName";
27
-
28
-    /** 上级菜单ID字段 */
29
-    public static final String PARENT_MENU_ID = "parentMenuId";
30
-
31
-    /** 上级菜单名称字段 */
32
-    public static final String PARENT_MENU_NAME = "parentMenuName";
33
-
34
-    /** 数据库字符串类型 */
35
-    public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2" };
36
-
37
-    /** 数据库文本类型 */
38
-    public static final String[] COLUMNTYPE_TEXT = { "tinytext", "text", "mediumtext", "longtext" };
39
-
40
-    /** 数据库时间类型 */
41
-    public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" };
42
-
43
-    /** 数据库数字类型 */
44
-    public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer",
45
-            "bit", "bigint", "float", "double", "decimal" };
46
-
47
-    /** 页面不需要编辑字段 */
48
-    public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" };
49
-
50
-    /** 页面不需要显示的列表字段 */
51
-    public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by",
52
-            "update_time" };
53
-
54
-    /** 页面不需要查询字段 */
55
-    public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by",
56
-            "update_time", "remark" };
57
-
58
-    /** Entity基类字段 */
59
-    public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" };
60
-
61
-    /** Tree基类字段 */
62
-    public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors", "children" };
63
-
64
-    /** 文本框 */
65
-    public static final String HTML_INPUT = "input";
66
-
67
-    /** 文本域 */
68
-    public static final String HTML_TEXTAREA = "textarea";
69
-
70
-    /** 下拉框 */
71
-    public static final String HTML_SELECT = "select";
72
-
73
-    /** 单选框 */
74
-    public static final String HTML_RADIO = "radio";
75
-
76
-    /** 复选框 */
77
-    public static final String HTML_CHECKBOX = "checkbox";
78
-
79
-    /** 日期控件 */
80
-    public static final String HTML_DATETIME = "datetime";
81
-
82
-    /** 图片上传控件 */
83
-    public static final String HTML_IMAGE_UPLOAD = "imageUpload";
84
-
85
-    /** 文件上传控件 */
86
-    public static final String HTML_FILE_UPLOAD = "fileUpload";
87
-
88
-    /** 富文本控件 */
89
-    public static final String HTML_EDITOR = "editor";
90
-
91
-    /** 字符串类型 */
92
-    public static final String TYPE_STRING = "String";
93
-
94
-    /** 整型 */
95
-    public static final String TYPE_INTEGER = "Integer";
96
-
97
-    /** 长整型 */
98
-    public static final String TYPE_LONG = "Long";
99
-
100
-    /** 浮点型 */
101
-    public static final String TYPE_DOUBLE = "Double";
102
-
103
-    /** 高精度计算类型 */
104
-    public static final String TYPE_BIGDECIMAL = "BigDecimal";
105
-
106
-    /** 时间类型 */
107
-    public static final String TYPE_DATE = "Date";
108
-
109
-    /** 模糊查询 */
110
-    public static final String QUERY_LIKE = "LIKE";
111
-
112
-    /** 相等查询 */
113
-    public static final String QUERY_EQ = "EQ";
114
-
115
-    /** 需要 */
116
-    public static final String REQUIRE = "1";
117
-}

+ 0
- 94
ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java 파일 보기

@@ -1,94 +0,0 @@
1
-package com.ruoyi.common.constant;
2
-
3
-/**
4
- * 返回状态码
5
- * 
6
- * @author ruoyi
7
- */
8
-public class HttpStatus
9
-{
10
-    /**
11
-     * 操作成功
12
-     */
13
-    public static final int SUCCESS = 200;
14
-
15
-    /**
16
-     * 对象创建成功
17
-     */
18
-    public static final int CREATED = 201;
19
-
20
-    /**
21
-     * 请求已经被接受
22
-     */
23
-    public static final int ACCEPTED = 202;
24
-
25
-    /**
26
-     * 操作已经执行成功,但是没有返回数据
27
-     */
28
-    public static final int NO_CONTENT = 204;
29
-
30
-    /**
31
-     * 资源已被移除
32
-     */
33
-    public static final int MOVED_PERM = 301;
34
-
35
-    /**
36
-     * 重定向
37
-     */
38
-    public static final int SEE_OTHER = 303;
39
-
40
-    /**
41
-     * 资源没有被修改
42
-     */
43
-    public static final int NOT_MODIFIED = 304;
44
-
45
-    /**
46
-     * 参数列表错误(缺少,格式不匹配)
47
-     */
48
-    public static final int BAD_REQUEST = 400;
49
-
50
-    /**
51
-     * 未授权
52
-     */
53
-    public static final int UNAUTHORIZED = 401;
54
-
55
-    /**
56
-     * 访问受限,授权过期
57
-     */
58
-    public static final int FORBIDDEN = 403;
59
-
60
-    /**
61
-     * 资源,服务未找到
62
-     */
63
-    public static final int NOT_FOUND = 404;
64
-
65
-    /**
66
-     * 不允许的http方法
67
-     */
68
-    public static final int BAD_METHOD = 405;
69
-
70
-    /**
71
-     * 资源冲突,或者资源被锁
72
-     */
73
-    public static final int CONFLICT = 409;
74
-
75
-    /**
76
-     * 不支持的数据,媒体类型
77
-     */
78
-    public static final int UNSUPPORTED_TYPE = 415;
79
-
80
-    /**
81
-     * 系统内部错误
82
-     */
83
-    public static final int ERROR = 500;
84
-
85
-    /**
86
-     * 接口未实现
87
-     */
88
-    public static final int NOT_IMPLEMENTED = 501;
89
-
90
-    /**
91
-     * 系统警告消息
92
-     */
93
-    public static final int WARN = 601;
94
-}

+ 0
- 50
ruoyi-common/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java 파일 보기

@@ -1,50 +0,0 @@
1
-package com.ruoyi.common.constant;
2
-
3
-/**
4
- * 任务调度通用常量
5
- * 
6
- * @author ruoyi
7
- */
8
-public class ScheduleConstants
9
-{
10
-    public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME";
11
-
12
-    /** 执行目标key */
13
-    public static final String TASK_PROPERTIES = "TASK_PROPERTIES";
14
-
15
-    /** 默认 */
16
-    public static final String MISFIRE_DEFAULT = "0";
17
-
18
-    /** 立即触发执行 */
19
-    public static final String MISFIRE_IGNORE_MISFIRES = "1";
20
-
21
-    /** 触发一次执行 */
22
-    public static final String MISFIRE_FIRE_AND_PROCEED = "2";
23
-
24
-    /** 不触发立即执行 */
25
-    public static final String MISFIRE_DO_NOTHING = "3";
26
-
27
-    public enum Status
28
-    {
29
-        /**
30
-         * 正常
31
-         */
32
-        NORMAL("0"),
33
-        /**
34
-         * 暂停
35
-         */
36
-        PAUSE("1");
37
-
38
-        private String value;
39
-
40
-        private Status(String value)
41
-        {
42
-            this.value = value;
43
-        }
44
-
45
-        public String getValue()
46
-        {
47
-            return value;
48
-        }
49
-    }
50
-}

+ 0
- 78
ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java 파일 보기

@@ -1,78 +0,0 @@
1
-package com.ruoyi.common.constant;
2
-
3
-/**
4
- * 用户常量信息
5
- * 
6
- * @author ruoyi
7
- */
8
-public class UserConstants
9
-{
10
-    /**
11
-     * 平台内系统用户的唯一标志
12
-     */
13
-    public static final String SYS_USER = "SYS_USER";
14
-
15
-    /** 正常状态 */
16
-    public static final String NORMAL = "0";
17
-
18
-    /** 异常状态 */
19
-    public static final String EXCEPTION = "1";
20
-
21
-    /** 用户封禁状态 */
22
-    public static final String USER_DISABLE = "1";
23
-
24
-    /** 角色封禁状态 */
25
-    public static final String ROLE_DISABLE = "1";
26
-
27
-    /** 部门正常状态 */
28
-    public static final String DEPT_NORMAL = "0";
29
-
30
-    /** 部门停用状态 */
31
-    public static final String DEPT_DISABLE = "1";
32
-
33
-    /** 字典正常状态 */
34
-    public static final String DICT_NORMAL = "0";
35
-
36
-    /** 是否为系统默认(是) */
37
-    public static final String YES = "Y";
38
-
39
-    /** 是否菜单外链(是) */
40
-    public static final String YES_FRAME = "0";
41
-
42
-    /** 是否菜单外链(否) */
43
-    public static final String NO_FRAME = "1";
44
-
45
-    /** 菜单类型(目录) */
46
-    public static final String TYPE_DIR = "M";
47
-
48
-    /** 菜单类型(菜单) */
49
-    public static final String TYPE_MENU = "C";
50
-
51
-    /** 菜单类型(按钮) */
52
-    public static final String TYPE_BUTTON = "F";
53
-
54
-    /** Layout组件标识 */
55
-    public final static String LAYOUT = "Layout";
56
-    
57
-    /** ParentView组件标识 */
58
-    public final static String PARENT_VIEW = "ParentView";
59
-
60
-    /** InnerLink组件标识 */
61
-    public final static String INNER_LINK = "InnerLink";
62
-
63
-    /** 校验是否唯一的返回标识 */
64
-    public final static boolean UNIQUE = true;
65
-    public final static boolean NOT_UNIQUE = false;
66
-
67
-    /**
68
-     * 用户名长度限制
69
-     */
70
-    public static final int USERNAME_MIN_LENGTH = 2;
71
-    public static final int USERNAME_MAX_LENGTH = 20;
72
-
73
-    /**
74
-     * 密码长度限制
75
-     */
76
-    public static final int PASSWORD_MIN_LENGTH = 5;
77
-    public static final int PASSWORD_MAX_LENGTH = 20;
78
-}

+ 0
- 202
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java 파일 보기

@@ -1,202 +0,0 @@
1
-package com.ruoyi.common.core.controller;
2
-
3
-import java.beans.PropertyEditorSupport;
4
-import java.util.Date;
5
-import java.util.List;
6
-import org.slf4j.Logger;
7
-import org.slf4j.LoggerFactory;
8
-import org.springframework.web.bind.WebDataBinder;
9
-import org.springframework.web.bind.annotation.InitBinder;
10
-import com.github.pagehelper.PageHelper;
11
-import com.github.pagehelper.PageInfo;
12
-import com.ruoyi.common.constant.HttpStatus;
13
-import com.ruoyi.common.core.domain.AjaxResult;
14
-import com.ruoyi.common.core.domain.model.LoginUser;
15
-import com.ruoyi.common.core.page.PageDomain;
16
-import com.ruoyi.common.core.page.TableDataInfo;
17
-import com.ruoyi.common.core.page.TableSupport;
18
-import com.ruoyi.common.utils.DateUtils;
19
-import com.ruoyi.common.utils.PageUtils;
20
-import com.ruoyi.common.utils.SecurityUtils;
21
-import com.ruoyi.common.utils.StringUtils;
22
-import com.ruoyi.common.utils.sql.SqlUtil;
23
-
24
-/**
25
- * web层通用数据处理
26
- * 
27
- * @author ruoyi
28
- */
29
-public class BaseController
30
-{
31
-    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
32
-
33
-    /**
34
-     * 将前台传递过来的日期格式的字符串,自动转化为Date类型
35
-     */
36
-    @InitBinder
37
-    public void initBinder(WebDataBinder binder)
38
-    {
39
-        // Date 类型转换
40
-        binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
41
-        {
42
-            @Override
43
-            public void setAsText(String text)
44
-            {
45
-                setValue(DateUtils.parseDate(text));
46
-            }
47
-        });
48
-    }
49
-
50
-    /**
51
-     * 设置请求分页数据
52
-     */
53
-    protected void startPage()
54
-    {
55
-        PageUtils.startPage();
56
-    }
57
-
58
-    /**
59
-     * 设置请求排序数据
60
-     */
61
-    protected void startOrderBy()
62
-    {
63
-        PageDomain pageDomain = TableSupport.buildPageRequest();
64
-        if (StringUtils.isNotEmpty(pageDomain.getOrderBy()))
65
-        {
66
-            String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
67
-            PageHelper.orderBy(orderBy);
68
-        }
69
-    }
70
-
71
-    /**
72
-     * 清理分页的线程变量
73
-     */
74
-    protected void clearPage()
75
-    {
76
-        PageUtils.clearPage();
77
-    }
78
-
79
-    /**
80
-     * 响应请求分页数据
81
-     */
82
-    @SuppressWarnings({ "rawtypes", "unchecked" })
83
-    protected TableDataInfo getDataTable(List<?> list)
84
-    {
85
-        TableDataInfo rspData = new TableDataInfo();
86
-        rspData.setCode(HttpStatus.SUCCESS);
87
-        rspData.setMsg("查询成功");
88
-        rspData.setRows(list);
89
-        rspData.setTotal(new PageInfo(list).getTotal());
90
-        return rspData;
91
-    }
92
-
93
-    /**
94
-     * 返回成功
95
-     */
96
-    public AjaxResult success()
97
-    {
98
-        return AjaxResult.success();
99
-    }
100
-
101
-    /**
102
-     * 返回失败消息
103
-     */
104
-    public AjaxResult error()
105
-    {
106
-        return AjaxResult.error();
107
-    }
108
-
109
-    /**
110
-     * 返回成功消息
111
-     */
112
-    public AjaxResult success(String message)
113
-    {
114
-        return AjaxResult.success(message);
115
-    }
116
-    
117
-    /**
118
-     * 返回成功消息
119
-     */
120
-    public AjaxResult success(Object data)
121
-    {
122
-        return AjaxResult.success(data);
123
-    }
124
-
125
-    /**
126
-     * 返回失败消息
127
-     */
128
-    public AjaxResult error(String message)
129
-    {
130
-        return AjaxResult.error(message);
131
-    }
132
-
133
-    /**
134
-     * 返回警告消息
135
-     */
136
-    public AjaxResult warn(String message)
137
-    {
138
-        return AjaxResult.warn(message);
139
-    }
140
-
141
-    /**
142
-     * 响应返回结果
143
-     * 
144
-     * @param rows 影响行数
145
-     * @return 操作结果
146
-     */
147
-    protected AjaxResult toAjax(int rows)
148
-    {
149
-        return rows > 0 ? AjaxResult.success() : AjaxResult.error();
150
-    }
151
-
152
-    /**
153
-     * 响应返回结果
154
-     * 
155
-     * @param result 结果
156
-     * @return 操作结果
157
-     */
158
-    protected AjaxResult toAjax(boolean result)
159
-    {
160
-        return result ? success() : error();
161
-    }
162
-
163
-    /**
164
-     * 页面跳转
165
-     */
166
-    public String redirect(String url)
167
-    {
168
-        return StringUtils.format("redirect:{}", url);
169
-    }
170
-
171
-    /**
172
-     * 获取用户缓存信息
173
-     */
174
-    public LoginUser getLoginUser()
175
-    {
176
-        return SecurityUtils.getLoginUser();
177
-    }
178
-
179
-    /**
180
-     * 获取登录用户id
181
-     */
182
-    public Long getUserId()
183
-    {
184
-        return getLoginUser().getUserId();
185
-    }
186
-
187
-    /**
188
-     * 获取登录部门id
189
-     */
190
-    public Long getDeptId()
191
-    {
192
-        return getLoginUser().getDeptId();
193
-    }
194
-
195
-    /**
196
-     * 获取登录用户名
197
-     */
198
-    public String getUsername()
199
-    {
200
-        return getLoginUser().getUsername();
201
-    }
202
-}

+ 0
- 216
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java 파일 보기

@@ -1,216 +0,0 @@
1
-package com.ruoyi.common.core.domain;
2
-
3
-import java.util.HashMap;
4
-import java.util.Objects;
5
-import com.ruoyi.common.constant.HttpStatus;
6
-import com.ruoyi.common.utils.StringUtils;
7
-
8
-/**
9
- * 操作消息提醒
10
- * 
11
- * @author ruoyi
12
- */
13
-public class AjaxResult extends HashMap<String, Object>
14
-{
15
-    private static final long serialVersionUID = 1L;
16
-
17
-    /** 状态码 */
18
-    public static final String CODE_TAG = "code";
19
-
20
-    /** 返回内容 */
21
-    public static final String MSG_TAG = "msg";
22
-
23
-    /** 数据对象 */
24
-    public static final String DATA_TAG = "data";
25
-
26
-    /**
27
-     * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
28
-     */
29
-    public AjaxResult()
30
-    {
31
-    }
32
-
33
-    /**
34
-     * 初始化一个新创建的 AjaxResult 对象
35
-     * 
36
-     * @param code 状态码
37
-     * @param msg 返回内容
38
-     */
39
-    public AjaxResult(int code, String msg)
40
-    {
41
-        super.put(CODE_TAG, code);
42
-        super.put(MSG_TAG, msg);
43
-    }
44
-
45
-    /**
46
-     * 初始化一个新创建的 AjaxResult 对象
47
-     * 
48
-     * @param code 状态码
49
-     * @param msg 返回内容
50
-     * @param data 数据对象
51
-     */
52
-    public AjaxResult(int code, String msg, Object data)
53
-    {
54
-        super.put(CODE_TAG, code);
55
-        super.put(MSG_TAG, msg);
56
-        if (StringUtils.isNotNull(data))
57
-        {
58
-            super.put(DATA_TAG, data);
59
-        }
60
-    }
61
-
62
-    /**
63
-     * 返回成功消息
64
-     * 
65
-     * @return 成功消息
66
-     */
67
-    public static AjaxResult success()
68
-    {
69
-        return AjaxResult.success("操作成功");
70
-    }
71
-
72
-    /**
73
-     * 返回成功数据
74
-     * 
75
-     * @return 成功消息
76
-     */
77
-    public static AjaxResult success(Object data)
78
-    {
79
-        return AjaxResult.success("操作成功", data);
80
-    }
81
-
82
-    /**
83
-     * 返回成功消息
84
-     * 
85
-     * @param msg 返回内容
86
-     * @return 成功消息
87
-     */
88
-    public static AjaxResult success(String msg)
89
-    {
90
-        return AjaxResult.success(msg, null);
91
-    }
92
-
93
-    /**
94
-     * 返回成功消息
95
-     * 
96
-     * @param msg 返回内容
97
-     * @param data 数据对象
98
-     * @return 成功消息
99
-     */
100
-    public static AjaxResult success(String msg, Object data)
101
-    {
102
-        return new AjaxResult(HttpStatus.SUCCESS, msg, data);
103
-    }
104
-
105
-    /**
106
-     * 返回警告消息
107
-     *
108
-     * @param msg 返回内容
109
-     * @return 警告消息
110
-     */
111
-    public static AjaxResult warn(String msg)
112
-    {
113
-        return AjaxResult.warn(msg, null);
114
-    }
115
-
116
-    /**
117
-     * 返回警告消息
118
-     *
119
-     * @param msg 返回内容
120
-     * @param data 数据对象
121
-     * @return 警告消息
122
-     */
123
-    public static AjaxResult warn(String msg, Object data)
124
-    {
125
-        return new AjaxResult(HttpStatus.WARN, msg, data);
126
-    }
127
-
128
-    /**
129
-     * 返回错误消息
130
-     * 
131
-     * @return 错误消息
132
-     */
133
-    public static AjaxResult error()
134
-    {
135
-        return AjaxResult.error("操作失败");
136
-    }
137
-
138
-    /**
139
-     * 返回错误消息
140
-     * 
141
-     * @param msg 返回内容
142
-     * @return 错误消息
143
-     */
144
-    public static AjaxResult error(String msg)
145
-    {
146
-        return AjaxResult.error(msg, null);
147
-    }
148
-
149
-    /**
150
-     * 返回错误消息
151
-     * 
152
-     * @param msg 返回内容
153
-     * @param data 数据对象
154
-     * @return 错误消息
155
-     */
156
-    public static AjaxResult error(String msg, Object data)
157
-    {
158
-        return new AjaxResult(HttpStatus.ERROR, msg, data);
159
-    }
160
-
161
-    /**
162
-     * 返回错误消息
163
-     * 
164
-     * @param code 状态码
165
-     * @param msg 返回内容
166
-     * @return 错误消息
167
-     */
168
-    public static AjaxResult error(int code, String msg)
169
-    {
170
-        return new AjaxResult(code, msg, null);
171
-    }
172
-
173
-    /**
174
-     * 是否为成功消息
175
-     *
176
-     * @return 结果
177
-     */
178
-    public boolean isSuccess()
179
-    {
180
-        return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG));
181
-    }
182
-
183
-    /**
184
-     * 是否为警告消息
185
-     *
186
-     * @return 结果
187
-     */
188
-    public boolean isWarn()
189
-    {
190
-        return Objects.equals(HttpStatus.WARN, this.get(CODE_TAG));
191
-    }
192
-
193
-    /**
194
-     * 是否为错误消息
195
-     *
196
-     * @return 结果
197
-     */
198
-    public boolean isError()
199
-    {
200
-        return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG));
201
-    }
202
-
203
-    /**
204
-     * 方便链式调用
205
-     *
206
-     * @param key 键
207
-     * @param value 值
208
-     * @return 数据对象
209
-     */
210
-    @Override
211
-    public AjaxResult put(String key, Object value)
212
-    {
213
-        super.put(key, value);
214
-        return this;
215
-    }
216
-}

+ 0
- 118
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java 파일 보기

@@ -1,118 +0,0 @@
1
-package com.ruoyi.common.core.domain;
2
-
3
-import java.io.Serializable;
4
-import java.util.Date;
5
-import java.util.HashMap;
6
-import java.util.Map;
7
-import com.fasterxml.jackson.annotation.JsonFormat;
8
-import com.fasterxml.jackson.annotation.JsonIgnore;
9
-import com.fasterxml.jackson.annotation.JsonInclude;
10
-
11
-/**
12
- * Entity基类
13
- * 
14
- * @author ruoyi
15
- */
16
-public class BaseEntity implements Serializable
17
-{
18
-    private static final long serialVersionUID = 1L;
19
-
20
-    /** 搜索值 */
21
-    @JsonIgnore
22
-    private String searchValue;
23
-
24
-    /** 创建者 */
25
-    private String createBy;
26
-
27
-    /** 创建时间 */
28
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
29
-    private Date createTime;
30
-
31
-    /** 更新者 */
32
-    private String updateBy;
33
-
34
-    /** 更新时间 */
35
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
36
-    private Date updateTime;
37
-
38
-    /** 备注 */
39
-    private String remark;
40
-
41
-    /** 请求参数 */
42
-    @JsonInclude(JsonInclude.Include.NON_EMPTY)
43
-    private Map<String, Object> params;
44
-
45
-    public String getSearchValue()
46
-    {
47
-        return searchValue;
48
-    }
49
-
50
-    public void setSearchValue(String searchValue)
51
-    {
52
-        this.searchValue = searchValue;
53
-    }
54
-
55
-    public String getCreateBy()
56
-    {
57
-        return createBy;
58
-    }
59
-
60
-    public void setCreateBy(String createBy)
61
-    {
62
-        this.createBy = createBy;
63
-    }
64
-
65
-    public Date getCreateTime()
66
-    {
67
-        return createTime;
68
-    }
69
-
70
-    public void setCreateTime(Date createTime)
71
-    {
72
-        this.createTime = createTime;
73
-    }
74
-
75
-    public String getUpdateBy()
76
-    {
77
-        return updateBy;
78
-    }
79
-
80
-    public void setUpdateBy(String updateBy)
81
-    {
82
-        this.updateBy = updateBy;
83
-    }
84
-
85
-    public Date getUpdateTime()
86
-    {
87
-        return updateTime;
88
-    }
89
-
90
-    public void setUpdateTime(Date updateTime)
91
-    {
92
-        this.updateTime = updateTime;
93
-    }
94
-
95
-    public String getRemark()
96
-    {
97
-        return remark;
98
-    }
99
-
100
-    public void setRemark(String remark)
101
-    {
102
-        this.remark = remark;
103
-    }
104
-
105
-    public Map<String, Object> getParams()
106
-    {
107
-        if (params == null)
108
-        {
109
-            params = new HashMap<>();
110
-        }
111
-        return params;
112
-    }
113
-
114
-    public void setParams(Map<String, Object> params)
115
-    {
116
-        this.params = params;
117
-    }
118
-}

+ 0
- 115
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java 파일 보기

@@ -1,115 +0,0 @@
1
-package com.ruoyi.common.core.domain;
2
-
3
-import java.io.Serializable;
4
-import com.ruoyi.common.constant.HttpStatus;
5
-
6
-/**
7
- * 响应信息主体
8
- *
9
- * @author ruoyi
10
- */
11
-public class R<T> implements Serializable
12
-{
13
-    private static final long serialVersionUID = 1L;
14
-
15
-    /** 成功 */
16
-    public static final int SUCCESS = HttpStatus.SUCCESS;
17
-
18
-    /** 失败 */
19
-    public static final int FAIL = HttpStatus.ERROR;
20
-
21
-    private int code;
22
-
23
-    private String msg;
24
-
25
-    private T data;
26
-
27
-    public static <T> R<T> ok()
28
-    {
29
-        return restResult(null, SUCCESS, "操作成功");
30
-    }
31
-
32
-    public static <T> R<T> ok(T data)
33
-    {
34
-        return restResult(data, SUCCESS, "操作成功");
35
-    }
36
-
37
-    public static <T> R<T> ok(T data, String msg)
38
-    {
39
-        return restResult(data, SUCCESS, msg);
40
-    }
41
-
42
-    public static <T> R<T> fail()
43
-    {
44
-        return restResult(null, FAIL, "操作失败");
45
-    }
46
-
47
-    public static <T> R<T> fail(String msg)
48
-    {
49
-        return restResult(null, FAIL, msg);
50
-    }
51
-
52
-    public static <T> R<T> fail(T data)
53
-    {
54
-        return restResult(data, FAIL, "操作失败");
55
-    }
56
-
57
-    public static <T> R<T> fail(T data, String msg)
58
-    {
59
-        return restResult(data, FAIL, msg);
60
-    }
61
-
62
-    public static <T> R<T> fail(int code, String msg)
63
-    {
64
-        return restResult(null, code, msg);
65
-    }
66
-
67
-    private static <T> R<T> restResult(T data, int code, String msg)
68
-    {
69
-        R<T> apiResult = new R<>();
70
-        apiResult.setCode(code);
71
-        apiResult.setData(data);
72
-        apiResult.setMsg(msg);
73
-        return apiResult;
74
-    }
75
-
76
-    public int getCode()
77
-    {
78
-        return code;
79
-    }
80
-
81
-    public void setCode(int code)
82
-    {
83
-        this.code = code;
84
-    }
85
-
86
-    public String getMsg()
87
-    {
88
-        return msg;
89
-    }
90
-
91
-    public void setMsg(String msg)
92
-    {
93
-        this.msg = msg;
94
-    }
95
-
96
-    public T getData()
97
-    {
98
-        return data;
99
-    }
100
-
101
-    public void setData(T data)
102
-    {
103
-        this.data = data;
104
-    }
105
-
106
-    public static <T> Boolean isError(R<T> ret)
107
-    {
108
-        return !isSuccess(ret);
109
-    }
110
-
111
-    public static <T> Boolean isSuccess(R<T> ret)
112
-    {
113
-        return R.SUCCESS == ret.getCode();
114
-    }
115
-}

+ 0
- 79
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java 파일 보기

@@ -1,79 +0,0 @@
1
-package com.ruoyi.common.core.domain;
2
-
3
-import java.util.ArrayList;
4
-import java.util.List;
5
-
6
-/**
7
- * Tree基类
8
- * 
9
- * @author ruoyi
10
- */
11
-public class TreeEntity extends BaseEntity
12
-{
13
-    private static final long serialVersionUID = 1L;
14
-
15
-    /** 父菜单名称 */
16
-    private String parentName;
17
-
18
-    /** 父菜单ID */
19
-    private Long parentId;
20
-
21
-    /** 显示顺序 */
22
-    private Integer orderNum;
23
-
24
-    /** 祖级列表 */
25
-    private String ancestors;
26
-
27
-    /** 子部门 */
28
-    private List<?> children = new ArrayList<>();
29
-
30
-    public String getParentName()
31
-    {
32
-        return parentName;
33
-    }
34
-
35
-    public void setParentName(String parentName)
36
-    {
37
-        this.parentName = parentName;
38
-    }
39
-
40
-    public Long getParentId()
41
-    {
42
-        return parentId;
43
-    }
44
-
45
-    public void setParentId(Long parentId)
46
-    {
47
-        this.parentId = parentId;
48
-    }
49
-
50
-    public Integer getOrderNum()
51
-    {
52
-        return orderNum;
53
-    }
54
-
55
-    public void setOrderNum(Integer orderNum)
56
-    {
57
-        this.orderNum = orderNum;
58
-    }
59
-
60
-    public String getAncestors()
61
-    {
62
-        return ancestors;
63
-    }
64
-
65
-    public void setAncestors(String ancestors)
66
-    {
67
-        this.ancestors = ancestors;
68
-    }
69
-
70
-    public List<?> getChildren()
71
-    {
72
-        return children;
73
-    }
74
-
75
-    public void setChildren(List<?> children)
76
-    {
77
-        this.children = children;
78
-    }
79
-}

+ 0
- 77
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java 파일 보기

@@ -1,77 +0,0 @@
1
-package com.ruoyi.common.core.domain;
2
-
3
-import java.io.Serializable;
4
-import java.util.List;
5
-import java.util.stream.Collectors;
6
-import com.fasterxml.jackson.annotation.JsonInclude;
7
-import com.ruoyi.common.core.domain.entity.SysDept;
8
-import com.ruoyi.common.core.domain.entity.SysMenu;
9
-
10
-/**
11
- * Treeselect树结构实体类
12
- * 
13
- * @author ruoyi
14
- */
15
-public class TreeSelect implements Serializable
16
-{
17
-    private static final long serialVersionUID = 1L;
18
-
19
-    /** 节点ID */
20
-    private Long id;
21
-
22
-    /** 节点名称 */
23
-    private String label;
24
-
25
-    /** 子节点 */
26
-    @JsonInclude(JsonInclude.Include.NON_EMPTY)
27
-    private List<TreeSelect> children;
28
-
29
-    public TreeSelect()
30
-    {
31
-
32
-    }
33
-
34
-    public TreeSelect(SysDept dept)
35
-    {
36
-        this.id = dept.getDeptId();
37
-        this.label = dept.getDeptName();
38
-        this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
39
-    }
40
-
41
-    public TreeSelect(SysMenu menu)
42
-    {
43
-        this.id = menu.getMenuId();
44
-        this.label = menu.getMenuName();
45
-        this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
46
-    }
47
-
48
-    public Long getId()
49
-    {
50
-        return id;
51
-    }
52
-
53
-    public void setId(Long id)
54
-    {
55
-        this.id = id;
56
-    }
57
-
58
-    public String getLabel()
59
-    {
60
-        return label;
61
-    }
62
-
63
-    public void setLabel(String label)
64
-    {
65
-        this.label = label;
66
-    }
67
-
68
-    public List<TreeSelect> getChildren()
69
-    {
70
-        return children;
71
-    }
72
-
73
-    public void setChildren(List<TreeSelect> children)
74
-    {
75
-        this.children = children;
76
-    }
77
-}

+ 0
- 203
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java 파일 보기

@@ -1,203 +0,0 @@
1
-package com.ruoyi.common.core.domain.entity;
2
-
3
-import java.util.ArrayList;
4
-import java.util.List;
5
-import javax.validation.constraints.Email;
6
-import javax.validation.constraints.NotBlank;
7
-import javax.validation.constraints.NotNull;
8
-import javax.validation.constraints.Size;
9
-import org.apache.commons.lang3.builder.ToStringBuilder;
10
-import org.apache.commons.lang3.builder.ToStringStyle;
11
-import com.ruoyi.common.core.domain.BaseEntity;
12
-
13
-/**
14
- * 部门表 sys_dept
15
- * 
16
- * @author ruoyi
17
- */
18
-public class SysDept extends BaseEntity
19
-{
20
-    private static final long serialVersionUID = 1L;
21
-
22
-    /** 部门ID */
23
-    private Long deptId;
24
-
25
-    /** 父部门ID */
26
-    private Long parentId;
27
-
28
-    /** 祖级列表 */
29
-    private String ancestors;
30
-
31
-    /** 部门名称 */
32
-    private String deptName;
33
-
34
-    /** 显示顺序 */
35
-    private Integer orderNum;
36
-
37
-    /** 负责人 */
38
-    private String leader;
39
-
40
-    /** 联系电话 */
41
-    private String phone;
42
-
43
-    /** 邮箱 */
44
-    private String email;
45
-
46
-    /** 部门状态:0正常,1停用 */
47
-    private String status;
48
-
49
-    /** 删除标志(0代表存在 2代表删除) */
50
-    private String delFlag;
51
-
52
-    /** 父部门名称 */
53
-    private String parentName;
54
-    
55
-    /** 子部门 */
56
-    private List<SysDept> children = new ArrayList<SysDept>();
57
-
58
-    public Long getDeptId()
59
-    {
60
-        return deptId;
61
-    }
62
-
63
-    public void setDeptId(Long deptId)
64
-    {
65
-        this.deptId = deptId;
66
-    }
67
-
68
-    public Long getParentId()
69
-    {
70
-        return parentId;
71
-    }
72
-
73
-    public void setParentId(Long parentId)
74
-    {
75
-        this.parentId = parentId;
76
-    }
77
-
78
-    public String getAncestors()
79
-    {
80
-        return ancestors;
81
-    }
82
-
83
-    public void setAncestors(String ancestors)
84
-    {
85
-        this.ancestors = ancestors;
86
-    }
87
-
88
-    @NotBlank(message = "部门名称不能为空")
89
-    @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符")
90
-    public String getDeptName()
91
-    {
92
-        return deptName;
93
-    }
94
-
95
-    public void setDeptName(String deptName)
96
-    {
97
-        this.deptName = deptName;
98
-    }
99
-
100
-    @NotNull(message = "显示顺序不能为空")
101
-    public Integer getOrderNum()
102
-    {
103
-        return orderNum;
104
-    }
105
-
106
-    public void setOrderNum(Integer orderNum)
107
-    {
108
-        this.orderNum = orderNum;
109
-    }
110
-
111
-    public String getLeader()
112
-    {
113
-        return leader;
114
-    }
115
-
116
-    public void setLeader(String leader)
117
-    {
118
-        this.leader = leader;
119
-    }
120
-
121
-    @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符")
122
-    public String getPhone()
123
-    {
124
-        return phone;
125
-    }
126
-
127
-    public void setPhone(String phone)
128
-    {
129
-        this.phone = phone;
130
-    }
131
-
132
-    @Email(message = "邮箱格式不正确")
133
-    @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
134
-    public String getEmail()
135
-    {
136
-        return email;
137
-    }
138
-
139
-    public void setEmail(String email)
140
-    {
141
-        this.email = email;
142
-    }
143
-
144
-    public String getStatus()
145
-    {
146
-        return status;
147
-    }
148
-
149
-    public void setStatus(String status)
150
-    {
151
-        this.status = status;
152
-    }
153
-
154
-    public String getDelFlag()
155
-    {
156
-        return delFlag;
157
-    }
158
-
159
-    public void setDelFlag(String delFlag)
160
-    {
161
-        this.delFlag = delFlag;
162
-    }
163
-
164
-    public String getParentName()
165
-    {
166
-        return parentName;
167
-    }
168
-
169
-    public void setParentName(String parentName)
170
-    {
171
-        this.parentName = parentName;
172
-    }
173
-
174
-    public List<SysDept> getChildren()
175
-    {
176
-        return children;
177
-    }
178
-
179
-    public void setChildren(List<SysDept> children)
180
-    {
181
-        this.children = children;
182
-    }
183
-
184
-    @Override
185
-    public String toString() {
186
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
187
-            .append("deptId", getDeptId())
188
-            .append("parentId", getParentId())
189
-            .append("ancestors", getAncestors())
190
-            .append("deptName", getDeptName())
191
-            .append("orderNum", getOrderNum())
192
-            .append("leader", getLeader())
193
-            .append("phone", getPhone())
194
-            .append("email", getEmail())
195
-            .append("status", getStatus())
196
-            .append("delFlag", getDelFlag())
197
-            .append("createBy", getCreateBy())
198
-            .append("createTime", getCreateTime())
199
-            .append("updateBy", getUpdateBy())
200
-            .append("updateTime", getUpdateTime())
201
-            .toString();
202
-    }
203
-}

+ 0
- 176
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java 파일 보기

@@ -1,176 +0,0 @@
1
-package com.ruoyi.common.core.domain.entity;
2
-
3
-import javax.validation.constraints.NotBlank;
4
-import javax.validation.constraints.Size;
5
-import org.apache.commons.lang3.builder.ToStringBuilder;
6
-import org.apache.commons.lang3.builder.ToStringStyle;
7
-import com.ruoyi.common.annotation.Excel;
8
-import com.ruoyi.common.annotation.Excel.ColumnType;
9
-import com.ruoyi.common.constant.UserConstants;
10
-import com.ruoyi.common.core.domain.BaseEntity;
11
-
12
-/**
13
- * 字典数据表 sys_dict_data
14
- * 
15
- * @author ruoyi
16
- */
17
-public class SysDictData extends BaseEntity
18
-{
19
-    private static final long serialVersionUID = 1L;
20
-
21
-    /** 字典编码 */
22
-    @Excel(name = "字典编码", cellType = ColumnType.NUMERIC)
23
-    private Long dictCode;
24
-
25
-    /** 字典排序 */
26
-    @Excel(name = "字典排序", cellType = ColumnType.NUMERIC)
27
-    private Long dictSort;
28
-
29
-    /** 字典标签 */
30
-    @Excel(name = "字典标签")
31
-    private String dictLabel;
32
-
33
-    /** 字典键值 */
34
-    @Excel(name = "字典键值")
35
-    private String dictValue;
36
-
37
-    /** 字典类型 */
38
-    @Excel(name = "字典类型")
39
-    private String dictType;
40
-
41
-    /** 样式属性(其他样式扩展) */
42
-    private String cssClass;
43
-
44
-    /** 表格字典样式 */
45
-    private String listClass;
46
-
47
-    /** 是否默认(Y是 N否) */
48
-    @Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
49
-    private String isDefault;
50
-
51
-    /** 状态(0正常 1停用) */
52
-    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
53
-    private String status;
54
-
55
-    public Long getDictCode()
56
-    {
57
-        return dictCode;
58
-    }
59
-
60
-    public void setDictCode(Long dictCode)
61
-    {
62
-        this.dictCode = dictCode;
63
-    }
64
-
65
-    public Long getDictSort()
66
-    {
67
-        return dictSort;
68
-    }
69
-
70
-    public void setDictSort(Long dictSort)
71
-    {
72
-        this.dictSort = dictSort;
73
-    }
74
-
75
-    @NotBlank(message = "字典标签不能为空")
76
-    @Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
77
-    public String getDictLabel()
78
-    {
79
-        return dictLabel;
80
-    }
81
-
82
-    public void setDictLabel(String dictLabel)
83
-    {
84
-        this.dictLabel = dictLabel;
85
-    }
86
-
87
-    @NotBlank(message = "字典键值不能为空")
88
-    @Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
89
-    public String getDictValue()
90
-    {
91
-        return dictValue;
92
-    }
93
-
94
-    public void setDictValue(String dictValue)
95
-    {
96
-        this.dictValue = dictValue;
97
-    }
98
-
99
-    @NotBlank(message = "字典类型不能为空")
100
-    @Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
101
-    public String getDictType()
102
-    {
103
-        return dictType;
104
-    }
105
-
106
-    public void setDictType(String dictType)
107
-    {
108
-        this.dictType = dictType;
109
-    }
110
-
111
-    @Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
112
-    public String getCssClass()
113
-    {
114
-        return cssClass;
115
-    }
116
-
117
-    public void setCssClass(String cssClass)
118
-    {
119
-        this.cssClass = cssClass;
120
-    }
121
-
122
-    public String getListClass()
123
-    {
124
-        return listClass;
125
-    }
126
-
127
-    public void setListClass(String listClass)
128
-    {
129
-        this.listClass = listClass;
130
-    }
131
-
132
-    public boolean getDefault()
133
-    {
134
-        return UserConstants.YES.equals(this.isDefault);
135
-    }
136
-
137
-    public String getIsDefault()
138
-    {
139
-        return isDefault;
140
-    }
141
-
142
-    public void setIsDefault(String isDefault)
143
-    {
144
-        this.isDefault = isDefault;
145
-    }
146
-
147
-    public String getStatus()
148
-    {
149
-        return status;
150
-    }
151
-
152
-    public void setStatus(String status)
153
-    {
154
-        this.status = status;
155
-    }
156
-    
157
-    @Override
158
-    public String toString() {
159
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
160
-            .append("dictCode", getDictCode())
161
-            .append("dictSort", getDictSort())
162
-            .append("dictLabel", getDictLabel())
163
-            .append("dictValue", getDictValue())
164
-            .append("dictType", getDictType())
165
-            .append("cssClass", getCssClass())
166
-            .append("listClass", getListClass())
167
-            .append("isDefault", getIsDefault())
168
-            .append("status", getStatus())
169
-            .append("createBy", getCreateBy())
170
-            .append("createTime", getCreateTime())
171
-            .append("updateBy", getUpdateBy())
172
-            .append("updateTime", getUpdateTime())
173
-            .append("remark", getRemark())
174
-            .toString();
175
-    }
176
-}

+ 0
- 96
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java 파일 보기

@@ -1,96 +0,0 @@
1
-package com.ruoyi.common.core.domain.entity;
2
-
3
-import javax.validation.constraints.NotBlank;
4
-import javax.validation.constraints.Pattern;
5
-import javax.validation.constraints.Size;
6
-import org.apache.commons.lang3.builder.ToStringBuilder;
7
-import org.apache.commons.lang3.builder.ToStringStyle;
8
-import com.ruoyi.common.annotation.Excel;
9
-import com.ruoyi.common.annotation.Excel.ColumnType;
10
-import com.ruoyi.common.core.domain.BaseEntity;
11
-
12
-/**
13
- * 字典类型表 sys_dict_type
14
- * 
15
- * @author ruoyi
16
- */
17
-public class SysDictType extends BaseEntity
18
-{
19
-    private static final long serialVersionUID = 1L;
20
-
21
-    /** 字典主键 */
22
-    @Excel(name = "字典主键", cellType = ColumnType.NUMERIC)
23
-    private Long dictId;
24
-
25
-    /** 字典名称 */
26
-    @Excel(name = "字典名称")
27
-    private String dictName;
28
-
29
-    /** 字典类型 */
30
-    @Excel(name = "字典类型")
31
-    private String dictType;
32
-
33
-    /** 状态(0正常 1停用) */
34
-    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
35
-    private String status;
36
-
37
-    public Long getDictId()
38
-    {
39
-        return dictId;
40
-    }
41
-
42
-    public void setDictId(Long dictId)
43
-    {
44
-        this.dictId = dictId;
45
-    }
46
-
47
-    @NotBlank(message = "字典名称不能为空")
48
-    @Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
49
-    public String getDictName()
50
-    {
51
-        return dictName;
52
-    }
53
-
54
-    public void setDictName(String dictName)
55
-    {
56
-        this.dictName = dictName;
57
-    }
58
-
59
-    @NotBlank(message = "字典类型不能为空")
60
-    @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
61
-    @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)")
62
-    public String getDictType()
63
-    {
64
-        return dictType;
65
-    }
66
-
67
-    public void setDictType(String dictType)
68
-    {
69
-        this.dictType = dictType;
70
-    }
71
-
72
-    public String getStatus()
73
-    {
74
-        return status;
75
-    }
76
-
77
-    public void setStatus(String status)
78
-    {
79
-        this.status = status;
80
-    }
81
-    
82
-    @Override
83
-    public String toString() {
84
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
85
-            .append("dictId", getDictId())
86
-            .append("dictName", getDictName())
87
-            .append("dictType", getDictType())
88
-            .append("status", getStatus())
89
-            .append("createBy", getCreateBy())
90
-            .append("createTime", getCreateTime())
91
-            .append("updateBy", getUpdateBy())
92
-            .append("updateTime", getUpdateTime())
93
-            .append("remark", getRemark())
94
-            .toString();
95
-    }
96
-}

+ 0
- 259
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java 파일 보기

@@ -1,259 +0,0 @@
1
-package com.ruoyi.common.core.domain.entity;
2
-
3
-import java.util.ArrayList;
4
-import java.util.List;
5
-import javax.validation.constraints.NotBlank;
6
-import javax.validation.constraints.NotNull;
7
-import javax.validation.constraints.Size;
8
-import org.apache.commons.lang3.builder.ToStringBuilder;
9
-import org.apache.commons.lang3.builder.ToStringStyle;
10
-import com.ruoyi.common.core.domain.BaseEntity;
11
-
12
-/**
13
- * 菜单权限表 sys_menu
14
- * 
15
- * @author ruoyi
16
- */
17
-public class SysMenu extends BaseEntity
18
-{
19
-    private static final long serialVersionUID = 1L;
20
-
21
-    /** 菜单ID */
22
-    private Long menuId;
23
-
24
-    /** 菜单名称 */
25
-    private String menuName;
26
-
27
-    /** 父菜单名称 */
28
-    private String parentName;
29
-
30
-    /** 父菜单ID */
31
-    private Long parentId;
32
-
33
-    /** 显示顺序 */
34
-    private Integer orderNum;
35
-
36
-    /** 路由地址 */
37
-    private String path;
38
-
39
-    /** 组件路径 */
40
-    private String component;
41
-
42
-    /** 路由参数 */
43
-    private String query;
44
-
45
-    /** 是否为外链(0是 1否) */
46
-    private String isFrame;
47
-
48
-    /** 是否缓存(0缓存 1不缓存) */
49
-    private String isCache;
50
-
51
-    /** 类型(M目录 C菜单 F按钮) */
52
-    private String menuType;
53
-
54
-    /** 显示状态(0显示 1隐藏) */
55
-    private String visible;
56
-    
57
-    /** 菜单状态(0正常 1停用) */
58
-    private String status;
59
-
60
-    /** 权限字符串 */
61
-    private String perms;
62
-
63
-    /** 菜单图标 */
64
-    private String icon;
65
-
66
-    /** 子菜单 */
67
-    private List<SysMenu> children = new ArrayList<SysMenu>();
68
-
69
-    public Long getMenuId()
70
-    {
71
-        return menuId;
72
-    }
73
-
74
-    public void setMenuId(Long menuId)
75
-    {
76
-        this.menuId = menuId;
77
-    }
78
-
79
-    @NotBlank(message = "菜单名称不能为空")
80
-    @Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符")
81
-    public String getMenuName()
82
-    {
83
-        return menuName;
84
-    }
85
-
86
-    public void setMenuName(String menuName)
87
-    {
88
-        this.menuName = menuName;
89
-    }
90
-
91
-    public String getParentName()
92
-    {
93
-        return parentName;
94
-    }
95
-
96
-    public void setParentName(String parentName)
97
-    {
98
-        this.parentName = parentName;
99
-    }
100
-
101
-    public Long getParentId()
102
-    {
103
-        return parentId;
104
-    }
105
-
106
-    public void setParentId(Long parentId)
107
-    {
108
-        this.parentId = parentId;
109
-    }
110
-
111
-    @NotNull(message = "显示顺序不能为空")
112
-    public Integer getOrderNum()
113
-    {
114
-        return orderNum;
115
-    }
116
-
117
-    public void setOrderNum(Integer orderNum)
118
-    {
119
-        this.orderNum = orderNum;
120
-    }
121
-
122
-    @Size(min = 0, max = 200, message = "路由地址不能超过200个字符")
123
-    public String getPath()
124
-    {
125
-        return path;
126
-    }
127
-
128
-    public void setPath(String path)
129
-    {
130
-        this.path = path;
131
-    }
132
-
133
-    @Size(min = 0, max = 200, message = "组件路径不能超过255个字符")
134
-    public String getComponent()
135
-    {
136
-        return component;
137
-    }
138
-
139
-    public void setComponent(String component)
140
-    {
141
-        this.component = component;
142
-    }
143
-
144
-    public String getQuery()
145
-    {
146
-        return query;
147
-    }
148
-
149
-    public void setQuery(String query)
150
-    {
151
-        this.query = query;
152
-    }
153
-
154
-    public String getIsFrame()
155
-    {
156
-        return isFrame;
157
-    }
158
-
159
-    public void setIsFrame(String isFrame)
160
-    {
161
-        this.isFrame = isFrame;
162
-    }
163
-
164
-    public String getIsCache()
165
-    {
166
-        return isCache;
167
-    }
168
-
169
-    public void setIsCache(String isCache)
170
-    {
171
-        this.isCache = isCache;
172
-    }
173
-
174
-    @NotBlank(message = "菜单类型不能为空")
175
-    public String getMenuType()
176
-    {
177
-        return menuType;
178
-    }
179
-
180
-    public void setMenuType(String menuType)
181
-    {
182
-        this.menuType = menuType;
183
-    }
184
-
185
-    public String getVisible()
186
-    {
187
-        return visible;
188
-    }
189
-
190
-    public void setVisible(String visible)
191
-    {
192
-        this.visible = visible;
193
-    }
194
-
195
-    public String getStatus()
196
-    {
197
-        return status;
198
-    }
199
-
200
-    public void setStatus(String status)
201
-    {
202
-        this.status = status;
203
-    }
204
-
205
-    @Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符")
206
-    public String getPerms()
207
-    {
208
-        return perms;
209
-    }
210
-
211
-    public void setPerms(String perms)
212
-    {
213
-        this.perms = perms;
214
-    }
215
-
216
-    public String getIcon()
217
-    {
218
-        return icon;
219
-    }
220
-
221
-    public void setIcon(String icon)
222
-    {
223
-        this.icon = icon;
224
-    }
225
-
226
-    public List<SysMenu> getChildren()
227
-    {
228
-        return children;
229
-    }
230
-
231
-    public void setChildren(List<SysMenu> children)
232
-    {
233
-        this.children = children;
234
-    }
235
-    
236
-    @Override
237
-    public String toString() {
238
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
239
-            .append("menuId", getMenuId())
240
-            .append("menuName", getMenuName())
241
-            .append("parentId", getParentId())
242
-            .append("orderNum", getOrderNum())
243
-            .append("path", getPath())
244
-            .append("component", getComponent())
245
-            .append("isFrame", getIsFrame())
246
-            .append("IsCache", getIsCache())
247
-            .append("menuType", getMenuType())
248
-            .append("visible", getVisible())
249
-            .append("status ", getStatus())
250
-            .append("perms", getPerms())
251
-            .append("icon", getIcon())
252
-            .append("createBy", getCreateBy())
253
-            .append("createTime", getCreateTime())
254
-            .append("updateBy", getUpdateBy())
255
-            .append("updateTime", getUpdateTime())
256
-            .append("remark", getRemark())
257
-            .toString();
258
-    }
259
-}

+ 0
- 241
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java 파일 보기

@@ -1,241 +0,0 @@
1
-package com.ruoyi.common.core.domain.entity;
2
-
3
-import java.util.Set;
4
-import javax.validation.constraints.NotBlank;
5
-import javax.validation.constraints.NotNull;
6
-import javax.validation.constraints.Size;
7
-import org.apache.commons.lang3.builder.ToStringBuilder;
8
-import org.apache.commons.lang3.builder.ToStringStyle;
9
-import com.ruoyi.common.annotation.Excel;
10
-import com.ruoyi.common.annotation.Excel.ColumnType;
11
-import com.ruoyi.common.core.domain.BaseEntity;
12
-
13
-/**
14
- * 角色表 sys_role
15
- * 
16
- * @author ruoyi
17
- */
18
-public class SysRole extends BaseEntity
19
-{
20
-    private static final long serialVersionUID = 1L;
21
-
22
-    /** 角色ID */
23
-    @Excel(name = "角色序号", cellType = ColumnType.NUMERIC)
24
-    private Long roleId;
25
-
26
-    /** 角色名称 */
27
-    @Excel(name = "角色名称")
28
-    private String roleName;
29
-
30
-    /** 角色权限 */
31
-    @Excel(name = "角色权限")
32
-    private String roleKey;
33
-
34
-    /** 角色排序 */
35
-    @Excel(name = "角色排序")
36
-    private Integer roleSort;
37
-
38
-    /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */
39
-    @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限")
40
-    private String dataScope;
41
-
42
-    /** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */
43
-    private boolean menuCheckStrictly;
44
-
45
-    /** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */
46
-    private boolean deptCheckStrictly;
47
-
48
-    /** 角色状态(0正常 1停用) */
49
-    @Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
50
-    private String status;
51
-
52
-    /** 删除标志(0代表存在 2代表删除) */
53
-    private String delFlag;
54
-
55
-    /** 用户是否存在此角色标识 默认不存在 */
56
-    private boolean flag = false;
57
-
58
-    /** 菜单组 */
59
-    private Long[] menuIds;
60
-
61
-    /** 部门组(数据权限) */
62
-    private Long[] deptIds;
63
-
64
-    /** 角色菜单权限 */
65
-    private Set<String> permissions;
66
-
67
-    public SysRole()
68
-    {
69
-
70
-    }
71
-
72
-    public SysRole(Long roleId)
73
-    {
74
-        this.roleId = roleId;
75
-    }
76
-
77
-    public Long getRoleId()
78
-    {
79
-        return roleId;
80
-    }
81
-
82
-    public void setRoleId(Long roleId)
83
-    {
84
-        this.roleId = roleId;
85
-    }
86
-
87
-    public boolean isAdmin()
88
-    {
89
-        return isAdmin(this.roleId);
90
-    }
91
-
92
-    public static boolean isAdmin(Long roleId)
93
-    {
94
-        return roleId != null && 1L == roleId;
95
-    }
96
-
97
-    @NotBlank(message = "角色名称不能为空")
98
-    @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符")
99
-    public String getRoleName()
100
-    {
101
-        return roleName;
102
-    }
103
-
104
-    public void setRoleName(String roleName)
105
-    {
106
-        this.roleName = roleName;
107
-    }
108
-
109
-    @NotBlank(message = "权限字符不能为空")
110
-    @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符")
111
-    public String getRoleKey()
112
-    {
113
-        return roleKey;
114
-    }
115
-
116
-    public void setRoleKey(String roleKey)
117
-    {
118
-        this.roleKey = roleKey;
119
-    }
120
-
121
-    @NotNull(message = "显示顺序不能为空")
122
-    public Integer getRoleSort()
123
-    {
124
-        return roleSort;
125
-    }
126
-
127
-    public void setRoleSort(Integer roleSort)
128
-    {
129
-        this.roleSort = roleSort;
130
-    }
131
-
132
-    public String getDataScope()
133
-    {
134
-        return dataScope;
135
-    }
136
-
137
-    public void setDataScope(String dataScope)
138
-    {
139
-        this.dataScope = dataScope;
140
-    }
141
-
142
-    public boolean isMenuCheckStrictly()
143
-    {
144
-        return menuCheckStrictly;
145
-    }
146
-
147
-    public void setMenuCheckStrictly(boolean menuCheckStrictly)
148
-    {
149
-        this.menuCheckStrictly = menuCheckStrictly;
150
-    }
151
-
152
-    public boolean isDeptCheckStrictly()
153
-    {
154
-        return deptCheckStrictly;
155
-    }
156
-
157
-    public void setDeptCheckStrictly(boolean deptCheckStrictly)
158
-    {
159
-        this.deptCheckStrictly = deptCheckStrictly;
160
-    }
161
-
162
-    public String getStatus()
163
-    {
164
-        return status;
165
-    }
166
-
167
-    public void setStatus(String status)
168
-    {
169
-        this.status = status;
170
-    }
171
-
172
-    public String getDelFlag()
173
-    {
174
-        return delFlag;
175
-    }
176
-
177
-    public void setDelFlag(String delFlag)
178
-    {
179
-        this.delFlag = delFlag;
180
-    }
181
-
182
-    public boolean isFlag()
183
-    {
184
-        return flag;
185
-    }
186
-
187
-    public void setFlag(boolean flag)
188
-    {
189
-        this.flag = flag;
190
-    }
191
-
192
-    public Long[] getMenuIds()
193
-    {
194
-        return menuIds;
195
-    }
196
-
197
-    public void setMenuIds(Long[] menuIds)
198
-    {
199
-        this.menuIds = menuIds;
200
-    }
201
-
202
-    public Long[] getDeptIds()
203
-    {
204
-        return deptIds;
205
-    }
206
-
207
-    public void setDeptIds(Long[] deptIds)
208
-    {
209
-        this.deptIds = deptIds;
210
-    }
211
-
212
-    public Set<String> getPermissions()
213
-    {
214
-        return permissions;
215
-    }
216
-
217
-    public void setPermissions(Set<String> permissions)
218
-    {
219
-        this.permissions = permissions;
220
-    }
221
-
222
-    @Override
223
-    public String toString() {
224
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
225
-            .append("roleId", getRoleId())
226
-            .append("roleName", getRoleName())
227
-            .append("roleKey", getRoleKey())
228
-            .append("roleSort", getRoleSort())
229
-            .append("dataScope", getDataScope())
230
-            .append("menuCheckStrictly", isMenuCheckStrictly())
231
-            .append("deptCheckStrictly", isDeptCheckStrictly())
232
-            .append("status", getStatus())
233
-            .append("delFlag", getDelFlag())
234
-            .append("createBy", getCreateBy())
235
-            .append("createTime", getCreateTime())
236
-            .append("updateBy", getUpdateBy())
237
-            .append("updateTime", getUpdateTime())
238
-            .append("remark", getRemark())
239
-            .toString();
240
-    }
241
-}

+ 0
- 324
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java 파일 보기

@@ -1,324 +0,0 @@
1
-package com.ruoyi.common.core.domain.entity;
2
-
3
-import java.util.Date;
4
-import java.util.List;
5
-import javax.validation.constraints.*;
6
-import org.apache.commons.lang3.builder.ToStringBuilder;
7
-import org.apache.commons.lang3.builder.ToStringStyle;
8
-import com.ruoyi.common.annotation.Excel;
9
-import com.ruoyi.common.annotation.Excel.ColumnType;
10
-import com.ruoyi.common.annotation.Excel.Type;
11
-import com.ruoyi.common.annotation.Excels;
12
-import com.ruoyi.common.core.domain.BaseEntity;
13
-import com.ruoyi.common.xss.Xss;
14
-
15
-/**
16
- * 用户对象 sys_user
17
- * 
18
- * @author ruoyi
19
- */
20
-public class SysUser extends BaseEntity
21
-{
22
-    private static final long serialVersionUID = 1L;
23
-
24
-    /** 用户ID */
25
-    @Excel(name = "用户序号", type = Type.EXPORT, cellType = ColumnType.NUMERIC, prompt = "用户编号")
26
-    private Long userId;
27
-
28
-    /** 部门ID */
29
-    @Excel(name = "部门编号", type = Type.IMPORT)
30
-    private Long deptId;
31
-
32
-    /** 用户账号 */
33
-    @Excel(name = "登录名称")
34
-    private String userName;
35
-
36
-    /** 用户昵称 */
37
-    @Excel(name = "用户名称")
38
-    private String nickName;
39
-
40
-    /** 用户邮箱 */
41
-    @Excel(name = "用户邮箱")
42
-    private String email;
43
-
44
-    /** 手机号码 */
45
-    @Excel(name = "手机号码", cellType = ColumnType.TEXT)
46
-    private String phonenumber;
47
-
48
-    /** 用户性别 */
49
-    @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
50
-    private String sex;
51
-
52
-    /** 用户头像 */
53
-    private String avatar;
54
-
55
-    /** 密码 */
56
-    private String password;
57
-
58
-    /** 帐号状态(0正常 1停用) */
59
-    @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
60
-    private String status;
61
-
62
-    /** 删除标志(0代表存在 2代表删除) */
63
-    private String delFlag;
64
-
65
-    /** 最后登录IP */
66
-    @Excel(name = "最后登录IP", type = Type.EXPORT)
67
-    private String loginIp;
68
-
69
-    /** 最后登录时间 */
70
-    @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
71
-    private Date loginDate;
72
-
73
-    /** 部门对象 */
74
-    @Excels({
75
-        @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
76
-        @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
77
-    })
78
-    private SysDept dept;
79
-
80
-    /** 角色对象 */
81
-    private List<SysRole> roles;
82
-
83
-    /** 角色组 */
84
-    private Long[] roleIds;
85
-
86
-    /** 岗位组 */
87
-    private Long[] postIds;
88
-
89
-    /** 角色ID */
90
-    private Long roleId;
91
-
92
-    public SysUser()
93
-    {
94
-
95
-    }
96
-
97
-    public SysUser(Long userId)
98
-    {
99
-        this.userId = userId;
100
-    }
101
-
102
-    public Long getUserId()
103
-    {
104
-        return userId;
105
-    }
106
-
107
-    public void setUserId(Long userId)
108
-    {
109
-        this.userId = userId;
110
-    }
111
-
112
-    public boolean isAdmin()
113
-    {
114
-        return isAdmin(this.userId);
115
-    }
116
-
117
-    public static boolean isAdmin(Long userId)
118
-    {
119
-        return userId != null && 1L == userId;
120
-    }
121
-
122
-    public Long getDeptId()
123
-    {
124
-        return deptId;
125
-    }
126
-
127
-    public void setDeptId(Long deptId)
128
-    {
129
-        this.deptId = deptId;
130
-    }
131
-
132
-    @Xss(message = "用户昵称不能包含脚本字符")
133
-    @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
134
-    public String getNickName()
135
-    {
136
-        return nickName;
137
-    }
138
-
139
-    public void setNickName(String nickName)
140
-    {
141
-        this.nickName = nickName;
142
-    }
143
-
144
-    @Xss(message = "用户账号不能包含脚本字符")
145
-    @NotBlank(message = "用户账号不能为空")
146
-    @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
147
-    public String getUserName()
148
-    {
149
-        return userName;
150
-    }
151
-
152
-    public void setUserName(String userName)
153
-    {
154
-        this.userName = userName;
155
-    }
156
-
157
-    @Email(message = "邮箱格式不正确")
158
-    @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
159
-    public String getEmail()
160
-    {
161
-        return email;
162
-    }
163
-
164
-    public void setEmail(String email)
165
-    {
166
-        this.email = email;
167
-    }
168
-
169
-    @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
170
-    public String getPhonenumber()
171
-    {
172
-        return phonenumber;
173
-    }
174
-
175
-    public void setPhonenumber(String phonenumber)
176
-    {
177
-        this.phonenumber = phonenumber;
178
-    }
179
-
180
-    public String getSex()
181
-    {
182
-        return sex;
183
-    }
184
-
185
-    public void setSex(String sex)
186
-    {
187
-        this.sex = sex;
188
-    }
189
-
190
-    public String getAvatar()
191
-    {
192
-        return avatar;
193
-    }
194
-
195
-    public void setAvatar(String avatar)
196
-    {
197
-        this.avatar = avatar;
198
-    }
199
-
200
-    public String getPassword()
201
-    {
202
-        return password;
203
-    }
204
-
205
-    public void setPassword(String password)
206
-    {
207
-        this.password = password;
208
-    }
209
-
210
-    public String getStatus()
211
-    {
212
-        return status;
213
-    }
214
-
215
-    public void setStatus(String status)
216
-    {
217
-        this.status = status;
218
-    }
219
-
220
-    public String getDelFlag()
221
-    {
222
-        return delFlag;
223
-    }
224
-
225
-    public void setDelFlag(String delFlag)
226
-    {
227
-        this.delFlag = delFlag;
228
-    }
229
-
230
-    public String getLoginIp()
231
-    {
232
-        return loginIp;
233
-    }
234
-
235
-    public void setLoginIp(String loginIp)
236
-    {
237
-        this.loginIp = loginIp;
238
-    }
239
-
240
-    public Date getLoginDate()
241
-    {
242
-        return loginDate;
243
-    }
244
-
245
-    public void setLoginDate(Date loginDate)
246
-    {
247
-        this.loginDate = loginDate;
248
-    }
249
-
250
-    public SysDept getDept()
251
-    {
252
-        return dept;
253
-    }
254
-
255
-    public void setDept(SysDept dept)
256
-    {
257
-        this.dept = dept;
258
-    }
259
-
260
-    public List<SysRole> getRoles()
261
-    {
262
-        return roles;
263
-    }
264
-
265
-    public void setRoles(List<SysRole> roles)
266
-    {
267
-        this.roles = roles;
268
-    }
269
-
270
-    public Long[] getRoleIds()
271
-    {
272
-        return roleIds;
273
-    }
274
-
275
-    public void setRoleIds(Long[] roleIds)
276
-    {
277
-        this.roleIds = roleIds;
278
-    }
279
-
280
-    public Long[] getPostIds()
281
-    {
282
-        return postIds;
283
-    }
284
-
285
-    public void setPostIds(Long[] postIds)
286
-    {
287
-        this.postIds = postIds;
288
-    }
289
-
290
-    public Long getRoleId()
291
-    {
292
-        return roleId;
293
-    }
294
-
295
-    public void setRoleId(Long roleId)
296
-    {
297
-        this.roleId = roleId;
298
-    }
299
-
300
-    @Override
301
-    public String toString() {
302
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
303
-            .append("userId", getUserId())
304
-            .append("deptId", getDeptId())
305
-            .append("userName", getUserName())
306
-            .append("nickName", getNickName())
307
-            .append("email", getEmail())
308
-            .append("phonenumber", getPhonenumber())
309
-            .append("sex", getSex())
310
-            .append("avatar", getAvatar())
311
-            .append("password", getPassword())
312
-            .append("status", getStatus())
313
-            .append("delFlag", getDelFlag())
314
-            .append("loginIp", getLoginIp())
315
-            .append("loginDate", getLoginDate())
316
-            .append("createBy", getCreateBy())
317
-            .append("createTime", getCreateTime())
318
-            .append("updateBy", getUpdateBy())
319
-            .append("updateTime", getUpdateTime())
320
-            .append("remark", getRemark())
321
-            .append("dept", getDept())
322
-            .toString();
323
-    }
324
-}

+ 0
- 69
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java 파일 보기

@@ -1,69 +0,0 @@
1
-package com.ruoyi.common.core.domain.model;
2
-
3
-/**
4
- * 用户登录对象
5
- * 
6
- * @author ruoyi
7
- */
8
-public class LoginBody
9
-{
10
-    /**
11
-     * 用户名
12
-     */
13
-    private String username;
14
-
15
-    /**
16
-     * 用户密码
17
-     */
18
-    private String password;
19
-
20
-    /**
21
-     * 验证码
22
-     */
23
-    private String code;
24
-
25
-    /**
26
-     * 唯一标识
27
-     */
28
-    private String uuid;
29
-
30
-    public String getUsername()
31
-    {
32
-        return username;
33
-    }
34
-
35
-    public void setUsername(String username)
36
-    {
37
-        this.username = username;
38
-    }
39
-
40
-    public String getPassword()
41
-    {
42
-        return password;
43
-    }
44
-
45
-    public void setPassword(String password)
46
-    {
47
-        this.password = password;
48
-    }
49
-
50
-    public String getCode()
51
-    {
52
-        return code;
53
-    }
54
-
55
-    public void setCode(String code)
56
-    {
57
-        this.code = code;
58
-    }
59
-
60
-    public String getUuid()
61
-    {
62
-        return uuid;
63
-    }
64
-
65
-    public void setUuid(String uuid)
66
-    {
67
-        this.uuid = uuid;
68
-    }
69
-}

+ 0
- 266
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java 파일 보기

@@ -1,266 +0,0 @@
1
-package com.ruoyi.common.core.domain.model;
2
-
3
-import com.alibaba.fastjson2.annotation.JSONField;
4
-import com.ruoyi.common.core.domain.entity.SysUser;
5
-import org.springframework.security.core.GrantedAuthority;
6
-import org.springframework.security.core.userdetails.UserDetails;
7
-import java.util.Collection;
8
-import java.util.Set;
9
-
10
-/**
11
- * 登录用户身份权限
12
- * 
13
- * @author ruoyi
14
- */
15
-public class LoginUser implements UserDetails
16
-{
17
-    private static final long serialVersionUID = 1L;
18
-
19
-    /**
20
-     * 用户ID
21
-     */
22
-    private Long userId;
23
-
24
-    /**
25
-     * 部门ID
26
-     */
27
-    private Long deptId;
28
-
29
-    /**
30
-     * 用户唯一标识
31
-     */
32
-    private String token;
33
-
34
-    /**
35
-     * 登录时间
36
-     */
37
-    private Long loginTime;
38
-
39
-    /**
40
-     * 过期时间
41
-     */
42
-    private Long expireTime;
43
-
44
-    /**
45
-     * 登录IP地址
46
-     */
47
-    private String ipaddr;
48
-
49
-    /**
50
-     * 登录地点
51
-     */
52
-    private String loginLocation;
53
-
54
-    /**
55
-     * 浏览器类型
56
-     */
57
-    private String browser;
58
-
59
-    /**
60
-     * 操作系统
61
-     */
62
-    private String os;
63
-
64
-    /**
65
-     * 权限列表
66
-     */
67
-    private Set<String> permissions;
68
-
69
-    /**
70
-     * 用户信息
71
-     */
72
-    private SysUser user;
73
-
74
-    public LoginUser()
75
-    {
76
-    }
77
-
78
-    public LoginUser(SysUser user, Set<String> permissions)
79
-    {
80
-        this.user = user;
81
-        this.permissions = permissions;
82
-    }
83
-
84
-    public LoginUser(Long userId, Long deptId, SysUser user, Set<String> permissions)
85
-    {
86
-        this.userId = userId;
87
-        this.deptId = deptId;
88
-        this.user = user;
89
-        this.permissions = permissions;
90
-    }
91
-
92
-    public Long getUserId()
93
-    {
94
-        return userId;
95
-    }
96
-
97
-    public void setUserId(Long userId)
98
-    {
99
-        this.userId = userId;
100
-    }
101
-
102
-    public Long getDeptId()
103
-    {
104
-        return deptId;
105
-    }
106
-
107
-    public void setDeptId(Long deptId)
108
-    {
109
-        this.deptId = deptId;
110
-    }
111
-
112
-    public String getToken()
113
-    {
114
-        return token;
115
-    }
116
-
117
-    public void setToken(String token)
118
-    {
119
-        this.token = token;
120
-    }
121
-
122
-    @JSONField(serialize = false)
123
-    @Override
124
-    public String getPassword()
125
-    {
126
-        return user.getPassword();
127
-    }
128
-
129
-    @Override
130
-    public String getUsername()
131
-    {
132
-        return user.getUserName();
133
-    }
134
-
135
-    /**
136
-     * 账户是否未过期,过期无法验证
137
-     */
138
-    @JSONField(serialize = false)
139
-    @Override
140
-    public boolean isAccountNonExpired()
141
-    {
142
-        return true;
143
-    }
144
-
145
-    /**
146
-     * 指定用户是否解锁,锁定的用户无法进行身份验证
147
-     * 
148
-     * @return
149
-     */
150
-    @JSONField(serialize = false)
151
-    @Override
152
-    public boolean isAccountNonLocked()
153
-    {
154
-        return true;
155
-    }
156
-
157
-    /**
158
-     * 指示是否已过期的用户的凭据(密码),过期的凭据防止认证
159
-     * 
160
-     * @return
161
-     */
162
-    @JSONField(serialize = false)
163
-    @Override
164
-    public boolean isCredentialsNonExpired()
165
-    {
166
-        return true;
167
-    }
168
-
169
-    /**
170
-     * 是否可用 ,禁用的用户不能身份验证
171
-     * 
172
-     * @return
173
-     */
174
-    @JSONField(serialize = false)
175
-    @Override
176
-    public boolean isEnabled()
177
-    {
178
-        return true;
179
-    }
180
-
181
-    public Long getLoginTime()
182
-    {
183
-        return loginTime;
184
-    }
185
-
186
-    public void setLoginTime(Long loginTime)
187
-    {
188
-        this.loginTime = loginTime;
189
-    }
190
-
191
-    public String getIpaddr()
192
-    {
193
-        return ipaddr;
194
-    }
195
-
196
-    public void setIpaddr(String ipaddr)
197
-    {
198
-        this.ipaddr = ipaddr;
199
-    }
200
-
201
-    public String getLoginLocation()
202
-    {
203
-        return loginLocation;
204
-    }
205
-
206
-    public void setLoginLocation(String loginLocation)
207
-    {
208
-        this.loginLocation = loginLocation;
209
-    }
210
-
211
-    public String getBrowser()
212
-    {
213
-        return browser;
214
-    }
215
-
216
-    public void setBrowser(String browser)
217
-    {
218
-        this.browser = browser;
219
-    }
220
-
221
-    public String getOs()
222
-    {
223
-        return os;
224
-    }
225
-
226
-    public void setOs(String os)
227
-    {
228
-        this.os = os;
229
-    }
230
-
231
-    public Long getExpireTime()
232
-    {
233
-        return expireTime;
234
-    }
235
-
236
-    public void setExpireTime(Long expireTime)
237
-    {
238
-        this.expireTime = expireTime;
239
-    }
240
-
241
-    public Set<String> getPermissions()
242
-    {
243
-        return permissions;
244
-    }
245
-
246
-    public void setPermissions(Set<String> permissions)
247
-    {
248
-        this.permissions = permissions;
249
-    }
250
-
251
-    public SysUser getUser()
252
-    {
253
-        return user;
254
-    }
255
-
256
-    public void setUser(SysUser user)
257
-    {
258
-        this.user = user;
259
-    }
260
-
261
-    @Override
262
-    public Collection<? extends GrantedAuthority> getAuthorities()
263
-    {
264
-        return null;
265
-    }
266
-}

+ 0
- 11
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/RegisterBody.java 파일 보기

@@ -1,11 +0,0 @@
1
-package com.ruoyi.common.core.domain.model;
2
-
3
-/**
4
- * 用户注册对象
5
- * 
6
- * @author ruoyi
7
- */
8
-public class RegisterBody extends LoginBody
9
-{
10
-
11
-}

+ 0
- 101
ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java 파일 보기

@@ -1,101 +0,0 @@
1
-package com.ruoyi.common.core.page;
2
-
3
-import com.ruoyi.common.utils.StringUtils;
4
-
5
-/**
6
- * 分页数据
7
- * 
8
- * @author ruoyi
9
- */
10
-public class PageDomain
11
-{
12
-    /** 当前记录起始索引 */
13
-    private Integer pageNum;
14
-
15
-    /** 每页显示记录数 */
16
-    private Integer pageSize;
17
-
18
-    /** 排序列 */
19
-    private String orderByColumn;
20
-
21
-    /** 排序的方向desc或者asc */
22
-    private String isAsc = "asc";
23
-
24
-    /** 分页参数合理化 */
25
-    private Boolean reasonable = true;
26
-
27
-    public String getOrderBy()
28
-    {
29
-        if (StringUtils.isEmpty(orderByColumn))
30
-        {
31
-            return "";
32
-        }
33
-        return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
34
-    }
35
-
36
-    public Integer getPageNum()
37
-    {
38
-        return pageNum;
39
-    }
40
-
41
-    public void setPageNum(Integer pageNum)
42
-    {
43
-        this.pageNum = pageNum;
44
-    }
45
-
46
-    public Integer getPageSize()
47
-    {
48
-        return pageSize;
49
-    }
50
-
51
-    public void setPageSize(Integer pageSize)
52
-    {
53
-        this.pageSize = pageSize;
54
-    }
55
-
56
-    public String getOrderByColumn()
57
-    {
58
-        return orderByColumn;
59
-    }
60
-
61
-    public void setOrderByColumn(String orderByColumn)
62
-    {
63
-        this.orderByColumn = orderByColumn;
64
-    }
65
-
66
-    public String getIsAsc()
67
-    {
68
-        return isAsc;
69
-    }
70
-
71
-    public void setIsAsc(String isAsc)
72
-    {
73
-        if (StringUtils.isNotEmpty(isAsc))
74
-        {
75
-            // 兼容前端排序类型
76
-            if ("ascending".equals(isAsc))
77
-            {
78
-                isAsc = "asc";
79
-            }
80
-            else if ("descending".equals(isAsc))
81
-            {
82
-                isAsc = "desc";
83
-            }
84
-            this.isAsc = isAsc;
85
-        }
86
-    }
87
-
88
-    public Boolean getReasonable()
89
-    {
90
-        if (StringUtils.isNull(reasonable))
91
-        {
92
-            return Boolean.TRUE;
93
-        }
94
-        return reasonable;
95
-    }
96
-
97
-    public void setReasonable(Boolean reasonable)
98
-    {
99
-        this.reasonable = reasonable;
100
-    }
101
-}

+ 0
- 85
ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java 파일 보기

@@ -1,85 +0,0 @@
1
-package com.ruoyi.common.core.page;
2
-
3
-import java.io.Serializable;
4
-import java.util.List;
5
-
6
-/**
7
- * 表格分页数据对象
8
- * 
9
- * @author ruoyi
10
- */
11
-public class TableDataInfo implements Serializable
12
-{
13
-    private static final long serialVersionUID = 1L;
14
-
15
-    /** 总记录数 */
16
-    private long total;
17
-
18
-    /** 列表数据 */
19
-    private List<?> rows;
20
-
21
-    /** 消息状态码 */
22
-    private int code;
23
-
24
-    /** 消息内容 */
25
-    private String msg;
26
-
27
-    /**
28
-     * 表格数据对象
29
-     */
30
-    public TableDataInfo()
31
-    {
32
-    }
33
-
34
-    /**
35
-     * 分页
36
-     * 
37
-     * @param list 列表数据
38
-     * @param total 总记录数
39
-     */
40
-    public TableDataInfo(List<?> list, int total)
41
-    {
42
-        this.rows = list;
43
-        this.total = total;
44
-    }
45
-
46
-    public long getTotal()
47
-    {
48
-        return total;
49
-    }
50
-
51
-    public void setTotal(long total)
52
-    {
53
-        this.total = total;
54
-    }
55
-
56
-    public List<?> getRows()
57
-    {
58
-        return rows;
59
-    }
60
-
61
-    public void setRows(List<?> rows)
62
-    {
63
-        this.rows = rows;
64
-    }
65
-
66
-    public int getCode()
67
-    {
68
-        return code;
69
-    }
70
-
71
-    public void setCode(int code)
72
-    {
73
-        this.code = code;
74
-    }
75
-
76
-    public String getMsg()
77
-    {
78
-        return msg;
79
-    }
80
-
81
-    public void setMsg(String msg)
82
-    {
83
-        this.msg = msg;
84
-    }
85
-}

+ 0
- 56
ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java 파일 보기

@@ -1,56 +0,0 @@
1
-package com.ruoyi.common.core.page;
2
-
3
-import com.ruoyi.common.core.text.Convert;
4
-import com.ruoyi.common.utils.ServletUtils;
5
-
6
-/**
7
- * 表格数据处理
8
- * 
9
- * @author ruoyi
10
- */
11
-public class TableSupport
12
-{
13
-    /**
14
-     * 当前记录起始索引
15
-     */
16
-    public static final String PAGE_NUM = "pageNum";
17
-
18
-    /**
19
-     * 每页显示记录数
20
-     */
21
-    public static final String PAGE_SIZE = "pageSize";
22
-
23
-    /**
24
-     * 排序列
25
-     */
26
-    public static final String ORDER_BY_COLUMN = "orderByColumn";
27
-
28
-    /**
29
-     * 排序的方向 "desc" 或者 "asc".
30
-     */
31
-    public static final String IS_ASC = "isAsc";
32
-
33
-    /**
34
-     * 分页参数合理化
35
-     */
36
-    public static final String REASONABLE = "reasonable";
37
-
38
-    /**
39
-     * 封装分页对象
40
-     */
41
-    public static PageDomain getPageDomain()
42
-    {
43
-        PageDomain pageDomain = new PageDomain();
44
-        pageDomain.setPageNum(Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1));
45
-        pageDomain.setPageSize(Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10));
46
-        pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN));
47
-        pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC));
48
-        pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE));
49
-        return pageDomain;
50
-    }
51
-
52
-    public static PageDomain buildPageRequest()
53
-    {
54
-        return getPageDomain();
55
-    }
56
-}

+ 0
- 268
ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java 파일 보기

@@ -1,268 +0,0 @@
1
-package com.ruoyi.common.core.redis;
2
-
3
-import java.util.Collection;
4
-import java.util.Iterator;
5
-import java.util.List;
6
-import java.util.Map;
7
-import java.util.Set;
8
-import java.util.concurrent.TimeUnit;
9
-import org.springframework.beans.factory.annotation.Autowired;
10
-import org.springframework.data.redis.core.BoundSetOperations;
11
-import org.springframework.data.redis.core.HashOperations;
12
-import org.springframework.data.redis.core.RedisTemplate;
13
-import org.springframework.data.redis.core.ValueOperations;
14
-import org.springframework.stereotype.Component;
15
-
16
-/**
17
- * spring redis 工具类
18
- *
19
- * @author ruoyi
20
- **/
21
-@SuppressWarnings(value = { "unchecked", "rawtypes" })
22
-@Component
23
-public class RedisCache
24
-{
25
-    @Autowired
26
-    public RedisTemplate redisTemplate;
27
-
28
-    /**
29
-     * 缓存基本的对象,Integer、String、实体类等
30
-     *
31
-     * @param key 缓存的键值
32
-     * @param value 缓存的值
33
-     */
34
-    public <T> void setCacheObject(final String key, final T value)
35
-    {
36
-        redisTemplate.opsForValue().set(key, value);
37
-    }
38
-
39
-    /**
40
-     * 缓存基本的对象,Integer、String、实体类等
41
-     *
42
-     * @param key 缓存的键值
43
-     * @param value 缓存的值
44
-     * @param timeout 时间
45
-     * @param timeUnit 时间颗粒度
46
-     */
47
-    public <T> void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit)
48
-    {
49
-        redisTemplate.opsForValue().set(key, value, timeout, timeUnit);
50
-    }
51
-
52
-    /**
53
-     * 设置有效时间
54
-     *
55
-     * @param key Redis键
56
-     * @param timeout 超时时间
57
-     * @return true=设置成功;false=设置失败
58
-     */
59
-    public boolean expire(final String key, final long timeout)
60
-    {
61
-        return expire(key, timeout, TimeUnit.SECONDS);
62
-    }
63
-
64
-    /**
65
-     * 设置有效时间
66
-     *
67
-     * @param key Redis键
68
-     * @param timeout 超时时间
69
-     * @param unit 时间单位
70
-     * @return true=设置成功;false=设置失败
71
-     */
72
-    public boolean expire(final String key, final long timeout, final TimeUnit unit)
73
-    {
74
-        return redisTemplate.expire(key, timeout, unit);
75
-    }
76
-
77
-    /**
78
-     * 获取有效时间
79
-     *
80
-     * @param key Redis键
81
-     * @return 有效时间
82
-     */
83
-    public long getExpire(final String key)
84
-    {
85
-        return redisTemplate.getExpire(key);
86
-    }
87
-
88
-    /**
89
-     * 判断 key是否存在
90
-     *
91
-     * @param key 键
92
-     * @return true 存在 false不存在
93
-     */
94
-    public Boolean hasKey(String key)
95
-    {
96
-        return redisTemplate.hasKey(key);
97
-    }
98
-
99
-    /**
100
-     * 获得缓存的基本对象。
101
-     *
102
-     * @param key 缓存键值
103
-     * @return 缓存键值对应的数据
104
-     */
105
-    public <T> T getCacheObject(final String key)
106
-    {
107
-        ValueOperations<String, T> operation = redisTemplate.opsForValue();
108
-        return operation.get(key);
109
-    }
110
-
111
-    /**
112
-     * 删除单个对象
113
-     *
114
-     * @param key
115
-     */
116
-    public boolean deleteObject(final String key)
117
-    {
118
-        return redisTemplate.delete(key);
119
-    }
120
-
121
-    /**
122
-     * 删除集合对象
123
-     *
124
-     * @param collection 多个对象
125
-     * @return
126
-     */
127
-    public boolean deleteObject(final Collection collection)
128
-    {
129
-        return redisTemplate.delete(collection) > 0;
130
-    }
131
-
132
-    /**
133
-     * 缓存List数据
134
-     *
135
-     * @param key 缓存的键值
136
-     * @param dataList 待缓存的List数据
137
-     * @return 缓存的对象
138
-     */
139
-    public <T> long setCacheList(final String key, final List<T> dataList)
140
-    {
141
-        Long count = redisTemplate.opsForList().rightPushAll(key, dataList);
142
-        return count == null ? 0 : count;
143
-    }
144
-
145
-    /**
146
-     * 获得缓存的list对象
147
-     *
148
-     * @param key 缓存的键值
149
-     * @return 缓存键值对应的数据
150
-     */
151
-    public <T> List<T> getCacheList(final String key)
152
-    {
153
-        return redisTemplate.opsForList().range(key, 0, -1);
154
-    }
155
-
156
-    /**
157
-     * 缓存Set
158
-     *
159
-     * @param key 缓存键值
160
-     * @param dataSet 缓存的数据
161
-     * @return 缓存数据的对象
162
-     */
163
-    public <T> BoundSetOperations<String, T> setCacheSet(final String key, final Set<T> dataSet)
164
-    {
165
-        BoundSetOperations<String, T> setOperation = redisTemplate.boundSetOps(key);
166
-        Iterator<T> it = dataSet.iterator();
167
-        while (it.hasNext())
168
-        {
169
-            setOperation.add(it.next());
170
-        }
171
-        return setOperation;
172
-    }
173
-
174
-    /**
175
-     * 获得缓存的set
176
-     *
177
-     * @param key
178
-     * @return
179
-     */
180
-    public <T> Set<T> getCacheSet(final String key)
181
-    {
182
-        return redisTemplate.opsForSet().members(key);
183
-    }
184
-
185
-    /**
186
-     * 缓存Map
187
-     *
188
-     * @param key
189
-     * @param dataMap
190
-     */
191
-    public <T> void setCacheMap(final String key, final Map<String, T> dataMap)
192
-    {
193
-        if (dataMap != null) {
194
-            redisTemplate.opsForHash().putAll(key, dataMap);
195
-        }
196
-    }
197
-
198
-    /**
199
-     * 获得缓存的Map
200
-     *
201
-     * @param key
202
-     * @return
203
-     */
204
-    public <T> Map<String, T> getCacheMap(final String key)
205
-    {
206
-        return redisTemplate.opsForHash().entries(key);
207
-    }
208
-
209
-    /**
210
-     * 往Hash中存入数据
211
-     *
212
-     * @param key Redis键
213
-     * @param hKey Hash键
214
-     * @param value 值
215
-     */
216
-    public <T> void setCacheMapValue(final String key, final String hKey, final T value)
217
-    {
218
-        redisTemplate.opsForHash().put(key, hKey, value);
219
-    }
220
-
221
-    /**
222
-     * 获取Hash中的数据
223
-     *
224
-     * @param key Redis键
225
-     * @param hKey Hash键
226
-     * @return Hash中的对象
227
-     */
228
-    public <T> T getCacheMapValue(final String key, final String hKey)
229
-    {
230
-        HashOperations<String, String, T> opsForHash = redisTemplate.opsForHash();
231
-        return opsForHash.get(key, hKey);
232
-    }
233
-
234
-    /**
235
-     * 获取多个Hash中的数据
236
-     *
237
-     * @param key Redis键
238
-     * @param hKeys Hash键集合
239
-     * @return Hash对象集合
240
-     */
241
-    public <T> List<T> getMultiCacheMapValue(final String key, final Collection<Object> hKeys)
242
-    {
243
-        return redisTemplate.opsForHash().multiGet(key, hKeys);
244
-    }
245
-
246
-    /**
247
-     * 删除Hash中的某条数据
248
-     *
249
-     * @param key Redis键
250
-     * @param hKey Hash键
251
-     * @return 是否成功
252
-     */
253
-    public boolean deleteCacheMapValue(final String key, final String hKey)
254
-    {
255
-        return redisTemplate.opsForHash().delete(key, hKey) > 0;
256
-    }
257
-
258
-    /**
259
-     * 获得缓存的基本对象列表
260
-     *
261
-     * @param pattern 字符串前缀
262
-     * @return 对象列表
263
-     */
264
-    public Collection<String> keys(final String pattern)
265
-    {
266
-        return redisTemplate.keys(pattern);
267
-    }
268
-}

+ 0
- 86
ruoyi-common/src/main/java/com/ruoyi/common/core/text/CharsetKit.java 파일 보기

@@ -1,86 +0,0 @@
1
-package com.ruoyi.common.core.text;
2
-
3
-import java.nio.charset.Charset;
4
-import java.nio.charset.StandardCharsets;
5
-import com.ruoyi.common.utils.StringUtils;
6
-
7
-/**
8
- * 字符集工具类
9
- * 
10
- * @author ruoyi
11
- */
12
-public class CharsetKit
13
-{
14
-    /** ISO-8859-1 */
15
-    public static final String ISO_8859_1 = "ISO-8859-1";
16
-    /** UTF-8 */
17
-    public static final String UTF_8 = "UTF-8";
18
-    /** GBK */
19
-    public static final String GBK = "GBK";
20
-
21
-    /** ISO-8859-1 */
22
-    public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1);
23
-    /** UTF-8 */
24
-    public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8);
25
-    /** GBK */
26
-    public static final Charset CHARSET_GBK = Charset.forName(GBK);
27
-
28
-    /**
29
-     * 转换为Charset对象
30
-     * 
31
-     * @param charset 字符集,为空则返回默认字符集
32
-     * @return Charset
33
-     */
34
-    public static Charset charset(String charset)
35
-    {
36
-        return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset);
37
-    }
38
-
39
-    /**
40
-     * 转换字符串的字符集编码
41
-     * 
42
-     * @param source 字符串
43
-     * @param srcCharset 源字符集,默认ISO-8859-1
44
-     * @param destCharset 目标字符集,默认UTF-8
45
-     * @return 转换后的字符集
46
-     */
47
-    public static String convert(String source, String srcCharset, String destCharset)
48
-    {
49
-        return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset));
50
-    }
51
-
52
-    /**
53
-     * 转换字符串的字符集编码
54
-     * 
55
-     * @param source 字符串
56
-     * @param srcCharset 源字符集,默认ISO-8859-1
57
-     * @param destCharset 目标字符集,默认UTF-8
58
-     * @return 转换后的字符集
59
-     */
60
-    public static String convert(String source, Charset srcCharset, Charset destCharset)
61
-    {
62
-        if (null == srcCharset)
63
-        {
64
-            srcCharset = StandardCharsets.ISO_8859_1;
65
-        }
66
-
67
-        if (null == destCharset)
68
-        {
69
-            destCharset = StandardCharsets.UTF_8;
70
-        }
71
-
72
-        if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset))
73
-        {
74
-            return source;
75
-        }
76
-        return new String(source.getBytes(srcCharset), destCharset);
77
-    }
78
-
79
-    /**
80
-     * @return 系统字符集编码
81
-     */
82
-    public static String systemCharset()
83
-    {
84
-        return Charset.defaultCharset().name();
85
-    }
86
-}

+ 0
- 1006
ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 0
- 92
ruoyi-common/src/main/java/com/ruoyi/common/core/text/StrFormatter.java 파일 보기

@@ -1,92 +0,0 @@
1
-package com.ruoyi.common.core.text;
2
-
3
-import com.ruoyi.common.utils.StringUtils;
4
-
5
-/**
6
- * 字符串格式化
7
- * 
8
- * @author ruoyi
9
- */
10
-public class StrFormatter
11
-{
12
-    public static final String EMPTY_JSON = "{}";
13
-    public static final char C_BACKSLASH = '\\';
14
-    public static final char C_DELIM_START = '{';
15
-    public static final char C_DELIM_END = '}';
16
-
17
-    /**
18
-     * 格式化字符串<br>
19
-     * 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
20
-     * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
21
-     * 例:<br>
22
-     * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
23
-     * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
24
-     * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
25
-     * 
26
-     * @param strPattern 字符串模板
27
-     * @param argArray 参数列表
28
-     * @return 结果
29
-     */
30
-    public static String format(final String strPattern, final Object... argArray)
31
-    {
32
-        if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray))
33
-        {
34
-            return strPattern;
35
-        }
36
-        final int strPatternLength = strPattern.length();
37
-
38
-        // 初始化定义好的长度以获得更好的性能
39
-        StringBuilder sbuf = new StringBuilder(strPatternLength + 50);
40
-
41
-        int handledPosition = 0;
42
-        int delimIndex;// 占位符所在位置
43
-        for (int argIndex = 0; argIndex < argArray.length; argIndex++)
44
-        {
45
-            delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition);
46
-            if (delimIndex == -1)
47
-            {
48
-                if (handledPosition == 0)
49
-                {
50
-                    return strPattern;
51
-                }
52
-                else
53
-                { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果
54
-                    sbuf.append(strPattern, handledPosition, strPatternLength);
55
-                    return sbuf.toString();
56
-                }
57
-            }
58
-            else
59
-            {
60
-                if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH)
61
-                {
62
-                    if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH)
63
-                    {
64
-                        // 转义符之前还有一个转义符,占位符依旧有效
65
-                        sbuf.append(strPattern, handledPosition, delimIndex - 1);
66
-                        sbuf.append(Convert.utf8Str(argArray[argIndex]));
67
-                        handledPosition = delimIndex + 2;
68
-                    }
69
-                    else
70
-                    {
71
-                        // 占位符被转义
72
-                        argIndex--;
73
-                        sbuf.append(strPattern, handledPosition, delimIndex - 1);
74
-                        sbuf.append(C_DELIM_START);
75
-                        handledPosition = delimIndex + 1;
76
-                    }
77
-                }
78
-                else
79
-                {
80
-                    // 正常占位符
81
-                    sbuf.append(strPattern, handledPosition, delimIndex);
82
-                    sbuf.append(Convert.utf8Str(argArray[argIndex]));
83
-                    handledPosition = delimIndex + 2;
84
-                }
85
-            }
86
-        }
87
-        // 加入最后一个占位符后所有的字符
88
-        sbuf.append(strPattern, handledPosition, strPattern.length());
89
-
90
-        return sbuf.toString();
91
-    }
92
-}

+ 0
- 20
ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java 파일 보기

@@ -1,20 +0,0 @@
1
-package com.ruoyi.common.enums;
2
-
3
-/**
4
- * 操作状态
5
- * 
6
- * @author ruoyi
7
- *
8
- */
9
-public enum BusinessStatus
10
-{
11
-    /**
12
-     * 成功
13
-     */
14
-    SUCCESS,
15
-
16
-    /**
17
-     * 失败
18
-     */
19
-    FAIL,
20
-}

+ 0
- 59
ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java 파일 보기

@@ -1,59 +0,0 @@
1
-package com.ruoyi.common.enums;
2
-
3
-/**
4
- * 业务操作类型
5
- * 
6
- * @author ruoyi
7
- */
8
-public enum BusinessType
9
-{
10
-    /**
11
-     * 其它
12
-     */
13
-    OTHER,
14
-
15
-    /**
16
-     * 新增
17
-     */
18
-    INSERT,
19
-
20
-    /**
21
-     * 修改
22
-     */
23
-    UPDATE,
24
-
25
-    /**
26
-     * 删除
27
-     */
28
-    DELETE,
29
-
30
-    /**
31
-     * 授权
32
-     */
33
-    GRANT,
34
-
35
-    /**
36
-     * 导出
37
-     */
38
-    EXPORT,
39
-
40
-    /**
41
-     * 导入
42
-     */
43
-    IMPORT,
44
-
45
-    /**
46
-     * 强退
47
-     */
48
-    FORCE,
49
-
50
-    /**
51
-     * 生成代码
52
-     */
53
-    GENCODE,
54
-    
55
-    /**
56
-     * 清空数据
57
-     */
58
-    CLEAN,
59
-}

+ 0
- 19
ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java 파일 보기

@@ -1,19 +0,0 @@
1
-package com.ruoyi.common.enums;
2
-
3
-/**
4
- * 数据源
5
- * 
6
- * @author ruoyi
7
- */
8
-public enum DataSourceType
9
-{
10
-    /**
11
-     * 主库
12
-     */
13
-    MASTER,
14
-
15
-    /**
16
-     * 从库
17
-     */
18
-    SLAVE
19
-}

+ 0
- 59
ruoyi-common/src/main/java/com/ruoyi/common/enums/DesensitizedType.java 파일 보기

@@ -1,59 +0,0 @@
1
-package com.ruoyi.common.enums;
2
-
3
-import java.util.function.Function;
4
-import com.ruoyi.common.utils.DesensitizedUtil;
5
-
6
-/**
7
- * 脱敏类型
8
- *
9
- * @author ruoyi
10
- */
11
-public enum DesensitizedType
12
-{
13
-    /**
14
-     * 姓名,第2位星号替换
15
-     */
16
-    USERNAME(s -> s.replaceAll("(\\S)\\S(\\S*)", "$1*$2")),
17
-
18
-    /**
19
-     * 密码,全部字符都用*代替
20
-     */
21
-    PASSWORD(DesensitizedUtil::password),
22
-
23
-    /**
24
-     * 身份证,中间10位星号替换
25
-     */
26
-    ID_CARD(s -> s.replaceAll("(\\d{4})\\d{10}(\\d{4})", "$1** **** ****$2")),
27
-
28
-    /**
29
-     * 手机号,中间4位星号替换
30
-     */
31
-    PHONE(s -> s.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2")),
32
-
33
-    /**
34
-     * 电子邮箱,仅显示第一个字母和@后面的地址显示,其他星号替换
35
-     */
36
-    EMAIL(s -> s.replaceAll("(^.)[^@]*(@.*$)", "$1****$2")),
37
-
38
-    /**
39
-     * 银行卡号,保留最后4位,其他星号替换
40
-     */
41
-    BANK_CARD(s -> s.replaceAll("\\d{15}(\\d{3})", "**** **** **** **** $1")),
42
-
43
-    /**
44
-     * 车牌号码,包含普通车辆、新能源车辆
45
-     */
46
-    CAR_LICENSE(DesensitizedUtil::carLicense);
47
-
48
-    private final Function<String, String> desensitizer;
49
-
50
-    DesensitizedType(Function<String, String> desensitizer)
51
-    {
52
-        this.desensitizer = desensitizer;
53
-    }
54
-
55
-    public Function<String, String> desensitizer()
56
-    {
57
-        return desensitizer;
58
-    }
59
-}

+ 0
- 36
ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java 파일 보기

@@ -1,36 +0,0 @@
1
-package com.ruoyi.common.enums;
2
-
3
-import java.util.HashMap;
4
-import java.util.Map;
5
-import org.springframework.lang.Nullable;
6
-
7
-/**
8
- * 请求方式
9
- *
10
- * @author ruoyi
11
- */
12
-public enum HttpMethod
13
-{
14
-    GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE;
15
-
16
-    private static final Map<String, HttpMethod> mappings = new HashMap<>(16);
17
-
18
-    static
19
-    {
20
-        for (HttpMethod httpMethod : values())
21
-        {
22
-            mappings.put(httpMethod.name(), httpMethod);
23
-        }
24
-    }
25
-
26
-    @Nullable
27
-    public static HttpMethod resolve(@Nullable String method)
28
-    {
29
-        return (method != null ? mappings.get(method) : null);
30
-    }
31
-
32
-    public boolean matches(String method)
33
-    {
34
-        return (this == resolve(method));
35
-    }
36
-}

+ 0
- 20
ruoyi-common/src/main/java/com/ruoyi/common/enums/LimitType.java 파일 보기

@@ -1,20 +0,0 @@
1
-package com.ruoyi.common.enums;
2
-
3
-/**
4
- * 限流类型
5
- *
6
- * @author ruoyi
7
- */
8
-
9
-public enum LimitType
10
-{
11
-    /**
12
-     * 默认策略全局限流
13
-     */
14
-    DEFAULT,
15
-
16
-    /**
17
-     * 根据请求者IP进行限流
18
-     */
19
-    IP
20
-}

+ 0
- 24
ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java 파일 보기

@@ -1,24 +0,0 @@
1
-package com.ruoyi.common.enums;
2
-
3
-/**
4
- * 操作人类别
5
- * 
6
- * @author ruoyi
7
- */
8
-public enum OperatorType
9
-{
10
-    /**
11
-     * 其它
12
-     */
13
-    OTHER,
14
-
15
-    /**
16
-     * 后台用户
17
-     */
18
-    MANAGE,
19
-
20
-    /**
21
-     * 手机端用户
22
-     */
23
-    MOBILE
24
-}

+ 0
- 30
ruoyi-common/src/main/java/com/ruoyi/common/enums/UserStatus.java 파일 보기

@@ -1,30 +0,0 @@
1
-package com.ruoyi.common.enums;
2
-
3
-/**
4
- * 用户状态
5
- * 
6
- * @author ruoyi
7
- */
8
-public enum UserStatus
9
-{
10
-    OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除");
11
-
12
-    private final String code;
13
-    private final String info;
14
-
15
-    UserStatus(String code, String info)
16
-    {
17
-        this.code = code;
18
-        this.info = info;
19
-    }
20
-
21
-    public String getCode()
22
-    {
23
-        return code;
24
-    }
25
-
26
-    public String getInfo()
27
-    {
28
-        return info;
29
-    }
30
-}

+ 0
- 15
ruoyi-common/src/main/java/com/ruoyi/common/exception/DemoModeException.java 파일 보기

@@ -1,15 +0,0 @@
1
-package com.ruoyi.common.exception;
2
-
3
-/**
4
- * 演示模式异常
5
- * 
6
- * @author ruoyi
7
- */
8
-public class DemoModeException extends RuntimeException
9
-{
10
-    private static final long serialVersionUID = 1L;
11
-
12
-    public DemoModeException()
13
-    {
14
-    }
15
-}

+ 0
- 58
ruoyi-common/src/main/java/com/ruoyi/common/exception/GlobalException.java 파일 보기

@@ -1,58 +0,0 @@
1
-package com.ruoyi.common.exception;
2
-
3
-/**
4
- * 全局异常
5
- * 
6
- * @author ruoyi
7
- */
8
-public class GlobalException extends RuntimeException
9
-{
10
-    private static final long serialVersionUID = 1L;
11
-
12
-    /**
13
-     * 错误提示
14
-     */
15
-    private String message;
16
-
17
-    /**
18
-     * 错误明细,内部调试错误
19
-     *
20
-     * 和 {@link CommonResult#getDetailMessage()} 一致的设计
21
-     */
22
-    private String detailMessage;
23
-
24
-    /**
25
-     * 空构造方法,避免反序列化问题
26
-     */
27
-    public GlobalException()
28
-    {
29
-    }
30
-
31
-    public GlobalException(String message)
32
-    {
33
-        this.message = message;
34
-    }
35
-
36
-    public String getDetailMessage()
37
-    {
38
-        return detailMessage;
39
-    }
40
-
41
-    public GlobalException setDetailMessage(String detailMessage)
42
-    {
43
-        this.detailMessage = detailMessage;
44
-        return this;
45
-    }
46
-
47
-    @Override
48
-    public String getMessage()
49
-    {
50
-        return message;
51
-    }
52
-
53
-    public GlobalException setMessage(String message)
54
-    {
55
-        this.message = message;
56
-        return this;
57
-    }
58
-}

+ 0
- 0
ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java 파일 보기


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.