|
|
@@ -1,7 +1,9 @@
|
|
|
package org.springblade.archive.service.impl;
|
|
|
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.itextpdf.text.*;
|
|
|
import com.itextpdf.text.pdf.BaseFont;
|
|
|
import com.itextpdf.text.pdf.PdfPCell;
|
|
|
@@ -31,6 +33,7 @@ import org.springblade.business.feign.MetadataClassificationClient;
|
|
|
import org.springblade.common.constant.ArchiveConstant;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
import org.springblade.core.oss.model.BladeFile;
|
|
|
+import org.springblade.core.redis.cache.BladeRedis;
|
|
|
import org.springblade.core.tool.utils.CollectionUtil;
|
|
|
import org.springblade.core.tool.utils.StringUtil;
|
|
|
import org.springblade.evisa.feign.EVisaClient;
|
|
|
@@ -40,12 +43,11 @@ 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;
|
|
|
-import java.util.*;
|
|
|
import java.util.List;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
@@ -71,6 +73,10 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
|
private final ArchiveTreeContractClient archiveTreeContractClient;
|
|
|
private final MetadataClassificationClient metadataClassificationClient;
|
|
|
|
|
|
+ private final BladeRedis bladeRedis;
|
|
|
+
|
|
|
+ private final static String REDIS_STR = "blade-archive-examining:";
|
|
|
+
|
|
|
/**
|
|
|
* 推送状态到前端
|
|
|
*
|
|
|
@@ -86,14 +92,18 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
|
Thread.sleep(4000L);
|
|
|
//判断报告状态
|
|
|
ArchiveExaminingReport report = this.getById(id);
|
|
|
- Integer reportStatus = report.getStatus();
|
|
|
- Integer detailStatus = report.getReportDetailStatus();
|
|
|
- //判断详情状态
|
|
|
+ statusR = report.getStatus();
|
|
|
|
|
|
- if (reportStatus != statusR || detailStatus != statusD) {
|
|
|
- webSocketServer.sendMessagesToArchive(userId + "", "true");
|
|
|
- statusR = reportStatus;
|
|
|
- statusD = detailStatus;
|
|
|
+ List<ArchiveExaminingReportDetail> list = detailService.list(Wrappers.<ArchiveExaminingReportDetail>lambdaQuery().eq(ArchiveExaminingReportDetail::getReportId, id));
|
|
|
+ //判断详情状态
|
|
|
+ JSONObject json = bladeRedis.get(REDIS_STR + id);
|
|
|
+ if(json == null){
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ json.set("list",list);
|
|
|
+ webSocketServer.sendMessagesToArchive(userId + "", json.toString());
|
|
|
+ if(json.getInt("status") == 5){
|
|
|
+ break;
|
|
|
}
|
|
|
} while (statusR != 4);
|
|
|
|
|
|
@@ -107,429 +117,479 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
|
@Async
|
|
|
@Override
|
|
|
public void getExamining(ArchiveExaminingVo vo, Long id) throws InterruptedException, DocumentException, IOException {
|
|
|
- ArchiveExaminingReport report = new ArchiveExaminingReport();
|
|
|
- report.setId(id);
|
|
|
- report.setStatus(2);
|
|
|
- this.updateById(report);
|
|
|
-
|
|
|
- //优化 获取权限表示码
|
|
|
- String authCode = archiveTreeContractClient.getAuthCode(vo.getContractId());
|
|
|
- //封装查询参数查询
|
|
|
- ArchivesAutoVO queryVo = new ArchivesAutoVO();
|
|
|
- queryVo.setProjectId(vo.getProjectId());
|
|
|
- queryVo.setContractId(vo.getContractId());
|
|
|
- queryVo.setCurrent(1);
|
|
|
- queryVo.setSize(999999999);
|
|
|
- queryVo.setIsArchive(1);
|
|
|
- queryVo.setAuthCode(authCode);
|
|
|
- //多个节点查询数据
|
|
|
- String nodeIds = vo.getNodeIds();
|
|
|
- Set<String> collect = new HashSet<>();
|
|
|
- if(StringUtils.isNotEmpty(nodeIds)){
|
|
|
- for (String s : nodeIds.split(",")) {
|
|
|
- queryVo.setNodeIds(s);
|
|
|
- //封装参数查询组卷列表
|
|
|
- IPage<ArchivesAutoVO> page = archivesAutoService.selectArchivesAutoFilePage(queryVo);
|
|
|
- List<ArchivesAutoVO> records = page.getRecords();
|
|
|
- if(CollectionUtil.isNotEmpty(records)){
|
|
|
- collect.addAll(records.stream().map(ArchivesAutoVO::getId).map(String::valueOf).collect(Collectors.toSet()));
|
|
|
+ try {
|
|
|
+ ArchiveExaminingReport report = new ArchiveExaminingReport();
|
|
|
+ report.setId(id);
|
|
|
+ report.setStatus(2);
|
|
|
+ this.updateById(report);
|
|
|
+
|
|
|
+ //优化 获取权限表示码
|
|
|
+ String authCode = archiveTreeContractClient.getAuthCode(vo.getContractId());
|
|
|
+ //封装查询参数查询
|
|
|
+ ArchivesAutoVO queryVo = new ArchivesAutoVO();
|
|
|
+ queryVo.setProjectId(vo.getProjectId());
|
|
|
+ queryVo.setContractId(vo.getContractId());
|
|
|
+ queryVo.setCurrent(1);
|
|
|
+ queryVo.setSize(999999999);
|
|
|
+ queryVo.setIsArchive(1);
|
|
|
+ queryVo.setAuthCode(authCode);
|
|
|
+ //多个节点查询数据
|
|
|
+ String nodeIds = vo.getNodeIds();
|
|
|
+ Set<String> collect = new HashSet<>();
|
|
|
+ if(StringUtils.isNotEmpty(nodeIds)){
|
|
|
+ for (String s : nodeIds.split(",")) {
|
|
|
+ queryVo.setNodeIds(s);
|
|
|
+ //封装参数查询组卷列表
|
|
|
+ IPage<ArchivesAutoVO> page = archivesAutoService.selectArchivesAutoFilePage(queryVo);
|
|
|
+ List<ArchivesAutoVO> records = page.getRecords();
|
|
|
+ if(CollectionUtil.isNotEmpty(records)){
|
|
|
+ collect.addAll(records.stream().map(ArchivesAutoVO::getId).map(String::valueOf).collect(Collectors.toSet()));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- //选中的指定文件也加入进来
|
|
|
- if(StringUtils.isNotEmpty(vo.getFileIds())){
|
|
|
- Set<String> collect1 = Arrays.stream(vo.getFileIds().split(",")).collect(Collectors.toSet());
|
|
|
- collect.addAll(collect1);
|
|
|
- }
|
|
|
- List<ArchiveFile> files = new ArrayList<>();
|
|
|
- if(CollectionUtil.isNotEmpty(collect)){
|
|
|
- //类型转换
|
|
|
- List<String> strings = new ArrayList<>(collect);
|
|
|
- //根据组件id查询文件数据
|
|
|
- files = archiveFileClient.getAllArchiveFileByArchiveIds(strings);
|
|
|
- }
|
|
|
- //文件类型范围
|
|
|
- List<String> strings = new ArrayList<>();
|
|
|
- strings.add("pdf");
|
|
|
- strings.add("dwg");
|
|
|
- strings.add("jpg");
|
|
|
- strings.add("png");
|
|
|
- //不合格对象
|
|
|
- List<Map<String, String>> mapList = new ArrayList<>();
|
|
|
- //1-1 电签验证
|
|
|
- int unqualifiedCount = 0;
|
|
|
- //1-2 一致性检测
|
|
|
- int consistency = 0;
|
|
|
- //1-5 对设定值域的元数据项值域符合度检测
|
|
|
- int metadataCompliance = 0;
|
|
|
- //1-6 对元数据项数据重复性检测
|
|
|
- int metadataRepeat = 0;
|
|
|
- //1-8 信息包一致性检测
|
|
|
- int infoConsistency = 0;
|
|
|
- //2-3 对元数据项完整性检测
|
|
|
- int metadataComplete = 0;
|
|
|
- //2-4 对元数据项必填项
|
|
|
- int metadataRequiredField = 0;
|
|
|
-
|
|
|
- //3-1 文件格式
|
|
|
- int fileType = 0;
|
|
|
- //3-2 文件是否能够访问
|
|
|
- int fileIsAccess = 0;
|
|
|
- //3-5 信息包加密
|
|
|
- int infoEncryption = 0;
|
|
|
- //4-1 病毒检测
|
|
|
- int virusDetection = 0;
|
|
|
- //4-3 病毒安装
|
|
|
- int virusInstall = 0;
|
|
|
-
|
|
|
- //检测中 文件为空,不允许检测
|
|
|
- if(CollectionUtil.isNotEmpty(files)){
|
|
|
- Map<Integer,String> storageTypeMap = new HashMap<>();
|
|
|
- storageTypeMap.put(1,"a");
|
|
|
- storageTypeMap.put(2,"b");
|
|
|
- storageTypeMap.put(3,"c");
|
|
|
- storageTypeMap.put(4,"d");
|
|
|
- storageTypeMap.put(5,"e");
|
|
|
- storageTypeMap.put(7,"f");
|
|
|
- storageTypeMap.put(6,"g");
|
|
|
- storageTypeMap.put(8,"h");
|
|
|
- storageTypeMap.put(9,"i");
|
|
|
- //获取nodeId 查询节点信息
|
|
|
- Map<String, List<ArchiveFile>> collect2 = files.stream().collect(Collectors.groupingBy(ArchiveFile::getNodeId));
|
|
|
- List<Long> collect11 = collect2.keySet().stream().map(String::trim).filter(s -> !s.isEmpty()).map(Long::valueOf).collect(Collectors.toList());
|
|
|
- List<ArchiveTreeContract> archiveTreeContractListByList = archiveTreeContractClient.getArchiveTreeContractListByList(collect11);
|
|
|
- //获取所有的元数据配置项
|
|
|
- List<MetadataClassification> metadataClassification = metadataClassificationClient.getMetadataClassification();
|
|
|
- //组装数据,节点与元数据配置型的映射关系
|
|
|
- HashMap<Long, List<MetadataClassification>> longStringHashMap = new HashMap<>();
|
|
|
- archiveTreeContractListByList.forEach(f -> {
|
|
|
- List<MetadataClassification> collect1 = metadataClassification.stream().filter(e -> e.getFileStorageType().contains(storageTypeMap.get(f.getStorageType()))).collect(Collectors.toList());
|
|
|
- longStringHashMap.put(f.getId(),collect1);
|
|
|
- });
|
|
|
- for (ArchiveFile file : files) {
|
|
|
- //当前文件父节点对应的元数据配置项
|
|
|
- List<MetadataClassification> metadataClassifications = longStringHashMap.get(Long.valueOf(file.getNodeId()));
|
|
|
- //获取文件元数据项
|
|
|
- List<HashMap<String, Object>> list = metadataClassificationClient.getMetadaFileByFileId(file.getId());
|
|
|
- //优先检查文件是否可读
|
|
|
- if(StringUtils.isEmpty(file.getPdfFileUrl())
|
|
|
- || !validateWithHead(file.getPdfFileUrl())
|
|
|
- || StringUtils.isEmpty(file.getFileUrl())
|
|
|
- || !validateWithHead(file.getFileUrl())){
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子档案内容数据的可读性检测");
|
|
|
- map.put("unqualifiedObject", file.getFileName());
|
|
|
- mapList.add(map);
|
|
|
- fileIsAccess++;
|
|
|
- continue;
|
|
|
+ //选中的指定文件也加入进来
|
|
|
+ if(StringUtils.isNotEmpty(vo.getFileIds())){
|
|
|
+ Set<String> collect1 = Arrays.stream(vo.getFileIds().split(",")).collect(Collectors.toSet());
|
|
|
+ collect.addAll(collect1);
|
|
|
+ }
|
|
|
+ List<ArchiveFile> files = new ArrayList<>();
|
|
|
+ if(CollectionUtil.isNotEmpty(collect)){
|
|
|
+ //类型转换
|
|
|
+ List<String> strings = new ArrayList<>(collect);
|
|
|
+ //根据组件id查询文件数据
|
|
|
+ files = archiveFileClient.getAllArchiveFileByArchiveIds(strings);
|
|
|
+ }
|
|
|
+ //文件类型范围
|
|
|
+ List<String> strings = new ArrayList<>();
|
|
|
+ strings.add("pdf");
|
|
|
+ strings.add("dwg");
|
|
|
+ strings.add("jpg");
|
|
|
+ strings.add("png");
|
|
|
+ //不合格对象
|
|
|
+ List<Map<String, String>> mapList = new ArrayList<>();
|
|
|
+ //1-1 电签验证
|
|
|
+ int unqualifiedCount = 0;
|
|
|
+ //1-2 一致性检测
|
|
|
+ int consistency = 0;
|
|
|
+ //1-5 对设定值域的元数据项值域符合度检测
|
|
|
+ int metadataCompliance = 0;
|
|
|
+ //1-6 对元数据项数据重复性检测
|
|
|
+ int metadataRepeat = 0;
|
|
|
+ //1-8 信息包一致性检测
|
|
|
+ int infoConsistency = 0;
|
|
|
+ //2-3 对元数据项完整性检测
|
|
|
+ int metadataComplete = 0;
|
|
|
+ //2-4 对元数据项必填项
|
|
|
+ int metadataRequiredField = 0;
|
|
|
+
|
|
|
+ //3-1 文件格式
|
|
|
+ int fileType = 0;
|
|
|
+ //3-2 文件是否能够访问
|
|
|
+ int fileIsAccess = 0;
|
|
|
+ //3-5 信息包加密
|
|
|
+ int infoEncryption = 0;
|
|
|
+ //4-1 病毒检测
|
|
|
+ int virusDetection = 0;
|
|
|
+ //4-3 病毒安装
|
|
|
+ int virusInstall = 0;
|
|
|
+
|
|
|
+ //检测中 文件为空,不允许检测
|
|
|
+ if(CollectionUtil.isNotEmpty(files)){
|
|
|
+ Map<Integer,String> storageTypeMap = new HashMap<>();
|
|
|
+ storageTypeMap.put(1,"a");
|
|
|
+ storageTypeMap.put(2,"b");
|
|
|
+ storageTypeMap.put(3,"c");
|
|
|
+ storageTypeMap.put(4,"d");
|
|
|
+ storageTypeMap.put(5,"e");
|
|
|
+ storageTypeMap.put(7,"f");
|
|
|
+ storageTypeMap.put(6,"g");
|
|
|
+ storageTypeMap.put(8,"h");
|
|
|
+ storageTypeMap.put(9,"i");
|
|
|
+ //获取nodeId 查询节点信息
|
|
|
+ Map<String, List<ArchiveFile>> collect2 = files.stream().collect(Collectors.groupingBy(ArchiveFile::getNodeId));
|
|
|
+ List<Long> collect11 = collect2.keySet().stream().map(String::trim).filter(s -> !s.isEmpty()).map(Long::valueOf).collect(Collectors.toList());
|
|
|
+ List<ArchiveTreeContract> archiveTreeContractListByList = archiveTreeContractClient.getArchiveTreeContractListByList(collect11);
|
|
|
+ //获取所有的元数据配置项
|
|
|
+ List<MetadataClassification> metadataClassification = metadataClassificationClient.getMetadataClassification();
|
|
|
+ //组装数据,节点与元数据配置型的映射关系
|
|
|
+ HashMap<Long, List<MetadataClassification>> longStringHashMap = new HashMap<>();
|
|
|
+ archiveTreeContractListByList.forEach(f -> {
|
|
|
+ List<MetadataClassification> collect1 = metadataClassification.stream().filter(e -> e.getFileStorageType().contains(storageTypeMap.get(f.getStorageType()))).collect(Collectors.toList());
|
|
|
+ longStringHashMap.put(f.getId(),collect1);
|
|
|
+ });
|
|
|
+ //开始检测
|
|
|
+ JSONObject json = bladeRedis.get(REDIS_STR + id);
|
|
|
+ if(json == null){
|
|
|
+ json = new JSONObject();
|
|
|
+ json.set("success",0);
|
|
|
}
|
|
|
- //真实性
|
|
|
- if (StringUtils.isNotBlank(vo.getAuthenticity()) && "1".equals(vo.getAuthenticity())) {
|
|
|
- //获取文件数字摘要
|
|
|
- RemoteFileMD5Calculator.MD5Result fileUrL = RemoteFileMD5Calculator.getRemoteFileMD5FromHeaders(file.getFileUrl());
|
|
|
- RemoteFileMD5Calculator.MD5Result pdfFileUrl = RemoteFileMD5Calculator.getRemoteFileMD5FromHeaders(file.getPdfFileUrl());
|
|
|
- String fileMd5 = fileUrL.getMd5Hash();
|
|
|
- String pdfMd5 = pdfFileUrl.getMd5Hash();
|
|
|
- if(vo.getAuthenticityList().contains("1")){
|
|
|
- //检测项目下所有工序资料PDF签章有效性
|
|
|
- CertBeanVO cb = eVisaClient.onlineCheckSeal(file.getPdfFileUrl());
|
|
|
- //数字摘要判断和电签
|
|
|
- if (cb == null || !file.getFileMd5().equals(fileMd5) || !file.getPdfMd5().equals(pdfMd5)) {
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对固化信息有效性检测");
|
|
|
- map.put("unqualifiedObject", file.getFileName());
|
|
|
- mapList.add(map);
|
|
|
- unqualifiedCount++;
|
|
|
- }
|
|
|
+ json.set("number",files.size());
|
|
|
+ json.set("status",2);
|
|
|
+ bladeRedis.setEx(REDIS_STR + id,json,300L);
|
|
|
+ for (ArchiveFile file : files) {
|
|
|
+ json = bladeRedis.get(REDIS_STR + id);
|
|
|
+ if(json == null){
|
|
|
+ json = new JSONObject();
|
|
|
+ json.set("success",0);
|
|
|
+ json.set("status",2);
|
|
|
+ json.set("number",files.size());
|
|
|
}
|
|
|
- if(vo.getAuthenticityList().contains("2")){
|
|
|
- if (!file.getFileMd5().equals(fileMd5) || !file.getPdfMd5().equals(pdfMd5)) {
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对固化信息有效性检测");
|
|
|
- map.put("unqualifiedObject", file.getFileName());
|
|
|
- mapList.add(map);
|
|
|
- consistency++;
|
|
|
- }
|
|
|
- }
|
|
|
- if(vo.getAuthenticityList().contains("3")){}
|
|
|
- if(vo.getAuthenticityList().contains("4")){}
|
|
|
- if(vo.getAuthenticityList().contains("5")){
|
|
|
- //获取元数据
|
|
|
- if(CollectionUtil.isEmpty(list) ){
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对设定值域的元数据项值域符合度检测");
|
|
|
- map.put("unqualifiedObject", file.getFileName());
|
|
|
- mapList.add(map);
|
|
|
- metadataCompliance++;
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
+ //当前文件父节点对应的元数据配置项
|
|
|
+ List<MetadataClassification> metadataClassifications = longStringHashMap.get(Long.valueOf(file.getNodeId()));
|
|
|
+ //获取文件元数据项
|
|
|
+ List<HashMap<String, Object>> list = metadataClassificationClient.getMetadaFileByFileId(file.getId());
|
|
|
+ //优先检查文件是否可读
|
|
|
+ if(StringUtils.isEmpty(file.getPdfFileUrl())
|
|
|
+ || !validateWithHead(file.getPdfFileUrl())
|
|
|
+ || StringUtils.isEmpty(file.getFileUrl())
|
|
|
+ || !validateWithHead(file.getFileUrl())){
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子档案内容数据的可读性检测");
|
|
|
+ map.put("unqualifiedObject", file.getFileName());
|
|
|
+ mapList.add(map);
|
|
|
+ fileIsAccess++;
|
|
|
+ json.set("success",json.getInt("success") + 1);
|
|
|
+ bladeRedis.setEx(REDIS_STR + id,json,300L);
|
|
|
+ continue;
|
|
|
}
|
|
|
- if(vo.getAuthenticityList().contains("6")){
|
|
|
- //获取元数据
|
|
|
- if(CollectionUtil.isEmpty(list)){
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项数据重复性检测");
|
|
|
- map.put("unqualifiedObject", file.getFileName());
|
|
|
- mapList.add(map);
|
|
|
- metadataRepeat++;
|
|
|
- }else{
|
|
|
- List<String> data = new ArrayList<>();
|
|
|
- HashMap<String, Object> stringObjectHashMap = list.get(0);
|
|
|
- for (MetadataClassification classification : metadataClassifications) {
|
|
|
- String fieldKey = classification.getFieldKey();
|
|
|
- data.add(stringObjectHashMap.get(fieldKey).toString());
|
|
|
+ //真实性
|
|
|
+ if (StringUtils.isNotBlank(vo.getAuthenticity()) && "1".equals(vo.getAuthenticity())) {
|
|
|
+ //获取文件数字摘要
|
|
|
+ RemoteFileMD5Calculator.MD5Result fileUrL = RemoteFileMD5Calculator.getRemoteFileMD5FromHeaders(file.getFileUrl());
|
|
|
+ RemoteFileMD5Calculator.MD5Result pdfFileUrl = RemoteFileMD5Calculator.getRemoteFileMD5FromHeaders(file.getPdfFileUrl());
|
|
|
+ String fileMd5 = fileUrL.getMd5Hash();
|
|
|
+ String pdfMd5 = pdfFileUrl.getMd5Hash();
|
|
|
+ if(vo.getAuthenticityList().contains("1")){
|
|
|
+ //检测项目下所有工序资料PDF签章有效性
|
|
|
+ CertBeanVO cb = eVisaClient.onlineCheckSeal(file.getPdfFileUrl());
|
|
|
+ //数字摘要判断和电签
|
|
|
+ if (cb == null || !file.getFileMd5().equals(fileMd5) || !file.getPdfMd5().equals(pdfMd5)) {
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对固化信息有效性检测");
|
|
|
+ map.put("unqualifiedObject", file.getFileName());
|
|
|
+ mapList.add(map);
|
|
|
+ unqualifiedCount++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(vo.getAuthenticityList().contains("2")){
|
|
|
+ if (!file.getFileMd5().equals(fileMd5) || !file.getPdfMd5().equals(pdfMd5)) {
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对固化信息有效性检测");
|
|
|
+ map.put("unqualifiedObject", file.getFileName());
|
|
|
+ mapList.add(map);
|
|
|
+ consistency++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(vo.getAuthenticityList().contains("3")){}
|
|
|
+ if(vo.getAuthenticityList().contains("4")){}
|
|
|
+ if(vo.getAuthenticityList().contains("5")){
|
|
|
+ //获取元数据
|
|
|
+ if(CollectionUtil.isEmpty(list) ){
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对设定值域的元数据项值域符合度检测");
|
|
|
+ map.put("unqualifiedObject", file.getFileName());
|
|
|
+ mapList.add(map);
|
|
|
+ metadataCompliance++;
|
|
|
}
|
|
|
- HashSet<String> strings1 = new HashSet<>(data);
|
|
|
- //存在重复数据
|
|
|
- if(data.size() != strings1.size()){
|
|
|
+
|
|
|
+ }
|
|
|
+ if(vo.getAuthenticityList().contains("6")){
|
|
|
+ //获取元数据
|
|
|
+ if(CollectionUtil.isEmpty(list)){
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项数据重复性检测");
|
|
|
map.put("unqualifiedObject", file.getFileName());
|
|
|
mapList.add(map);
|
|
|
metadataRepeat++;
|
|
|
+ }else{
|
|
|
+ List<String> data = new ArrayList<>();
|
|
|
+ HashMap<String, Object> stringObjectHashMap = list.get(0);
|
|
|
+ for (MetadataClassification classification : metadataClassifications) {
|
|
|
+ String fieldKey = classification.getFieldKey();
|
|
|
+ data.add(stringObjectHashMap.get(fieldKey).toString());
|
|
|
+ }
|
|
|
+ HashSet<String> strings1 = new HashSet<>(data);
|
|
|
+ //存在重复数据
|
|
|
+ if(data.size() != strings1.size()){
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项数据重复性检测");
|
|
|
+ map.put("unqualifiedObject", file.getFileName());
|
|
|
+ mapList.add(map);
|
|
|
+ metadataRepeat++;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
- if(vo.getAuthenticityList().contains("7")){}
|
|
|
- if(vo.getAuthenticityList().contains("8")){
|
|
|
- if(!file.getFileMd5().equals(fileMd5) || !file.getPdfMd5().equals(pdfMd5)){
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对固化信息有效性检测");
|
|
|
- map.put("unqualifiedObject", file.getFileName());
|
|
|
- mapList.add(map);
|
|
|
- infoConsistency++;
|
|
|
}
|
|
|
- }
|
|
|
- if(vo.getAuthenticityList().contains("9")){}
|
|
|
- if(vo.getAuthenticityList().contains("10")){}
|
|
|
- report.setReportDetailStatus(1);
|
|
|
- this.updateById(report);
|
|
|
- }
|
|
|
- //完整性
|
|
|
- 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")){
|
|
|
- //获取元数据
|
|
|
- if(CollectionUtil.isEmpty(list)){
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项完整性检测");
|
|
|
- map.put("unqualifiedObject", file.getFileName());
|
|
|
- mapList.add(map);
|
|
|
- metadataComplete++;
|
|
|
- }else{
|
|
|
- //元数据
|
|
|
- HashMap<String, Object> stringObjectHashMap = list.get(0);
|
|
|
- //元数据项
|
|
|
- List<String> collect1 = metadataClassifications.stream().map(MetadataClassification::getFieldKey).collect(Collectors.toList());
|
|
|
- Set<String> strings2 = stringObjectHashMap.keySet();
|
|
|
- //元数据项是否缺失
|
|
|
- if(!strings2.containsAll(collect1)){
|
|
|
+ if(vo.getAuthenticityList().contains("7")){}
|
|
|
+ if(vo.getAuthenticityList().contains("8")){
|
|
|
+ if(!file.getFileMd5().equals(fileMd5) || !file.getPdfMd5().equals(pdfMd5)){
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
- map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项完整性检测");
|
|
|
+ map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对固化信息有效性检测");
|
|
|
map.put("unqualifiedObject", file.getFileName());
|
|
|
mapList.add(map);
|
|
|
- metadataComplete++;
|
|
|
+ infoConsistency++;
|
|
|
}
|
|
|
}
|
|
|
+ if(vo.getAuthenticityList().contains("9")){}
|
|
|
+ if(vo.getAuthenticityList().contains("10")){}
|
|
|
+ report.setReportDetailStatus(1);
|
|
|
+ this.updateById(report);
|
|
|
}
|
|
|
- if(vo.getIntegralityList().contains("4")){
|
|
|
- //获取元数据
|
|
|
- if(CollectionUtil.isEmpty(list)){
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据必填项检测");
|
|
|
- map.put("unqualifiedObject", file.getFileName());
|
|
|
- mapList.add(map);
|
|
|
- metadataRequiredField++;
|
|
|
- }else{
|
|
|
- //元数据
|
|
|
- HashMap<String, Object> stringObjectHashMap = list.get(0);
|
|
|
- //元数据项-必选项
|
|
|
- List<String> collect1 = metadataClassifications.stream().filter(f -> f.getMandatoryType() == 1).map(MetadataClassification::getFieldKey).collect(Collectors.toList());
|
|
|
- for (String s : collect1) {
|
|
|
- Object o = stringObjectHashMap.get(s);
|
|
|
- //必选项没有值
|
|
|
- if(o == null){
|
|
|
+ //完整性
|
|
|
+ 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")){
|
|
|
+ //获取元数据
|
|
|
+ if(CollectionUtil.isEmpty(list)){
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项完整性检测");
|
|
|
+ map.put("unqualifiedObject", file.getFileName());
|
|
|
+ mapList.add(map);
|
|
|
+ metadataComplete++;
|
|
|
+ }else{
|
|
|
+ //元数据
|
|
|
+ HashMap<String, Object> stringObjectHashMap = list.get(0);
|
|
|
+ //元数据项
|
|
|
+ List<String> collect1 = metadataClassifications.stream().map(MetadataClassification::getFieldKey).collect(Collectors.toList());
|
|
|
+ Set<String> strings2 = stringObjectHashMap.keySet();
|
|
|
+ //元数据项是否缺失
|
|
|
+ if(!strings2.containsAll(collect1)){
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
- map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据必填项检测");
|
|
|
+ map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项完整性检测");
|
|
|
map.put("unqualifiedObject", file.getFileName());
|
|
|
mapList.add(map);
|
|
|
- metadataRequiredField++;
|
|
|
- break;
|
|
|
+ metadataComplete++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if(vo.getIntegralityList().contains("4")){
|
|
|
+ //获取元数据
|
|
|
+ if(CollectionUtil.isEmpty(list)){
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据必填项检测");
|
|
|
+ map.put("unqualifiedObject", file.getFileName());
|
|
|
+ mapList.add(map);
|
|
|
+ metadataRequiredField++;
|
|
|
+ }else{
|
|
|
+ //元数据
|
|
|
+ HashMap<String, Object> stringObjectHashMap = list.get(0);
|
|
|
+ //元数据项-必选项
|
|
|
+ List<String> collect1 = metadataClassifications.stream().filter(f -> f.getMandatoryType() == 1).map(MetadataClassification::getFieldKey).collect(Collectors.toList());
|
|
|
+ for (String s : collect1) {
|
|
|
+ Object o = stringObjectHashMap.get(s);
|
|
|
+ //必选项没有值
|
|
|
+ if(o == null){
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据必填项检测");
|
|
|
+ map.put("unqualifiedObject", file.getFileName());
|
|
|
+ mapList.add(map);
|
|
|
+ metadataRequiredField++;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- if(vo.getIntegralityList().contains("5")){}
|
|
|
- if(vo.getIntegralityList().contains("6")){}
|
|
|
- if(vo.getIntegralityList().contains("7")){}
|
|
|
- if(vo.getIntegralityList().contains("8")){}
|
|
|
- report.setReportDetailStatus(2);
|
|
|
- this.updateById(report);
|
|
|
- }
|
|
|
- //可用性
|
|
|
- if (StringUtils.isNotBlank(vo.getUsability()) && "1".equals(vo.getUsability())) {
|
|
|
- Thread.sleep(5000L);
|
|
|
- if(vo.getUsabilityList().contains("1")){
|
|
|
- //获取文件后缀,后缀为
|
|
|
- String fileExtensionFromUrl = RemoteFileExtension.getFileExtensionFromUrl(file.getPdfFileUrl());
|
|
|
- if(StringUtils.isEmpty(fileExtensionFromUrl) || !strings.contains(fileExtensionFromUrl)){
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子文件格式检测");
|
|
|
- map.put("unqualifiedObject", file.getFileName());
|
|
|
- mapList.add(map);
|
|
|
- fileType++;
|
|
|
}
|
|
|
-
|
|
|
+ if(vo.getIntegralityList().contains("5")){}
|
|
|
+ if(vo.getIntegralityList().contains("6")){}
|
|
|
+ if(vo.getIntegralityList().contains("7")){}
|
|
|
+ if(vo.getIntegralityList().contains("8")){}
|
|
|
+ report.setReportDetailStatus(2);
|
|
|
+ this.updateById(report);
|
|
|
}
|
|
|
- //3-2 放在最开始
|
|
|
- if(vo.getUsabilityList().contains("3")){
|
|
|
+ //可用性
|
|
|
+ if (StringUtils.isNotBlank(vo.getUsability()) && "1".equals(vo.getUsability())) {
|
|
|
+ Thread.sleep(5000L);
|
|
|
+ if(vo.getUsabilityList().contains("1")){
|
|
|
+ //获取文件后缀,后缀为
|
|
|
+ String fileExtensionFromUrl = RemoteFileExtension.getFileExtensionFromUrl(file.getPdfFileUrl());
|
|
|
+ if(StringUtils.isEmpty(fileExtensionFromUrl) || !strings.contains(fileExtensionFromUrl)){
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子文件格式检测");
|
|
|
+ map.put("unqualifiedObject", file.getFileName());
|
|
|
+ mapList.add(map);
|
|
|
+ fileType++;
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- if(vo.getUsabilityList().contains("4")){
|
|
|
+ }
|
|
|
+ //3-2 放在最开始
|
|
|
+ if(vo.getUsabilityList().contains("3")){
|
|
|
|
|
|
- }
|
|
|
- if(vo.getUsabilityList().contains("5")){
|
|
|
- //文件加密压缩认证
|
|
|
- FileAnalysisResult fileAnalysisResult = null;
|
|
|
- try {
|
|
|
- fileAnalysisResult = RemoteFileSecurityChecker.analyzeRemoteFile(file.getFileUrl());
|
|
|
- } catch (IOException e) {}
|
|
|
- //是否使用公共压缩算法 是否加密
|
|
|
- if(fileAnalysisResult == null){
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项数据重复性检测");
|
|
|
- map.put("unqualifiedObject", file.getFileName());
|
|
|
- mapList.add(map);
|
|
|
- infoEncryption++;
|
|
|
}
|
|
|
- }
|
|
|
- if(vo.getUsabilityList().contains("6")){}
|
|
|
- report.setReportDetailStatus(3);
|
|
|
- this.updateById(report);
|
|
|
- }
|
|
|
- //安全性
|
|
|
- if (StringUtils.isNotBlank(vo.getSecurity()) && "1".equals(vo.getSecurity())) {
|
|
|
- if(vo.getSecurityList().contains("1")){
|
|
|
- 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++;
|
|
|
+ if(vo.getUsabilityList().contains("4")){
|
|
|
+
|
|
|
+ }
|
|
|
+ if(vo.getUsabilityList().contains("5")){
|
|
|
+ //文件加密压缩认证
|
|
|
+ FileAnalysisResult fileAnalysisResult = null;
|
|
|
+ try {
|
|
|
+ fileAnalysisResult = RemoteFileSecurityChecker.analyzeRemoteFile(file.getFileUrl());
|
|
|
+ } catch (IOException e) {}
|
|
|
+ //是否使用公共压缩算法 是否加密
|
|
|
+ if(fileAnalysisResult == null){
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项数据重复性检测");
|
|
|
+ map.put("unqualifiedObject", file.getFileName());
|
|
|
+ mapList.add(map);
|
|
|
+ infoEncryption++;
|
|
|
+ }
|
|
|
}
|
|
|
+ if(vo.getUsabilityList().contains("6")){}
|
|
|
+ report.setReportDetailStatus(3);
|
|
|
+ this.updateById(report);
|
|
|
}
|
|
|
- if(vo.getSecurityList().contains("2")){}
|
|
|
- if(vo.getSecurityList().contains("3")){
|
|
|
- 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++;
|
|
|
+ //安全性
|
|
|
+ if (StringUtils.isNotBlank(vo.getSecurity()) && "1".equals(vo.getSecurity())) {
|
|
|
+ if(vo.getSecurityList().contains("1")){
|
|
|
+ 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++;
|
|
|
+ }
|
|
|
}
|
|
|
+ if(vo.getSecurityList().contains("2")){}
|
|
|
+ if(vo.getSecurityList().contains("3")){
|
|
|
+ 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++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(vo.getSecurityList().contains("4")){}
|
|
|
+ report.setReportDetailStatus(4);
|
|
|
+ this.updateById(report);
|
|
|
}
|
|
|
- if(vo.getSecurityList().contains("4")){}
|
|
|
- report.setReportDetailStatus(4);
|
|
|
- this.updateById(report);
|
|
|
+
|
|
|
+ json.set("success",json.getInt("success") + 1);
|
|
|
+ bladeRedis.setEx(REDIS_STR + id,json,300L);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- //可用性
|
|
|
- if(StringUtils.isNotBlank(vo.getUsability()) && "1".equals(vo.getUsability())){
|
|
|
- if(vo.getUsabilityList().contains("1")){
|
|
|
- detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
|
|
|
- ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子文件格式检测", fileType, fileType == 0 ? "无" : "详见附件", fileType == 0 ? 0 : 1));
|
|
|
- }
|
|
|
- if(vo.getUsabilityList().contains("2")){
|
|
|
- detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
|
|
|
- ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子档案内容数据的可读性检测", fileIsAccess, fileIsAccess == 0 ? "无" : "详见附件", fileIsAccess == 0 ? 0 : 1));
|
|
|
- }
|
|
|
- if(vo.getUsabilityList().contains("3")){
|
|
|
- detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
|
|
|
- ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对目标数据库中的元数据可访问性检测", 0, "无", 0));
|
|
|
- }
|
|
|
- if(vo.getUsabilityList().contains("4")){
|
|
|
- detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
|
|
|
- ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包中元数据可读性检测", 0, "无", 0));
|
|
|
- }
|
|
|
- if(vo.getUsabilityList().contains("5")){
|
|
|
- detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
|
|
|
- ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包中包含的内容数据合规性检测", infoEncryption, infoEncryption == 0 ? "无" : "详见附件", infoEncryption == 0 ? 0 : 1));
|
|
|
- }
|
|
|
- }
|
|
|
- //真实性
|
|
|
- if (StringUtils.isNotBlank(vo.getAuthenticity()) && "1".equals(vo.getAuthenticity())) {
|
|
|
- if(vo.getAuthenticityList().contains("1")){
|
|
|
- detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
|
|
|
- ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对固化信息有效性检测", unqualifiedCount, unqualifiedCount == 0 ? "无" : "详见附件", unqualifiedCount == 0 ? 0 : 1));
|
|
|
- }
|
|
|
- if(vo.getAuthenticityList().contains("2")){
|
|
|
- detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
|
|
|
- ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子文件内容一致性检测", consistency, consistency == 0 ? "无" : "详见附件", consistency == 0 ? 0 : 1));
|
|
|
+ JSONObject json = bladeRedis.get(REDIS_STR + id);
|
|
|
+ if(json == null){
|
|
|
+ json = new JSONObject();
|
|
|
+ json.set("number",files.size());
|
|
|
+ json.set("success",files.size());
|
|
|
}
|
|
|
- if(vo.getAuthenticityList().contains("5")){
|
|
|
- detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
|
|
|
- ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对设定值域的元数据项值域符合度检测", metadataCompliance, metadataCompliance == 0 ? "无" : "详见附件", metadataCompliance == 0 ? 0 : 1));
|
|
|
+ json.set("status",3);
|
|
|
+ bladeRedis.setEx(REDIS_STR + id,json,300L);
|
|
|
+ //可用性
|
|
|
+ if(StringUtils.isNotBlank(vo.getUsability()) && "1".equals(vo.getUsability())){
|
|
|
+ if(vo.getUsabilityList().contains("1")){
|
|
|
+ detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
|
|
|
+ ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子文件格式检测", fileType, fileType == 0 ? "无" : "详见附件", fileType == 0 ? 0 : 1));
|
|
|
+ }
|
|
|
+ if(vo.getUsabilityList().contains("2")){
|
|
|
+ detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
|
|
|
+ ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子档案内容数据的可读性检测", fileIsAccess, fileIsAccess == 0 ? "无" : "详见附件", fileIsAccess == 0 ? 0 : 1));
|
|
|
+ }
|
|
|
+ if(vo.getUsabilityList().contains("3")){
|
|
|
+ detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
|
|
|
+ ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对目标数据库中的元数据可访问性检测", 0, "无", 0));
|
|
|
+ }
|
|
|
+ if(vo.getUsabilityList().contains("4")){
|
|
|
+ detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
|
|
|
+ ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包中元数据可读性检测", 0, "无", 0));
|
|
|
+ }
|
|
|
+ if(vo.getUsabilityList().contains("5")){
|
|
|
+ detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
|
|
|
+ ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包中包含的内容数据合规性检测", infoEncryption, infoEncryption == 0 ? "无" : "详见附件", infoEncryption == 0 ? 0 : 1));
|
|
|
+ }
|
|
|
}
|
|
|
- if(vo.getAuthenticityList().contains("6")){
|
|
|
- detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
|
|
|
- ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项数据重复性检测", metadataRepeat, metadataRepeat == 0 ? "无" : "详见附件", metadataRepeat == 0 ? 0 : 1));
|
|
|
+ //真实性
|
|
|
+ if (StringUtils.isNotBlank(vo.getAuthenticity()) && "1".equals(vo.getAuthenticity())) {
|
|
|
+ if(vo.getAuthenticityList().contains("1")){
|
|
|
+ detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
|
|
|
+ ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对固化信息有效性检测", unqualifiedCount, unqualifiedCount == 0 ? "无" : "详见附件", unqualifiedCount == 0 ? 0 : 1));
|
|
|
+ }
|
|
|
+ if(vo.getAuthenticityList().contains("2")){
|
|
|
+ detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
|
|
|
+ ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子文件内容一致性检测", consistency, consistency == 0 ? "无" : "详见附件", consistency == 0 ? 0 : 1));
|
|
|
+ }
|
|
|
+ if(vo.getAuthenticityList().contains("5")){
|
|
|
+ detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
|
|
|
+ ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对设定值域的元数据项值域符合度检测", metadataCompliance, metadataCompliance == 0 ? "无" : "详见附件", metadataCompliance == 0 ? 0 : 1));
|
|
|
+ }
|
|
|
+ if(vo.getAuthenticityList().contains("6")){
|
|
|
+ detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
|
|
|
+ ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项数据重复性检测", metadataRepeat, metadataRepeat == 0 ? "无" : "详见附件", metadataRepeat == 0 ? 0 : 1));
|
|
|
+ }
|
|
|
+ if(vo.getAuthenticityList().contains("8")){
|
|
|
+ detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
|
|
|
+ ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包一致性检测", infoConsistency, infoConsistency == 0 ? "无" : "详见附件", infoConsistency == 0 ? 0 : 1));
|
|
|
+ }
|
|
|
}
|
|
|
- if(vo.getAuthenticityList().contains("8")){
|
|
|
- detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
|
|
|
- ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包一致性检测", infoConsistency, infoConsistency == 0 ? "无" : "详见附件", infoConsistency == 0 ? 0 : 1));
|
|
|
+ //完整信
|
|
|
+ if (StringUtils.isNotBlank(vo.getIntegrality()) && "1".equals(vo.getIntegrality())) {
|
|
|
+ if(vo.getIntegralityList().contains("3")){
|
|
|
+ detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
|
|
|
+ ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项完整性检测", metadataComplete, metadataComplete == 0 ? "无" : "详见附件", metadataComplete == 0 ? 0 : 1));
|
|
|
+ }
|
|
|
+ if(vo.getIntegralityList().contains("4")){
|
|
|
+ detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
|
|
|
+ ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据必填项检测", metadataRequiredField, metadataRequiredField == 0 ? "无" : "详见附件", metadataRequiredField == 0 ? 0 : 1));
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- //完整信
|
|
|
- if (StringUtils.isNotBlank(vo.getIntegrality()) && "1".equals(vo.getIntegrality())) {
|
|
|
- if(vo.getIntegralityList().contains("3")){
|
|
|
- detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
|
|
|
- ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项完整性检测", metadataComplete, metadataComplete == 0 ? "无" : "详见附件", metadataComplete == 0 ? 0 : 1));
|
|
|
+ //安全性
|
|
|
+ if (StringUtils.isNotBlank(vo.getSecurity()) && "1".equals(vo.getSecurity())) {
|
|
|
+ if(vo.getSecurityList().contains("1")){
|
|
|
+ detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_SECURITY,
|
|
|
+ ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对病毒感染检测", virusDetection, virusDetection == 0 ? "无" : "详见附件", virusDetection == 0 ? 0 : 1));
|
|
|
+ }
|
|
|
+ if(vo.getSecurityList().contains("3")){
|
|
|
+ detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_SECURITY,
|
|
|
+ ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对系统环境中是否安装杀毒软件检测", virusInstall, virusInstall == 0 ? "无" : "详见附件", virusInstall == 0 ? 0 : 1));
|
|
|
+ }
|
|
|
}
|
|
|
- if(vo.getIntegralityList().contains("4")){
|
|
|
- detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
|
|
|
- ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据必填项检测", metadataRequiredField, metadataRequiredField == 0 ? "无" : "详见附件", metadataRequiredField == 0 ? 0 : 1));
|
|
|
+
|
|
|
+ Thread.sleep(3000L);
|
|
|
+ //生成报告,生成PDF
|
|
|
+ report.setStatus(3);
|
|
|
+ this.updateById(report);
|
|
|
+ String url = this.generateReportPdf(id);
|
|
|
+ //生成附件PDF
|
|
|
+ if (mapList.size() > 0) {
|
|
|
+ String detailPdf = this.generateReportDetailPdf(mapList);
|
|
|
+ List<String> PdfUrls = new ArrayList<>();
|
|
|
+ PdfUrls.add(url);
|
|
|
+ PdfUrls.add(detailPdf);
|
|
|
+ String localUrl = FileUtils.getSysLocalFileUrl() + "/archiveExaminingPdf/123.pdf";
|
|
|
+ //合并pdf
|
|
|
+ FileUtils.mergePdfPublicMethods(PdfUrls, localUrl);
|
|
|
+ BladeFile bladeFile = iossClient.uploadFile("123.pdf", localUrl);
|
|
|
+ report.setReportPdfUrl(bladeFile.getLink());
|
|
|
+ } else {
|
|
|
+ report.setReportPdfUrl(url);
|
|
|
}
|
|
|
- }
|
|
|
- //安全性
|
|
|
- if (StringUtils.isNotBlank(vo.getSecurity()) && "1".equals(vo.getSecurity())) {
|
|
|
- if(vo.getSecurityList().contains("1")){
|
|
|
- detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_SECURITY,
|
|
|
- ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对病毒感染检测", virusDetection, virusDetection == 0 ? "无" : "详见附件", virusDetection == 0 ? 0 : 1));
|
|
|
+ Thread.sleep(5000L);
|
|
|
+ //完成
|
|
|
+ report.setStatus(4);
|
|
|
+
|
|
|
+ json = bladeRedis.get(REDIS_STR + id);
|
|
|
+ if(json == null){
|
|
|
+ json = new JSONObject();
|
|
|
+ json.set("number",files.size());
|
|
|
+ json.set("success",files.size());
|
|
|
}
|
|
|
- if(vo.getSecurityList().contains("3")){
|
|
|
- detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_SECURITY,
|
|
|
- ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对系统环境中是否安装杀毒软件检测", virusInstall, virusInstall == 0 ? "无" : "详见附件", virusInstall == 0 ? 0 : 1));
|
|
|
+ json.set("status",4);
|
|
|
+ bladeRedis.setEx(REDIS_STR + id,json,300L);
|
|
|
+ this.updateById(report);
|
|
|
+ } catch (Exception e) {
|
|
|
+ JSONObject json = bladeRedis.get(REDIS_STR + id);
|
|
|
+ if(json == null){
|
|
|
+ json = new JSONObject();
|
|
|
}
|
|
|
+ json.set("status",5);
|
|
|
+ json.set("error",e.getMessage());
|
|
|
+ bladeRedis.setEx(REDIS_STR + id,json,300L);
|
|
|
}
|
|
|
-
|
|
|
- Thread.sleep(3000L);
|
|
|
- //生成报告,生成PDF
|
|
|
- report.setStatus(3);
|
|
|
- this.updateById(report);
|
|
|
- String url = this.generateReportPdf(id);
|
|
|
- //生成附件PDF
|
|
|
- if (mapList.size() > 0) {
|
|
|
- String detailPdf = this.generateReportDetailPdf(mapList);
|
|
|
- List<String> PdfUrls = new ArrayList<>();
|
|
|
- PdfUrls.add(url);
|
|
|
- PdfUrls.add(detailPdf);
|
|
|
- String localUrl = FileUtils.getSysLocalFileUrl() + "/archiveExaminingPdf/123.pdf";
|
|
|
- //合并pdf
|
|
|
- FileUtils.mergePdfPublicMethods(PdfUrls, localUrl);
|
|
|
- BladeFile bladeFile = iossClient.uploadFile("123.pdf", localUrl);
|
|
|
- report.setReportPdfUrl(bladeFile.getLink());
|
|
|
- } else {
|
|
|
- report.setReportPdfUrl(url);
|
|
|
- }
|
|
|
- Thread.sleep(5000L);
|
|
|
- //完成
|
|
|
- report.setStatus(4);
|
|
|
- this.updateById(report);
|
|
|
}
|
|
|
|
|
|
/**
|