فهرست منبع

本地部署生成pdf调整

wangliang 3 سال پیش
والد
کامیت
db9c5b1e98

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

@@ -114,7 +114,7 @@ public class TBSyncTaskServiceImpl extends ServiceImpl<TBSyncTaskMapper, TBSyncT
     public IPage<SyncListResult> query(Long schoolId, TaskStatusEnum status, PushTypeEnum type, TaskResultEnum result, int pageNumber, int pageSize) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
-        ;
+
         IPage<SyncListResult> page = this.baseMapper.query(new Page<>(pageNumber, pageSize), schoolId, status, type, result, sysUser.getId(), orgIds);
         List<SyncListResult> list = page.getRecords();
         for (SyncListResult syncListResult : list) {

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

@@ -28,6 +28,7 @@ import com.qmth.teachcloud.common.annotation.ExcelDBFieldDesc;
 import com.qmth.teachcloud.common.base.BaseEntity;
 import com.qmth.teachcloud.common.bean.dto.excel.*;
 import com.qmth.teachcloud.common.bean.params.ArraysParams;
+import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.*;
 import com.qmth.teachcloud.common.enums.*;
@@ -177,6 +178,9 @@ public class TaskLogicServiceImpl implements TaskLogicService {
     @Resource
     private TeachClazzService teachClazzService;
 
+    @Resource
+    DictionaryConfig dictionaryConfig;
+
     /**
      * 创建pdf前置条件
      *
@@ -399,7 +403,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                                 int mod = seq % examTaskDetail.getDrawCount();
                                 String tempPaperType = paperTypes.get(mod);
                                 BasicAttachment basicAttachment = createPdfUtil.examStudentHtml(cardContent, null, tempPaperType, examDetail, examDetailCourse, sysUser.getId(), studentCardPdfList, basicCardRule);
-                                ;
+
                                 if (!stringBasicAttachmentMap.containsKey(tempPaperType)) {
                                     stringBasicAttachmentMap.put(tempPaperType, basicAttachment);
                                     JSONObject object = new JSONObject();
@@ -597,7 +601,9 @@ public class TaskLogicServiceImpl implements TaskLogicService {
 //            createPdfUtil.deleteAttachment(attachmentIds, ftlList);
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
-            basicAttachmentService.batchDeleteAttachment(basicAttachmentList);
+            if (dictionaryConfig.sysDomain().isOss()) {
+                basicAttachmentService.batchDeleteAttachment(basicAttachmentList);
+            }
             if (e instanceof ApiException) {
                 ResultUtil.error((ApiException) e, e.getMessage());
             } else {

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

@@ -833,13 +833,15 @@ public class CreatePdfUtil {
             fileStoreUtil.ossUpload(dirNameCardA3, localA3PdfCardFile, DigestUtils.md5Hex(new FileInputStream(localA3PdfCardFile)), fileStoreUtil.getUploadEnumByPath(dirNameCardA3).getFssType());
             localA3PdfCardFile.delete();
         }
-        if (Objects.nonNull(localA4PdfFile)) {
+        if (Objects.nonNull(localA4PdfFile) && oss) {
             localA4PdfFile.delete();
         }
         //删除题卡临时文件
-        for (PdfDto pdfDto : mergePdfDeleteList) {
-            if (Objects.nonNull(pdfDto)) {
-                new File(pdfDto.getPath()).delete();
+        if (oss) {
+            for (PdfDto pdfDto : mergePdfDeleteList) {
+                if (Objects.nonNull(pdfDto)) {
+                    new File(pdfDto.getPath()).delete();
+                }
             }
         }
 //        for (PdfDto pdfDto : mergePdfA3List) {

+ 1 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/PushTypeEnum.java

@@ -16,7 +16,7 @@ public enum PushTypeEnum {
 
     STRUCTURE_GROUP_PUSH("试卷结构、分组、评卷员绑定关系数据推送"),
 
-    PAPER_ANSWER_FILE_PUSH("试卷、标文件推送"),
+    PAPER_ANSWER_FILE_PUSH("试卷、标文件推送"),
 
     OBJECTIVE_ANSWER_PUSH("客观题答案推送"),