ソースを参照

1/18 其他参考资料

xiexiang 1 年間 前
コミット
eacc70eb6e
19 ファイル変更354 行追加89 行削除
  1. 2 1
      src/main/java/cn/cslg/pas/common/dto/business/LitigationHistoryDTO.java
  2. 16 0
      src/main/java/cn/cslg/pas/common/dto/business/OtherPatentInfoDTO.java
  3. 3 5
      src/main/java/cn/cslg/pas/common/dto/business/ReviewHistoryDTO.java
  4. 11 1
      src/main/java/cn/cslg/pas/common/vo/business/LitigationHistoryVO.java
  5. 3 0
      src/main/java/cn/cslg/pas/common/vo/business/OtherReferencesVO.java
  6. 10 0
      src/main/java/cn/cslg/pas/common/vo/business/PermissionRecordVO.java
  7. 10 1
      src/main/java/cn/cslg/pas/common/vo/business/ReviewHistoryVO.java
  8. 4 6
      src/main/java/cn/cslg/pas/controller/LitigationHistoryController.java
  9. 4 5
      src/main/java/cn/cslg/pas/controller/OtherReferencesController.java
  10. 4 5
      src/main/java/cn/cslg/pas/controller/PermissionRecordController.java
  11. 4 5
      src/main/java/cn/cslg/pas/controller/ReviewHistoryController.java
  12. 6 4
      src/main/java/cn/cslg/pas/domain/business/AssoOtherReferencesFile.java
  13. 1 0
      src/main/java/cn/cslg/pas/domain/business/LitigationHistory.java
  14. 2 2
      src/main/java/cn/cslg/pas/mapper/AssoOtherReferencesFileMapper.java
  15. 3 3
      src/main/java/cn/cslg/pas/service/business/AssoOtherReferencesFileService.java
  16. 85 9
      src/main/java/cn/cslg/pas/service/business/LitigationHistoryService.java
  17. 64 30
      src/main/java/cn/cslg/pas/service/business/OtherReferencesService.java
  18. 37 5
      src/main/java/cn/cslg/pas/service/business/PermissionRecordService.java
  19. 85 7
      src/main/java/cn/cslg/pas/service/business/ReviewHistoryService.java

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

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * @Author xiexiang
@@ -50,7 +51,7 @@ public class LitigationHistoryDTO {
     /**
      * 附件id
      */
-    private String fileGuid;
+    private List<String> fileGuids;
 
     /**
      * projectId

+ 16 - 0
src/main/java/cn/cslg/pas/common/dto/business/OtherPatentInfoDTO.java

@@ -0,0 +1,16 @@
+package cn.cslg.pas.common.dto.business;
+
+import lombok.Data;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/1/18
+ */
+@Data
+public class OtherPatentInfoDTO {
+    private String patentNo;
+    private Integer projectId;
+    private Integer current;
+    private Integer size;
+
+}

+ 3 - 5
src/main/java/cn/cslg/pas/common/dto/business/ReviewHistoryDTO.java

@@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * 审查历史
@@ -37,11 +38,6 @@ public class ReviewHistoryDTO {
     private String reviewExplain;
 
     /**
-     * 文件id
-     */
-    private String fileGuid;
-
-    /**
      * 所属project
      */
     private Integer projectId;
@@ -51,4 +47,6 @@ public class ReviewHistoryDTO {
      */
     private String patentNo;
 
+    private List<String> fileGuids;
+
 }

+ 11 - 1
src/main/java/cn/cslg/pas/common/vo/business/LitigationHistoryVO.java

@@ -1,9 +1,12 @@
 package cn.cslg.pas.common.vo.business;
 
+import cn.cslg.pas.common.model.cronModel.SystemFile;
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * @Author xiexiang
@@ -11,6 +14,7 @@ import java.util.Date;
  */
 @Data
 public class LitigationHistoryVO {
+    private Integer id;
     /**
      * 原告
      */
@@ -30,6 +34,10 @@ public class LitigationHistoryVO {
     /**
      * 起诉时间
      */
+    @JsonFormat(
+            pattern = "yyyy-MM-dd",
+            timezone = "GMT+8"
+    )
     private Date indictTime;
 
     /**
@@ -45,7 +53,9 @@ public class LitigationHistoryVO {
     /**
      * 附件id
      */
-    private String fileGuid;
+    private List<String> fileGuids;
+
+    private List<SystemFile> systemFileList;
 
     /**
      * projectId

+ 3 - 0
src/main/java/cn/cslg/pas/common/vo/business/OtherReferencesVO.java

@@ -1,5 +1,6 @@
 package cn.cslg.pas.common.vo.business;
 
+import cn.cslg.pas.common.model.cronModel.SystemFile;
 import com.baomidou.mybatisplus.annotation.TableField;
 import lombok.Data;
 
@@ -39,6 +40,8 @@ public class OtherReferencesVO {
 
     private List<String> fileGuids;
 
+    private List<SystemFile> systemFileList;
+
     private String createName;
 
     /**

+ 10 - 0
src/main/java/cn/cslg/pas/common/vo/business/PermissionRecordVO.java

@@ -1,6 +1,7 @@
 package cn.cslg.pas.common.vo.business;
 
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.util.Date;
@@ -12,6 +13,7 @@ import java.util.Date;
  */
 @Data
 public class PermissionRecordVO {
+    private Integer id;
     /**
      * 专利号
      */
@@ -35,6 +37,10 @@ public class PermissionRecordVO {
     /**
      * 许可时间
      */
+    @JsonFormat(
+            pattern = "yyyy-MM-dd",
+            timezone = "GMT+8"
+    )
     private Date licenseTime;
 
     /**
@@ -45,6 +51,10 @@ public class PermissionRecordVO {
     /**
      * 截止时间
      */
+    @JsonFormat(
+            pattern = "yyyy-MM-dd",
+            timezone = "GMT+8"
+    )
     private Date licenseDeadLine;
 
     /**

+ 10 - 1
src/main/java/cn/cslg/pas/common/vo/business/ReviewHistoryVO.java

@@ -1,9 +1,12 @@
 package cn.cslg.pas.common.vo.business;
 
+import cn.cslg.pas.common.model.cronModel.SystemFile;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import org.apache.poi.hssf.record.DateWindow1904Record;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * @Author xiexiang
@@ -16,6 +19,10 @@ public class ReviewHistoryVO {
     /**
      * 时间
      */
+    @JsonFormat(
+            pattern = "yyyy-MM-dd",
+            timezone = "GMT+8"
+    )
     private Date reviewTime ;
 
     /**
@@ -31,7 +38,9 @@ public class ReviewHistoryVO {
     /**
      * 文件id
      */
-    private String fileGuid;
+    private List<String> fileGuids;
+
+    private List<SystemFile> systemFileList;
 
     /**
      * 所属project

+ 4 - 6
src/main/java/cn/cslg/pas/controller/LitigationHistoryController.java

@@ -2,9 +2,9 @@ package cn.cslg.pas.controller;
 
 import cn.cslg.pas.common.core.base.Constants;
 import cn.cslg.pas.common.dto.business.LitigationHistoryDTO;
+import cn.cslg.pas.common.dto.business.OtherPatentInfoDTO;
 import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.utils.Response;
-import cn.cslg.pas.common.vo.business.LitigationHistoryVO;
 import cn.cslg.pas.service.business.LitigationHistoryService;
 import io.swagger.v3.oas.annotations.Operation;
 import lombok.extern.slf4j.Slf4j;
@@ -35,11 +35,9 @@ public class LitigationHistoryController {
     }
 
     @Operation(summary = "查询诉讼历史")
-    @GetMapping("/query")
-    public Response queryLitigationHistory(String patentNo) throws Exception {
-        List<LitigationHistoryVO> litigationHistoryVOS = litigationHistoryService.getLitigationHistory(patentNo);
-        Records records = new Records();
-        records.setData(litigationHistoryVOS);
+    @PostMapping("/query")
+    public Response queryLitigationHistory(@RequestBody OtherPatentInfoDTO otherPatentInfoDTO) throws Exception {
+        Records records = litigationHistoryService.getLitigationHistory(otherPatentInfoDTO);
         return Response.success(records);
     }
 

+ 4 - 5
src/main/java/cn/cslg/pas/controller/OtherReferencesController.java

@@ -1,6 +1,7 @@
 package cn.cslg.pas.controller;
 
 import cn.cslg.pas.common.core.base.Constants;
+import cn.cslg.pas.common.dto.business.OtherPatentInfoDTO;
 import cn.cslg.pas.common.dto.business.OtherReferencesDTO;
 import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.utils.Response;
@@ -35,11 +36,9 @@ public class OtherReferencesController {
     }
 
     @Operation(summary = "查询其他参考资料")
-    @GetMapping("/query")
-    public Response queryOtherReferences(String patentNo) throws Exception {
-        List<OtherReferencesVO> otherReferencesVOS = otherReferencesService.getOtherReferences(patentNo);
-        Records records = new Records();
-        records.setData(otherReferencesVOS);
+    @PostMapping("/query")
+    public Response queryOtherReferences(@RequestBody OtherPatentInfoDTO otherPatentInfoDTO) throws Exception {
+        Records records = otherReferencesService.getOtherReferences(otherPatentInfoDTO);
         return Response.success(records);
     }
 

+ 4 - 5
src/main/java/cn/cslg/pas/controller/PermissionRecordController.java

@@ -1,6 +1,7 @@
 package cn.cslg.pas.controller;
 
 import cn.cslg.pas.common.core.base.Constants;
+import cn.cslg.pas.common.dto.business.OtherPatentInfoDTO;
 import cn.cslg.pas.common.dto.business.PermissionRecordDTO;
 import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.utils.Response;
@@ -35,11 +36,9 @@ public class PermissionRecordController {
     }
 
     @Operation(summary = "查询许可历史")
-    @GetMapping("/query")
-    public Response queryLitigationHistory(String patentNo) throws Exception {
-        List<PermissionRecordVO> permissionRecordVOS = permissionRecordService.getPermissionRecord(patentNo);
-        Records records = new Records();
-        records.setData(permissionRecordVOS);
+    @PostMapping("/query")
+    public Response queryPermissionRecord(@RequestBody OtherPatentInfoDTO otherPatentInfoDTO) throws Exception {
+        Records records = permissionRecordService.getPermissionRecord(otherPatentInfoDTO);
         return Response.success(records);
     }
 

+ 4 - 5
src/main/java/cn/cslg/pas/controller/ReviewHistoryController.java

@@ -1,6 +1,7 @@
 package cn.cslg.pas.controller;
 
 import cn.cslg.pas.common.core.base.Constants;
+import cn.cslg.pas.common.dto.business.OtherPatentInfoDTO;
 import cn.cslg.pas.common.dto.business.ReviewHistoryDTO;
 import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.utils.Response;
@@ -36,11 +37,9 @@ public class ReviewHistoryController {
     }
 
     @Operation(summary = "查询审查历史")
-    @GetMapping("/query")
-    public Response queryReviewHistory(String patentNo) throws Exception {
-        List<ReviewHistoryVO> reviewHistoryVOS = reviewHistoryService.getReviewHistory(patentNo);
-        Records records = new Records();
-        records.setData(reviewHistoryVOS);
+    @PostMapping("/query")
+    public Response queryReviewHistory(@RequestBody OtherPatentInfoDTO otherPatentInfoDTO) throws Exception {
+        Records records = reviewHistoryService.getReviewHistory(otherPatentInfoDTO);
         return Response.success(records);
     }
 

+ 6 - 4
src/main/java/cn/cslg/pas/domain/business/AssoOtherReferencesFile.java

@@ -10,10 +10,12 @@ import lombok.Data;
  * @Date 2024/1/17
  */
 @Data
-@TableName("asso_other_references_file")
-public class AssoOtherReferencesFile extends BaseEntity<AssoOtherReferencesFile> {
+@TableName("asso_other_patent_info_file")
+public class AssoOtherPatentInfoFile extends BaseEntity<AssoOtherPatentInfoFile> {
     @TableField(value = "file_guid")
     private String fileGuid;
-    @TableField(value = "other_references_id")
-    private Integer otherReferencesId;
+    @TableField(value = "other_patent_info_id")
+    private Integer otherPatentInfoId;
+    @TableField(value = "type")
+    private Integer type;
 }

+ 1 - 0
src/main/java/cn/cslg/pas/domain/business/LitigationHistory.java

@@ -8,6 +8,7 @@ import lombok.Data;
 import java.util.Date;
 
 /**
+ * 诉讼历史
  * @Author xiexiang
  * @Date 2024/1/15
  */

+ 2 - 2
src/main/java/cn/cslg/pas/mapper/AssoOtherReferencesFileMapper.java

@@ -1,6 +1,6 @@
 package cn.cslg.pas.mapper;
 
-import cn.cslg.pas.domain.business.AssoOtherReferencesFile;
+import cn.cslg.pas.domain.business.AssoOtherPatentInfoFile;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.springframework.stereotype.Repository;
 
@@ -9,5 +9,5 @@ import org.springframework.stereotype.Repository;
  * @Date 2024/1/17
  */
 @Repository
-public interface AssoOtherReferencesFileMapper extends BaseMapper<AssoOtherReferencesFile> {
+public interface AssoOtherPatentInfoFileMapper extends BaseMapper<AssoOtherPatentInfoFile> {
 }

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

@@ -1,7 +1,7 @@
 package cn.cslg.pas.service.business;
 
-import cn.cslg.pas.domain.business.AssoOtherReferencesFile;
-import cn.cslg.pas.mapper.AssoOtherReferencesFileMapper;
+import cn.cslg.pas.domain.business.AssoOtherPatentInfoFile;
+import cn.cslg.pas.mapper.AssoOtherPatentInfoFileMapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
@@ -12,5 +12,5 @@ import org.springframework.stereotype.Service;
  */
 @Slf4j
 @Service
-public class AssoOtherReferencesFileService extends ServiceImpl<AssoOtherReferencesFileMapper, AssoOtherReferencesFile> {
+public class AssoOtherPatentInfoFileService extends ServiceImpl<AssoOtherPatentInfoFileMapper, AssoOtherPatentInfoFile> {
 }

+ 85 - 9
src/main/java/cn/cslg/pas/service/business/LitigationHistoryService.java

@@ -1,21 +1,25 @@
 package cn.cslg.pas.service.business;
 
 import cn.cslg.pas.common.dto.business.LitigationHistoryDTO;
-import cn.cslg.pas.common.dto.business.ReviewHistoryDTO;
+import cn.cslg.pas.common.dto.business.OtherPatentInfoDTO;
 import cn.cslg.pas.common.model.cronModel.Personnel;
 import cn.cslg.pas.common.model.cronModel.PersonnelVO;
+import cn.cslg.pas.common.model.cronModel.Records;
+import cn.cslg.pas.common.model.cronModel.SystemFile;
 import cn.cslg.pas.common.utils.CacheUtils;
 import cn.cslg.pas.common.utils.LoginUtils;
 import cn.cslg.pas.common.utils.StringUtils;
 import cn.cslg.pas.common.vo.business.LitigationHistoryVO;
-import cn.cslg.pas.common.vo.business.ReviewHistoryVO;
+import cn.cslg.pas.domain.business.AssoOtherPatentInfoFile;
 import cn.cslg.pas.domain.business.LitigationHistory;
-import cn.cslg.pas.domain.business.ReviewHistory;
 import cn.cslg.pas.exception.XiaoShiException;
 import cn.cslg.pas.mapper.LitigationHistoryMapper;
+import cn.cslg.pas.service.common.FileManagerService;
 import cn.cslg.pas.service.permissions.PermissionService;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
@@ -25,6 +29,7 @@ import org.springframework.stereotype.Service;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @Author xiexiang
@@ -42,6 +47,15 @@ public class LitigationHistoryService extends ServiceImpl<LitigationHistoryMappe
     @Autowired
     private PermissionService permissionService;
 
+    @Autowired
+    private AssoOtherPatentInfoFileService assoOtherPatentInfoFileService;
+
+    @Autowired
+    private OtherReferencesService otherReferencesService;
+
+    @Autowired
+    private FileManagerService fileManagerService;
+
     /**
      * 新增or更新
      * @param litigationHistoryDTO
@@ -52,12 +66,23 @@ public class LitigationHistoryService extends ServiceImpl<LitigationHistoryMappe
             throw new XiaoShiException("入参为空");
         }
         Integer id = litigationHistoryDTO.getId();
+        List<String> fileGuids = litigationHistoryDTO.getFileGuids();
         LitigationHistory litigationHistory = new LitigationHistory();
+        Integer type = 4;
         if (id != null) {
             //update
             litigationHistory = this.getById(id);
             BeanUtils.copyProperties(litigationHistoryDTO, litigationHistory);
             litigationHistory.updateById();
+
+            //先删除 后添加
+            LambdaQueryWrapper<AssoOtherPatentInfoFile> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(AssoOtherPatentInfoFile::getOtherPatentInfoId, id)
+                    .eq(AssoOtherPatentInfoFile::getType, type);
+            assoOtherPatentInfoFileService.remove(queryWrapper);
+            if (!fileGuids.isEmpty()) {
+                List<Integer> fileIds = otherReferencesService.addFile(litigationHistory.getId(), fileGuids, type);
+            }
         } else {
             BeanUtils.copyProperties(litigationHistoryDTO, litigationHistory);
             PersonnelVO personnelVO = new PersonnelVO();
@@ -68,19 +93,35 @@ public class LitigationHistoryService extends ServiceImpl<LitigationHistoryMappe
             }
             litigationHistory.setCreateId(personnelVO.getId());
             litigationHistory.insert();
+            if (fileGuids != null && !fileGuids.isEmpty()) {
+                //先删除 后添加
+                List<Integer> fileIds = otherReferencesService.addFile(litigationHistory.getId(), fileGuids, type);
+            }
         }
         return litigationHistory.getId();
     }
 
-    public List<LitigationHistoryVO> getLitigationHistory(String patentNo) throws IOException {
+    /**
+     * 分页查询
+     * @param otherPatentInfoDTO
+     * @return
+     * @throws IOException
+     */
+    public Records getLitigationHistory( OtherPatentInfoDTO otherPatentInfoDTO) throws IOException {
+        List<LitigationHistoryVO> litigationHistoryVOS = new ArrayList<>();
+        String patentNo = otherPatentInfoDTO.getPatentNo();
         if (patentNo == null || StringUtils.isEmpty(patentNo)) {
             throw new XiaoShiException("入参为空");
         }
-        List<LitigationHistoryVO> litigationHistoryVOS = new ArrayList<>();
+        Integer current = otherPatentInfoDTO.getCurrent();
+        Integer size = otherPatentInfoDTO.getSize();
+        Page<LitigationHistory> page = new Page<>(current, size);
+
         LambdaQueryWrapper<LitigationHistory> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(LitigationHistory::getPatentNo, patentNo);
-        List<LitigationHistory> litigationHistories = this.list(queryWrapper);
-
+        IPage<LitigationHistory> litigationHistoryPage = this.page(page, queryWrapper);
+        List<LitigationHistory> litigationHistories = litigationHistoryPage.getRecords();
+        long total = litigationHistoryPage.getTotal();
         if (!litigationHistories.isEmpty()) {
             litigationHistories.forEach(item -> {
                 LitigationHistoryVO litigationHistoryVO = new LitigationHistoryVO();
@@ -89,9 +130,19 @@ public class LitigationHistoryService extends ServiceImpl<LitigationHistoryMappe
             });
             this.loadLitigationHistoryVOS(litigationHistoryVOS);
         }
-        return litigationHistoryVOS;
+        Records records = new Records();
+        records.setTotal(total);
+        records.setCurrent((long)current);
+        records.setSize((long) size);
+        records.setData(litigationHistoryVOS);
+        return records;
     }
 
+    /**
+     * 装载
+     * @param litigationHistoryVOS
+     * @throws IOException
+     */
     public void loadLitigationHistoryVOS(List<LitigationHistoryVO> litigationHistoryVOS) throws IOException {
         List<String> createIds = new ArrayList<>();
         litigationHistoryVOS.forEach(item -> {
@@ -113,12 +164,37 @@ public class LitigationHistoryService extends ServiceImpl<LitigationHistoryMappe
             if (personnel != null) {
                 litigationHistoryVO.setCreateName(personnel.getPersonnelName());
             }
+            LambdaQueryWrapper<AssoOtherPatentInfoFile> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(AssoOtherPatentInfoFile::getOtherPatentInfoId, litigationHistoryVO.getId())
+                    .eq(AssoOtherPatentInfoFile::getType, 4);
+            List<AssoOtherPatentInfoFile> assoOtherPatentInfoFiles = assoOtherPatentInfoFileService.list(queryWrapper);
+            if (!assoOtherPatentInfoFiles.isEmpty()) {
+                List<String> fileGuids = assoOtherPatentInfoFiles.stream().map(AssoOtherPatentInfoFile::getFileGuid).collect(Collectors.toList());
+                litigationHistoryVO.setFileGuids(fileGuids);
+                List<SystemFile> systemFiles = new ArrayList<>();
+                if (fileGuids.size() != 0) {
+                    String res = fileManagerService.getSystemFileFromFMS(fileGuids);
+                    systemFiles = JSONObject.parseArray(res, SystemFile.class);
+                }
+                if (!systemFiles.isEmpty()) {
+                    litigationHistoryVO.setSystemFileList(systemFiles);
+                }
+            }
         }
-
     }
 
+    /**
+     * 删除
+     * @param ids
+     * @return
+     */
     public List<Integer> deleteLitigationHistory(List<Integer> ids) {
         if (!ids.isEmpty()) {
+            //先删除附件
+            LambdaQueryWrapper<AssoOtherPatentInfoFile> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.in(AssoOtherPatentInfoFile::getOtherPatentInfoId, ids)
+                    .eq(AssoOtherPatentInfoFile::getType, 4);
+            assoOtherPatentInfoFileService.remove(queryWrapper);
             this.removeBatchByIds(ids);
         }
         return ids;

+ 64 - 30
src/main/java/cn/cslg/pas/service/business/OtherReferencesService.java

@@ -1,21 +1,25 @@
 package cn.cslg.pas.service.business;
 
+import cn.cslg.pas.common.dto.business.OtherPatentInfoDTO;
 import cn.cslg.pas.common.dto.business.OtherReferencesDTO;
 import cn.cslg.pas.common.model.cronModel.Personnel;
 import cn.cslg.pas.common.model.cronModel.PersonnelVO;
+import cn.cslg.pas.common.model.cronModel.Records;
+import cn.cslg.pas.common.model.cronModel.SystemFile;
 import cn.cslg.pas.common.utils.CacheUtils;
 import cn.cslg.pas.common.utils.LoginUtils;
 import cn.cslg.pas.common.utils.StringUtils;
-import cn.cslg.pas.common.vo.business.LitigationHistoryVO;
 import cn.cslg.pas.common.vo.business.OtherReferencesVO;
-import cn.cslg.pas.domain.business.AssoOtherReferencesFile;
-import cn.cslg.pas.domain.business.LitigationHistory;
+import cn.cslg.pas.domain.business.AssoOtherPatentInfoFile;
 import cn.cslg.pas.domain.business.OtherReferences;
 import cn.cslg.pas.exception.XiaoShiException;
 import cn.cslg.pas.mapper.OtherReferencesMapper;
+import cn.cslg.pas.service.common.FileManagerService;
 import cn.cslg.pas.service.permissions.PermissionService;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
@@ -45,7 +49,10 @@ public class OtherReferencesService extends ServiceImpl<OtherReferencesMapper, O
     private PermissionService permissionService;
 
     @Autowired
-    private AssoOtherReferencesFileService assoReferencesFileService;
+    private AssoOtherPatentInfoFileService assoOtherPatentInfoFileService;
+
+    @Autowired
+    private FileManagerService fileManagerService;
 
     /**
      * 新增or更新其他参考资料
@@ -59,17 +66,19 @@ public class OtherReferencesService extends ServiceImpl<OtherReferencesMapper, O
         Integer id = otherReferencesDTO.getId();
         List<String> fileGuids = otherReferencesDTO.getFileGuids();
         OtherReferences otherReferences = new OtherReferences();
+        Integer type = 1;
         if (id != null) {
             //update
             otherReferences = this.getById(id);
             BeanUtils.copyProperties(otherReferencesDTO, otherReferences);
             otherReferences.updateById();
             //先删除 后添加
-            LambdaQueryWrapper<AssoOtherReferencesFile> queryWrapper = new LambdaQueryWrapper<>();
-            queryWrapper.eq(AssoOtherReferencesFile::getOtherReferencesId, id);
-            assoReferencesFileService.remove(queryWrapper);
+            LambdaQueryWrapper<AssoOtherPatentInfoFile> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(AssoOtherPatentInfoFile::getOtherPatentInfoId, id)
+                    .eq(AssoOtherPatentInfoFile::getType, type);
+            assoOtherPatentInfoFileService.remove(queryWrapper);
             if (!fileGuids.isEmpty()) {
-                List<Integer> fileIds = this.addFile(otherReferences.getId(), fileGuids);
+                List<Integer> fileIds = this.addFile(otherReferences.getId(), fileGuids, type);
             }
         } else {
             BeanUtils.copyProperties(otherReferencesDTO, otherReferences);
@@ -83,7 +92,7 @@ public class OtherReferencesService extends ServiceImpl<OtherReferencesMapper, O
             otherReferences.insert();
             if (!fileGuids.isEmpty()) {
                 //先删除 后添加
-                List<Integer> fileIds = this.addFile(otherReferences.getId(), fileGuids);
+                List<Integer> fileIds = this.addFile(otherReferences.getId(), fileGuids, type);
             }
         }
         return otherReferences.getId();
@@ -93,37 +102,46 @@ public class OtherReferencesService extends ServiceImpl<OtherReferencesMapper, O
      * 新增文件与其他参考资料关联
      * @param id
      * @param fileGuids
+     * @param type
      * @return
      */
-    public List<Integer> addFile(Integer id, List<String> fileGuids){
+    public List<Integer> addFile(Integer id, List<String> fileGuids, Integer type){
         List<Integer> ids = new ArrayList<>();
         if (!fileGuids.isEmpty()) {
-            List<AssoOtherReferencesFile> assoOtherReferencesFiles = new ArrayList<>();
+            List<AssoOtherPatentInfoFile> assoOtherPatentInfoFiles = new ArrayList<>();
             fileGuids.forEach(item -> {
-                AssoOtherReferencesFile assoOtherReferencesFile = new AssoOtherReferencesFile();
-                assoOtherReferencesFile.setOtherReferencesId(id);
-                assoOtherReferencesFile.setFileGuid(item);
-                assoOtherReferencesFiles.add(assoOtherReferencesFile);
+                AssoOtherPatentInfoFile assoOtherPatentInfoFile = new AssoOtherPatentInfoFile();
+                assoOtherPatentInfoFile.setOtherPatentInfoId(id);
+                assoOtherPatentInfoFile.setType(type);
+                assoOtherPatentInfoFile.setFileGuid(item);
+                assoOtherPatentInfoFiles.add(assoOtherPatentInfoFile);
             });
-            assoReferencesFileService.saveBatch(assoOtherReferencesFiles);
+            assoOtherPatentInfoFileService.saveBatch(assoOtherPatentInfoFiles);
         }
         return ids;
     }
 
     /**
-     * 查询
-     * @param patentNo
+     * 分页查询
+     * @param otherPatentInfoDTO
      * @return
      * @throws IOException
      */
-    public List<OtherReferencesVO> getOtherReferences(String patentNo) throws IOException {
+    public Records getOtherReferences(OtherPatentInfoDTO otherPatentInfoDTO) throws IOException {
+        List<OtherReferencesVO> otherReferencesVOS = new ArrayList<>();
+        String patentNo = otherPatentInfoDTO.getPatentNo();
         if (patentNo == null || StringUtils.isEmpty(patentNo)) {
             throw new XiaoShiException("入参为空");
         }
-        List<OtherReferencesVO> otherReferencesVOS = new ArrayList<>();
+        Integer current = otherPatentInfoDTO.getCurrent();
+        Integer size = otherPatentInfoDTO.getSize();
+        Page<OtherReferences> page = new Page<>(current, size);
+
         LambdaQueryWrapper<OtherReferences> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(OtherReferences::getPatentNo, patentNo);
-        List<OtherReferences> otherReferencesList = this.list(queryWrapper);
+        IPage<OtherReferences> otherReferencesPage = this.page(page, queryWrapper);
+        List<OtherReferences> otherReferencesList = otherReferencesPage.getRecords();
+        long total = otherReferencesPage.getTotal();
 
         if (!otherReferencesList.isEmpty()) {
             otherReferencesList.forEach(item -> {
@@ -133,7 +151,12 @@ public class OtherReferencesService extends ServiceImpl<OtherReferencesMapper, O
             });
             this.loadOtherReferencesVOS(otherReferencesVOS);
         }
-        return otherReferencesVOS;
+        Records records = new Records();
+        records.setTotal(total);
+        records.setCurrent((long)current);
+        records.setSize((long) size);
+        records.setData(otherReferencesVOS);
+        return records;
     }
 
     /**
@@ -162,13 +185,23 @@ public class OtherReferencesService extends ServiceImpl<OtherReferencesMapper, O
             if (personnel != null) {
                 otherReferencesVO.setCreateName(personnel.getPersonnelName());
             }
-            LambdaQueryWrapper<AssoOtherReferencesFile> queryWrapper = new LambdaQueryWrapper<>();
-            queryWrapper.eq(AssoOtherReferencesFile::getOtherReferencesId, otherReferencesVO.getId());
-            List<AssoOtherReferencesFile> assoOtherReferencesFiles = assoReferencesFileService.list(queryWrapper);
-            if (!assoOtherReferencesFiles.isEmpty()) {
-                List<String> fileGuids = assoOtherReferencesFiles.stream().map(AssoOtherReferencesFile::getFileGuid).collect(Collectors.toList());
+            LambdaQueryWrapper<AssoOtherPatentInfoFile> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(AssoOtherPatentInfoFile::getOtherPatentInfoId, otherReferencesVO.getId())
+                    .eq(AssoOtherPatentInfoFile::getType, 1);
+            List<AssoOtherPatentInfoFile> assoOtherPatentInfoFiles = assoOtherPatentInfoFileService.list(queryWrapper);
+            if (!assoOtherPatentInfoFiles.isEmpty()) {
+                List<String> fileGuids = assoOtherPatentInfoFiles.stream().map(AssoOtherPatentInfoFile::getFileGuid).collect(Collectors.toList());
                 otherReferencesVO.setFileGuids(fileGuids);
+                List<SystemFile> systemFiles = new ArrayList<>();
+                if (fileGuids.size() != 0) {
+                    String res = fileManagerService.getSystemFileFromFMS(fileGuids);
+                    systemFiles = JSONObject.parseArray(res, SystemFile.class);
+                }
+                if (!systemFiles.isEmpty()) {
+                    otherReferencesVO.setSystemFileList(systemFiles);
+                }
             }
+
         }
 
     }
@@ -181,9 +214,10 @@ public class OtherReferencesService extends ServiceImpl<OtherReferencesMapper, O
     public List<Integer> deleteOtherReferences(List<Integer> ids) {
         if (!ids.isEmpty()) {
             //先删除附件
-            LambdaQueryWrapper<AssoOtherReferencesFile> queryWrapper = new LambdaQueryWrapper<>();
-            queryWrapper.in(AssoOtherReferencesFile::getOtherReferencesId, ids);
-            assoReferencesFileService.remove(queryWrapper);
+            LambdaQueryWrapper<AssoOtherPatentInfoFile> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.in(AssoOtherPatentInfoFile::getOtherPatentInfoId, ids)
+                    .eq(AssoOtherPatentInfoFile::getType, 1);
+            assoOtherPatentInfoFileService.remove(queryWrapper);
             this.removeBatchByIds(ids);
         }
         return ids;

+ 37 - 5
src/main/java/cn/cslg/pas/service/business/PermissionRecordService.java

@@ -1,9 +1,11 @@
 package cn.cslg.pas.service.business;
 
 import cn.cslg.pas.common.dto.business.LitigationHistoryDTO;
+import cn.cslg.pas.common.dto.business.OtherPatentInfoDTO;
 import cn.cslg.pas.common.dto.business.PermissionRecordDTO;
 import cn.cslg.pas.common.model.cronModel.Personnel;
 import cn.cslg.pas.common.model.cronModel.PersonnelVO;
+import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.utils.CacheUtils;
 import cn.cslg.pas.common.utils.LoginUtils;
 import cn.cslg.pas.common.utils.StringUtils;
@@ -16,6 +18,8 @@ import cn.cslg.pas.mapper.PermissionRecordMapper;
 import cn.cslg.pas.service.permissions.PermissionService;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
@@ -66,21 +70,34 @@ public class PermissionRecordService extends ServiceImpl<PermissionRecordMapper,
             } catch (Exception e) {
                 throw new XiaoShiException("未查询到当前登陆人");
             }
+            permissionRecord.setTenantId(personnelVO.getTenantId());
             permissionRecord.setCreateId(personnelVO.getId());
             permissionRecord.insert();
         }
         return permissionRecord.getId();
     }
 
-    public List<PermissionRecordVO> getPermissionRecord(String patentNo) throws IOException {
+    /**
+     * 分页查询
+     * @param otherPatentInfoDTO
+     * @return
+     * @throws IOException
+     */
+    public Records getPermissionRecord(OtherPatentInfoDTO otherPatentInfoDTO) throws IOException {
+        List<PermissionRecordVO> permissionRecordVOS = new ArrayList<>();
+        String patentNo = otherPatentInfoDTO.getPatentNo();
         if (patentNo == null || StringUtils.isEmpty(patentNo)) {
             throw new XiaoShiException("入参为空");
         }
-        List<PermissionRecordVO> permissionRecordVOS = new ArrayList<>();
+        Integer current = otherPatentInfoDTO.getCurrent();
+        Integer size = otherPatentInfoDTO.getSize();
+        Page<PermissionRecord> page = new Page<>(current, size);
+
         LambdaQueryWrapper<PermissionRecord> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(PermissionRecord::getPatentNo, patentNo);
-        List<PermissionRecord> permissionRecords = this.list(queryWrapper);
-
+        IPage<PermissionRecord> permissionRecordPage = this.page(page, queryWrapper);
+        List<PermissionRecord> permissionRecords = permissionRecordPage.getRecords();
+        long total = permissionRecordPage.getTotal();
         if (!permissionRecords.isEmpty()) {
             permissionRecords.forEach(item -> {
                 PermissionRecordVO permissionRecordVO = new PermissionRecordVO();
@@ -89,9 +106,19 @@ public class PermissionRecordService extends ServiceImpl<PermissionRecordMapper,
             });
             this.loadPermissionRecordVOS(permissionRecordVOS);
         }
-        return permissionRecordVOS;
+        Records records = new Records();
+        records.setTotal(total);
+        records.setCurrent((long)current);
+        records.setSize((long) size);
+        records.setData(permissionRecordVOS);
+        return records;
     }
 
+    /**
+     * 装载
+     * @param permissionRecordVOS
+     * @throws IOException
+     */
     public void loadPermissionRecordVOS(List<PermissionRecordVO> permissionRecordVOS) throws IOException {
         List<String> createIds = new ArrayList<>();
         permissionRecordVOS.forEach(item -> {
@@ -117,6 +144,11 @@ public class PermissionRecordService extends ServiceImpl<PermissionRecordMapper,
 
     }
 
+    /**
+     * 删除许可历史
+     * @param ids
+     * @return
+     */
     public List<Integer> deletePermissionRecord(List<Integer> ids) {
         if (!ids.isEmpty()) {
             this.removeBatchByIds(ids);

+ 85 - 7
src/main/java/cn/cslg/pas/service/business/ReviewHistoryService.java

@@ -1,20 +1,25 @@
 package cn.cslg.pas.service.business;
 
+import cn.cslg.pas.common.dto.business.OtherPatentInfoDTO;
 import cn.cslg.pas.common.dto.business.ReviewHistoryDTO;
 import cn.cslg.pas.common.model.cronModel.Personnel;
 import cn.cslg.pas.common.model.cronModel.PersonnelVO;
+import cn.cslg.pas.common.model.cronModel.Records;
+import cn.cslg.pas.common.model.cronModel.SystemFile;
 import cn.cslg.pas.common.utils.CacheUtils;
 import cn.cslg.pas.common.utils.LoginUtils;
 import cn.cslg.pas.common.utils.StringUtils;
-import cn.cslg.pas.common.vo.HightlightTemplateVO;
 import cn.cslg.pas.common.vo.business.ReviewHistoryVO;
-import cn.cslg.pas.domain.business.HightlightTemplate;
+import cn.cslg.pas.domain.business.AssoOtherPatentInfoFile;
 import cn.cslg.pas.domain.business.ReviewHistory;
 import cn.cslg.pas.exception.XiaoShiException;
 import cn.cslg.pas.mapper.ReviewHistoryMapper;
+import cn.cslg.pas.service.common.FileManagerService;
 import cn.cslg.pas.service.permissions.PermissionService;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
@@ -24,6 +29,7 @@ import org.springframework.stereotype.Service;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @Author xiexiang
@@ -41,6 +47,15 @@ public class ReviewHistoryService extends ServiceImpl<ReviewHistoryMapper, Revie
     @Autowired
     private PermissionService permissionService;
 
+    @Autowired
+    private AssoOtherPatentInfoFileService assoOtherPatentInfoFileService;
+
+    @Autowired
+    private OtherReferencesService otherReferencesService;
+
+    @Autowired
+    private FileManagerService fileManagerService;
+
     /**
      * 新增or更新
      * @param reviewHistoryDTO
@@ -51,12 +66,23 @@ public class ReviewHistoryService extends ServiceImpl<ReviewHistoryMapper, Revie
             throw new XiaoShiException("入参为空");
         }
         Integer id = reviewHistoryDTO.getId();
+        List<String> fileGuids = reviewHistoryDTO.getFileGuids();
         ReviewHistory reviewHistory = new ReviewHistory();
+        Integer type = 3;
         if (id != null) {
             //update
             reviewHistory = this.getById(id);
             BeanUtils.copyProperties(reviewHistoryDTO, reviewHistory);
             reviewHistory.updateById();
+
+            //先删除 后添加
+            LambdaQueryWrapper<AssoOtherPatentInfoFile> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(AssoOtherPatentInfoFile::getOtherPatentInfoId, id)
+                    .eq(AssoOtherPatentInfoFile::getType, type);
+            assoOtherPatentInfoFileService.remove(queryWrapper);
+            if (!fileGuids.isEmpty()) {
+                List<Integer> fileIds = otherReferencesService.addFile(reviewHistory.getId(), fileGuids, type);
+            }
         } else {
             BeanUtils.copyProperties(reviewHistoryDTO, reviewHistory);
             PersonnelVO personnelVO = new PersonnelVO();
@@ -68,19 +94,35 @@ public class ReviewHistoryService extends ServiceImpl<ReviewHistoryMapper, Revie
             reviewHistory.setCreateId(personnelVO.getId());
             reviewHistory.setTenantId(personnelVO.getTenantId());
             reviewHistory.insert();
+            if (!fileGuids.isEmpty()) {
+                //先删除 后添加
+                List<Integer> fileIds = otherReferencesService.addFile(reviewHistory.getId(), fileGuids, type);
+            }
         }
         return reviewHistory.getId();
     }
 
-    public List<ReviewHistoryVO> getReviewHistory(String patentNo) throws IOException {
+    /**
+     * 分页查询
+     * @param otherPatentInfoDTO
+     * @return
+     * @throws IOException
+     */
+    public Records getReviewHistory(OtherPatentInfoDTO otherPatentInfoDTO) throws IOException {
+        List<ReviewHistoryVO> reviewHistoryVOS = new ArrayList<>();
+        String patentNo = otherPatentInfoDTO.getPatentNo();
         if (patentNo == null || StringUtils.isEmpty(patentNo)) {
             throw new XiaoShiException("入参为空");
         }
-        List<ReviewHistoryVO> reviewHistoryVOS = new ArrayList<>();
+        Integer current = otherPatentInfoDTO.getCurrent();
+        Integer size = otherPatentInfoDTO.getSize();
+        Page<ReviewHistory> page = new Page<>(current, size);
+
         LambdaQueryWrapper<ReviewHistory> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(ReviewHistory::getPatentNo, patentNo);
-        List<ReviewHistory> reviewHistories = this.list(queryWrapper);
-
+        IPage<ReviewHistory> reviewHistoryPage = this.page(page, queryWrapper);
+        List<ReviewHistory> reviewHistories = reviewHistoryPage.getRecords();
+        long total = reviewHistoryPage.getTotal();
         if (!reviewHistories.isEmpty()) {
             reviewHistories.forEach(item -> {
                 ReviewHistoryVO reviewHistoryVO = new ReviewHistoryVO();
@@ -89,9 +131,19 @@ public class ReviewHistoryService extends ServiceImpl<ReviewHistoryMapper, Revie
             });
             this.loadReviewHistoryVOS(reviewHistoryVOS);
         }
-        return reviewHistoryVOS;
+        Records records = new Records();
+        records.setTotal(total);
+        records.setCurrent((long)current);
+        records.setSize((long) size);
+        records.setData(reviewHistoryVOS);
+        return records;
     }
 
+    /**
+     * 装载
+     * @param reviewHistoryVOS
+     * @throws IOException
+     */
     public void loadReviewHistoryVOS(List<ReviewHistoryVO> reviewHistoryVOS) throws IOException {
         List<String> createIds = new ArrayList<>();
         reviewHistoryVOS.forEach(item -> {
@@ -113,12 +165,38 @@ public class ReviewHistoryService extends ServiceImpl<ReviewHistoryMapper, Revie
             if (personnel != null) {
                 reviewHistoryVO.setCreateName(personnel.getPersonnelName());
             }
+            LambdaQueryWrapper<AssoOtherPatentInfoFile> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(AssoOtherPatentInfoFile::getOtherPatentInfoId, reviewHistoryVO.getId())
+                    .eq(AssoOtherPatentInfoFile::getType, 3);
+            List<AssoOtherPatentInfoFile> assoOtherPatentInfoFiles = assoOtherPatentInfoFileService.list(queryWrapper);
+            if (!assoOtherPatentInfoFiles.isEmpty()) {
+                List<String> fileGuids = assoOtherPatentInfoFiles.stream().map(AssoOtherPatentInfoFile::getFileGuid).collect(Collectors.toList());
+                reviewHistoryVO.setFileGuids(fileGuids);
+                List<SystemFile> systemFiles = new ArrayList<>();
+                if (fileGuids.size() != 0) {
+                    String res = fileManagerService.getSystemFileFromFMS(fileGuids);
+                    systemFiles = JSONObject.parseArray(res, SystemFile.class);
+                }
+                if (!systemFiles.isEmpty()) {
+                    reviewHistoryVO.setSystemFileList(systemFiles);
+                }
+            }
         }
 
     }
 
+    /**
+     * 删除
+     * @param ids
+     * @return
+     */
     public List<Integer> deleteReviewHistory(List<Integer> ids) {
         if (!ids.isEmpty()) {
+            //先删除附件
+            LambdaQueryWrapper<AssoOtherPatentInfoFile> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.in(AssoOtherPatentInfoFile::getOtherPatentInfoId, ids)
+                    .eq(AssoOtherPatentInfoFile::getType, 3);
+            assoOtherPatentInfoFileService.remove(queryWrapper);
             this.removeBatchByIds(ids);
         }
         return ids;