Jelajahi Sumber

增加打印

huangtf 1 tahun lalu
induk
melakukan
0b2cdbcc10

+ 13 - 10
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveAutoPdfServiceImpl.java

@@ -778,22 +778,25 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
      * @return
      */
     public String getPdfFileUrl(ArchiveFile file) {
-        //
-        String url = file.getPdfFileUrl();
-        if (StringUtil.isEmpty(url)) {
-            String fileUrl = file.getFileUrl();
-
-            if (StringUtils.isNotEmpty(fileUrl) && fileUrl.endsWith(".pdf") ) {
-                url = file.getFileUrl();
+        String url = null;
+        try {
+            if (file != null) {
+                url = file.getPdfFileUrl();
+                if (StringUtil.isEmpty(url)) {
+                    String fileUrl = file.getFileUrl();
+                    if (fileUrl != null && StringUtils.isNotEmpty(fileUrl) && fileUrl.endsWith(".pdf")) {
+                        url = fileUrl;
+                    }
+                }
             }
+        } catch (Exception e) {
+            e.printStackTrace();
         }
-
         //todo 生成相册内容,待补充
-
-
         return url;
     }
 
+
     /**
      * 刷新文件大小
      *

+ 1 - 1
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchivesAutoServiceImpl.java

@@ -700,7 +700,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 
 		if (nodeId!= null) {
 			ArchiveTreeContract node = archiveTreeContractClient.getArchiveTreeContractById(nodeId);
-			if (node!= null && node.getContractId() != null) {
+			if (node!= null && node.getContractId() != null && node.getContractId() != -1) {
 				contractId = node.getContractId();
 			}
 		}