Ver código fonte

3.2.5 抽多套卷时,关联错误问题修复

xiaofei 2 anos atrás
pai
commit
39779abdf9

+ 16 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamTaskSync.java

@@ -60,6 +60,12 @@ public class ExamTaskSync implements Serializable {
      */
     @TableField("paper_type")
     private String paperType;
+
+    /**
+     * 试卷类型
+     */
+    @TableField("total_paper_type")
+    private String totalPaperType;
     /**
      * 机构代码
      */
@@ -98,13 +104,14 @@ public class ExamTaskSync implements Serializable {
     public ExamTaskSync() {
     }
 
-    public ExamTaskSync(Long schoolId, Long examId, String courseCode, String paperNumber, String paperType, String orgCode, Integer thirdRelateId, ExamTaskSyncStatusEnum syncStatus, Long syncUserId, Long syncStartTime, Long syncEndTime) {
+    public ExamTaskSync(Long schoolId, Long examId, String courseCode, String paperNumber, String paperType, String totalPaperType, String orgCode, Integer thirdRelateId, ExamTaskSyncStatusEnum syncStatus, Long syncUserId, Long syncStartTime, Long syncEndTime) {
         this.id = SystemConstant.getDbUuid();
         this.schoolId = schoolId;
         this.examId = examId;
         this.courseCode = courseCode;
         this.paperNumber = paperNumber;
         this.paperType = paperType;
+        this.totalPaperType = totalPaperType;
         this.orgCode = orgCode;
         this.thirdRelateId = thirdRelateId;
         this.syncStatus = syncStatus;
@@ -161,6 +168,14 @@ public class ExamTaskSync implements Serializable {
         this.paperType = paperType;
     }
 
+    public String getTotalPaperType() {
+        return totalPaperType;
+    }
+
+    public void setTotalPaperType(String totalPaperType) {
+        this.totalPaperType = totalPaperType;
+    }
+
     public String getOrgCode() {
         return orgCode;
     }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/DataSyncServiceImpl.java

@@ -157,7 +157,7 @@ public class DataSyncServiceImpl implements DataSyncService {
                         ExamTaskSyncStatusEnum syncStatus = ExamTaskSyncStatusEnum.STARTING;
 
                         if (examTaskSync == null) {
-                            examTaskSync = new ExamTaskSync(schoolId, examTask.getExamId(), examTask.getCourseCode(), examTask.getPaperNumber(), paperType, orgCode, Math.toIntExact(thirdRelateId), syncStatus, sysUser.getId(), System.currentTimeMillis(), null);
+                            examTaskSync = new ExamTaskSync(schoolId, examTask.getExamId(), examTask.getCourseCode(), examTask.getPaperNumber(), paperType, param.getPaperType(), orgCode, Math.toIntExact(thirdRelateId), syncStatus, sysUser.getId(), System.currentTimeMillis(), null);
                         } else {
                             examTaskSync.setThirdRelateId(Math.toIntExact(thirdRelateId));
                             examTaskSync.setSyncStatus(syncStatus);

+ 2 - 1
distributed-print-business/src/main/resources/db/install/teachcloud_db.sql

@@ -963,7 +963,8 @@ CREATE TABLE `exam_task_sync` (
                                   `exam_id` bigint NOT NULL COMMENT '考试ID',
                                   `course_code` varchar(50) NOT NULL COMMENT '课程代码',
                                   `paper_number` varchar(50) NOT NULL COMMENT '试着编号',
-                                  `paper_type` varchar(10) DEFAULT NULL COMMENT '试卷类型',
+                                  `paper_type` varchar(50) DEFAULT NULL COMMENT '试卷类型',
+                                  `total_paper_type` varchar(50) DEFAULT NULL COMMENT '所有试卷类型',
                                   `org_code` varchar(45) DEFAULT NULL COMMENT '机构代码',
                                   `third_relate_id` int DEFAULT NULL COMMENT '云阅卷考试ID',
                                   `sync_status` varchar(45) DEFAULT NULL COMMENT '同步状态',

+ 5 - 0
distributed-print-business/src/main/resources/db/log/脚本-xiaof.sql

@@ -75,3 +75,8 @@ ALTER TABLE `exam_paper_structure`
 
 ALTER TABLE `exam_task_sync`
     CHANGE COLUMN `paper_type` `paper_type` VARCHAR(50) CHARACTER SET 'utf8mb4' NULL DEFAULT NULL COMMENT '试卷类型' ;
+
+ALTER TABLE `exam_task_sync`
+    ADD COLUMN `total_paper_type` VARCHAR(50) NULL COMMENT '所有卷型' AFTER `paper_type`;
+
+update `exam_task_sync` set total_paper_type = paper_type where total_paper_type is null;

+ 6 - 1
distributed-print-business/src/main/resources/db/upgrade/3.2.5.sql

@@ -88,6 +88,9 @@ ALTER TABLE `exam_paper_structure`
 ALTER TABLE `exam_paper_structure`
     CHANGE COLUMN `paper_number` `paper_number` VARCHAR(50) CHARACTER SET 'utf8mb4' NOT NULL COMMENT '试卷编号' ;
 
+ALTER TABLE `exam_task_sync`
+    ADD COLUMN `total_paper_type` VARCHAR(50) NULL COMMENT '所有卷型' AFTER `paper_type`;
+
 ALTER TABLE basic_student MODIFY COLUMN student_code varchar(100) NOT NULL COMMENT '学生编号';
 ALTER TABLE basic_student MODIFY COLUMN student_name varchar(100) NOT NULL COMMENT '学生姓名';
 ALTER TABLE exam_student MODIFY COLUMN student_code varchar(100) NOT NULL COMMENT '考生代码';
@@ -158,4 +161,6 @@ INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence
 
 UPDATE sys_config
 SET config_value='UTF-8'
-WHERE config_key='sys.txt.charset';
+WHERE config_key='sys.txt.charset';
+
+update `exam_task_sync` set total_paper_type = paper_type where total_paper_type is null;

+ 3 - 3
distributed-print-business/src/main/resources/mapper/ExamDetailCourseMapper.xml

@@ -210,7 +210,7 @@
                      a.org_code,
                      a.third_relate_id,
                      a.sync_user_id,
-                     GROUP_CONCAT(a.paper_type ORDER BY a.paper_type) paper_type,
+                     a.total_paper_type,
                      CASE
                         WHEN LOCATE('STARTING', GROUP_CONCAT(DISTINCT a.sync_status)) THEN 'STARTING'
                         WHEN LOCATE('FAIL', GROUP_CONCAT(DISTINCT a.sync_status)) THEN 'FAIL'
@@ -234,11 +234,11 @@
                             and a.paper_number = #{paperNumber}
                         </if>
                     </where>
-                    GROUP BY a.school_id , a.exam_id , a.course_code , a.paper_number , a.org_code , a.third_relate_id , a.sync_user_id
+                    GROUP BY a.school_id , a.exam_id , a.course_code , a.paper_number , a.org_code , a.third_relate_id ,a.sync_user_id, a.total_paper_type
                 ) ets ON et.school_id = ets.school_id
                 AND et.exam_id = ets.exam_id
                 AND et.paper_number = ets.paper_number
-                AND t.paper_type = ets.paper_type
+                AND t.paper_type = ets.total_paper_type
                 LEFT JOIN
             sys_user su ON ets.sync_user_id = su.id
                 LEFT JOIN