Переглянути джерело

Merge branch 'test-merge' of http://219.151.181.73:3000/zhuwei/bladex into test-merge

lvy 4 днів тому
батько
коміт
f61ea35760

+ 7 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsFormElement.java

@@ -77,4 +77,11 @@ public class WbsFormElement extends BaseEntity {
      */
     @ApiModelProperty(value = "exid")
     private Long exid;
+
+    /**
+     * 是否辅助(1-是,0-不是)
+     */
+    @ApiModelProperty(value = "是否辅助(1-是,0-不是)")
+    private Integer assist;
+
 }

+ 6 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/SaveUserInfoByProjectVO2.java

@@ -39,4 +39,10 @@ public class SaveUserInfoByProjectVO2 implements Serializable {
     @JsonProperty(value = "roleType")
     private String roleType;
 
+    /**
+     * 角色id
+     */
+    @JsonProperty(value = "roleId")
+    private String roleId;
+
 }

+ 11 - 3
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveExaminingReportController.java

@@ -1,22 +1,21 @@
 package org.springblade.archive.controller;
 
+import cn.hutool.json.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.itextpdf.text.DocumentException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
-import lombok.extern.java.Log;
 import org.springblade.archive.entity.ArchiveExaminingReport;
 import org.springblade.archive.service.IArchiveExaminingReportService;
 import org.springblade.archive.vo.ArchiveExaminingVo;
 import org.springblade.common.utils.SnowFlakeUtil;
-import org.springblade.core.oss.model.BladeFile;
+import org.springblade.core.redis.cache.BladeRedis;
 import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.evisa.feign.EVisaClient;
 import org.springblade.evisa.vo.CertBeanVO;
-import org.springblade.resource.feign.NewIOSSClient;
 import org.springframework.web.bind.annotation.*;
 
 import java.io.IOException;
@@ -38,6 +37,9 @@ public class ArchiveExaminingReportController {
 
     private final EVisaClient eVisaClient;
 
+    private final BladeRedis bladeRedis;
+
+    private final static String REDIS_STR = "blade-archive-examining:";
     @GetMapping("test")
     public String test() throws DocumentException, IOException {
 //        BladeFile bladeFile = iossClient.uploadFile("124456sdf", "D:\\develop\\test\\test1.pdf");
@@ -95,6 +97,12 @@ public class ArchiveExaminingReportController {
             report.setCreateTime(new Date());
             report.setProjectId(vo.getProjectId());
             archiveExaminingReportService.save(report);
+            //添加缓存
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.set("status",1);
+            jsonObject.set("number",0);
+            jsonObject.set("success",0);
+            bladeRedis.setEx(REDIS_STR + id,jsonObject,300L);
             //调用四性检测方法
             archiveExaminingReportService.getExamining(vo, id);
             //调用socket,每隔3秒检测当前报告状态然后推送

+ 444 - 384
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveExaminingReportImpl.java

@@ -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);
     }
 
     /**

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TaskBatchMapper.xml

@@ -64,7 +64,7 @@
                 AND b.project_id = #{query.projectId}
             </if>
             <if test="query.contractId != null">
-                AND b.contractId = #{query.contractId}
+                AND b.contract_id = #{query.contractId}
             </if>
             <if test="query.taskName != null and query.taskName != ''">
                 AND b.name like concat('%',#{query.taskName},'%')

+ 4 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/KeyMapper.java

@@ -46,6 +46,10 @@ public class KeyMapper {
      * 公式id
      */
     private Long formulaId;
+    /**
+     * 是否为辅助字段
+     */
+    private Integer assist;
 
     public String getCode() {
         return this.tableName + StringPool.COLON + this.field;

+ 46 - 9
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorMeter.java

@@ -1262,13 +1262,42 @@ public class ExecutorMeter extends FormulaExecutor {
                              }
                          }
                          ipc.setCurrentPeriodPay(StringUtils.handleNull(currentMoney.get(cm.getKey())));
-                         ipc.setCurrentPeriodChangeMoney(StringUtils.handleNullZero(sumChangeMoneyForChapter(changeTokenList0,ch)
-                                 ,tec.getPayRadicScale()));
-                         ipc.setPreviousPeriodEndChangeMoney(StringUtils.handleNullZero(sumChangeMoneyForChapter(changeTokenList1,ch)
-                                 ,tec.getPayRadicScale()));
-                         ipc.setCurrentPeriodEndChangeMoney(StringUtils.handleNullZero(sumChangeMoneyForChapter(changeTokenList2,ch)
-                                 ,tec.getPayRadicScale()));
-
+                         //2-8公式开发前逻辑
+                         //本期变更金额
+//                         ipc.setCurrentPeriodChangeMoney(StringUtils.handleNullZero(sumChangeMoneyForChapter(changeTokenList0,ch)
+//                                 ,tec.getPayRadicScale()));
+                         //上期末变更金额
+//                         ipc.setPreviousPeriodEndChangeMoney(StringUtils.handleNullZero(sumChangeMoneyForChapter(changeTokenList1,ch)
+//                                 ,tec.getPayRadicScale()));
+                         //本期末变更金额
+//                         ipc.setCurrentPeriodEndChangeMoney(StringUtils.handleNullZero(sumChangeMoneyForChapter(changeTokenList2,ch)
+//                                 ,tec.getPayRadicScale()));
+                         //2-8公式开发后逻辑
+                         List<ChangeInventoryForm> changeInventoryForms = InventoryUCUtil.selectInventoryFormByInventoryNum(tec.getPeriodId(), tec.getContractId(), k);
+                         //本期变更金额
+                         String totalChangeMoney = changeInventoryForms.stream()
+                                 .map(form -> new BigDecimal(form.getChangeMoney()))
+                                 .reduce(BigDecimal.ZERO, BigDecimal::add)
+                                 .setScale(0, RoundingMode.HALF_UP)
+                                 .toPlainString();
+                         ipc.setCurrentPeriodChangeMoney(totalChangeMoney);
+                        if(finalPrePeriodId!=null){
+                            List<ChangeInventoryForm> preChangeInventoryForms = InventoryUCUtil.selectInventoryFormByInventoryNum(finalPrePeriodId, tec.getContractId(), k);
+                            String afterTotalChangeMoney = preChangeInventoryForms.stream()
+                                    .map(form -> new BigDecimal(form.getAfterChangeMoney()))
+                                    .reduce(BigDecimal.ZERO, BigDecimal::add)
+                                    .setScale(0, RoundingMode.HALF_UP)
+                                    .toPlainString();
+                            //上期末变更金额
+                            ipc.setPreviousPeriodEndChangeMoney(afterTotalChangeMoney);
+                            BigDecimal currentChange = BaseUtils.str2BigDecimal(totalChangeMoney);
+                            BigDecimal previousChange = BaseUtils.str2BigDecimal(afterTotalChangeMoney);
+                            //本期末变更金额
+                            ipc.setCurrentPeriodEndChangeMoney(currentChange.add(previousChange).toPlainString());
+                        }else {
+                            //本期末变更金额
+                            ipc.setCurrentPeriodEndChangeMoney(totalChangeMoney);
+                        }
                          /*计算其它属性值*/
                          ipc.calculate();
                          //dataList.add(ipc);
@@ -2202,8 +2231,16 @@ public class ExecutorMeter extends FormulaExecutor {
                 cs.setPayPercent(ratioFc.apply(cs.getCurrentPeriodEndPay(),meterAmountChange));
                 /*本期末占合合同金额 */
                 cs.setCurrentEndPayPercent(ratioFc.apply(cs.getCurrentPeriodEndPay(),meterAmount));
-                /*变更金额*/
-                cs.setChangeMoneyAll(subtractFc.apply(cs.getChangeMoney(),cs.getContractMoney()));
+                /*变更金额 2-8公式开发之前逻辑*/
+                //cs.setChangeMoneyAll(subtractFc.apply(cs.getChangeMoney(),cs.getContractMoney()));
+                List<ChangeInventoryForm> changeInventoryForms = InventoryUCUtil.selectInventoryFormByInventoryNum(tec.getPeriodId(), tec.getContractId(), k);
+                BigDecimal changeMoneyAll = changeInventoryForms.stream()
+                        .map(ChangeInventoryForm::getChangeMoney)
+                        .map(BaseUtils::str2BigDecimal)
+                        .reduce(BigDecimal.ZERO, BigDecimal::add)
+                        .setScale(0, RoundingMode.HALF_UP);  // 四舍五入保留整数
+                String changeMoneyAllWan = changeMoneyAll.divide(BigDecimal.valueOf(10000), 4, RoundingMode.HALF_UP).toPlainString();
+                cs.setChangeMoneyAll(changeMoneyAllWan);
                 dataList.add(cs);
             });
             /*每月合计进度*/

+ 4 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeMapper.xml

@@ -407,6 +407,7 @@
     <select id="selectFormElements" resultMap="wbsFormElementMap">
         select f_id,
                e_key,
+               a.assist,
                a.id,
                a.dynamic_dict,
                e_name,
@@ -425,6 +426,7 @@
         union
         select f_id,
                e_key,
+               a.assist,
                a.id,
                a.dynamic_dict,
                e_name,
@@ -445,6 +447,7 @@
         select b.id
              , IF(c.formula_id > 0, 1, 0)           globalFormula
              , b.e_name
+             , b.assist
              , e_type
              , e_length
              , e_allow_deviation
@@ -519,6 +522,7 @@
              , ci.contract_name                                          as "contractName"
              , (SELECT role_name FROM blade_role WHERE id = r.parent_id) as "roleType"
              , r.role_name                                               as "roleName"
+             , mpau.role_id                                              as "roleId"
         FROM m_project_assignment_user mpau
                  INNER JOIN blade_role r ON r.id = mpau.role_id
                  INNER JOIN m_contract_info ci ON ci.id = mpau.contract_id

+ 45 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -704,7 +704,16 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             } else {
                 List<WbsTreeContract> list = wbsTreeContractService.getBaseMapper().selectList(Wrappers.<WbsTreeContract>query().lambda().in(WbsTreeContract::getPKeyId, pkeyIds));
                 if (list.size() > 0) {
-                    list.forEach(e -> coordinateMap.computeIfAbsent(e.getInitTableName(), k -> FormulaUtils.getElementCell(e.getHtmlUrl())));
+                    list.forEach(e -> {
+                        Map<String, String> elementCell = FormulaUtils.getElementCell(e.getHtmlUrl());
+                        //扩展中间元素开发 获取字段是辅助字段  并且在html上没有这个字段
+                        List<String> collect = keyMappers.stream().filter(f -> f.getAssist() == 1
+                                && elementCell.get(f.getField()) == null).map(KeyMapper::getField).collect(Collectors.toList());
+                        collect.forEach(f->{
+                            elementCell.put(f,"0_0");
+                        });
+                        coordinateMap.computeIfAbsent(e.getInitTableName(), k -> elementCell);
+                    });
                 }
             }
         }
@@ -2009,6 +2018,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         /*需要加载表单公式的时候isFormLoading==true*/
         Document document = null;
         Map<String, Object> reData = new HashMap<>();
+        //编号
+        Map<String, Object> bhData = new HashMap<>();
 
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
@@ -2167,7 +2178,36 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                     int trindex = Integer.parseInt(element.attr("trindex"));
                     if (trindex <= 10) {
                         if (StringUtils.isNotBlank(node.getPartitionCode())) {
-                            reData.put(element.attr("keyName"), node.getPartitionCode());
+                            bhData.put(element.attr("keyName"), node.getPartitionCode());
+                        }
+                    }
+                }
+            }
+            // 编号 //编号为父节点划分编号 “编号:”、“工程编号:”、“编号”、“分项工程编号”、“分部分项编号” 优先使用自己节点,没有编码找寻父级子分项或分项节点
+            if (bhtitle.size() >= 1 && contractInfo.getIsReferenceNumber() == 2) {
+                String nodePartitionCode = "";
+                if(StringUtils.isNotEmpty(node.getPartitionCode())){
+                    nodePartitionCode=node.getPartitionCode();
+                }else {
+                    List<WbsTreeContract> list = wbsTreeContractService.getBaseMapper().selectList(Wrappers.<WbsTreeContract>query().lambda().in(WbsTreeContract::getPKeyId, node.getAncestorsPId()).in(WbsTreeContract::getNodeType, Arrays.asList(4, 5)));
+                    if(!list.isEmpty()){
+                        // 获取第一个节点类型为5的元素
+                        WbsTreeContract result = list.stream().filter(item -> item.getNodeType() == 5).findFirst().orElse(null);
+                        if(result!=null){
+                            nodePartitionCode=result.getPartitionCode();
+                        }else {
+                            WbsTreeContract result2 = list.stream().filter(item -> item.getNodeType() == 4).findFirst().orElse(null);
+                            if(result2!=null){
+                                nodePartitionCode=result2.getPartitionCode();
+                            }
+                        }
+                    }
+                }
+                for (Element element : bhtitle) {
+                    int trindex = Integer.parseInt(element.attr("trindex"));
+                    if (trindex <= 10) {
+                        if (StringUtils.isNotBlank(nodePartitionCode)) {
+                            bhData.put(element.attr("keyName"), nodePartitionCode);
                         }
                     }
                 }
@@ -2341,6 +2381,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 }
             }
         }
+        if(bhData!=null){
+            reData.putAll(bhData);
+        }
 //        if(reData.size()>0){
 //            //处理key重复导致pdf数据错位
 //            for (Iterator<Map.Entry<String, Object>> iterator = reData.entrySet().iterator(); iterator.hasNext(); ) {

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -5402,7 +5402,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
     private List<Map<String, Object>> listMap(List<Long> ids, ExecuteType type) {
         String pkIds = ids.stream().map(String::valueOf).collect(Collectors.joining(","));
         String tableName = ExecuteType.INSPECTION.equals(type) ? "m_wbs_tree_contract" : "m_wbs_tree_private";
-        return this.jdbcTemplate.queryForList(" select a.init_table_name as tableName,a.p_key_id as pkId ,c.e_key as field,c.e_name as eName,c.id  as fieldId ,c.e_type eType , e_allow_deviation as eAllowDeviation  " +
+        return this.jdbcTemplate.queryForList(" select a.init_table_name as tableName,a.p_key_id as pkId ,c.e_key as field,c.e_name as eName,c.id  as fieldId ,c.e_type eType, c.assist , e_allow_deviation as eAllowDeviation  " +
                 "from " + tableName + " a " +
                 "inner join m_table_info b on a.init_table_name=b.tab_en_name " +
                 "INNER JOIN m_wbs_form_element c on b.id=c.f_id " +

+ 6 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/utils/InventoryUCUtil.java

@@ -109,6 +109,12 @@ public class InventoryUCUtil {
         return str.matches("\\d+");
     }
 
+    //根据章节查询变更详情
+    public static List<ChangeInventoryForm> selectInventoryFormByInventoryNum(Long periodId, Long contractId, String k) {
+        String sql="select * from s_change_inventory_form where contract_id="+contractId+" and period_id="+periodId+" and inventory_num='"+k+"' and is_deleted=0";
+        return jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(ChangeInventoryForm.class));
+    }
+
     @Autowired
     public  void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
         InventoryUCUtil.jdbcTemplate = jdbcTemplate;