瀏覽代碼

Merge remote-tracking branch 'origin/master' into prod_test

lwhhszx 1 年之前
父節點
當前提交
a486726952
共有 55 個文件被更改,包括 3468 次插入230 次删除
  1. 二進制
      a8c0ca9fa41341cc9a46440025b63b63.xls
  2. 4 4
      src/main/java/cn/cslg/pas/common/config/WebSocketConfig.java
  3. 1 0
      src/main/java/cn/cslg/pas/common/dto/UploadPatentWebDTO.java
  4. 1 0
      src/main/java/cn/cslg/pas/common/dto/business/CustomFieldDTO.java
  5. 1 0
      src/main/java/cn/cslg/pas/common/dto/business/CustomOptionDTO.java
  6. 1 0
      src/main/java/cn/cslg/pas/common/dto/business/PatentProjectDTO.java
  7. 1 1
      src/main/java/cn/cslg/pas/common/dto/business/TreeNodeDTO.java
  8. 3 1
      src/main/java/cn/cslg/pas/common/utils/DateUtils.java
  9. 32 0
      src/main/java/cn/cslg/pas/common/utils/FileUtils.java
  10. 12 0
      src/main/java/cn/cslg/pas/common/utils/FormatUtil.java
  11. 3 3
      src/main/java/cn/cslg/pas/controller/ExportProjectController.java
  12. 5 3
      src/main/java/cn/cslg/pas/controller/FeatureController.java
  13. 11 3
      src/main/java/cn/cslg/pas/service/business/AsInvalidReasonHistoryService.java
  14. 26 0
      src/main/java/cn/cslg/pas/service/business/CommonService.java
  15. 34 38
      src/main/java/cn/cslg/pas/service/business/CustomFieldService.java
  16. 22 0
      src/main/java/cn/cslg/pas/service/business/CustomOptionService.java
  17. 65 45
      src/main/java/cn/cslg/pas/service/business/FeatureService.java
  18. 47 13
      src/main/java/cn/cslg/pas/service/business/InvalidRecordService.java
  19. 11 4
      src/main/java/cn/cslg/pas/service/business/PatentProjectService.java
  20. 57 0
      src/main/java/cn/cslg/pas/service/business/TreeNodeService.java
  21. 15 19
      src/main/java/cn/cslg/pas/service/business/es/EsCustomFieldService.java
  22. 62 53
      src/main/java/cn/cslg/pas/service/business/es/EsPatentService.java
  23. 10 6
      src/main/java/cn/cslg/pas/service/business/es/EsService.java
  24. 2 2
      src/main/java/cn/cslg/pas/service/common/FileManagerService.java
  25. 8 0
      src/main/java/cn/cslg/pas/service/common/PatentStarApiService.java
  26. 91 19
      src/main/java/cn/cslg/pas/service/common/TranslateService.java
  27. 18 0
      src/main/java/cn/cslg/pas/service/exportProject/Constants.java
  28. 671 0
      src/main/java/cn/cslg/pas/service/exportProject/ImportFromFileToEsService.java
  29. 236 7
      src/main/java/cn/cslg/pas/service/exportProject/ImportProjectService.java
  30. 87 0
      src/main/java/cn/cslg/pas/service/exportProject/SavePatentToEsService.java
  31. 90 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldCustomAnalysisItem.java
  32. 50 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldCustomAnalysisItemSchema.java
  33. 360 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldCustomAnalysisItemSetting.java
  34. 80 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldCustomAnalysisItemSource.java
  35. 67 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentAffair.java
  36. 22 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentAgency.java
  37. 25 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentAgent.java
  38. 102 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentApplicant.java
  39. 357 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentDTO.java
  40. 27 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentInstructionText.java
  41. 69 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentInventor.java
  42. 33 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentLabel.java
  43. 40 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentRight.java
  44. 131 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProject.java
  45. 85 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProjectField.java
  46. 64 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProjectFieldOption.java
  47. 42 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProjectFieldPatentLink.java
  48. 30 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProjectFieldText.java
  49. 53 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProjectFieldTree.java
  50. 37 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProjectFolder.java
  51. 27 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProjectFolderPatentLink.java
  52. 64 0
      src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProjectUser.java
  53. 4 4
      src/main/resources/application-dev.yml
  54. 32 5
      src/test/java/cn/cslg/pas/service/EventServiceTests.java
  55. 40 0
      src/test/java/cn/cslg/pas/service/ExportProjectServiceTests.java

二進制
a8c0ca9fa41341cc9a46440025b63b63.xls


+ 4 - 4
src/main/java/cn/cslg/pas/common/config/WebSocketConfig.java

@@ -6,8 +6,8 @@ import org.springframework.web.socket.server.standard.ServerEndpointExporter;
 
 @Configuration
 public class WebSocketConfig {
-    @Bean
-    public ServerEndpointExporter serverEndpointExporter() {
-        return new ServerEndpointExporter();
-    }
+//    @Bean
+//    public ServerEndpointExporter serverEndpointExporter() {
+//        return new ServerEndpointExporter();
+//    }
 }

+ 1 - 0
src/main/java/cn/cslg/pas/common/dto/UploadPatentWebDTO.java

@@ -22,4 +22,5 @@ public class UploadPatentWebDTO {
     private Integer haveSaveCounter;
     private Integer index;
     private List<EsCustomFieldDTO> esCustomFieldDTOList;
+    private Integer projectId;
 }

+ 1 - 0
src/main/java/cn/cslg/pas/common/dto/business/CustomFieldDTO.java

@@ -34,4 +34,5 @@ public class CustomFieldDTO {
      * 状态
      */
     private Boolean status;
+    private String personId;
 }

+ 1 - 0
src/main/java/cn/cslg/pas/common/dto/business/CustomOptionDTO.java

@@ -24,5 +24,6 @@ public class CustomOptionDTO {
      * 父id
      */
     private Integer parentId;
+    private String personId;
 
 }

+ 1 - 0
src/main/java/cn/cslg/pas/common/dto/business/PatentProjectDTO.java

@@ -53,4 +53,5 @@ public class PatentProjectDTO {
     private List<ProjectEventDTO> events;
     @Schema(description = "文件guids")
     private List<String> fileGuids;
+    private String personId;
 }

+ 1 - 1
src/main/java/cn/cslg/pas/common/dto/business/TreeNodeDTO.java

@@ -42,6 +42,6 @@ public class TreeNodeDTO {
      * 说明
      */
     private String description;
-
+   private String personId;
 
 }

+ 3 - 1
src/main/java/cn/cslg/pas/common/utils/DateUtils.java

@@ -173,7 +173,9 @@ public class DateUtils {
 
             return sf1.parse(dateString);
         } catch (Exception e) {
-            throw new RuntimeException("时间转化格式错误" + "[dateString=" + dateString + "]" + "[FORMAT_STRING=" + FORMAT_STRING + "]");
+            System.out.println ("时间转化格式错误" + "[dateString=" + dateString + "]" + "[FORMAT_STRING=" + FORMAT_STRING + "]");
+
+            return null;
         }
     }
 

+ 32 - 0
src/main/java/cn/cslg/pas/common/utils/FileUtils.java

@@ -3,6 +3,7 @@ package cn.cslg.pas.common.utils;
 
 import cn.cslg.pas.Application;
 import cn.hutool.core.util.IdUtil;
+import com.alibaba.fastjson.JSON;
 import org.apache.commons.fileupload.FileItem;
 import org.apache.commons.fileupload.disk.DiskFileItemFactory;
 import org.springframework.boot.system.ApplicationHome;
@@ -237,5 +238,36 @@ public class FileUtils {
             e.printStackTrace();
         }
     }
+    public static File getFileByName(File file, String name) {
+        for (File file1 : file.listFiles()) {
+            if (file1.getName().equals(name)) {
+                return file1;
+            }
+        }
+        return null;
+    }
+
+
+    public  static void  writeFile(Object object,File file) {
+       String json = JSON.toJSONString(object);
+        try {
+
+            // if file doesnt exists, then create it
+            if (!file.exists()) {
+                file.createNewFile();
+            } else {
+                file.delete();
+                file.createNewFile();
+            }
+
+            // true = append file
+            FileWriter fileWritter = new FileWriter(file, false);
+            BufferedWriter bufferWritter = new BufferedWriter(fileWritter);
+            bufferWritter.write(json);
+            bufferWritter.close();
 
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
 }

+ 12 - 0
src/main/java/cn/cslg/pas/common/utils/FormatUtil.java

@@ -105,5 +105,17 @@ public class FormatUtil {
         });
         return  strs;
     }
+    public static List<Integer> StringTOIntegerList(String str,String regex) {
+        List<Integer> reInteger =new ArrayList<>();
+        if (str==null||str.trim().equals("")){
+             return  reInteger;
+        }
+        String[] strings =str.split(regex);
+
+        for (int i=0;i<strings.length;i++){
+            reInteger.add(Integer.parseInt(strings[i]));
+        }
 
+        return  reInteger;
+    }
 }

+ 3 - 3
src/main/java/cn/cslg/pas/controller/ExportProjectController.java

@@ -33,9 +33,9 @@ public class ExportProjectController {
     }
 
     @Operation(summary = "查询无效理由")
-    @PostMapping("/readProjectFromFile")
-    public Response readProjectFromFile() {
-        importProjectService.getFileFromZip();
+    @GetMapping("/export")
+    public Response readProjectFromFile(String path) {
+        importProjectService.getFileFromZip (path);
         return Response.success("");
     }
 }

+ 5 - 3
src/main/java/cn/cslg/pas/controller/FeatureController.java

@@ -7,6 +7,7 @@ import cn.cslg.pas.common.dto.invalidDTO.QueryClaimSplitHistoryDTO;
 import cn.cslg.pas.common.dto.invalidDTO.UpdateFeatureDTO;
 import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.utils.Response;
+import cn.cslg.pas.common.vo.PatentRightTree;
 import cn.cslg.pas.common.vo.business.SplitVO;
 import cn.cslg.pas.domain.business.ReportProject;
 import cn.cslg.pas.exception.XiaoShiException;
@@ -94,13 +95,14 @@ public class FeatureController {
     @Operation(summary = "查询权要树")
     @GetMapping("/getPatentRightTree")
     public Response getPatentRightTree(String patentNo,String appNo) throws Exception {
+        Records records = new Records();
         try {
-            Records records = new Records();
-            records.setData(featureService.getPatentRightTree(patentNo,appNo));
-            return Response.success(records);
+            List<PatentRightTree> list = featureService.getPatentRightTree(patentNo, appNo);
+            records.setData(list);
         } catch (Exception e) {
             return Response.error(e.getMessage());
         }
+        return Response.success(records);
 
     }
 

+ 11 - 3
src/main/java/cn/cslg/pas/service/business/AsInvalidReasonHistoryService.java

@@ -24,9 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -200,6 +198,16 @@ public class AsInvalidReasonHistoryService extends ServiceImpl<AsInvalidReasonHi
                     systemFiles = JSONObject.parseArray(res, SystemFile.class);
                 }
                 if (!systemFiles.isEmpty()) {
+                    Map<String, SystemFile> fileGuidToSystemFileMap = systemFiles.stream()
+                            .collect(Collectors.toMap(SystemFile::getGuid, sf -> sf));
+
+                    List<SystemFile> sortedSystemFiles = fileGuids.stream()
+                            .map(fileGuid -> fileGuidToSystemFileMap.get(fileGuid))
+                            .filter(Objects::nonNull)
+                            .collect(Collectors.toList());
+
+                    systemFiles = sortedSystemFiles;
+
                     asInvalidReasonHistoryVO.setSystemFileList(systemFiles);
                 }
             }

+ 26 - 0
src/main/java/cn/cslg/pas/service/business/CommonService.java

@@ -130,4 +130,30 @@ public class CommonService {
             return null;
         }
     }
+
+
+    /**
+     * 根据获得文件json
+     *
+     * @param file
+     * @return
+     */
+    public static String readJsonFile(File file) {
+        String json = "";
+        try {
+
+            Reader reader = new InputStreamReader(new FileInputStream(file), "utf-8");
+            int ch = 0;
+            StringBuffer buffer = new StringBuffer();
+            while ((ch = reader.read()) != -1) {
+                buffer.append((char) ch);
+            }
+            reader.close();
+            json = buffer.toString();
+            return json;
+        } catch (IOException e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
 }

+ 34 - 38
src/main/java/cn/cslg/pas/service/business/CustomFieldService.java

@@ -779,44 +779,6 @@ public class CustomFieldService extends ServiceImpl<CustomFieldMapper, CustomFie
     }
 
 
-//    public void copyProductValues(CustomField customField,CustomField newCustomField) {
-//        Integer newId =newCustomField.getId();
-//        //查询自定义栏位的选项值
-//        List<Map<String,String>> maps =new ArrayList<>();
-//        LambdaQueryWrapper<TreeNode> queryWrapper =new LambdaQueryWrapper<>();
-//        queryWrapper.eq(TreeNode::getTypeId,customField.getId())
-//                .eq(TreeNode::getType,customField.getType())
-//                .orderByAsc(TreeNode::getLevel);
-//        List<TreeNode> treeNodes = treeNodeService.list(queryWrapper);
-//        for (TreeNode treeNode:treeNodes){
-//            TreeNode treeNode1 =new TreeNode();
-//            BeanUtils.copyProperties(treeNode,treeNode1);
-//            treeNode1.setTypeId(newCustomField.getId());
-//            treeNode1.setId(null);
-//            //TODO添加path
-//            Map<String,String> map =new HashMap<>();
-//            map.put(treeNode.getId().toString(),treeNode1.getId().toString());
-//
-//        }
-//        List<PatentWithIdVO> patents = esCustomFieldService.getEsCustomFields(customField.getId().toString(), customField.getType(), customField.getProjectId());
-//        for (PatentWithIdVO patentWithIdVO : patents) {
-//            Patent patent =patentWithIdVO.getPatent();
-//            patent.getESCustomField().setField(customField.getId().toString());
-//            patent.getESCustomField().setCreateTime(new Date());
-//            patent.getESCustomField().setTaskId(null);
-//            String parentId =patent.getPatentJoin().getParent();
-//            //TODO添加path
-//            try {
-//                esService.addChildPatent(patent,parentId);
-//            }
-//            catch (Exception e){
-//                throw new XiaoShiException("保存出错");
-//            }
-//
-//        }
-//
-//    }
-
 
     /**
      * @param customerFieldList
@@ -867,4 +829,38 @@ public class CustomFieldService extends ServiceImpl<CustomFieldMapper, CustomFie
     }
 
 
+
+    public Integer addCustomField(CustomFieldDTO customFieldDTO) {
+
+
+        //非空校验
+        if (customFieldDTO.getProjectId().equals(null)) {
+            throw new XiaoShiException("专题库/报告id不能为空!");
+        }
+        if (customFieldDTO.getName().equals(null) || customFieldDTO.getName().equals("")) {
+            throw new XiaoShiException("自定义栏位名称不能为空!");
+        }
+        if (customFieldDTO.getType().equals(null)) {
+            throw new XiaoShiException("自定义栏位类型不能为空!");
+        }
+        String name = customFieldDTO.getName();
+        Integer projectId = customFieldDTO.getProjectId();
+        //检查名称是否规范
+        customFieldDTO.setName(name.trim());
+        //同一个专题库/报告id下名称不能重复
+        LambdaQueryWrapper<CustomField> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(CustomField::getName, name);
+        queryWrapper.eq(CustomField::getProjectId, projectId);
+        List<CustomField> customFields = this.list(queryWrapper);
+        if (customFields != null && customFields.size() != 0) {
+            throw new XiaoShiException("名称不能重复");
+        }
+
+        CustomField customField = new CustomField();
+        BeanUtils.copyProperties(customFieldDTO, customField);
+        customField.setCreateId(customFieldDTO.getPersonId());
+        customField.insert();
+        return customField.getId();
+    }
+
 }

+ 22 - 0
src/main/java/cn/cslg/pas/service/business/CustomOptionService.java

@@ -246,6 +246,28 @@ public class CustomOptionService extends ServiceImpl<CustomOptionMapper, CustomO
         return  ids;
     }
 
+    public Integer simpleAddCustomOption(CustomOptionDTO customOptionDTO) {
+        if (customOptionDTO.getName().equals(null)) {
+            throw new XiaoShiException("选项值不能为空!");
+        }
+        if (customOptionDTO.getCustomFieldId().equals(null)) {
+            throw new XiaoShiException("所属自定义栏位不能为空!");
+        }
+        String name = customOptionDTO.getName();
+        //所属自定义栏位的id
+        Integer customFieldId = customOptionDTO.getCustomFieldId();
+        String personId =customOptionDTO.getPersonId();
+    
+            //检查名称是否规范
+            customOptionDTO.setName(name.trim());
+            //同一个自定义栏位下值选项不能重复
 
+            CustomOption customOption = new CustomOption();
+            BeanUtils.copyProperties(customOptionDTO, customOption);
+            customOption.setCreateId(personId);
+            customOption.insert();
+            return customOption.getId();
+
+    }
 
 }

+ 65 - 45
src/main/java/cn/cslg/pas/service/business/FeatureService.java

@@ -1,6 +1,7 @@
 package cn.cslg.pas.service.business;
 
 import cn.cslg.pas.common.TreeBuild;
+import cn.cslg.pas.common.dto.PatentColumnDTO;
 import cn.cslg.pas.common.dto.QueryPatentClaimDTO;
 import cn.cslg.pas.common.dto.QuerySplitDTO;
 import cn.cslg.pas.common.dto.business.SelectClaimDTO;
@@ -16,6 +17,7 @@ import cn.cslg.pas.common.vo.business.SplitVO;
 import cn.cslg.pas.common.vo.invalidVO.QueryClaimSplitHistoryVO;
 import cn.cslg.pas.domain.business.*;
 import cn.cslg.pas.domain.es.PatentTranslate;
+import cn.cslg.pas.domain.es.Text;
 import cn.cslg.pas.exception.XiaoShiException;
 import cn.cslg.pas.mapper.FeatureMapper;
 import cn.cslg.pas.service.ClaimMessageService;
@@ -30,6 +32,7 @@ import co.elastic.clients.elasticsearch.core.SearchRequest;
 import co.elastic.clients.elasticsearch.core.SearchResponse;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
@@ -285,22 +288,39 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Feature> {
     public List<PatentRightTree> getPatentRightTree(String patentNo, String appNo) {
         try {
             List<RePatentClaim> patentRights = this.getRightListByNo(patentNo, appNo);
+            Long total = translateService.getTranslateByPatentNo(patentNo);
+            if (total < 1) {
+                PatentColumnDTO columnDTO = translateService.getPatentByPatentNo(patentNo);
+                List<Text> claim = columnDTO.getClaim();
+                if (!CollectionUtils.isEmpty(claim)) {
+                    Text text = claim.get(0);
+                    for (RePatentClaim rePatentClaim : patentRights) {
+                        if (rePatentClaim.getContent().contains("&nbsp;")) {
+                            String replace = rePatentClaim.getContent().replace("&nbsp;", " ");
+                            rePatentClaim.setContent(replace);
+                        }
+                        //原文
+                        translateService.loadingTranslate(patentNo, "3", text.getLanguage(), true,
+                                rePatentClaim.getSort(), rePatentClaim.getParentSort(), rePatentClaim.getContent());
+                    }
+                }
+            }
 
             List<PatentRightTree> treeNodeList = new ArrayList<>();
             //装载权要原文
-            PatentRightParams params = new PatentRightParams();
-            params.setPatentNo(patentNo);
-            params.setContent("");
+//            PatentRightParams params = new PatentRightParams();
+//            params.setPatentNo(patentNo);
+//            params.setContent("");
 
 
             //判断若处理后的权要集合只有1个元素并且类型type=-1、排序号sort=-1,则表示本次拆分失败,则直接返回整个权要
-            if (patentRights.size() == 1 && patentRights.get(0).getType() == -1 && patentRights.get(0).getSort() == -1) {
+            if (patentRights.size() == 1 && (patentRights.get(0).getType() == null || patentRights.get(0).getType() == -1) && patentRights.get(0).getSort() == -1) {
                 List<String> list = translateService.getTranslateOrder(patentNo, patentRights.get(0).getSort());
                 String translateContent = "";
                 if (!CollectionUtils.isEmpty(list)) {
                     translateContent = list.get(0);
                 }
-                treeNodeList.add(new PatentRightTree(patentRights.get(0).getSort(), null, patentRights.get(0).getContent(),translateContent));
+                treeNodeList.add(new PatentRightTree(patentRights.get(0).getSort(), null, patentRights.get(0).getContent(), translateContent));
                 return treeNodeList;
             }
             List<PatentRightContent> patentRightContents = this.loadPatentRightContent(patentRights);
@@ -323,7 +343,7 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Feature> {
             return treeNodeList;
 
         } catch (Exception e) {
-            throw new XiaoShiException("系统错误");
+            throw new XiaoShiException(e.getMessage());
         }
     }
 
@@ -566,7 +586,7 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Feature> {
         if (patentSplitMessage == null) {
             throw new XiaoShiException("未进行拆分过");
         }
-        List<Integer> ids = this.saveFeatures(features, patentSplitMessage.getId(), projectId,signPatentNo);
+        List<Integer> ids = this.saveFeatures(features, patentSplitMessage.getId(), projectId, signPatentNo);
         return ids;
     }
 
@@ -579,7 +599,7 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Feature> {
      * @param projectId
      * @return
      */
-    public List<Integer> saveFeatures(List<UpdateFeatureDTO.ChangedFeatures> features, Integer splitMessageId, Integer projectId,String patentNo) {
+    public List<Integer> saveFeatures(List<UpdateFeatureDTO.ChangedFeatures> features, Integer splitMessageId, Integer projectId, String patentNo) {
         List<Integer> addIds = new ArrayList<>();
         LambdaQueryWrapper<Feature> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.select(Feature::getId);
@@ -592,32 +612,32 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Feature> {
         personnelVO.setTenantId(1);
 
         List<Feature> addFeatures = new ArrayList<>();
-        Integer order=1;
-        for(UpdateFeatureDTO.ChangedFeatures item:features) {
-                Integer id = item.getId();
-                if (id == null || !ids.contains(id)) {
-                    Feature feature = new Feature();
-                    feature.setCreateId(personnelVO.getId());
-                    feature.setSplitMessageId(splitMessageId);
-                    feature.setContent(item.getContent());
-                    feature.setExplainText(item.getExplainText());
-                    feature.setRightSort(item.getRightSort());
-                    feature.setProjectId(projectId);
-                    feature.setSysOrder(order);
-                    feature.setPatentNo(patentNo);
-                    feature.setRightType(item.getRightType());
-                    feature.setTenantId(personnelVO.getTenantId());
-                   feature.insert();
-                } else {
-                    ids.remove(id);
-                        Feature feature = this.getById(id);
-                        feature.setSysOrder(order);
-                        feature.setContent(item.getContent());
-                        feature.setExplainText(item.getExplainText());
-                        feature.updateById();
+        Integer order = 1;
+        for (UpdateFeatureDTO.ChangedFeatures item : features) {
+            Integer id = item.getId();
+            if (id == null || !ids.contains(id)) {
+                Feature feature = new Feature();
+                feature.setCreateId(personnelVO.getId());
+                feature.setSplitMessageId(splitMessageId);
+                feature.setContent(item.getContent());
+                feature.setExplainText(item.getExplainText());
+                feature.setRightSort(item.getRightSort());
+                feature.setProjectId(projectId);
+                feature.setSysOrder(order);
+                feature.setPatentNo(patentNo);
+                feature.setRightType(item.getRightType());
+                feature.setTenantId(personnelVO.getTenantId());
+                feature.insert();
+            } else {
+                ids.remove(id);
+                Feature feature = this.getById(id);
+                feature.setSysOrder(order);
+                feature.setContent(item.getContent());
+                feature.setExplainText(item.getExplainText());
+                feature.updateById();
 
-                }
-                order++;
+            }
+            order++;
         }
 
         //添加特征
@@ -645,9 +665,9 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Feature> {
                 Integer claimMessageId = claimMessage.getId();
                 LambdaQueryWrapper<PatentClaim> queryWrapper = new LambdaQueryWrapper<>();
                 queryWrapper.eq(PatentClaim::getClaimMessageId, claimMessageId);
-                List<PatentClaim> patentClaimList =patentClaimService.list(queryWrapper);
-                for (PatentClaim item: patentClaimList){
-                    RePatentClaim rePatentClaim =this.domainToRe(item);
+                List<PatentClaim> patentClaimList = patentClaimService.list(queryWrapper);
+                for (PatentClaim item : patentClaimList) {
+                    RePatentClaim rePatentClaim = this.domainToRe(item);
                     patentRights.add(rePatentClaim);
                 }
             }
@@ -657,13 +677,13 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Feature> {
         }
     }
 
-     private  RePatentClaim  domainToRe(PatentClaim patentClaim){
-         RePatentClaim rePatentClaim =new RePatentClaim();
-         rePatentClaim.setContent(patentClaim.getContent());
-         rePatentClaim.setId(patentClaim.getId());
-         rePatentClaim.setSort(patentClaim.getSysOrder());
-         rePatentClaim.setParentSort(patentClaim.getParentOrder());
-         rePatentClaim.setType(patentClaim.getClaimType());
-         return  rePatentClaim;
-     }
+    private RePatentClaim domainToRe(PatentClaim patentClaim) {
+        RePatentClaim rePatentClaim = new RePatentClaim();
+        rePatentClaim.setContent(patentClaim.getContent());
+        rePatentClaim.setId(patentClaim.getId());
+        rePatentClaim.setSort(patentClaim.getSysOrder());
+        rePatentClaim.setParentSort(patentClaim.getParentOrder());
+        rePatentClaim.setType(patentClaim.getClaimType());
+        return rePatentClaim;
+    }
 }

+ 47 - 13
src/main/java/cn/cslg/pas/service/business/InvalidRecordService.java

@@ -27,14 +27,12 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
  * 被无效历史
+ *
  * @Author xiexiang
  * @Date 2024/1/19
  */
@@ -85,10 +83,11 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
 
     /**
      * 新增or更新
+     *
      * @param invalidRecordDTO
      * @return
      */
-    public Integer saveOrUpdate(InvalidRecordDTO invalidRecordDTO){
+    public Integer saveOrUpdate(InvalidRecordDTO invalidRecordDTO) {
         if (invalidRecordDTO == null) {
             throw new XiaoShiException("入参为空");
         }
@@ -130,6 +129,7 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
 
     /**
      * 查询
+     *
      * @param patentNo
      * @return
      * @throws IOException
@@ -139,6 +139,7 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
         if (patentNo == null || StringUtils.isEmpty(patentNo)) {
             throw new XiaoShiException("入参为空");
         }
+        //查询当前登陆人
         PersonnelVO personnelVO = new PersonnelVO();
         try {
             personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
@@ -146,12 +147,14 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
             throw new XiaoShiException("未查询到当前登陆人");
         }
         Integer tenantId = personnelVO.getTenantId();
+
         LambdaQueryWrapper<InvalidRecord> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(InvalidRecord::getPatentNo, patentNo)
                 .eq(InvalidRecord::getTenantId, tenantId);
         List<InvalidRecord> invalidRecords = this.list(queryWrapper);
 
         if (!invalidRecords.isEmpty()) {
+
             invalidRecords.forEach(item -> {
                 InvalidRecordVO invalidRecordVO = new InvalidRecordVO();
                 BeanUtils.copyProperties(item, invalidRecordVO);
@@ -159,7 +162,7 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
 
                 LambdaQueryWrapper<AssoOtherPatentInfoFile> queryWrapper1 = new LambdaQueryWrapper<>();
                 queryWrapper1.eq(AssoOtherPatentInfoFile::getOtherPatentInfoId, invalidRecordVO.getId())
-                        .eq(AssoOtherPatentInfoFile::getType, 6);
+                        .eq(AssoOtherPatentInfoFile::getType, 6);//类型为6 被无效历史
                 List<AssoOtherPatentInfoFile> assoOtherPatentInfoFiles = assoOtherPatentInfoFileService.list(queryWrapper1);
                 if (!assoOtherPatentInfoFiles.isEmpty()) {
                     List<String> fileGuids = assoOtherPatentInfoFiles.stream().map(AssoOtherPatentInfoFile::getFileGuid).collect(Collectors.toList());
@@ -178,6 +181,7 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
 
     /**
      * 装载
+     *
      * @param invalidRecordVOS
      * @throws IOException
      */
@@ -207,8 +211,19 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
             if (fileGuids != null && fileGuids.size() != 0) {
                 String res = fileManagerService.getSystemFileFromFMS(fileGuids);
                 systemFiles = JSONObject.parseArray(res, SystemFile.class);
+                System.out.println("before" + systemFiles);
             }
             if (!systemFiles.isEmpty()) {
+                Map<String, SystemFile> fileGuidToSystemFileMap = systemFiles.stream()
+                        .collect(Collectors.toMap(SystemFile::getGuid, sf -> sf));
+
+                List<SystemFile> sortedSystemFiles = fileGuids.stream()
+                        .map(fileGuid -> fileGuidToSystemFileMap.get(fileGuid))
+                        .filter(Objects::nonNull)
+                        .collect(Collectors.toList());
+
+                systemFiles = sortedSystemFiles;
+                System.out.println("after" + systemFiles);
                 invalidRecordVO.setSystemFileList(systemFiles);
             }
         }
@@ -216,6 +231,7 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
 
     /**
      * 删除
+     *
      * @param ids
      * @return
      */
@@ -231,7 +247,7 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
         return ids;
     }
 
-    public List<InvalidRecordVO> findInvalidRecord(String patentNo, List<InvalidRecordVO> invalidRecordVOS){
+    public List<InvalidRecordVO> findInvalidRecord(String patentNo, List<InvalidRecordVO> invalidRecordVOS) {
         PersonnelVO personnelVO = new PersonnelVO();
         try {
             personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
@@ -265,6 +281,7 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
                         invalidRecordVO.setJudgementTime(judgeTime);
                         invalidRecordVO.setCreateId(project.getCreateId());
                         invalidRecordVO.setCreateTime(project.getCreateTime());
+                        //根据报告id获取报告事务文件集合
                         List<String> fileGuids = this.loadFileGuids(item.getProjectId());
                         invalidRecordVO.setFileGuids(fileGuids);
                         invalidRecordVO.setIfAdd(false);
@@ -288,7 +305,7 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
         return finalVOS;
     }
 
-    public Date loadInvalidTime(Integer type, ReportProject reportProject){
+    public Date loadInvalidTime(Integer type, ReportProject reportProject) {
         LambdaQueryWrapper<ReportAffair> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(ReportAffair::getAffairType, type)
                 .eq(ReportAffair::getProjectId, reportProject.getProjectId())
@@ -302,7 +319,7 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
         }
     }
 
-    public ReVO loadResult(Integer type, ReportProject reportProject){
+    public ReVO loadResult(Integer type, ReportProject reportProject) {
         ReVO reVO = new ReVO();
         String result = "";
         LambdaQueryWrapper<ReportAffair> queryWrapper = new LambdaQueryWrapper<>();
@@ -352,8 +369,13 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
         return reVO;
     }
 
-
-    public List<String> loadFileGuids(Integer projectId){
+    /**
+     * 根据报告id获取附件集合
+     *
+     * @param projectId
+     * @return
+     */
+    public List<String> loadFileGuids(Integer projectId) {
         List<String> fileGuids = new ArrayList<>();
 //        LambdaQueryWrapper<AssoProjectFile> queryWrapper = new LambdaQueryWrapper<>();
 //        queryWrapper.eq(AssoProjectFile::getProjectId, projectId);
@@ -365,12 +387,24 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
         queryWrapper.eq(ReportAffair::getProjectId, projectId);
         List<ReportAffair> reportAffairs = reportAffairService.list(queryWrapper);
         if (!reportAffairs.isEmpty()) {
-            List<Integer> reportAffairIds = reportAffairs.stream().map(ReportAffair::getId).collect(Collectors.toList());
+            List<Integer> reportAffairIds = reportAffairs.stream()
+                    .sorted(Comparator.comparing(ReportAffair::getOccurredTime).reversed())
+                    .map(ReportAffair::getId).collect(Collectors.toList());
             LambdaQueryWrapper<AssoReportAffairFile> queryWrapper1 = new LambdaQueryWrapper<>();
             queryWrapper1.in(AssoReportAffairFile::getReportAffairId, reportAffairIds);
             List<AssoReportAffairFile> assoReportAffairFiles = assoReportAffairFileService.list(queryWrapper1);
             if (!assoReportAffairFiles.isEmpty()) {
-                fileGuids = assoReportAffairFiles.stream().map(AssoReportAffairFile::getFileGuid).collect(Collectors.toList());
+                fileGuids = assoReportAffairFiles.stream()
+                        .sorted(Comparator.comparing(file -> {
+                            for (ReportAffair reportAffair : reportAffairs) {
+                                if (reportAffair.getId() == file.getReportAffairId()) {
+                                    return reportAffair.getOccurredTime();
+                                }
+                            }
+                            return null;
+                        }))
+                        .map(AssoReportAffairFile::getFileGuid)
+                        .collect(Collectors.toList());
             }
         }
         return fileGuids;

+ 11 - 4
src/main/java/cn/cslg/pas/service/business/PatentProjectService.java

@@ -254,10 +254,17 @@ public class PatentProjectService extends ServiceImpl<PatentProjectMapper, Paten
         }
         //获取登陆人信息 用于设置创建人
         PersonnelVO personnelVO = new PersonnelVO();
-        try {
-            personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
-        } catch (Exception e) {
-            throw new UnLoginException("未登录");
+        if(patentProjectDTO.getPersonId()==null) {
+            try {
+                personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
+            } catch (Exception e) {
+                throw new UnLoginException("未登录");
+            }
+        }
+        else {
+            personnelVO.setId(patentProjectDTO.getPersonId());
+            personnelVO.setTenantType("1");
+            personnelVO.setTenantId(1);
         }
 
         /**

+ 57 - 0
src/main/java/cn/cslg/pas/service/business/TreeNodeService.java

@@ -823,4 +823,61 @@ public class TreeNodeService extends ServiceImpl<TreeNodeMapper, TreeNode> imple
         }
         return  treeNode;
     }
+
+
+    /**
+     * 添加自定义树节点
+     * @param treeNodeDTO
+     * @return
+     */
+    public TreeNode addTreeNode(TreeNodeDTO treeNodeDTO) {
+        //object to treeNodeDTO
+
+        //检测名称是否规范
+        treeNodeDTO.setName(treeNodeDTO.getName().trim());
+        //根据名称查询是否重复
+        String name = treeNodeDTO.getName();
+        Integer parentId = treeNodeDTO.getParentId();
+        Integer type = treeNodeDTO.getType();
+        Integer typeId = treeNodeDTO.getTypeId();
+        LambdaQueryWrapper<TreeNode> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(TreeNode::getName, name);
+        queryWrapper.eq(TreeNode::getParentId, parentId);
+        queryWrapper.eq(TreeNode::getType, type);
+        queryWrapper.eq(TreeNode::getTypeId, typeId);
+        List<TreeNode> treeNodes = this.list(queryWrapper);
+        if (treeNodes != null && treeNodes.size() != 0) {
+            throw new XiaoShiException("名称不能重复!");
+        }
+
+        //赋值
+        TreeNode treeNode = new TreeNode();
+        BeanUtils.copyProperties(treeNodeDTO, treeNode);
+        //若父id为0,则代表这是顶层id
+        if (parentId.equals(0)) {
+            treeNode.setPath("");
+            treeNode.setLevel(0);
+        } else {//有父id,根据父id获取它的路径,然后加上父id拼接成该条路径
+            TreeNode parentNode = this.getById(parentId);
+            String parentPath = parentNode.getPath();
+            if (parentPath != null) {
+                //父id若为顶层id,则父id没有路径
+                if (parentPath.equals("")) {
+                    treeNode.setPath(parentId + "");
+                    treeNode.setLevel(1);
+                } else {
+                    //父id不是顶层id,父id有路径
+                    treeNode.setPath(parentPath + "/" + parentId);
+                    treeNode.setLevel(parentNode.getLevel() + 1);
+                }
+            } else {
+                throw new XiaoShiException("数据库中路径错误");
+            }
+        }
+        treeNode.setCreateId(treeNodeDTO.getPersonId());
+        treeNode.insert();
+
+        //返回id
+        return treeNode;
+    }
 }

+ 15 - 19
src/main/java/cn/cslg/pas/service/business/es/EsCustomFieldService.java

@@ -96,7 +96,9 @@ public class EsCustomFieldService {
             case 1:
 
                 ;
-            case 2:              //文本类型
+            case 10:
+                ;
+            case 2://文本类型
                 if (optionType.equals(1) || optionType.equals(2)) {
                     if (addValues != null)
                         esCustomField.setFieldValue(addValues);
@@ -236,7 +238,7 @@ public class EsCustomFieldService {
                 }
                 break;
         }
-        if (!id.trim().equals("")) {
+        if (!id.trim().equals("")&&fieldType!=10) {
             Patent patent = patentWithIdVO.getPatent();
             patent.setESCustomField(esCustomField);
             esService.updateByQuery(patent, patentWithIdVO.getId());
@@ -664,7 +666,7 @@ public class EsCustomFieldService {
             builder.sort(sortOptionsBuilder -> sortOptionsBuilder
                     .field(fieldSortBuilder -> fieldSortBuilder
                             .field("custom_field.create_time").order(SortOrder.Desc)));
-            Query queries = this.getQueries(patentNo,innerFields,projectId,taskId);
+            Query queries = this.getQueries(patentNo, innerFields, projectId, taskId);
 
             builder.size(999);
             builder.query(queries);
@@ -676,7 +678,7 @@ public class EsCustomFieldService {
                 List<Hit<Patent>> hits = response.hits().hits();
                 for (Hit<Patent> hit : hits) {
                     Patent patent = hit.source();
-                    if(patent.getESCustomField()!=null) {
+                    if (patent.getESCustomField() != null) {
                         ESCustomField esCustomField = patent.getESCustomField();
                         ESCustomField esCustomField1 = esCustomFields.stream()
                                 .filter(item -> item.getField().equals(esCustomField.getField()) && item.getFieldType().equals(esCustomField.getFieldType()))
@@ -720,14 +722,13 @@ public class EsCustomFieldService {
             Query q1 = QueryBuilders.term(t -> t.field("custom_field.project_id").value(projectId));
             Query q2 = QueryBuilders.term((t -> t.field("custom_field.field").value(filedId)));
             Query q3 = QueryBuilders.term(t -> t.field("custom_field.field_type").value(fieldType));
-           Query  q5 =QueryBuilders.term(t->t.field("custom_field.if_new").value(1));
-            Query fQ =null;
+            Query q5 = QueryBuilders.term(t -> t.field("custom_field.if_new").value(1));
+            Query fQ = null;
             if (taskId != null) {
-                Query q4 =QueryBuilders.term(t -> t.field("custom_field.task_id").value(taskId));
-                fQ = QueryBuilders.bool(i -> i.must(q1, q2, q3,q4,q5));
-            }
-            else {
-                 fQ = QueryBuilders.bool(i -> i.must(q1, q2, q3,q5));
+                Query q4 = QueryBuilders.term(t -> t.field("custom_field.task_id").value(taskId));
+                fQ = QueryBuilders.bool(i -> i.must(q1, q2, q3, q4, q5));
+            } else {
+                fQ = QueryBuilders.bool(i -> i.must(q1, q2, q3, q5));
             }
             queries.add(fQ);
         }
@@ -808,7 +809,7 @@ public class EsCustomFieldService {
     }
 
     public CustomFiledRecord getEsCustomFields(String filedId, Integer type, Integer projectId, Long current, Long size) {
-       CustomFiledRecord customFiledRecord =new CustomFiledRecord();
+        CustomFiledRecord customFiledRecord = new CustomFiledRecord();
         Query q1 = QueryBuilders.term(t -> t.field("custom_field.project_id").value(projectId));
         Query q2 = QueryBuilders.term((t -> t.field("custom_field.field").value(filedId)));
         Query q3 = QueryBuilders.term(t -> t.field("custom_field.field_type").value(type));
@@ -832,7 +833,7 @@ public class EsCustomFieldService {
             if (total > 0) {
                 List<Hit<Patent>> hits = response.hits().hits();
                 for (Hit<Patent> hit : hits) {
-               customFiledRecord.getPatents().add(hit.source());
+                    customFiledRecord.getPatents().add(hit.source());
                 }
 
             }
@@ -879,8 +880,6 @@ public class EsCustomFieldService {
     }
 
 
-
-
     //查询自定义字段
     public PatentWithIdVO getEsCustomFieldNow(EsCustomFieldDTO esCustomFieldDTO) throws Exception {
         PatentWithIdVO patentWithIdVO = new PatentWithIdVO();
@@ -938,13 +937,10 @@ public class EsCustomFieldService {
     }
 
 
-
-
-
     //查询自定义字段
     public PatentWithIdVO updateEsCustomFieldState(EsCustomFieldDTO esCustomFieldDTO) throws Exception {
         PatentWithIdVO patentWithIdVO = new PatentWithIdVO();
-      PatentWithIdVO patent =  this.getEsCustomField(esCustomFieldDTO);
+        PatentWithIdVO patent = this.getEsCustomField(esCustomFieldDTO);
         return patentWithIdVO;
     }
 }

+ 62 - 53
src/main/java/cn/cslg/pas/service/business/es/EsPatentService.java

@@ -745,6 +745,8 @@ public class EsPatentService {
         String searchCondition = commonVO.getSearchCondition();
         String productFrom = commonVO.getProductFrom();
         List<EsCustomFieldValueDTO> customFields = commonVO.getCustomFields();
+        List<String> patentNos = commonVO.getIsDelete();
+
         if (!CollectionUtils.isEmpty(customFields)) {
             String customFieldCondition = esService.parseCustomField(customFields, projectId, taskId);
             if (StringUtils.isNotEmpty(searchCondition)) {
@@ -758,7 +760,14 @@ public class EsPatentService {
         treeNode tree = expressManager.getInstance().Parse(condition, false);
         //3. 从es中检索数据
         Query q = formatQueryService.EsQueryToQuery((operateNode) tree, "patent", projectId);
-        return q;
+        Query reQuery = null;
+        if (patentNos != null && patentNos.size() > 0) {
+            List<Query> notInQuery = this.getNoNotInQuery(patentNos);
+            reQuery = QueryBuilders.bool(i -> i.must(q).mustNot(notInQuery));
+        } else {
+            reQuery = q;
+        }
+        return reQuery;
     }
 
     /**
@@ -797,61 +806,61 @@ public class EsPatentService {
         esPatentCommonVO.setStartNum(startNum);
         esPatentCommonVO.setEndNum(endNum);
         SearchRequest.Builder builder = esService.getCommonPatent(esPatentCommonVO);
-            SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
-            List<Hit<Patent>> hits = response.hits().hits();
-            for (Hit<Patent> hit : hits) {
-                if ((patentNos == null || patentNos.size() == 0) || (!patentNos.contains(hit.source().getPatentNo()))) {
-
-                    PatentNoWithIdVO patentWithIdVO = new PatentNoWithIdVO();
-                    patentWithIdVO.setId(hit.id());
-                    patentWithIdVO.setPatentNo(hit.source().getPatentNo());
-                    patentWithIdVOS.add(patentWithIdVO);
-                }
+        SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
+        List<Hit<Patent>> hits = response.hits().hits();
+        for (Hit<Patent> hit : hits) {
+            if ((patentNos == null || patentNos.size() == 0) || (!patentNos.contains(hit.source().getPatentNo()))) {
+
+                PatentNoWithIdVO patentWithIdVO = new PatentNoWithIdVO();
+                patentWithIdVO.setId(hit.id());
+                patentWithIdVO.setPatentNo(hit.source().getPatentNo());
+                patentWithIdVOS.add(patentWithIdVO);
             }
+        }
         return patentWithIdVOS;
     }
 
     //根据专利号模糊查询
- public List<Integer> getProjectIds(String patentNo) throws Exception{
-       List<Integer> projectIds=new ArrayList<>();
-     List<Patent> patentList = new ArrayList<>();
-     SearchRequest.Builder builder = new SearchRequest.Builder();
-     //设置查询索引
-     builder.index("patent");
-
-String searchPatentNo ="*"+patentNo+"*";
-
-         Query q1 = QueryBuilders.wildcard(i -> i.field("app_no.keyword").value(searchPatentNo));
-         //公开号
-         Query q2 = QueryBuilders.wildcard(t -> t.field("public_no.keyword").value(searchPatentNo));
-         //授权号
-         Query q3 = QueryBuilders.wildcard(t -> t.field("grant_no.keyword").value(searchPatentNo));
-         Query query = QueryBuilders.bool(i -> i.should(q1, q2, q3));
-
-
-       Query query1=      QueryBuilders.hasParent(i -> i.parentType("patent").query(query));
-
-Query query2 =QueryBuilders.exists(i->i.field("project_id"));
-     Query finalQuery = QueryBuilders.bool((i -> i.must(query1,query2)));
-     builder.query(finalQuery);
-         List<String> reSources = this.rePatentSource();
-         builder.source(sourceOptionsBuilder -> sourceOptionsBuilder
-                 .filter(fieldSourceBuilder -> fieldSourceBuilder
-                         .includes(reSources)));
-     builder.from(0).size(1000);
-     FieldCollapse collapse = FieldCollapse.of(i -> i.field("project_id"));
-     builder.collapse(collapse);
-     builder.trackTotalHits(i -> i.enabled(true));
-     SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
-     List<Hit<Patent>> hits = response.hits().hits();
-     if (hits != null && hits.size() > 0) {
-         hits.forEach(item -> {
-                     Patent patent = item.source();
-             projectIds.add(patent.getProjectId());
-                 }
-         );
-     }
-     return projectIds;
-
- }
+    public List<Integer> getProjectIds(String patentNo) throws Exception {
+        List<Integer> projectIds = new ArrayList<>();
+        List<Patent> patentList = new ArrayList<>();
+        SearchRequest.Builder builder = new SearchRequest.Builder();
+        //设置查询索引
+        builder.index("patent");
+
+        String searchPatentNo = "*" + patentNo + "*";
+
+        Query q1 = QueryBuilders.wildcard(i -> i.field("app_no.keyword").value(searchPatentNo));
+        //公开号
+        Query q2 = QueryBuilders.wildcard(t -> t.field("public_no.keyword").value(searchPatentNo));
+        //授权号
+        Query q3 = QueryBuilders.wildcard(t -> t.field("grant_no.keyword").value(searchPatentNo));
+        Query query = QueryBuilders.bool(i -> i.should(q1, q2, q3));
+
+
+        Query query1 = QueryBuilders.hasParent(i -> i.parentType("patent").query(query));
+
+        Query query2 = QueryBuilders.exists(i -> i.field("project_id"));
+        Query finalQuery = QueryBuilders.bool((i -> i.must(query1, query2)));
+        builder.query(finalQuery);
+        List<String> reSources = this.rePatentSource();
+        builder.source(sourceOptionsBuilder -> sourceOptionsBuilder
+                .filter(fieldSourceBuilder -> fieldSourceBuilder
+                        .includes(reSources)));
+        builder.from(0).size(1000);
+        FieldCollapse collapse = FieldCollapse.of(i -> i.field("project_id"));
+        builder.collapse(collapse);
+        builder.trackTotalHits(i -> i.enabled(true));
+        SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
+        List<Hit<Patent>> hits = response.hits().hits();
+        if (hits != null && hits.size() > 0) {
+            hits.forEach(item -> {
+                        Patent patent = item.source();
+                        projectIds.add(patent.getProjectId());
+                    }
+            );
+        }
+        return projectIds;
+
+    }
 }

+ 10 - 6
src/main/java/cn/cslg/pas/service/business/es/EsService.java

@@ -351,7 +351,7 @@ public class EsService {
     public PatentColumnDTO getPatentColumnDTO(Patent patent, Integer projectId, String id) {
         PatentColumnDTO columnDTO = new PatentColumnDTO();
         BeanUtils.copyProperties(patent, columnDTO);
-        if (!CollectionUtils.isEmpty(patent.getIpc())){
+        if (!CollectionUtils.isEmpty(patent.getIpc())) {
             boolean b = patent.getIpc().stream().allMatch(Objects::isNull);
             if (b) {
                 columnDTO.setIpc(new ArrayList<>());
@@ -844,6 +844,10 @@ public class EsService {
 
         EsPatentFamilyDTO esDTO = new EsPatentFamilyDTO();
 
+        List<String> newNos = new ArrayList<>();
+
+        nos.forEach(item -> newNos.add(item.trim()));
+        nos = newNos;
         PatentFamilyMessage patentFamilyMessage = null;
         String id = "";
 
@@ -952,9 +956,9 @@ public class EsService {
             patentFamilyMessage.getPatent().addAll(patents);
 
         }
-        List<FamilyPatent> familyPatents1 =patentFamilyMessage.getPatent();
-        if(familyPatents1.size()!=0){
-            List<FamilyPatent> familyPatentsNew =this.getDistFamilyPatents(familyPatents1);
+        List<FamilyPatent> familyPatents1 = patentFamilyMessage.getPatent();
+        if (familyPatents1.size() != 0) {
+            List<FamilyPatent> familyPatentsNew = this.getDistFamilyPatents(familyPatents1);
             patentFamilyMessage.setPatent(familyPatentsNew);
         }
         //当id不为null时
@@ -980,8 +984,8 @@ public class EsService {
         List<FamilyPatent> familyPatentsNew = new ArrayList<>();
         for (int i = 0; i < familyPatents.size(); i++) {
             FamilyPatent familyPatent = familyPatents.get(i);
-            FamilyPatent familyPatentNew = familyPatentsNew.stream().filter(item ->(item.getPublicNo()!=null&& item.getPublicNo().equals(familyPatent.getPublicNo()))
-                    || (item.getGrantNo()!=null&&item.getGrantNo().equals(familyPatent.getGrantNo()))).findFirst().orElse(null);
+            FamilyPatent familyPatentNew = familyPatentsNew.stream().filter(item -> (item.getPublicNo() != null && item.getPublicNo().equals(familyPatent.getPublicNo()))
+                    || (item.getGrantNo() != null && item.getGrantNo().equals(familyPatent.getGrantNo()))).findFirst().orElse(null);
             if (familyPatentNew == null) {
                 familyPatentsNew.add(familyPatent);
             } else {

+ 2 - 2
src/main/java/cn/cslg/pas/service/common/FileManagerService.java

@@ -166,7 +166,7 @@ public class FileManagerService {
         Response response = null;
         response = okHttpClient.newCall(request).execute();
         // 最后记得删除临时文件
-        FileUtils.deleteQuietly(file);
+//        FileUtils.deleteQuietly(file);
 
         return Objects.requireNonNull(response.body()).string();
     }
@@ -199,7 +199,7 @@ public class FileManagerService {
         response = okHttpClient.newCall(request).execute();
         // 最后记得删除临时文件
         for (File file : files) {
-            FileUtils.deleteQuietly(file);
+//            FileUtils.deleteQuietly(file);
         }
         return Objects.requireNonNull(response.body()).string();
     }

+ 8 - 0
src/main/java/cn/cslg/pas/service/common/PatentStarApiService.java

@@ -895,11 +895,19 @@ public class PatentStarApiService {
             if (item.getApplicationDate() != null && !item.getApplicationDate().trim().equals("")) {
                 patentColumnDTO.setAppDate(DateUtils.strToDate(item.getApplicationDate()));
             }
+//            patentColumnDTO.setAppCountry(item.getBureau());
             //装载申请人地址
             PersonAddress appAddress = new PersonAddress();
             appAddress.setAddress(item.getApplicationAddress());
             appAddress.setProvince(item.getProvinceStr());
             patentColumnDTO.setApplicantAddr(appAddress);
+            patentColumnDTO.setAppAddress(item.getApplicationAddress());
+//            patentColumnDTO.setApplicantCountry(item.getProvinceStr());
+            String provinceStr = item.getProvinceStr();
+            if (provinceStr.contains("(") && provinceStr.contains(")")) {
+                String substring = provinceStr.substring(provinceStr.indexOf("(") + 1, provinceStr.indexOf(")"));
+                patentColumnDTO.setAppProvince(substring);
+            }
             //装载ipc(主)分类号
             PatentClassify mipcClassify = new PatentClassify();
             mipcClassify.setLevel5(item.getMainIpc());

+ 91 - 19
src/main/java/cn/cslg/pas/service/common/TranslateService.java

@@ -16,6 +16,7 @@ import cn.cslg.pas.domain.es.Text;
 import cn.cslg.pas.exception.XiaoShiException;
 import co.elastic.clients.elasticsearch.ElasticsearchClient;
 import co.elastic.clients.elasticsearch._types.InlineScript;
+import co.elastic.clients.elasticsearch._types.Refresh;
 import co.elastic.clients.elasticsearch._types.Script;
 import co.elastic.clients.elasticsearch._types.query_dsl.Query;
 import co.elastic.clients.elasticsearch._types.query_dsl.QueryBuilders;
@@ -25,6 +26,7 @@ import co.elastic.clients.elasticsearch.core.SearchResponse;
 import co.elastic.clients.elasticsearch.core.UpdateByQueryRequest;
 import co.elastic.clients.elasticsearch.core.search.Hit;
 import com.aliyun.alimt20181012.models.TranslateGeneralResponse;
+import com.aliyun.alimt20181012.models.TranslateGeneralResponseBody;
 import com.aliyun.tea.TeaException;
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.lang3.ObjectUtils;
@@ -36,6 +38,8 @@ import org.springframework.util.CollectionUtils;
 
 import java.io.IOException;
 import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
 @Service
@@ -146,7 +150,7 @@ public class TranslateService {
         IndexResponse indexResponse = client.index(i -> i
                 .index("translate")
                 //传入user对象
-                .document(translate)
+                .document(translate).refresh(Refresh.True)
         );
         return indexResponse.id();
     }
@@ -176,7 +180,7 @@ public class TranslateService {
             i += 1;
         }
         //译文
-        String translateContent = this.getTranslateContent(textContent);
+        String translateContent = this.getLimitTranslateContent(textContent);
         String s1 = this.loadingTranslate(patentNo, patentField, "CN", false, 0, "-1", translateContent);
         if (StringUtils.isNotEmpty(s1)) {
             i += 1;
@@ -218,11 +222,11 @@ public class TranslateService {
                     }
                 }
             }
-            try {
-                Thread.sleep(800);
-            } catch (InterruptedException e) {
-                Thread.currentThread().interrupt();
-            }
+//            try {
+//                Thread.sleep(800);
+//            } catch (InterruptedException e) {
+//                Thread.currentThread().interrupt();
+//            }
             translateDTOS = this.getPatentTranslateByPatentNo(vo);
             translateVO = this.loadTIAndAbTranslate(translateDTOS);
         } else {
@@ -270,11 +274,11 @@ public class TranslateService {
                 List<Text> explainText = columnDTO.getPublicFullText();
                 this.addOldPFTTranslate(explainText, patentNo, patentField);
             }
-            try {
-                Thread.sleep(800);
-            } catch (InterruptedException e) {
-                Thread.currentThread().interrupt();
-            }
+//            try {
+//                Thread.sleep(800);
+//            } catch (InterruptedException e) {
+//                Thread.currentThread().interrupt();
+//            }
             translateDTOS = this.getPatentTranslateByPatentNo(vo);
             translateVOS = this.loadTranslate(translateDTOS);
         } else {
@@ -415,7 +419,8 @@ public class TranslateService {
             int i = 0;
             for (EsTranslateDTO translateDTO : translateDTOS) {
                 Content content = translateDTO.getContent();
-                String translateContent = this.getTranslateContent(content.getTextContent());
+                String textContent = content.getTextContent();
+                String translateContent = this.getLimitTranslateContent(textContent);
                 String s = this.loadingTranslate(translateDTO.getPatentNo(), translateDTO.getPatentField(), "CN", false,
                         content.getOrder(), content.getParentSort(), translateContent);
                 if (StringUtils.isNotEmpty(s)) {
@@ -425,11 +430,11 @@ public class TranslateService {
             if (i < 1) {
                 throw new XiaoShiException("添加译文失败");
             }
-            try {
-                Thread.sleep(1000);
-            } catch (InterruptedException e) {
-                Thread.currentThread().interrupt();
-            }
+//            try {
+//                Thread.sleep(1000);
+//            } catch (InterruptedException e) {
+//                Thread.currentThread().interrupt();
+//            }
             translateDTOS = this.getPatentTranslateByPatentNo(vo);
             translateVOS = this.loadTranslate(translateDTOS);
         } else {
@@ -438,6 +443,47 @@ public class TranslateService {
         return translateVOS;
     }
 
+    //判断文本翻译是否超出限制5000
+    public String getLimitTranslateContent(String content) throws Exception {
+        /*if (content.length() > 5000) {
+            String s = content.substring(0, 5000);
+            int i = s.lastIndexOf(",") + 1;
+            String s1 = s.substring(0, i);
+            str = str + this.getTranslateContent(s1);
+            String s2 = s.substring(i);
+            String s3 = this.getLimitTranslateContent(s2);
+            str = str + s3;
+        } else {
+            str = this.getTranslateContent(content);
+        }*/
+        String str = "";
+        String regex = "(?<!\\d)\\.(?!\\d)|[;。;]";
+        String regex1 = "(?<!\\d)\\.(?!\\d)";
+        Pattern pattern = Pattern.compile(regex);
+        Pattern pattern1 = Pattern.compile(regex1);
+        while (content.length() > 5000) {
+            String s2 = content.substring(0, 5000);
+            Matcher matcher = pattern.matcher(s2);
+            Matcher matcher1 = pattern1.matcher(s2);
+            int lastIndex = -1;
+            while (matcher.find()) {
+                lastIndex = matcher.end() - 1; // matcher.end() 返回的是匹配项之后的索引,所以减1得到最后一个字符的索引
+            }
+            if (lastIndex == -1) {
+                while (matcher1.find()) {
+                    lastIndex = matcher1.end() - 1; // matcher.end() 返回的是匹配项之后的索引,所以减1得到最后一个字符的索引
+                }
+            }
+            String s = content.substring(0, lastIndex + 1);
+            String translateContent = this.getTranslateContent(s);
+            str = str + translateContent;
+            content = content.substring(lastIndex + 1);
+        }
+        String translateContent = this.getTranslateContent(content);
+        str = str + translateContent;
+        return str;
+    }
+
     /**
      * 根据文本获取翻译内容
      *
@@ -445,7 +491,7 @@ public class TranslateService {
      * @return
      */
     public TranslateVO getTranslateByText(TranslateDTO vo) throws Exception {
-        String translateContent = this.getTranslateContent(vo.getContent());
+        String translateContent = this.getLimitTranslateContent(vo.getContent());
         TranslateVO translateVO = new TranslateVO();
         translateVO.setOriginalContent(vo.getContent());
         translateVO.setTranslationContent(translateContent);
@@ -476,6 +522,7 @@ public class TranslateService {
         return explainTextVOS;
     }
 
+    //根据专利号和序号查询是否已有翻译
     public List<String> getTranslateOrder(String patentNo, Integer sort) throws IOException {
         List<String> list = new ArrayList<>();
         SearchRequest.Builder builder = new SearchRequest.Builder();
@@ -500,4 +547,29 @@ public class TranslateService {
         }
         return list;
     }
+
+    //根据专利号和序号查询是否已有翻译
+    public Long getTranslateByPatentNo(String patentNo) throws IOException {
+        List<String> list = new ArrayList<>();
+        SearchRequest.Builder builder = new SearchRequest.Builder();
+        //设置查询索引
+        builder.index("translate");
+        Query q1 = QueryBuilders.term(t -> t.field("patent_no").value(patentNo));
+        Query q2 = QueryBuilders.term(t -> t.field("patent_field").value("3"));
+        Query q3 = QueryBuilders.term(t -> t.field("if_origin").value(true));
+        Query bool = QueryBuilders.bool(i -> i.must(q1, q2, q3));
+        builder.query(bool);
+        builder.size(1000);
+        builder.trackTotalHits(i -> i.enabled(true));
+        SearchResponse<PatentTranslate> response = client.search(builder.build(), PatentTranslate.class);
+//        List<Hit<PatentTranslate>> hits = response.hits().hits();
+//        for (Hit<PatentTranslate> hit : hits) {
+//            PatentTranslate source = hit.source();
+//            String content = source.getContent().getTextContent();
+//            if (StringUtils.isNotEmpty(content)) {
+//                list.add(content);
+//            }
+//        }
+        return response.hits().total().value();
+    }
 }

+ 18 - 0
src/main/java/cn/cslg/pas/service/exportProject/Constants.java

@@ -0,0 +1,18 @@
+package cn.cslg.pas.service.exportProject;
+
+public class Constants {
+    public static final String PROJECT_INFO_FILE_NAME = "project.json";
+    public static final String PROJECT_FILE_DIRECTORY_NAME = "project-file";
+    public static final String PROJECT_USER = "project-user.json";
+    public static final String PROJECT_FIELD_FILE_NAME = "project-field.json";
+    public static final String PROJECT_FIELD_OPTION_FILE_NAME = "project-field-option.json";
+    public static final String PROJECT_FIELD_TREE_FILE_NAME = "project-field-tree.json";
+    public static final String PROJECT_FIELD_TEXT_FILE_NAME = "project-field-text.json";
+    public static final String PROJECT_FOLDER_JSON =  "project-folder.json";
+    public static final String PATENT_FIELD_LINK="patent-field-link.json";
+    public static final String PATENT_FOLDER_LINK="folder-link.json";
+    public static final String PATENT_JSON ="patent.json";
+    public static final String LABELS_JSON="labels.json";
+    public static final String PATENT_IMAGE="image";
+    public static final String PATENT_PDF="pdf";
+}

+ 671 - 0
src/main/java/cn/cslg/pas/service/exportProject/ImportFromFileToEsService.java

@@ -0,0 +1,671 @@
+package cn.cslg.pas.service.exportProject;
+
+import cn.cslg.pas.common.core.base.FamilyType;
+import cn.cslg.pas.common.dto.business.CustomFieldDTO;
+import cn.cslg.pas.common.dto.business.CustomOptionDTO;
+import cn.cslg.pas.common.dto.business.EsPatentFamilyDTO;
+import cn.cslg.pas.common.dto.business.TreeNodeDTO;
+import cn.cslg.pas.common.dto.es.EsCustomFieldDTO;
+import cn.cslg.pas.common.model.importTaskModel.PatentInventor;
+import cn.cslg.pas.common.utils.DateUtils;
+import cn.cslg.pas.common.utils.FileUtils;
+import cn.cslg.pas.common.utils.FormatUtil;
+import cn.cslg.pas.common.utils.esDataForm.AddressSplitter;
+import cn.cslg.pas.common.utils.esDataForm.PatentClassifySplitter;
+import cn.cslg.pas.domain.business.TreeNode;
+import cn.cslg.pas.domain.es.*;
+import cn.cslg.pas.service.business.CommonService;
+import cn.cslg.pas.service.business.CustomFieldService;
+import cn.cslg.pas.service.business.CustomOptionService;
+import cn.cslg.pas.service.business.TreeNodeService;
+import cn.cslg.pas.service.business.es.EsService;
+import cn.cslg.pas.service.common.FileManagerService;
+import cn.cslg.pas.service.exportProject.oldPasEntity.*;
+
+import com.alibaba.fastjson.JSONArray;
+import lombok.RequiredArgsConstructor;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import java.io.File;
+import java.time.Period;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Scope("prototype")
+@Service
+@RequiredArgsConstructor
+public class ImportFromFileToEsService {
+    private final CustomFieldService customFieldService;
+    private final TreeNodeService treeNodeService;
+    private final CustomOptionService customOptionService;
+    private final EsService esService;
+    private final FileManagerService fileManagerService;
+
+    public void ImportFromFile(File file, Integer projectId) {
+//获取自定义栏位列表
+        List<OldProjectField> oldProjectFields = new ArrayList<>();
+        List<OldProjectFieldOption> oldProjectFieldOptions = new ArrayList<>();
+        List<OldProjectFieldText> oldProjectFieldTexts = new ArrayList<>();
+        List<OldProjectFieldTree> oldProjectFieldTrees = new ArrayList<>();
+        List<OldProjectFolder> oldProjectFolders = new ArrayList<>();
+        List<File> files = new ArrayList<>();
+        this.saveCustomField(oldProjectFields, oldProjectFieldOptions, oldProjectFieldTexts, oldProjectFieldTrees, projectId);
+        this.saveFolder(oldProjectFolders, projectId);
+
+        for (File pFile : files) {
+            OldPatentDTO oldPatentDTO = new OldPatentDTO();
+
+        }
+
+
+    }
+
+
+    public void saveCustomField(List<OldProjectField> oldProjectFields, List<OldProjectFieldOption> oldProjectFieldOptions, List<OldProjectFieldText> oldProjectFieldTexts, List<OldProjectFieldTree> oldProjectFieldTrees, Integer projectId) {
+        for (OldProjectField oldProjectField : oldProjectFields) {
+            //保存自定义栏位内容
+            CustomFieldDTO customFieldDTO = new CustomFieldDTO();
+            customFieldDTO.setName(oldProjectField.getName());
+            customFieldDTO.setDescription(oldProjectField.getRemark());
+            if (oldProjectField.getStatus() != null && oldProjectField.getStatus().equals(1)) {
+                customFieldDTO.setStatus(true);
+            } else {
+                customFieldDTO.setStatus(false);
+            }
+            customFieldDTO.setProjectId(projectId);
+            customFieldDTO.setPersonId(oldProjectField.getCreateBy().toString());
+            Integer type = oldProjectField.getType();
+            customFieldDTO.setType(type);
+            Integer oldCustomFieldId = oldProjectField.getId();
+            Integer customFieldId = customFieldService.addCustomField(customFieldDTO);
+            oldProjectField.setNewId(customFieldId);
+            switch (type) {
+                case 0:
+                case 1:
+
+                case 2:
+
+                    break;
+                case 4:
+                case 5:
+                    List<OldProjectFieldOption> newOldFieldOptions = oldProjectFieldOptions.stream().filter(item -> item.getFieldId().equals(oldCustomFieldId)).collect(Collectors.toList());
+                    for (OldProjectFieldOption oldProjectFieldOption : newOldFieldOptions) {
+                        CustomOptionDTO customOptionDTO = new CustomOptionDTO();
+                        customOptionDTO.setCustomFieldId(customFieldId);
+                        customOptionDTO.setName(oldProjectFieldOption.getName());
+                        Integer id = customOptionService.simpleAddCustomOption(customOptionDTO);
+                        oldProjectFieldOption.setNewId(id);
+                    }
+                    break;
+                case 6:
+                    List<OldProjectFieldTree> newOldFieldTrees = oldProjectFieldTrees.stream().filter(item -> item.getFieldId().equals(oldCustomFieldId)).collect(Collectors.toList());
+                    List<OldProjectFieldTree> rootTrees = newOldFieldTrees.stream().filter(item -> item.getParentId().equals(0)).collect(Collectors.toList());
+                    rootTrees.forEach(item -> item.setParentId(0));
+                    while (rootTrees.size() > 0) {
+                        OldProjectFieldTree oldProjectFieldTree = rootTrees.remove(0);
+                        TreeNodeDTO treeNodeDTO = new TreeNodeDTO();
+                        treeNodeDTO.setName(oldProjectFieldTree.getName());
+                        treeNodeDTO.setParentId(oldProjectFieldTree.getParentId());
+                        treeNodeDTO.setType(4);
+                        treeNodeDTO.setTypeId(customFieldId);
+                        TreeNode treeNode = treeNodeService.addTreeNode(treeNodeDTO);
+                        oldProjectFieldTree.setNewParentId(treeNode.getParentId());
+                        oldProjectFieldTree.setNewId(treeNode.getId());
+                        //查询子节点
+                        List<OldProjectFieldTree> childTreeNodes = newOldFieldTrees.stream().filter(item -> item.getParentId().equals(oldProjectFieldTree.getId())).collect(Collectors.toList());
+                        childTreeNodes.forEach(item -> item.setParentId(treeNode.getId()));
+                        rootTrees.addAll(childTreeNodes);
+                    }
+                    break;
+            }
+        }
+
+    }
+
+    public void saveFolder(List<OldProjectFolder> oldProjectFolders, Integer projectId) {
+        CustomFieldDTO customFieldDTO = new CustomFieldDTO();
+        customFieldDTO.setName("文件夹");
+        customFieldDTO.setDescription("老系统文件夹迁移");
+        customFieldDTO.setStatus(true);
+        customFieldDTO.setProjectId(projectId);
+        customFieldDTO.setPersonId("");
+        customFieldDTO.setType(6);
+        Integer customFieldId = customFieldService.addCustomField(customFieldDTO);
+        oldProjectFolders = oldProjectFolders.stream().sorted(Comparator.comparing(OldProjectFolder::getOrder)).collect(Collectors.toList());
+        List<OldProjectFolder> rootOlderProjectFolders = oldProjectFolders.stream().filter(item -> item.getParentId().equals(0)).collect(Collectors.toList());
+
+        while (rootOlderProjectFolders.size() > 0) {
+            OldProjectFolder olderProjectFolder = rootOlderProjectFolders.remove(0);
+            TreeNodeDTO treeNodeDTO = new TreeNodeDTO();
+            treeNodeDTO.setName(olderProjectFolder.getName());
+            treeNodeDTO.setParentId(olderProjectFolder.getParentId());
+            treeNodeDTO.setType(4);
+            treeNodeDTO.setTypeId(customFieldId);
+            TreeNode treeNode = treeNodeService.addTreeNode(treeNodeDTO);
+            olderProjectFolder.setNewParentId(treeNode.getParentId());
+            olderProjectFolder.setNewId(treeNode.getId());
+            olderProjectFolder.setFieldId(customFieldId);
+            olderProjectFolder.setCustomFieldId(customFieldId);
+            //查询子节点
+            List<OldProjectFolder> childTreeNodes = oldProjectFolders.stream().filter(item -> item.getParentId().equals(olderProjectFolder.getId())).collect(Collectors.toList());
+            childTreeNodes.forEach(item -> item.setParentId(treeNode.getId()));
+            rootOlderProjectFolders.addAll(childTreeNodes);
+        }
+    }
+
+    public Patent loadPatent(OldPatentDTO oldPatentDTO) throws Exception {
+        Patent patent = new Patent();
+
+        //号码
+        patent.setAppNo(oldPatentDTO.getApplicationNo());
+        patent.setPublicNo(oldPatentDTO.getPublicNo());
+        if (oldPatentDTO.getPublicDate() != null) {
+            Date publicDate = DateUtils.strToDate(oldPatentDTO.getPublicDate());
+            patent.setPublicDate(publicDate);
+        }
+        if (oldPatentDTO.getApplicationDate() != null) {
+            Date appDate = DateUtils.strToDate(oldPatentDTO.getApplicationDate());
+            patent.setAppDate(appDate);
+        }
+        patent.setGrantNo(oldPatentDTO.getPublicAccreditNo());
+        if (oldPatentDTO.getPublicAccreditDate() != null && !oldPatentDTO.getPublicAccreditDate().trim().equals("")) {
+            Date grantDate = DateUtils.strToDate(oldPatentDTO.getPublicAccreditDate());
+            patent.setGrantDate(grantDate);
+        }
+
+
+        String patentNo = patent.getPatentNo();
+        String appNo = patent.getAppNo();
+        String publicNo = patent.getPublicNo();
+        String grantNo = patent.getGrantNo();
+
+        String usedNo = null;
+        if (appNo != null) {
+            usedNo = appNo;
+        } else if (publicNo != null) {
+            usedNo = publicNo;
+        } else if (grantNo != null) {
+            usedNo = grantNo;
+        }
+
+        String contry = usedNo.substring(0, 2);
+        if (contry.equals("CN")) {
+            patent.setPatentNo(appNo);
+        } else {
+            if (publicNo != null) {
+                patent.setPatentNo(publicNo);
+            } else if (grantNo != null) {
+                patent.setPatentNo(grantNo);
+            }
+        }
+
+
+        //装载标题
+        List<Text> texts = new ArrayList<>();
+        if (oldPatentDTO.getName() != null) {
+            Text text = new Text();
+            text.setTextContent(oldPatentDTO.getName());
+            text.setIfOrigin(true);
+            text.setLanguage(contry);
+            texts.add(text);
+        }
+        if (oldPatentDTO.getNameOut() != null) {
+            Text text = new Text();
+            text.setTextContent(oldPatentDTO.getNameOut());
+            text.setIfOrigin(false);
+            text.setLanguage("CN");
+            texts.add(text);
+        }
+        if (texts.size() != 0) {
+            patent.setTitle(texts);
+        }
+
+
+        //装载说明书
+        List<Text> textInstructions = new ArrayList<>();
+        if(oldPatentDTO.getInstruction()!=null) {
+            if (oldPatentDTO.getInstruction().getManual() != null) {
+                Text text = new Text();
+                text.setTextContent(oldPatentDTO.getInstruction().getManual());
+                text.setIfOrigin(true);
+                text.setLanguage(contry);
+                textInstructions.add(text);
+            }
+            if (oldPatentDTO.getInstruction().getManualOut() != null) {
+                Text text = new Text();
+                text.setTextContent(oldPatentDTO.getInstruction().getManualOut());
+                text.setIfOrigin(false);
+                text.setLanguage("CN");
+                textInstructions.add(text);
+            }
+            if (textInstructions.size() != 0) {
+                patent.setPublicFullText(textInstructions);
+            }
+        }
+
+
+        //装载摘要
+        List<Text> textsAbstractStr = new ArrayList<>();
+        if (oldPatentDTO.getAbstractStr() != null) {
+            Text text = new Text();
+            text.setTextContent(oldPatentDTO.getAbstractStr());
+            text.setIfOrigin(true);
+            text.setLanguage(contry);
+
+            textsAbstractStr.add(text);
+        }
+        if (oldPatentDTO.getAbstractOut() != null) {
+            Text text = new Text();
+            text.setTextContent(oldPatentDTO.getAbstractOut());
+            text.setIfOrigin(false);
+            text.setLanguage("CN");
+            texts.add(text);
+            textsAbstractStr.add(text);
+        }
+        if (textsAbstractStr.size() != 0) {
+            patent.setAbstractStr(textsAbstractStr);
+        }
+
+
+        //装载申请人,权利人地址 以及申请人权利人
+        if (oldPatentDTO.getApplicant() != null && oldPatentDTO.getApplicant().size() != 0) {
+            List<PatentPerson> patentPeopleApp = new ArrayList<>();
+            List<PatentPerson> patentPeopleRightHolder = new ArrayList<>();
+            String addressApp = null;
+            String addressRightHolder = null;
+            for (OldPatentApplicant patentApplicant : oldPatentDTO.getApplicant()) {
+                if (patentApplicant.getDataType().equals(2)) {
+                    if (patentApplicant.getAddressStr() != null) {
+                        addressApp = patentApplicant.getAddressStr();
+                    }
+                    PatentPerson patentPerson = new PatentPerson();
+                    patentPerson.setOrder(patentPeopleApp.size() + 1);
+                    patentPerson.setType("1");
+                    patentPerson.setName(patentApplicant.getName());
+                    patentPeopleApp.add(patentPerson);
+                }
+                if (patentApplicant.getDataType().equals(1)) {
+                    if (patentApplicant.getAddressStr() != null) {
+                        addressRightHolder = patentApplicant.getAddressStr();
+                    }
+                    PatentPerson patentPerson = new PatentPerson();
+                    patentPerson.setOrder(patentPeopleRightHolder.size() + 1);
+                    patentPerson.setType("1");
+                    patentPerson.setName(patentApplicant.getName());
+                    patentPeopleApp.add(patentPerson);
+                }
+
+
+            }
+            if (patentPeopleApp.size() != 0) {
+                patent.setApplicant(patentPeopleApp);
+            }
+            if (patentPeopleRightHolder.size() != 0) {
+                patent.setRightHolder(patentPeopleRightHolder);
+            }
+            if (addressApp != null) {
+                PersonAddress personAddress = new PersonAddress();
+                personAddress.setAddress(addressApp);
+                patent.setApplicantAddr(personAddress);
+            }
+            if (addressRightHolder != null) {
+                PersonAddress personAddress = new PersonAddress();
+                personAddress.setAddress(addressRightHolder);
+                patent.setRightHolderAddr(personAddress);
+            }
+        }
+
+        //发明人
+        List<OldPatentInventor> patentInventorList = oldPatentDTO.getInventor();
+        if (patentInventorList != null && patentInventorList.size() > 0) {
+            List<PatentPerson> patentPeople = new ArrayList<>();
+            for (int i = 0; i < patentInventorList.size(); i++) {
+                PatentPerson patentPerson = new PatentPerson();
+                patentPerson.setOrder(i + 1);
+                patentPerson.setType("1");
+                patentPerson.setName(patentInventorList.get(i).getName());
+                patentPeople.add(patentPerson);
+            }
+            patent.setInventor(patentPeople);
+        }
+        //装载审查员
+        patent.setExaminer(oldPatentDTO.getExaminer());
+
+        //助理审查员
+        patent.setAidExaminer(oldPatentDTO.getAidExaminer());
+
+        //优先权
+        if (oldPatentDTO.getPriorityNo() != null) {
+
+            List<Priorities> priorities = new ArrayList<>();
+
+
+            Priorities prioritie = new Priorities();
+            prioritie.setPriorityNo(oldPatentDTO.getPriorityNo());
+            String pCountry = oldPatentDTO.getPriorityNo().substring(0, 2);
+            prioritie.setPriorityCountry(pCountry);
+            if (oldPatentDTO.getPriorityDate() != null) {
+                prioritie.setPriorityDate(oldPatentDTO.getPriorityDate());
+            }
+            priorities.add(prioritie);
+
+            patent.setPriorities(priorities);
+
+        }
+
+        //分类号
+        //装载IPC分类号
+        List<String> ipcList = oldPatentDTO.getIpcList();
+        String mainIpc = oldPatentDTO.getIpc();
+        if (ipcList == null && mainIpc != null) {
+            ipcList = new ArrayList<>();
+            ipcList.add(mainIpc);
+        }
+
+        if (ipcList != null && ipcList.size() > 0) {
+            List<PatentClassify> patentClassifies = new ArrayList<>();
+            for (int i = 0; i < ipcList.size(); i++) {
+                PatentClassify patentClassify = PatentClassifySplitter.split(ipcList.get(i));
+                if (patentClassify != null) {
+                    patentClassifies.add(patentClassify);
+                    if (i == 0) {
+                        patent.setMipc(patentClassify);
+                    }
+                }
+            }
+            patent.setIpc(patentClassifies);
+        }
+
+        //装载CPC分类号
+        List<String> cpcList = oldPatentDTO.getCpcList();
+        String mainCpc = oldPatentDTO.getCpc();
+        if (cpcList == null && mainCpc != null) {
+            cpcList = new ArrayList<>();
+            cpcList.add(mainCpc);
+        }
+
+        if (cpcList != null && cpcList.size() > 0) {
+            List<PatentClassify> patentClassifies = new ArrayList<>();
+            for (int i = 0; i < cpcList.size(); i++) {
+                PatentClassify patentClassify = PatentClassifySplitter.split(cpcList.get(i));
+                if (patentClassify != null) {
+                    patentClassifies.add(patentClassify);
+                    if (i == 0) {
+                        patent.setMcpc(patentClassify);
+                    }
+                }
+            }
+            patent.setCpc(patentClassifies);
+        }
+
+        //装载UPC分类号
+        List<String> upcList = oldPatentDTO.getCpcList();
+        String mainUpc = oldPatentDTO.getUpc();
+        if (upcList == null && mainUpc != null) {
+            upcList = new ArrayList<>();
+            upcList.add(mainUpc);
+        }
+
+        if (upcList != null && upcList.size() > 0) {
+            List<PatentClassify> patentClassifies = new ArrayList<>();
+            for (int i = 0; i < upcList.size(); i++) {
+                PatentClassify patentClassify = PatentClassifySplitter.split(upcList.get(i));
+                if (patentClassify != null) {
+                    patentClassifies.add(patentClassify);
+                    if (i == 0) {
+                        patent.setMupc(patentClassify);
+                    }
+                }
+            }
+            patent.setUpc(patentClassifies);
+        }
+
+        //装载Loc分类号
+        List<String> locList = oldPatentDTO.getLocList();
+        String mainLoc = oldPatentDTO.getLoc();
+        if (locList == null && mainLoc != null) {
+            locList = new ArrayList<>();
+            locList.add(mainLoc);
+        }
+
+        if (locList != null && locList.size() > 0) {
+            List<PatentClassify> patentClassifies = new ArrayList<>();
+            for (int i = 0; i < locList.size(); i++) {
+                PatentClassify patentClassify = PatentClassifySplitter.split(locList.get(i));
+                if (patentClassify != null) {
+                    patentClassifies.add(patentClassify);
+                    if (i == 0) {
+                        patent.setMloc(patentClassify);
+                    }
+                }
+            }
+            patent.setLoc(patentClassifies);
+        }
+
+        //简单法律状态
+        if(oldPatentDTO.getSimpleStatus()!=null) {
+            switch (oldPatentDTO.getSimpleStatus()) {
+                case "有效":
+                    patent.setSimpleStatus("1");
+                    break;
+                case "审中":
+                    patent.setSimpleStatus("3");
+                    break;
+                case "失效":
+                    patent.setSimpleStatus("2");
+                    break;
+                default:
+                    patent.setSimpleStatus("1");
+                    break;
+            }
+        }
+        if(oldPatentDTO.getType()!=null){
+
+
+        }
+        //专利类型
+        String type = oldPatentDTO.getType();
+        if (type != null) {
+            type = type.trim();
+            switch (type) {
+                case "授权发明":
+                case "发明申请":
+                    type = "1";
+                    break;
+                case "实用新型":
+                    type = "2";
+                    break;
+                case "外观设计":
+                    type = "3";
+                    break;
+                default:
+                    type = null;
+                    break;
+            }
+            patent.setPatentType(type);
+        }
+        //装载权利要求
+        if (oldPatentDTO.getRights() != null && oldPatentDTO.getRights().size() > 0) {
+            List<Text> rightTexts = new ArrayList<>();
+            List<OldPatentRight> oldPatentRights = oldPatentDTO.getRights().stream().sorted(Comparator.comparing(OldPatentRight::getSort)).collect(Collectors.toList());
+            StringBuilder stringBuilder = new StringBuilder();
+            for (OldPatentRight oldPatentRight : oldPatentRights) {
+                stringBuilder.append(oldPatentRight.getContent());
+            }
+            Text text = new Text();
+            text.setTextContent(stringBuilder.toString());
+            text.setIfOrigin(true);
+            text.setLanguage(contry);
+            rightTexts.add(text);
+            if (rightTexts.size() != 0) {
+                patent.setClaim(rightTexts);
+            }
+        }
+
+        //wo指定国
+        if (oldPatentDTO.getWo() != null) {
+            patent.setWo(oldPatentDTO.getWo());
+        }
+
+        //同族
+        if (oldPatentDTO.getFamily() != null) {
+            OldPatentDTO.PatentFamily family = oldPatentDTO.getFamily();
+            if (family.getSimple() != null && family.getSimple().size() > 0) {
+                EsPatentFamilyDTO esPatentFamilyDTO = esService.addEsPatentFamily(patent, family.getSimple(), FamilyType.SIMPLE);
+                if (esPatentFamilyDTO != null) {
+                    patent.setSimpleFamilyId(esPatentFamilyDTO.getPatentFamilyId());
+                    patent.setSimpleFamilyNum(esPatentFamilyDTO.getFamilyNum());
+                }
+            }
+            if (family.getInpadoc() != null && family.getInpadoc().size() > 0) {
+                EsPatentFamilyDTO esPatentFamilyDTO = esService.addEsPatentFamily(patent, family.getInpadoc(), FamilyType.INPADOC);
+                if (esPatentFamilyDTO != null) {
+                    patent.setInpadocFamilyId(esPatentFamilyDTO.getPatentFamilyId());
+                    patent.setInpadocFamilyNum(esPatentFamilyDTO.getFamilyNum());
+                }
+            }
+        }
+
+        //引用专利
+
+        String nos = oldPatentDTO.getQuote();
+        System.out.println(nos);
+//        if (nos != null) {
+//            List<String> quotedNos = this.reQuotedNos(nos);
+//            esService.addEsQuotePatent(, quotedNos);
+//        }
+        return patent;
+    }
+
+
+    public List<EsCustomFieldDTO> getEsCustomField(List<OldProjectFolderPatentLink> oldProjectFolderPatentLinks, List<OldPatentLabel> oldPatentLabels, Integer projectId, List<OldProjectFolder> oldProjectFolders) {
+        List<EsCustomFieldDTO> esCustomFieldDTOList = new ArrayList<>();
+        if (oldPatentLabels != null && oldPatentLabels.size() > 0) {
+            List<String> names = oldPatentLabels.stream().map(OldPatentLabel::getName).collect(Collectors.toList());
+            EsCustomFieldDTO esCustomFieldDTO = new EsCustomFieldDTO();
+            esCustomFieldDTO.setFieldType(10);
+            esCustomFieldDTO.setProjectId(projectId);
+            esCustomFieldDTO.setFieldId("0");
+            esCustomFieldDTO.setFieldValue(names);
+
+            esCustomFieldDTOList.add(esCustomFieldDTO);
+        }
+        if (oldProjectFolders != null && oldProjectFolders.size() > 0 && oldProjectFolderPatentLinks.size() > 0) {
+            EsCustomFieldDTO esCustomFieldDTO = new EsCustomFieldDTO();
+            esCustomFieldDTO.setFieldType(6);
+            esCustomFieldDTO.setProjectId(projectId);
+            esCustomFieldDTO.setFieldId(oldProjectFolders.get(0).getCustomFieldId().toString());
+            List<Integer> oldLinkIds = oldProjectFolderPatentLinks.stream().map(OldProjectFolderPatentLink::getFolderId).collect(Collectors.toList());
+            List<Integer> newLinkIds = oldProjectFolders.stream().filter(item -> oldLinkIds.contains(item.getId())).map(OldProjectFolder::getNewId).collect(Collectors.toList());
+            List<String> names = FormatUtil.IntegerTOStringList(newLinkIds);
+            esCustomFieldDTO.setFieldValue(names);
+            esCustomFieldDTOList.add(esCustomFieldDTO);
+        }
+        return esCustomFieldDTOList;
+    }
+
+    public List<EsCustomFieldDTO> getEsCustomField(File file, Integer projectId, List<OldProjectFieldOption> oldProjectFieldOptions, List<OldProjectField> oldProjectFields, List<OldProjectFieldTree> oldProjectFieldTrees, List<OldProjectFieldText> oldProjectFieldTexts) {
+        List<EsCustomFieldDTO> esCustomFieldDTOList = new ArrayList<>();
+        List<OldProjectFieldPatentLink> oldProjectFieldPatentLinks = new ArrayList<>();
+        String patentFieldLinkJsons = CommonService.readJsonFile(file);
+        oldProjectFieldPatentLinks = JSONArray.parseArray(patentFieldLinkJsons, OldProjectFieldPatentLink.class);
+
+        if (oldProjectFieldPatentLinks.size() > 0 && oldProjectFields.size() > 0) {
+            for (OldProjectField oldProjectField : oldProjectFields) {
+                List<OldProjectFieldPatentLink> partLinks = oldProjectFieldPatentLinks.stream().filter(item -> item.getFieldId().equals(oldProjectField.getId())).collect(Collectors.toList());
+                if (partLinks.size() > 0) {
+                    Integer type = oldProjectField.getType();
+                    EsCustomFieldDTO esCustomFieldDTO = new EsCustomFieldDTO();
+                    esCustomFieldDTO.setFieldType(type);
+                    esCustomFieldDTO.setProjectId(projectId);
+                    esCustomFieldDTO.setFieldId(oldProjectField.getNewId().toString());
+                    List<String> names = new ArrayList<>();
+                    List<Integer> linkIds = partLinks.stream().map(OldProjectFieldPatentLink::getOptionId).collect(Collectors.toList());
+                    switch (type) {
+                        case 0:
+                        case 1:
+
+                        case 2:
+                            names = oldProjectFieldTexts.stream().filter(item -> linkIds.contains(item.getId())).map(OldProjectFieldText::getText).collect(Collectors.toList());
+                            break;
+                        case 4:
+                        case 5:
+                            List<Integer> optionIds = oldProjectFieldOptions.stream().filter(item -> linkIds.contains(item.getId())).map(OldProjectFieldOption::getNewId).collect(Collectors.toList());
+                            names = FormatUtil.IntegerTOStringList(optionIds);
+                            break;
+                        case 6:
+                            List<Integer> treeIds = oldProjectFieldTrees.stream().filter(item -> linkIds.contains(item.getId())).map(OldProjectFieldTree::getNewId).collect(Collectors.toList());
+                            names = FormatUtil.IntegerTOStringList(treeIds);
+                            break;
+                    }
+
+                    esCustomFieldDTO.setFieldValue(names);
+                    esCustomFieldDTOList.add(esCustomFieldDTO);
+                }
+
+            }
+        }
+        return esCustomFieldDTOList;
+
+    }
+
+    public void WriteCustomFieldToFile(List<OldProjectField> oldProjectFields, List<OldProjectFieldOption> oldProjectFieldOptions, List<OldProjectFieldTree> oldProjectFieldTrees, File file) {
+
+//        FileUtils.writeFile(oldProjectFields,);
+
+    }
+
+    public List<String> reQuotedNos(String quoteNos) {
+        List<String> nos = new ArrayList<>();
+        if (quoteNos == null) {
+            return nos;
+        }
+        String[] quoteNoStrs = quoteNos.split("\\|");
+        for (int i = 0; i < quoteNoStrs.length; i++) {
+            nos.add(quoteNoStrs[i].trim());
+        }
+        return nos;
+
+    }
+
+    public void savePatentPicture(File file, Patent patent) throws Exception {
+        File imageDiretory = FileUtils.getFileByName(file, Constants.PATENT_IMAGE);
+       if(imageDiretory==null){
+           return;
+       }
+        File[] imageFiles = imageDiretory.listFiles();
+        if(imageFiles.length>0){
+            File ImageFile =imageFiles[0];
+            String guid = FormatUtil.getPictureFormat(patent.getAppNo());
+            fileManagerService.uploadFileWithGuid(ImageFile, guid);
+        }
+
+
+}
+
+    public void savePatentPDF(File file, Patent patent) throws Exception {
+        File pdfDiretory = FileUtils.getFileByName(file, Constants.PATENT_PDF);
+        if(pdfDiretory==null||!pdfDiretory.exists()){
+
+            System.out.println(patent.getPatentNo());
+            return;
+        }
+        File[] pdfFiles = pdfDiretory.listFiles();
+        for (int i = 0; i < pdfFiles.length; i++) {
+            File pdfFile = pdfFiles[i];
+            String name = pdfFile.getName();
+            String[] names = name.split("_");
+            Integer type = 0;
+            if (names[1].contains("2")) {
+                type = 1;
+            }
+            String guid1 = FormatUtil.getPDFFormat(patent.getPatentNo(), type);
+            fileManagerService.uploadFileWithGuid(pdfFile,guid1);
+        }
+    }
+
+}
+
+
+

+ 236 - 7
src/main/java/cn/cslg/pas/service/exportProject/ImportProjectService.java

@@ -1,33 +1,262 @@
 package cn.cslg.pas.service.exportProject;
 
+import cn.cslg.pas.common.dto.UploadPatentWebDTO;
 import cn.cslg.pas.common.dto.business.PatentProjectDTO;
+import cn.cslg.pas.common.dto.es.EsCustomFieldDTO;
+import cn.cslg.pas.common.utils.DateUtils;
 import cn.cslg.pas.common.utils.FileUtils;
+import cn.cslg.pas.common.utils.FormatUtil;
+import cn.cslg.pas.common.utils.JsonUtils;
+import cn.cslg.pas.common.vo.UploadSettingVO;
 import cn.cslg.pas.common.vo.business.PatentProjectVO;
+import cn.cslg.pas.domain.business.AssoProjectPerson;
 import cn.cslg.pas.domain.business.Project;
+import cn.cslg.pas.domain.es.Patent;
+import cn.cslg.pas.service.business.AssoProjectPersonService;
+import cn.cslg.pas.service.business.CommonService;
+import cn.cslg.pas.service.business.PatentProjectService;
+import cn.cslg.pas.service.business.ProjectService;
+import cn.cslg.pas.service.common.FileManagerService;
+import cn.cslg.pas.service.exportProject.oldPasEntity.*;
 import cn.hutool.core.util.ZipUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson2.util.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStream;
 import java.io.ObjectInputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
 import java.util.zip.ZipFile;
 
 @Service
 public class ImportProjectService {
+    @Autowired
+    private FileManagerService fileManagerService;
 
-    public void getFileFromZip() {
+    @Autowired
+    private PatentProjectService patentProjectService;
+
+    @Autowired
+    private AssoProjectPersonService assoProjectPersonService;
+
+    @Autowired
+    private ImportFromFileToEsService importFromFileToEsService;
+
+    @Autowired
+    private SavePatentToEsService savePatentToEsService;
+    public void getFileFromZip(String path) {
         try {
-            File file = new File("D:\\PAS\\target\\2353868e6d06429bbd03fd9b185e6645.zip");
-            ZipFile zipFile = new ZipFile(file);
-            InputStream inputStream = ZipUtil.get(zipFile,"project.json");
-            ObjectInputStream ois = new ObjectInputStream(inputStream);
-            PatentProjectVO patentProjectVO = (PatentProjectVO) ois.readObject();
-            PatentProjectDTO patentProjectDTO =new PatentProjectDTO();
+            File file = new File(path);
+           //导入专题库
+            Integer projectId = this.ImportProject(file);
+            //导入分享信息
+            this.ImportProjectShareMessage(file, projectId);
+
+            List<OldProjectField> oldProjectFields = new ArrayList<>();
+            List<OldProjectFieldOption> oldProjectFieldOptions = new ArrayList<>();
+            List<OldProjectFieldText> oldProjectFieldTexts = new ArrayList<>();
+            List<OldProjectFieldTree> oldProjectFieldTrees = new ArrayList<>();
+            List<OldProjectFolder> oldProjectFolders = new ArrayList<>();
+            File customFieldFile = this.getFileByName(file, Constants.PROJECT_FIELD_FILE_NAME);
+            String customFieldJsons = CommonService.readJsonFile(customFieldFile);
+            oldProjectFields = JSONArray.parseArray(customFieldJsons, OldProjectField.class);
+
+            File customFieldOptionFile = this.getFileByName(file, Constants.PROJECT_FIELD_OPTION_FILE_NAME);
+            String customFieldOptionJsons = CommonService.readJsonFile(customFieldOptionFile);
+            oldProjectFieldOptions = JSONArray.parseArray(customFieldOptionJsons, OldProjectFieldOption.class);
+
+
+            File customFieldTreeFile = this.getFileByName(file, Constants.PROJECT_FIELD_TREE_FILE_NAME);
+            String customFieldTreeJsons = CommonService.readJsonFile(customFieldTreeFile);
+            oldProjectFieldTrees = JSONArray.parseArray(customFieldTreeJsons, OldProjectFieldTree.class);
+
+            File customFieldTextFile = this.getFileByName(file, Constants.PROJECT_FIELD_TEXT_FILE_NAME);
+            String customFieldTextJsons = CommonService.readJsonFile(customFieldTextFile);
+            oldProjectFieldTexts = JSONArray.parseArray(customFieldTextJsons, OldProjectFieldText.class);
+
+            File folderFile = this.getFileByName(file, Constants.PROJECT_FOLDER_JSON);
+            String folderJsons = CommonService.readJsonFile(folderFile);
+            oldProjectFolders = JSONArray.parseArray(folderJsons, OldProjectFolder.class);
+            importFromFileToEsService.saveCustomField(oldProjectFields, oldProjectFieldOptions, oldProjectFieldTexts, oldProjectFieldTrees, projectId);
+            importFromFileToEsService.saveFolder(oldProjectFolders, projectId);
+
+            File patentFiles = this.getFileByName(file, "patent");
+            File[] patentFileList = patentFiles.listFiles();
+            for (int i = 0; i < patentFileList.length; i++) {
+                File patentFile = patentFileList[i];
+                System.out.println("文件名称"+patentFile.getName());
+                if (patentFile.getName().equals("null")) {
+                    continue;
+                }
+                File patentJsonFile = this.getFileByName(patentFile, Constants.PATENT_JSON);
+                String patentJsons = CommonService.readJsonFile(patentJsonFile);
+                OldPatentDTO oldPatentDTO = JSON.parseObject(patentJsons,OldPatentDTO.class);
+                Patent patent = importFromFileToEsService.loadPatent(oldPatentDTO);
+
+                File patentFolderLinkFile = this.getFileByName(patentFile, Constants.PATENT_FOLDER_LINK);
+                String patentFolderLinkJsons =CommonService.readJsonFile(patentFolderLinkFile);
+                List<OldProjectFolderPatentLink> oldProjectFolderPatentLinks =JSONArray.parseArray(patentFolderLinkJsons,OldProjectFolderPatentLink.class);
+                File patentLabelFile = this.getFileByName(patentFile, Constants.LABELS_JSON);
+                String patentLabelJsons =CommonService.readJsonFile(patentLabelFile);
+                List<OldPatentLabel> oldPatentLabels =JSONArray.parseArray(patentLabelJsons,OldPatentLabel.class);
+                List<EsCustomFieldDTO> esCustomFieldDTOList1 = importFromFileToEsService.getEsCustomField(oldProjectFolderPatentLinks,oldPatentLabels, projectId, oldProjectFolders);
+                File patentFieldLinkFile =this.getFileByName(patentFile,Constants.PATENT_FIELD_LINK);
+                List<EsCustomFieldDTO> esCustomFieldDTOList2 = importFromFileToEsService.getEsCustomField(patentFieldLinkFile,projectId, oldProjectFieldOptions, oldProjectFields, oldProjectFieldTrees,  oldProjectFieldTexts);
+                esCustomFieldDTOList1.addAll(esCustomFieldDTOList2);
+                UploadPatentWebDTO uploadPatentWebDTO =new UploadPatentWebDTO();
+                uploadPatentWebDTO.setPatent(patent);
+                uploadPatentWebDTO.setProjectId(projectId);
+                uploadPatentWebDTO.setEsCustomFieldDTOList(esCustomFieldDTOList1);
+                savePatentToEsService.savePatentToEs(uploadPatentWebDTO);
+
+                importFromFileToEsService.savePatentPicture(patentFile,patent);
+
+                importFromFileToEsService.savePatentPDF(patentFile,patent);
+            }
 
         } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+
+
+    public File getFileByName(File file, String name) {
+        for (File file1 : file.listFiles()) {
+            if (file1.getName().equals(name)) {
+                return file1;
+            }
         }
+        return null;
+    }
+
+    /**
+     * 导入专题库
+     *
+     * @param file
+     * @return
+     * @throws Exception
+     */
+    private Integer ImportProject(File file) throws Exception {
+        File projectFile = this.getFileByName(file, Constants.PROJECT_INFO_FILE_NAME);
+        String projectJsons = CommonService.readJsonFile(projectFile);
+        File file1 = this.getFileByName(file, Constants.PROJECT_FILE_DIRECTORY_NAME);
+        List<String> fileGuids = new ArrayList<>();
+
+        //上传附件并获取guid
+        if (file1 != null) {
+            File[] files = file1.listFiles();
+            if (files != null && files.length > 0) {
+                for(int i=0;i<files.length;i++) {
+                    File file2 =files[i];
+                  List<String>  fileGuids2 = fileManagerService.uploadFileGetGuid2(Arrays.asList(file2));
+                  fileGuids.addAll(fileGuids2);
+                }
+            }
+        }
+
+        OldProject oldProject = JSON.parseObject(projectJsons, OldProject.class);
+        //获取信息并装载
+        PatentProjectDTO patentProjectDTO = this.loadPatentProjectDTO(oldProject);
+        patentProjectDTO.setFileGuids(fileGuids);
+        patentProjectDTO.setIfUpdate(false);
+        //保存专题库信息
+        Object o = patentProjectService.addMessage(patentProjectDTO);
+        Integer projectId = (Integer) o;
+        return projectId;
+    }
+
+
+    private List<?> jsonToObject(String json, Class<?> c) {
+        List<?> uploadSettingVOs = JsonUtils.jsonToList(json, c);
+        return uploadSettingVOs;
+    }
+
+    /**
+     * 装载·DTO类进行导入
+     *
+     * @param oldProject
+     * @return
+     */
+    private PatentProjectDTO loadPatentProjectDTO(OldProject oldProject) {
+        PatentProjectDTO patentProjectDTO = new PatentProjectDTO();
+        //名称
+        patentProjectDTO.setName(oldProject.getName());
+        //委托方id
+        if (oldProject.getClientId() != null) {
+            patentProjectDTO.setEntrustId(oldProject.getClientId().toString());
+        }
+        //负责人id
+        if (oldProject.getPersonnelId() != null) {
+            patentProjectDTO.setHeadId(oldProject.getPersonnelId().toString());
+        } else {
+            patentProjectDTO.setHeadId(oldProject.getCreateBy().toString());
+        }
+        patentProjectDTO.setPersonId(oldProject.getCreateBy().toString());
+        if (oldProject.getDepartmentId() != null) {
+            patentProjectDTO.setDepartmentId(oldProject.getDepartmentId().toString());
+        }
+        patentProjectDTO.setContractNo(oldProject.getContractNo());
+        patentProjectDTO.setVolumeNumber(oldProject.getInnerFile());
+        //委案日
+        if (oldProject.getCaseDate() != null) {
+            Date CaseDay = DateUtils.strToDate(oldProject.getCaseDate());
+            patentProjectDTO.setCommissionCaseDay(CaseDay);
+        }
+        //描述
+        patentProjectDTO.setDescription(oldProject.getRemark());
+        //应用场景
+        String scenarioStr = oldProject.getScenario();
+        if (scenarioStr != null) {
+            List<Integer> scenarioIds = FormatUtil.StringTOIntegerList(scenarioStr, ",");
+            patentProjectDTO.setScenarioIds(scenarioIds);
+        }
+        //处理事项
+
+        String matterStr = oldProject.getType();
+        if (matterStr != null) {
+            List<Integer> matterIds = FormatUtil.StringTOIntegerList(matterStr, ",");
+            patentProjectDTO.setMatterIds(matterIds);
+            patentProjectDTO.setStatus(Integer.parseInt(oldProject.getStatus()));
+        }
+        return patentProjectDTO;
+    }
+
+    public void ImportProjectShareMessage(File file, Integer projectId) {
+        File projectUserFile = this.getFileByName(file, Constants.PROJECT_USER);
+        String projectUserJsons = CommonService.readJsonFile(projectUserFile);
+
+        List<OldProjectUser> oldProjectUsers = JSONArray.parseArray(projectUserJsons, OldProjectUser.class);
+        List<AssoProjectPerson> assoProjectPersonList = new ArrayList<>();
+        oldProjectUsers.forEach(item -> {
+            AssoProjectPerson assoProjectPerson = new AssoProjectPerson();
+            assoProjectPerson.setProjectId(projectId);
+            assoProjectPerson.setPersonId(item.getUserId().toString());
+            assoProjectPerson.setCreateId("1");
+            if (item.getType().equals(2)) {
+                assoProjectPerson.setRole(0);
+            } else {
+                assoProjectPerson.setRole(3);
+            }
+            assoProjectPersonList.add(assoProjectPerson);
+        });
+        assoProjectPersonService.saveBatch(assoProjectPersonList);
+
+    }
+
+    public void ImportCustomAnalyse(File file, Integer projectId) {
+
+
+    }
+    public void ImportFamilyPatent(Patent patent){
+
 
 
     }

+ 87 - 0
src/main/java/cn/cslg/pas/service/exportProject/SavePatentToEsService.java

@@ -0,0 +1,87 @@
+package cn.cslg.pas.service.exportProject;
+
+import cn.cslg.pas.common.dto.UploadPatentWebDTO;
+import cn.cslg.pas.common.dto.es.EsCustomFieldDTO;
+import cn.cslg.pas.common.utils.FormatUtil;
+import cn.cslg.pas.common.vo.ImportTaskAMVO;
+import cn.cslg.pas.common.vo.PatentWithIdVO;
+import cn.cslg.pas.domain.es.ESImportTask;
+import cn.cslg.pas.domain.es.Patent;
+import cn.cslg.pas.domain.es.PatentJoin;
+import cn.cslg.pas.service.business.CompareLiteratureService;
+import cn.cslg.pas.service.business.es.EsCustomFieldService;
+import cn.cslg.pas.service.business.es.EsMergePersonService;
+import cn.cslg.pas.service.business.es.EsProductPatentService;
+import cn.cslg.pas.service.business.es.EsService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+@Service
+@RequiredArgsConstructor
+public class SavePatentToEsService {
+    private final EsService esService;
+    private final EsCustomFieldService esCustomFieldService;
+    private final EsMergePersonService esMergePersonService;
+    public void savePatentToEs(UploadPatentWebDTO uploadPatentWebDTO) {
+
+        Patent patent = uploadPatentWebDTO.getPatent();
+        try {
+            //根据专利号查询专利
+            PatentWithIdVO patentWithIdVO = esService.getIdByPatentNo(patent.getPatentNo());
+            String patentId = null;
+            // 若查出专利则更新
+            Patent orgPatent =null;
+            if (patentWithIdVO != null) {
+                patentId = patentWithIdVO.getId();
+                orgPatent = patentWithIdVO.getPatent();
+                BeanUtils.copyProperties(patent, orgPatent, FormatUtil.getNullPropertyNames(patent));
+                esService.updatePatent(orgPatent, patentWithIdVO.getId());
+            } else {
+                PatentJoin patentJoin = new PatentJoin();
+                patentJoin.setName("patent");
+                patent.setPatentJoin(patentJoin);
+                patentId = esService.addPatent(patent);
+                orgPatent= patent;
+            }
+            //判断是否和专题库或报告关联
+
+            //和专题库或报告进行关联
+            if (uploadPatentWebDTO.getProjectId() != null) {
+                //根据projectId和专利id查询
+                if (patentId != null) {
+                    Boolean ifInproject = esService.searchPatent(patentId, uploadPatentWebDTO.getProjectId());
+                    if (!ifInproject) {
+                        System.out.println("多添加的专利:"+patent.getPatentNo());
+                        Patent patentChild = new Patent();
+                        PatentJoin patentJoin = new PatentJoin();
+                        patentJoin.setParent(patentId);
+                        patentJoin.setName("project");
+                        patentChild.setPatentJoin(patentJoin);
+                        patentChild.setProjectId(uploadPatentWebDTO.getProjectId());
+                        esService.addChildPatent(patentChild, patentId);
+                        //当导入专题库时添加默认合并申请人
+
+                            esMergePersonService.addDefaultMergePerson(orgPatent, patentId, uploadPatentWebDTO.getProjectId());
+                    }
+                }
+            }
+
+
+
+            if (uploadPatentWebDTO.getEsCustomFieldDTOList() != null && uploadPatentWebDTO.getEsCustomFieldDTOList().size() != 0) {
+                for (EsCustomFieldDTO esCustomFieldDTO : uploadPatentWebDTO.getEsCustomFieldDTOList()
+                ) {
+                    esCustomFieldDTO.setPatentId(patentId);
+                    esCustomFieldDTO.setOptionType(2);
+                    esCustomFieldDTO.setPatentNo(patent.getPatentNo());
+                    esCustomFieldService.addCustomField(esCustomFieldDTO);
+                }
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+}

+ 90 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldCustomAnalysisItem.java

@@ -0,0 +1,90 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * <p>
+ * 自定义分析项目
+ * </p>
+ *
+ * @author 王岩
+ * @since 2021-12-23
+ */
+@Data
+public class OldCustomAnalysisItem {
+    private Integer id;
+    /**
+     * UID
+     */
+    private String uid;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 创建者
+     */
+    private Integer createBy;
+
+    /**
+     * 父节点
+     */
+    private Integer parentId;
+
+    /**
+     * 可见类型
+     */
+    private Integer permissions;
+
+    /**
+     * 专题库ID
+     */
+    private Integer projectId;
+
+    /**
+     * 排序
+     */
+    private Integer sort;
+
+    /**
+     * 类型
+     */
+    private Integer type;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 状态 0:失效  1:生效
+     */
+    private Integer status;
+
+    /**
+     * @TableField 配置需要填充的字段
+     * 创建时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+}

+ 50 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldCustomAnalysisItemSchema.java

@@ -0,0 +1,50 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+
+import lombok.Data;
+
+@Data
+public class OldCustomAnalysisItemSchema {
+   private Integer id;
+    /**
+     * UID
+     */
+    private String uid;
+
+    /**
+     * 维度
+     */
+    private String dimension;
+
+    /**
+     * 拓展ID
+     */
+    private Integer expand;
+
+
+    /**
+     * 字段ID
+     */
+    private Integer field;
+
+    /**
+     * 字段类型
+     */
+    private Integer ptype;
+
+    /**
+     * 类型
+     */
+    private Integer type;
+
+    /**
+     * 选择数量
+     */
+    private Integer num;
+
+    /**
+     * 创建者
+     */
+    private Integer createBy;
+
+}

+ 360 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldCustomAnalysisItemSetting.java

@@ -0,0 +1,360 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * <p>
+ * 自定义分析项目图表设置
+ * </p>
+ *
+ * @author 王岩
+ * @since 2021-12-23
+ */
+@Data
+public class OldCustomAnalysisItemSetting {
+
+    public OldCustomAnalysisItemSetting() {
+        this.type = 1;
+        this.showType = 0;
+        this.tableType = 0;
+        this.theme = "customed";
+        this.titleSize = 14;
+        this.dataSize = 14;
+        this.axisSize = 14;
+        this.dataLabel = false;
+        this.dataLabel2 = false;
+        this.dataLabel3 = false;
+        this.title1Dir = 0;
+        this.title1 = "";
+        this.title2 = "";
+        this.dataPosition = "top";
+        this.fontFamily = "sans-serif";
+        this.fontFamily2 = "sans-serif";
+        this.fontFamily3 = "sans-serif";
+        this.fontFamily4 = "sans-serif";
+        this.fontWeight = false;
+        this.fontWeight2 = false;
+        this.nameLocation = "end";
+        this.nameLocation2 = "end";
+        this.width = "100";
+        this.height = "650";
+        this.widthUnit = "%";
+        this.heightUnit = "px";
+        this.splitLine = false;
+        this.splitLine2 = false;
+        this.legend = true;
+        this.gridTop = "0";
+        this.gridLeft = "0";
+        this.gridBottom = "0";
+        this.gridRight = "0";
+        this.labelColor = "#000000";
+        this.legendColor = "#000000";
+        this.legendLocation = "top";
+        this.legendFontSize = "13";
+        this.fontSize = "13";
+        this.fontSize2 = "13";
+        this.fontColor = "#000000";
+        this.fontColor2 = "#000000";
+        this.show = true;
+        this.show2 = true;
+        this.interval = true;
+        this.interval2 = true;
+        this.rotate = "0";
+        this.rotate2 = "0";
+        this.paddingTop = 0;
+        this.paddingBottom = 0;
+        this.paddingRight = 0;
+        this.paddingLeft = 0;
+        this.paddingTop2 = 0;
+        this.paddingLeft2 = 0;
+        this.paddingBottom2 = 0;
+        this.paddingRight2 = 0;
+        this.type2 = "scroll";
+        this.barWidth = "";
+        this.scatterSize = "0";
+
+    }
+     private Integer id;
+    /**
+     * UID
+     */
+    private String uid;
+
+    /**
+     * 基础类型
+     */
+    private Integer type;
+
+    /**
+     * 显示类型
+     */
+    private Integer showType;
+
+    /**
+     * 表格类型
+     */
+    private Integer tableType;
+
+    /**
+     * 图片主题
+     */
+    private String theme;
+
+    /**
+     * x轴标题
+     */
+    private String title1;
+
+    /**
+     * y轴标题
+     */
+    private String title2;
+
+    /**
+     * 数据标签是否显示
+     */
+    private Boolean dataLabel;
+
+    /**
+     * 数据标签字体大小
+     */
+    private Integer dataSize;
+
+    /**
+     * xy轴标题字体大小
+     */
+    private Integer titleSize;
+
+    /**
+     * xy轴字体大小
+     */
+    private Integer axisSize;
+
+    /**
+     * x轴字体方向
+     */
+    private Integer title1Dir;
+
+    /**
+     * 数据标签显示位置
+     */
+    private String dataPosition;
+
+    /**
+     * 表格设置
+     */
+    private String tableConfig;
+
+    /**
+     * 颜色
+     */
+    private String colorConfig;
+
+    /**
+     * 辅助线
+     */
+    private String lineConfig;
+
+
+
+    private Integer createBy;
+
+    /**
+     * 坐标轴(X)字体
+     */
+    private String fontFamily;
+
+    /**
+     * 坐标轴(X)加粗
+     */
+    private Boolean fontWeight;
+
+    /**
+     * 坐标轴(Y)加粗
+     */
+    private Boolean fontWeight2;
+
+    /**
+     * 坐标轴(X)名称位置
+     */
+    private String nameLocation;
+
+    /**
+     * 坐标轴(Y)名称位置
+     */
+    private String nameLocation2;
+
+    /**
+     * 高
+     */
+    private String height;
+
+    /**
+     * 宽
+     */
+    private String width;
+
+    /**
+     * 高(单位)
+     */
+    private String heightUnit;
+
+    /**
+     * 宽(单位)
+     */
+    private String widthUnit;
+
+    /**
+     * 坐标轴X(线)是否显示
+     */
+    private Boolean splitLine;
+
+    /**
+     * 坐标轴Y(线)是否显示
+     */
+    private Boolean splitLine2;
+
+    /**
+     * 图例是否显示
+     */
+    private Boolean legend;
+
+    /**
+     * 图例位置
+     */
+    private String legendLocation;
+
+    /**
+     * 图表位置
+     */
+    private String gridTop;
+    private String gridLeft;
+    private String gridRight;
+    private String gridBottom;
+
+    /**
+     * 标签字体
+     */
+    private String fontFamily2;
+
+    /**
+     * 标签字体颜色
+     */
+    private String labelColor;
+
+    /**
+     * 图例字体
+     */
+    private String fontFamily3;
+
+    /**
+     * 图例字体大小
+     */
+    private String legendFontSize;
+
+    /**
+     * 图例字体颜色
+     */
+    private String legendColor;
+
+    /**
+     * 坐标轴(Y)字体
+     */
+    private String fontFamily4;
+
+    /**
+     * 坐标轴(X)字体大小
+     */
+    private String fontSize;
+
+    /**
+     * 坐标轴(Y)字体大小
+     */
+    private String fontSize2;
+
+    /**
+     * 坐标轴(X)字体颜色
+     */
+    private String fontColor;
+
+    /**
+     * 坐标轴(Y)字体颜色
+     */
+    private String fontColor2;
+
+    /**
+     * 坐标轴(X)显示
+     */
+    @TableField("`show`")
+    private Boolean show;
+
+    /**
+     * 坐标轴(Y)显示
+     */
+    private Boolean show2;
+
+    /**
+     * X轴信息全部显示
+     */
+    @TableField("`interval`")
+    private Boolean interval;
+
+    /**
+     * X轴倾斜角度
+     */
+    private String rotate;
+
+    /**
+     * Y轴信息全部显示
+     */
+    private Boolean interval2;
+
+    /**
+     * Y轴倾斜角度
+     */
+    private String rotate2;
+
+    /**
+     * X轴标题padding
+     */
+    private Integer paddingTop;
+    private Integer paddingLeft;
+    private Integer paddingBottom;
+    private Integer paddingRight;
+
+    /**
+     * Y轴标题padding
+     */
+    private Integer paddingTop2;
+    private Integer paddingLeft2;
+    private Integer paddingBottom2;
+    private Integer paddingRight2;
+
+    /**
+     * 图例类型
+     */
+    private String type2;
+
+    /**
+     * 饼图(环形图)数值
+     */
+    private Boolean dataLabel2;
+
+    /**
+     * 饼图(环形图)百分比
+     */
+    private Boolean dataLabel3;
+
+    /**
+     * 柱形图宽度
+     */
+    private String barWidth;
+
+    /**
+     * 气泡比例
+     */
+    private String scatterSize;
+}

+ 80 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldCustomAnalysisItemSource.java

@@ -0,0 +1,80 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * <p>
+ * 自定义分析项目数据源
+ * </p>
+ *
+ * @author 王岩
+ * @since 2021-12-24
+ */
+@Data
+@TableName("os_custom_analysis_item_source")
+public class OldCustomAnalysisItemSource  {
+   private Integer id;
+    /**
+     * 分析项UID
+     */
+    private String uid;
+
+    /**
+     * 维度
+     */
+    private String dimension;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 是否选择
+     */
+    private Boolean selected;
+
+    /**
+     * 字段ID
+     */
+    private Integer fieldId;
+
+    /**
+     * 拓展ID
+     */
+    private Integer expandId;
+
+    /**
+     * 开始时间
+     */
+    private String startTime;
+
+    /**
+     * 结束时间
+     */
+    private String endTime;
+
+    /**
+     * 大于
+     */
+    private String minData;
+
+    /**
+     * 小于
+     */
+    private String maxData;
+
+    /**
+     * 创建者
+     */
+    private Integer createBy;
+
+
+
+    public OldCustomAnalysisItemSource() {
+        this.fieldId = 0;
+        this.expandId = 0;
+    }
+}

+ 67 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentAffair.java

@@ -0,0 +1,67 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import javax.swing.text.html.ObjectView;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 专利信息事务信息表
+ * </p>
+ *
+ * @author 王岩
+ * @since 2022-02-24
+ */
+@Data
+public class OldPatentAffair {
+
+    /**
+     * 发生日期
+     */
+    private Integer dateTime;
+
+    /**
+     * 法律状态
+     */
+    private String status;
+
+    /**
+     * 简单法律状态
+     */
+    private Integer simpleStatus;
+
+    /**
+     * 事务内容(INPADOC法律状态)
+     */
+    private String content;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 专利信息ID
+     */
+    private Integer patentId;
+
+    @TableField(exist = false)
+    private String createTime;
+
+    @TableField(exist = false)
+    private String createStatus;
+
+    @TableField(exist = false)
+    private String createSimpleStatus;
+
+    @Data
+    public static class INPADOC {
+        private String year;
+        private String content;
+        private String country;
+    }
+}

+ 22 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentAgency.java

@@ -0,0 +1,22 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * <p>
+ * 专利信息代理机构表
+ * </p>
+ *
+ * @author 王岩
+ * @since 2022-02-24
+ */
+@Data
+public class OldPatentAgency {
+
+    /**
+     * 机构名称
+     */
+    private String name;
+
+}

+ 25 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentAgent.java

@@ -0,0 +1,25 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * <p>
+ * 专利信息代理人表
+ * </p>
+ *
+ * @author 王岩
+ * @since 2022-02-24
+ */
+@Data
+public class OldPatentAgent {
+    /**
+     * 代理人
+     */
+    private String name;
+    /**
+     * 专利id
+     */
+    private Integer patentId;
+}

+ 102 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentApplicant.java

@@ -0,0 +1,102 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 专利信息申请人表
+ * </p>
+ *
+ * @author 王岩
+ * @since 2022-02-24
+ */
+@Data
+public class OldPatentApplicant {
+    /**
+     * 申请人名称
+     */
+    private String name;
+
+
+    private String shortName;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+    private Integer createBy;
+
+    /**
+     * 更新时间
+     */
+    private Integer updateTime;
+
+    /**
+     * 1.个人 2.企业 3.院校 4.科研机构
+     */
+    private Integer type;
+
+    /**
+     * 国家
+     */
+    private String country;
+
+    /**
+     * 地址
+     */
+    private String addressStr;
+
+    /**
+     * 省ID
+     */
+    private Integer provinceId;
+
+    /**
+     * 市级ID
+     */
+    private Integer cityId;
+
+    /**
+     * 地区关联表
+     */
+    private Integer areaId;
+
+    /**
+     * 是否合并
+     */
+    private Boolean merge;
+
+    /**
+     * 专题库ID
+     */
+    private Integer projectId;
+
+    @TableField(exist = false)
+    private Integer patentId;
+
+    @TableField(exist = false)
+    private Integer order;
+    /**
+     * 申请人/权利人(1权利人 2申请人)
+     */
+    @TableField(exist = false)
+    private Integer dataType;
+
+    @TableField(exist = false)
+    private List<Integer> applicantIds;
+
+    @TableField(exist = false)
+    private String countryName;
+
+    /**
+     * 合并ID (旧)
+     */
+    @TableField(exist = false)
+    private Integer oldMergeId;
+}

+ 357 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentDTO.java

@@ -0,0 +1,357 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class OldPatentDTO {
+    private Integer id;
+    private List<OldPatentApplicant> applicant;
+    private List<OldPatentInventor> inventor;
+    private OldPatentAgency agency;
+    private List<OldPatentAgent> agent;
+    private List<OldPatentAffair> affair;
+    private List<Field> field;
+    private Integer read;
+    private List<String> ipcList;
+    private List<String> cpcList;
+    private List<String> upcList;
+    private List<String> locList;
+
+    private Integer simpleFamily;
+    private Integer inpadocFamily;
+    private Integer patSnapFamily;
+    private PatentFamily family;
+    private List<OldPatentRight> rights;
+    private OldPatentInstructionText instruction;
+    private List<String> priorityCountry;
+    /**
+     * 结果集(专利之星检索接口返回同族专利的接口使用)
+     */
+    private Object familyPatentResult;
+
+    @Data
+    public static class PatentFamily {
+        private List<String> simple;
+        private List<String> inpadoc;
+        private List<String> patSnap;
+    }
+
+    @Data
+    public static class Field {
+        private Integer id;
+        private Integer type;
+        private String name;
+        private List<String> selected;
+    }
+
+    /**
+     * 专利名称(标题)
+     */
+    private String name;
+
+    /**
+     * 专利名称(标题)(译)
+     */
+    private String nameOut;
+
+    /**
+     * 专利号
+     */
+    private String patentNo;
+
+    /**
+     * 摘要
+     */
+    private String abstractStr;
+
+    /**
+     * 摘要(译)
+     */
+    private String abstractOut;
+
+    /**
+     * 申请号
+     */
+    private String applicationNo;
+
+    /**
+     * 申请日
+     */
+    private String applicationDate;
+
+    /**
+     * 公开号
+     */
+    private String publicNo;
+
+    /**
+     * 公开日
+     */
+    private String publicDate;
+
+    /**
+     * 首次公开日
+     */
+    private String firstPublicDate;
+
+    /**
+     * 公开授权号
+     */
+    private String publicAccreditNo;
+
+    /**
+     * 公开授权日
+     */
+    private String publicAccreditDate;
+
+    /**
+     * 受理局
+     */
+    private String bureau;
+
+    /**
+     * IPC国际分类号(主)
+     */
+    private String ipc;
+
+    /**
+     * CPC国际分类号(主)
+     */
+    private String cpc;
+
+    /**
+     * UPC国际分类号(主)
+     */
+    private String upc;
+
+    /**
+     * LOC国际分类号(主)
+     */
+    private String loc;
+
+    /**
+     * 专利状态【有权、审中、无权、PCT状态】
+     */
+    private String simpleStatus;
+    /**
+     * 专利状态【有权、审中、无权、PCT状态】
+     */
+    private Integer simpleStatusInt;
+    /**
+     * 专利类型【发明、新型、外观】
+     */
+    private String type;
+
+    /**
+     * 授权文档名称
+     */
+    private String authDocName;
+
+    /**
+     * 授权文档文件地址
+     */
+    private String authDocUrl;
+
+    /**
+     * 公开文档名称
+     */
+    private String publicDocName;
+
+    /**
+     * 公开文档文件地址
+     */
+    private String publicDocUrl;
+
+    /**
+     * 文献代码
+     */
+    private String code;
+
+    /**
+     * 说明书
+     */
+    private String manual;
+
+    /**
+     * 说明书(译)
+     */
+    private String manualOut;
+
+    /**
+     * 文献页数
+     */
+    private Integer docPage;
+
+    /**
+     * 发明人数量
+     */
+    private Integer inventorNum;
+
+    /**
+     * 主权项数量
+     */
+    private Integer mainRightNum;
+
+    /**
+     * 权利要求数量
+     */
+    private Integer rightNum;
+
+    /**
+     * 权利要求
+     */
+    private String rightContent;
+
+    /**
+     * 独立权力要求
+     */
+    private String selfRightContent;
+
+    /**
+     * 权利要求(译)
+     */
+    private String rightContentOut;
+
+    /**
+     * 优先权号
+     */
+    private String priorityNo;
+
+    /**
+     * 优先权日
+     */
+    private String priorityDate;
+
+    /**
+     * 简单同族数量
+     */
+    private Integer simpleFamilyNum;
+
+    /**
+     * INPADOC同族数量
+     */
+    private Integer inpadocFamilyNum;
+
+    private Integer patSnapFamilyNum;
+
+    /**
+     * 引用专利数量
+     */
+    private Integer quoteNum;
+
+    /**
+     * 被引用次数
+     */
+    private Integer quotedNum;
+
+    /**
+     * 3年内被引用次数
+     */
+    private Integer quotedNum3;
+
+    /**
+     * 5年内被引用次数
+     */
+    private Integer quotedNum5;
+
+    /**
+     * 非专利引用文献数量
+     */
+    private Integer notPatentQuoteNum;
+
+    /**
+     * WO国家阶段
+     */
+    private String wo;
+
+    /**
+     * 代理机构ID
+     */
+    private String agencyId;
+
+    /**
+     * 代理人ID
+     */
+    private String agentId;
+
+    /**
+     * 审查员
+     */
+    private String examiner;
+
+    /**
+     * 助理审查员
+     */
+    private String aidExaminer;
+
+    /**
+     * 引用专利
+     */
+    private String quote;
+
+    /**
+     * 被引用专利
+     */
+    private String quoted;
+
+    /**
+     * 非专利引用文献
+     */
+    private String notPatentQuote;
+
+    /**
+     * 摘要附图
+     */
+    private String abstractPath;
+
+    /**
+     * 当前第一申请人
+     */
+    private String firstApplicant;
+
+    /**
+     * 当前第一申请人地址
+     */
+    private String firstApplicantAddress;
+
+    /**
+     * 申请人数量
+     */
+    private Integer applicantNum;
+
+    /**
+     * 第一发明人
+     */
+    private String firstInventor;
+
+    /**
+     * 第一发明人地址
+     */
+    private String firstInventorAddress;
+
+    private Integer selfRightContentNum;
+
+    /**
+     * 简单同族
+     */
+    private String simpleFamilyStr;
+
+    /**
+     * INPADOC同族
+     */
+    private String inpadocFamilyStr;
+
+    /**
+     * EP指定国状态
+     */
+    private String epStatus;
+
+    /**
+     * pdf首页文件base64位字节流
+     */
+    private String pdfFirstPage;
+
+
+}

+ 27 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentInstructionText.java

@@ -0,0 +1,27 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * 专利说明书(文本)
+ * @TableName os_patent_instruction_text
+ */
+@Data
+public class OldPatentInstructionText {
+    /**
+     * 专利ID
+     */
+    private Integer patentId;
+
+    /**
+     * 说明书
+     */
+    private String manual;
+
+    /**
+     * 说明书(译)
+     */
+    private String manualOut;
+
+}

+ 69 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentInventor.java

@@ -0,0 +1,69 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 专利信息发明人表
+ * </p>
+ *
+ * @author 王岩
+ * @since 2022-02-24
+ */
+@Data
+public class OldPatentInventor {
+
+    /**
+     * 合并前发明人名称
+     */
+    private String name;
+
+    /**
+     * 地址
+     */
+    private String address;
+
+    /**
+     * 国家
+     */
+    private String country;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 类型【个人、企业、研究机构、院校】
+     */
+    private Integer type;
+
+    /**
+     * 专利信息ID
+     */
+    @TableField(exist = false)
+    private Integer patentId;
+
+    @TableField(exist = false)
+    private Boolean first;
+
+    /**
+     * 合并(所属专题库)
+     */
+    private Integer projectId;
+
+    /**
+     * 是否合并
+     */
+    private Boolean merge;
+
+    private Integer updateTime;
+
+    private Integer createBy;
+
+    private List<Integer> inventorIds;
+}

+ 33 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentLabel.java

@@ -0,0 +1,33 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * <p>
+ * 专利信息标签表
+ * </p>
+ *
+ * @author 王岩
+ * @since 2022-03-07
+ */
+@Data
+public class OldPatentLabel  {
+
+    /**
+     * 标签名称
+     */
+    private String name;
+
+    /**
+     * 专利ID
+     */
+    private Integer patentId;
+
+    /**
+     * 专题库
+     */
+    private Integer projectId;
+
+}

+ 40 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldPatentRight.java

@@ -0,0 +1,40 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * 专利权利要求
+ *
+ * @TableName os_patent_right
+ */
+@Data
+@Accessors(chain = true)
+public class OldPatentRight {
+    /**
+     * 专利ID
+     */
+    private Integer patentId;
+    /**
+     * 权利要求原文
+     */
+    private String content;
+    /**
+     * 权利要求译文
+     */
+    private String contentOut;
+    /**
+     * 类型
+     */
+    private Integer type;
+    /**
+     * 排序号
+     */
+    private Integer sort;
+    /**
+     * 父权要的排序号
+     */
+    private String parentSort;
+}

+ 131 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProject.java

@@ -0,0 +1,131 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class OldProject {
+    /**
+     * 专题库名称
+     */
+    private String name;
+
+
+    private Integer createBy;
+
+    /**
+     * 技术主题
+     */
+    private String technicalTheme;
+
+
+    private String innerFile;
+
+
+    private Integer update;
+
+    /**
+     * 处理状态
+     */
+    private String status;
+
+    /**
+     * 合同号
+     */
+    private String contractNo;
+
+    /**
+     * 委案日
+     */
+    private String caseDate;
+
+    /**
+     * 更新周期
+     */
+    private String updateTime;
+
+    /**
+     * 排序
+     */
+    private Integer sort;
+
+    /**
+     * 委托方ID
+     */
+    private Integer clientId;
+
+    /**
+     * 委托场景ID
+     */
+    private String scenario;
+
+    /**
+     * 调查类型ID
+     */
+    private String type;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 部门ID
+     */
+    private Integer departmentId;
+
+    /**
+     * 部门ID
+     */
+    private Integer personnelId;
+    /**
+     * 租户ID
+     */
+    private Integer tenantId;
+    /**
+     * 创建时间
+     */
+    private Integer createTime;
+
+    private String clientName;
+
+
+    private List<String> typeName;
+
+    private List<String> scenarioName;
+
+    private String createName;
+
+    private List<Integer> scenarioList;
+
+    private List<Integer> typeList;
+
+    private Integer reportNum;
+
+    private String departmentName;
+
+    private String personnelName;
+
+    /**
+     * 产品id
+     */
+    private Integer productId;
+    /**
+     * 架构id
+     */
+    private Integer structureId;
+    /**
+     * 是否分类(1是 0否)
+     */
+    private Integer isCategory;
+    /**
+     * 产品名称
+     */
+    private String productName;
+    //事件
+//    private List<EventAddNewDTO> eventAddNewDTOs;
+
+}

+ 85 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProjectField.java

@@ -0,0 +1,85 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 专利信息自定义字段表
+ * </p>
+ *
+ * @author 王岩
+ * @since 2021-12-16
+ */
+@Data
+public class OldProjectField {
+    private Integer id;
+    private Integer newId;
+    /**
+     * 自定义字段名称
+     */
+    private String name;
+
+    /**
+     * 1.是标引 2.是分类
+     */
+    private Integer ptype;
+
+    /**
+     * 字段类型
+     */
+    private Integer type;
+
+    /**
+     * 状态(1正常、0关闭)
+     */
+    private Integer status;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 创建人账户ID
+     */
+    @TableField("cid")
+    private Integer createBy;
+
+
+    private Integer createTime;
+
+    /**
+     * 专题库
+     */
+    private Integer projectId;
+
+
+
+    @TableField(exist = false)
+    private String createName;
+
+    @TableField(exist = false)
+    private Boolean enabled = false;
+
+    @TableField(exist = false)
+    private String text;
+
+    @TableField(exist = false)
+    private List<Integer> selected;
+
+    @TableField(exist = false)
+    private String projectName;
+
+    /**
+     * 数据来源对象
+     */
+    @Data
+    public static class dataType {
+        private String name;
+        private Object id;
+    }
+}

+ 64 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProjectFieldOption.java

@@ -0,0 +1,64 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 自定义字段多选关联表
+ * </p>
+ *
+ * @author 王岩
+ * @since 2021-12-17
+ */
+@Data
+public class OldProjectFieldOption {
+    private Integer id;
+    private Integer newId;
+    /**
+     * 多选选项名称
+     */
+    private String name;
+
+    /**
+     * 自定义字段ID
+     */
+    private Integer fieldId;
+
+    /**
+     * 子节点
+     */
+    private List<OldProjectFieldOption> children;
+
+    /**
+     * 父节点ID
+     */
+    private Integer parentId;
+
+    /**
+     * 专题库ID
+     */
+    private Integer projectId;
+
+    /**
+     * 类型
+     */
+    private Integer type;
+
+    /**
+     * 树形层级
+     */
+    private Integer level;
+
+    /**
+     * 路径
+     */
+    private String path;
+
+    private Integer order;
+
+    private String remark;
+
+    private Integer total;
+}

+ 42 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProjectFieldPatentLink.java

@@ -0,0 +1,42 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * <p>
+ * 标引内容关联专利
+ * </p>
+ *
+ * @author 王岩
+ * @since 2022-02-22
+ */
+@Data
+public class OldProjectFieldPatentLink  {
+
+    /**
+     * 分类标引id
+     */
+    private Integer optionId;
+    /**
+     * 字段ID
+     */
+    private Integer fieldId;
+    /**
+     * 标引类型 0-6
+     */
+    private Integer type;
+    /**
+     * 专利id
+     */
+    private Integer patentId;
+    /**
+     * 专题库id
+     */
+    private Integer projectId;
+    /**
+     * 操作人
+     */
+    private Integer createBy;
+}

+ 30 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProjectFieldText.java

@@ -0,0 +1,30 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * <p>
+ * 自定义字段文本关联表
+ * </p>
+ *
+ * @author 王岩
+ * @since 2022-02-22
+ */
+@Data
+public class OldProjectFieldText {
+  private Integer id;
+    /**
+     * 文本内容
+     */
+    @TableField("name")
+    private String text;
+
+    /**
+     * 自定义字段ID
+     */
+    @TableField("cid")
+    private Integer fieldId;
+
+}

+ 53 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProjectFieldTree.java

@@ -0,0 +1,53 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * <p>
+ * 自定义字段树类型关联表
+ * </p>
+ *
+ * @author 王岩
+ * @since 2021-12-17
+ */
+@Data
+public class OldProjectFieldTree {
+    private Integer id;
+    private Integer newId;
+    /**
+     * 文本内容
+     */
+    private String name;
+
+    /**
+     * 自定义字段ID
+     */
+    private Integer fieldId;
+
+    /**
+     * 父级ID
+     */
+    private Integer parentId;
+    private Integer newParentId;
+    /**
+     * 树真正的ID
+     */
+    private Integer treeId;
+
+    /**
+     * 层级
+     */
+    private Integer level;
+
+    /**
+     * 节点顺序
+     */
+    private Integer order;
+
+    /**
+     * 路径
+     */
+    private String path;
+}

+ 37 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProjectFolder.java

@@ -0,0 +1,37 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 文件夹主表
+ * </p>
+ *
+ * @author 王岩
+ * @since 2021-12-17
+ */
+@Data
+public class OldProjectFolder {
+   private Integer id;
+    private Integer newId;
+    private Integer customFieldId;
+    private String name;
+
+    private Integer parentId;
+    private Integer newParentId;
+
+    private Integer projectId;
+
+
+    private Integer order;
+
+    private String remark;
+
+
+    private Integer total;
+    private Integer fieldId;
+}

+ 27 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProjectFolderPatentLink.java

@@ -0,0 +1,27 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * <p>
+ * 文件夹管理表
+ * </p>
+ *
+ * @author 王岩
+ * @since 2022-02-22
+ */
+@Data
+public class OldProjectFolderPatentLink {
+
+
+    private Integer folderId;
+
+
+    private Integer patentId;
+
+    private Integer look;
+
+    private Integer projectId;
+}

+ 64 - 0
src/main/java/cn/cslg/pas/service/exportProject/oldPasEntity/OldProjectUser.java

@@ -0,0 +1,64 @@
+package cn.cslg.pas.service.exportProject.oldPasEntity;
+
+
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 分配表
+ * </p>
+ *
+ * @author 王岩
+ * @since 2022-02-18
+ */
+@Data
+public class OldProjectUser {
+
+    /**
+     * 账号id(userid)
+     */
+    private Integer userId;
+
+    /**
+     * 租户id
+     */
+    private Integer tenantId;
+
+    /**
+     * 专题库id
+     */
+    private Integer projectId;
+
+    /**
+     *  添加时间
+     */
+    private Integer createTime;
+
+    /**
+     * 备注
+     */
+    private String remark;
+    private List<User> users;
+
+    /**
+     * 权限 1分类人,2管理员,3查阅人
+     */
+    private Integer type;
+
+    private List<String> roles;
+    private String username;
+
+    private String name;
+
+    List<Integer> userIds;
+
+    @Data
+    public static class User{
+        private Integer userId;
+        private Integer tenantId;
+
+    }
+}

+ 4 - 4
src/main/resources/application-dev.yml

@@ -61,12 +61,12 @@ spring:
     #初始化表结构
     jdbc:
       initialize-schema: always
-authorUrl: http://localhost:8885
-PCSUrl: http://localhost:8885
-#OPSUrl: http://192.168.2.24:g5001
+authorUrl: http://localhost:8871
+PCSUrl: http://localhost:8871
+#OPSUrl: http://192.168.2.24:5001
 OPSUrl: http://139.224.24.90:5001
 PASUrl: http://localhost:8879
-FMSUrl: http://localhost:8803
+FMSUrl: http://192.168.2.24:8803
 FileSource: 1
 ES:
   patentVector: patent_vector

File diff suppressed because it is too large
+ 32 - 5
src/test/java/cn/cslg/pas/service/EventServiceTests.java


+ 40 - 0
src/test/java/cn/cslg/pas/service/ExportProjectServiceTests.java

@@ -0,0 +1,40 @@
+package cn.cslg.pas.service;
+
+import cn.cslg.pas.common.dto.DomainFieldDTO;
+import cn.cslg.pas.common.utils.GenerateObjectUtil;
+import cn.cslg.pas.controller.AvoidDesignController;
+import cn.cslg.pas.domain.business.FollowUp;
+import cn.cslg.pas.service.business.AvoidDesignService;
+import cn.cslg.pas.service.exportProject.ExportProjectService;
+import cn.cslg.pas.service.exportProject.ImportProjectService;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2023/12/5
+ */
+@SpringBootTest
+public class ExportProjectServiceTests {
+    @Autowired
+    private ExportProjectService exportProjectService;
+    @Autowired
+    private ImportProjectService importProjectService;
+
+
+    @Test
+    public void test() throws Exception {
+
+    }
+
+    @Test
+    public void testUpdate() {
+        importProjectService.getFileFromZip("");
+
+    }
+
+}