Pārlūkot izejas kodu

预警BUG修改

wangliang 4 gadi atpakaļ
vecāks
revīzija
d6b77a8960

+ 26 - 0
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateWarnInfoController.java

@@ -132,4 +132,30 @@ public class TIeInvigilateWarnInfoController {
         }
         return ResultUtil.ok(Collections.singletonMap(SystemConstant.SUCCESS, true));
     }
+
+    @ApiOperation(value = "预警提醒清除未阅列表接口")
+    @RequestMapping(value = "/approveStatus/list/update", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "监考预警信息", response = InvigilateListWarningBean.class)})
+    public Result approveStatusListUpdate(@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,
+                                          @ApiParam(value = "审阅状态", required = false) @RequestParam(required = false) Integer approveStatus,
+                                          @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name,
+                                          @ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity,
+                                          @ApiParam(value = "陌生人脸min", required = false) @RequestParam(required = false) Integer minMultipleFaceCount,
+                                          @ApiParam(value = "陌生人脸max", required = false) @RequestParam(required = false) Integer maxMultipleFaceCount,
+                                          @ApiParam(value = "异常处理min", required = false) @RequestParam(required = false) Integer minExceptionCount,
+                                          @ApiParam(value = "异常处理max", required = false) @RequestParam(required = false) Integer maxExceptionCount,
+                                          @ApiParam(value = "预警量min", required = false) @RequestParam(required = false) Integer minWarningCount,
+                                          @ApiParam(value = "预警量max", required = false) @RequestParam(required = false) Integer maxWarningCount) {
+        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        AuthDto authDto = (AuthDto) redisUtil.get(SystemConstant.userOauth + "::" + tbUser.getId());
+        //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
+        Long userId = null;
+        if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
+            userId = tbUser.getId();
+        }
+        tOeExamRecordService.approveStatusListUpdate(examId, examActivityId, roomCode, approveStatus, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, userId);
+        return ResultUtil.ok(Collections.singletonMap(SystemConstant.SUCCESS, true));
+    }
 }

+ 41 - 9
themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java

@@ -187,6 +187,38 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                                       @Param("maxWarningCount") Integer maxWarningCount,
                                                                       @Param("userId") Long userId);
 
+    /**
+     * 预警提醒清除未阅列表
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param approveStatus
+     * @param name
+     * @param identity
+     * @param minMultipleFaceCount
+     * @param maxMultipleFaceCount
+     * @param minExceptionCount
+     * @param maxExceptionCount
+     * @param minWarningCount
+     * @param maxWarningCount
+     * @param userId
+     * @return
+     */
+    public Integer approveStatusListUpdate(@Param("examId") Long examId,
+                                           @Param("examActivityId") Long examActivityId,
+                                           @Param("roomCode") String roomCode,
+                                           @Param("approveStatus") Integer approveStatus,
+                                           @Param("name") String name,
+                                           @Param("identity") String identity,
+                                           @Param("minMultipleFaceCount") Integer minMultipleFaceCount,
+                                           @Param("maxMultipleFaceCount") Integer maxMultipleFaceCount,
+                                           @Param("minExceptionCount") Integer minExceptionCount,
+                                           @Param("maxExceptionCount") Integer maxExceptionCount,
+                                           @Param("minWarningCount") Integer minWarningCount,
+                                           @Param("maxWarningCount") Integer maxWarningCount,
+                                           @Param("userId") Long userId);
+
     /**
      * 进度查询列表
      *
@@ -221,12 +253,12 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @return
      */
     public List<InvigilateListProgressExcelBean> invigilatePageProgressListExport(@Param("examId") Long examId,
-                                                                         @Param("examActivityId") Long examActivityId,
-                                                                         @Param("roomCode") String roomCode,
-                                                                         @Param("courseCode") String courseCode,
-                                                                         @Param("name") String name,
-                                                                         @Param("identity") String identity,
-                                                                         @Param("userId") Long userId);
+                                                                                  @Param("examActivityId") Long examActivityId,
+                                                                                  @Param("roomCode") String roomCode,
+                                                                                  @Param("courseCode") String courseCode,
+                                                                                  @Param("name") String name,
+                                                                                  @Param("identity") String identity,
+                                                                                  @Param("userId") Long userId);
 
     /**
      * 监考明细管理列表
@@ -290,10 +322,10 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      */
     public List<InvigilateListPatrolReportBean> patrolReport(@Param("examId") Long examId, @Param("userId") Long userId);
 
-    public TOeExamRecord findOneByExamId(@Param("examId") Long examId,@Param("status") String status);
+    public TOeExamRecord findOneByExamId(@Param("examId") Long examId, @Param("status") String status);
 
     public Long getExamingCount();
-    
+
     public Long getOnlineCount();
 
     public Long getExceptionCount();
@@ -307,6 +339,6 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
     public List<Map<String, Object>> getTypeDistribution();
 
     public List<ExaminationMonitorHourWarnCountBean> getWarnTrend(@Param("startTime") Long startTime);
-    
+
     public void updateHasAnswerFile(@Param("recordId") Long recordId, @Param("hasAnswerFile") Integer hasAnswerFile);
 }

+ 32 - 0
themis-business/src/main/java/com/qmth/themis/business/service/TOeExamRecordService.java

@@ -232,6 +232,38 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
                                                                       Integer maxWarningCount,
                                                                       Long userId);
 
+    /**
+     * 预警提醒清除未阅列表
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param approveStatus
+     * @param name
+     * @param identity
+     * @param minMultipleFaceCount
+     * @param maxMultipleFaceCount
+     * @param minExceptionCount
+     * @param maxExceptionCount
+     * @param minWarningCount
+     * @param maxWarningCount
+     * @param userId
+     * @return
+     */
+    public Integer approveStatusListUpdate(Long examId,
+                                           Long examActivityId,
+                                           String roomCode,
+                                           Integer approveStatus,
+                                           String name,
+                                           String identity,
+                                           Integer minMultipleFaceCount,
+                                           Integer maxMultipleFaceCount,
+                                           Integer minExceptionCount,
+                                           Integer maxExceptionCount,
+                                           Integer minWarningCount,
+                                           Integer maxWarningCount,
+                                           Long userId);
+
     /**
      * 进度查询列表
      *

+ 23 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java

@@ -600,6 +600,29 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
         return tOeExamRecordMapper.invigilatePageWarningList(iPage, examId, examActivityId, roomCode, approveStatus, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, userId);
     }
 
+    /**
+     * 预警提醒清除未阅列表
+     *
+     * @param examId
+     * @param examActivityId
+     * @param roomCode
+     * @param approveStatus
+     * @param name
+     * @param identity
+     * @param minMultipleFaceCount
+     * @param maxMultipleFaceCount
+     * @param minExceptionCount
+     * @param maxExceptionCount
+     * @param minWarningCount
+     * @param maxWarningCount
+     * @param userId
+     * @return
+     */
+    @Override
+    public Integer approveStatusListUpdate(Long examId, Long examActivityId, String roomCode, Integer approveStatus, String name, String identity, Integer minMultipleFaceCount, Integer maxMultipleFaceCount, Integer minExceptionCount, Integer maxExceptionCount, Integer minWarningCount, Integer maxWarningCount, Long userId) {
+        return tOeExamRecordMapper.approveStatusListUpdate(examId, examActivityId, roomCode, approveStatus, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, userId);
+    }
+
     /**
      * 进度查询列表
      *

+ 7 - 0
themis-business/src/main/resources/db/init.sql

@@ -511,6 +511,9 @@ INSERT INTO `t_b_privilege` VALUES (154, '实时监控台视频随机列表', '/
 INSERT INTO `t_b_privilege` VALUES (155, '进度查询列表导出', '/api/admin/invigilate/progress/list/export', 'LINK', 60, 40, NULL, 1600932652000);
 INSERT INTO `t_b_privilege` VALUES (156, '报表-考情监控-预警时间趋势', '/api/admin/report/examination_monitor/warn_msg', 'LINK', 60, 41, NULL, 1600932652000);
 INSERT INTO `t_b_privilege` VALUES (157, '候考/答题状态退出', '/api/oe/exam/exit', 'LINK', 60, 42, NULL, 1600932652000);
+INSERT INTO `t_b_privilege` VALUES (158, '监考端通话中', '/api/admin/monitor/call/calling', 'LINK', 10, 6, NULL, 1600932652000);
+INSERT INTO `t_b_privilege` VALUES (159, '成绩查询', 'markResult', 'MENU', 4, 8, NULL, 1600932652000);
+INSERT INTO `t_b_privilege` VALUES (160, '预警提醒清除未阅列表', '/api/admin/invigilate/warn/approveStatus/list/update', 'LINK', 60, 43, NULL, 1600932652000);
 COMMIT;
 
 -- ----------------------------
@@ -741,6 +744,10 @@ INSERT INTO `t_b_role_privilege` VALUES (192, 'ADMIN', 156);
 INSERT INTO `t_b_role_privilege` VALUES (193, 'INSPECTION', 156);
 INSERT INTO `t_b_role_privilege` VALUES (194, 'STUDENT', 157);
 INSERT INTO `t_b_role_privilege` VALUES (195, 'ADMIN', 120);
+INSERT INTO `t_b_role_privilege` VALUES (196, 'INVIGILATE', 158);
+INSERT INTO `t_b_role_privilege` VALUES (197, 'ADMIN', 159);
+INSERT INTO `t_b_role_privilege` VALUES (198, 'ADMIN', 160);
+INSERT INTO `t_b_role_privilege` VALUES (199, 'INVIGILATE', 160);
 COMMIT;
 
 -- ----------------------------

+ 87 - 0
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -394,6 +394,93 @@
 		order by t.roomCode
 	</select>
 
+	<update id="approveStatusListUpdate">
+		update t_ie_invigilate_warn_info tiiwi set tiiwi.approve_status = 0
+		where exists(
+			select t.warningId from(select
+			tiiwi.id as warningId,
+			tee.id as examId,
+			tee.name as examName,
+			teea.id as examActivityId,
+			tees.id as examStudentId,
+			teea.code as examActivityCode,
+			tees.room_code as roomCode,
+			tees.room_name as roomName,
+			toer.id as examRecordId,
+			tees.`identity`,
+			tees.name,
+			tees.course_code as courseCode,
+			tees.course_name as courseName,
+			toer.status as statusCode,
+			IFNULL(toer.warning_count,0) as warningCount,
+			IFNULL(toer.breach_status,1) as breachStatus,
+			toer.client_last_sync_time as updateTime,
+			tiiwi.approve_status as approveStatus
+			,(select count(1) from t_ie_invigilate_warn_info tiiwi where
+			tiiwi.exam_record_id = toer.id and tiiwi.`type` =
+			'FACE_COUNT_ERROR' and tiiwi.`level` = 'D8') as multipleFaceCount
+			,(select count(1) from t_ie_invigilate_exception_info tiiei where
+			tiiei.exam_record_id = toer.id) as exceptionCount
+			from t_ie_invigilate_warn_info tiiwi
+			left join t_e_exam tee on tee.id = tiiwi.exam_id
+			left join t_e_exam_activity teea on teea.id = tiiwi.exam_activity_id
+			inner join (select toer.id from t_oe_exam_record toer where EXISTS(select
+			tees.id from t_e_exam_student tees where EXISTS (select distinct
+			tbeiu.room_code from t_b_exam_invigilate_user tbeiu
+			where
+			<if test="userId != null and userId != ''">
+				tbeiu.user_id = #{userId} and
+			</if>
+			tbeiu.room_code = tees.room_code and toer.exam_student_id = tees.id)))
+			t on t.id = tiiwi.exam_record_id
+			left join t_oe_exam_record toer on toer.id = t.id
+			left join t_e_exam_student tees on tees.id = tiiwi.exam_student_id
+			<where>
+				<if test="examId != null and examId != ''">
+					and tiiwi.exam_id = #{examId}
+				</if>
+				<if test="examActivityId != null and examActivityId != ''">
+					and tiiwi.exam_activity_id = #{examActivityId}
+				</if>
+				<if test="roomCode != null and roomCode != ''">
+					and tees.room_code = #{roomCode}
+				</if>
+				<if test="approveStatus != null and approveStatus != '' or approveStatus == 0">
+					and tiiwi.approve_status = #{approveStatus}
+				</if>
+				<if test="name != null and name !=''">
+					and tees.name like CONCAT('%', #{name},'%')
+				</if>
+				<if test="identity != null and identity !=''">
+					and tees.identity like CONCAT('%', #{identity},'%')
+				</if>
+				<if test="maxWarningCount != null and maxWarningCount != '' or maxWarningCount == 0">
+					and toer.warning_count &lt;= #{maxWarningCount}
+				</if>
+				<if test="minWarningCount != null and minWarningCount != '' or minWarningCount == 0">
+					and toer.warning_count &gt;= #{minWarningCount}
+				</if>
+				and tee.enable = 1
+				and teea.enable = 1
+			</where>
+			) t
+			<where> 1 = 1
+				<if test="minMultipleFaceCount != null and minMultipleFaceCount != '' or minMultipleFaceCount == 0">
+					and t.multipleFaceCount &gt;= #{minMultipleFaceCount}
+				</if>
+				<if test="maxMultipleFaceCount != null and maxMultipleFaceCount != '' or maxMultipleFaceCount == 0">
+					and t.multipleFaceCount &lt;= #{maxMultipleFaceCount}
+				</if>
+				<if test="minExceptionCount != null and minExceptionCount != '' or minExceptionCount == 0">
+					and t.exceptionCount &gt;= #{minExceptionCount}
+				</if>
+				<if test="maxExceptionCount != null and maxExceptionCount != '' or maxExceptionCount == 0">
+					and t.exceptionCount &lt;= #{maxExceptionCount}
+				</if>
+			</where>
+		 		 and t.warningId = tiiwi.id)
+	</update>
+
 	<select id="invigilatePageProgressList" resultType="com.qmth.themis.business.bean.backend.InvigilateListProgressBean">
 		select
 		distinct tee.id as examId,