瀏覽代碼

卷袋生成及排序问题修复

xiaof 4 年之前
父節點
當前提交
4ca0e19d43

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

@@ -684,6 +684,14 @@ public class TaskLogicServiceImpl implements TaskLogicService {
             examinationImportDtoList.add(examinationImportDto);
         }
 
+        // 按考点+开始时间+课程代码+考场排序
+        examinationImportDtoList.sort(
+                Comparator.comparing(ExaminationImportDto::getExamPlace)
+                        .thenComparing(ExaminationImportDto::getExamStartTime)
+                        .thenComparing(ExaminationImportDto::getCourseCode)
+                        .thenComparing(ExaminationImportDto::getExamRoom)
+        );
+
         System.out.println(JSON.toJSONString(examinationImportDtoList));
 
         // 校验课程代码和试卷编号在印刷计划下是1对1的关系
@@ -700,7 +708,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
         examDetailService.deleteExaminationData(printPlanId);
 
         // 卷袋号生成规则
-        SerialNumberParams serialNumberParams = new SerialNumberParams("packageCode-", "1", 6);
+        SerialNumberParams serialNumberParams = new SerialNumberParams("packageCode-" + schoolId, "1", 6);
         String key = serialNumberParams.getModel() + serialNumberParams.getPrefix();
         RedisAtomicLong counter = new RedisAtomicLong(key, Objects.requireNonNull(redisTemplate.getConnectionFactory()));
         Long value = counter.get();