xiaof 4 anos atrás
pai
commit
94813b4ff7

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

@@ -130,6 +130,7 @@ public class BasicAttachmentServiceImpl extends ServiceImpl<BasicAttachmentMappe
                 File localHtmlFile = ossUtil.ossDownload(dirName, url);
                 String pdfDirName = dirName.replaceAll(SystemConstant.HTML_PREFIX, SystemConstant.PDF_PREFIX).replaceAll(UploadFileEnum.HTML.name().toLowerCase(), UploadFileEnum.PDF.name().toLowerCase());
                 String destUrl = SystemConstant.PDF_TEMP_FILES_DIR + File.separator + pdfDirName;
+//                destUrl = destUrl.replaceAll("\\\\","/");
                 HtmlToPdfUtil.convert(localHtmlFile.getPath(), destUrl, PageSizeEnum.A3);
                 File pdfFile = new File(destUrl);
                 pdfDto = PdfUtil.addPdfPage(pdfFile);

+ 11 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java

@@ -331,6 +331,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         return this.update(updateWrapper);
     }
 
+    @Transactional
     @Override
     public boolean taskCancel(ExamDetail examDetail) {
         ExamDetail detail = this.getById(examDetail.getId());
@@ -339,6 +340,16 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         }
         UpdateWrapper<ExamDetail> updateWrapper = new UpdateWrapper<>();
         updateWrapper.lambda().set(ExamDetail::getStatus, ExamDetailStatusEnum.READY).eq(ExamDetail::getId, examDetail.getId());
+
+        //所有考场都撤回,印刷任务状态改为就绪
+        QueryWrapper<ExamDetail> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(ExamDetail::getPrintPlanId, detail.getPrintPlanId()).notIn(ExamDetail::getStatus, ExamDetailStatusEnum.NEW, ExamDetailStatusEnum.READY);
+        List<ExamDetail> examDetails = this.list(queryWrapper);
+        if(examDetails.isEmpty()){
+            UpdateWrapper<ExamPrintPlan> printPlanUpdateWrapper = new UpdateWrapper<>();
+            printPlanUpdateWrapper.lambda().set(ExamPrintPlan::getStatus, PrintPlanStatusEnum.READY).eq(ExamPrintPlan::getId, detail.getPrintPlanId());
+            examPrintPlanService.update(printPlanUpdateWrapper);
+        }
         return this.update(updateWrapper);
     }
 

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

@@ -385,6 +385,8 @@ public class CreatePdfUtil {
         }
         List<String> pathList = mergePdfList.stream().map(PdfDto::getPath).collect(Collectors.toList());
         String dirName = PdfUtil.mergePdf(pathList.toArray(new String[mergePdfList.size()]), null);
+        // oss上只认"/",windows生成的路径分隔符全部替换为"/"
+        dirName = dirName.replaceAll("\\\\", "/");
         File localPdfFile = new File(stringJoiner.toString() + File.separator + dirName);
         BasicAttachment basicAttachment = basicAttachmentService.saveAttachmentPdf(dirName, userId);
         tbTask.setImportFileName(basicAttachment.getName());