wangliang 4 лет назад
Родитель
Сommit
03f5a96ee3

+ 4 - 3
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateController.java

@@ -350,7 +350,6 @@ public class TIeInvigilateController {
         if (Objects.isNull(mapParameter.get("type")) || Objects.equals(mapParameter.get("type"), "")) {
             throw new BusinessException(ExceptionResultEnum.BREACH_TYPE_IS_NULL);
         }
-        BreachTypeEnum type = BreachTypeEnum.valueOf(String.valueOf(mapParameter.get("type")));
         if (Objects.isNull(mapParameter.get("description")) || Objects.equals(mapParameter.get("description"), "")) {
             throw new BusinessException(ExceptionResultEnum.BREACH_DESC_IS_NULL);
         }
@@ -362,6 +361,7 @@ public class TIeInvigilateController {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
         List<TEExamBreachLog> teExamBreachLogList = new ArrayList<>();
         if (status == 0) {//新建违纪
+            BreachTypeEnum type = BreachTypeEnum.valueOf(String.valueOf(mapParameter.get("type")));
             List<TEExamBreachLog> finalTeExamBreachLogList = teExamBreachLogList;
             for (int i = 0; i < recordIdList.size(); i++) {
                 Long l = Long.parseLong(String.valueOf(recordIdList.get(i)));
@@ -379,16 +379,17 @@ public class TIeInvigilateController {
                     examStudentId = ExamRecordCacheUtil.getExamStudentId(l);
                     examActivityId = ExamRecordCacheUtil.getExamActivityId(l);
                 }
-                TEExamBreachLog teExamBreachLog = new TEExamBreachLog(examId, examActivityId, l, examStudentId, type, description, status);
+                TEExamBreachLog teExamBreachLog = new TEExamBreachLog(examId, examActivityId, l, examStudentId, type.name(), description, status);
                 teExamBreachLog.setCreateId(tbUser.getId());
                 finalTeExamBreachLogList.add(teExamBreachLog);
             }
         } else {//撤销违纪
+            BreachCancelTypeEnum type = BreachCancelTypeEnum.valueOf(String.valueOf(mapParameter.get("type")));
             QueryWrapper<TEExamBreachLog> teExamBreachLogQueryWrapper = new QueryWrapper<>();
             teExamBreachLogQueryWrapper.lambda().in(TEExamBreachLog::getExamRecordId, recordIdList);
             teExamBreachLogList = teExamBreachLogService.list(teExamBreachLogQueryWrapper);
             teExamBreachLogList.forEach(s -> {
-                s.setType(type);
+                s.setType(type.name());
                 s.setDescription(description);
                 s.setStatus(status);
                 s.setUpdateId(tbUser.getId());

+ 4 - 4
themis-business/src/main/java/com/qmth/themis/business/entity/TEExamBreachLog.java

@@ -35,7 +35,7 @@ public class TEExamBreachLog extends BaseEntity {
 
     @ApiModelProperty(value = "类型")
     @TableField(value = "type")
-    private BreachTypeEnum type;
+    private String type;
 
     @ApiModelProperty(value = "描述")
     @TableField(value = "description")
@@ -49,7 +49,7 @@ public class TEExamBreachLog extends BaseEntity {
     @TableField(value = "remark")
     private String remark;
 
-    public TEExamBreachLog(Long examId, Long examActivityId, Long examRecordId, Long examStudentId, BreachTypeEnum type, String description, Integer status) {
+    public TEExamBreachLog(Long examId, Long examActivityId, Long examRecordId, Long examStudentId, String type, String description, Integer status) {
         setId(Constants.idGen.next());
         this.examId = examId;
         this.examActivityId = examActivityId;
@@ -96,11 +96,11 @@ public class TEExamBreachLog extends BaseEntity {
         this.examStudentId = examStudentId;
     }
 
-    public BreachTypeEnum getType() {
+    public String getType() {
         return type;
     }
 
-    public void setType(BreachTypeEnum type) {
+    public void setType(String type) {
         this.type = type;
     }
 

+ 27 - 0
themis-business/src/main/java/com/qmth/themis/business/enums/BreachCancelTypeEnum.java

@@ -0,0 +1,27 @@
+package com.qmth.themis.business.enums;
+
+/**
+* @Description: 违纪撤销类型 enum
+* @Param:
+* @return:
+* @Author: wangliang
+* @Date: 2020/8/12
+*/
+public enum BreachCancelTypeEnum {
+
+    SOFTWARE_MISSING("软件误操作"),
+
+    INCONSISTENT_FACTS("违规事实不符"),
+
+    CANCEL_OTHER("其它");
+
+    private String code;
+
+    private BreachCancelTypeEnum(String code){
+        this.code = code;
+    }
+
+    public String getCode() {
+        return code;
+    }
+}