Ver código fonte

学生视频监考回放查询接口新增ip

wangliang 2 anos atrás
pai
commit
a890a64a6c

+ 14 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEStudentServiceImpl.java

@@ -30,6 +30,7 @@ import com.qmth.themis.common.util.HexUtils;
 import org.apache.commons.io.FilenameUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
@@ -206,6 +207,19 @@ public class TEStudentServiceImpl extends ServiceImpl<TEStudentMapper, TEStudent
             teExamStudentLogQueryWrapper.lambda().eq(TEExamStudentLog::getExamStudentId, examStudentCacheBean.getId())
                     .eq(TEExamStudentLog::getExamRecordId, examRecordId)
                     .orderByAsc(TEExamStudentLog::getCreateTime);
+            if (!CollectionUtils.isEmpty(teExamStudentLogList)) {
+                String currentIp = teExamStudentLogList.get(0).getIp();
+                for (int i = 1; i < teExamStudentLogList.size(); i++) {
+                    String ip = teExamStudentLogList.get(i).getIp();
+                    if (Objects.isNull(currentIp) || Objects.equals(currentIp.trim(), "")) {
+                        currentIp = ip;
+                        continue;
+                    } else if (Objects.nonNull(currentIp) && !Objects.equals(currentIp.trim(), "") && !Objects.equals(currentIp, ip)) {
+                        teExamStudentLogList.get(i).setIpChange(true);
+                        currentIp = ip;
+                    }
+                }
+            }
             teExamStudentLogList = teExamStudentLogService.list(teExamStudentLogQueryWrapper);
         }