Răsfoiți Sursa

监考老师操作不存ip

wangliang 1 an în urmă
părinte
comite
bde1a299ba

+ 1 - 2
themis-business/src/main/java/com/qmth/themis/business/bean/admin/ExamStudentLogDetailListBean.java

@@ -5,7 +5,6 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
-import org.springframework.util.CollectionUtils;
 
 import java.util.Objects;
 
@@ -61,7 +60,7 @@ public class ExamStudentLogDetailListBean {
             if (Objects.isNull(currentIp) || Objects.equals(currentIp.trim(), "")) {
                 currentIp = ip;
                 continue;
-            } else if (Objects.nonNull(currentIp) && !Objects.equals(currentIp.trim(), "") && !Objects.equals(currentIp, ip)) {
+            } else if (Objects.nonNull(currentIp) && Objects.nonNull(ip) && !Objects.equals(currentIp.trim(), "") && !Objects.equals(currentIp, ip)) {
                 examStudentLogDetailListBeanIPage.getRecords().get(i).setIpChange(true);
                 currentIp = ip;
             }

+ 3 - 30
themis-exam/src/main/java/com/qmth/themis/exam/listener/service/impl/MqOeLogicServiceImpl.java

@@ -91,16 +91,7 @@ public class MqOeLogicServiceImpl implements MqOeLogicService {
                 map.put(SystemConstant.RECORD_ID, recordId);
                 map.put(SystemConstant.MESSAGE, FinishTypeEnum.valueOf(String.valueOf(mqDto.getProperties().get(SystemConstant.TYPE))).getCode());
 
-                String ip = ExamRecordCacheUtil.getClientCurrentIp(recordId), country = null, region = null, province = null, city = null, isp = null;
-                String[] strs = SystemConstant.getIpInfo(ip);
-                if (Objects.nonNull(strs) && strs.length > 0) {
-                    country = strs[0];
-                    region = strs[1];
-                    province = strs[2];
-                    city = strs[3];
-                    isp = strs[4];
-                }
-                TEExamStudentLog teExamStudentLog = new TEExamStudentLog(mqDto.getType().name(), "监考老师[" + mqDto.getObjName() + "]强制离线(交卷)", mqDto.getType().getCode(), examStudentCacheBean.getStudentId(), examStudentId, recordId, mqDto.getType().getCode(), ip, country, region, province, city, isp);
+                TEExamStudentLog teExamStudentLog = new TEExamStudentLog(mqDto.getType().name(), "监考老师[" + mqDto.getObjName() + "]强制离线(交卷)", mqDto.getType().getCode(), examStudentCacheBean.getStudentId(), examStudentId, recordId, mqDto.getType().getCode(), null, null, null, null, null, null);
                 teExamStudentLogService.save(teExamStudentLog);
 
                 tmRocketMessageService.saveMqMessageSuccess(mqDto, key);
@@ -142,16 +133,7 @@ public class MqOeLogicServiceImpl implements MqOeLogicService {
                 map.put(SystemConstant.RECORD_ID, recordId);
                 map.put(SystemConstant.BREACH_STATUS, FinishTypeEnum.valueOf(String.valueOf(mqDto.getProperties().get(SystemConstant.TYPE))).getCode());
 
-                String ip = ExamRecordCacheUtil.getClientCurrentIp(recordId), country = null, region = null, province = null, city = null, isp = null;
-                String[] strs = SystemConstant.getIpInfo(ip);
-                if (Objects.nonNull(strs) && strs.length > 0) {
-                    country = strs[0];
-                    region = strs[1];
-                    province = strs[2];
-                    city = strs[3];
-                    isp = strs[4];
-                }
-                TEExamStudentLog teExamStudentLog = new TEExamStudentLog(mqDto.getType().name(), mqDto.getType().getCode(), mqDto.getType().getCode(), examStudentCacheBean.getStudentId(), examStudentId, recordId, mqDto.getType().getCode(), ip, country, region, province, city, isp);
+                TEExamStudentLog teExamStudentLog = new TEExamStudentLog(mqDto.getType().name(), mqDto.getType().getCode(), mqDto.getType().getCode(), examStudentCacheBean.getStudentId(), examStudentId, recordId, mqDto.getType().getCode(), null, null, null, null, null, null);
                 teExamStudentLogService.save(teExamStudentLog);
 
                 tmRocketMessageService.saveMqMessageSuccess(mqDto, key);
@@ -233,16 +215,7 @@ public class MqOeLogicServiceImpl implements MqOeLogicService {
                 map.put(SystemConstant.RECORD_ID, recordId);
                 map.put(SystemConstant.WEB_SOCKET_OE_SERVER, webSocketOeServer);
 
-                String ip = ExamRecordCacheUtil.getClientCurrentIp(recordId), country = null, region = null, province = null, city = null, isp = null;
-                String[] strs = SystemConstant.getIpInfo(ip);
-                if (Objects.nonNull(strs) && strs.length > 0) {
-                    country = strs[0];
-                    region = strs[1];
-                    province = strs[2];
-                    city = strs[3];
-                    isp = strs[4];
-                }
-                TEExamStudentLog teExamStudentLog = new TEExamStudentLog(mqDto.getType().name(), mqDto.getType().getCode(), mqDto.getType().getCode(), examStudentCacheBean.getStudentId(), examStudentId, recordId, mqDto.getType().getCode(), ip, country, region, province, city, isp);
+                TEExamStudentLog teExamStudentLog = new TEExamStudentLog(mqDto.getType().name(), mqDto.getType().getCode(), mqDto.getType().getCode(), examStudentCacheBean.getStudentId(), examStudentId, recordId, mqDto.getType().getCode(), null, null, null, null, null, null);
                 teExamStudentLogService.save(teExamStudentLog);
 
                 tmRocketMessageService.saveMqMessageSuccess(mqDto, key);

+ 0 - 9
themis-mq/src/main/java/com/qmth/themis/mq/service/impl/MqLogicServiceImpl.java

@@ -165,15 +165,6 @@ public class MqLogicServiceImpl implements MqLogicService {
             String ip = null, country = null, region = null, province = null, city = null, isp = null;
             if (Objects.nonNull(mqDto.getProperties())) {
                 Long recordId = Long.parseLong(String.valueOf(mqDto.getProperties().get(SystemConstant.EXAM_RECORD_ID)));
-                ip = Objects.nonNull(recordId) ? ExamRecordCacheUtil.getClientCurrentIp(recordId) : mqDto.getObjName();
-                String[] strs = SystemConstant.getIpInfo(ip);
-                if (Objects.nonNull(strs) && strs.length > 0) {
-                    country = strs[0];
-                    region = strs[1];
-                    province = strs[2];
-                    city = strs[3];
-                    isp = strs[4];
-                }
                 String type = Objects.nonNull(mqDto.getProperties().get(SystemConstant.TYPE)) ?
                         String.valueOf(mqDto.getProperties().get(SystemConstant.TYPE)) :
                         SystemOperationEnum.valueOf(String.valueOf(mqDto.getBody())).getCode();