Quellcode durchsuchen

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

lvy vor 2 Tagen
Ursprung
Commit
bc5e8df0a6
16 geänderte Dateien mit 1025 neuen und 118 gelöschten Zeilen
  1. 20 0
      blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/vo/ArchiveExaminingVo.java
  2. 4 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/MetadataClassificationClient.java
  3. 59 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/InventoryUnitChange.java
  4. 5 0
      blade-service/blade-archive/pom.xml
  5. 3 6
      blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveExaminingReportController.java
  6. 361 108
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveExaminingReportImpl.java
  7. 48 0
      blade-service/blade-archive/src/main/java/org/springblade/archive/utils/ClamAVClientScanner.java
  8. 33 0
      blade-service/blade-archive/src/main/java/org/springblade/archive/utils/RemoteFileExtension.java
  9. 306 0
      blade-service/blade-archive/src/main/java/org/springblade/archive/utils/RemoteFileMD5Calculator.java
  10. 7 0
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/MetadataClassificationClientImpl.java
  11. 3 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/IMetadataClassificationService.java
  12. 4 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/MetadataClassificationServiceImpl.java
  13. 16 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  14. 4 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeContractController.java
  15. 107 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorMeter.java
  16. 45 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/utils/InventoryUCUtil.java

+ 20 - 0
blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/vo/ArchiveExaminingVo.java

@@ -12,6 +12,8 @@ import lombok.Data;
 public class ArchiveExaminingVo {
     @ApiModelProperty("项目ID")
     private Long projectId;
+    @ApiModelProperty("合同段ID")
+    private Long contractId;
 
     @ApiModelProperty("报告ID")
     private Long reportId;
@@ -19,12 +21,30 @@ public class ArchiveExaminingVo {
     @ApiModelProperty("真实性")
     private String authenticity;
 
+    @ApiModelProperty("真实性-检测项")
+    private String authenticityList;
+
     @ApiModelProperty("完整性")
     private String integrality;
 
+    @ApiModelProperty("完整性-检测项")
+    private String integralityList;
+
     @ApiModelProperty("可用性")
     private String usability;
 
+    @ApiModelProperty("可用性-检测项")
+    private String usabilityList;
+
     @ApiModelProperty("安全性")
     private String security;
+
+    @ApiModelProperty("安全性-检测项")
+    private String securityList;
+
+    @ApiModelProperty("节点")
+    private String nodeIds;
+
+    @ApiModelProperty("文件")
+    private String fileIds;
 }

+ 4 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/MetadataClassificationClient.java

@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -32,4 +33,7 @@ public interface MetadataClassificationClient {
 
     @PostMapping(API_PREFIX + "/createMetadataFiles")
     boolean createMetadataFiles(@RequestBody List<Long> fileId);
+
+    @PostMapping(API_PREFIX + "/getMetadaFileByFileId")
+    List<HashMap<String, Object>> getMetadaFileByFileId(Long id);
 }

+ 59 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/InventoryUnitChange.java

@@ -0,0 +1,59 @@
+package org.springblade.manager.vo;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class InventoryUnitChange implements DataModel{
+    public static final String ID="20380000000";
+    public static final String TBN="IUC";
+    public static final String TBN_CH="清单工程量变更一览表";
+    @JSONField(name = "key_0",label="清单编号",ordinal = 1)
+    private String inventoryNum;
+    @JSONField(name = "key_1",label="项目编号")
+    private String formNumber;
+    @JSONField(name = "key_2",label="项目内容",ordinal = 2)
+    private String itemName;
+    @JSONField(name = "key_3",label="计量单位",ordinal = 3)
+    private String unit;
+    @JSONField(name = "key_4",label="合同清单数量(单价)",ordinal = 4)
+    private String contractInventoryPrice;
+    @JSONField(name = "key_5",label="合同清单数量(工程量)",ordinal = 5)
+    private String contractInventoryUnit;
+    @JSONField(name = "key_6",label="合同清单数量(金额)",ordinal = 6)
+    private String contractInventoryAmount;
+    @JSONField(name = "key_7",label="到本期末变更后(单价)",ordinal = 7)
+    private String afterChangePeriodPrice;
+    @JSONField(name = "key_8",label="到本期末变更后(工程量)",ordinal = 8)
+    private String afterChangePeriodUnit;
+    @JSONField(name = "key_9",label="到本期末变更后(金额)",ordinal = 9)
+    private String afterChangePeriodAmount;
+    @JSONField(name = "key_10",label="到本期末变更累计(数量)",ordinal = 10)
+    private String ChangeEndPeriodUnit;
+    @JSONField(name = "key_11",label="到本期末变更累计(金额)",ordinal = 11)
+    private String ChangeEndPeriodAmount;
+    @JSONField(name = "key_12",label="本期变更(数量)",ordinal = 12)
+    private String ChangePeriodUnit;
+    @JSONField(name = "key_13",label="本期变更(金额)",ordinal = 13)
+    private String ChangePeriodAmount;
+    @JSONField(name = "key_14",label="批准文号",ordinal = 14)
+    private String changeApprovalNumber;
+    @JSONField(name = "key_69",label="共N页" ,ordinal = 101)
+    private String pageTotal;
+    @JSONField(name = "key_68",label="第N页" ,ordinal = 101)
+    private String pageIndex;
+    /**是否是汇总小结数据,输出的时候显示,计算的时候不参与*/
+    private Boolean isSummary=false;
+    /**计算的时候控制正负属性*/
+    private BigDecimal invertState=BigDecimal.ONE;
+    public InventoryUnitChange(String itemName) {
+        this.itemName = itemName;
+    }
+
+    public InventoryUnitChange() {
+    }
+
+
+}

+ 5 - 0
blade-service/blade-archive/pom.xml

@@ -177,6 +177,11 @@
             <artifactId>pdfbox</artifactId>
             <version>2.0.24</version>
         </dependency>
+        <dependency>
+            <groupId>xyz.capybara</groupId>
+            <artifactId>clamav-client</artifactId>
+            <version>2.1.2</version>
+        </dependency>
     </dependencies>
 
     <build>

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

@@ -17,10 +17,7 @@ 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.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.io.IOException;
 import java.time.LocalDateTime;
@@ -82,9 +79,9 @@ public class ArchiveExaminingReportController {
         return R.data(-1);
     }
 
-    @GetMapping("/getExamining")
+    @PostMapping("/getExamining")
     @ApiOperation(value = "档案四性检测")
-    public R getExamining(ArchiveExaminingVo vo) throws InterruptedException, IOException, DocumentException {
+    public R getExamining(@RequestBody ArchiveExaminingVo vo) throws InterruptedException, IOException, DocumentException {
 
         //如果id为0则为一键检测,不为0则有报告正在进行
         if (vo.getReportId() == 0) {

+ 361 - 108
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveExaminingReportImpl.java

@@ -1,45 +1,55 @@
 package org.springblade.archive.service.impl;
 
-import com.alibaba.fastjson.JSON;
-import com.aliyun.oss.OSSClient;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.itextpdf.text.*;
 import com.itextpdf.text.pdf.BaseFont;
 import com.itextpdf.text.pdf.PdfPCell;
 import com.itextpdf.text.pdf.PdfPTable;
 import com.itextpdf.text.pdf.PdfWriter;
 import lombok.AllArgsConstructor;
+import lombok.var;
 import org.apache.commons.lang.StringUtils;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.HttpHead;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
 import org.springblade.archive.entity.ArchiveExaminingReport;
 import org.springblade.archive.entity.ArchiveExaminingReportDetail;
 import org.springblade.archive.mapper.ArchiveExaminingReportMapper;
 import org.springblade.archive.service.IArchiveExaminingReportDetailService;
 import org.springblade.archive.service.IArchiveExaminingReportService;
 import org.springblade.archive.socket.WebSocketServer;
+import org.springblade.archive.utils.ClamAVClientScanner;
 import org.springblade.archive.utils.FileUtils;
+import org.springblade.archive.utils.RemoteFileExtension;
+import org.springblade.archive.utils.RemoteFileMD5Calculator;
 import org.springblade.archive.vo.ArchiveExaminingSocketVo;
 import org.springblade.archive.vo.ArchiveExaminingVo;
+import org.springblade.archive.vo.ArchivesAutoVO;
 import org.springblade.business.entity.ArchiveFile;
+import org.springblade.business.entity.MetadataClassification;
 import org.springblade.business.feign.ArchiveFileClient;
+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.secure.BladeUser;
-import org.springblade.core.secure.utils.AuthUtil;
-import org.springblade.core.secure.utils.SecureUtil;
+import org.springblade.core.tool.utils.CollectionUtil;
 import org.springblade.core.tool.utils.StringUtil;
 import org.springblade.evisa.feign.EVisaClient;
 import org.springblade.evisa.vo.CertBeanVO;
+import org.springblade.manager.entity.ArchiveTreeContract;
+import org.springblade.manager.feign.ArchiveTreeContractClient;
 import org.springblade.resource.feign.NewIOSSClient;
-import org.springblade.resource.feign.NewISmsClient;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
+import xyz.capybara.clamav.commands.scan.result.ScanResult;
 
-import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.*;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @Param
@@ -59,6 +69,11 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
 
     private final EVisaClient eVisaClient;
 
+    private final ArchivesAutoServiceImpl archivesAutoService;
+
+    private final ArchiveTreeContractClient archiveTreeContractClient;
+    private final MetadataClassificationClient metadataClassificationClient;
+
     /**
      * 推送状态到前端
      *
@@ -99,112 +114,329 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
         report.setId(id);
         report.setStatus(2);
         this.updateById(report);
-        //获取项目中所有档案文件的工序资料pdfUrl
-        List<ArchiveFile> files = archiveFileClient.getAllPdfFileUrlByProjectIdAndFileType(vo.getProjectId());
+
+        //优化 获取权限表示码
+        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;
-        //检测中
-        //真实性
-        if (StringUtils.isNotBlank(vo.getAuthenticity()) && "1".equals(vo.getAuthenticity())) {
-            //检测项目下所有工序资料PDF签章有效性
+        //1-2 一致性检测
+        int consistency = 0;
+        //1-5 对设定值域的元数据项值域符合度检测
+        int metadataCompliance = 0;
+        //1-6 对元数据项数据重复性检测
+        int metadataRepeat = 0;
+        //2-3 对元数据项完整性检测
+        int metadataComplete = 0;
+        //2-4 对元数据项必填项
+        int metadataRequiredField = 0;
+
+        //3-1 文件格式
+        int fileType = 0;
+        //3-2 文件是否能够访问
+        int fileIsAccess = 0;
+        //4-1 病毒检测
+        int virusDetection = 0;
+        //4-3 病毒安装
+        int virusInstall = 0;
+
+        //检测中 文件为空,不允许检测
+        if(CollectionUtil.isNotEmpty(files)){
+            Map<Integer,String> storageTypeMap = new HashMap<>();
+            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) {
-                if (StringUtils.isNotBlank(file.getPdfFileUrl())) {
-                    CertBeanVO cb = eVisaClient.onlineCheckSeal(file.getPdfFileUrl());
-                    if (cb == null) {
-                        Map<String, String> map = new HashMap<>();
-                        map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对固化信息有效性检测");
-                        map.put("unqualifiedObject", file.getFileName());
-                        mapList.add(map);
-                        unqualifiedCount++;
+                //当前文件父节点对应的元数据配置项
+                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())){
+                    Map<String, String> map = new HashMap<>();
+                    map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子档案内容数据的可读性检测");
+                    map.put("unqualifiedObject", file.getFileName());
+                    mapList.add(map);
+                    fileIsAccess++;
+                    detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
+                            ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子档案内容数据的可读性检测", fileIsAccess, fileIsAccess == 0 ? "无" : "详见附件", fileIsAccess == 0 ? 0 : 1));
+                    continue;
+                }
+                //真实性
+                if (StringUtils.isNotBlank(vo.getAuthenticity()) && "1".equals(vo.getAuthenticity())) {
+                    //获取文件数字摘要
+                    RemoteFileMD5Calculator.MD5Result remoteFileMD5FromHeaders = RemoteFileMD5Calculator.getRemoteFileMD5FromHeaders(file.getPdfFileUrl());
+                    String md5Hash = remoteFileMD5FromHeaders.getMd5Hash();
+                    if(vo.getAuthenticityList().contains("1")){
+                        //检测项目下所有工序资料PDF签章有效性
+                        CertBeanVO cb = eVisaClient.onlineCheckSeal(file.getPdfFileUrl());
+                        //数字摘要判断和电签
+                        if (cb == null || !file.getFileName().equals(md5Hash)) {
+                            Map<String, String> map = new HashMap<>();
+                            map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对固化信息有效性检测");
+                            map.put("unqualifiedObject", file.getFileName());
+                            mapList.add(map);
+                            unqualifiedCount++;
+                        }
+                        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")){
+                        if (!file.getFileName().equals(md5Hash)) {
+                            Map<String, String> map = new HashMap<>();
+                            map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对固化信息有效性检测");
+                            map.put("unqualifiedObject", file.getFileName());
+                            mapList.add(map);
+                            consistency++;
+                        }
+                        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("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++;
+                        }
+                        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")){
+                        //获取元数据
+                        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++;
+                            }
+                        }
+                        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("7")){}
+                    if(vo.getAuthenticityList().contains("8")){
+                        //TODO
+                        detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
+                                ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包一致性检测", 0, "无", 0));
+                    }
+                    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.getAuthenticityList().contains("1")){}
+                    if(vo.getAuthenticityList().contains("2")){}
+                    if(vo.getAuthenticityList().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("unqualifiedObject", file.getFileName());
+                                mapList.add(map);
+                                metadataComplete++;
+                            }
+                        }
+                        detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
+                                ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项完整性检测",  metadataComplete, metadataComplete == 0 ? "无" : "详见附件", metadataComplete == 0 ? 0 : 1));
+                    }
+                    if(vo.getAuthenticityList().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;
+                                }
+                            }
+                        }
+                        detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
+                                ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据必填项检测", metadataRequiredField, metadataRequiredField == 0 ? "无" : "详见附件", metadataRequiredField == 0 ? 0 : 1));
                     }
+                    if(vo.getAuthenticityList().contains("5")){}
+                    if(vo.getAuthenticityList().contains("6")){}
+                    if(vo.getAuthenticityList().contains("7")){}
+                    if(vo.getAuthenticityList().contains("8")){}
+                    report.setReportDetailStatus(2);
+                    this.updateById(report);
+                }
+                //可用性
+                if (StringUtils.isNotBlank(vo.getUsability()) && "1".equals(vo.getUsability())) {
+                    Thread.sleep(5000L);
+                    if(vo.getAuthenticityList().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++;
+                        }
+                        detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
+                                ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子文件格式检测", fileType, fileType == 0 ? "无" : "详见附件", fileType == 0 ? 0 : 1));
+                    }
+                    //3-2 放在最开始
+                    if(vo.getAuthenticityList().contains("3")){
+                        detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
+                                ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对目标数据库中的元数据可访问性检测", 0, "无", 0));
+                    }
+                    if(vo.getAuthenticityList().contains("4")){
+                        detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
+                                ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包中元数据可读性检测", 0, "无", 0));
+                    }
+                    if(vo.getAuthenticityList().contains("5")){
+                        //TODO
+                        detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
+                                ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包中包含的内容数据合规性检测", 0, "无", 0));
+                    }
+                    if(vo.getAuthenticityList().contains("6")){}
+                    report.setReportDetailStatus(3);
+                    this.updateById(report);
+                }
+                //安全性
+                if (StringUtils.isNotBlank(vo.getSecurity()) && "1".equals(vo.getSecurity())) {
+                    if(vo.getAuthenticityList().contains("1")){
+                        ClamAVClientScanner clamAVClientScanner = new ClamAVClientScanner();
+                        if(!clamAVClientScanner.checkHealth() || !ClamAVClientScanner.scanRemoteFile(file.getPdfFileUrl())){
+                            Map<String, String> map = new HashMap<>();
+                            map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子文件格式检测");
+                            map.put("unqualifiedObject", file.getFileName());
+                            mapList.add(map);
+                            virusDetection++;
+                        }
+                        detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_SECURITY,
+                                ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对病毒感染检测", virusDetection, virusDetection == 0 ? "无" : "详见附件", virusDetection == 0 ? 0 : 1));
+                    }
+                    if(vo.getAuthenticityList().contains("2")){}
+                    if(vo.getAuthenticityList().contains("3")){
+                        ClamAVClientScanner clamAVClientScanner = new ClamAVClientScanner();
+                        if(!clamAVClientScanner.checkHealth()){
+                            Map<String, String> map = new HashMap<>();
+                            map.put("examiningItem", ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子文件格式检测");
+                            map.put("unqualifiedObject", file.getFileName());
+                            mapList.add(map);
+                            virusInstall++;
+                        }
+                        detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_SECURITY,
+                                ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对系统环境中是否安装杀毒软件检测", virusInstall, virusInstall == 0 ? "无" : "详见附件", virusInstall == 0 ? 0 : 1));
+                    }
+                    if(vo.getAuthenticityList().contains("4")){}
+                    report.setReportDetailStatus(4);
+                    this.updateById(report);
                 }
             }
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对固化信息有效性检测", unqualifiedCount, unqualifiedCount == 0 ? "无" : "详见附件", unqualifiedCount == 0 ? 0 : 1));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项数据长度检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项数据类型、格式检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对设定值域的元数据项值域符合度检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对档号规范性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对内容数据的电子属性一致性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项数据重复性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据是否关联内容数据检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包目录结构规范性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包一致性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子档案封装包规范性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子档案封装包电子前面有效性检测", 0, "无", 0));
-            report.setReportDetailStatus(1);
-            this.updateById(report);
-        }
-        if (StringUtils.isNotBlank(vo.getIntegrality()) && "1".equals(vo.getIntegrality())) {
-            Thread.sleep(5000L);
-            //完整性
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对总件数相符性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对总字节数相符性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据项完整性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对元数据必填著录项目检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对过程信息完整性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对连续性元数据项检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对内容数据完整性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对附件数据完整性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对归档范围检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包元数据完整性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包内容数据完整性检测", 0, "无", 0));
-            report.setReportDetailStatus(2);
-            this.updateById(report);
-        }
-        //可用性
-        if (StringUtils.isNotBlank(vo.getUsability()) && "1".equals(vo.getUsability())) {
-            Thread.sleep(5000L);
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包中元数据的可读性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对目标数据库中的元数据可访问下检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对内容数据格式检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对内容数据的可读性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对内容数据格式长期可用性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对软硬件环境合规性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包中包含的内容数据格式合规性检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对备份数据可恢复性检测", 0, "无", 0));
-            report.setReportDetailStatus(3);
-            this.updateById(report);
-        }
-        //安全性
-        if (StringUtils.isNotBlank(vo.getSecurity()) && "1".equals(vo.getSecurity())) {
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_SECURITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对系统环境中是否安装杀毒软件检测", 0, "无", 0));
-            detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_SECURITY,
-                    ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对病毒感染检测", 0, "无", 0));
-            report.setReportDetailStatus(4);
-            this.updateById(report);
         }
         Thread.sleep(3000L);
         //生成报告,生成PDF
@@ -217,8 +449,8 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
             List<String> PdfUrls = new ArrayList<>();
             PdfUrls.add(url);
             PdfUrls.add(detailPdf);
-            String localUrl = "/www/wwwroot/Users/hongchuangyanfa/Desktop/archiveExaminingPdf/123.pdf";
-//            String localUrl = "D:\\develop\\test\\123.pdf";
+//            String localUrl = "/www/wwwroot/Users/hongchuangyanfa/Desktop/archiveExaminingPdf/123.pdf";
+            String localUrl = "D:\\tools\\html\\123.pdf";
             //合并pdf
             FileUtils.mergePdfPublicMethods(PdfUrls, localUrl);
             BladeFile bladeFile = iossClient.uploadFile("123.pdf", localUrl);
@@ -422,4 +654,25 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
         }
         return pdfPCell;
     }
+
+    public static boolean validateWithHead(String fileUrl) {
+        try (CloseableHttpClient client = HttpClients.createDefault()) {
+            HttpHead request = new HttpHead(fileUrl);
+
+            // 设置超时配置
+            RequestConfig config = RequestConfig.custom()
+                    .setConnectTimeout(5000)
+                    .setSocketTimeout(5000)
+                    .build();
+            request.setConfig(config);
+
+            try (var response = client.execute(request)) {
+                int statusCode = response.getStatusLine().getStatusCode();
+                return statusCode >= 200 && statusCode < 300;
+            }
+        } catch (Exception e) {
+            System.out.println("验证失败: " + e.getMessage());
+            return false;
+        }
+    }
 }

+ 48 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/utils/ClamAVClientScanner.java

@@ -0,0 +1,48 @@
+package org.springblade.archive.utils;
+
+import xyz.capybara.clamav.ClamavClient;
+import xyz.capybara.clamav.commands.scan.result.ScanResult;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+/**
+ * 病毒检测类
+ * @author LHB
+ */
+public class ClamAVClientScanner {
+
+    public static boolean scanRemoteFile(String fileUrl) throws IOException {
+        // 创建ClamAV客户端,默认连接本地3310端口
+        ClamavClient client = new ClamavClient("localhost", 3310);
+
+        // 从远程URL下载文件
+        URL url = new URL(fileUrl);
+        try (InputStream inputStream = url.openStream()) {
+            // 扫描输入流
+            ScanResult result = client.scan(inputStream);
+
+            // 根据结果类型判断
+            if (result instanceof ScanResult.OK) {
+                return true;
+            } else if (result instanceof ScanResult.VirusFound) {
+                return false;
+            } else {
+                return false;
+            }
+        }
+    }
+
+    public boolean checkHealth() {
+        ClamavClient client = new ClamavClient("localhost", 3310);
+        try {
+            client.ping();
+            System.out.println("ClamAV服务正常运行");
+            return true;
+        } catch (Exception e) {
+            System.err.println("ClamAV服务不可用: " + e.getMessage());
+            return false;
+        }
+    }
+}

+ 33 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/utils/RemoteFileExtension.java

@@ -0,0 +1,33 @@
+package org.springblade.archive.utils;
+
+import java.net.URL;
+import java.nio.file.Paths;
+
+/**
+ * @author LHB
+ */
+public class RemoteFileExtension {
+    public static String getFileExtensionFromUrl(String fileUrl) {
+        try {
+            URL url = new URL(fileUrl);
+            String path = url.getPath();
+
+            // 处理可能包含查询参数的情况
+            int questionMarkIndex = path.indexOf('?');
+            if (questionMarkIndex != -1) {
+                path = path.substring(0, questionMarkIndex);
+            }
+
+            // 使用 Paths 获取文件名并提取后缀
+            String fileName = Paths.get(path).getFileName().toString();
+
+            int lastDotIndex = fileName.lastIndexOf('.');
+            if (lastDotIndex > 0 && lastDotIndex < fileName.length() - 1) {
+                return fileName.substring(lastDotIndex + 1).toLowerCase();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+}

+ 306 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/utils/RemoteFileMD5Calculator.java

@@ -0,0 +1,306 @@
+package org.springblade.archive.utils;
+
+import lombok.Data;
+
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+public class RemoteFileMD5Calculator {
+
+    private static final int BUFFER_SIZE = 64 * 1024; // 64KB
+    private static final int CONNECT_TIMEOUT = 10000; // 10秒
+    private static final int READ_TIMEOUT = 30000; // 30秒
+
+    /**
+     * 下载远程文件并计算MD5
+     */
+    public static MD5Result calculateRemoteFileMD5(String fileUrl) {
+        return calculateRemoteFileMD5(fileUrl, null);
+    }
+
+    public static MD5Result calculateRemoteFileMD5(String fileUrl, ProgressListener progressListener) {
+        HttpURLConnection connection = null;
+        InputStream inputStream = null;
+
+        try {
+            URL url = new URL(fileUrl);
+            connection = (HttpURLConnection) url.openConnection();
+            connection.setRequestMethod("GET");
+            connection.setConnectTimeout(CONNECT_TIMEOUT);
+            connection.setReadTimeout(READ_TIMEOUT);
+
+            // 设置请求头
+            connection.setRequestProperty("User-Agent",
+                    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36");
+
+            int responseCode = connection.getResponseCode();
+            if (responseCode != HttpURLConnection.HTTP_OK) {
+                return new MD5Result(null, false, "HTTP错误: " + responseCode + " - " + connection.getResponseMessage(),0);
+            }
+
+            long contentLength = connection.getContentLengthLong();
+            String contentType = connection.getContentType();
+
+            System.out.println("开始下载文件: " + fileUrl);
+            System.out.println("文件大小: " + formatFileSize(contentLength));
+            System.out.println("Content-Type: " + contentType);
+
+            inputStream = connection.getInputStream();
+            MessageDigest md = MessageDigest.getInstance("MD5");
+
+            byte[] buffer = new byte[BUFFER_SIZE];
+            int bytesRead;
+            long totalBytesRead = 0;
+            long lastProgressUpdate = 0;
+
+            if (progressListener != null) {
+                progressListener.onStart(contentLength);
+            }
+
+            while ((bytesRead = inputStream.read(buffer)) != -1) {
+                md.update(buffer, 0, bytesRead);
+                totalBytesRead += bytesRead;
+
+                // 更新进度
+                if (progressListener != null) {
+                    long currentTime = System.currentTimeMillis();
+                    if (totalBytesRead - lastProgressUpdate >= 1024 * 1024 || // 每1MB更新一次
+                            totalBytesRead == contentLength) {
+
+                        double progress = contentLength > 0 ?
+                                (double) totalBytesRead / contentLength * 100 : 0;
+                        long elapsedTime = currentTime - progressListener.getStartTime();
+                        double speed = elapsedTime > 0 ?
+                                (double) totalBytesRead / elapsedTime * 1000 : 0;
+
+                        progressListener.onProgress(totalBytesRead, contentLength, progress, speed);
+                        lastProgressUpdate = totalBytesRead;
+                    }
+                }
+            }
+
+            byte[] digest = md.digest();
+            String md5Hash = bytesToHex(digest);
+
+            if (progressListener != null) {
+                progressListener.onComplete(md5Hash, totalBytesRead);
+            }
+
+            return new MD5Result(md5Hash, true, "下载并计算成功", contentLength);
+
+        } catch (Exception e) {
+            return new MD5Result(null, false, "错误: " + e.getMessage(), 0);
+        } finally {
+            if (inputStream != null) {
+                try {
+                    inputStream.close();
+                } catch (IOException e) {
+                    System.err.println("关闭输入流时出错: " + e.getMessage());
+                }
+            }
+            if (connection != null) {
+                connection.disconnect();
+            }
+        }
+    }
+
+    /**
+     * 获取远程文件的MD5(如果服务器提供ETag或Content-MD5头部)
+     */
+    public static MD5Result getRemoteFileMD5FromHeaders(String fileUrl) {
+        HttpURLConnection connection = null;
+
+        try {
+            URL url = new URL(fileUrl);
+            connection = (HttpURLConnection) url.openConnection();
+            connection.setRequestMethod("HEAD"); // 只请求头部信息
+            connection.setConnectTimeout(CONNECT_TIMEOUT);
+            connection.setReadTimeout(READ_TIMEOUT);
+
+            connection.setRequestProperty("User-Agent",
+                    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36");
+
+            int responseCode = connection.getResponseCode();
+            if (responseCode != HttpURLConnection.HTTP_OK) {
+                return new MD5Result(null, false,
+                        "HTTP错误: " + responseCode + " - " + connection.getResponseMessage());
+            }
+
+            // 检查常见的MD5相关头部
+            String etag = connection.getHeaderField("ETag");
+            String contentMD5 = connection.getHeaderField("Content-MD5");
+            String contentLength = connection.getHeaderField("Content-Length");
+
+            System.out.println("ETag: " + etag);
+            System.out.println("Content-MD5: " + contentMD5);
+            System.out.println("Content-Length: " + contentLength);
+
+            // 尝试从ETag提取MD5(常见格式:"md5-hash" 或 "md5-hash-extra")
+            if (etag != null) {
+                // 移除引号
+                etag = etag.replace("\"", "");
+
+                // 检查是否是MD5格式(32位十六进制)
+                if (etag.matches("[a-fA-F0-9]{32}")) {
+                    return new MD5Result(etag.toLowerCase(), true,
+                            "从ETag头部获取", Long.parseLong(contentLength != null ? contentLength : "0"));
+                }
+
+                // 检查是否包含MD5(如:"5d41402abc4b2a76b9719d911017c592-gzip")
+                if (etag.length() >= 32) {
+                    String possibleMD5 = etag.substring(0, 32);
+                    if (possibleMD5.matches("[a-fA-F0-9]{32}")) {
+                        return new MD5Result(possibleMD5.toLowerCase(), true,
+                                "从ETag提取", Long.parseLong(contentLength != null ? contentLength : "0"));
+                    }
+                }
+            }
+
+            // 直接使用Content-MD5(需要Base64解码)
+            if (contentMD5 != null) {
+                try {
+                    byte[] md5Bytes = java.util.Base64.getDecoder().decode(contentMD5);
+                    String md5Hash = bytesToHex(md5Bytes);
+                    return new MD5Result(md5Hash, true,
+                            "从Content-MD5头部获取", Long.parseLong(contentLength != null ? contentLength : "0"));
+                } catch (IllegalArgumentException e) {
+                    System.out.println("Content-MD5 Base64解码失败: " + e.getMessage());
+                }
+            }
+
+            return new MD5Result(null, false,
+                    "服务器未提供MD5信息", Long.parseLong(contentLength != null ? contentLength : "0"));
+
+        } catch (Exception e) {
+            return new MD5Result(null, false, "错误: " + e.getMessage(), 0);
+        } finally {
+            if (connection != null) {
+                connection.disconnect();
+            }
+        }
+    }
+
+    /**
+     * 字节数组转十六进制字符串
+     */
+    private static String bytesToHex(byte[] bytes) {
+        StringBuilder hexString = new StringBuilder(bytes.length * 2);
+        for (byte b : bytes) {
+            String hex = Integer.toHexString(0xff & b);
+            if (hex.length() == 1) {
+                hexString.append('0');
+            }
+            hexString.append(hex);
+        }
+        return hexString.toString();
+    }
+
+    /**
+     * 格式化文件大小
+     */
+    private static String formatFileSize(long size) {
+        if (size < 1024) return size + " B";
+        if (size < 1024 * 1024) return String.format("%.2f KB", size / 1024.0);
+        if (size < 1024 * 1024 * 1024) return String.format("%.2f MB", size / (1024.0 * 1024.0));
+        return String.format("%.2f GB", size / (1024.0 * 1024.0 * 1024.0));
+    }
+
+    /**
+     * 进度监听器接口
+     */
+    public interface ProgressListener {
+        void onStart(long totalSize);
+        void onProgress(long bytesRead, long totalSize, double progress, double speedBytesPerSec);
+        void onComplete(String md5Hash, long totalBytesProcessed);
+        long getStartTime();
+    }
+
+    /**
+     * 默认进度监听器
+     */
+    public static class DefaultProgressListener implements ProgressListener {
+        private long startTime;
+
+        @Override
+        public void onStart(long totalSize) {
+            this.startTime = System.currentTimeMillis();
+            System.out.println("开始下载,文件大小: " + formatFileSize(totalSize));
+        }
+
+        @Override
+        public void onProgress(long bytesRead, long totalSize, double progress, double speedBytesPerSec) {
+            String progressBar = createProgressBar(progress, 20);
+            System.out.printf("\r%s [%s] %.2f%% | 速度: %s/s",
+                    progressBar,
+                    formatFileSize(bytesRead) + "/" + formatFileSize(totalSize),
+                    progress,
+                    formatFileSize((long) speedBytesPerSec));
+        }
+
+        @Override
+        public void onComplete(String md5Hash, long totalBytesProcessed) {
+            long endTime = System.currentTimeMillis();
+            long elapsedTime = endTime - startTime;
+            System.out.printf("\n下载完成! 耗时: %.2f秒 | MD5: %s\n",
+                    elapsedTime / 1000.0, md5Hash);
+        }
+
+        @Override
+        public long getStartTime() {
+            return startTime;
+        }
+
+        private String createProgressBar(double progress, int length) {
+            int filledLength = (int) (progress / 100 * length);
+            StringBuilder bar = new StringBuilder();
+            for (int i = 0; i < length; i++) {
+                if (i < filledLength) {
+                    bar.append("=");
+                } else if (i == filledLength) {
+                    bar.append(">");
+                } else {
+                    bar.append(" ");
+                }
+            }
+            return bar.toString();
+        }
+    }
+
+    /**
+     * MD5计算结果封装
+     */
+    @Data
+    public static class MD5Result {
+        public final String md5Hash;
+        public final boolean success;
+        public final String message;
+        public final long fileSize;
+
+        public MD5Result(String md5Hash, boolean success, String message, long fileSize) {
+            this.md5Hash = md5Hash;
+            this.success = success;
+            this.message = message;
+            this.fileSize = fileSize;
+        }
+        public MD5Result(String md5Hash, boolean success, String message) {
+            this.md5Hash = md5Hash;
+            this.success = success;
+            this.message = message;
+            this.fileSize = 0;
+        }
+
+        @Override
+        public String toString() {
+            StringBuilder sb = new StringBuilder();
+            sb.append("=== 远程文件MD5计算结果 ===\n");
+            sb.append("文件大小: ").append(formatFileSize(fileSize)).append("\n");
+            sb.append("计算状态: ").append(success ? "成功" : "失败").append("\n");
+            sb.append("MD5值: ").append(md5Hash != null ? md5Hash : "N/A").append("\n");
+            sb.append("信息: ").append(message);
+            return sb.toString();
+        }
+    }
+}

+ 7 - 0
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/MetadataClassificationClientImpl.java

@@ -8,6 +8,8 @@ import org.springblade.business.vo.MetadataClassificationVO;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -42,4 +44,9 @@ public class MetadataClassificationClientImpl implements MetadataClassificationC
     public boolean createMetadataFiles(List<Long> fileIds){
         return iMetadataClassificationService.createMetadataFiles(fileIds, 0);
     }
+
+    @Override
+    public List<HashMap<String, Object>> getMetadaFileByFileId(Long id) {
+        return iMetadataClassificationService.getMetadaFileByFileId(id);
+    }
 }

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

@@ -5,6 +5,7 @@ import org.springblade.business.entity.MetadataClassification;
 import org.springblade.business.vo.MetadataClassificationVO;
 import org.springblade.core.mp.base.BaseService;
 
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -28,4 +29,6 @@ public interface IMetadataClassificationService extends BaseService<MetadataClas
     List<MetadataClassification> getMetadataClassification();
 
     boolean createMetadataFiles(List<Long> fileIds, Integer type);
+
+    List<HashMap<String, Object>> getMetadaFileByFileId(Long id);
 }

+ 4 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/MetadataClassificationServiceImpl.java

@@ -1227,4 +1227,8 @@ public class MetadataClassificationServiceImpl
         return keyValue;
     }
 
+    @Override
+    public List<HashMap<String, Object>> getMetadaFileByFileId(Long id) {
+        return baseMapper.getMetadaFileByFileId(id);
+    }
 }

+ 16 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -933,14 +933,29 @@ public class ExcelTabController extends BladeController {
             if (tab != null) {
                 isWater = true;
             }
+            Elements select = table.select("el-date-picker");
 
             // 添加标题显示
             Elements trs = table.select("tr");
-            for (int i = 1; i < 6; i++) {
+            for (int i = 1; i < trs.size(); i++) {
                 Element tr = trs.get(i);
                 Elements tds = tr.select("td");
                 for (int j = 0; j < tds.size(); j++) {
                     Element data = tds.get(j);
+                    Elements select1 = data.select("el-date-picker");
+                    if(select1 != null && select1.size()>0){
+                        for (Element element : select1) {
+                            String attr = element.attr("@mouseup.right");
+                            String keyname = element.attr("keyname");
+                            String id = element.attr("id");
+                            String contextmenu = element.attr("@contextmenu.prevent.native");
+                            data.attr("@mouseup.right",attr);
+                            data.attr("keyname",keyname);
+                            data.attr("id",id);
+                            data.attr("@contextmenu.prevent.native",contextmenu);
+                        }
+                    }
+
                     String style = data.attr("style");
                     if (style.indexOf("font-size") >= 0) {
                         int fontsize = Integer.parseInt(style.substring(style.indexOf("font-size:") + 10, style.indexOf(".0pt")));

+ 4 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeContractController.java

@@ -734,6 +734,8 @@ public class WbsTreeContractController extends BladeController {
                             if(cell.getCellTypeEnum()==CellType.STRING){
                                 if(StringUtils.isNotEmpty(cell.getStringCellValue())){
                                     if(cell.getStringCellValue().equals("公式配置")){
+                                        // 设置单元格值为"日期框"
+                                        cell.setCellValue("公式配置,日期框");
                                         continue;
                                     }
                                 }
@@ -761,6 +763,7 @@ public class WbsTreeContractController extends BladeController {
                             if(cell.getCellTypeEnum()==CellType.STRING){
                                 if(StringUtils.isNotEmpty(cell.getStringCellValue())){
                                     if(cell.getStringCellValue().equals("公式配置")){
+                                        cell.setCellValue("公式配置,日期范围框,两日期用-分割");
                                         continue;
                                     }
                                 }
@@ -1314,7 +1317,7 @@ public class WbsTreeContractController extends BladeController {
             String key = entry.getKey();
             String value = entry.getValue()+"";
             value = value.replaceAll("\\s+", "");
-            if(StringUtils.isNotEmpty(value)&&(value.equals("公式配置")||value.equals("日期框")||value.equals("日期范围框,两日期用-分割")||value.equals("多选下拉框,如需填写选项内容,并用、分割")||value.equals("单选下拉框,如需填写选项内容,否则无法导入")||value.equals("电签配置,请勿填写数据")||value.equals("图片框,请到客户端上传")||value.equals("默认配置"))){
+            if(StringUtils.isNotEmpty(value)&&(value.equals("公式配置")||value.equals("日期框")||value.equals("日期范围框,两日期用-分割")||value.equals("多选下拉框,如需填写选项内容,并用、分割")||value.equals("单选下拉框,如需填写选项内容,否则无法导入")||value.equals("电签配置,请勿填写数据")||value.equals("图片框,请到客户端上传")||value.equals("默认配置")||value.equals("公式配置,日期框")||value.equals("公式配置,日期范围框,两日期用-分割"))){
                 continue;
             }
             Matcher matcher = pattern.matcher(key);

+ 107 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorMeter.java

@@ -12,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springblade.common.utils.BaseUtils;
 import org.springblade.manager.dto.FormEndPayDTO;
 import org.springblade.manager.entity.ChapterEndPay;
+import org.springblade.manager.utils.InventoryUCUtil;
 import org.springblade.manager.utils.PeriodContractUtil;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.oss.model.BladeFile;
@@ -28,8 +29,7 @@ import org.springblade.manager.formula.NodeTable;
 import org.springblade.manager.service.impl.FormEndPayServiceImpl;
 import org.springblade.manager.utils.FormEndPayUtil;
 import org.springblade.manager.vo.*;
-import org.springblade.meter.entity.ContractMeterPeriod;
-import org.springblade.meter.entity.InterimPayCertificateItem;
+import org.springblade.meter.entity.*;
 import org.springframework.beans.BeanUtils;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -254,6 +254,8 @@ public class ExecutorMeter extends FormulaExecutor {
             this.specialList.add(new MaterialInterimSp());
             /*材料*/
             this.specialList.add(new MaterialsArrivalSp());
+            /*清单工程量变更一览*/
+            this.specialList.add(new InventoryUC());
             /*中期支付证书*/
             this.specialList.add(new InterimPayCert());
             this.specialList.add(new InterimSum());
@@ -959,6 +961,109 @@ public class ExecutorMeter extends FormulaExecutor {
             putOut(MaterialsArrival.class);
         }
     }
+    @Data
+    @EqualsAndHashCode(callSuper = true)
+    public class  InventoryUC extends  BaseSpecial<InventoryUnitChange> implements Special{
+
+        @Override
+        public boolean ready() {
+            return MeterType.INTERIM.equals(tec.getMeterType());
+        }
+
+        @Override
+        public void parse() {
+            builderFormDatas(InventoryUnitChange.class);
+            List<ChangeTokenForm> changeTokenForms = InventoryUCUtil.getChangeTokenForm(tec.getContractId(), tec.getPeriodInfo().getStartDate(), tec.getPeriodInfo().getEndDate());
+            if(!changeTokenForms.isEmpty()){
+                List<ChangeTokenInventory> inventoryList=new ArrayList<>();
+                for (ChangeTokenForm tokenForm : changeTokenForms) {
+                    List<ChangeTokenInventory> list = InventoryUCUtil.getChangeTokenInventory(tec.getContractId(), tokenForm.getId());
+                    inventoryList.addAll(list);
+                }
+                //根据清单编号分组
+                Map<String, List<ChangeTokenInventory>> map = inventoryList.stream().filter(e -> StringUtils.isNotEmpty(e.getFormNumber())).collect(Collectors.groupingBy(ChangeTokenInventory::getFormNumber));
+                for (Map.Entry<String, List<ChangeTokenInventory>> entry : map.entrySet()) {
+                    //同一组清单编号
+                    List<ChangeTokenInventory> ChangeTokenInventoryList = entry.getValue();
+                    InventoryUnitChange change = new InventoryUnitChange();
+                    ContractInventoryForm inventoryNum = InventoryUCUtil.getInventoryNum(ChangeTokenInventoryList.get(0).getContractFormId());
+                    /*清单编号*/
+                    change.setInventoryNum(inventoryNum.getChapterNumber()+"章");
+                    /*项目编号*/
+                    change.setFormNumber(entry.getKey());
+                    /*项目内容*/
+                    change.setItemName(inventoryNum.getFormName());
+                    /*计量单位*/
+                    change.setUnit(inventoryNum.getUnit());
+                    /*合同清单数量(单价)*/
+                    change.setContractInventoryPrice(inventoryNum.getBidPrice()+"");
+                    /*合同清单数量(工程量)*/
+                    change.setContractInventoryUnit(inventoryNum.getContractTotal()+"");
+                    /*合同清单数量(金额)*/
+                    change.setContractInventoryAmount(inventoryNum.getContractMoney()+"");
+                    /*到本期末变更后(单价)*/
+                    change.setAfterChangePeriodPrice(inventoryNum.getChangePrice()+"");
+                    /*到本期末变更后(工程量)*/
+                    change.setAfterChangePeriodUnit(inventoryNum.getChangeTotal()+"");
+                    /*到本期末变更后(金额)*/
+                    change.setAfterChangePeriodAmount(inventoryNum.getChangeMoney()+"");
+                    //统计本期变更(数量) 将所有的变更数量加起来
+                    BigDecimal totalChangeUnit = ChangeTokenInventoryList.stream()
+                            .map(ChangeTokenInventory::getChangeTotal)
+                            .filter(Objects::nonNull)
+                            .reduce(BigDecimal.ZERO, BigDecimal::add);
+                    //统计本期变更(金额) 将所有的变更金额加起来 变更数量*当前单价
+                    BigDecimal totalChangeAmount = ChangeTokenInventoryList.stream()
+                            .map(item -> {
+                                BigDecimal changeTotal = item.getChangeTotal();
+                                BigDecimal currentPrice = item.getCurrentPrice();
+                                if (changeTotal != null && currentPrice != null) {
+                                    return changeTotal.multiply(currentPrice);
+                                }
+                                return BigDecimal.ZERO;
+                            })
+                            .reduce(BigDecimal.ZERO, BigDecimal::add);
+                    /*本期变更(数量)*/
+                    change.setChangePeriodUnit(totalChangeUnit+"");
+                    /*本期变更(金额)*/
+                    change.setChangePeriodAmount(totalChangeAmount+"");
+                    //变更令IDs
+                    List<Long> changeTokenIds = ChangeTokenInventoryList.stream()
+                            .map(ChangeTokenInventory::getChangeTokenId)
+                            .filter(Objects::nonNull)
+                            .distinct()
+                            .collect(Collectors.toList());
+                    //变更批复文号
+                    String changeApprovalNumber = changeTokenForms.stream().filter(e -> changeTokenIds.contains(e.getId())).map(ChangeTokenForm::getChangeApprovalNumber).filter(StringUtils::isNotEmpty).collect(Collectors.joining(","));
+                    /*批准文号*/
+                    change.setChangeApprovalNumber(changeApprovalNumber);
+                    //查询上一期的变更情况
+                    //上期期数ID
+                    Long prePeriodId = null;
+                    List<ContractMeterPeriod> contractMeterPeriodList =FormEndPayUtil.selectList(tec.getContractId());
+                    if(contractMeterPeriodList.size()>0){
+                        OptionalInt index=IntStream.range(0, contractMeterPeriodList.size())
+                                .filter(i -> contractMeterPeriodList.get(i).getId().equals(tec.getPeriodId()))
+                                .findFirst();
+                        //i大于0 说明需要有上期
+                        if(index.isPresent()){
+                            int j = index.getAsInt();
+                            if(j>0){
+                                prePeriodId=contractMeterPeriodList.get(j-1).getId();
+                            }
+                        }
+                    }
+                    if(prePeriodId!=null){
+
+                    }
+                    //获取上一期的到本期末变更数量
+
+                    //获取上一期的到本期末变更金额
+                }
+                putOut();
+            }
+        }
+    }
 
     @Data
     @EqualsAndHashCode(callSuper = true)

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

@@ -0,0 +1,45 @@
+package org.springblade.manager.utils;
+
+import org.springblade.meter.entity.ChangeTokenForm;
+import org.springblade.meter.entity.ChangeTokenInventory;
+import org.springblade.meter.entity.ContractInventoryForm;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.stereotype.Component;
+
+import java.time.LocalDate;
+import java.util.List;
+
+@Component
+public class InventoryUCUtil {
+    private static JdbcTemplate jdbcTemplate;
+
+    public static ContractInventoryForm getInventoryNum(Long contractFormId) {
+        String sql="select * from s_contract_inventory_form where id ="+contractFormId;
+        return jdbcTemplate.queryForObject(sql,new BeanPropertyRowMapper<>(ContractInventoryForm.class));
+    }
+
+    @Autowired
+    public  void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
+        InventoryUCUtil.jdbcTemplate = jdbcTemplate;
+    }
+
+    // 获取当前期变更令
+    public static List<ChangeTokenForm> getChangeTokenForm(Long contractId, LocalDate startDate, LocalDate endDate) {
+        String sql = "SELECT * FROM s_change_token_form where contract_id=" + contractId +
+                " and command_status=1 and is_deleted=0 and business_date>='"+startDate+"' and business_date<='"+endDate+"'";
+        return jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(ChangeTokenForm.class));
+    }
+    //获取当前变更令所用到的清单
+    public static List<ChangeTokenInventory> getChangeTokenInventory(Long contractId, Long changeTokenId){
+       String sql="select * from s_change_token_inventory where contract_id ="+contractId+" and change_token_id="+changeTokenId+" and is_deleted = 0 and is_collect_form = 0";
+       return jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(ChangeTokenInventory.class));
+    }
+
+
+
+
+
+
+}