Przeglądaj źródła

查询专利详情更新 2022/12/1

lwhhszx 2 lat temu
rodzic
commit
4c392b6df1

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

@@ -0,0 +1,51 @@
+package cn.cslg.pas.common.model;
+
+import cn.cslg.pas.common.model.vo.BaseVO;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author 李仁杰
+ * RMS查询专利的VO类
+ */
+@Data
+public class QueryPatentVO extends BaseVO {
+    //专题库ID
+    private Integer projectId;
+    //RMS导入ID
+    private List<Integer> importTaskId;
+    //专利号
+    private List<String> patentNos;
+    // 去除的专利号
+    private List<String> notInPatentNos;
+    //条件专利号
+    private List<String> conPatentNos;
+    //申请人名字
+    private String applicationName;
+    //权利人名字
+    private String obligeeName;
+
+    private Integer startNumber;
+
+    private Integer endNumber;
+
+    @Schema(description = "专利号")
+    private String patentNo;
+
+    @Schema(description = "申请号")
+    private String applicationNo;
+
+    @Schema(description = "IPC分类号")
+    private String numberIpc;
+    @Schema(description = "CPC分类号")
+    private String numberCpc;
+    @Schema(description = "UPC分类号")
+    private String numberUpc;
+    @Schema(description = "摘要")
+    private String abstractStr;
+    @Schema(description = "标题")
+    private String patentName;
+}

+ 12 - 1
PAS/src/main/java/cn/cslg/pas/controller/SystemController.java

@@ -1,14 +1,18 @@
 package cn.cslg.pas.controller;
 
 import cn.cslg.pas.common.core.base.Constants;
+import cn.cslg.pas.common.model.QueryPatentVO;
 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.SystemDict;
 import cn.cslg.pas.domain.Task;
+import cn.cslg.pas.mapper.PatentMapper;
 import cn.cslg.pas.service.PatentService;
 import cn.cslg.pas.service.SystemDictService;
 import cn.cslg.pas.service.TaskService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import lombok.RequiredArgsConstructor;
@@ -34,6 +38,7 @@ public class SystemController {
 
     private final SystemDictService systemDictService;
     private final PatentService patentService;
+    private final PatentMapper patentMapper;
     @PostMapping("dict")
     @Operation(summary = "根据类型获得字典")
     public String getPageList(@RequestBody  List<String> dicts) {
@@ -44,10 +49,16 @@ public class SystemController {
 
     @PostMapping("patentList")
     @Operation(summary = "专利列表")
-    public String getList(@RequestBody PatentVO params) {
+    public String getList(@RequestBody QueryPatentVO params) {
         return Response.success(patentService.getPageListForRMS(params));
     }
 
+
+    @PostMapping("test")
+    @Operation(summary = "专利列表")
+    public String getList1(@RequestBody QueryPatentVO params) {
+        return Response.success(patentMapper.getPageListForRMS2(new Page<>(params.getCurrent(), params.getSize()),params));
+    }
     @PostMapping("getComPantentNos")
     @Operation(summary = "获得对比专利号")
     public String getComPantentNos(@RequestBody PatentVO params) {

+ 2 - 0
PAS/src/main/java/cn/cslg/pas/mapper/PatentMapper.java

@@ -1,5 +1,6 @@
 package cn.cslg.pas.mapper;
 
+import cn.cslg.pas.common.model.QueryPatentVO;
 import cn.cslg.pas.common.model.dto.PatentQueryFieldSourceDTO;
 import cn.cslg.pas.common.model.vo.PatentQueryFieldSourceVO;
 import cn.cslg.pas.common.model.vo.PatentVO;
@@ -37,6 +38,7 @@ public interface PatentMapper extends BaseMapper<Patent> {
 
     IPage<Patent> getPageList(Page<Patent> page, @Param("params") PatentVO params);
     IPage<Patent> getPageListForRMS(Page<Patent> page, @Param("params") PatentVO params);
+    IPage<Patent> getPageListForRMS2(Page<Patent> page, @Param("params") QueryPatentVO params);
     List<String> getListForRMS( @Param("params") PatentVO params);
     List<Patent> getPageList(@Param("params") PatentVO params);
 

+ 10 - 6
PAS/src/main/java/cn/cslg/pas/service/PatentService.java

@@ -2,6 +2,7 @@ package cn.cslg.pas.service;
 
 import cn.cslg.pas.common.core.base.Constants;
 import cn.cslg.pas.common.model.BaseEntity;
+import cn.cslg.pas.common.model.QueryPatentVO;
 import cn.cslg.pas.common.model.dto.PatentDTO;
 import cn.cslg.pas.common.model.dto.PatentQueryFieldSourceDTO;
 import cn.cslg.pas.common.model.dto.TaskWebSocketDTO;
@@ -469,8 +470,8 @@ public class PatentService extends ServiceImpl<PatentMapper, Patent> {
         pageList.setCurrent(dataPage.getCurrent());
         return pageList;
     }
-    public IPage<PatentDTO> getPageListForRMS(PatentVO params) {
-        IPage<Patent> dataPage = baseMapper.getPageListForRMS(new Page<>(params.getCurrent(), params.getSize()), params);
+    public IPage<PatentDTO> getPageListForRMS(QueryPatentVO params) {
+        IPage<Patent> dataPage = baseMapper.getPageListForRMS2(new Page<>(params.getCurrent(), params.getSize()),params);
         IPage<PatentDTO> pageList = new Page<>();
         List<PatentDTO> records = new ArrayList<>();
         List<Integer> patentIds = dataPage.getRecords().stream().map(Patent::getId).collect(Collectors.toList());
@@ -649,12 +650,15 @@ public String getComPantentNos(PatentVO params){
     public PatentDTO getPatentDTOById(String patentNo) {
         LambdaQueryWrapper<Patent> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(Patent::getPatentNo, patentNo);
-        Patent patent = this.list(wrapper).get(0);
+        List<Patent> patents =this.list(wrapper);
+        PatentDTO patentDTO = new PatentDTO();
         //如果未查出专利则返回为空
-        if (patent == null) {
-            return null;
+        if (patents ==null||patents.size()==0) {
+            return patentDTO;
         }
-        PatentDTO patentDTO = new PatentDTO();
+        Patent patent = patents.get(0);
+
+
         BeanUtils.copyProperties(patent, patentDTO);
         List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Arrays.asList(Constants.PATENT_TYPE, Constants.PATENT_SIMPLE_STATUS, Constants.COUNTRIES));
         List<PatentClassNumberLink> patentClassNumberLinkList = patentClassNumberLinkService.getPatentClassNumberLinkByPatentIds(Collections.singletonList(patent.getId()));

+ 0 - 18
PAS/src/main/java/cn/cslg/pas/service/UploadPatentBatchService.java

@@ -186,24 +186,6 @@ public class UploadPatentBatchService {
             return Response.success();
         } catch (Exception e) {
 
-            SpringUtil.getBean(ProjectService.class).setImportPatentTaskStatus(2, params.getTaskId());
-            WebSocketServer.sendInfo(Response.websocket(new TaskWebSocketDTO()
-                    .setTaskId(params.getTaskId())
-                    .setComplete(true)
-                    .setIndex(total)
-                    .setTaskType(Constants.TASK_IMPORT_PATENT)
-                    .setPercentage(100L)
-                    .setFileName("")
-                    .setOldName(params.getOldName())
-                    .setUrl("")
-                    .setTotal(total), ResponseEnum.PATENT_IMPORT_TASK_SUCCESS), params.getUserId());
-            e.printStackTrace();
-            SpringUtil.getBean(ProjectService.class).setImportPatentTaskStatus(3, params.getTaskId());
-            if (FLAG > 0) {
-                int successCount = total - FLAG;
-                WebSocketServer.sendInfo(Response.error("部分数据上传成功" + "\n" + "成功条数:" + successCount + "失败条数:" + FLAG), params.getUserId());
-            }
-            FLAG = 0;
             return Response.error();
         }
     }

+ 161 - 17
PAS/src/main/resources/mapper/PatentMapper.xml

@@ -1270,14 +1270,14 @@
             </if>
 
             <if test="params.patentNos != null and params.patentNos.size()!=0">
-            or patentno in
-            <foreach item="item" collection="params.patentNos" index="index" open="(" separator="," close=")">
-                #{item}
-            </foreach>
+                or patentno in
+                <foreach item="item" collection="params.patentNos" index="index" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="params.startNumber!=null and params.endNumber!=null">
+                limit #{params.startNumber} , #{params.endNumber}
             </if>
-          <if test="params.startNumber!=null and params.endNumber!=null">
-          limit #{params.startNumber} , #{params.endNumber}
-          </if>
         </where>
 
     </select>
@@ -1297,27 +1297,32 @@
         <where>
             patentno="0"
             <if test="params.projectId != null">
-                or  a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
+                or a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
                 <if test="params.notInPatentNos != null">
-                     and patentno not in
-                    <foreach item="item" collection="params.notInPatentNos" index="index" open="(" separator="," close=")">
+                    and patentno not in
+                    <foreach item="item" collection="params.notInPatentNos" index="index" open="(" separator=","
+                             close=")">
                         #{item}
                     </foreach>
                 </if>
 
             </if>
             <if test="params.importTaskId != null and params.importTaskId.size()!=0">
-                or a.id in
+                or (patentno in
+                ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where IMPORTTASK_ID in
                 <foreach item="item" collection="params.importTaskId" index="index" open="(" separator="," close=") ">
                     #{item}
                 </foreach>
+                )
 
                 <if test="params.notInPatentNos != null">
                     and patentno not in
-                    <foreach item="item" collection="params.notInPatentNos" index="index" open="(" separator="," close=")">
+                    <foreach item="item" collection="params.notInPatentNos" index="index" open="(" separator=","
+                             close=")">
                         #{item}
                     </foreach>
                 </if>
+                )
             </if>
             <if test="params.patentNos != null and params.patentNos.size()!=0">
                 or patentno in
@@ -1325,9 +1330,148 @@
                     #{item}
                 </foreach>
             </if>
+
         </where>
 
     </select>
+    <select id="getPageListForRMS2" parameterType="cn.cslg.pas.common.model.vo.PatentVO"
+            resultType="cn.cslg.pas.domain.Patent">
+        select DISTINCT a.id, a.`name` as name, a.nameout as name_out, a.patentno as patent_no, a.abstract_path,
+        a.abstract as
+        abstract_str, a.abstractout as abstract_out,
+        a.publicno as public_no, a.publicdate as public_date, a.simple_family, a.inpadoc_family, a.applicationno as
+        application_no, a.appdate as application_date,
+        a.`status` as simple_status, a.type, a.publictodate as public_accredit_date, a.fpublicdate as first_public_date,
+        a.prioritydate as priority_date,
+        a.agencyid as agency_id, a.num2 as right_num, a.quoteno as quote_num, a.quotedno as quoted_num,
+        a.patsnap_family as patSnapFamily, a.patsnapfamilynum as patSnapFamilyNum
+        from os_patent a
+
+
+        <if test="params.applicationName !=null ">
+            left join os_applicant_attr b on a.id=b.pid and b.type =1
+            left join os_patent_applicant c on c.id=b.applicantid
+        </if>
+        <if test=" params.obligeeName !=null">
+            left join os_applicant_attr d on a.id=d.pid and d.type =2
+            left join os_patent_applicant e on e.id=d.applicantid
+        </if>
+        <if test="params.numberIpc!=null ">
+            left join os_patent_typeno f on f.pid =a.id and f.type =1
+        </if>
+        <if test=" params.numberCpc!=null ">
+            left join os_patent_typeno g on g.pid =a.id and g.type =2
+        </if>
+        <if test=" params.numberUpc!=null">
+            left join os_patent_typeno h on h.pid =a.id and h.type =3
+        </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)">
+                    <if test="params.projectId != null">
+                        and ( a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
+                        <if test="params.patentNos != null and params.patentNos.size()!=0">
+                            or patentno in
+                            <foreach item="item" collection="params.patentNos" index="index" open="(" separator=","
+                                     close=")">
+                                #{item}
+                            </foreach>
+                        </if>
+
+                        <if test="params.importTaskId != null and params.importTaskId.size()!=0">
+                            or patentno in
+                            ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where IMPORTTASK_ID in
+                            <foreach item="item" collection="params.importTaskId" index="index" open="(" separator=","
+                                     close=") ">
+                                #{item}
+                            </foreach>
+                            )
+                        </if>
+                        )
+
+                    </if>
+
+                    <if test="params.projectId == null and params.patentNos != null and params.patentNos.size()!=0">
+                        (patentno in
+                        <foreach item="item" collection="params.patentNos" index="index" open="(" separator=","
+                                 close=")">
+                            #{item}
+                        </foreach>
+                        <if test="params.importTaskId != null and params.importTaskId.size()!=0">
+                            or patentno in
+                            ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where IMPORTTASK_ID in
+                            <foreach item="item" collection="params.importTaskId" index="index" open="(" separator=","
+                                     close=") ">
+                                #{item}
+                            </foreach>
+                            )
+                        </if>
+                        )
+                    </if>
+
+                    <if test="params.projectId == null and (params.patentNos == null or params.patentNos.size()==0) and params.importTaskId != null and params.importTaskId.size()!=0">
+                        patentno in
+                        ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where IMPORTTASK_ID in
+                        <foreach item="item" collection="params.importTaskId" index="index" open="(" separator=","
+                                 close=") ">
+                            #{item}
+                        </foreach>
+                        )
+                    </if>
+
+
+                    <if test="params.notInPatentNos != null and params.notInPatentNos.size!=0">
+                        and patentno not in
+                        <foreach item="item" collection="params.notInPatentNos" index="index" open="(" separator=","
+                                 close=")">
+                            #{item}
+                        </foreach>
+                    </if>
+                    <if test="params.conPatentNos != null and params.conPatentNos.size!=0">
+                        and patentno in
+                        <foreach item="item" collection="params.conPatentNos" index="index" open="(" separator=","
+                                 close=")">
+                            #{item}
+                        </foreach>
+                    </if>
+
+                    <if test="params.applicationName !=null and params.applicationName !=''  ">
+                        and c.name like concat("%",#{params.applicationName}, "%")
+                    </if>
+                    <if test="params.obligeeName!=null and params.obligeeName!=''">
+                        and e.name like concat("%", #{params.obligeeName}, "%")
+                    </if>
+                    <if test="params.numberIpc!=null and params.numberIpc!=''">
+                        and f.code like concat("%", #{params.numberIpc}, "%")
+                    </if>
+                    <if test="params.numberCpc!=null and params.numberCpc!=''">
+                        and g.code like concat("%", #{params.numberCpc}, "%")
+                    </if>
+                    <if test="params.numberUpc!=null and params.numberUpc!=''">
+                        and h.code like concat("%", #{params.numberUpc}, "%")
+                    </if>
+                    <if test="params.patentNo!=null">
+                        and a.patentNo like concat("%",#{params.patentNo} , "%")
+                    </if>
+                    <if test="params.applicationNo!=null">
+                        and a.applicationNo like concat("%", #{params.applicationNo}, "%")
+                    </if>
+                    <if test="params.abstractStr!=null">
+                        and a.abstract like concat("%", #{params.abstractStr}, "%")
+                    </if>
+                    <if test="params.patentName!=null">
+                        and a.`name` like concat("%", #{params.patentName}, "%")
+                    </if>
+                </when>
+
+                <otherwise>
+                    1!=1
+                </otherwise>
+            </choose>
+        </where>
+    </select>
+
     <select id="getPatent" parameterType="java.util.List" resultType="cn.cslg.pas.domain.Patent">
         select a.id, a.`name` as name, a.nameout as name_out, a.patentno as patent_no, a.abstract_path, a.abstract as
         abstract_str, a.abstractout as abstract_out,
@@ -1338,15 +1482,15 @@
         a.agencyid as agency_id, a.num2 as right_num, a.quoteno as quote_num, a.quotedno as quoted_num,
         a.patsnap_family as patSnapFamily, a.patsnapfamilynum as patSnapFamilyNum
         from os_patent a
-       where patentno in
+        where patentno in
         <foreach item="item" collection="patentNo" index="index" open="(" separator="," close=")">
-              #{item}
+            #{item}
         </foreach>
         <if test="n!=-1 and p!=-1">
-       limit #{n},#{p}
-</if>
+            limit #{n},#{p}
+        </if>
     </select>
-<!--    int getPatentNumber(@Param("patentNo")List<String> patentNo);-->
+    <!--    int getPatentNumber(@Param("patentNo")List<String> patentNo);-->
     <select id="getPatentNumber" resultType="java.lang.Integer">
         select count(*) from os_patent
         where patentno in