Browse Source

线上考试违纪考生导入

haogh 6 months ago
parent
commit
91fa78bbde
2 changed files with 18 additions and 2 deletions
  1. 1 1
      sql/update.sql
  2. 17 1
      src/cn/hmsoft/art/service/score/ScScoreYmViolationService.java

+ 1 - 1
sql/update.sql

@@ -170,7 +170,7 @@ CREATE TABLE `sc_score_ym_violation`
     `violation_no`     varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci  NULL DEFAULT NULL COMMENT '考生违规编号',
     `exam_date`        varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci  NULL DEFAULT NULL COMMENT '考试日期 yyyy-MM-dd',
     `exam_subject`     varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '考试科目',
-    `violation_remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '违规行为',
+    `violation_remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '违规行为',
     `country_rule`     varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '国家处理办法',
     `school_rule`      varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '学校处理办法',
     PRIMARY KEY (`id`) USING BTREE

+ 17 - 1
src/cn/hmsoft/art/service/score/ScScoreYmViolationService.java

@@ -45,6 +45,7 @@ public class ScScoreYmViolationService extends ArtService {
 
     public void upload(List<List<String>> values, FrameOptr optr) {
         int row = 2;
+        int total = 0;
         for (List<String> list : values) {
             String std_name = list.get(0) == null ? null : list.get(0).trim();
             String cert_id = list.get(1) == null ? null : list.get(1).trim();
@@ -129,19 +130,33 @@ public class ScScoreYmViolationService extends ArtService {
             if (StringHelper.isEmpty(exam_subject)) {
                 throw new BusinessException("第【" + row + "】行,考生考试科目不能为空");
             }
+            if(exam_subject.length() > 200) {
+                throw new BusinessException("第【" + row + "】行,考生考试科目过长");
+            }
 
             if (StringHelper.isEmpty(violation_remark)) {
                 throw new BusinessException("第【" + row + "】行,考生违规行为不能为空");
             }
+            if(violation_remark.length() > 200) {
+                throw new BusinessException("第【" + row + "】行,考生违规行为过长");
+            }
 
             if (StringHelper.isEmpty(country_rule)) {
                 throw new BusinessException("第【" + row + "】行,国家处理办法不能为空");
             }
 
+            if(country_rule.length() > 200) {
+                throw new BusinessException("第【" + row + "】行,国家处理办法过长");
+            }
+
             if (StringHelper.isEmpty(school_rule)) {
                 throw new BusinessException("第【" + row + "】行,学校处理办法不能为空");
             }
 
+            if(school_rule.length() > 200) {
+                throw new BusinessException("第【" + row + "】行,学校处理办法过长");
+            }
+
             //判断是否已经存在
             ScScoreYmViolation existViolation = scScoreYmViolationDao.findByCertAndAspect(cert_id, aspect_name);
             if (existViolation != null) {
@@ -168,9 +183,10 @@ public class ScScoreYmViolationService extends ArtService {
                 scScoreYmViolationDao.insert(violation);
             }
             row++;
+            total++;
         }
 
-        this.log(optr, ArtOptrLogType.VIOLATION_IMPORT.toString());
+        this.log(optr, ArtOptrLogType.VIOLATION_IMPORT.toString(), total);
     }