wangliang 4 anni fa
parent
commit
1df9498c2d
17 ha cambiato i file con 298 aggiunte e 111 eliminazioni
  1. 14 0
      themis-backend/src/main/java/com/qmth/themis/backend/api/SysController.java
  2. 1 1
      themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamStudentController.java
  3. 1 1
      themis-backend/src/main/resources/application.properties
  4. 8 0
      themis-business/src/main/java/com/qmth/themis/business/dao/TBExamInvigilateUserMapper.java
  5. 13 1
      themis-business/src/main/java/com/qmth/themis/business/dao/TIeExamInvigilateCallMapper.java
  6. 32 0
      themis-business/src/main/java/com/qmth/themis/business/dto/response/RoomCodeQueryDto.java
  7. 8 12
      themis-business/src/main/java/com/qmth/themis/business/enums/FieldUniqueEnum.java
  8. 8 0
      themis-business/src/main/java/com/qmth/themis/business/service/TBExamInvigilateUserService.java
  9. 12 1
      themis-business/src/main/java/com/qmth/themis/business/service/TIeExamInvigilateCallService.java
  10. 11 0
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TBExamInvigilateUserServiceImpl.java
  11. 11 0
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeExamInvigilateCallServiceImpl.java
  12. 9 0
      themis-business/src/main/resources/mapper/TBExamInvigilateUserMapper.xml
  13. 14 0
      themis-business/src/main/resources/mapper/TIeExamInvigilateCallMapper.xml
  14. 56 39
      themis-exam/src/main/java/com/qmth/themis/exam/api/TIeInvigilateCallMobileController.java
  15. 66 50
      themis-exam/src/main/java/com/qmth/themis/exam/api/TIeInvigilateCallOeController.java
  16. 1 1
      themis-exam/src/main/resources/application.properties
  17. 33 5
      themis-mq/src/main/java/com/qmth/themis/mq/service/impl/MqLogicServiceImpl.java

+ 14 - 0
themis-backend/src/main/java/com/qmth/themis/backend/api/SysController.java

@@ -7,6 +7,7 @@ import com.google.gson.Gson;
 import com.qmth.themis.backend.config.DictionaryConfig;
 import com.qmth.themis.business.config.SystemConfig;
 import com.qmth.themis.business.constant.SystemConstant;
+import com.qmth.themis.business.dto.response.RoomCodeQueryDto;
 import com.qmth.themis.business.dto.response.TEExamQueryDto;
 import com.qmth.themis.business.entity.*;
 import com.qmth.themis.business.enums.DownloadFileEnum;
@@ -74,6 +75,9 @@ public class SysController {
     @Resource
     TEExamService teExamService;
 
+    @Resource
+    TBExamInvigilateUserService tbExamInvigilateUserService;
+
     @ApiOperation(value = "菜单查询接口")
     @RequestMapping(value = "/getMenu", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "菜单信息", response = TBPrivilege.class)})
@@ -271,4 +275,14 @@ public class SysController {
         map.put(SystemConstant.RECORDS, teExamQueryDtoList);
         return ResultUtil.ok(map);
     }
+
+    @ApiOperation(value = "考场查询接口")
+    @RequestMapping(value = "/examRoom/query", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "角色信息", response = RoomCodeQueryDto.class)})
+    public Result examRoomQuery() {
+        List<RoomCodeQueryDto> roomCodeQueryDtoList = tbExamInvigilateUserService.examRoomQuery();
+        Map map = new HashMap();
+        map.put(SystemConstant.RECORDS, roomCodeQueryDtoList);
+        return ResultUtil.ok(map);
+    }
 }

+ 1 - 1
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamStudentController.java

@@ -72,7 +72,7 @@ public class TEExamStudentController {
     @ApiOperation(value = "考生查询接口")
     @RequestMapping(value = "/query", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TEExamStudentDto.class)})
-    public Result query(@ApiParam(value = "考试批次id", required = true) @RequestParam Long examId, @ApiParam(value = "考试次id", required = false) @RequestParam(required = false) Long activityId, @ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity, @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name, @ApiParam(value = "考场代码", required = false) @RequestParam(required = false) String roomCode, @ApiParam(value = "科目代码", required = false) @RequestParam(required = false) String courseCode, @ApiParam(value = "年级", required = false) @RequestParam(required = false) String grade, @ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Integer enable, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+    public Result query(@ApiParam(value = "考试批次id", required = true) @RequestParam Long examId, @ApiParam(value = "考试次id", required = false) @RequestParam(required = false) Long activityId, @ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity, @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name, @ApiParam(value = "考场代码", required = false) @RequestParam(required = false) String roomCode, @ApiParam(value = "科目代码", required = false) @RequestParam(required = false) String courseCode, @ApiParam(value = "年级", required = false) @RequestParam(required = false) String grade, @ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Integer enable, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
         if (Objects.isNull(examId) || Objects.equals(examId, "")) {
             throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
         }

+ 1 - 1
themis-backend/src/main/resources/application.properties

@@ -160,4 +160,4 @@ prefix.url.admin=api/admin
 
 #\u65E0\u9700\u9274\u6743\u7684url
 no.auth.urls=/webjars/**,/druid/**,/swagger-ui.html,/doc.html,/swagger-resources/**,/v2/api-docs,/webjars/springfox-swagger-ui/**,/api/admin/user/login/account,/api/admin/sys/org/queryByOrgCode,/file/**,/upload/**,/client/**,/base_photo/**,/frontend/**
-common.system.urls=/api/admin/sys/getMenu,/api/admin/user/logout,/api/admin/sys/env,/api/admin/sys/file/upload,/api/admin/sys/file/download,/api/admin/sys/org/query,/api/admin/sys/role/query,/api/admin/sys/examActivity/query,/api/admin/sys/exam/query
+common.system.urls=/api/admin/sys/getMenu,/api/admin/user/logout,/api/admin/sys/env,/api/admin/sys/file/upload,/api/admin/sys/file/download,/api/admin/sys/org/query,/api/admin/sys/role/query,/api/admin/sys/examActivity/query,/api/admin/sys/exam/query,/api/admin/sys/examRoom/query

+ 8 - 0
themis-business/src/main/java/com/qmth/themis/business/dao/TBExamInvigilateUserMapper.java

@@ -3,6 +3,7 @@ package com.qmth.themis.business.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.themis.business.dto.RoomCodeExportDto;
+import com.qmth.themis.business.dto.response.RoomCodeQueryDto;
 import com.qmth.themis.business.dto.response.TBExamInvigilateUserDto;
 import com.qmth.themis.business.entity.TBExamInvigilateUser;
 import org.apache.ibatis.annotations.Mapper;
@@ -37,4 +38,11 @@ public interface TBExamInvigilateUserMapper extends BaseMapper<TBExamInvigilateU
      * @return
      */
     public List<RoomCodeExportDto> examInvigilateUserExport();
+
+    /**
+     * 考场查询
+     *
+     * @return
+     */
+    public List<RoomCodeQueryDto> examRoomQuery();
 }

+ 13 - 1
themis-business/src/main/java/com/qmth/themis/business/dao/TIeExamInvigilateCallMapper.java

@@ -1,9 +1,12 @@
 package com.qmth.themis.business.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.themis.business.entity.TIeExamInvigilateCall;
-import com.qmth.themis.business.entity.TIeExamInvigilateCallLog;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
 
 /**
  * @Description: 监考 监控通话申请 Mapper 接口
@@ -15,4 +18,13 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 public interface TIeExamInvigilateCallMapper extends BaseMapper<TIeExamInvigilateCall> {
 
+    /**
+     * 监考监控通话申请查询
+     *
+     * @param iPage
+     * @param examActivityId
+     * @param status
+     * @return
+     */
+    public IPage<TIeExamInvigilateCall> examInvigilateCallQuery(IPage<Map> iPage, @Param("examActivityId") Long examActivityId, @Param("status") String status);
 }

+ 32 - 0
themis-business/src/main/java/com/qmth/themis/business/dto/response/RoomCodeQueryDto.java

@@ -0,0 +1,32 @@
+package com.qmth.themis.business.dto.response;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 公用考场查询
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/8/15
+ */
+public class RoomCodeQueryDto implements Serializable {
+
+    private String roomCode;
+    private String roomName;
+
+    public String getRoomCode() {
+        return roomCode;
+    }
+
+    public void setRoomCode(String roomCode) {
+        this.roomCode = roomCode;
+    }
+
+    public String getRoomName() {
+        return roomName;
+    }
+
+    public void setRoomName(String roomName) {
+        this.roomName = roomName;
+    }
+}

+ 8 - 12
themis-business/src/main/java/com/qmth/themis/business/enums/FieldUniqueEnum.java

@@ -25,9 +25,9 @@ public enum FieldUniqueEnum {
 
     t_b_exam_invigilate_user_orgId_userId_roomCode_Idx("监考员"),
 
-    t_b_user_loginName_orgId_Idx("用户名");
+    t_b_user_loginName_orgId_Idx("用户名"),
 
-//    t_ie_exam_invigilate_call_recordId_source_Idx("监考视频源");
+    t_ie_exam_invigilate_call_recordId_source_Idx("监考视频源");
 
     private String code;
 
@@ -62,11 +62,9 @@ public enum FieldUniqueEnum {
             return t_b_exam_invigilate_user_orgId_userId_roomCode_Idx.name();
         } else if (Objects.equals(value.trim(), t_b_user_loginName_orgId_Idx.code)) {
             return t_b_user_loginName_orgId_Idx.name();
-        }
-//        else if (Objects.equals(value.trim(), t_ie_exam_invigilate_call_recordId_source_Idx.code)) {
-//            return t_ie_exam_invigilate_call_recordId_source_Idx.name();
-//        }
-        else {
+        } else if (Objects.equals(value.trim(), t_ie_exam_invigilate_call_recordId_source_Idx.code)) {
+            return t_ie_exam_invigilate_call_recordId_source_Idx.name();
+        } else {
             return t_e_exam_activity_examId_code_Idx.name();
         }
     }
@@ -94,11 +92,9 @@ public enum FieldUniqueEnum {
             return t_b_exam_invigilate_user_orgId_userId_roomCode_Idx.code;
         } else if (value.trim().contains(t_b_user_loginName_orgId_Idx.name())) {
             return t_b_user_loginName_orgId_Idx.code;
-        }
-//        else if (value.trim().contains(t_ie_exam_invigilate_call_recordId_source_Idx.name())) {
-//            return t_ie_exam_invigilate_call_recordId_source_Idx.code;
-//        }
-        else {
+        } else if (value.trim().contains(t_ie_exam_invigilate_call_recordId_source_Idx.name())) {
+            return t_ie_exam_invigilate_call_recordId_source_Idx.code;
+        } else {
             return t_e_exam_activity_examId_code_Idx.code;
         }
     }

+ 8 - 0
themis-business/src/main/java/com/qmth/themis/business/service/TBExamInvigilateUserService.java

@@ -3,6 +3,7 @@ package com.qmth.themis.business.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.themis.business.dto.RoomCodeExportDto;
+import com.qmth.themis.business.dto.response.RoomCodeQueryDto;
 import com.qmth.themis.business.dto.response.TBExamInvigilateUserDto;
 import com.qmth.themis.business.entity.TBExamInvigilateUser;
 
@@ -34,4 +35,11 @@ public interface TBExamInvigilateUserService extends IService<TBExamInvigilateUs
      * @return
      */
     public List<RoomCodeExportDto> examInvigilateUserExport();
+
+    /**
+     * 考场查询
+     *
+     * @return
+     */
+    public List<RoomCodeQueryDto> examRoomQuery();
 }

+ 12 - 1
themis-business/src/main/java/com/qmth/themis/business/service/TIeExamInvigilateCallService.java

@@ -1,8 +1,10 @@
 package com.qmth.themis.business.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.themis.business.entity.TIeExamInvigilateCall;
-import com.qmth.themis.business.entity.TIeExamInvigilateCallLog;
+
+import java.util.Map;
 
 /**
  * @Description: 监考监控通话申请 服务类
@@ -13,4 +15,13 @@ import com.qmth.themis.business.entity.TIeExamInvigilateCallLog;
  */
 public interface TIeExamInvigilateCallService extends IService<TIeExamInvigilateCall> {
 
+    /**
+     * 监考监控通话申请查询
+     *
+     * @param iPage
+     * @param examActivityId
+     * @param status
+     * @return
+     */
+    public IPage<TIeExamInvigilateCall> examInvigilateCallQuery(IPage<Map> iPage, Long examActivityId, String status);
 }

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TBExamInvigilateUserServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.themis.business.dao.TBExamInvigilateUserMapper;
 import com.qmth.themis.business.dto.RoomCodeExportDto;
+import com.qmth.themis.business.dto.response.RoomCodeQueryDto;
 import com.qmth.themis.business.dto.response.TBExamInvigilateUserDto;
 import com.qmth.themis.business.entity.TBExamInvigilateUser;
 import com.qmth.themis.business.service.TBExamInvigilateUserService;
@@ -48,4 +49,14 @@ public class TBExamInvigilateUserServiceImpl extends ServiceImpl<TBExamInvigilat
     public List<RoomCodeExportDto> examInvigilateUserExport() {
         return tbExamInvigilateUserMapper.examInvigilateUserExport();
     }
+
+    /**
+     * 考场查询
+     *
+     * @return
+     */
+    @Override
+    public List<RoomCodeQueryDto> examRoomQuery() {
+        return tbExamInvigilateUserMapper.examRoomQuery();
+    }
 }

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeExamInvigilateCallServiceImpl.java

@@ -1,11 +1,15 @@
 package com.qmth.themis.business.service.impl;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.themis.business.dao.TIeExamInvigilateCallMapper;
 import com.qmth.themis.business.entity.TIeExamInvigilateCall;
 import com.qmth.themis.business.service.TIeExamInvigilateCallService;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.util.Map;
+
 /**
  * @Description: 监考监控通话申请 服务实现类
  * @Param:
@@ -16,4 +20,11 @@ import org.springframework.stereotype.Service;
 @Service
 public class TIeExamInvigilateCallServiceImpl extends ServiceImpl<TIeExamInvigilateCallMapper, TIeExamInvigilateCall> implements TIeExamInvigilateCallService {
 
+    @Resource
+    TIeExamInvigilateCallMapper tIeExamInvigilateCallMapper;
+
+    @Override
+    public IPage<TIeExamInvigilateCall> examInvigilateCallQuery(IPage<Map> iPage, Long examActivityId, String status) {
+        return tIeExamInvigilateCallMapper.examInvigilateCallQuery(iPage, examActivityId, status);
+    }
 }

+ 9 - 0
themis-business/src/main/resources/mapper/TBExamInvigilateUserMapper.xml

@@ -49,4 +49,13 @@
         t.roomCode,
         t.roomName
     </select>
+
+    <select id="examRoomQuery" resultType="com.qmth.themis.business.dto.response.RoomCodeQueryDto">
+        select
+            DISTINCT
+            tbeiu.room_code as roomCode,
+            tbeiu.room_name as roomName
+        from
+            t_b_exam_invigilate_user tbeiu
+    </select>
 </mapper>

+ 14 - 0
themis-business/src/main/resources/mapper/TIeExamInvigilateCallMapper.xml

@@ -2,4 +2,18 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.qmth.themis.business.dao.TIeExamInvigilateCallMapper">
 
+    <select id="examInvigilateCallQuery" resultType="com.qmth.themis.business.entity.TIeExamInvigilateCall">
+        select
+            tieic.*
+        from
+            t_ie_exam_invigilate_call tieic
+        <where>
+            <if test="examActivityId != null and examActivityId != ''">
+                and tieic.exam_activity_id = #{examActivityId}
+            </if>
+            <if test="status != null and status != ''">
+                and tieic.status = #{status}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 56 - 39
themis-exam/src/main/java/com/qmth/themis/exam/api/TIeInvigilateCallMobileController.java

@@ -1,18 +1,20 @@
 package com.qmth.themis.exam.api;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
+import com.qmth.themis.business.base.BasePage;
 import com.qmth.themis.business.cache.RedisKeyHelper;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.MqDto;
+import com.qmth.themis.business.dto.response.TEExamQueryDto;
+import com.qmth.themis.business.entity.TIeExamInvigilateCall;
 import com.qmth.themis.business.entity.TIeExamInvigilateCallLog;
-import com.qmth.themis.business.enums.MonitorStatusSourceEnum;
-import com.qmth.themis.business.enums.MonitorVideoSourceEnum;
-import com.qmth.themis.business.enums.MqTagEnum;
-import com.qmth.themis.business.enums.MqTopicEnum;
+import com.qmth.themis.business.enums.*;
 import com.qmth.themis.business.service.MqDtoService;
-import com.qmth.themis.business.service.TIeExamInvigilateCallLogService;
+import com.qmth.themis.business.service.TIeExamInvigilateCallService;
 import com.qmth.themis.business.util.RedisUtil;
 import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.exception.BusinessException;
@@ -21,6 +23,7 @@ import com.qmth.themis.common.util.ResultUtil;
 import io.swagger.annotations.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.dao.DuplicateKeyException;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
@@ -43,20 +46,20 @@ import java.util.Objects;
 public class TIeInvigilateCallMobileController {
     private final static Logger log = LoggerFactory.getLogger(TIeInvigilateCallOeController.class);
 
-    @Resource
-    TIeExamInvigilateCallLogService tIeExamInvigilateCallLogService;
-
     @Resource
     RedisUtil redisUtil;
 
     @Resource
     MqDtoService mqDtoService;
 
+    @Resource
+    TIeExamInvigilateCallService tIeExamInvigilateCallService;
+
     @ApiOperation(value = "监控观看地址更新接口")
     @RequestMapping(value = "/live_url", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
     @Transactional
-    public Result liveUrl(@ApiJsonObject(name = "liveUrlOe", value = {
+    public Result liveUrl(@ApiJsonObject(name = "liveUrlMobile", value = {
             @ApiJsonProperty(key = "recordId", type = "long", example = "1", description = "考试记录id", required = true),
             @ApiJsonProperty(key = "source", description = "监考视频源", required = true),
             @ApiJsonProperty(key = "liveUrl", description = "观看地址", required = true)
@@ -65,25 +68,39 @@ public class TIeInvigilateCallMobileController {
             throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
         }
         Long recordId = null;
-        recordId = Long.parseLong(String.valueOf(mapParameter.get("recordId")));
-        if (Objects.isNull(mapParameter.get("source")) || Objects.equals(mapParameter.get("source"), "")) {
-            throw new BusinessException("监考视频源不能为空");
-        }
-        MonitorVideoSourceEnum source = MonitorVideoSourceEnum.valueOf(String.valueOf(mapParameter.get("source")).toUpperCase());
-        if (Objects.isNull(mapParameter.get("liveUrl")) || Objects.equals(mapParameter.get("liveUrl"), "")) {
-            throw new BusinessException("观看地址不能为空");
+        try {
+            recordId = Long.parseLong(String.valueOf(mapParameter.get("recordId")));
+            if (Objects.isNull(mapParameter.get("source")) || Objects.equals(mapParameter.get("source"), "")) {
+                throw new BusinessException("监考视频源不能为空");
+            }
+            MonitorVideoSourceEnum source = MonitorVideoSourceEnum.valueOf(String.valueOf(mapParameter.get("source")).toUpperCase());
+            if (Objects.isNull(mapParameter.get("liveUrl")) || Objects.equals(mapParameter.get("liveUrl"), "")) {
+                throw new BusinessException("观看地址不能为空");
+            }
+            String liveUrl = String.valueOf(mapParameter.get("liveUrl"));
+            TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, source, liveUrl, MonitorStatusSourceEnum.INIT);
+            //获取考试记录缓存
+            Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(recordId));
+            objectMap.put(SystemConstant.MONITOR_LIVE_URL_ + source.name(), liveUrl);
+            objectMap.put(SystemConstant.MONITOR_STATUS_ + source.name(), tIeExamInvigilateCallLog.getStatus().name());
+            redisUtil.setForHash(RedisKeyHelper.examRecordCacheKey(recordId), objectMap);
+
+            //监考监控通话信息 发送mq start
+            MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.monitorLog.name(), tIeExamInvigilateCallLog, MqTagEnum.monitorLog, String.valueOf(tIeExamInvigilateCallLog.getId()), source.name());
+            mqDtoService.assembleSendOneWayMsg(mqDto);
+            //监考监控通话信息 发送mq end
+        } catch (Exception e) {
+            e.printStackTrace();
+            if (e instanceof DuplicateKeyException) {
+                String errorColumn = e.getCause().toString();
+                String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");
+                throw new BusinessException("考试记录id[" + recordId + "]下的" + FieldUniqueEnum.convertToCode(columnStr) + "数据不允许重复插入");
+            } else if (e instanceof BusinessException) {
+                throw new BusinessException(e.getMessage());
+            } else {
+                throw new RuntimeException(e);
+            }
         }
-        String liveUrl = String.valueOf(mapParameter.get("liveUrl"));
-        TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, source, liveUrl, MonitorStatusSourceEnum.INIT);
-        //获取考试记录缓存
-        Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(recordId));
-        objectMap.put(SystemConstant.MONITOR_LIVE_URL_ + source.name(), liveUrl);
-        objectMap.put(SystemConstant.MONITOR_STATUS_ + source.name(), tIeExamInvigilateCallLog.getStatus().name());
-        redisUtil.setForHash(RedisKeyHelper.examRecordCacheKey(recordId), objectMap);
-        //监考监控通话信息 发送mq start
-        MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.monitorLog.name(), tIeExamInvigilateCallLog, MqTagEnum.monitorLog, String.valueOf(tIeExamInvigilateCallLog.getId()), source.name());
-        mqDtoService.assembleSendOneWayMsg(mqDto);
-        //监考监控通话信息 发送mq end
         return ResultUtil.ok(SystemConstant.SUCCESS);
     }
 
@@ -91,7 +108,7 @@ public class TIeInvigilateCallMobileController {
     @RequestMapping(value = "/call/apply", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
     @Transactional
-    public Result callApply(@ApiJsonObject(name = "callApplyOe", value = {
+    public Result callApply(@ApiJsonObject(name = "callApplyMobile", value = {
             @ApiJsonProperty(key = "recordId", type = "long", example = "1", description = "考试记录id", required = true),
     }) @ApiParam(value = "监控信息", required = true) @RequestBody Map<String, Object> mapParameter) {
         if (Objects.isNull(mapParameter.get("recordId")) || Objects.equals(mapParameter.get("recordId"), "")) {
@@ -112,6 +129,7 @@ public class TIeInvigilateCallMobileController {
         objectMap.put(SystemConstant.MONITOR_STATUS_ + source, MonitorStatusSourceEnum.START.name());
         TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, source, liveUrl, MonitorStatusSourceEnum.START);
         redisUtil.setForHash(RedisKeyHelper.examRecordCacheKey(recordId), objectMap);
+
         //监考监控通话信息 发送mq start
         MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.monitorLog.name(), tIeExamInvigilateCallLog, MqTagEnum.monitorLog, String.valueOf(tIeExamInvigilateCallLog.getId()), source.name());
         mqDtoService.assembleSendOneWayMsg(mqDto);
@@ -123,7 +141,7 @@ public class TIeInvigilateCallMobileController {
     @RequestMapping(value = "/call/cancel", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
     @Transactional
-    public Result callCancel(@ApiJsonObject(name = "callCancelOe", value = {
+    public Result callCancel(@ApiJsonObject(name = "callCancelMobile", value = {
             @ApiJsonProperty(key = "recordId", type = "long", example = "1", description = "考试记录id", required = true),
     }) @ApiParam(value = "监控信息", required = true) @RequestBody Map<String, Object> mapParameter) {
         if (Objects.isNull(mapParameter.get("recordId")) || Objects.equals(mapParameter.get("recordId"), "")) {
@@ -153,23 +171,22 @@ public class TIeInvigilateCallMobileController {
 
     @ApiOperation(value = "监考监控通话查询接口")
     @RequestMapping(value = "/call/list", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = TIeExamInvigilateCallLog.class)})
-    public Result callList(@ApiParam(value = "场次id", required = true) @RequestParam Long examActivityId) {
-        QueryWrapper<TIeExamInvigilateCallLog> tIeExamInvigilateCallQueryWrapper = new QueryWrapper<>();
-        tIeExamInvigilateCallQueryWrapper.lambda().eq(TIeExamInvigilateCallLog::getSource, "apply");
-        List<TIeExamInvigilateCallLog> tIeExamInvigilateCallList = tIeExamInvigilateCallLogService.list(tIeExamInvigilateCallQueryWrapper);
+    @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = TIeExamInvigilateCall.class)})
+    public Result callList(@ApiParam(value = "场次id", required = true) @RequestParam Long examActivityId, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        IPage<TIeExamInvigilateCall> tIeExamInvigilateCallIPage = tIeExamInvigilateCallService.examInvigilateCallQuery(new Page<>(pageNumber, pageSize), examActivityId,MonitorStatusSourceEnum.START.name());
+        BasePage basePage = new BasePage(tIeExamInvigilateCallIPage.getRecords(), tIeExamInvigilateCallIPage.getCurrent(), tIeExamInvigilateCallIPage.getSize(), tIeExamInvigilateCallIPage.getTotal());
         Map map = new HashMap<>();
-        map.put(SystemConstant.RECORDS, tIeExamInvigilateCallList);
+        map.put(SystemConstant.RECORDS, basePage);
         return ResultUtil.ok(map);
     }
 
     @ApiOperation(value = "监考监控通话查询来源接口")
     @RequestMapping(value = "/call/query", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = TIeExamInvigilateCallLog.class)})
+    @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = TIeExamInvigilateCall.class)})
     public Result callQuery(@ApiParam(value = "考试记录id", required = true) @RequestParam(required = true) Long recordId) {
-        QueryWrapper<TIeExamInvigilateCallLog> tIeExamInvigilateCallQueryWrapper = new QueryWrapper<>();
-        tIeExamInvigilateCallQueryWrapper.lambda().eq(TIeExamInvigilateCallLog::getExamRecordId, recordId);
-        List<TIeExamInvigilateCallLog> tIeExamInvigilateCallList = tIeExamInvigilateCallLogService.list(tIeExamInvigilateCallQueryWrapper);
+        QueryWrapper<TIeExamInvigilateCall> tIeExamInvigilateCallQueryWrapper = new QueryWrapper<>();
+        tIeExamInvigilateCallQueryWrapper.lambda().eq(TIeExamInvigilateCall::getExamRecordId, recordId);
+        List<TIeExamInvigilateCall> tIeExamInvigilateCallList = tIeExamInvigilateCallService.list(tIeExamInvigilateCallQueryWrapper);
         Map map = new HashMap<>();
         map.put(SystemConstant.RECORDS, tIeExamInvigilateCallList);
         return ResultUtil.ok(map);

+ 66 - 50
themis-exam/src/main/java/com/qmth/themis/exam/api/TIeInvigilateCallOeController.java

@@ -1,18 +1,19 @@
 package com.qmth.themis.exam.api;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
+import com.qmth.themis.business.base.BasePage;
 import com.qmth.themis.business.cache.RedisKeyHelper;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.MqDto;
+import com.qmth.themis.business.entity.TIeExamInvigilateCall;
 import com.qmth.themis.business.entity.TIeExamInvigilateCallLog;
-import com.qmth.themis.business.enums.MonitorStatusSourceEnum;
-import com.qmth.themis.business.enums.MonitorVideoSourceEnum;
-import com.qmth.themis.business.enums.MqTagEnum;
-import com.qmth.themis.business.enums.MqTopicEnum;
+import com.qmth.themis.business.enums.*;
 import com.qmth.themis.business.service.MqDtoService;
-import com.qmth.themis.business.service.TIeExamInvigilateCallLogService;
+import com.qmth.themis.business.service.TIeExamInvigilateCallService;
 import com.qmth.themis.business.util.RedisUtil;
 import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.exception.BusinessException;
@@ -21,6 +22,7 @@ import com.qmth.themis.common.util.ResultUtil;
 import io.swagger.annotations.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.dao.DuplicateKeyException;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
@@ -31,27 +33,27 @@ import java.util.Map;
 import java.util.Objects;
 
 /**
- * @Description: oe监考监控通话信息 前端控制器
+ * @Description: mobile监考监控通话信息 前端控制器
  * @Param:
  * @return:
  * @Author: wangliang
  * @Date: 2020/6/25
  */
-@Api(tags = "oe监考监控通话信息Controller")
+@Api(tags = "mobile监考监控通话信息Controller")
 @RestController
 @RequestMapping("/${prefix.url.exam}/monitor")
 public class TIeInvigilateCallOeController {
     private final static Logger log = LoggerFactory.getLogger(TIeInvigilateCallOeController.class);
 
-    @Resource
-    TIeExamInvigilateCallLogService tIeExamInvigilateCallLogService;
-
     @Resource
     RedisUtil redisUtil;
 
     @Resource
     MqDtoService mqDtoService;
 
+    @Resource
+    TIeExamInvigilateCallService tIeExamInvigilateCallService;
+
     @ApiOperation(value = "监控观看地址更新接口")
     @RequestMapping(value = "/live_url", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
@@ -65,25 +67,39 @@ public class TIeInvigilateCallOeController {
             throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
         }
         Long recordId = null;
-        recordId = Long.parseLong(String.valueOf(mapParameter.get("recordId")));
-        if (Objects.isNull(mapParameter.get("source")) || Objects.equals(mapParameter.get("source"), "")) {
-            throw new BusinessException("监考视频源不能为空");
-        }
-        MonitorVideoSourceEnum source = MonitorVideoSourceEnum.valueOf(String.valueOf(mapParameter.get("source")).toUpperCase());
-        if (Objects.isNull(mapParameter.get("liveUrl")) || Objects.equals(mapParameter.get("liveUrl"), "")) {
-            throw new BusinessException("观看地址不能为空");
+        try {
+            recordId = Long.parseLong(String.valueOf(mapParameter.get("recordId")));
+            if (Objects.isNull(mapParameter.get("source")) || Objects.equals(mapParameter.get("source"), "")) {
+                throw new BusinessException("监考视频源不能为空");
+            }
+            MonitorVideoSourceEnum source = MonitorVideoSourceEnum.valueOf(String.valueOf(mapParameter.get("source")).toUpperCase());
+            if (Objects.isNull(mapParameter.get("liveUrl")) || Objects.equals(mapParameter.get("liveUrl"), "")) {
+                throw new BusinessException("观看地址不能为空");
+            }
+            String liveUrl = String.valueOf(mapParameter.get("liveUrl"));
+            TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, source, liveUrl, MonitorStatusSourceEnum.INIT);
+            //获取考试记录缓存
+            Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(recordId));
+            objectMap.put(SystemConstant.MONITOR_LIVE_URL_ + source.name(), liveUrl);
+            objectMap.put(SystemConstant.MONITOR_STATUS_ + source.name(), tIeExamInvigilateCallLog.getStatus().name());
+            redisUtil.setForHash(RedisKeyHelper.examRecordCacheKey(recordId), objectMap);
+
+            //监考监控通话信息 发送mq start
+            MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.monitorLog.name(), tIeExamInvigilateCallLog, MqTagEnum.monitorLog, String.valueOf(tIeExamInvigilateCallLog.getId()), source.name());
+            mqDtoService.assembleSendOneWayMsg(mqDto);
+            //监考监控通话信息 发送mq end
+        } catch (Exception e) {
+            e.printStackTrace();
+            if (e instanceof DuplicateKeyException) {
+                String errorColumn = e.getCause().toString();
+                String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");
+                throw new BusinessException("考试记录id[" + recordId + "]下的" + FieldUniqueEnum.convertToCode(columnStr) + "数据不允许重复插入");
+            } else if (e instanceof BusinessException) {
+                throw new BusinessException(e.getMessage());
+            } else {
+                throw new RuntimeException(e);
+            }
         }
-        String liveUrl = String.valueOf(mapParameter.get("liveUrl"));
-        TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, source, liveUrl, MonitorStatusSourceEnum.INIT);
-        //获取考试记录缓存
-        Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(recordId));
-        objectMap.put(SystemConstant.MONITOR_LIVE_URL_ + source.name(), liveUrl);
-        objectMap.put(SystemConstant.MONITOR_STATUS_ + source.name(), tIeExamInvigilateCallLog.getStatus().name());
-        redisUtil.setForHash(RedisKeyHelper.examRecordCacheKey(recordId), objectMap);
-        //监考监控通话信息 发送mq start
-        MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.monitorLog.name(), tIeExamInvigilateCallLog, MqTagEnum.monitorLog, String.valueOf(tIeExamInvigilateCallLog.getId()), source.name());
-        mqDtoService.assembleSendOneWayMsg(mqDto);
-        //监考监控通话信息 发送mq end
         return ResultUtil.ok(SystemConstant.SUCCESS);
     }
 
@@ -102,16 +118,17 @@ public class TIeInvigilateCallOeController {
         Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(recordId));
         String liveUrl = null;
         MonitorVideoSourceEnum source = null;
-        if (Objects.nonNull(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.MOBILE_FIRST.name()))) {
-            source = MonitorVideoSourceEnum.MOBILE_FIRST;
-            liveUrl = String.valueOf(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.MOBILE_FIRST.name()));
-        } else if (Objects.nonNull(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.MOBILE_SECOND.name()))) {
-            source = MonitorVideoSourceEnum.MOBILE_SECOND;
-            liveUrl = String.valueOf(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.MOBILE_SECOND.name()));
+        if (Objects.nonNull(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.CLIENT_SCREEN.name()))) {
+            source = MonitorVideoSourceEnum.CLIENT_SCREEN;
+            liveUrl = String.valueOf(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.CLIENT_SCREEN.name()));
+        } else if (Objects.nonNull(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.CLIENT_CAMERA.name()))) {
+            source = MonitorVideoSourceEnum.CLIENT_CAMERA;
+            liveUrl = String.valueOf(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.CLIENT_CAMERA.name()));
         }
         objectMap.put(SystemConstant.MONITOR_STATUS_ + source, MonitorStatusSourceEnum.START.name());
         TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, source, liveUrl, MonitorStatusSourceEnum.START);
         redisUtil.setForHash(RedisKeyHelper.examRecordCacheKey(recordId), objectMap);
+
         //监考监控通话信息 发送mq start
         MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.monitorLog.name(), tIeExamInvigilateCallLog, MqTagEnum.monitorLog, String.valueOf(tIeExamInvigilateCallLog.getId()), source.name());
         mqDtoService.assembleSendOneWayMsg(mqDto);
@@ -134,12 +151,12 @@ public class TIeInvigilateCallOeController {
         Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(recordId));
         String liveUrl = null;
         MonitorVideoSourceEnum source = null;
-        if (Objects.nonNull(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.MOBILE_FIRST.name()))) {
-            source = MonitorVideoSourceEnum.MOBILE_FIRST;
-            liveUrl = String.valueOf(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.MOBILE_FIRST.name()));
-        } else if (Objects.nonNull(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.MOBILE_SECOND.name()))) {
-            source = MonitorVideoSourceEnum.MOBILE_SECOND;
-            liveUrl = String.valueOf(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.MOBILE_SECOND.name()));
+        if (Objects.nonNull(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.CLIENT_SCREEN.name()))) {
+            source = MonitorVideoSourceEnum.CLIENT_SCREEN;
+            liveUrl = String.valueOf(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.CLIENT_SCREEN.name()));
+        } else if (Objects.nonNull(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.CLIENT_CAMERA.name()))) {
+            source = MonitorVideoSourceEnum.CLIENT_CAMERA;
+            liveUrl = String.valueOf(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.CLIENT_CAMERA.name()));
         }
         objectMap.put(SystemConstant.MONITOR_STATUS_ + source, MonitorStatusSourceEnum.STOP.name());
         TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, source, liveUrl, MonitorStatusSourceEnum.STOP);
@@ -153,23 +170,22 @@ public class TIeInvigilateCallOeController {
 
     @ApiOperation(value = "监考监控通话查询接口")
     @RequestMapping(value = "/call/list", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = TIeExamInvigilateCallLog.class)})
-    public Result callList(@ApiParam(value = "场次id", required = true) @RequestParam Long examActivityId) {
-        QueryWrapper<TIeExamInvigilateCallLog> tIeExamInvigilateCallQueryWrapper = new QueryWrapper<>();
-        tIeExamInvigilateCallQueryWrapper.lambda().eq(TIeExamInvigilateCallLog::getSource, "apply");
-        List<TIeExamInvigilateCallLog> tIeExamInvigilateCallList = tIeExamInvigilateCallLogService.list(tIeExamInvigilateCallQueryWrapper);
+    @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = TIeExamInvigilateCall.class)})
+    public Result callList(@ApiParam(value = "场次id", required = true) @RequestParam Long examActivityId, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        IPage<TIeExamInvigilateCall> tIeExamInvigilateCallIPage = tIeExamInvigilateCallService.examInvigilateCallQuery(new Page<>(pageNumber, pageSize), examActivityId, MonitorStatusSourceEnum.START.name());
+        BasePage basePage = new BasePage(tIeExamInvigilateCallIPage.getRecords(), tIeExamInvigilateCallIPage.getCurrent(), tIeExamInvigilateCallIPage.getSize(), tIeExamInvigilateCallIPage.getTotal());
         Map map = new HashMap<>();
-        map.put(SystemConstant.RECORDS, tIeExamInvigilateCallList);
+        map.put(SystemConstant.RECORDS, basePage);
         return ResultUtil.ok(map);
     }
 
     @ApiOperation(value = "监考监控通话查询来源接口")
     @RequestMapping(value = "/call/query", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = TIeExamInvigilateCallLog.class)})
+    @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = TIeExamInvigilateCall.class)})
     public Result callQuery(@ApiParam(value = "考试记录id", required = true) @RequestParam(required = true) Long recordId) {
-        QueryWrapper<TIeExamInvigilateCallLog> tIeExamInvigilateCallQueryWrapper = new QueryWrapper<>();
-        tIeExamInvigilateCallQueryWrapper.lambda().eq(TIeExamInvigilateCallLog::getExamRecordId, recordId);
-        List<TIeExamInvigilateCallLog> tIeExamInvigilateCallList = tIeExamInvigilateCallLogService.list(tIeExamInvigilateCallQueryWrapper);
+        QueryWrapper<TIeExamInvigilateCall> tIeExamInvigilateCallQueryWrapper = new QueryWrapper<>();
+        tIeExamInvigilateCallQueryWrapper.lambda().eq(TIeExamInvigilateCall::getExamRecordId, recordId);
+        List<TIeExamInvigilateCall> tIeExamInvigilateCallList = tIeExamInvigilateCallService.list(tIeExamInvigilateCallQueryWrapper);
         Map map = new HashMap<>();
         map.put(SystemConstant.RECORDS, tIeExamInvigilateCallList);
         return ResultUtil.ok(map);

+ 1 - 1
themis-exam/src/main/resources/application.properties

@@ -149,5 +149,5 @@ prefix.url.mobile=api/mobile
 wxapp.upload.url=http://wxapp2.qmth.com.cn
 
 #\u65E0\u9700\u9274\u6743\u7684url
-no.auth.urls=/webjars/**,/druid/**,/swagger-ui.html,/doc.html,/swagger-resources/**,/v2/api-docs,/webjars/springfox-swagger-ui/**,/api/oe/student/login,/api/oe/sys/env,/file/**,/upload/**,/client/**,/base_photo/**,/frontend/**,/api/oe/exam/short_code,/api/oe/monitor/live_url,/api/oe/monitor/call/apply,/api/oe/monitor/call/cancel,/api/oe/monitor/call/list,/api/oe/monitor/call/query,/api/mobile/authorization
+no.auth.urls=/webjars/**,/druid/**,/swagger-ui.html,/doc.html,/swagger-resources/**,/v2/api-docs,/webjars/springfox-swagger-ui/**,/api/oe/student/login,/api/oe/sys/env,/file/**,/upload/**,/client/**,/base_photo/**,/frontend/**,/api/oe/exam/short_code,/api/oe/monitor/live_url,/api/oe/monitor/call/apply,/api/oe/monitor/call/cancel,/api/oe/monitor/call/list,/api/oe/monitor/call/query,/api/mobile/monitor/live_url,/api/mobile/monitor/call/apply,/api/mobile/monitor/call/cancel,/api/mobile/monitor/call/list,/api/mobile/monitor/call/query,/api/mobile/authorization
 common.system.urls=/api/oe/student/logout,/api/oe/exam/file/upload,/api/oe/qrcode/mobile_monitor,/api/oe/qrcode/photo_upload,/api/oe/qrcode/audio_upload

+ 33 - 5
themis-mq/src/main/java/com/qmth/themis/mq/service/impl/MqLogicServiceImpl.java

@@ -7,10 +7,7 @@ import com.qmth.themis.business.cache.RedisKeyHelper;
 import com.qmth.themis.business.constant.SpringContextHolder;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.MqDto;
-import com.qmth.themis.business.entity.TBSession;
-import com.qmth.themis.business.entity.TIeExamInvigilateCallLog;
-import com.qmth.themis.business.entity.TMRocketMessage;
-import com.qmth.themis.business.entity.TOeExamBreakHistory;
+import com.qmth.themis.business.entity.*;
 import com.qmth.themis.business.enums.BreakReasonEnum;
 import com.qmth.themis.business.enums.ExamRecordStatusEnum;
 import com.qmth.themis.business.enums.MqTagEnum;
@@ -25,6 +22,7 @@ import com.qmth.themis.business.templete.impl.TaskRoomCodeImportTemplete;
 import com.qmth.themis.business.threadPool.MyThreadPool;
 import com.qmth.themis.business.util.JacksonUtil;
 import com.qmth.themis.business.util.RedisUtil;
+import com.qmth.themis.common.contanst.Constants;
 import com.qmth.themis.common.util.SimpleBeanUtil;
 import com.qmth.themis.mq.service.MqLogicService;
 import org.springframework.stereotype.Service;
@@ -80,6 +78,9 @@ public class MqLogicServiceImpl implements MqLogicService {
     @Resource
     TIeExamInvigilateCallLogService tIeExamInvigilateCallLogService;
 
+    @Resource
+    TIeExamInvigilateCallService tIeExamInvigilateCallService;
+
     /**
      * mq最大重试次数逻辑
      *
@@ -395,7 +396,34 @@ public class MqLogicServiceImpl implements MqLogicService {
         Gson gson = new Gson();
         String tag = mqDto.getTag();
         if (tag.contains(MqTagEnum.monitorLog.name())) {
-            tIeExamInvigilateCallLogService.saveOrUpdate(JacksonUtil.readJson(JacksonUtil.parseJson(mqDto.getBody()), TIeExamInvigilateCallLog.class));
+            TIeExamInvigilateCallLog tIeExamInvigilateCallLog = JacksonUtil.readJson(JacksonUtil.parseJson(mqDto.getBody()), TIeExamInvigilateCallLog.class);
+            Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(tIeExamInvigilateCallLog.getExamRecordId()));
+            Long examId = null, examActivityId = null, examStudentId = null;
+            if (Objects.nonNull(objectMap.get("examActivityId"))) {
+                examActivityId = Long.parseLong(String.valueOf(objectMap.get("examActivityId")));
+                examId = Long.parseLong(String.valueOf(objectMap.get("examId")));
+                examStudentId = Long.parseLong(String.valueOf(objectMap.get("examStudentId")));
+            } else {
+                TOeExamRecord tOeExamRecord = examRecordService.getById(tIeExamInvigilateCallLog.getExamRecordId());
+                examActivityId = tOeExamRecord.getExamActivityId();
+                examId = tOeExamRecord.getExamId();
+                examStudentId = tOeExamRecord.getExamStudentId();
+            }
+            tIeExamInvigilateCallLog.setExamId(examId);
+            tIeExamInvigilateCallLog.setExamActivityId(examActivityId);
+            tIeExamInvigilateCallLog.setExamStudentId(examStudentId);
+            QueryWrapper<TIeExamInvigilateCall> tIeExamInvigilateCallQueryWrapper = new QueryWrapper<>();
+            tIeExamInvigilateCallQueryWrapper.lambda().eq(TIeExamInvigilateCall::getExamRecordId, tIeExamInvigilateCallLog.getExamRecordId()).eq(TIeExamInvigilateCall::getSource, tIeExamInvigilateCallLog.getSource());
+            TIeExamInvigilateCall tIeExamInvigilateCall = tIeExamInvigilateCallService.getOne(tIeExamInvigilateCallQueryWrapper);
+            if (Objects.isNull(tIeExamInvigilateCall)) {
+                tIeExamInvigilateCall = gson.fromJson(gson.toJson(tIeExamInvigilateCallLog), TIeExamInvigilateCall.class);
+                tIeExamInvigilateCall.setId(Constants.idGen.next());
+            } else {
+                tIeExamInvigilateCall.setLiveUrl(tIeExamInvigilateCallLog.getLiveUrl());
+                tIeExamInvigilateCall.setStatus(tIeExamInvigilateCallLog.getStatus());
+            }
+            tIeExamInvigilateCallService.saveOrUpdate(tIeExamInvigilateCall);
+            tIeExamInvigilateCallLogService.saveOrUpdate(tIeExamInvigilateCallLog);
         }
         mqDto.setAck(SystemConstant.STANDARD_ACK_TYPE);
         TMRocketMessage tmRocketMessage = gson.fromJson(gson.toJson(mqDto), TMRocketMessage.class);