xiatian há 2 anos atrás
pai
commit
c8273cd0a7

+ 3 - 1
src/main/java/cn/com/qmth/scancloud/tools/service/impl/AbsentImportTask.java

@@ -122,7 +122,9 @@ public class AbsentImportTask extends AbstractTask {
             if (StringUtils.isEmpty(breachCode)) {
                 throw new StatusException(String.format("【第%s行】“违纪”字段不能为空! %s", index + 1, line));
             }
-
+            if("1".equals(absent)&&"1".equals(breachCode)) {
+                throw new StatusException(String.format("【第%s行】违纪和缺考不能同时存在! %s", index + 1, line));
+            }
             ExamStudent data = new ExamStudent();
             data.setExamNumber(examNumber);
             data.setAbsent("1".equals(absent) ? true : false);

+ 3 - 3
src/main/java/cn/com/qmth/scancloud/tools/service/impl/ObjectiveQuestionExportTask.java

@@ -205,19 +205,19 @@ public class ObjectiveQuestionExportTask extends AbstractTask {
                 DataMap line = lineList.get(i);
 
                 CetMarking imp = new CetMarking();
-                String paperType = trimAndNullIfBlank(line.getValue(3));
+                String paperType = trimAndNullIfBlank(line.get(EXCEL_HEADER[3]));
                 if (StringUtils.isBlank(paperType)) {
                     throw new StatusException(newError(i + 2, "条形码值不能为空"));
                 }
                 imp.setPaperType(paperType);
 
-                String oddNumber = trimAndNullIfBlank(line.getValue(5));
+                String oddNumber = trimAndNullIfBlank(line.get(EXCEL_HEADER[5]));
                 if (StringUtils.isBlank(oddNumber)) {
                     throw new StatusException(newError(i + 2, "奇数考场评卷点代码不能为空"));
                 }
                 imp.setOddNumber(oddNumber);
 
-                String evenNumber = trimAndNullIfBlank(line.getValue(7));
+                String evenNumber = trimAndNullIfBlank(line.get(EXCEL_HEADER[7]));
                 if (StringUtils.isBlank(evenNumber)) {
                     throw new StatusException(newError(i + 2, "偶数考场评卷点代码不能为空"));
                 }

+ 5 - 5
src/main/java/cn/com/qmth/scancloud/tools/service/impl/StructImportTask.java

@@ -100,7 +100,7 @@ public class StructImportTask extends AbstractTask {
                 Struct imp = new Struct();
                 imp.setExamId(examId);
                 imp.setPaperType("#");
-                String code = trimAndNullIfBlank(line.getValue(0));
+                String code = trimAndNullIfBlank(line.get(EXCEL_HEADER[0]));
                 if (StringUtils.isBlank(code)) {
                     msg.append("  科目代码不能为空");
                 } else if (code.length() > 50) {
@@ -108,7 +108,7 @@ public class StructImportTask extends AbstractTask {
                 }
                 imp.setSubjectCode(code);
 
-                String objective = trimAndNullIfBlank(line.getValue(1));
+                String objective = trimAndNullIfBlank(line.get(EXCEL_HEADER[1]));
                 if (StringUtils.isBlank(objective)) {
                     msg.append("  是否客观题不能为空");
                 } else {
@@ -123,7 +123,7 @@ public class StructImportTask extends AbstractTask {
                     }
                 }
 
-                String detailName = trimAndNullIfBlank(line.getValue(2));
+                String detailName = trimAndNullIfBlank(line.get(EXCEL_HEADER[2]));
                 if (StringUtils.isBlank(detailName)) {
                     msg.append("  大题名称不能为空");
                 } else if (detailName.length() > 50) {
@@ -131,7 +131,7 @@ public class StructImportTask extends AbstractTask {
                 }
                 imp.setMainTitle(detailName);
 
-                String detailNumber = trimAndNullIfBlank(line.getValue(3));
+                String detailNumber = trimAndNullIfBlank(line.get(EXCEL_HEADER[3]));
                 if (StringUtils.isBlank(detailNumber)) {
                     msg.append("  大题号不能为空");
                 } else {
@@ -148,7 +148,7 @@ public class StructImportTask extends AbstractTask {
 
                 }
 
-                String unitNumber = trimAndNullIfBlank(line.getValue(4));
+                String unitNumber = trimAndNullIfBlank(line.get(EXCEL_HEADER[4]));
                 if (StringUtils.isBlank(unitNumber)) {
                     msg.append("  小题号不能为空");
                 } else {