Explorar el Código

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

wangliang hace 2 años
padre
commit
3532a1753f

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/util/CreatePdfUtil.java

@@ -1246,7 +1246,7 @@ public class CreatePdfUtil {
         File localA4PdfFile = null, localPaperPdfFile = null, localA3PdfCardFile = null;
         BasicAttachment basicAttachment = null;
         // 试卷+题卡
-        if (Objects.nonNull(dirNamePaper)) {
+        if (StringUtils.isNotBlank(dirNamePaper)) {
             dirNamePaper = dirNamePaper.replaceAll("\\\\", SystemConstant.ORG_SPLIT);
             localPaperPdfFile = new File(dirNamePaper);
             basicAttachment = basicAttachmentService.saveAttachmentPdf(dirNamePaper, userId);
@@ -1259,7 +1259,7 @@ public class CreatePdfUtil {
             examDetail.setAttachmentId(basicAttachment.getId());
         }
         // 题卡
-        if (Objects.nonNull(dirNameCardA3)) {
+        if (StringUtils.isNotBlank(dirNameCardA3)) {
             dirNameCardA3 = dirNameCardA3.replaceAll("\\\\", SystemConstant.ORG_SPLIT);
             localA3PdfCardFile = new File(dirNameCardA3);
             basicAttachment = basicAttachmentService.saveAttachmentPdf(dirNameCardA3, userId);

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

@@ -50,7 +50,7 @@
         FROM
             exam_card a
                 LEFT JOIN
-            exam_task_detail b ON FIND_IN_SET(a.id, REPLACE(substring_index(substring_index(CONVERT((b.paper_attachment_ids ->>'$[*].cardId') USING utf8), ']', 1), '[',-1),'"',''))
+            exam_task_detail b ON FIND_IN_SET(a.id, REPLACE(REPLACE(substring_index(substring_index(CONVERT((b.paper_attachment_ids ->>'$[*].cardId') USING utf8), ']', 1), '[',-1),' "','"'),'"',''))
                 LEFT JOIN
             exam_task c ON b.exam_task_id = c.id
                 LEFT JOIN
@@ -182,8 +182,7 @@
                 left JOIN
             exam_task_detail b ON a.id = b.exam_task_id
                 JOIN
-            exam_card c ON FIND_IN_SET(c.id, REPLACE(substring_index(substring_index(CONVERT((b.paper_attachment_ids ->>'$[*].cardId')
-                                                                                             USING utf8), ']', 1), '[',-1),'"',''))
+            exam_card c ON FIND_IN_SET(c.id, REPLACE(REPLACE(substring_index(substring_index(CONVERT((b.paper_attachment_ids ->>'$[*].cardId') USING utf8), ']', 1), '[',-1),' "','"'),'"',''))
                 left JOIN
             exam_card_detail d ON c.id = d.card_id
         WHERE
@@ -244,7 +243,7 @@
                               exam_task_detail b
                                   LEFT JOIN exam_task et on b.exam_task_id = et.id
                           WHERE
-                              et.paper_number = #{paperNumber} and et.status = 'STAGE' and FIND_IN_SET(a.id, REPLACE(substring_index(substring_index(CONVERT((b.paper_attachment_ids ->>'$[*].cardId') USING utf8), ']', 1), '[',-1),'"','')))
+                              et.paper_number = #{paperNumber} and et.status = 'STAGE' and FIND_IN_SET(a.id, REPLACE(REPLACE(substring_index(substring_index(CONVERT((b.paper_attachment_ids ->>'$[*].cardId') USING utf8), ']', 1), '[',-1),' "','"'),'"','')))
         order by a.create_time desc
     </select>
 </mapper>

+ 2 - 4
distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml

@@ -535,8 +535,7 @@
         sys_user d ON a.create_id = d.id
         LEFT JOIN
         basic_card_rule e ON a.card_rule_id = e.id
-        JOIN exam_card f ON FIND_IN_SET(f.id, REPLACE(substring_index(substring_index(CONVERT((b.paper_attachment_ids ->>'$[*].cardId')
-            USING utf8), ']', 1), '[',-1),'"',''))
+        JOIN exam_card f ON FIND_IN_SET(f.id, REPLACE(REPLACE(substring_index(substring_index(CONVERT((b.paper_attachment_ids ->>'$[*].cardId') USING utf8), ']', 1), '[',-1),' "','"'),'"',''))
         LEFT JOIN
         basic_exam be ON a.exam_id = be.id
         LEFT JOIN
@@ -721,8 +720,7 @@
                 LEFT JOIN
             exam_task_detail b ON a.id = b.exam_task_id
         WHERE
-            FIND_IN_SET(#{cardId}, REPLACE(substring_index(substring_index(CONVERT((b.paper_attachment_ids ->>'$[*].cardId')
-                                                                              USING utf8), ']', 1), '[',-1),'"',''))
+            FIND_IN_SET(#{cardId}, REPLACE(REPLACE(substring_index(substring_index(CONVERT((b.paper_attachment_ids ->>'$[*].cardId') USING utf8), ']', 1), '[',-1),' "','"'),'"',''))
     </select>
     <select id="listReviewSampleInfoByExamTaskId"
             resultType="com.qmth.distributed.print.business.bean.dto.ReviewSampleDto">

+ 0 - 2
teachcloud-common/src/main/java/com/qmth/teachcloud/common/annotation/ExcelNote.java

@@ -15,6 +15,4 @@ import java.lang.annotation.*;
 public @interface ExcelNote {
 
     String value() default "";
-
-    boolean require() default true;
 }

+ 4 - 4
teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/ExcelUtil.java

@@ -199,7 +199,7 @@ public class ExcelUtil {
                             } else {
                                 if (Objects.nonNull(cell)) {
                                     Object obj = convert(cell);
-                                    if (StringUtils.isBlank(obj.toString().trim())) {
+                                    if (obj == null || StringUtils.isBlank(obj.toString().trim())) {
                                         emptyRowSum++;
                                     }
                                     if (extend) {
@@ -208,7 +208,7 @@ public class ExcelUtil {
                                             fields[j].set(o, obj);
                                             Annotation annotation = fields[j].getAnnotation(NotNull.class);
                                             ExcelNote note = fields[j].getAnnotation(ExcelNote.class);
-                                            if (note.require() && (Objects.isNull(obj) || Objects.equals("", obj)) && Objects.nonNull(annotation)) {
+                                            if ((Objects.isNull(obj) || Objects.equals("", obj)) && Objects.nonNull(annotation)) {
                                                 excelErrorList.add(y, new ExcelError(j + 1, "excel第" + (y + 1) + "个sheet第" + (j + 1) + "行[" + note.value() + "]为空"));
                                             }
                                         } else {
@@ -232,7 +232,7 @@ public class ExcelUtil {
                                             fields[j].set(o, obj);
                                             Annotation annotation = fields[j].getAnnotation(NotNull.class);
                                             ExcelNote note = fields[j].getAnnotation(ExcelNote.class);
-                                            if (note.require() && (Objects.isNull(obj) || Objects.equals("", obj)) && Objects.nonNull(annotation)) {
+                                            if ((Objects.isNull(obj) || Objects.equals("", obj)) && Objects.nonNull(annotation)) {
                                                 excelErrorList.add(y, new ExcelError(i + 1, "excel第" + (y + 1) + "个sheet第" + (i + 1) + "行[" + note.value() + "]为空"));
                                             }
                                         }
@@ -341,7 +341,7 @@ public class ExcelUtil {
             field.setAccessible(true);
             Annotation annotation = field.getAnnotation(NotNull.class);
             ExcelNote note = field.getAnnotation(ExcelNote.class);
-            if (note.require() && (Objects.isNull(field.get(obj)) || Objects.equals("", field.get(obj))) && Objects.nonNull(annotation)) {
+            if ((Objects.isNull(field.get(obj)) || Objects.equals("", field.get(obj))) && Objects.nonNull(annotation)) {
                 excelErrorList.add(new ExcelError(index + 1, "excel第" + (sheetIndex + 1) + "个sheet第" + (index + 1) + "行[" + note.value() + "]为空"));
             }
         }