浏览代码

需求优化

wangliang 2 年之前
父节点
当前提交
6cf493845d

+ 39 - 1
themis-admin/src/main/java/com/qmth/themis/admin/api/TIeInvigilateController.java

@@ -174,6 +174,27 @@ public class TIeInvigilateController {
         return ResultUtil.ok(invigilateListVideoBeanIPage);
     }
 
+    public static void main(String[] args) {
+        List<String> monitorVideoSourceList = new ArrayList<>();
+//        monitorVideoSourceList.add(MonitorVideoSourceEnum.CLIENT_CAMERA.name());
+        monitorVideoSourceList.add(MonitorVideoSourceEnum.MOBILE_FIRST.name());
+        monitorVideoSourceList.add(MonitorVideoSourceEnum.MOBILE_SECOND.name());
+        if (Objects.nonNull(monitorVideoSourceList) && (monitorVideoSourceList.contains(MonitorVideoSourceEnum.CLIENT_CAMERA.name())
+                && monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_FIRST.name())
+                && monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_SECOND.name()))) {
+            System.out.println(1);
+        } else if (Objects.nonNull(monitorVideoSourceList) && (monitorVideoSourceList.contains(MonitorVideoSourceEnum.CLIENT_CAMERA.name())
+                && monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_FIRST.name()))) {
+            System.out.println(2);
+        } else if (Objects.nonNull(monitorVideoSourceList) && (monitorVideoSourceList.contains(MonitorVideoSourceEnum.CLIENT_CAMERA.name())
+                && monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_SECOND.name()))) {
+            System.out.println(3);
+        } else if (Objects.nonNull(monitorVideoSourceList) && (monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_FIRST.name())
+                && monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_SECOND.name()))) {
+            System.out.println(4);
+        }
+    }
+
     @ApiOperation(value = "实时监控台视频随机列表接口")
     @RequestMapping(value = "/list/video/random", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = InvigilateListVideoBean.class)})
@@ -197,8 +218,25 @@ public class TIeInvigilateController {
                 if (Objects.nonNull(s.getMonitorVideoSource()) && !Objects.equals(s.getMonitorVideoSource().trim().replaceAll(" ", ""), "")) {
                     monitorVideoSourceList = Arrays.asList(s.getMonitorVideoSource().trim().toUpperCase().replaceAll(" ", "").split(","));
                 }
-                if (Objects.nonNull(monitorVideoSourceList) && monitorVideoSourceList.contains(MonitorVideoSourceEnum.CLIENT_CAMERA.name())) {
+                if (Objects.nonNull(monitorVideoSourceList) && (monitorVideoSourceList.contains(MonitorVideoSourceEnum.CLIENT_CAMERA.name())
+                        && monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_FIRST.name())
+                        && monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_SECOND.name()))) {
+                    s.setMonitorLiveUrl(SystemConstant.setStreamId(dictionaryConfig.monitorDomain().getPrefix(), s.getExamRecordId(), MonitorVideoSourceEnum.CLIENT_CAMERA));
+                } else if (Objects.nonNull(monitorVideoSourceList) && (monitorVideoSourceList.contains(MonitorVideoSourceEnum.CLIENT_CAMERA.name())
+                        && monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_FIRST.name()))) {
+                    s.setMonitorLiveUrl(SystemConstant.setStreamId(dictionaryConfig.monitorDomain().getPrefix(), s.getExamRecordId(), MonitorVideoSourceEnum.CLIENT_CAMERA));
+                } else if (Objects.nonNull(monitorVideoSourceList) && (monitorVideoSourceList.contains(MonitorVideoSourceEnum.CLIENT_CAMERA.name())
+                        && monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_SECOND.name()))) {
+                    s.setMonitorLiveUrl(SystemConstant.setStreamId(dictionaryConfig.monitorDomain().getPrefix(), s.getExamRecordId(), MonitorVideoSourceEnum.CLIENT_CAMERA));
+                } else if (Objects.nonNull(monitorVideoSourceList) && (monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_FIRST.name())
+                        && monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_SECOND.name()))) {
+                    s.setMonitorLiveUrl(SystemConstant.setStreamId(dictionaryConfig.monitorDomain().getPrefix(), s.getExamRecordId(), MonitorVideoSourceEnum.MOBILE_FIRST));
+                } else if (Objects.nonNull(monitorVideoSourceList) && monitorVideoSourceList.contains(MonitorVideoSourceEnum.CLIENT_CAMERA.name())) {
                     s.setMonitorLiveUrl(SystemConstant.setStreamId(dictionaryConfig.monitorDomain().getPrefix(), s.getExamRecordId(), MonitorVideoSourceEnum.CLIENT_CAMERA));
+                } else if (Objects.nonNull(monitorVideoSourceList) && monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_FIRST.name())) {
+                    s.setMonitorLiveUrl(SystemConstant.setStreamId(dictionaryConfig.monitorDomain().getPrefix(), s.getExamRecordId(), MonitorVideoSourceEnum.MOBILE_FIRST));
+                } else if (Objects.nonNull(monitorVideoSourceList) && monitorVideoSourceList.contains(MonitorVideoSourceEnum.MOBILE_SECOND.name())) {
+                    s.setMonitorLiveUrl(SystemConstant.setStreamId(dictionaryConfig.monitorDomain().getPrefix(), s.getExamRecordId(), MonitorVideoSourceEnum.MOBILE_SECOND));
                 }
                 WebsocketStatusEnum websocketStatusEnum = ExamRecordCacheUtil.getClientWebsocketStatus(s.getExamRecordId());
                 if (Objects.nonNull(websocketStatusEnum)) {

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

@@ -87,6 +87,7 @@
         <if test="orgId != null">
             and h.org_id=#{orgId}
         </if>
+        and h.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         order by t.create_time desc limit #{conut}
         ) tem
         LEFT JOIN t_e_exam_student f ON tem.examStudentId = f.id

+ 13 - 2
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -1016,6 +1016,7 @@
         <if test="orgId != null and orgId != ''">
             and h.org_id=#{orgId}
         </if>
+        and h.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         and (f.STATUS = 'FIRST_PREPARE' or f.STATUS = 'ANSWERING'
         or f.STATUS = 'BREAK_OFF' or f.STATUS = 'RESUME_PREPARE')
         AND t.type!='NONE'
@@ -1033,7 +1034,8 @@
         <if test="orgId != null and orgId != ''">
             and h.org_id=#{orgId}
         </if>
-        and (f.STATUS = 'FIRST_PREPARE' or f.STATUS = 'ANSWERING'
+        and h.monitor_status <![CDATA[ <> ]]> 'FINISHED'
+        and  (f.STATUS = 'FIRST_PREPARE' or f.STATUS = 'ANSWERING'
         or f.STATUS = 'BREAK_OFF' or f.STATUS = 'RESUME_PREPARE')
         AND t.status = 0
         AND t.id IS NOT NULL
@@ -1052,6 +1054,7 @@
         <if test="orgId != null and orgId != ''">
             and tee.org_id = #{orgId}
         </if>
+        and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         and (toer.STATUS = 'FIRST_PREPARE' or toer.STATUS = 'ANSWERING'
         or toer.STATUS = 'BREAK_OFF' or toer.STATUS = 'RESUME_PREPARE')
         group by
@@ -1075,12 +1078,13 @@
         <if test="orgId != null and orgId != ''">
             and tee.org_id = #{orgId}
         </if>
+        and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         and (toer.STATUS = 'FIRST_PREPARE' or toer.STATUS = 'ANSWERING'
         or toer.STATUS = 'BREAK_OFF' or toer.STATUS = 'RESUME_PREPARE')
         and tir.country != '0' and tir.province != '0'
         group by
         tir.country,
-        tir.province;
+        tir.province
     </select>
 
     <select id="getMap" resultType="com.qmth.themis.business.bean.admin.ExaminationMonitorMapBean">
@@ -1106,6 +1110,7 @@
         <if test="orgId != null and orgId != ''">
             and tee.org_id = #{orgId}
         </if>
+        and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         and toer.client_websocket_status = 'ON_LINE'
         and (toer.STATUS = 'FIRST_PREPARE'
         or toer.STATUS = 'ANSWERING'
@@ -1133,6 +1138,7 @@
         <if test="orgId != null and orgId != ''">
             and tee.org_id = #{orgId}
         </if>
+        and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         and (toer.STATUS = 'FIRST_PREPARE'
         or toer.STATUS = 'ANSWERING'
         or toer.STATUS = 'BREAK_OFF'
@@ -1217,6 +1223,7 @@
                 from t_e_exam tee
                 where tee.org_id = #{orgId}
                   and toer.exam_id = tee.id
+                  and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
             )
           and (toer.STATUS = 'FIRST_PREPARE'
             or toer.STATUS = 'ANSWERING'
@@ -1231,6 +1238,7 @@
                 from t_e_exam tee
                 where tee.org_id = #{orgId}
                   and toer.exam_id = tee.id
+                  and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
             )
           and toer.STATUS = 'FIRST_PREPARE'
           and toer.client_websocket_status = 'ON_LINE'
@@ -1242,6 +1250,7 @@
                 from t_e_exam tee
                 where tee.org_id = #{orgId}
                   and toer.exam_id = tee.id
+                  and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
             )
           and toer.STATUS = 'ANSWERING'
           and toer.client_websocket_status = 'ON_LINE'
@@ -1647,6 +1656,7 @@
         <if test="orgId != null and orgId != ''">
             and tee.org_id = #{orgId}
         </if>
+        and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         and (teesol.create_time <![CDATA[ >= ]]> #{minusTime}
         and teesol.create_time <![CDATA[ <= ]]> #{currentTime})
         and teesol.`type` = 'ON_LINE') t where t.createTime <![CDATA[ <= ]]> #{item}
@@ -1671,6 +1681,7 @@
         <if test="orgId != null and orgId != ''">
             and tee.org_id = #{orgId}
         </if>
+        and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         and (teesol.create_time <![CDATA[ >= ]]> #{minusTime}
         and teesol.create_time <![CDATA[ <= ]]> #{currentTime})
         and teesol.`type` = 'OFF_LINE') t where t.createTime <![CDATA[ <= ]]> #{item}