瀏覽代碼

2023/6/16 专利之星接口添加

lwhhszx 2 年之前
父節點
當前提交
c4c1f1db5a

+ 14 - 6
PAS/src/main/java/cn/cslg/pas/common/model/outApi/PatentStarListDto.java

@@ -1,5 +1,6 @@
 package cn.cslg.pas.common.model.outApi;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 import lombok.experimental.Accessors;
 
@@ -8,15 +9,22 @@ import lombok.experimental.Accessors;
  *
  * @author 李仁杰
  */
-@Accessors(chain = true)
+
 @Data
 public class PatentStarListDto {
     /**
      * 检索式
      */
-    String CurrentQuery;
-    String DBType;
-    int PageNum;
-    int RowCount;
-
+    @JsonProperty(value = "CurrentQuery")
+   private String CurrentQuery;
+    @JsonProperty(value = "DBType")
+    private String DBType;
+    @JsonProperty(value = "PageNum")
+    private Integer PageNum;
+    @JsonProperty(value = "RowCount")
+    private Integer RowCount;
+    @JsonProperty(value = "OrderBy")
+    private String OrderBy;
+    @JsonProperty(value = "OrderByType")
+    private String OrderByType;
 }

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

@@ -1,7 +1,35 @@
 package cn.cslg.pas.common.utils;
 
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
 public class FormatUtil {
     public static String toString(Object o) {
         return o == null ? "" : o.toString();
     }
+    public static String MD5(String src){
+        // 需要加密的字符串
+        try {
+// 加密对象,指定加密方式
+            MessageDigest md5 = MessageDigest.getInstance("md5");
+// 准备要加密的数据
+            byte[] b = src.getBytes();
+// 加密
+            byte[] digest = md5.digest(b);
+// 十六进制的字符
+            char[] chars = new char[] { '0', '1', '2', '3', '4', '5',
+                    '6', '7' , '8', '9', 'A', 'B', 'C', 'D', 'E','F' };
+            StringBuffer sb = new StringBuffer();
+// 处理成十六进制的字符串(通常)
+            for (byte bb : digest) {
+                sb.append(chars[(bb >> 4) & 15]);
+                sb.append(chars[bb & 15]);
+            }
+            return sb.toString();
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+
 }

+ 4 - 0
PAS/src/main/java/cn/cslg/pas/controller/PatentController.java

@@ -87,17 +87,20 @@ public class PatentController {
         PatentDTO patentDTO =patentService.getPatentDTOById(patentNo,projectId);
         return Response.success(patentDTO);
     }
+
     @GetMapping("id")
     @Operation(summary = "根据专利号获取专利")
     public String getPatentByPatentNo(String patentNo) {
         Patent patent = patentService.getByPatentNo(patentNo);
         return Response.success(patent);
     }
+
     @PostMapping("ids")
     @Operation(summary = "根据范围获取专利ID")
     public String getPatentListIds(@RequestBody PatentVO params) {
         return Response.success(patentService.getPatentListIds(params));
     }
+
     @checkAuth(FunId = "/workspace/folder/exportPatent")
     @PostMapping("export")
     @Operation(summary = "导出专利")
@@ -130,6 +133,7 @@ public class PatentController {
         return Response.success(patentService.getPatentQuerySourcePageList(params));
     }
 
+
     @PostMapping("/save/select")
     @Operation(summary = "保存选择的专利")
     public String saveSelectPatentIds(@RequestBody PatentVO params) {

+ 3 - 1
PAS/src/main/java/cn/cslg/pas/controller/ProductMarketDataController.java

@@ -27,7 +27,6 @@ import org.springframework.web.bind.annotation.*;
 @RestController
 public class ProductMarketDataController {
     private final IProductMarketDataService productMarketDataService;
-
     @Operation(summary = "新增产品营销数据")
     @PostMapping("/addNew")
     public String addNew(@RequestBody ProductMarketDataAddNewDTO productMarketDataAddNewDTO) {
@@ -40,6 +39,7 @@ public class ProductMarketDataController {
         return Response.success("新增产品营销数据完成");
     }
 
+
     @Operation(summary = "修改产品营销数据")
     @PostMapping("/update")
     public String update(@RequestBody ProductMarketDataUpdateDTO productMarketDataUpdateDTO) {
@@ -52,6 +52,7 @@ public class ProductMarketDataController {
         return Response.success("修改产品营销数据完成");
     }
 
+
     @Operation(summary = "分页查询产品营销数据")
     @PostMapping("/query")
     public String update(@RequestBody ProductMarketDataQueryPageDTO productMarketDataQueryPageDTO) {
@@ -60,6 +61,7 @@ public class ProductMarketDataController {
         return Response.success(jsonPage);
     }
 
+
     @Operation(summary = "删除产品营销数据")
     @GetMapping("/delete")
     public String delete(Integer id) {

+ 5 - 0
PAS/src/main/java/cn/cslg/pas/controller/ProjectController.java

@@ -48,12 +48,14 @@ public class ProjectController {
         return Response.success(projectService.getPageList(params));
     }
 
+
     @GetMapping("getProjectById")
     @Operation(summary = "根据Id获得专题库")
     public String getProject(Integer id) throws IOException {
         return Response.success(projectService.getProjectByIds(Arrays.asList(id)));
     }
 
+
     @checkAuth(FunId = "/workspace/project/add")
     @PostMapping("add")
     @Operation(summary = "新增专题库")
@@ -67,6 +69,7 @@ public class ProjectController {
         return Response.success(projectId);
     }
 
+
     @Permission(roles = {2})
     @checkAuth(FunId = "/workspace/project/modify")
     @PostMapping("edit")
@@ -80,6 +83,7 @@ public class ProjectController {
         return Response.success();
     }
 
+
     @Permission(roles = {2})
     @PostMapping("delete")
     @checkAuth(FunId = "/workspace/project/delete")
@@ -88,6 +92,7 @@ public class ProjectController {
         return projectService.delete(id);
     }
 
+
     @checkAuth(FunId = "/workspace/project/delete")
     @PostMapping("/patent/delete")
     @Operation(summary = "删除专题库专利")

+ 80 - 0
PAS/src/main/java/cn/cslg/pas/controller/outApi/PatentStarController.java

@@ -0,0 +1,80 @@
+package cn.cslg.pas.controller.outApi;
+
+import cn.cslg.pas.common.core.base.Constants;
+import cn.cslg.pas.common.model.outApi.PatentStarListDto;
+import cn.cslg.pas.common.utils.Response;
+import cn.cslg.pas.service.OAuth2Service;
+import cn.cslg.pas.service.outApi.PatentStarApiService;
+import cn.dev33.satoken.stp.StpUtil;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.RequiredArgsConstructor;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+@Tag(name = "专利之星接口服务类")
+@RestController
+@RequestMapping(Constants.API_VERSION_V2 + "/patentStar")
+@RequiredArgsConstructor(onConstructor_ = {@Lazy})
+public class PatentStarController {
+    private final PatentStarApiService patentStarApiService;
+    @PostMapping("/select")
+    @Operation(summary = "检索接口")
+    public String getAreaList(@RequestBody PatentStarListDto patentStarListDto) throws IOException {
+        return patentStarApiService.patentStarSearchApi(patentStarListDto);
+    }
+    @GetMapping("/getCnBib")
+    @Operation(summary = "获得中国专利著录")
+    public String getCnBib(String appNo) throws IOException {
+        return patentStarApiService.getCnBibApi(appNo);
+    }
+    @GetMapping("/getPicture")
+    @Operation(summary = "获得中国专利摘要附图")
+    public String getPicture(String appNo) throws IOException {
+        return patentStarApiService.getPictureApi(appNo);
+    }
+    @GetMapping("/getWGPicture")
+    @Operation(summary = "获得中国专利外观图")
+    public String getWGPicture(String appNo) throws IOException {
+        return patentStarApiService.getWGPictureApi(appNo);
+    }
+    @GetMapping("/getCnLegal")
+    @Operation(summary = "获得中国专利法律状态")
+    public String getCnLegal(String appNo) throws IOException {
+        return patentStarApiService.getCnLegalApi(appNo);
+    }
+    @GetMapping("/getCnPdf")
+    @Operation(summary = "获得中国专利pdf全文")
+    public String getCnPdf(String appNo) throws IOException {
+        return patentStarApiService.getCnPdfApi(appNo);
+    }
+    @GetMapping("/getCnFullXml")
+    @Operation(summary = "获得中国专利全文文本")
+    public String getCnFullXml(String appNo) throws IOException {
+        return patentStarApiService.getCnFullXmlApi(appNo);
+    }
+    @GetMapping("/getEnPdf")
+    @Operation(summary = "获得世界专利pdf")
+    public String getEnPdf(String patentNo) throws IOException {
+        return patentStarApiService.getEnPdfApi(patentNo);
+    }
+    @GetMapping("/getENBib")
+    @Operation(summary = "获得世界专利著录信息")
+    public String getENBib(String patentNo) throws IOException {
+        return Response.success(patentStarApiService.getENBibApi(patentNo));
+    }
+    @GetMapping("/getFamilyByPubNo")
+    @Operation(summary = "获得同住专利")
+    public String getFamilyByPubNo(String patentNo) throws IOException {
+        return patentStarApiService.getFamilyByPubNoApi(patentNo);
+    }
+    @GetMapping("/getCitedNumByPubNo")
+    @Operation(summary = "获得被引用次数")
+    public String getCitedNumByPubNo(String patentNo) throws IOException {
+        return patentStarApiService.getCitedNumByPubNoApi(patentNo);
+    }
+}

+ 377 - 151
PAS/src/main/java/cn/cslg/pas/service/outApi/PatentStarApiService.java

@@ -6,11 +6,20 @@ import cn.cslg.pas.common.model.dto.GetDescriptionInfoParamsDTO;
 import cn.cslg.pas.common.model.dto.GetFuTuParamsDTO;
 import cn.cslg.pas.common.model.dto.GetSearchBiblioParamsDTO;
 import cn.cslg.pas.common.model.outApi.PatentStarListDto;
+import cn.cslg.pas.common.utils.FormatUtil;
+import cn.cslg.pas.common.utils.JsonUtils;
+import cn.cslg.pas.common.utils.SecurityUtils.SecurityUtils;
 import cn.cslg.pas.domain.PubNo;
+import cn.hutool.crypto.SecureUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.google.gson.Gson;
+import com.google.gson.JsonObject;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import okhttp3.*;
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.junit.Test;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
@@ -28,6 +37,7 @@ import java.util.concurrent.TimeUnit;
 @RequiredArgsConstructor
 @Slf4j
 @Service
+
 public class PatentStarApiService {
     @Value("${authorUrl}")
     private String PCSUrl;
@@ -36,191 +46,407 @@ public class PatentStarApiService {
     @Value("${PASUrl}")
     private String PASUrl;
 
-
     public String patentStarSearchApi(PatentStarListDto patentStarListDto) throws IOException {
-
-//        // 创建一个OkHttpClient对象
-//        OkHttpClient okHttpClient = new OkHttpClient();
-//
-//        // 创建一个RequestBody(参数1:数据类型 参数2传递的json串)
-//        FormBody.Builder builder = new FormBody.Builder();
-//
-//        for (String key : param.keySet()) {
-//            Object obj = param.get(key);
-//            if (obj != null) {
-//                builder.addEncoded(key, param.get(key).toString());
-//            } else {
-//                builder.addEncoded(key, "");
-//            }
-//        }
-//        FormBody  requestBody = builder.build();
-//
-//        // 创建一个请求对象
-//        Request request = new Request.Builder().url(url).post(requestBody).build();
-//        // 发送请求获取响应
-//        try {
-//            Response response = okHttpClient.newCall(request).execute();
-//            // 判断请求是否成功
-//            if (response.isSuccessful()) {
-//                // 打印服务端返回结果
-//                return response.body().string();
-//            }
-//        } catch (IOException e) {
-//            e.printStackTrace();
-//        }
-//        return "{}";
-//        OkHttpClient okHttpClient = new OkHttpClient();
-//        Request request = new Request.Builder()
-//                .url(PCSUrl + "/permission/api/system/getPersonIdByName?personName=" + personName)
-//                .get()
-//                .build();
-//        return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
-   return "";
+        String json = JSONObject.toJSONString(patentStarListDto);
+        String url = "http://s.patentstar.com.cn/SearchAPI/PatentSearch/ResultGet";
+        Long currentTimeMillis = System.currentTimeMillis() / 1000;
+        String Sign = "FNYJD7902206FFB741E163BE6536C3689D55" + currentTimeMillis.toString();
+        String signMd5 = FormatUtil.MD5(Sign);
+        // 创建一个OkHttpClient对象
+        OkHttpClient okHttpClient = new OkHttpClient();
+        // 创建一个RequestBody(参数1:数据类型 参数2传递的json串)
+        FormBody.Builder builder = new FormBody.Builder();
+        builder.add("AppID", "K8FFB741E163BE6536");
+        builder.add("Stamp", currentTimeMillis.toString());
+        builder.add("Sign", signMd5);
+        builder.add("QueryJson", json);
+        FormBody requestBody = builder.build();
+        // 创建一个请求对象
+        Request request = new Request.Builder().url(url).post(requestBody).build();
+        // 发送请求获取响应
+        try {
+            Response response = okHttpClient.newCall(request).execute();
+            // 判断请求是否成功
+            if (response.isSuccessful()) {
+//                JSONObject jsonObject  =JSONObject.parseObject(Objects.requireNonNull(response.body()).string());
+//                JSONObject jsonObject1= (JSONObject)jsonObject.get("Data");
+                // 打印服务端返回结果
+                return Objects.requireNonNull(response.body()).string();
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return "{}";
+    }
+    /**
+     * @param appNo
+     * @return
+     * @throws IOException
+     * @author 李仁杰
+     * 从专利之星获取摘要附图
+     */
+    public String getCnBibApi(String appNo) throws IOException {
+        String url = "https://api.patentstar.com.cn/api/Patent/CnBib/" + appNo;
+        String appId = "2000041";
+        String appkey = "F0E183D5F02C48E391F5FADF1B646F54";
+        Long currentTimeMillis = System.currentTimeMillis() / 1000;
+        String Sign = appId + appkey + currentTimeMillis.toString();
+        String signMd5 = FormatUtil.MD5(Sign);
+        // 创建一个OkHttpClient对象
+        OkHttpClient okHttpClient = new OkHttpClient();
+        // 创建一个请求对象
+        Request request = new Request.Builder().url(url)
+                .addHeader("_appid", "2000041")
+                .addHeader("_timestamp", currentTimeMillis.toString())
+                .addHeader("_sign", signMd5)
+                .get().build();
+        // 发送请求获取响应
+        try {
+            Response response = okHttpClient.newCall(request).execute();
+            // 判断请求是否成功
+            if (response.isSuccessful()) {
+                response.body().toString();
+                // 打印服务端返回结果
+                return Objects.requireNonNull(response.body()).string();
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return "{}";
     }
 
     /**
-     * 根据人员ids查询人员列表
-     *
-     * @param ids 人员ids
-     * @return 返回装载着人员列表数据的data的String
+     * @param patentNo
+     * @return
+     * @throws IOException
+     * @author 李仁杰
+     * 从专利之星获取摘要附图
      */
-    public String getPersonnelByIdsFromPCS(List<Integer> ids) throws IOException {
-
-        String param = new Gson().toJson(ids);
-        RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
-        OkHttpClient okHttpClient = new OkHttpClient.Builder()
-                .connectTimeout(60, TimeUnit.SECONDS)
-                .writeTimeout(60, TimeUnit.SECONDS)
-                .readTimeout(60, TimeUnit.SECONDS)
-                .build();
-        Request request = new Request.Builder()
-                .url(PCSUrl + "/permission/api/system/getPersonnelByIds")
-                .post(requestBody)
-                .build();
-        return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+    public String getPictureApi(String patentNo) throws IOException {
+        String url = "https://api.patentstar.com.cn/api/Patent/CnMainImage/" + patentNo;
+        String appId = "2000041";
+        String appkey = "F0E183D5F02C48E391F5FADF1B646F54";
+        Long currentTimeMillis = System.currentTimeMillis() / 1000;
+        String Sign = appId + appkey + currentTimeMillis.toString();
+        String signMd5 = FormatUtil.MD5(Sign);
+        // 创建一个OkHttpClient对象
+        OkHttpClient okHttpClient = new OkHttpClient();
+        // 创建一个请求对象
+        Request request = new Request.Builder().url(url)
+                .addHeader("_appid", "2000041")
+                .addHeader("_timestamp", currentTimeMillis.toString())
+                .addHeader("_sign", signMd5)
+                .get().build();
+        // 发送请求获取响应
+        try {
+            Response response = okHttpClient.newCall(request).execute();
+            // 判断请求是否成功
+            if (response.isSuccessful()) {
+                response.body().toString();
+                // 打印服务端返回结果
+                return Objects.requireNonNull(response.body()).string();
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return "{}";
     }
 
     /**
-     * 远程调用获取一批专利著录的接口
-     *
+     * @param appNo
      * @return
+     * @throws IOException
+     * @author 李仁杰
+     * 从专利之星获取中国专利外观图
      */
-    public String getSearchBiblio(GetSearchBiblioParamsDTO getSearchBiblioParamsDTO) throws IOException {
-        //String param = new Gson().toJson(getSearchBiblioParamsDTO);
-        //RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
-        OkHttpClient okHttpClient = new OkHttpClient.Builder()
-                .connectTimeout(60, TimeUnit.SECONDS)
-                .writeTimeout(60, TimeUnit.SECONDS)
-                .readTimeout(60, TimeUnit.SECONDS)
-                .build();
-        Request request = new Request.Builder()
-                .url(OPSUrl + "/api/OPSQuery/SearchBiblio?query=" + getSearchBiblioParamsDTO.getQuery() + "&start=" + getSearchBiblioParamsDTO.getStart() + "&end=" + getSearchBiblioParamsDTO.getEnd())
-                .get()
-                .build();
-        return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+    public String getWGPictureApi(String appNo) throws IOException {
+
+        String url = "https://api.patentstar.com.cn/api/Patent/CnWGImage/" + appNo;
+        String appId = "2000041";
+        String appkey = "F0E183D5F02C48E391F5FADF1B646F54";
+        Long currentTimeMillis = System.currentTimeMillis() / 1000;
+        String Sign = appId + appkey + currentTimeMillis.toString();
+        String signMd5 = FormatUtil.MD5(Sign);
+        // 创建一个OkHttpClient对象
+        OkHttpClient okHttpClient = new OkHttpClient();
+        // 创建一个请求对象
+        Request request = new Request.Builder().url(url)
+                .addHeader("_appid", "2000041")
+                .addHeader("_timestamp", currentTimeMillis.toString())
+                .addHeader("_sign", signMd5)
+                .get().build();
+        // 发送请求获取响应
+        try {
+            Response response = okHttpClient.newCall(request).execute();
+            // 判断请求是否成功
+            if (response.isSuccessful()) {
+                response.body().toString();
+                // 打印服务端返回结果
+                return Objects.requireNonNull(response.body()).string();
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return "{}";
     }
 
     /**
-     * 远程调用获取权要信息的接口
-     *
+     * @param appNo
      * @return
+     * @throws IOException
+     * @author 李仁杰
+     * 从专利之星获取中国专利法律状态
      */
-    public String getClaimsInfo(GetClaimsInfoParamsDTO getClaimsInfoParamsDTO) throws IOException {
-        //String param = new Gson().toJson(getClaimsInfoParamsDTO);
-        //RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
-        OkHttpClient okHttpClient = new OkHttpClient.Builder()
-                .connectTimeout(60, TimeUnit.SECONDS)
-                .writeTimeout(60, TimeUnit.SECONDS)
-                .readTimeout(60, TimeUnit.SECONDS)
-                .build();
-        Request request = new Request.Builder()
-                .url(OPSUrl + "/api/OPSQuery/GetClaimsInfo?cc=" + getClaimsInfoParamsDTO.getCc() + "&number=" + getClaimsInfoParamsDTO.getNumber() + "&kind=" + getClaimsInfoParamsDTO.getKind())
-                .get()
-                .build();
-        return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+    public String getCnLegalApi(String appNo) throws IOException {
+        String url = "https://api.patentstar.com.cn/api/Patent/CnLegal/"+appNo;
+        String appId = "2000041";
+        String appkey = "F0E183D5F02C48E391F5FADF1B646F54";
+        Long currentTimeMillis = System.currentTimeMillis() / 1000;
+        String Sign = appId + appkey + currentTimeMillis.toString();
+        String signMd5 = FormatUtil.MD5(Sign);
+        // 创建一个OkHttpClient对象
+        OkHttpClient okHttpClient = new OkHttpClient();
+        // 创建一个请求对象
+        Request request = new Request.Builder().url(url)
+                .addHeader("_appid", "2000041")
+                .addHeader("_timestamp", currentTimeMillis.toString())
+                .addHeader("_sign", signMd5)
+                .get().build();
+        // 发送请求获取响应
+        try {
+            Response response = okHttpClient.newCall(request).execute();
+            // 判断请求是否成功
+            if (response.isSuccessful()) {
+                response.body().toString();
+                // 打印服务端返回结果
+                return Objects.requireNonNull(response.body()).string();
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return "{}";
     }
 
     /**
-     * 远程调用获取说明书的接口
-     *
+     * @param appNo
+     * @return
+     * @throws IOException
+     * @author 李仁杰
+     * 从专利之星获取中国专利全文图片
+     */
+
+    public String  getCnPdfApi(String appNo) throws IOException {
+        String url = "https://api.patentstar.com.cn/api/Patent/CnPdf/"+appNo;
+        String appId = "2000041";
+        String appkey = "F0E183D5F02C48E391F5FADF1B646F54";
+        Long currentTimeMillis = System.currentTimeMillis() / 1000;
+        String Sign = appId + appkey + currentTimeMillis.toString();
+        String signMd5 = FormatUtil.MD5(Sign);
+        // 创建一个OkHttpClient对象
+        OkHttpClient okHttpClient = new OkHttpClient();
+        // 创建一个请求对象
+        Request request = new Request.Builder().url(url)
+                .addHeader("_appid", "2000041")
+                .addHeader("_timestamp", currentTimeMillis.toString())
+                .addHeader("_sign", signMd5)
+                .get().build();
+        // 发送请求获取响应
+        try {
+            Response response = okHttpClient.newCall(request).execute();
+            // 判断请求是否成功
+            if (response.isSuccessful()) {
+                response.body().toString();
+                // 打印服务端返回结果
+                return Objects.requireNonNull(response.body()).string();
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return "{}";
+    }
+    /**
+     * @param appNo
      * @return
+     * @throws IOException
+     * @author 李仁杰
+     * 从专利之星获取中国专利全文文本
      */
-    public String getDescriptionInfo(GetDescriptionInfoParamsDTO getDescriptionInfoParamsDTO) throws IOException {
-        //String param = new Gson().toJson(getDescriptionInfoParamsDTO);
-        //RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
-        OkHttpClient okHttpClient = new OkHttpClient.Builder()
-                .connectTimeout(60, TimeUnit.SECONDS)
-                .writeTimeout(60, TimeUnit.SECONDS)
-                .readTimeout(60, TimeUnit.SECONDS)
-                .build();
-        Request request = new Request.Builder()
-                .url(OPSUrl + "/api/OPSQuery/GetDescriptionInfo?cc=" + getDescriptionInfoParamsDTO.getCc() + "&number=" + getDescriptionInfoParamsDTO.getNumber() + "&kind=" + getDescriptionInfoParamsDTO.getKind())
-                .get()
-                .build();
-        return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+
+    public String  getCnFullXmlApi(String appNo) throws IOException {
+        String url = "https://api.patentstar.com.cn/api/Patent/CnFullXml/"+appNo;
+        String appId = "2000041";
+        String appkey = "F0E183D5F02C48E391F5FADF1B646F54";
+        Long currentTimeMillis = System.currentTimeMillis() / 1000;
+        String Sign = appId + appkey + currentTimeMillis.toString();
+        String signMd5 = FormatUtil.MD5(Sign);
+        // 创建一个OkHttpClient对象
+        OkHttpClient okHttpClient = new OkHttpClient();
+        // 创建一个请求对象
+        Request request = new Request.Builder().url(url)
+                .addHeader("_appid", "2000041")
+                .addHeader("_timestamp", currentTimeMillis.toString())
+                .addHeader("_sign", signMd5)
+                .get().build();
+        // 发送请求获取响应
+        try {
+            Response response = okHttpClient.newCall(request).execute();
+            // 判断请求是否成功
+            if (response.isSuccessful()) {
+                response.body().toString();
+                // 打印服务端返回结果
+                return Objects.requireNonNull(response.body()).string();
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return "{}";
     }
 
     /**
-     * 远程调用获取Image信息的接口
-     *
+     * @param patentNo
      * @return
+     * @throws IOException
+     * @author 李仁杰
+     * 从专利之星获取世界专利pdf
      */
-    public String getImagesInfo(PubNo pubNo) throws IOException {
-        String pn = pubNo.getCountry() + pubNo.getNumber() + "." + pubNo.getKind();
-        //String param = new Gson().toJson(pn);
-        //RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
-        OkHttpClient okHttpClient = new OkHttpClient.Builder()
-                .connectTimeout(60, TimeUnit.SECONDS)
-                .writeTimeout(60, TimeUnit.SECONDS)
-                .readTimeout(60, TimeUnit.SECONDS)
-                .build();
-        Request request = new Request.Builder()
-                .url(OPSUrl + "/api/OPSQuery/GetImagesInfo?Pn=" + pn)
-                .get()
-                .build();
-        return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+    public String  getEnPdfApi(String patentNo) throws IOException {
+        String url = "  https://api.patentstar.com.cn/api/Patent/EnPdf/"+patentNo;
+        String appId = "2000041";
+        String appkey = "F0E183D5F02C48E391F5FADF1B646F54";
+        Long currentTimeMillis = System.currentTimeMillis() / 1000;
+        String Sign = appId + appkey + currentTimeMillis.toString();
+        String signMd5 = FormatUtil.MD5(Sign);
+        // 创建一个OkHttpClient对象
+        OkHttpClient okHttpClient = new OkHttpClient();
+        // 创建一个请求对象
+        Request request = new Request.Builder().url(url)
+                .addHeader("_appid", "2000041")
+                .addHeader("_timestamp", currentTimeMillis.toString())
+                .addHeader("_sign", signMd5)
+                .get().build();
+        // 发送请求获取响应
+        try {
+            Response response = okHttpClient.newCall(request).execute();
+            // 判断请求是否成功
+            if (response.isSuccessful()) {
+                response.body().toString();
+                // 打印服务端返回结果
+                return Objects.requireNonNull(response.body()).string();
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return "{}";
     }
 
     /**
-     * 远程调用获取附件文件流的接口
-     *
+     * @param patentNo
      * @return
+     * @throws IOException
+     * @author 李仁杰
+     * 从专利之星获取世界专利著录信息
      */
-    public byte[] getPatentFile(GetFuTuParamsDTO getFuTuParamsDTO) throws IOException {
-        //String param = new Gson().toJson(getFuTuParamsDTO);
-        //RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
-        OkHttpClient okHttpClient = new OkHttpClient.Builder()
-                .connectTimeout(60, TimeUnit.SECONDS)
-                .writeTimeout(60, TimeUnit.SECONDS)
-                .readTimeout(60, TimeUnit.SECONDS)
-                .build();
-        Request request = new Request.Builder()
-                .url(OPSUrl + "/api/OPSQuery/GetPatentFile?link=" + getFuTuParamsDTO.getLink() + "&page=" + getFuTuParamsDTO.getPage() + "&type=" + getFuTuParamsDTO.getType())
-                .get()
-                .build();
-        byte[] buffer = okHttpClient.newCall(request).execute().body().bytes();
-        return buffer;
+    public String  getENBibApi(String patentNo) throws IOException {
+        String url = "https://api.patentstar.com.cn/api/Patent/ENBib/"+patentNo;
+        String appId = "2000041";
+        String appkey = "F0E183D5F02C48E391F5FADF1B646F54";
+        Long currentTimeMillis = System.currentTimeMillis() / 1000;
+        String Sign = appId + appkey + currentTimeMillis.toString();
+        String signMd5 = FormatUtil.MD5(Sign);
+        // 创建一个OkHttpClient对象
+        OkHttpClient okHttpClient = new OkHttpClient();
+        // 创建一个请求对象
+        Request request = new Request.Builder().url(url)
+                .addHeader("_appid", "2000041")
+                .addHeader("_timestamp", currentTimeMillis.toString())
+                .addHeader("_sign", signMd5)
+                .get().build();
+        // 发送请求获取响应
+        try {
+            Response response = okHttpClient.newCall(request).execute();
+            // 判断请求是否成功
+            if (response.isSuccessful()) {
+                response.body().toString();
+                // 打印服务端返回结果
+                return Objects.requireNonNull(response.body()).string();
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return "{}";
     }
 
     /**
-     * @params 传对象
-     * @title 导入专利
-     * @description 导入专利
-     * @author lrj
+     * @param patentNo
+     * @return
+     * @throws IOException
+     * @author 李仁杰
+     * 从专利之星获取同族专利
      */
-    public String importPatents(PatentCell patentCell) throws IOException {
-        OkHttpClient httpClient = new OkHttpClient.Builder()
-                .pingInterval(400, TimeUnit.SECONDS) // 设置 PING 帧发送间隔
-                .connectTimeout(300, TimeUnit.SECONDS)//设置连接超时时间
-                .readTimeout(300, TimeUnit.SECONDS)//设置读取超时时间
-                .build();
-        String param = new Gson().toJson(patentCell);
-        RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
-        Request request = new Request.Builder()
-                .url(PASUrl + "/api/v2/system/patentCellTODb")
-                .post(requestBody)
-                .build();
-        return Objects.requireNonNull(httpClient.newCall(request).execute().body()).string();
+    public String  getFamilyByPubNoApi(String patentNo) throws IOException {
+        String url = "https://api.patentstar.com.cn/api/Patent/FamilyByPubNo/"+patentNo;
+        String appId = "2000041";
+        String appkey = "F0E183D5F02C48E391F5FADF1B646F54";
+        Long currentTimeMillis = System.currentTimeMillis() / 1000;
+        String Sign = appId + appkey + currentTimeMillis.toString();
+        String signMd5 = FormatUtil.MD5(Sign);
+        // 创建一个OkHttpClient对象
+        OkHttpClient okHttpClient = new OkHttpClient();
+        // 创建一个请求对象
+        Request request = new Request.Builder().url(url)
+                .addHeader("_appid", "2000041")
+                .addHeader("_timestamp", currentTimeMillis.toString())
+                .addHeader("_sign", signMd5)
+                .get().build();
+        // 发送请求获取响应
+        try {
+            Response response = okHttpClient.newCall(request).execute();
+            // 判断请求是否成功
+            if (response.isSuccessful()) {
+                response.body().toString();
+                // 打印服务端返回结果
+                return Objects.requireNonNull(response.body()).string();
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return "{}";
     }
 
+    /**
+     * @param patentNo
+     * @return
+     * @throws IOException
+     * @author 李仁杰
+     * 获得专利被引用次数api
+     */
+    public String  getCitedNumByPubNoApi(String patentNo) throws IOException {
+        String url = "https://api.patentstar.com.cn/api/Patent/CitedNumByPubNo/"+patentNo;
+        String appId = "2000041";
+        String appkey = "F0E183D5F02C48E391F5FADF1B646F54";
+        Long currentTimeMillis = System.currentTimeMillis()/ 1000;
+        String Sign = appId + appkey + currentTimeMillis.toString();
+        String signMd5 = FormatUtil.MD5(Sign);
+        // 创建一个OkHttpClient对象
+        OkHttpClient okHttpClient = new OkHttpClient();
+        // 创建一个请求对象
+        Request request = new Request.Builder().url(url)
+                .addHeader("_appid", "2000041")
+                .addHeader("_timestamp", currentTimeMillis.toString())
+                .addHeader("_sign", signMd5)
+                .get().build();
+        // 发送请求获取响应
+        try {
+            Response response = okHttpClient.newCall(request).execute();
+            // 判断请求是否成功
+            if (response.isSuccessful()) {
+                response.body().toString();
+                // 打印服务端返回结果
+                return Objects.requireNonNull(response.body()).string();
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return "{}";
+    }
 }

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

@@ -388,9 +388,7 @@
                     </where>
                     )
                 </foreach>
-
             </if>
-
         </where>
         group by a.id
         order by