浏览代码

档案文件检测

lvy 3 天之前
父节点
当前提交
a4a4bc1852

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

@@ -5623,13 +5623,11 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 			}
 			String url = "";
 			if (file.getPdfFileUrl() != null && file.getPdfFileUrl().contains("http")) {
-				url = file.getFileUrl();
-			} else if (file.getFileUrl() != null && file.getFileUrl().contains("http")) {
 				url = file.getPdfFileUrl();
+			} else if (file.getFileUrl() != null && file.getFileUrl().contains("http")) {
+				url = file.getFileUrl();
 			}
-			if (url == null || !url.endsWith(".pdf")) {
-				checkStatus += ",3";
-			} else {
+			if (url.endsWith(".pdf")) {
 				if (checkPdf) {
 					int lastIndexOf = url.lastIndexOf("/");
 					String prefix = url.substring(0, lastIndexOf + 1);
@@ -5651,8 +5649,9 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 								checkStatus += ",6";
 							}
 						}
-					} catch (Exception e) {
-						checkStatus += ",3";
+					} catch (Throwable e) {
+						e.printStackTrace();
+						checkStatus += ",6";
 					}
 				}
 			}

+ 3 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ArchiveFileServiceImpl.java

@@ -98,6 +98,9 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A
                     }
                 });
             }
+            if (vos.getCheckStatus() !=  null && (vos.getCheckStatus().trim().equals("-1") || vos.getCheckStatus().trim().equals("0"))) {
+                vos.setCheckStatus("");
+            }
             fileIds.append(vos.getId() + ",");
         });
         if (vo.getRectification() != null && (vo.getRectification() == 1 || vo.getRectification() == 2)) {

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ArchiveTreeContractMapper.xml

@@ -274,7 +274,7 @@
         d.archive_name_suffix,
         d.contract_id,
         IFNULL(SUM(file_counts.count), 0) AS tree_number,
-        file_counts.check_status AS check_status,
+        if(sum(file_counts.check_status) > 0, 1, 0) AS check_status,
         (SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_archive_tree_contract WHERE parent_id = d.id and is_deleted = 0 and project_id = #{projectId}) AS "has_children"
         FROM
         m_archive_tree_contract d