Sfoglia il codice sorgente

增加测试配置文件

haogh 1 anno fa
parent
commit
812ca7d0ac

+ 1 - 1
src/main/java/com/qmth/exam/reserve/controller/admin/StudentApplyController.java

@@ -152,7 +152,7 @@ public class StudentApplyController extends BaseController {
     @Aac(strict = false, auth = false)
     @Aac(strict = false, auth = false)
     @ApiOperation(value = "自动排考")
     @ApiOperation(value = "自动排考")
     @PostMapping(value = "/std/auto/layout")
     @PostMapping(value = "/std/auto/layout")
-    public void autoLayout(@ApiParam("教学点ID") @RequestParam Long teachingId) {
+    public void autoLayout(@ApiParam("教学点ID") @RequestParam(required = false) Long teachingId) {
         // LoginUser user = this.curLoginUser();
         // LoginUser user = this.curLoginUser();
         // if (!Role.ADMIN.equals(user.getRole())) {
         // if (!Role.ADMIN.equals(user.getRole())) {
         // throw new StatusException("没有权限");
         // throw new StatusException("没有权限");

+ 7 - 2
src/main/java/com/qmth/exam/reserve/service/impl/StudentApplyServiceImpl.java

@@ -718,13 +718,17 @@ public class StudentApplyServiceImpl extends ServiceImpl<StudentApplyDao, Studen
             List<TimePeriodEntity> noCancelTimePeroidList = listNoCancelApplyTimePeroid(timePeriodList,
             List<TimePeriodEntity> noCancelTimePeroidList = listNoCancelApplyTimePeroid(timePeriodList,
                     applyTask.getAllowApplyCancelDays());
                     applyTask.getAllowApplyCancelDays());
             if (noCancelTimePeroidList.isEmpty()) {
             if (noCancelTimePeroidList.isEmpty()) {
-                log.info("当前时间不在取消预约范围内");
+                log.warn("当前时间不在取消预约范围内");
                 return;
                 return;
             }
             }
             // 2.查询考试日期的待排考的考生
             // 2.查询考试日期的待排考的考生
             List<StudentApplyEntity> toBeLayoutStudentList = this.baseMapper.listTimePeriod(
             List<StudentApplyEntity> toBeLayoutStudentList = this.baseMapper.listTimePeriod(
                     noCancelTimePeroidList.stream().map(item -> item.getId()).collect(Collectors.toList()),
                     noCancelTimePeroidList.stream().map(item -> item.getId()).collect(Collectors.toList()),
                     Boolean.FALSE);
                     Boolean.FALSE);
+            if (toBeLayoutStudentList == null || toBeLayoutStudentList.isEmpty()) {
+                log.warn("没有待排考的考生");
+                return;
+            }
             // 3.开始排考
             // 3.开始排考
             Map<Long, List<StudentApplyEntity>> toBeLayoutStudentMap = toBeLayoutStudentList.stream()
             Map<Long, List<StudentApplyEntity>> toBeLayoutStudentMap = toBeLayoutStudentList.stream()
                     .collect(Collectors.groupingBy(StudentApplyEntity::getExamSiteId));
                     .collect(Collectors.groupingBy(StudentApplyEntity::getExamSiteId));
@@ -733,7 +737,8 @@ public class StudentApplyServiceImpl extends ServiceImpl<StudentApplyDao, Studen
                         .collect(Collectors.groupingBy(StudentApplyEntity::getTimePeriodId));
                         .collect(Collectors.groupingBy(StudentApplyEntity::getTimePeriodId));
                 List<ExamRoomEntity> roomList = listExamRoom(examSiteId);
                 List<ExamRoomEntity> roomList = listExamRoom(examSiteId);
                 if (roomList.isEmpty()) {
                 if (roomList.isEmpty()) {
-                    throw new StatusException(examSiteId + ":未设置考场");
+                    log.warn(examSiteId + ":未设置考场");
+                    return;
                 }
                 }
                 ExamSiteEntity examSite = examSiteService.getById(examSiteId);
                 ExamSiteEntity examSite = examSiteService.getById(examSiteId);
                 layoutStudentByTimePeriod(applyTask.getId(), examSite, roomList, timeLayoutStudentMap);
                 layoutStudentByTimePeriod(applyTask.getId(), examSite, roomList, timeLayoutStudentMap);

+ 55 - 0
src/main/resources/application-test.properties

@@ -0,0 +1,55 @@
+#
+# ********** server config **********
+#
+server.port=8080
+server.servlet.context-path=/
+server.servlet.session.timeout=PT2H
+spring.servlet.multipart.max-request-size=100MB
+spring.servlet.multipart.max-file-size=100MB
+spring.main.allow-bean-definition-overriding=true
+spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
+spring.jackson.time-zone=GMT+8
+server.tomcat.threads.max=800
+server.tomcat.max-connections=20000
+server.tomcat.connection-timeout=90000
+#
+# ********** mysql config **********
+#
+db.host=192.168.10.136
+db.port=3307
+db.database=exam_reserve_db
+com.qmth.datasource.username=exam_reserve_db
+com.qmth.datasource.password=exam_reserve_db
+com.qmth.datasource.url=jdbc:mysql://${db.host}:${db.port}/${db.database}?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2b8&rewriteBatchedStatements=true
+com.qmth.datasource.max-pool-size=200
+com.qmth.datasource.min-idle=10
+#
+# ********** redis config **********
+#
+com.qmth.redis.host=192.168.10.136
+com.qmth.redis.password=123456
+com.qmth.redis.port=6379
+com.qmth.redis.db=16
+#
+# ********** file config **********
+#
+com.qmth.fss.config=/home/admin/project/exam-reserve/static
+com.qmth.fss.server=https://qmth-test.oss-cn-shenzhen.aliyuncs.com/apply
+#
+# ********** sys config **********
+#
+com.qmth.mybatis.block-attack=false
+com.qmth.mybatis.log-level=info
+com.qmth.logging.root-level=info
+com.qmth.logging.file-path=logs/exam-reserve.log
+#
+# ********** auth config **********
+#
+com.qmth.auth.time-max-delay=10m
+com.qmth.auth.time-max-ahead=10m
+#
+# ********** wx config **********
+#
+wx.app_id=wx90d496f6838bcff7
+wx.app_secret=7802a1c8ff50344977fa0c18b4d147a8
+