|
@@ -1,5 +1,16 @@
|
|
package com.qmth.themis.mq.service.impl;
|
|
package com.qmth.themis.mq.service.impl;
|
|
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.Objects;
|
|
|
|
+
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
import com.qmth.themis.business.cache.ExamRecordCacheUtil;
|
|
import com.qmth.themis.business.cache.ExamRecordCacheUtil;
|
|
import com.qmth.themis.business.constant.SpringContextHolder;
|
|
import com.qmth.themis.business.constant.SpringContextHolder;
|
|
@@ -8,8 +19,19 @@ import com.qmth.themis.business.entity.TBSession;
|
|
import com.qmth.themis.business.entity.TMRocketMessage;
|
|
import com.qmth.themis.business.entity.TMRocketMessage;
|
|
import com.qmth.themis.business.entity.TOeExamBreakHistory;
|
|
import com.qmth.themis.business.entity.TOeExamBreakHistory;
|
|
import com.qmth.themis.business.entity.TOeExamRecord;
|
|
import com.qmth.themis.business.entity.TOeExamRecord;
|
|
-import com.qmth.themis.business.enums.*;
|
|
|
|
-import com.qmth.themis.business.service.*;
|
|
|
|
|
|
+import com.qmth.themis.business.enums.BreakReasonEnum;
|
|
|
|
+import com.qmth.themis.business.enums.ExamRecordStatusEnum;
|
|
|
|
+import com.qmth.themis.business.enums.MqEnum;
|
|
|
|
+import com.qmth.themis.business.enums.SystemOperationEnum;
|
|
|
|
+import com.qmth.themis.business.enums.WebsocketStatusEnum;
|
|
|
|
+import com.qmth.themis.business.service.TBSessionService;
|
|
|
|
+import com.qmth.themis.business.service.TEExamStudentLogService;
|
|
|
|
+import com.qmth.themis.business.service.TEUserLogService;
|
|
|
|
+import com.qmth.themis.business.service.TMRocketMessageService;
|
|
|
|
+import com.qmth.themis.business.service.TOeExamBreakHistoryService;
|
|
|
|
+import com.qmth.themis.business.service.TOeExamRecordService;
|
|
|
|
+import com.qmth.themis.business.service.TOeFaceVerifyHistoryService;
|
|
|
|
+import com.qmth.themis.business.service.TOeLivenessVerifyHistoryService;
|
|
import com.qmth.themis.business.templete.TaskExportTemplete;
|
|
import com.qmth.themis.business.templete.TaskExportTemplete;
|
|
import com.qmth.themis.business.templete.TaskImportTemplete;
|
|
import com.qmth.themis.business.templete.TaskImportTemplete;
|
|
import com.qmth.themis.business.templete.impl.TaskExamPaperImportTemplete;
|
|
import com.qmth.themis.business.templete.impl.TaskExamPaperImportTemplete;
|
|
@@ -21,15 +43,6 @@ import com.qmth.themis.business.util.JacksonUtil;
|
|
import com.qmth.themis.business.util.RedisUtil;
|
|
import com.qmth.themis.business.util.RedisUtil;
|
|
import com.qmth.themis.mq.dto.MqDto;
|
|
import com.qmth.themis.mq.dto.MqDto;
|
|
import com.qmth.themis.mq.service.MqLogicService;
|
|
import com.qmth.themis.mq.service.MqLogicService;
|
|
-import org.springframework.stereotype.Service;
|
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
-
|
|
|
|
-import javax.annotation.Resource;
|
|
|
|
-import java.io.IOException;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.Map;
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description: mq执行逻辑 impl
|
|
* @Description: mq执行逻辑 impl
|
|
@@ -70,6 +83,11 @@ public class MqLogicServiceImpl implements MqLogicService {
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
TOeFaceVerifyHistoryService faceVerifyHistoryService;
|
|
TOeFaceVerifyHistoryService faceVerifyHistoryService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ TOeLivenessVerifyHistoryService livenessVerifyHistoryService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* mq最大重试次数逻辑
|
|
* mq最大重试次数逻辑
|
|
@@ -273,4 +291,24 @@ public class MqLogicServiceImpl implements MqLogicService {
|
|
tmRocketMessageService.saveOrUpdate(tmRocketMessage);
|
|
tmRocketMessageService.saveOrUpdate(tmRocketMessage);
|
|
redisUtil.delete(key, mqDto.getId());
|
|
redisUtil.delete(key, mqDto.getId());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void execMqLivenessVerifySaveLogic(MqDto mqDto, String key) {
|
|
|
|
+ Gson gson = new Gson();
|
|
|
|
+ Map<String, Object> param = (Map<String, Object>) mqDto.getBody();
|
|
|
|
+ Long id = (Long) param.get("id");
|
|
|
|
+ Long recordId = (Long) param.get("recordId");
|
|
|
|
+ String type = (String) param.get("type");
|
|
|
|
+ String actions = (String) param.get("actions");
|
|
|
|
+ Integer retry = (Integer) param.get("retry");
|
|
|
|
+ Long startTime = (Long) param.get("startTime");
|
|
|
|
+ Long finishTime = (Long) param.get("finishTime");
|
|
|
|
+ Boolean pass = (Boolean) param.get("pass");
|
|
|
|
+ livenessVerifyHistoryService.save(id, recordId, type, actions, retry, startTime, finishTime, pass);
|
|
|
|
+ mqDto.setAck(SystemConstant.STANDARD_ACK_TYPE);
|
|
|
|
+ TMRocketMessage tmRocketMessage = gson.fromJson(gson.toJson(mqDto), TMRocketMessage.class);
|
|
|
|
+ tmRocketMessage.setBody(JacksonUtil.parseJson(tmRocketMessage.getBody()));
|
|
|
|
+ tmRocketMessageService.saveOrUpdate(tmRocketMessage);
|
|
|
|
+ redisUtil.delete(key, mqDto.getId());
|
|
|
|
+ }
|
|
}
|
|
}
|