Przeglądaj źródła

加入考生预警未读数,去重

wangliang 1 rok temu
rodzic
commit
b8a134c7db

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

@@ -88,7 +88,7 @@ public class TIeInvigilateWarnInfoController {
                         teExamSummaryAllList.addAll(themisCacheService.getExamSummaryCache(t.getExamId(), teExamActivity.getId(), t.getRoomCode()));
                     }
                 }
-                count = teExamSummaryAllList.stream().mapToInt(s -> s.getWarningUnread()).sum();
+                count = teExamSummaryAllList.stream().mapToInt(s -> s.getWarningStudentUnread()).sum();
             }
         } else {
             //取当前用户机构id所属考试id集合
@@ -103,7 +103,7 @@ public class TIeInvigilateWarnInfoController {
                         }
                     }
                 }
-                count = teExamSummaryAllList.stream().mapToInt(s -> s.getWarningUnread()).sum();
+                count = teExamSummaryAllList.stream().mapToInt(s -> s.getWarningStudentUnread()).sum();
             }
         }
         return ResultUtil.ok(Collections.singletonMap(SystemConstant.COUNT, Objects.isNull(count) ? 0 : count));

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/entity/TEExamSummary.java

@@ -66,12 +66,23 @@ public class TEExamSummary implements Serializable {
     @ApiModelProperty(value = "预警未读数")
     private Integer warningUnread = 0;
 
+    @ApiModelProperty(value = "预警考生未读数(去重)")
+    private Integer warningStudentUnread = 0;
+
     @ApiModelProperty(value = "陌生人脸预警总数")
     private Integer warningMultipleFaceCount = 0;
 
     @ApiModelProperty(value = "异常数据总数")
     private Integer exceptionCount = 0;
 
+    public Integer getWarningStudentUnread() {
+        return warningStudentUnread;
+    }
+
+    public void setWarningStudentUnread(Integer warningStudentUnread) {
+        this.warningStudentUnread = warningStudentUnread;
+    }
+
     public Long getId() {
         return id;
     }

+ 0 - 1
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEOrgSummaryServiceImpl.java

@@ -19,7 +19,6 @@ import org.springframework.util.CollectionUtils;
 import org.springframework.util.LinkedMultiValueMap;
 
 import javax.annotation.Resource;
-import java.util.Arrays;
 import java.util.List;
 import java.util.stream.Collectors;
 

+ 5 - 3
themis-business/src/main/resources/db/log/1.2.8.log

@@ -105,8 +105,8 @@ CREATE TABLE `t_e_region_summary` (
   KEY `t_e_region_summary_country_IDX` (`country`,`province`) USING BTREE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='地区统计表';
 
-ALTER TABLE t_e_exam_student1 DROP INDEX roomcode_examid;
-ALTER TABLE t_e_exam_student1 DROP INDEX student_id;
+ALTER TABLE t_e_exam_student DROP INDEX roomcode_examid;
+ALTER TABLE t_e_exam_student DROP INDEX student_id;
 
 CREATE INDEX t_e_exam_student_exam_id_IDX USING BTREE ON t_e_exam_student (exam_id,exam_activity_id,room_code);
 CREATE INDEX t_e_exam_student_student_id_IDX USING BTREE ON t_e_exam_student (student_id,exam_activity_id,enable);
@@ -140,4 +140,6 @@ INSERT INTO t_b_role_privilege
 VALUES(153, 'ADMIN', 19);
 
 delete t from t_b_role_privilege t
-where t.id in (149,153);
+where t.id in (149,153);
+
+ALTER TABLE t_e_exam_summary ADD warning_student_unread BIGINT NULL COMMENT '预警考生未读数(去重)';

+ 1 - 0
themis-business/src/main/resources/mapper/TEExamSummaryMapper.xml

@@ -12,6 +12,7 @@
             sum(case when (t.status = 'ANSWERING' and t.client_websocket_status = 'ON_LINE') or t.status = 'RESUME_PREPARE' or t.status = 'BREAK_OFF' then 1 else 0 end) as examCount,
             sum(t.warning_count) as warningCount,
             sum(t.warning_unread) as warningUnread,
+            sum(case when t.warning_unread > 0 then 1 else 0 end) as warningStudentUnread,
             sum(t.warning_multiple_face_count) as warningMultipleFaceCount,
             sum(t.exception_count) as exceptionCount
                <!--,