Browse Source

考生日志修改

wangliang 2 years ago
parent
commit
b20d715959

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

@@ -1,5 +1,6 @@
 package com.qmth.themis.business.bean.admin;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -16,7 +17,84 @@ public class ExamStudentLogDetailListBean {
 	@ApiModelProperty(name = "详情")
     private String remark;
 
-	public Long getCreateTime() {
+    @ApiModelProperty(value = "ip地址")
+    private String ip;
+
+    @ApiModelProperty(value = "国家")
+    private String country;
+
+    @ApiModelProperty(value = "地区")
+    private String region;
+
+    @ApiModelProperty(value = "省份")
+    private String province;
+
+    @ApiModelProperty(value = "城市")
+    private String city;
+
+    @ApiModelProperty(value = "运营商")
+    private String isp;
+
+    @ApiModelProperty(value = "ip是否改变")
+    private Boolean ipChange;
+
+    public String getIp() {
+        return ip;
+    }
+
+    public void setIp(String ip) {
+        this.ip = ip;
+    }
+
+    public String getCountry() {
+        return country;
+    }
+
+    public void setCountry(String country) {
+        this.country = country;
+    }
+
+    public String getRegion() {
+        return region;
+    }
+
+    public void setRegion(String region) {
+        this.region = region;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getIsp() {
+        return isp;
+    }
+
+    public void setIsp(String isp) {
+        this.isp = isp;
+    }
+
+    public Boolean getIpChange() {
+        return ipChange;
+    }
+
+    public void setIpChange(Boolean ipChange) {
+        this.ipChange = ipChange;
+    }
+
+    public Long getCreateTime() {
 		return createTime;
 	}
 

+ 15 - 1
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeReportServiceImpl.java

@@ -323,7 +323,21 @@ public class TIeReportServiceImpl implements TIeReportService {
      */
     @Override
     public IPage<ExamStudentLogDetailListBean> examStudentLogListDetail(Long examStudentId, int pageNumber, int pageSize) {
-        return examStudentLogMapper.getExamStudentLogList(new Page<>(pageNumber, pageSize), examStudentId);
+        IPage<ExamStudentLogDetailListBean> examStudentLogDetailListBeanIPage = examStudentLogMapper.getExamStudentLogList(new Page<>(pageNumber, pageSize), examStudentId);
+        if (Objects.nonNull(examStudentLogDetailListBeanIPage) && !CollectionUtils.isEmpty(examStudentLogDetailListBeanIPage.getRecords())) {
+            String currentIp = examStudentLogDetailListBeanIPage.getRecords().get(0).getIp();
+            for (int i = 1; i < examStudentLogDetailListBeanIPage.getRecords().size(); i++) {
+                String ip = examStudentLogDetailListBeanIPage.getRecords().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)) {
+                    examStudentLogDetailListBeanIPage.getRecords().get(i).setIpChange(true);
+                    currentIp = ip;
+                }
+            }
+        }
+        return examStudentLogDetailListBeanIPage;
     }
 
     /**

+ 7 - 1
themis-business/src/main/resources/mapper/TEExamStudentLogMapper.xml

@@ -6,7 +6,13 @@
 		select
 			f.create_time createTime,
             (case when JSON_VALID(f.title) = 1 then CONVERT((f.title->>'$.title') USING utf8) else f.title end) as type,
-			f.info remark
+			f.info remark,
+            f.ip,
+            f.country,
+            f.region,
+            f.province,
+            f.city,
+            f.isp
 		from
 			t_e_exam_student_log f
 		where