浏览代码

考试集成兼容

tanzy 9 月之前
父节点
当前提交
9ca3b4f60a
共有 17 个文件被更改,包括 126 次插入21 次删除
  1. 17 0
      pom.xml
  2. 2 2
      ruoyi-auth/src/main/resources/bootstrap-local.yml
  3. 2 2
      ruoyi-gateway/src/main/resources/bootstrap-local.yml
  4. 22 1
      ruoyi-modules/airport-exam/pom.xml
  5. 33 0
      ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/IdUtils.java
  6. 4 1
      ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/ExamRecOptServiceImpl.java
  7. 4 1
      ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/ExamRecServiceImpl.java
  8. 4 2
      ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/ExamServiceImpl.java
  9. 6 2
      ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/QuesCatServiceImpl.java
  10. 4 1
      ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/QuesOptServiceImpl.java
  11. 4 1
      ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/QuesServiceImpl.java
  12. 4 1
      ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/TestPaperCatServiceImpl.java
  13. 4 1
      ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/TestPaperQuesServiceImpl.java
  14. 4 1
      ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/TestPaperServiceImpl.java
  15. 2 2
      ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/logic/manage/model/params/ExamAddParam.java
  16. 7 1
      ruoyi-modules/airport-exam/src/main/resources/logback.xml
  17. 3 2
      ruoyi-modules/ruoyi-system/src/main/resources/bootstrap-local.yml

+ 17 - 0
pom.xml

@@ -327,5 +327,22 @@
327 327
             </snapshots>
328 328
         </pluginRepository>
329 329
     </pluginRepositories>
330
+    <profiles>
331
+        <profile>
332
+            <id>dev</id>
333
+            <properties>
334
+                <profile.active>dev</profile.active>
335
+            </properties>
336
+            <activation>
337
+                <activeByDefault>true</activeByDefault>
338
+            </activation>
339
+        </profile>
340
+        <profile>
341
+            <id>local</id>
342
+            <properties>
343
+                <profile.active>local</profile.active>
344
+            </properties>
345
+        </profile>
346
+    </profiles>
330 347
 
331 348
 </project>

+ 2 - 2
ruoyi-auth/src/main/resources/bootstrap-local.yml

@@ -7,7 +7,7 @@ spring:
7 7
         server-addr: 192.168.3.222:8848
8 8
         username: nacos
9 9
         password: nacos
10
-        namespace: 98847e88-f851-4d7e-91ff-954bb08e2563
10
+        namespace: local
11 11
       config:
12 12
         # 配置中心地址
13 13
         server-addr: 192.168.3.222:8848
@@ -18,4 +18,4 @@ spring:
18 18
         # 共享配置
19 19
         shared-configs:
20 20
           - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
21
-        namespace: 98847e88-f851-4d7e-91ff-954bb08e2563
21
+        namespace: local

+ 2 - 2
ruoyi-gateway/src/main/resources/bootstrap-local.yml

@@ -7,7 +7,7 @@ spring:
7 7
         server-addr: 192.168.3.222:8848
8 8
         username: nacos
9 9
         password: nacos
10
-        namespace: 98847e88-f851-4d7e-91ff-954bb08e2563
10
+        namespace: local
11 11
       config:
12 12
         # 配置中心地址
13 13
         username: nacos
@@ -18,7 +18,7 @@ spring:
18 18
         # 共享配置
19 19
         shared-configs:
20 20
           - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
21
-        namespace: 98847e88-f851-4d7e-91ff-954bb08e2563
21
+        namespace: local
22 22
     sentinel:
23 23
       # 取消控制台懒加载
24 24
       eager: true

+ 22 - 1
ruoyi-modules/airport-exam/pom.xml

@@ -48,7 +48,18 @@
48 48
         <dependency>
49 49
             <groupId>com.ruoyi</groupId>
50 50
             <artifactId>ruoyi-common-datasource</artifactId>
51
+            <exclusions>
52
+                <exclusion>
53
+                    <groupId>com.github.pagehelper</groupId>
54
+                    <artifactId>pagehelper-spring-boot-starter</artifactId>
55
+                </exclusion>
56
+            </exclusions>
51 57
         </dependency>
58
+<!--        <dependency>-->
59
+<!--            <groupId>com.github.jsqlparser</groupId>-->
60
+<!--            <artifactId>jsqlparser</artifactId>-->
61
+<!--            <version>4.9</version>-->
62
+<!--        </dependency>-->
52 63
 
53 64
         <!-- RuoYi Common DataScope -->
54 65
         <dependency>
@@ -70,7 +81,17 @@
70 81
         <dependency>
71 82
             <groupId>com.baomidou</groupId>
72 83
             <artifactId>mybatis-plus-boot-starter</artifactId>
73
-            <version>3.5.6</version>
84
+            <version>3.1.2</version>
85
+        </dependency>
86
+        <dependency>
87
+            <groupId>com.baomidou</groupId>
88
+            <artifactId>mybatis-plus-generator</artifactId>
89
+            <version>3.1.2</version>
90
+        </dependency>
91
+        <dependency>
92
+            <groupId>com.github.jsqlparser</groupId>
93
+            <artifactId>jsqlparser</artifactId>
94
+            <version>3.1</version>
74 95
         </dependency>
75 96
         <dependency>
76 97
             <groupId>org.projectlombok</groupId>

+ 33 - 0
ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/IdUtils.java

@@ -0,0 +1,33 @@
1
+package com.sundot.airport.common;
2
+import org.springframework.data.redis.core.StringRedisTemplate;
3
+import org.springframework.stereotype.Component;
4
+
5
+import javax.annotation.Resource;
6
+import java.text.SimpleDateFormat;
7
+import java.util.Date;
8
+
9
+@Component
10
+public class IdUtils {
11
+
12
+    @Resource
13
+    private StringRedisTemplate stringRedisTemplate;
14
+
15
+    // 生成带指定前缀的唯一编号
16
+    public String generateId(String prefix) {
17
+        // 获取当前日期作为基础部分(格式:YYMMDD)
18
+        String datePart = new SimpleDateFormat("yyMMdd").format(new Date());
19
+
20
+        // 使用Redis递增计数器,key为prefix+日期
21
+        Long count = stringRedisTemplate.opsForValue().increment(prefix + ":" + datePart);
22
+
23
+        // 如果计数器不存在,则初始化为1
24
+        if (count == null) {
25
+            stringRedisTemplate.opsForValue().set(prefix + ":" + datePart, "1");
26
+            count = 1L;
27
+        }
28
+
29
+        // 组装编号(前缀 + 日期 + 6位自增数,不足补0)
30
+        return prefix + datePart + String.format("%06d", count);
31
+    }
32
+}
33
+

+ 4 - 1
ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/ExamRecOptServiceImpl.java

@@ -10,6 +10,7 @@ import org.slf4j.Logger;
10 10
 import org.slf4j.LoggerFactory;
11 11
 import org.springframework.stereotype.Service;
12 12
 
13
+import javax.annotation.Resource;
13 14
 import java.util.ArrayList;
14 15
 import java.util.List;
15 16
 import java.util.Optional;
@@ -27,10 +28,12 @@ public class ExamRecOptServiceImpl extends ServiceImpl<ExamRecOptMapper, ExamRec
27 28
 
28 29
     private static final Logger log = LoggerFactory.getLogger(ExamRecOptServiceImpl.class);
29 30
 
31
+    @Resource
32
+    private com.sundot.airport.common.IdUtils idUtils;
30 33
     @Override
31 34
     public void setServiceId(ExamRecOpt entity) {
32 35
 
33
-        entity.setEroId(IdUtils.fastUUID());
36
+        entity.setEroId(idUtils.generateId("ERO"));
34 37
     }
35 38
 
36 39
     @Override

+ 4 - 1
ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/ExamRecServiceImpl.java

@@ -17,6 +17,7 @@ import org.slf4j.Logger;
17 17
 import org.slf4j.LoggerFactory;
18 18
 import org.springframework.stereotype.Service;
19 19
 
20
+import javax.annotation.Resource;
20 21
 import java.util.ArrayList;
21 22
 import java.util.List;
22 23
 import java.util.Optional;
@@ -34,10 +35,12 @@ public class ExamRecServiceImpl extends ServiceImpl<ExamRecMapper, ExamRec> impl
34 35
 
35 36
     private static final Logger log = LoggerFactory.getLogger(ExamRecServiceImpl.class);
36 37
 
38
+    @Resource
39
+    private com.sundot.airport.common.IdUtils idUtils;
37 40
     @Override
38 41
     public void setServiceId(ExamRec entity) {
39 42
 
40
-        entity.setErId(IdUtils.fastUUID());
43
+        entity.setErId(idUtils.generateId("ER"));
41 44
     }
42 45
 
43 46
     @Override

+ 4 - 2
ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/ExamServiceImpl.java

@@ -18,6 +18,7 @@ import org.slf4j.LoggerFactory;
18 18
 import org.springframework.beans.BeanUtils;
19 19
 import org.springframework.stereotype.Service;
20 20
 
21
+import javax.annotation.Resource;
21 22
 import java.util.ArrayList;
22 23
 import java.util.List;
23 24
 import java.util.Optional;
@@ -34,10 +35,11 @@ import java.util.Optional;
34 35
 public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements ExamService {
35 36
 
36 37
     private static final Logger log = LoggerFactory.getLogger(ExamServiceImpl.class);
37
-
38
+    @Resource
39
+    private com.sundot.airport.common.IdUtils idUtils;
38 40
     @Override
39 41
     public void setServiceId(Exam entity) {
40
-        entity.setExId(IdUtils.fastUUID());
42
+        entity.setExId(idUtils.generateId("EX"));
41 43
     }
42 44
 
43 45
     @Override

+ 6 - 2
ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/QuesCatServiceImpl.java

@@ -3,7 +3,8 @@ package com.sundot.airport.common.service.impl;
3 3
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
4 4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5 5
 import com.github.pagehelper.PageInfo;
6
-import com.ruoyi.common.core.utils.uuid.IdUtils;
6
+
7
+import com.sundot.airport.common.IdUtils;
7 8
 import com.sundot.airport.common.model.result.QuesCatPageResult;
8 9
 import com.sundot.airport.common.service.QuesCatService;
9 10
 import com.sundot.airport.entity.QuesCat;
@@ -14,6 +15,7 @@ import org.slf4j.Logger;
14 15
 import org.slf4j.LoggerFactory;
15 16
 import org.springframework.stereotype.Service;
16 17
 
18
+import javax.annotation.Resource;
17 19
 import java.util.ArrayList;
18 20
 import java.util.Comparator;
19 21
 import java.util.List;
@@ -32,10 +34,12 @@ public class QuesCatServiceImpl extends ServiceImpl<QuesCatMapper, QuesCat> impl
32 34
 
33 35
     private static final Logger log = LoggerFactory.getLogger(QuesCatServiceImpl.class);
34 36
 
37
+    @Resource
38
+    private IdUtils idUtils;
35 39
     @Override
36 40
     public void setServiceId(QuesCat entity) {
37 41
 
38
-        entity.setQcId(IdUtils.fastUUID());
42
+        entity.setQcId(idUtils.generateId("QC"));
39 43
     }
40 44
 
41 45
     @Override

+ 4 - 1
ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/QuesOptServiceImpl.java

@@ -11,6 +11,7 @@ import org.slf4j.Logger;
11 11
 import org.slf4j.LoggerFactory;
12 12
 import org.springframework.stereotype.Service;
13 13
 
14
+import javax.annotation.Resource;
14 15
 import java.util.ArrayList;
15 16
 import java.util.List;
16 17
 import java.util.Optional;
@@ -28,10 +29,12 @@ public class QuesOptServiceImpl extends ServiceImpl<QuesOptMapper, QuesOpt> impl
28 29
 
29 30
     private static final Logger log = LoggerFactory.getLogger(QuesOptServiceImpl.class);
30 31
 
32
+    @Resource
33
+    private com.sundot.airport.common.IdUtils idUtils;
31 34
     @Override
32 35
     public void setServiceId(QuesOpt entity) {
33 36
 
34
-        entity.setQoId(IdUtils.fastUUID());
37
+        entity.setQoId(idUtils.generateId("QO"));
35 38
     }
36 39
 
37 40
     @Override

+ 4 - 1
ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/QuesServiceImpl.java

@@ -17,6 +17,7 @@ import org.slf4j.Logger;
17 17
 import org.slf4j.LoggerFactory;
18 18
 import org.springframework.stereotype.Service;
19 19
 
20
+import javax.annotation.Resource;
20 21
 import java.util.ArrayList;
21 22
 import java.util.List;
22 23
 import java.util.Optional;
@@ -34,9 +35,11 @@ public class QuesServiceImpl extends ServiceImpl<QuesMapper, Ques> implements Qu
34 35
 
35 36
     private static final Logger log = LoggerFactory.getLogger(QuesServiceImpl.class);
36 37
 
38
+    @Resource
39
+    private com.sundot.airport.common.IdUtils idUtils;
37 40
     @Override
38 41
     public void setServiceId(Ques entity) {
39
-        entity.setQuId(IdUtils.fastUUID());
42
+        entity.setQuId("Q");
40 43
     }
41 44
 
42 45
     @Override

+ 4 - 1
ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/TestPaperCatServiceImpl.java

@@ -14,6 +14,7 @@ import org.slf4j.Logger;
14 14
 import org.slf4j.LoggerFactory;
15 15
 import org.springframework.stereotype.Service;
16 16
 
17
+import javax.annotation.Resource;
17 18
 import java.util.ArrayList;
18 19
 import java.util.Comparator;
19 20
 import java.util.List;
@@ -32,9 +33,11 @@ public class TestPaperCatServiceImpl extends ServiceImpl<TestPaperCatMapper, Tes
32 33
 
33 34
     private static final Logger log = LoggerFactory.getLogger(TestPaperCatServiceImpl.class);
34 35
 
36
+    @Resource
37
+    private com.sundot.airport.common.IdUtils idUtils;
35 38
     @Override
36 39
     public void setServiceId(TestPaperCat entity) {
37
-        entity.setTpcId(IdUtils.fastUUID());
40
+        entity.setTpcId(idUtils.generateId("TPC"));
38 41
     }
39 42
 
40 43
     @Override

+ 4 - 1
ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/TestPaperQuesServiceImpl.java

@@ -12,6 +12,7 @@ import org.slf4j.Logger;
12 12
 import org.slf4j.LoggerFactory;
13 13
 import org.springframework.stereotype.Service;
14 14
 
15
+import javax.annotation.Resource;
15 16
 import java.util.ArrayList;
16 17
 import java.util.List;
17 18
 import java.util.Optional;
@@ -29,10 +30,12 @@ public class TestPaperQuesServiceImpl extends ServiceImpl<TestPaperQuesMapper, T
29 30
 
30 31
     private static final Logger log = LoggerFactory.getLogger(TestPaperQuesServiceImpl.class);
31 32
 
33
+    @Resource
34
+    private com.sundot.airport.common.IdUtils idUtils;
32 35
     @Override
33 36
     public void setServiceId(TestPaperQues entity) {
34 37
 
35
-        entity.setTpqId(IdUtils.fastUUID());
38
+        entity.setTpqId(idUtils.generateId("TPQ"));
36 39
     }
37 40
 
38 41
     @Override

+ 4 - 1
ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/common/service/impl/TestPaperServiceImpl.java

@@ -19,6 +19,7 @@ import org.slf4j.Logger;
19 19
 import org.slf4j.LoggerFactory;
20 20
 import org.springframework.stereotype.Service;
21 21
 
22
+import javax.annotation.Resource;
22 23
 import java.util.List;
23 24
 import java.util.Optional;
24 25
 
@@ -35,10 +36,12 @@ public class TestPaperServiceImpl extends ServiceImpl<TestPaperMapper, TestPaper
35 36
 
36 37
     private static final Logger log = LoggerFactory.getLogger(TestPaperServiceImpl.class);
37 38
 
39
+    @Resource
40
+    private com.sundot.airport.common.IdUtils idUtils;
38 41
     @Override
39 42
     public void setServiceId(TestPaper entity) {
40 43
 
41
-        entity.setTpId(IdUtils.fastUUID());
44
+        entity.setTpId(idUtils.generateId("TP"));
42 45
     }
43 46
 
44 47
     @Override

+ 2 - 2
ruoyi-modules/airport-exam/src/main/java/com/sundot/airport/logic/manage/model/params/ExamAddParam.java

@@ -25,13 +25,13 @@ public class ExamAddParam {
25 25
     /**
26 26
      * 背景图片资源
27 27
      */
28
-    @NotBlank(message = "背景图片不能为空")
28
+   // @NotBlank(message = "背景图片不能为空")
29 29
     private String exBgImg;
30 30
 
31 31
     /**
32 32
      * 详情介绍图片资源
33 33
      */
34
-    @NotBlank(message = "详情介绍图片不能为空")
34
+    //@NotBlank(message = "详情介绍图片不能为空")
35 35
     private String exDetailImg;
36 36
 
37 37
     /**

+ 7 - 1
ruoyi-modules/airport-exam/src/main/resources/logback.xml

@@ -61,8 +61,14 @@
61 61
 	<logger name="com.ruoyi" level="info" />
62 62
 	<!-- Spring日志级别控制  -->
63 63
 	<logger name="org.springframework" level="warn" />
64
+    <logger name="org.mybatis" level="DEBUG" additivity="false">
65
+        <appender-ref ref="console" />
66
+    </logger>
67
+    <logger name="java.sql" level="DEBUG" additivity="false">
68
+        <appender-ref ref="console" />
69
+    </logger>
64 70
 
65
-	<root level="info">
71
+	<root level="debug">
66 72
 		<appender-ref ref="console" />
67 73
 	</root>
68 74
 	

+ 3 - 2
ruoyi-modules/ruoyi-system/src/main/resources/bootstrap-local.yml

@@ -7,7 +7,8 @@ spring:
7 7
         server-addr: 192.168.3.222:8848
8 8
         username: nacos
9 9
         password: nacos
10
-        namespace: 98847e88-f851-4d7e-91ff-954bb08e2563
10
+        namespace: local
11
+
11 12
       config:
12 13
         # 配置中心地址
13 14
         username: nacos
@@ -18,5 +19,5 @@ spring:
18 19
         # 共享配置
19 20
         shared-configs:
20 21
           - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
21
-        namespace: 98847e88-f851-4d7e-91ff-954bb08e2563
22
+        namespace: local
22 23