xiatian 8 місяців тому
батько
коміт
7e0b84250e

+ 14 - 7
src/main/java/cn/com/qmth/scancentral/service/impl/StudentServiceImpl.java

@@ -2335,10 +2335,14 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
             }
             StringBuilder msg = new StringBuilder();
             String[] line = lineString.split(",");
-            if (line.length != 3) {
+            if (line.length != 4) {
                 msg.append("  格式错误");
             } else {
-                String examNumber = trimAndNullIfBlank(line[0]);
+                String subjectCode = trimAndNullIfBlank(line[0]);
+                if (StringUtils.isBlank(subjectCode)) {
+                    throw new ParameterException(errorMsg(i + 1, "  科目代码不能为空"));
+                }
+                String examNumber = trimAndNullIfBlank(line[1]);
                 if (StringUtils.isBlank(examNumber)) {
                     msg.append("  准考证号不能为空");
                 } else {
@@ -2355,7 +2359,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
                     }
                 }
 
-                String breach = trimAndNullIfBlank(line[1]);
+                String breach = trimAndNullIfBlank(line[3]);
                 if (StringUtils.isBlank(breach)) {
                     msg.append("  违纪不能为空");
                 } else {
@@ -2485,11 +2489,14 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
             }
             StringBuilder msg = new StringBuilder();
             String[] line = lineString.split(",");
-            if (line.length != 3) {
+            if (line.length != 4) {
                 msg.append("  格式错误");
             } else {
-
-                String examNumber = trimAndNullIfBlank(line[0]);
+                String subjectCode = trimAndNullIfBlank(line[0]);
+                if (StringUtils.isBlank(subjectCode)) {
+                    throw new ParameterException(errorMsg(i + 1, "  科目代码不能为空"));
+                }
+                String examNumber = trimAndNullIfBlank(line[1]);
                 if (StringUtils.isBlank(examNumber)) {
                     msg.append("  准考证号不能为空");
                 } else {
@@ -2506,7 +2513,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
                     }
                 }
 
-                String breach = trimAndNullIfBlank(line[1]);
+                String breach = trimAndNullIfBlank(line[3]);
                 if (StringUtils.isBlank(breach)) {
                     msg.append("  考生状态不能为空");
                 } else {

+ 1 - 1
src/main/resources/templates/breach-import.txt

@@ -1 +1 @@
-准考证号,姓名,违纪(标题行,数据从第二行读取)
+科目代码,准考证号,姓名,违纪(标题行,数据从第二行读取)

+ 1 - 1
src/main/resources/templates/cust-status-import.txt

@@ -1 +1 @@
-准考证号,姓名,考生状态(标题行,数据从第二行读取)
+科目代码,准考证号,姓名,考生状态(标题行,数据从第二行读取)