Browse Source

Merge remote-tracking branch 'origin/dev_v3.2.5' into dev_v3.2.5

wangliang 2 năm trước cách đây
mục cha
commit
1135a6d1ce

+ 9 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/SyncExamTaskDto.java

@@ -27,6 +27,7 @@ public class SyncExamTaskDto {
     private String examTime;
     private Integer totalSubjects;
     private Integer thirdRelateId;
+    private String thirdRelateName;
     private ExamTaskSyncStatusEnum syncStatus;
     private String syncStatusDisplay;
     private String errorMsg;
@@ -149,6 +150,14 @@ public class SyncExamTaskDto {
         return thirdRelateId;
     }
 
+    public String getThirdRelateName() {
+        return thirdRelateName;
+    }
+
+    public void setThirdRelateName(String thirdRelateName) {
+        this.thirdRelateName = thirdRelateName;
+    }
+
     public void setThirdRelateId(Integer thirdRelateId) {
         this.thirdRelateId = thirdRelateId;
     }

+ 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);

+ 9 - 11
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/TaskLogicServiceImpl.java

@@ -304,12 +304,10 @@ public class TaskLogicServiceImpl implements TaskLogicService {
 
                     //拼装key
                     StringJoiner stringJoiner = new StringJoiner("_");
-                    stringJoiner.add(String.valueOf(examDetail.getSchoolId()))
-                            .add(String.valueOf(examPrintPlan.getExamId()))
+                    stringJoiner.add(String.valueOf(examPrintPlan.getId()))
+                            .add(examDetailCourse.getPaperNumber())
                             .add(String.valueOf(examDetail.getExamStartTime()))
-                            .add(String.valueOf(examDetail.getExamEndTime()))
-                            .add(examDetailCourse.getCourseCode())
-                            .add(examDetailCourse.getPaperNumber());
+                            .add(String.valueOf(examDetail.getExamEndTime()));
                     String key = stringJoiner.toString();
 
                     String paperType;
@@ -329,12 +327,12 @@ public class TaskLogicServiceImpl implements TaskLogicService {
 
                     // 当前关联试卷类型
                     List<String> relatePaperTypes = new ArrayList<>();
-                    if (StringUtils.isNotBlank(examTaskDetail.getRelatePaperType())) {
-                        String[] strings = examTaskDetail.getRelatePaperType().split(",");
-                        if (strings.length > 0) {
-                            relatePaperTypes.addAll(Arrays.asList(strings));
-                        }
-                    }
+//                    if (StringUtils.isNotBlank(examTaskDetail.getRelatePaperType())) {
+//                        String[] strings = examTaskDetail.getRelatePaperType().split(",");
+//                        if (strings.length > 0) {
+//                            relatePaperTypes.addAll(Arrays.asList(strings));
+//                        }
+//                    }
 
                     // 考生实际关联试卷类型
                     List<String> studentPaperTypes = new ArrayList<>();

+ 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;

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

@@ -161,6 +161,7 @@
             t.total_subjects totalSubjects,
             t.print_plan_ids printPlanIds,
             ets.third_relate_id thirdRelateId,
+            tsse.exam_name thirdRelateName,
             ets.sync_status syncStatus,
             su.real_name syncUserName,
             bc.teaching_room_id teachingRoomId,
@@ -210,7 +211,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 +235,14 @@
                             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
+            t_sync_stmms_exam tsse ON ets.school_id = tsse.school_id
+                and ets.third_relate_id = tsse.exam_id
                 LEFT JOIN
             sys_user su ON ets.sync_user_id = su.id
                 LEFT JOIN