Prechádzať zdrojové kódy

考生导入新增联系电话

wangliang 3 rokov pred
rodič
commit
469503b862

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/dto/ExamStudentImportDto.java

@@ -39,6 +39,9 @@ public class ExamStudentImportDto implements Serializable {
     @ExcelNote(value = "密码")
     private String password; //密码
 
+    @ExcelNote(value = "联系电话")
+    private String mobileNumber;
+
     @NotNull
     @ExcelNote(value = "场次")
     private String examActivityCode; //场次
@@ -55,6 +58,14 @@ public class ExamStudentImportDto implements Serializable {
         return password;
     }
 
+    public String getMobileNumber() {
+        return mobileNumber;
+    }
+
+    public void setMobileNumber(String mobileNumber) {
+        this.mobileNumber = mobileNumber;
+    }
+
     public void setPassword(String password) {
         this.password = password;
     }

+ 3 - 2
themis-business/src/main/java/com/qmth/themis/business/entity/TEExamStudent.java

@@ -1,5 +1,6 @@
 package com.qmth.themis.business.entity;
 
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@@ -80,11 +81,11 @@ public class TEExamStudent extends BaseEntity {
     private Integer enable;
 
     @ApiModelProperty(value = "年级")
-    @TableField(value = "grade")
+    @TableField(value = "grade", updateStrategy = FieldStrategy.IGNORED)
     private String grade;
 
     @ApiModelProperty(value = "教学班级")
-    @TableField(value = "class_no")
+    @TableField(value = "class_no", updateStrategy = FieldStrategy.IGNORED)
     private String classNo;
 
     @ApiModelProperty(value = "科目名称")

+ 2 - 1
themis-business/src/main/java/com/qmth/themis/business/entity/TEStudent.java

@@ -1,5 +1,6 @@
 package com.qmth.themis.business.entity;
 
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@@ -38,7 +39,7 @@ public class TEStudent extends BaseEntity {
     private String idcardNumber;
 
     @ApiModelProperty(value = "手机号")
-    @TableField(value = "mobile_number")
+    @TableField(value = "mobile_number", updateStrategy = FieldStrategy.IGNORED)
     private String mobileNumber;
 
     @ApiModelProperty(value = "姓名")

+ 5 - 9
themis-business/src/main/java/com/qmth/themis/business/templete/service/impl/TempleteLogicServiceImpl.java

@@ -18,7 +18,6 @@ import com.qmth.themis.common.contanst.Constants;
 import com.qmth.themis.common.exception.BusinessException;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.Base64Utils;
 import org.springframework.util.LinkedMultiValueMap;
 
 import javax.annotation.Resource;
@@ -142,12 +141,8 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
                         }
                         teExamStudent = gson.fromJson(gson.toJson(examStudentImportDto), TEExamStudent.class);
                         teExamStudent.setExamId(examId);
-                        teExamStudent.setExamActivityId(teExamActivity.getId());
                         teExamStudent.setStudentId(teStudent.getId());
                         teExamStudent.setCreateId(createId);
-                        teExamStudent.setCourseCode(examStudentImportDto.getCourseCode());
-                        teExamStudent.setCourseName(examStudentImportDto.getCourseName());
-                        teExamStudent.setAlreadyExamCount(0);
                     } else {
                         teExamStudent.setUpdateId(createId);
                         teExamStudent.setName(examStudentImportDto.getName());
@@ -155,11 +150,11 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
                         teExamStudent.setClassNo(examStudentImportDto.getClassNo());
                         teExamStudent.setRoomCode(examStudentImportDto.getRoomCode());
                         teExamStudent.setRoomName(examStudentImportDto.getRoomName());
-                        teExamStudent.setCourseCode(examStudentImportDto.getCourseCode());
-                        teExamStudent.setCourseName(examStudentImportDto.getCourseName());
-                        teExamStudent.setExamActivityId(teExamActivity.getId());
-                        teExamStudent.setAlreadyExamCount(0);
                     }
+                    teExamStudent.setCourseCode(examStudentImportDto.getCourseCode());
+                    teExamStudent.setCourseName(examStudentImportDto.getCourseName());
+                    teExamStudent.setAlreadyExamCount(0);
+                    teExamStudent.setExamActivityId(teExamActivity.getId());
                     if (Objects.nonNull(examStudentImportDto.getPassword()) && !Objects.equals(examStudentImportDto.getPassword().trim(), "")) {
                         teStudent.setPassword(Base64Util.encode(examStudentImportDto.getPassword().trim().getBytes(SystemConstant.CHARSET_NAME)));
                     } else {
@@ -167,6 +162,7 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
                             teStudent.setPassword(SystemConstant.DEFAULT_PASSWORD);
                         }
                     }
+                    teStudent.setMobileNumber(examStudentImportDto.getMobileNumber());
                     teStudent.setName(examStudentImportDto.getName());
                     teStudentList.add(teStudent);