Browse Source

3.4.4 update-20250507,bug修改

xiaofei 2 months ago
parent
commit
03015c0283

+ 1 - 1
distributed-print/install/mysql/init/teachcloud_db.sql

@@ -4063,7 +4063,7 @@ INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (1235, '重置AI智能评卷任务', '/api/admin/mark/question/subjective/ai/reset', 'URL', 917, 29, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (1236, '查看任务轨迹', 'MarkTaskTrack', 'LINK', 917, 11, 'AUTH', '1237', 1, 0, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (1237, '查看任务轨迹', '/api/admin/mark/task/track', 'URL', 917, 30, 'AUTH', NULL, 1, 1, 1);
-INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (1238, 'AI评卷失败待复核', 'AiMarkAbnormal', 'BUTTON', '946', '15', 'AUTH', '1239', '1', '0', '1');
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (1238, 'AI评卷失败待复核', 'AiMarkAbnormal', 'BUTTON', '946', '15', 'AUTH', '888,894,956,957,958,1011,1239', '1', '0', '1');
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES (1239, 'AI评卷失败待复核', '/api/admin/mark/inspected/ai/mark/abnormal/count', 'URL', '946', '15', 'AUTH', '1', '1', '1');
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (1300, '获取评卷区', '/api/admin/mark/inspected/get_mark_area', 'URL', 946, 9, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (1999, '达成度统计', 'DegreeManage', 'MENU', 2000, 2, NULL, NULL, 1, 0, 1);

+ 1 - 1
distributed-print/install/mysql/upgrade/3.4.5.sql

@@ -146,5 +146,5 @@ ADD COLUMN `retry_count` INT NULL DEFAULT 0 COMMENT '重试次数' AFTER `ai_mar
 ALTER TABLE `mark_task` ADD COLUMN `next_retry_time` BIGINT(20) NULL COMMENT '下一次重试时间' AFTER `retry_count`;
 ALTER TABLE `mark_student` ADD COLUMN `ai_mark_abnormal` TINYINT(1) NULL DEFAULT 0 COMMENT 'ai评卷异常' AFTER `version`;
 
-INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('1238', 'AI评卷失败待复核', 'AiMarkAbnormal', 'BUTTON', '946', '15', 'AUTH', '1239', '1', '0', '1');
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('1238', 'AI评卷失败待复核', 'AiMarkAbnormal', 'BUTTON', '946', '15', 'AUTH', '888,894,956,957,958,1011,1239', '1', '0', '1');
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('1239', 'AI评卷失败待复核', '/api/admin/mark/inspected/ai/mark/abnormal/count', 'URL', '946', '15', 'AUTH', '1', '1', '1');

+ 37 - 18
distributed-print/src/main/java/com/qmth/distributed/print/upgrade/DataUpgrade_3_4_4.java

@@ -132,36 +132,50 @@ public class DataUpgrade_3_4_4 implements DataUpgradeService {
                 this.updateMarkPaperArchive(jdbcTemplate, markPaper.getId());
             }
             log.info("1.1.2结束更新课程归档状态:[" + basicExam.getName() + "],试卷编号:[" + paperNumber + "];时间:" + DateFormatUtils.format(new Date(), DATE_PATTERN));
+            i++;
+        }
 
-            log.info("1.1.3开始更新试卷、答案文件存储json结构状态:[" + basicExam.getName() + "],试卷编号:[" + paperNumber + "];时间:" + DateFormatUtils.format(new Date(), DATE_PATTERN));
+        log.info("1.2开始查询试卷、标答格式化课程数据;时间:" + DateFormatUtils.format(new Date(), DATE_PATTERN));
+        List<MarkPaper> markPaperAllList = this.listMarkPaperAll(jdbcTemplate);
+        log.info("1.2结束查询试卷、标答格式化课程数据,共" + markPaperAllList.size() + "条数据;时间:" + DateFormatUtils.format(new Date(), DATE_PATTERN));
+        for (MarkPaper markPaper : markPaperAllList) {
+            BasicExam basicExam = getBasicExam(jdbcTemplate, markPaper.getExamId());
+            log.info("1.2.1开始更新试卷、答案文件存储json结构状态:[" + basicExam.getName() + "],试卷编号:[" + markPaper.getPaperNumber() + "];时间:" + DateFormatUtils.format(new Date(), DATE_PATTERN));
             this.parseMarkPaperAndAnswerFilePath(jdbcTemplate, markPaper);
-            log.info("1.1.3结束更试卷、答案文件存储json结构状态:[" + basicExam.getName() + "],试卷编号:[" + paperNumber + "];时间:" + DateFormatUtils.format(new Date(), DATE_PATTERN));
-            i++;
+            log.info("1.2.1结束更试卷、答案文件存储json结构状态:[" + basicExam.getName() + "],试卷编号:[" + markPaper.getPaperNumber() + "];时间:" + DateFormatUtils.format(new Date(), DATE_PATTERN));
         }
     }
 
     private void parseMarkPaperAndAnswerFilePath(JdbcTemplate jdbcTemplate, MarkPaper markPaper) {
         String[] paperTypes = markPaper.getPaperTypeList().toArray(new String[0]);
         if (StringUtils.isNotBlank(markPaper.getPaperFilePath())) {
-            List<MarkPaperFileDto> subjectivePaperFileDtoList = new ArrayList<>();
-            List<FilePathVo> paperFilePathList = JSON.parseArray(markPaper.getPaperFilePath(), FilePathVo.class);
-            for (int i = 0; i < paperFilePathList.size(); i++) {
-                MarkPaperFileDto subjectiveAnswerFileDto = new MarkPaperFileDto();
-                subjectiveAnswerFileDto.setPaperType(paperTypes[i]);
-                subjectiveAnswerFileDto.setFilePathVo(paperFilePathList.get(i));
-                subjectivePaperFileDtoList.add(subjectiveAnswerFileDto);
+            try {
+                List<MarkPaperFileDto> subjectivePaperFileDtoList = new ArrayList<>();
+                List<FilePathVo> paperFilePathList = JSON.parseArray(markPaper.getPaperFilePath(), FilePathVo.class);
+                for (int i = 0; i < paperFilePathList.size(); i++) {
+                    MarkPaperFileDto subjectiveAnswerFileDto = new MarkPaperFileDto();
+                    subjectiveAnswerFileDto.setPaperType(paperTypes[i]);
+                    subjectiveAnswerFileDto.setFilePathVo(paperFilePathList.get(i));
+                    subjectivePaperFileDtoList.add(subjectiveAnswerFileDto);
+                }
+                markPaper.setPaperFilePath(JSON.toJSONString(subjectivePaperFileDtoList));
+            } catch (Exception e) {
+                log.error("格式化试卷错误:{}", e.getMessage());
             }
-            markPaper.setPaperFilePath(JSON.toJSONString(subjectivePaperFileDtoList));
         }
 
         if (StringUtils.isNotBlank(markPaper.getAnswerFilePath())) {
-            List<MarkPaperFileDto> subjectiveAnswerFileDtoList = new ArrayList<>();
-            FilePathVo answerFilePath = JSON.parseObject(markPaper.getAnswerFilePath(), FilePathVo.class);
-            MarkPaperFileDto subjectiveAnswerFileDto = new MarkPaperFileDto();
-            subjectiveAnswerFileDto.setPaperType(paperTypes[0]);
-            subjectiveAnswerFileDto.setFilePathVo(answerFilePath);
-            subjectiveAnswerFileDtoList.add(subjectiveAnswerFileDto);
-            markPaper.setAnswerFilePath(JSON.toJSONString(subjectiveAnswerFileDtoList));
+            try {
+                List<MarkPaperFileDto> subjectiveAnswerFileDtoList = new ArrayList<>();
+                FilePathVo answerFilePath = JSON.parseObject(markPaper.getAnswerFilePath(), FilePathVo.class);
+                MarkPaperFileDto subjectiveAnswerFileDto = new MarkPaperFileDto();
+                subjectiveAnswerFileDto.setPaperType(paperTypes[0]);
+                subjectiveAnswerFileDto.setFilePathVo(answerFilePath);
+                subjectiveAnswerFileDtoList.add(subjectiveAnswerFileDto);
+                markPaper.setAnswerFilePath(JSON.toJSONString(subjectiveAnswerFileDtoList));
+            } catch (Exception e) {
+                log.error("格式化标答错误:{}", e.getMessage());
+            }
         }
 
         this.updateMarkPaperAndAnswerFilePath(jdbcTemplate, markPaper);
@@ -613,6 +627,11 @@ public class DataUpgrade_3_4_4 implements DataUpgradeService {
         return this.listData(jdbcTemplate, sql, MarkPaper.class);
     }
 
+    private List<MarkPaper> listMarkPaperAll(JdbcTemplate jdbcTemplate) {
+        String sql = "select * from mark_paper";
+        return this.listData(jdbcTemplate, sql, MarkPaper.class);
+    }
+
     private List<MarkStudent> listMarkStudent(JdbcTemplate jdbcTemplate, Long examId, String paperNumber) {
         String sql = "select * from mark_student where exam_id = " + examId + " and paper_number = '" + paperNumber + "'";
         return this.listData(jdbcTemplate, sql, MarkStudent.class);

+ 1 - 1
distributed-print/src/main/resources/upgrade/3.4.5-upgrade.sql

@@ -148,5 +148,5 @@ ALTER TABLE `mark_task`
 
 ALTER TABLE `mark_student` ADD COLUMN `ai_mark_abnormal` TINYINT(1) NULL DEFAULT 0 COMMENT 'ai评卷异常' AFTER `version`;
 
-INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('1238', 'AI评卷失败待复核', 'AiMarkAbnormal', 'BUTTON', '946', '15', 'AUTH', '1239', '1', '0', '1');
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES ('1238', 'AI评卷失败待复核', 'AiMarkAbnormal', 'BUTTON', '946', '15', 'AUTH', '888,894,956,957,958,1011,1239', '1', '0', '1');
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('1239', 'AI评卷失败待复核', '/api/admin/mark/inspected/ai/mark/abnormal/count', 'URL', '946', '15', 'AUTH', '1', '1', '1');