haogh 1 yıl önce
ebeveyn
işleme
70a59f55a7

+ 5 - 1
src/main/java/com/qmth/exam/reserve/service/impl/StudentImportAsyncServiceImpl.java

@@ -64,12 +64,16 @@ public class StudentImportAsyncServiceImpl implements StudentImportAsyncService
             String studentCode = trimAndNullIfBlank(line.get(EXCEL_HEADER[0]));
             if (StringUtils.isBlank(studentCode)) {
                 msg.append(" 学号不能为空");
+            } else if (studentCode.length() > 20) {
+                msg.append(" 学号的长度不能超过20位");
             } else {
                 student.setStudentCode(studentCode);
             }
             String name = trimAndNullIfBlank(line.get(EXCEL_HEADER[1]));
             if (StringUtils.isBlank(name)) {
                 msg.append(" 姓名不能为空");
+            } else if (name.length() > 50) {
+                msg.append(" 考生姓名的长度不能超过50位");
             } else {
                 student.setName(name);
             }
@@ -77,7 +81,7 @@ public class StudentImportAsyncServiceImpl implements StudentImportAsyncService
             String identityNumber = trimAndNullIfBlank(line.get(EXCEL_HEADER[2]));
             if (StringUtils.isBlank(identityNumber)) {
                 msg.append(" 证件号不能为空");
-            } else if (identityNumber.length() < 6) {
+            } else if (identityNumber.length() < 6 || identityNumber.length() > 20) {
                 msg.append(" 证件号不正确");
             } else {
                 student.setIdentityNumber(identityNumber);

+ 1 - 1
src/main/resources/mapper/StudentApplyMapper.xml

@@ -19,7 +19,7 @@
         r.id=a.exam_room_id
         left join t_user u on u.id=a.operate_id 
         where
-        a.student_id=s.id and s.category_id=o.id
+        a.student_id=s.id and s.category_id=o.id and a.cancel=0
         <if test="req.teachingId != null">
             and s.category_id=#{req.teachingId}
         </if>

BIN
src/main/resources/templates/preExamImport.xlsx


BIN
src/main/resources/templates/studentImport.xlsx