|
|
@@ -20,6 +20,7 @@ import org.springblade.archive.mapper.ArchiveExaminingReportMapper;
|
|
|
import org.springblade.archive.service.IArchiveExaminingReportDetailService;
|
|
|
import org.springblade.archive.service.IArchiveExaminingReportService;
|
|
|
import org.springblade.archive.socket.WebSocketServer;
|
|
|
+import org.springblade.archive.utils.ClamAVClientScanner;
|
|
|
import org.springblade.archive.utils.FileUtils;
|
|
|
import org.springblade.archive.utils.RemoteFileExtension;
|
|
|
import org.springblade.archive.utils.RemoteFileMD5Calculator;
|
|
|
@@ -42,6 +43,7 @@ import org.springblade.manager.feign.ArchiveTreeContractClient;
|
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import xyz.capybara.clamav.commands.scan.result.ScanResult;
|
|
|
|
|
|
import java.io.FileOutputStream;
|
|
|
import java.io.IOException;
|
|
|
@@ -183,6 +185,11 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
|
int fileType = 0;
|
|
|
//3-2 文件是否能够访问
|
|
|
int fileIsAccess = 0;
|
|
|
+ //4-1 病毒检测
|
|
|
+ int virusDetection = 0;
|
|
|
+ //4-3 病毒安装
|
|
|
+ int virusInstall = 0;
|
|
|
+
|
|
|
//检测中 文件为空,不允许检测
|
|
|
if(CollectionUtil.isNotEmpty(files)){
|
|
|
Map<Integer,String> storageTypeMap = new HashMap<>();
|
|
|
@@ -410,13 +417,29 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
|
//安全性
|
|
|
if (StringUtils.isNotBlank(vo.getSecurity()) && "1".equals(vo.getSecurity())) {
|
|
|
if(vo.getAuthenticityList().contains("1")){
|
|
|
+ ClamAVClientScanner clamAVClientScanner = new ClamAVClientScanner();
|
|
|
+ if(!clamAVClientScanner.checkHealth() || !ClamAVClientScanner.scanRemoteFile(file.getPdfFileUrl())){
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子文件格式检测");
|
|
|
+ map.put("unqualifiedObject", file.getFileName());
|
|
|
+ mapList.add(map);
|
|
|
+ virusDetection++;
|
|
|
+ }
|
|
|
detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_SECURITY,
|
|
|
- ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对病毒感染检测", 0, "无", 0));
|
|
|
+ ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对病毒感染检测", virusDetection, virusDetection == 0 ? "无" : "详见附件", virusDetection == 0 ? 0 : 1));
|
|
|
}
|
|
|
if(vo.getAuthenticityList().contains("2")){}
|
|
|
if(vo.getAuthenticityList().contains("3")){
|
|
|
+ ClamAVClientScanner clamAVClientScanner = new ClamAVClientScanner();
|
|
|
+ if(!clamAVClientScanner.checkHealth()){
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子文件格式检测");
|
|
|
+ map.put("unqualifiedObject", file.getFileName());
|
|
|
+ mapList.add(map);
|
|
|
+ virusInstall++;
|
|
|
+ }
|
|
|
detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_SECURITY,
|
|
|
- ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对系统环境中是否安装杀毒软件检测", 0, "无", 0));
|
|
|
+ ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对系统环境中是否安装杀毒软件检测", virusInstall, virusInstall == 0 ? "无" : "详见附件", virusInstall == 0 ? 0 : 1));
|
|
|
}
|
|
|
if(vo.getAuthenticityList().contains("4")){}
|
|
|
report.setReportDetailStatus(4);
|