|
@@ -6,9 +6,11 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
|
|
import com.qmth.themis.business.enums.ExamRecordStatusEnum;
|
|
|
+import com.qmth.themis.business.enums.MessageTypeEnum;
|
|
|
import com.qmth.themis.business.util.UidUtil;
|
|
|
import io.swagger.annotations.ApiModel;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
+import org.jetbrains.annotations.NotNull;
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
import java.util.List;
|
|
@@ -22,7 +24,7 @@ import java.util.Objects;
|
|
|
* @Date: 2020/6/25
|
|
|
*/
|
|
|
@ApiModel(value = "t_e_exam_student_log", description = "考生轨迹")
|
|
|
-public class TEExamStudentLog implements Serializable {
|
|
|
+public class TEExamStudentLog implements Serializable, Comparable<TEExamStudentLog> {
|
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
@@ -97,10 +99,42 @@ public class TEExamStudentLog implements Serializable {
|
|
|
@TableField(exist = false)
|
|
|
private Boolean ipChange;
|
|
|
|
|
|
+ @ApiModelProperty(value = "消息类型")
|
|
|
+ @TableField(exist = false)
|
|
|
+ private MessageTypeEnum msgType;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "消息类型")
|
|
|
+ @TableField(exist = false)
|
|
|
+ private String msgTypeStr;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "消息内容")
|
|
|
+ @TableField(exist = false)
|
|
|
+ private String content;
|
|
|
+
|
|
|
+ @JsonSerialize(using = ToStringSerializer.class)
|
|
|
+ @ApiModelProperty(value = "发送人id")
|
|
|
+ @TableField(exist = false)
|
|
|
+ private Long formUserId;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "发送人名称")
|
|
|
+ @TableField(exist = false)
|
|
|
+ private String formUserName;
|
|
|
+
|
|
|
public TEExamStudentLog() {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public TEExamStudentLog(Long studentId, Long examStudentId, Long examRecordId, MessageTypeEnum msgType, String content, Long formUserId, String formUserName, Long createTime) {
|
|
|
+ this.studentId = studentId;
|
|
|
+ this.examStudentId = examStudentId;
|
|
|
+ this.examRecordId = examRecordId;
|
|
|
+ this.msgType = msgType;
|
|
|
+ this.content = content;
|
|
|
+ this.formUserId = formUserId;
|
|
|
+ this.formUserName = formUserName;
|
|
|
+ this.createTime = createTime;
|
|
|
+ }
|
|
|
+
|
|
|
public TEExamStudentLog(String type, String info, String remark, Long studentId, String ip,
|
|
|
String country, String region, String province, String city, String isp) {
|
|
|
this.id = UidUtil.nextId();
|
|
@@ -155,6 +189,34 @@ public class TEExamStudentLog implements Serializable {
|
|
|
this.isp = isp;
|
|
|
}
|
|
|
|
|
|
+ public String getFormUserName() {
|
|
|
+ return formUserName;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setFormUserName(String formUserName) {
|
|
|
+ this.formUserName = formUserName;
|
|
|
+ }
|
|
|
+
|
|
|
+ public MessageTypeEnum getMsgType() {
|
|
|
+ return msgType;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setMsgType(MessageTypeEnum msgType) {
|
|
|
+ this.msgType = msgType;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getMsgTypeStr() {
|
|
|
+ if (Objects.nonNull(msgType)) {
|
|
|
+ return msgType.getCode();
|
|
|
+ } else {
|
|
|
+ return msgTypeStr;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setMsgTypeStr(String msgTypeStr) {
|
|
|
+ this.msgTypeStr = msgTypeStr;
|
|
|
+ }
|
|
|
+
|
|
|
public List<TEExamStudentLog> ipChange(List<TEExamStudentLog> teExamStudentLogList) {
|
|
|
String currentIp = teExamStudentLogList.get(0).getIp();
|
|
|
for (int i = 1; i < teExamStudentLogList.size(); i++) {
|
|
@@ -173,6 +235,22 @@ public class TEExamStudentLog implements Serializable {
|
|
|
return teExamStudentLogList;
|
|
|
}
|
|
|
|
|
|
+ public String getContent() {
|
|
|
+ return content;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setContent(String content) {
|
|
|
+ this.content = content;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Long getFormUserId() {
|
|
|
+ return formUserId;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setFormUserId(Long formUserId) {
|
|
|
+ this.formUserId = formUserId;
|
|
|
+ }
|
|
|
+
|
|
|
public Boolean getIpChange() {
|
|
|
return ipChange;
|
|
|
}
|
|
@@ -320,4 +398,15 @@ public class TEExamStudentLog implements Serializable {
|
|
|
public void setCreateTime(Long createTime) {
|
|
|
this.createTime = createTime;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int compareTo(@NotNull TEExamStudentLog o) {
|
|
|
+ if (o.getCreateTime() < this.getCreateTime()) {
|
|
|
+ return 1;
|
|
|
+ } else if (o.getCreateTime() > this.getCreateTime()) {
|
|
|
+ return -1;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|