xiatian 8 months ago
parent
commit
98d175d6a4

+ 9 - 21
src/main/java/cn/com/qmth/scancentral/service/impl/StudentServiceImpl.java

@@ -1745,16 +1745,12 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
             // 已读字符串长度
             StringBuilder msg = new StringBuilder();
             String[] str = line.split(",");
-            if (str.length != 3) {
+            if (str.length != 2) {
                 msg.append("  无法解析,请检查分隔符和数据");
                 throw new ParameterException(newError(i + 1, msg.toString()));
             }
             String examNumber = str[0];
             String absent = str[1];
-            String subjectCode = str[2];
-            if (StringUtils.isBlank(subjectCode) || !vo.getSubjectCode().equals(subjectCode)) {
-                msg.append("  科目代码不正确");
-            }
             if (StringUtils.isBlank(examNumber)) {
                 examNumber = null;
                 msg.append("  准考证号不能为空");
@@ -1771,8 +1767,8 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
                 if (examNumbers.containsKey(examNumber)) {
                     msg.append("  准考证号有重复");
                 } else {
-                    StudentEntity student = this.findByExamAndSubjectCodeAndExamNumber(vo.getExamId(), subjectCode,
-                            examNumber);
+                    StudentEntity student = this.findByExamAndSubjectCodeAndExamNumber(vo.getExamId(),
+                            vo.getSubjectCode(), examNumber);
                     if (student == null) {
                         msg.append("  准考证号不存在");
                     } else {
@@ -2342,14 +2338,10 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
             }
             StringBuilder msg = new StringBuilder();
             String[] line = lineString.split(",");
-            if (line.length != 4) {
+            if (line.length != 3) {
                 msg.append("  格式错误");
             } else {
-                String subjectCode = trimAndNullIfBlank(line[0]);
-                if (StringUtils.isBlank(subjectCode)) {
-                    throw new ParameterException(errorMsg(i + 1, "  科目代码不能为空"));
-                }
-                String examNumber = trimAndNullIfBlank(line[1]);
+                String examNumber = trimAndNullIfBlank(line[0]);
                 if (StringUtils.isBlank(examNumber)) {
                     msg.append("  准考证号不能为空");
                 } else {
@@ -2366,7 +2358,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
                     }
                 }
 
-                String breach = trimAndNullIfBlank(line[3]);
+                String breach = trimAndNullIfBlank(line[2]);
                 if (StringUtils.isBlank(breach)) {
                     msg.append("  违纪不能为空");
                 } else {
@@ -2499,14 +2491,10 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
             }
             StringBuilder msg = new StringBuilder();
             String[] line = lineString.split(",");
-            if (line.length != 4) {
+            if (line.length != 3) {
                 msg.append("  格式错误");
             } else {
-                String subjectCode = trimAndNullIfBlank(line[0]);
-                if (StringUtils.isBlank(subjectCode)) {
-                    throw new ParameterException(errorMsg(i + 1, "  科目代码不能为空"));
-                }
-                String examNumber = trimAndNullIfBlank(line[1]);
+                String examNumber = trimAndNullIfBlank(line[0]);
                 if (StringUtils.isBlank(examNumber)) {
                     msg.append("  准考证号不能为空");
                 } else {
@@ -2523,7 +2511,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, StudentEntity> i
                     }
                 }
 
-                String breach = trimAndNullIfBlank(line[3]);
+                String breach = trimAndNullIfBlank(line[2]);
                 if (StringUtils.isBlank(breach)) {
                     msg.append("  考生状态不能为空");
                 } else {

+ 2 - 2
src/main/resources/mapper/BatchMapper.xml

@@ -47,10 +47,10 @@
         </if>
         GROUP BY b.device,b.subject_code ) tem
         <if test="req.sort != null">
-        	<if test="req.sort = 'ASC'">
+        	<if test="req.sort == 'ASC'">
         		order by tem.answerScanCount ASC
         	</if>
-        	<if test="req.sort != 'DESC'">
+        	<if test="req.sort == 'DESC'">
         		order by tem.answerScanCount DESC
         	</if>
         </if>

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

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

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

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

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

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