瀏覽代碼

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveAutoPdfServiceImpl.java
liuyc 1 年之前
父節點
當前提交
948ecc94a8
共有 13 個文件被更改,包括 240 次插入167 次删除
  1. 21 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/InspectionRectifyDTO.java
  2. 2 1
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/RoutingInspectionDTO.java
  3. 12 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/InspectionRectify.java
  4. 1 1
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/RoutingInspection.java
  5. 2 1
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/RoutingInspectionVO2.java
  6. 122 148
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveAutoPdfServiceImpl.java
  7. 17 3
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchivesAutoServiceImpl.java
  8. 5 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/InspectionRectifyMapper.java
  9. 5 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/InspectionRectifyMapper.xml
  10. 4 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IInspectionRectifyService.java
  11. 1 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ArchiveTreeContractSyncImpl.java
  12. 8 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/InspectionRectifyServiceImpl.java
  13. 40 13
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/RoutingInspectionServiceImpl.java

+ 21 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/InspectionRectifyDTO.java

@@ -0,0 +1,21 @@
+package org.springblade.manager.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.manager.entity.InspectionRectify;
+
+import java.util.List;
+
+/**
+ * @Param
+ * @Author wangwl
+ * @Date 2023/11/3 11:45
+ **/
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class InspectionRectifyDTO extends InspectionRectify {
+
+    @ApiModelProperty(value = "检查项目集合")
+    private List<String> autoExpandKeys;
+}

+ 2 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/RoutingInspectionDTO.java

@@ -18,5 +18,6 @@ import java.util.List;
 public class RoutingInspectionDTO extends RoutingInspection {
 
     @ApiModelProperty(value = "检查项目集合")
-    private List<InspectionRectify> list;
+    private List<InspectionRectifyDTO> list;
+
 }

+ 12 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/InspectionRectify.java

@@ -46,9 +46,21 @@ public class InspectionRectify extends BaseEntity {
     @ApiModelProperty(value = "整改附件")
     private String rectifyAttachment;
 
+    @ApiModelProperty(value = "整改附件")
+    private String rectifyAttachmentName;
+
     @ApiModelProperty(value = "整改图片")
     private String rectifyPdfUrl;
 
+    @ApiModelProperty(value = "是否显示图片 0不显示1显示")
+    private String isShowImage;
+
+    @ApiModelProperty(value = "节点id")
+    private String primaryKeyId;
+
+    @ApiModelProperty(value = "检查部位")
+    private String inspectLocation;
+
 
 
 }

+ 1 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/RoutingInspection.java

@@ -37,7 +37,7 @@ public class RoutingInspection extends BaseEntity {
     private LocalDate rectifyDate;
 
     @ApiModelProperty(value = "整改人")
-    private Long rectifyUser;
+    private String rectifyUser;
 
     @ApiModelProperty(value = "检查部位")
     private String inspectLocation;

+ 2 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/RoutingInspectionVO2.java

@@ -3,6 +3,7 @@ package org.springblade.manager.vo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import org.springblade.manager.dto.InspectionRectifyDTO;
 import org.springblade.manager.entity.InspectionRectify;
 import org.springblade.manager.entity.RoutingInspection;
 
@@ -18,6 +19,6 @@ import java.util.List;
 public class RoutingInspectionVO2 extends RoutingInspection {
 
     @ApiModelProperty(value = "检查项目集合")
-    private List<InspectionRectify> list;
+    private List<InspectionRectifyDTO> list;
 
 }

+ 122 - 148
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveAutoPdfServiceImpl.java

@@ -8,9 +8,6 @@ import com.itextpdf.text.pdf.*;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
-import org.apache.pdfbox.pdmodel.PDDocument;
-import org.apache.pdfbox.pdmodel.PDPage;
-import org.apache.pdfbox.pdmodel.common.PDRectangle;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.util.IOUtils;
 import org.springblade.archive.entity.ArchiveFormulaConfig;
@@ -61,7 +58,7 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
 
     private ArchiveFileClient archiveFileClient;
 
-    public static final String[] ARCHIVE_NUMBER = new String[]{"r_Archives_front", "r_Archives_catalog", "r_Archives_spare", "r_Archives_back"};
+    public static final  String[] ARCHIVE_NUMBER = new String[]{"r_Archives_front","r_Archives_catalog","r_Archives_spare","r_Archives_back"};
 
     public static final Map<String, String> URL_MAP = new HashMap<>();
     public static final Map<String, String> NAME_MAP = new HashMap<>();
@@ -126,7 +123,7 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
         List<ArchiveFile> waitFiles = new ArrayList<>();
         waitFiles.add(f1);
         waitFiles.add(f2);
-        builtFilePageNo(archivesAuto, waitFiles);
+        builtFilePageNo(archivesAuto,waitFiles);
         System.out.println();
 
 
@@ -210,21 +207,20 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
 
         List<ArchiveFile> archiveFiles = new ArrayList<>();
 
-        for (int i = 0; i < 20; i++) {
+        for (int i = 0; i < 20;i++) {
             archiveFiles.add(archiveFile);
         }
-        buildArchiveFrontPdfs(projectId, archivesAuto, archiveFiles, true);
+        buildArchiveFrontPdfs(projectId,archivesAuto,archiveFiles,true);
     }
 
 
     /**
-     * 生成四要素
-     *
+     *  生成四要素
      * @param projectId
-     * @param archivesAuto,   会更新起始时间和结束时间,所以调用后要更新
+     * @param archivesAuto, 会更新起始时间和结束时间,所以调用后要更新
      * @param archiveFileList
      */
-    public void buildArchiveFrontPdfs(Long projectId, ArchivesAuto archivesAuto, List<ArchiveFile> archiveFileList,
+    public void buildArchiveFrontPdfs(Long projectId, ArchivesAuto archivesAuto,List<ArchiveFile> archiveFileList,
                                       boolean bBuildFront) {
 
         if (bBuildFront == false) {
@@ -252,26 +248,26 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
         String secretLevel = archivesAuto.getSecretLevel();
         String storageTime = archivesAuto.getStorageTime();
 
-        Map<String, Object> variables = dataSourceBuilder(archivesAuto, archiveFileList);
+        Map<String,Object> variables = dataSourceBuilder(archivesAuto,archiveFileList);
 
         // 使用生成的档案号码字符串链表生成档案 PDF 文件
         List<String> frontUrls = new ArrayList<>();
         List<String> backUrls = new ArrayList<>();
         for (String number : numberFronts) {
             // 具体实现省略
-            buildFrontPdf(archivesAuto, number, variables, frontUrls);
+            buildFrontPdf(archivesAuto,number, variables,frontUrls);
         }
 
         for (String number : numberBacks) {
             // 具体实现省略
-            buildFrontPdf(archivesAuto, number, variables, backUrls);
+            buildFrontPdf(archivesAuto,number, variables,backUrls);
         }
 
         //将封面写入archivesAuto
         frontUrls.addAll(backUrls);
 
         //统计文件大小
-        RefreshFileSize(archivesAuto, archiveFileList, frontUrls);
+        RefreshFileSize(archivesAuto,archiveFileList,frontUrls);
 
         String joinedUrls = String.join(", ", frontUrls);
         archivesAuto.setOutUrl(joinedUrls);
@@ -281,11 +277,10 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
 
     /**
      * 打码
-     *
      * @param archivesAuto
      * @param waitArchiveFiles
      */
-    public void builtFilePageNo(ArchivesAuto archivesAuto, List<ArchiveFile> waitArchiveFiles) {
+    public void builtFilePageNo(ArchivesAuto archivesAuto,List<ArchiveFile> waitArchiveFiles){
 
         Long projectId = archivesAuto.getProjectId();
 
@@ -293,7 +288,7 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
         //是否打页码
         if (!config.isPage()) {
             //不需要打页码的,把字段pdf_page_url设为null
-            for (ArchiveFile file : waitArchiveFiles) {
+            for(ArchiveFile file:waitArchiveFiles){
                 file.setPdfPageUrl("");
             }
             return;
@@ -305,17 +300,17 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
         }
 
         List<String> urls = new ArrayList<>();
-        for (ArchiveFile f : waitArchiveFiles) {
+        for (ArchiveFile f: waitArchiveFiles) {
             String url = getPdfFileUrl(f);
-            if (f.getIsElement() != null && f.getIsElement() == 1) {
+            if (f.getIsElement() != null && f.getIsElement()== 1) {
                 urls.add(FileUtils.Element_FLAG + url);
             } else {
                 urls.add(url);
             }
         }
         String localPath = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        List<String> pageUrls = FileUtils.doForPageNumberUseItextpdf(urls, localPath, newIOSSClient, archivesAuto.getProjectId());
-        for (int i = 0; i < waitArchiveFiles.size(); i++) {
+        List<String> pageUrls = FileUtils.doForPageNumberUseItextpdf(urls,localPath,newIOSSClient, archivesAuto.getProjectId());
+        for(int i=0;i<waitArchiveFiles.size();i++){
             waitArchiveFiles.get(i).setPdfPageUrl(pageUrls.get(i));
         }
 
@@ -323,12 +318,14 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
     }
 
 
+
     /**
-     * @param number    四要素的表名
+     *
+     * @param number  四要素的表名
      * @param variables 参数集
-     * @param urls      返回的url
+     * @param urls  返回的url
      */
-    public void buildFrontPdf(ArchivesAuto archivesAuto, String number, Map<String, Object> variables, List<String> urls) {
+    public void buildFrontPdf(ArchivesAuto archivesAuto,String number, Map<String,Object> variables,List<String> urls) {
         // Step 1: Get the list of formulas using archiveFormulaConfigService
         List<ArchiveFormulaConfig> formulaConfigs = archiveFormulaConfigService.getByNumber(number);
 
@@ -338,7 +335,7 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
 
         ArchiveFormulaConfig multiLineconfig = null;
         //采取
-        String fileName = FileUtils.generateFilename(number, 0, archivesAuto.getId());
+        String fileName = FileUtils.generateFilename(number,0,archivesAuto.getId());
 
         for (ArchiveFormulaConfig config : formulaConfigs) {
             String coords = config.getCoords();
@@ -355,13 +352,14 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
                 }
             }*/
 
-            if (variables.containsKey("ArchiveFile") && variables.get("ArchiveFile") instanceof List
-                    && formula.indexOf("ArchiveFile") >= 0) {
+            if(variables.containsKey("ArchiveFile") && variables.get("ArchiveFile") instanceof List
+                    && formula.indexOf("ArchiveFile") >= 0){
 
                 multiLineconfig = config;
                 //handleArchiveFile(coords, formula, variables, file_path, excelUrl, dataInfo,urls);
                 continue;
-            } else {
+            }
+            else{
                 handleNonArchiveFile(config, coords, formula, variables, file_path, excelUrl, dataInfo);
             }
         }
@@ -369,11 +367,11 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
         if (multiLineconfig != null) {
             String coords = multiLineconfig.getCoords();
             String formula = multiLineconfig.getFormula();
-            handleArchiveFile(coords, formula, variables, file_path, excelUrl, dataInfo, urls, fileName, archivesAuto.getProjectId());
+            handleArchiveFile(coords, formula, variables, file_path, excelUrl, dataInfo,urls,fileName, archivesAuto.getProjectId());
 
-        } else {
+        }else {
             try {
-                String url = getBussPdfInfo(fileName, dataInfo, excelUrl, file_path, OssConstant.ARCHIVE_DIRECTORY, archivesAuto.getProjectId());
+                String url = getBussPdfInfo(fileName, dataInfo, excelUrl, file_path,OssConstant.ARCHIVE_DIRECTORY,archivesAuto.getProjectId());
                 urls.add(url);
             } catch (Exception e) {
                 e.printStackTrace();
@@ -384,7 +382,6 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
 
     /**
      * 生成 卷内目录
-     *
      * @param coords
      * @param formula
      * @param variables
@@ -394,8 +391,8 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
      * @param urls
      */
     private void handleArchiveFile(String coords, String formula,
-                                   Map<String, Object> variables, String file_path,
-                                   String excelUrl, Map<String, Object> dataInfo, List<String> urls, String fileName, Long projectId) {
+                                   Map<String,Object> variables,String file_path,
+                                   String excelUrl, Map<String, Object> dataInfo,List<String> urls,String fileName,Long projectId){
         //todo  目录多页合并一页,文件名带上
 
 
@@ -406,16 +403,16 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
             DataVO dataVO2 = FormulaUtil.convertCellToIndex(coordArr[1]);
             Integer pageSize = dataVO2.getY() - dataVO1.getY() + 1;
 
-            List<Map<String, Object>> archiveFiles = (List<Map<String, Object>>) variables.get("ArchiveFile");
+            List<Map<String,Object>> archiveFiles = (List<Map<String,Object>>)variables.get("ArchiveFile");
 
             Map<String, Object> pageMap = new HashMap<>();
-            if (archiveFiles != null && archiveFiles.size() > 0) {
+            if(archiveFiles != null && archiveFiles.size() > 0){
                 int pageIndex = 0; // 当前页数
                 while (true) {
-                    List<Map<String, Object>> subList = archiveFiles.subList(pageIndex * pageSize,
+                    List<Map<String,Object>> subList = archiveFiles.subList(pageIndex * pageSize,
                             Math.min((pageIndex + 1) * pageSize, archiveFiles.size()));
 
-                    if (subList.size() == 0) {
+                    if(subList.size()==0){
                         break;
                     }
 
@@ -423,12 +420,12 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
                     pageMap.putAll(dataInfo);
 
                     int subIndex = 0;
-                    for (Map<String, Object> archiveMap : subList) {
+                    for (Map<String,Object> archiveMap : subList) {
                         // 处理archiveFile逻辑
                         int y = dataVO1.getY() + subIndex;
                         List<Object> objects = FormulaUtil.expressionParseList(formula, archiveMap);
                         int xIndex = 0;
-                        for (Object o : objects) {
+                        for (Object o: objects) {
                             if (o == null) {
                                 xIndex++;
                                 continue;
@@ -442,8 +439,8 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
                         subIndex++;
                     }
                     try {
-                        Integer fileNamenum = (pageIndex * pageSize) + subIndex;
-                        String url = getBussPdfInfo(fileName + fileNamenum, pageMap, excelUrl, file_path, OssConstant.ARCHIVE_DIRECTORY, projectId);
+                        Integer fileNamenum=(pageIndex * pageSize)+subIndex;
+                        String url = getBussPdfInfo(fileName + fileNamenum, pageMap, excelUrl, file_path,OssConstant.ARCHIVE_DIRECTORY,projectId);
                         localUrls.add(url);
                     } catch (Exception e) {
                         e.printStackTrace();
@@ -467,23 +464,22 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
             FileUtils.mergePdfPublicMethods(localUrls, localPdf);
 //            BladeFile bladeFile = this.newIOSSClient.uploadFile(fileName + ".pdf", localPdf, OssConstant.ARCHIVE_DIRECTORY,projectId);
 
-            String absoluteFileName = FileUtils.getOssPath(OssConstant.ARCHIVE_DIRECTORY, fileName, projectId);
+            String absoluteFileName = FileUtils.getOssPath(OssConstant.ARCHIVE_DIRECTORY,fileName,projectId);
             BladeFile bladeFile = newIOSSClient.uploadFile(absoluteFileName + ".pdf", localPdf);
 
 //            ByteArrayOutputStream bos = new ByteArrayOutputStream();
 //            FileUtils.PdfCopyPublicMethods(bos, localUrls);
 //            BladeFile bladeFile = newIOSSClient.updateFile(bos.toByteArray(),fileName + ".pdf");
-            if (bladeFile != null) {
+            if (bladeFile!= null ) {
                 urls.add(bladeFile.getLink());
             }
-        } else if (localUrls.size() == 1) {
+        }else if (localUrls.size() == 1) {
             urls.add(localUrls.get(0));
         }
     }
 
     /**
      * 生成 封面,备考表,脊背
-     *
      * @param config
      * @param coords
      * @param formula
@@ -493,29 +489,29 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
      * @param dataInfo  结果集
      */
     private void handleNonArchiveFile(ArchiveFormulaConfig config, String coords, String formula,
-                                      Map<String, Object> variables, String file_path,
+                                      Map<String,Object> variables,String file_path,
                                       String excelUrl, Map<String, Object> dataInfo) {
         DataVO dataVO = FormulaUtil.convertCellToIndex(coords);
         Object object = null;
         if (formula.indexOf("~") > 0) {
             String[] formulaArr = formula.split("~");
             if (formulaArr.length == 2) {
-                Object object1 = FormulaUtil.expressionParse(formulaArr[0], variables);
-                Object object2 = FormulaUtil.expressionParse(formulaArr[1], variables);
+                Object object1 = FormulaUtil.expressionParse(formulaArr[0],variables);
+                Object object2 = FormulaUtil.expressionParse(formulaArr[1],variables);
                 object = object1 + "~" + object2;
             }
-        } else {
-            object = FormulaUtil.expressionParse(formula, variables);
+        }else {
+            object = FormulaUtil.expressionParse(formula,variables);
         }
 
 
         String key = config.getId() + "__" + dataVO.getY() + "_" + dataVO.getX();
 
 
-        if ("Archive['startDate']~Archive['endDate']".equals(formula)) {
-            log.info("起止时间object:" + object.toString());
-            if ("null~null".equals(object)) {
-                object = "";
+        if("Archive['startDate']~Archive['endDate']".equals(formula)){
+            log.info("起止时间object:"+object.toString());
+            if("null~null".equals(object)){
+                object="";
             }
         }
         dataInfo.put(key, object);
@@ -528,18 +524,17 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
 
     /**
      * 生成单张pdf
-     *
-     * @param fileName  文件名
+     * @param fileName   文件名
      * @param DataInfo  excel和数据
      * @param excelUrl  excel模板
-     * @param localPath 本地路径
-     * @param ossPath   oss上的路径
+     * @param localPath  本地路径
+     * @param ossPath  oss上的路径
      * @param projectId 项目ID
      * @return
      * @throws Exception
      */
-    public String getBussPdfInfo(String fileName, Map<String, Object> DataInfo, String excelUrl, String localPath,
-                                 String ossPath, Long projectId) throws Exception {
+    public String getBussPdfInfo(String fileName,Map<String, Object> DataInfo,String excelUrl,String localPath,
+         String ossPath, Long projectId) throws Exception{
 
         if (fileName == null) {
             fileName = SnowFlakeUtil.getId().toString();
@@ -555,9 +550,9 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
 
         // 获取excel流 和 html流
         InputStream exceInp = null;
-        if (isOssFilePath(excelUrl)) {
+        if ( isOssFilePath(excelUrl)){
             exceInp = CommonUtil.getOSSInputStream(excelUrl);
-        } else {
+        }else {
             exceInp = new FileInputStream(new File(excelUrl));
         }
 
@@ -580,12 +575,12 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
                     int x2 = 0;
                     int y2 = 0;
 
-                    if (xy.length == 2) {
+                    if (xy.length == 2 ) {
                         x1 = Integer.parseInt(xy[1]);
                         y1 = Integer.parseInt(xy[0]);
                     }
 
-                    if (xy.length == 4) {
+                    if (xy.length == 4 ) {
                         x2 = Integer.parseInt(xy[3]);
                         y2 = Integer.parseInt(xy[2]);
                     }
@@ -614,10 +609,11 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
                         pict.resize(1, 1);
                         FileUtils.imageOrientation(sheet, anchor, new DataVO(x1 - 1, y1 - 1));
 
-                    } else {
-                        Row row = sheet.getRow(y1);
+                    }
+                    else {
+                        Row row = sheet.getRow(y1 );
                         if (row != null) {
-                            Cell cell = row.getCell(x1);
+                            Cell cell = row.getCell(x1 );
                             if (cell != null || ObjectUtils.isNotEmpty(cell)) {
 //                                boolean bflag = true;
 //                                if (bflag) {
@@ -637,25 +633,24 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
         FileOutputStream outputStream = new FileOutputStream(excelPath);
         workbook.write(outputStream);
         FileUtils.setExcelScaleToPdf(excelPath, localPdfPath);
-        String absoluteFileName = FileUtils.getOssPath(OssConstant.ARCHIVE_DIRECTORY, fileName, projectId);
+        String absoluteFileName = FileUtils.getOssPath(OssConstant.ARCHIVE_DIRECTORY,fileName,projectId);
         BladeFile bladeFile = newIOSSClient.uploadFile(absoluteFileName + ".pdf", localPdfPath);
 
         ///BladeFile bladeFile = newIOSSClient.uploadFile(fileName + ".pdf", localPdfPath,ossPath, projectId);
         String pdfLink = "";
-        if (bladeFile != null) {
+        if (bladeFile!= null ){
             pdfLink = bladeFile.getLink();
         }
         return pdfLink;
     }
 
     /**
-     * 生成四要素的数据源
-     *
+     *  生成四要素的数据源
      * @param archive
      * @param datas
      * @return
      */
-    public static Map<String, Object> dataSourceBuilder(ArchivesAuto archive, List<ArchiveFile> datas) {
+    public static  Map<String,Object> dataSourceBuilder(ArchivesAuto archive, List<ArchiveFile> datas){
 
         //预处理
         archive.setSecretLevel(FormulaUtil.securityLevelMap.get(archive.getSecretLevel()));
@@ -667,11 +662,11 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
         List<Map<String, Object>> fileMapList = new ArrayList<>();
 
         //todo  增加获取总大小
-        for (ArchiveFile file : datas) {
+        for (ArchiveFile file:  datas) {
 
-            if (file.getIsElement() != null && file.getIsElement() == 1) {
+            if (file.getIsElement() != null && file.getIsElement()== 1){
 
-            } else {
+            }else {
 
                 idx++;
                 //设置序号
@@ -684,7 +679,7 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
                 file.setPageNum(iStartPage.toString());
 
                 //最后一页
-                if (file.getFilePage() != null) {
+                if (file.getFilePage() != null ) {
                     iStartPage += file.getFilePage();
                 }
                 if (idx >= datas.size()) {
@@ -706,7 +701,7 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
 
         for (ArchiveFile file : datas) {
             String fileTime = file.getFileTime();
-            if (StringUtils.isNotEmpty(fileTime)) {
+            if(StringUtils.isNotEmpty(fileTime)){
                 if (minDate.isEmpty() || fileTime.compareTo(minDate) <= 0) {
                     minDate = fileTime;
                 }
@@ -717,42 +712,45 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
         }
 
         // 将日期赋值给startDate和endDate
-        if (!minDate.isEmpty()) {
-            LocalDateTime localDateTime = FormulaUtil.parseStringToLocalDateTime(minDate, "yyyyMMdd");
-            archive.setStartDate(localDateTime);
-        }
-        if (!maxDate.isEmpty()) {
-            LocalDateTime localDateTime = FormulaUtil.parseStringToLocalDateTime(maxDate, "yyyyMMdd");
-            archive.setEndDate(localDateTime);
+        try {
+            if (!minDate.isEmpty()) {
+                LocalDateTime localDateTime = FormulaUtil.parseStringToLocalDateTime(minDate,"yyyyMMdd");
+                archive.setStartDate(localDateTime);
+            }
+            if (!maxDate.isEmpty()) {
+                LocalDateTime localDateTime = FormulaUtil.parseStringToLocalDateTime(maxDate,"yyyyMMdd");
+                archive.setEndDate(localDateTime);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
         }
 
         Map<String, Object> archivesAutoMap = new ObjectMapper().convertValue(archive, Map.class);
-        if (archive.getRollDate() != null) {
-            archivesAutoMap.put("rollDate", FormulaUtil.formatLocalDateTime(archive.getRollDate(), "yyyy年MM月dd日"));
+        if (archive.getRollDate()!= null) {
+            archivesAutoMap.put("rollDate",FormulaUtil.formatLocalDateTime(archive.getRollDate(),"yyyy年MM月dd日"));
         }
 
-        if (archive.getReviewDate() != null) {
-            archivesAutoMap.put("reviewDate", FormulaUtil.formatLocalDateTime(archive.getReviewDate(), "yyyy年MM月dd日"));
+        if (archive.getReviewDate()!= null) {
+            archivesAutoMap.put("reviewDate",FormulaUtil.formatLocalDateTime(archive.getReviewDate(),"yyyy年MM月dd日"));
         }
 
-        if (archive.getStartDate() != null) {
-            archivesAutoMap.put("startDate", FormulaUtil.formatLocalDateTime(archive.getStartDate(), "yyyyMMdd"));
+        if (archive.getStartDate()!= null) {
+            archivesAutoMap.put("startDate",FormulaUtil.formatLocalDateTime(archive.getStartDate(),"yyyyMMdd"));
         }
 
-        if (archive.getEndDate() != null) {
-            archivesAutoMap.put("endDate", FormulaUtil.formatLocalDateTime(archive.getEndDate(), "yyyyMMdd"));
+        if (archive.getEndDate()!= null) {
+            archivesAutoMap.put("endDate",FormulaUtil.formatLocalDateTime(archive.getEndDate(),"yyyyMMdd"));
         }
 
-        Map<String, Object> variables = new HashMap<>();
-        variables.put("Archive", archivesAutoMap);
+        Map<String,Object> variables = new HashMap<>();
+        variables.put("Archive",archivesAutoMap);
 
-        variables.put("ArchiveFile", fileMapList);
-        return variables;
+        variables.put("ArchiveFile",fileMapList);
+        return  variables;
     }
 
     /**
      * 获取四要素模板的url,这里写死,后续可以从清表的 ”归档“模板树下获取
-     *
      * @param number
      * @return
      */
@@ -764,16 +762,15 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
 
     /**
      * 获取指定文件的pdf文件
-     *
      * @param file
      * @return
      */
-    public String getPdfFileUrl(ArchiveFile file) {
+    public String getPdfFileUrl(ArchiveFile file){
         //
         String url = file.getPdfFileUrl();
         if (StringUtil.isEmpty(url)) {
             String fileUrl = file.getFileUrl();
-            if (fileUrl.endsWith(".pdf") || fileUrl.endsWith(".PDF")) {
+            if(fileUrl.endsWith(".pdf") || fileUrl.endsWith(".PDF")){
                 url = file.getFileUrl();
             }
         }
@@ -786,24 +783,23 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
 
     /**
      * 刷新文件大小
-     *
      * @param archive
      * @param datas
      * @param frontUrls
      */
-    public void RefreshFileSize(ArchivesAuto archive, List<ArchiveFile> datas, List<String> frontUrls) {
+    public void RefreshFileSize(ArchivesAuto archive,List<ArchiveFile> datas,List<String> frontUrls){
 
         List<String> fileUrls = new ArrayList<>();
-        for (ArchiveFile file : datas) {
+        for (ArchiveFile file: datas) {
             String url = getPdfFileUrl(file);
-            if (StringUtils.isEmpty(url)) {
+            if(StringUtils.isEmpty(url)){
                 continue;
             }
             fileUrls.add(url);
         }
 
         fileUrls.addAll(frontUrls);
-        List<FileSize> fileSizes = org.springblade.common.utils.FileUtils.getOssFileSize(fileUrls);
+        List<FileSize>  fileSizes = org.springblade.common.utils.FileUtils.getOssFileSize(fileUrls);
 
         double totalSize = fileSizes.stream()
                 .mapToDouble(FileSize::getFileSize)
@@ -813,9 +809,9 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
 
         //todo 生成相册内容,待补充
         int i = 0;
-        for (ArchiveFile file : datas) {
+        for (ArchiveFile file: datas) {
             double size = fileSizes.get(i).getFileSize();
-            if (file.getFileSize() != null) {
+            if (file.getFileSize()!= null) {
                 file.setFileSize(Math.round(size));
             }
         }
@@ -823,11 +819,10 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
 
     /**
      * 刷新档号
-     *
      * @param archive
      * @param fileNumber
      */
-    public boolean refreshFileNumber(ArchivesAuto archive, String fileNumber) {
+    public boolean refreshFileNumber(ArchivesAuto archive,String fileNumber) {
         //没变化则不用刷新
         if (fileNumber.equals(archive.getFileNumber())) {
             return false;
@@ -838,44 +833,42 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
 
         List<ArchiveFile> archiveFiles = archiveFileClient.getArchiveFileByArchiveID(archive.getId());
 
-        buildArchiveFrontPdfs(projectId, archive, archiveFiles, true);
+        buildArchiveFrontPdfs(projectId,archive,archiveFiles,true);
 
         return true;
     }
 
     /**
      * 刷新档号
-     *
      * @param archive
      * @param fileNumber
      */
-    public boolean refreshFileNumberForce(ArchivesAuto archive, String fileNumber) {
+    public boolean refreshFileNumberForce(ArchivesAuto archive,String fileNumber) {
         //没变化则不用刷新,强制刷新
         Long projectId = archive.getProjectId();
         archive.setFileNumber(fileNumber);
 
         List<ArchiveFile> archiveFiles = archiveFileClient.getArchiveFileByArchiveID(archive.getId());
 
-        buildArchiveFrontPdfs(projectId, archive, archiveFiles, true);
+        buildArchiveFrontPdfs(projectId,archive,archiveFiles,true);
 
         return true;
     }
 
     /**
      * 合并pdf并上传到oss
-     *
      * @param urlList
      * @param fileName
      * @return
      */
-    public String MergePdfAndUpload(List<String> urlList, String fileName, String filePath, Long pojectId) {
-        String url = "";
-        Long id = SnowFlakeUtil.getId();
-        String localPdf = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL) + "/pdf/" + id + ".pdf";
+    public String MergePdfAndUpload(List<String> urlList,String fileName,String filePath,Long pojectId) {
+       String url = "";
+       Long id = SnowFlakeUtil.getId();
+       String localPdf = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL) + "/pdf/" + id + ".pdf";
 
-        try {
+       try {
             //合并pdf
-            FileUtils.mergePdfPublicMethods(urlList, localPdf);
+            FileUtils.mergePdfPublicMethods(urlList,localPdf);
 
             if (StringUtils.isEmpty(filePath)) {
                 filePath = OssConstant.TEMP_DIRECTORY;
@@ -884,8 +877,8 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
             fileName += (OssConstant.SEPARATOR + id);
 
             //上传到oss
-            String absoluteFileName = FileUtils.getOssPath(OssConstant.TEMP_DIRECTORY, fileName, null);
-            BladeFile file = newIOSSClient.uploadFile(absoluteFileName + ".pdf", localPdf);
+           String absoluteFileName = FileUtils.getOssPath(OssConstant.TEMP_DIRECTORY,fileName,null);
+           BladeFile file = newIOSSClient.uploadFile(absoluteFileName + ".pdf", localPdf);
 
 
 //            BladeFile file  = newIOSSClient.uploadFile(fileName+ ".pdf", localPdf,filePath,pojectId);
@@ -897,23 +890,22 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
     }
 
     @Override
-    public String upFile(InputStream inputStream, Long projectId) {
+    public String upFile(InputStream inputStream,Long projectId) {
         String url = "";
         Long id = SnowFlakeUtil.getId();
         String localPdf = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL) + "/pdf/" + id + ".pdf";
         String fileName = id + ".pdf";
         try {
-            //合并PDF
+            //合并pdf
             byte[] bytes = FileUtils.InputStreamToBytes(inputStream);
             OutputStream outputStream = new FileOutputStream(localPdf);
             outputStream.write(bytes);
 
-            //将PDF设置为A4纸大小
-            this.setPdfToA4Size(localPdf, localPdf);
+            //上传到oss
+            String absoluteFileName = FileUtils.getOssPath(OssConstant.ARCHIVE_DIRECTORY,fileName,projectId);
 
-            //上传到OSS
-            String absoluteFileName = FileUtils.getOssPath(OssConstant.ARCHIVE_DIRECTORY, fileName, projectId);
             BladeFile file = newIOSSClient.uploadFile(absoluteFileName, localPdf);
+
             url = file.getLink();
         } catch (Exception e) {
             e.printStackTrace();
@@ -921,24 +913,6 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
         return url;
     }
 
-    /**
-     * 设置pdf大小为A4纸大小
-     *
-     * @param inputPdfPath
-     * @param outputPdfPath
-     */
-    private void setPdfToA4Size(String inputPdfPath, String outputPdfPath) {
-        try {
-            PDDocument document = PDDocument.load(new File(inputPdfPath));
-            PDPage newPage = new PDPage(PDRectangle.A4);
-            document.removePage(0);
-            document.addPage(newPage);
-            document.save(outputPdfPath);
-            document.close();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
 
 
 }

+ 17 - 3
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchivesAutoServiceImpl.java

@@ -680,9 +680,17 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
     public void archiveAutoMethod(Long projectId, Long contractId, Long nodeId) {
         //步骤一:把档号集合初始化
         indexMap = new HashMap<>();
-        //步骤二:查询归档树节点。存在未归档文件的节点。
+        //步list = {ArrayList@18238}  size = 19骤二:查询归档树节点。存在未归档文件的节点。
         List<ArchiveTreeContract> list = archiveTreeContractClient.getHavedFileNodeByProjectID(projectId);
 
+
+		if (nodeId!= null) {
+			ArchiveTreeContract node = archiveTreeContractClient.getArchiveTreeContractById(nodeId);
+			if (node!= null && node.getContractId() != null) {
+				contractId = node.getContractId();
+			}
+		}
+
         //按合同段过滤
         List<ArchiveTreeContract> authlist = authFilter(list, contractId, nodeId);
 
@@ -1681,6 +1689,12 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 	 */
 	public void refreshFileNumberNoSlipt(Long projectId,Long contractId,Long nodeId,boolean bforce) {
 		List<ArchiveTreeContract> list = archiveTreeContractClient.getListByProjectId(projectId);
+		if (nodeId!= null) {
+			ArchiveTreeContract node = archiveTreeContractClient.getArchiveTreeContractById(nodeId);
+			if (node!= null && node.getContractId() != null) {
+				contractId = node.getContractId();
+			}
+		}
 		this.refreshFileNumberNoSlipt(list,contractId,nodeId,bforce);
 	}
 
@@ -2058,12 +2072,12 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 						result.add(contract);
 					}
 				}else{
-					if (StringUtils.isEmpty(contract.getTreeCode()) || contractId.toString().equals(contract.getTreeCode())) {
+					if (StringUtils.isEmpty(contract.getTreeCode()) || contractId.toString().equals(contract.getTreeCode())  || contractId.equals(contract.getContractId())) {
 						result.add(contract);
 					}
 				}
 			} else {
-				if (treeCode.equals(contract.getTreeCode()) || contractId.toString().equals(contract.getTreeCode())) {
+				if (treeCode.equals(contract.getTreeCode()) || contractId.toString().equals(contract.getTreeCode()) || contractId.equals(contract.getContractId())) {
 					result.add(contract);
 				}
 			}

+ 5 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/InspectionRectifyMapper.java

@@ -3,11 +3,16 @@ package org.springblade.manager.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
+import org.springblade.manager.dto.InspectionRectifyDTO;
 import org.springblade.manager.entity.InspectionRectify;
 import org.springblade.manager.entity.RoutingInspection;
 
+import java.util.List;
+
 
 public interface InspectionRectifyMapper extends BaseMapper<InspectionRectify> {
 
     void deleteByInspectId(@Param("inspectId") Long inspectId);
+
+    List<InspectionRectifyDTO> getDTOList(@Param("inspectId") Long inspectId);
 }

+ 5 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/InspectionRectifyMapper.xml

@@ -6,4 +6,9 @@
         DELETE FROM m_inspection_rectify
         WHERE inspect_id = #{inspectId}
     </delete>
+    <select id="getDTOList" resultType="org.springblade.manager.dto.InspectionRectifyDTO">
+        select *
+        from m_inspection_rectify
+        where is_deleted = 0 and inspect_id = #{inspectId}
+    </select>
 </mapper>

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

@@ -1,12 +1,16 @@
 package org.springblade.manager.service;
 
 import org.springblade.core.mp.base.BaseService;
+import org.springblade.manager.dto.InspectionRectifyDTO;
 import org.springblade.manager.entity.InspectionRectify;
 import org.springblade.manager.entity.RoutingInspection;
 
+import java.util.List;
+
 public interface IInspectionRectifyService extends BaseService<InspectionRectify> {
 
     //真实删除检查项目
     void deleteByInspectId(Long inspectId);
 
+    List<InspectionRectifyDTO> getDTOList(Long inspectId);
 }

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

@@ -266,6 +266,7 @@ public class ArchiveTreeContractSyncImpl {
                     for (ContractRelationJlyz contractRelationJlyz: list) {
                         syncBusinessData(projectId,contractRelationJlyz.getId(),2);
                     }
+
                 }else {
                     //将项目未锁定案卷拆卷
                     syncBusinessData(projectId,contractId,1);

+ 8 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/InspectionRectifyServiceImpl.java

@@ -3,6 +3,7 @@ package org.springblade.manager.service.impl;
 import lombok.AllArgsConstructor;
 import org.springblade.core.mp.base.BaseEntity;
 import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.manager.dto.InspectionRectifyDTO;
 import org.springblade.manager.entity.InspectionRectify;
 import org.springblade.manager.entity.RoutingInspection;
 import org.springblade.manager.mapper.InspectionRectifyMapper;
@@ -11,6 +12,8 @@ import org.springblade.manager.service.IInspectionRectifyService;
 import org.springblade.manager.service.IRoutingInspectionService;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 @AllArgsConstructor
 public class InspectionRectifyServiceImpl extends BaseServiceImpl<InspectionRectifyMapper, InspectionRectify> implements IInspectionRectifyService {
@@ -19,4 +22,9 @@ public class InspectionRectifyServiceImpl extends BaseServiceImpl<InspectionRect
     public void deleteByInspectId(Long inspectId) {
         baseMapper.deleteByInspectId(inspectId);
     }
+
+    @Override
+    public List<InspectionRectifyDTO> getDTOList(Long inspectId) {
+        return baseMapper.getDTOList(inspectId);
+    }
 }

+ 40 - 13
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/RoutingInspectionServiceImpl.java

@@ -1,5 +1,6 @@
 package org.springblade.manager.service.impl;
 
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -17,10 +18,7 @@ import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.constant.BladeConstant;
 import org.springblade.core.tool.utils.Func;
-import org.springblade.manager.dto.ArchiveTreeContractAutoRuleMapDTO;
-import org.springblade.manager.dto.ArchiveTreeDTO;
-import org.springblade.manager.dto.ArchiveTreeSortDTO;
-import org.springblade.manager.dto.RoutingInspectionDTO;
+import org.springblade.manager.dto.*;
 import org.springblade.manager.entity.*;
 import org.springblade.manager.mapper.ArchiveAutoRuleWbsMapper;
 import org.springblade.manager.mapper.ArchiveTreeMapper;
@@ -33,6 +31,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.time.LocalDate;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -46,7 +45,7 @@ public class RoutingInspectionServiceImpl extends BaseServiceImpl<RoutingInspect
     @Transactional
     public void add(RoutingInspectionDTO dto) {
         //获取检查部位
-        List<InspectionRectify> list = dto.getList();
+        List<InspectionRectifyDTO> list = dto.getList();
         if (list == null || list.size() == 0){
             throw new ServiceException("请填写检查项目");
         }
@@ -57,15 +56,22 @@ public class RoutingInspectionServiceImpl extends BaseServiceImpl<RoutingInspect
         inspection.setId(id);
         this.save(inspection);
         //再保存具体的巡检项目
-        list.stream().forEach(l->l.setInspectId(id));
-        rectifyService.saveBatch(list);
+        List<InspectionRectify> list1 = list.stream().map(l -> {
+            InspectionRectify rectify = new InspectionRectify();
+            BeanUtils.copyProperties(l, rectify);
+            rectify.setInspectId(id);
+            List<String> autoExpandKeys = l.getAutoExpandKeys();
+            rectify.setInspectLocation(JSON.toJSONString(autoExpandKeys));
+            return rectify;
+        }).collect(Collectors.toList());
+        rectifyService.saveBatch(list1);
     }
 
     @Override
     @Transactional
     public void Update(RoutingInspectionDTO dto) {
         //获取检查部位
-        List<InspectionRectify> list = dto.getList();
+        List<InspectionRectifyDTO> list = dto.getList();
         if (list == null || list.size() == 0){
             throw new ServiceException("请填写检查项目");
         }
@@ -74,8 +80,16 @@ public class RoutingInspectionServiceImpl extends BaseServiceImpl<RoutingInspect
         this.updateById(inspection);
         //修改先删除,再保存
         rectifyService.deleteByInspectId(dto.getId());
-        list.stream().forEach(l->l.setInspectId(dto.getId()));
-        rectifyService.saveBatch(list);
+        //再保存具体的巡检项目
+        List<InspectionRectify> list1 = list.stream().map(l -> {
+            InspectionRectify rectify = new InspectionRectify();
+            BeanUtils.copyProperties(l, rectify);
+            rectify.setInspectId(dto.getId());
+            List<String> autoExpandKeys = l.getAutoExpandKeys();
+            rectify.setInspectLocation(JSON.toJSONString(autoExpandKeys));
+            return rectify;
+        }).collect(Collectors.toList());
+        rectifyService.saveBatch(list1);
     }
 
     @Override
@@ -97,7 +111,8 @@ public class RoutingInspectionServiceImpl extends BaseServiceImpl<RoutingInspect
     @Override
     public RoutingInspectionVO2 detail(Long id) {
         //先查出巡检项目集合
-        List<InspectionRectify> list = rectifyService.list(new LambdaQueryWrapper<InspectionRectify>().eq(InspectionRectify::getInspectId, id));
+        List<InspectionRectifyDTO> list = rectifyService.getDTOList(id);
+        list.stream().forEach(l->l.setAutoExpandKeys(JSON.parseArray(l.getInspectLocation(),String.class)));
         //再查出巡检信息,集合设置进巡检信息
         RoutingInspection inspection = this.getById(id);
         RoutingInspectionVO2 vo2 = new RoutingInspectionVO2();
@@ -113,6 +128,7 @@ public class RoutingInspectionServiceImpl extends BaseServiceImpl<RoutingInspect
             //复检未通过,修改复检状态为2未通过
             this.update(new LambdaUpdateWrapper<RoutingInspection>()
                     .set(RoutingInspection::getReviewInspectStatus,2)
+                    .set(RoutingInspection::getSubmitRectify,1)
                     .eq(RoutingInspection::getId,id));
         }else if (status == 2){
             //复检通过,修改复检状态为3通过,修改整改状态为2不用整改
@@ -131,10 +147,20 @@ public class RoutingInspectionServiceImpl extends BaseServiceImpl<RoutingInspect
         //修改巡检信息状态为已经整改
         this.update(new LambdaUpdateWrapper<RoutingInspection>()
                 .set(RoutingInspection::getSubmitRectify,2)
+                .set(RoutingInspection::getActualRectifyDate, LocalDate.now())
                 .eq(RoutingInspection::getId,dto.getId()));
         //保存检查项目
-        List<InspectionRectify> list = dto.getList();
-        rectifyService.updateBatchById(list);
+        List<InspectionRectifyDTO> list = dto.getList();
+        //再保存具体的巡检项目
+        List<InspectionRectify> list1 = list.stream().map(l -> {
+            InspectionRectify rectify = new InspectionRectify();
+            BeanUtils.copyProperties(l, rectify);
+            //整改只能修改整改信息
+            List<String> autoExpandKeys = l.getAutoExpandKeys();
+            rectify.setInspectLocation(JSON.toJSONString(autoExpandKeys));
+            return rectify;
+        }).collect(Collectors.toList());
+        rectifyService.updateBatchById(list1);
     }
 
     @Override
@@ -142,6 +168,7 @@ public class RoutingInspectionServiceImpl extends BaseServiceImpl<RoutingInspect
         //修改巡检信息为未整改
         this.update(new LambdaUpdateWrapper<RoutingInspection>()
                 .set(RoutingInspection::getSubmitRectify,1)
+                .set(RoutingInspection::getActualRectifyDate,null)
                 .eq(RoutingInspection::getId,id));
     }
 }