소스 검색

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

wangliang 1 년 전
부모
커밋
b4be357c7a

+ 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()));
                         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 {
         } else {
             //取当前用户机构id所属考试id集合
             //取当前用户机构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));
         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 = "预警未读数")
     @ApiModelProperty(value = "预警未读数")
     private Integer warningUnread = 0;
     private Integer warningUnread = 0;
 
 
+    @ApiModelProperty(value = "预警考生未读数(去重)")
+    private Integer warningStudentUnread = 0;
+
     @ApiModelProperty(value = "陌生人脸预警总数")
     @ApiModelProperty(value = "陌生人脸预警总数")
     private Integer warningMultipleFaceCount = 0;
     private Integer warningMultipleFaceCount = 0;
 
 
     @ApiModelProperty(value = "异常数据总数")
     @ApiModelProperty(value = "异常数据总数")
     private Integer exceptionCount = 0;
     private Integer exceptionCount = 0;
 
 
+    public Integer getWarningStudentUnread() {
+        return warningStudentUnread;
+    }
+
+    public void setWarningStudentUnread(Integer warningStudentUnread) {
+        this.warningStudentUnread = warningStudentUnread;
+    }
+
     public Long getId() {
     public Long getId() {
         return id;
         return id;
     }
     }

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

@@ -140,4 +140,6 @@ INSERT INTO t_b_role_privilege
 VALUES(153, 'ADMIN', 19);
 VALUES(153, 'ADMIN', 19);
 
 
 delete t from t_b_role_privilege t
 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(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_count) as warningCount,
             sum(t.warning_unread) as warningUnread,
             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.warning_multiple_face_count) as warningMultipleFaceCount,
             sum(t.exception_count) as exceptionCount
             sum(t.exception_count) as exceptionCount
                <!--,
                <!--,