|
|
@@ -10,6 +10,7 @@ import com.itextpdf.text.pdf.PdfPCell;
|
|
|
import com.itextpdf.text.pdf.PdfPTable;
|
|
|
import com.itextpdf.text.pdf.PdfWriter;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import lombok.var;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.apache.http.client.config.RequestConfig;
|
|
|
@@ -56,6 +57,7 @@ import java.util.stream.Collectors;
|
|
|
* @Date 2023/4/20 17:36
|
|
|
**/
|
|
|
@Service
|
|
|
+@Slf4j
|
|
|
@AllArgsConstructor
|
|
|
public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExaminingReportMapper, ArchiveExaminingReport> implements IArchiveExaminingReportService {
|
|
|
private final WebSocketServer webSocketServer;
|
|
|
@@ -260,6 +262,7 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
|
continue;
|
|
|
}
|
|
|
//真实性
|
|
|
+ log.info("{}正在检测真实性",file.getFileName());
|
|
|
if (StringUtils.isNotBlank(vo.getAuthenticity()) && "1".equals(vo.getAuthenticity())) {
|
|
|
//获取文件数字摘要
|
|
|
RemoteFileMD5Calculator.MD5Result fileUrL = RemoteFileMD5Calculator.getRemoteFileMD5FromHeaders(file.getFileUrl());
|
|
|
@@ -343,8 +346,8 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
|
this.updateById(report);
|
|
|
}
|
|
|
//完整性
|
|
|
+ log.info("{}正在检测完整性",file.getFileName());
|
|
|
if (StringUtils.isNotBlank(vo.getIntegrality()) && "1".equals(vo.getIntegrality())) {
|
|
|
- Thread.sleep(5000L);
|
|
|
if(vo.getIntegralityList().contains("1")){}
|
|
|
if(vo.getIntegralityList().contains("2")){}
|
|
|
if(vo.getIntegralityList().contains("3")){
|
|
|
@@ -407,8 +410,8 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
|
this.updateById(report);
|
|
|
}
|
|
|
//可用性
|
|
|
+ log.info("{}正在检测可用性",file.getFileName());
|
|
|
if (StringUtils.isNotBlank(vo.getUsability()) && "1".equals(vo.getUsability())) {
|
|
|
- Thread.sleep(5000L);
|
|
|
if(vo.getUsabilityList().contains("1")){
|
|
|
//获取文件后缀,后缀为
|
|
|
String fileExtensionFromUrl = RemoteFileExtension.getFileExtensionFromUrl(file.getPdfFileUrl());
|
|
|
@@ -448,6 +451,7 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
|
this.updateById(report);
|
|
|
}
|
|
|
//安全性
|
|
|
+ log.info("{}正在检测安全性",file.getFileName());
|
|
|
if (StringUtils.isNotBlank(vo.getSecurity()) && "1".equals(vo.getSecurity())) {
|
|
|
if(vo.getSecurityList().contains("1")){
|
|
|
if(!ClamAVClientScanner.checkHealth() || !ClamAVClientScanner.scanRemoteFile(file.getPdfFileUrl())){
|
|
|
@@ -475,6 +479,7 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
|
|
|
|
json.set("success",json.getInt("success") + 1);
|
|
|
bladeRedis.setEx(REDIS_STR + id,json,300L);
|
|
|
+ log.info("{}检测完成",file.getFileName());
|
|
|
}
|
|
|
}
|
|
|
JSONObject json = bladeRedis.get(REDIS_STR + id);
|
|
|
@@ -554,7 +559,6 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Thread.sleep(3000L);
|
|
|
//生成报告,生成PDF
|
|
|
report.setStatus(3);
|
|
|
this.updateById(report);
|
|
|
@@ -573,7 +577,6 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
|
} else {
|
|
|
report.setReportPdfUrl(url);
|
|
|
}
|
|
|
- Thread.sleep(5000L);
|
|
|
//完成
|
|
|
report.setStatus(4);
|
|
|
|