Browse Source

查询专利号带筛选 2022/12/16

lwhhszx 2 years ago
parent
commit
6ec7feb45e

+ 11 - 0
PAS/src/main/java/cn/cslg/pas/common/model/QueryPatentVO.java

@@ -32,6 +32,9 @@ public class QueryPatentVO extends BaseVO {
 
     private Integer endNumber;
 
+    @Schema(description = "专题库自定义选项列表")
+    private List<SourceVO> PasOptions;
+
     @Schema(description = "专利号")
     private String patentNo;
 
@@ -48,4 +51,12 @@ public class QueryPatentVO extends BaseVO {
     private String abstractStr;
     @Schema(description = "标题")
     private String patentName;
+
+    @Data
+    public static class SourceVO {
+        //字段Id
+        private Integer fieldId;
+        //选项Id
+        private List<Integer>  key;
+    }
 }

+ 11 - 0
PAS/src/main/java/cn/cslg/pas/controller/SystemController.java

@@ -6,9 +6,11 @@ import cn.cslg.pas.common.model.vo.PatentVO;
 import cn.cslg.pas.common.model.vo.TaskVO;
 import cn.cslg.pas.common.utils.Response;
 import cn.cslg.pas.domain.Patent;
+import cn.cslg.pas.domain.ProjectField;
 import cn.cslg.pas.domain.SystemDict;
 import cn.cslg.pas.domain.Task;
 import cn.cslg.pas.mapper.PatentMapper;
+import cn.cslg.pas.service.PatentFieldService;
 import cn.cslg.pas.service.PatentService;
 import cn.cslg.pas.service.SystemDictService;
 import cn.cslg.pas.service.TaskService;
@@ -38,6 +40,7 @@ public class SystemController {
 
     private final SystemDictService systemDictService;
     private final PatentService patentService;
+    private final PatentFieldService patentFieldService;
     @PostMapping("dict")
     @Operation(summary = "根据类型获得字典")
     public String getPageList(@RequestBody  List<String> dicts) {
@@ -63,11 +66,19 @@ public class SystemController {
     public String getConPantentNos(@RequestBody QueryPatentVO params) {
         return patentService.getConPantentNos(params);
     }
+
+
     @PostMapping("getPatentDTOListForRMS")
     @Operation(summary = "获得所有对比文件详细信息")
     public String   getPatentDTOListForRMS(@RequestBody PatentVO params) {
         return Response.success(patentService.getPatentDTOListForRMS(params));
     }
 
+    @GetMapping("field/list")
+    @Operation(summary = "自定义字段列表")
+    public String getFieldList(Integer projectId) {
+        return Response.success(patentFieldService.getPageList(projectId));
+    }
+
 }
 

+ 15 - 0
PAS/src/main/java/cn/cslg/pas/service/PatentFieldService.java

@@ -1,11 +1,14 @@
 package cn.cslg.pas.service;
 
+import cn.cslg.pas.common.utils.Response;
 import cn.cslg.pas.domain.PatentField;
 import cn.cslg.pas.domain.ProjectField;
 import cn.cslg.pas.common.core.base.Constants;
 import cn.cslg.pas.common.model.vo.SystemFieldVO;
 import cn.cslg.pas.common.utils.CacheUtils;
 import cn.dev33.satoken.stp.StpUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.RequiredArgsConstructor;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
@@ -50,6 +53,8 @@ public class PatentFieldService {
         return patentFieldList;
     }
 
+
+
     public List<PatentField> getUserSetting(SystemFieldVO params) {
         if (params.getRefresh() != null && params.getRefresh()) {
             cacheUtils.deleteUserSystemFieldSetting(params.getProjectId(), params.getType(), params.getView(), 3);
@@ -242,4 +247,14 @@ public class PatentFieldService {
         return patentFieldList.stream().filter(item -> item.getType().equals(type)).collect(Collectors.toList());
     }
 
+    //获得专题库的所有自定义字段
+    //获得自定义字段列表
+    public  List<ProjectField> getPageList(Integer projectId) {
+        LambdaQueryWrapper<ProjectField> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(ProjectField::getProjectId,projectId);
+        queryWrapper.orderByDesc(ProjectField::getId);
+            List<ProjectField> projectFields = projectFieldService.list(queryWrapper);
+            return projectFields;
+
+    }
 }

+ 0 - 1
PAS/src/main/java/cn/cslg/pas/service/PatentService.java

@@ -575,7 +575,6 @@ public String getComPantentNos(PatentVO params){
 // 获得带筛选条件的对比专利号
 public String getConPantentNos(QueryPatentVO params){
     List<String> patents = baseMapper.getConPantentNos(params);
-    System.out.println("你好");
     return Response.success(patents);
 }
     public PatentDTO getPatentDTOById(Integer id, Integer projectId) {

+ 10 - 0
PAS/src/main/resources/mapper/PatentMapper.xml

@@ -1313,6 +1313,10 @@
         <if test=" params.numberUpc!=null">
             left join os_patent_typeno h on h.pid =a.id and h.type =3
         </if>
+        <if test="params.projectId != null and params.PasOptions !=null and params.PasOptions.size()!=0">
+            left join os_thematic_pid i on i.pid=a.id  left join os_patent_field_patent_link j on a.id=j.pid
+
+        </if>
         <where>
             <choose>
                 <when test="params.projectId != null or (params.patentNos != null and params.patentNos.size()!=0) or (params.importTaskId != null and params.importTaskId.size()!=0)">
@@ -1397,6 +1401,12 @@
                     <if test="params.patentName !=null and params.patentName !=''">
                         and a.`name` like concat("%", #{params.patentName}, "%")
                     </if>
+                    <if test="params.PasOptions !=null and params.PasOptions.size()!=0">
+                      and  <foreach item="item" collection="params.PasOptions" index="index" open="(" separator="and"
+                                 close=")">
+                          and  #{item.fieldId}
+                        </foreach>
+                    </if>
                     order  by a.patentno
                 </when>