wangliang 1 жил өмнө
parent
commit
a465b2adbc

+ 2 - 0
themis-admin/src/main/java/com/qmth/themis/admin/api/SysController.java

@@ -10,6 +10,7 @@ import com.google.common.reflect.TypeToken;
 import com.qmth.boot.core.solar.config.SolarProperties;
 import com.qmth.boot.core.solar.service.SolarService;
 import com.qmth.themis.admin.config.DictionaryConfig;
+import com.qmth.themis.business.annotation.RedisLimitAnnotation;
 import com.qmth.themis.business.bean.admin.DataCountBean;
 import com.qmth.themis.business.bean.admin.MapDataCountBean;
 import com.qmth.themis.business.bean.admin.OrgDataCountBean;
@@ -541,6 +542,7 @@ public class SysController {
     @ApiOperation(value = "数据统计接口")
     @RequestMapping(value = "/data_count", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "超管数据统计接口", response = Result.class)})
+    @RedisLimitAnnotation(key = "dataCount", period = 1, count = 1)
     public Result dataCount() {
         List<Long> list = tOeExamRecordService.dataCount();
         List<OrgDataCountBean> orgDataCountBeanList = tOeExamRecordService.orgDataCount();

+ 3 - 0
themis-admin/src/main/java/com/qmth/themis/admin/api/TIeInvigilateWarnInfoController.java

@@ -2,6 +2,7 @@ package com.qmth.themis.admin.api;
 
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmth.themis.business.annotation.RedisLimitAnnotation;
 import com.qmth.themis.business.bean.admin.InvigilateListWarningBean;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.AuthDto;
@@ -57,6 +58,7 @@ public class TIeInvigilateWarnInfoController {
     @ApiOperation(value = "预警提醒接口")
     @RequestMapping(value = "/notify", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"count\":1}", response = Result.class)})
+    @RedisLimitAnnotation(key = "warnNotify", period = 1, count = 1)
     public Result notify(@ApiParam(value = "考试批次id", required = false) @RequestParam(required = false) Long examId,
                          @ApiParam(value = "考试场次id", required = false) @RequestParam(required = false) Long examActivityId,
                          @ApiParam(value = "虚拟考场代码", required = false) @RequestParam(required = false) String roomCode) {
@@ -101,6 +103,7 @@ public class TIeInvigilateWarnInfoController {
     @ApiOperation(value = "预警消息接口")
     @RequestMapping(value = "/message", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "预警通知信息", response = TIeWarningNotifyDto.class)})
+    @RedisLimitAnnotation(key = "warnMessage", period = 1, count = 1)
     public Result warningMessage(@ApiParam(value = "考试批次id", required = false) @RequestParam(required = false) Long examId) {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
         AuthDto authDto = themisCacheService.addAccountAuthCache(tbUser.getId());

+ 4 - 7
themis-business/src/main/resources/mapper/TIeInvigilateWarnInfoMapper.xml

@@ -8,7 +8,7 @@
         left join t_e_exam_student tees on tees.id = tiiwi.exam_student_id
         left join t_e_exam tee on tee.id = tees.exam_id
         <if test="userId != null and userId != ''">
-            left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = tees.exam_id
+            left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = tees.exam_id and tbeiu.room_code = tees.room_code
         </if>
         <where> 1 = 1
             and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
@@ -40,7 +40,7 @@
         left join t_e_exam_student tees on tees.id = tiiwi.exam_student_id
         left join t_e_exam tee on tee.id = tees.exam_id
         <if test="userId != null and userId != ''">
-            left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = tees.exam_id
+            left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = tees.exam_id and tbeiu.room_code = tees.room_code
         </if>
         <where> 1 = 1
             and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
@@ -87,11 +87,8 @@
         tiiwi.exam_record_id) temp on
         temp.warningId = tiiwi.id
         2022/09/03新增 end-->
-        left join t_e_exam_student tees on
-        tees.id = tiiwi.exam_student_id
-        left join t_b_exam_invigilate_user tbeiu on
-        tbeiu.exam_id = tiiwi.exam_id
-        and tbeiu.room_code = tees.room_code
+        left join t_e_exam_student tees on tees.id = tiiwi.exam_student_id
+        left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = tiiwi.exam_id and tbeiu.room_code = tees.room_code
         join t_e_exam tee on tee.id = tiiwi.exam_id
         <where> 1 = 1
             and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'