Browse Source

回调不显示ip

wangliang 2 years ago
parent
commit
c8412dcb3e

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

@@ -120,7 +120,7 @@ public class TENotifyController {
                             if (Objects.nonNull(jsonArray) && jsonArray.size() > 0 && count != jsonArray.size()) {
                                 if (Objects.nonNull(ExamRecordCacheUtil.getTencentVideoUrl(recordId)) && Objects.equals(tencentVideoUrl, ExamRecordCacheUtil.getTencentVideoUrl(recordId))) {
                                     ExamRecordCacheUtil.setTencentVideoUrl(recordId, jsonArray.toJSONString());
-                                    tOeExamRecordService.sendExamRecordDataSaveMq(recordId, System.currentTimeMillis());
+                                    tOeExamRecordService.sendExamRecordDataSaveMqNotIp(recordId, System.currentTimeMillis());
                                 }
                             }
                         } else {
@@ -374,7 +374,7 @@ public class TENotifyController {
         String monitorKey = ExamRecordCacheUtil.getMonitorKey(recordId);
         TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, MonitorVideoSourceEnum.valueOf(source), liveUrl, MonitorStatusSourceEnum.START, monitorKey, callStatus);
 
-        tOeExamRecordService.sendExamRecordDataSaveMq(recordId, eventTime);
+        tOeExamRecordService.sendExamRecordDataSaveMqNotIp(recordId, eventTime);
 
         //监考监控通话信息 发送mq start
         MqDto mqDto = new MqDto(mqUtil.getMqGroupDomain().getTopic(), MqTagEnum.MONITOR_LOG.name(), tIeExamInvigilateCallLog, MqTagEnum.MONITOR_LOG, String.valueOf(tIeExamInvigilateCallLog.getId()), MonitorVideoSourceEnum.valueOf(source).name());

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

@@ -60,6 +60,14 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      */
     void sendExamRecordDataSaveMq(Long recordId, Long timestamp);
 
+    /**
+     * 发送mq更新考试记录
+     *
+     * @param recordId
+     * @param timestamp
+     */
+    void sendExamRecordDataSaveMqNotIp(Long recordId, Long timestamp);
+
     /**
      * 查询实时监控台视频列表
      *

+ 13 - 1
themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java

@@ -619,7 +619,6 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
                 String ip = IpUtil.getRemoteIp(ServletUtil.getRequest());
                 if (Objects.nonNull(ip)) {
                     ExamRecordCacheUtil.setClientCurrentIp(recordId, ip);
-//                    ExamRecordCacheUtil.setClientCurrentIp(recordId, "171.43.210.22");
                 }
             }
         } catch (Exception e) {
@@ -631,6 +630,19 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
         }
     }
 
+    /**
+     * 发送mq更新考试记录
+     *
+     * @param recordId
+     * @param timestamp
+     */
+    @Override
+    public void sendExamRecordDataSaveMqNotIp(Long recordId, Long timestamp) {
+        ExamRecordCacheUtil.setUpdateTime(recordId, timestamp);
+        MqDto mqDto = new MqDto(mqUtil.getMqGroupDomain().getTopic(), MqTagEnum.EXAM_RECORD_UPDATE.name(), recordId.toString(), timestamp);
+        mqDtoService.assembleSendOneWayMsg(mqDto);
+    }
+
     /**
      * 查询实时监控台视频列表
      *