|
@@ -91,12 +91,12 @@ public class PatentStarApiService {
|
|
|
}
|
|
|
}
|
|
|
String reStr = sb.toString();
|
|
|
- reStr ="FXX"+reStr.replace("=", "/");
|
|
|
+ reStr = "FXX" + reStr.replace("=", "/");
|
|
|
return reStr;
|
|
|
}
|
|
|
|
|
|
- public Map<String,Object> patentStarSearchApi(PatentStarListDto patentStarListDto) throws IOException {
|
|
|
- String formQuery=patentStarListDto.getCurrentQuery();
|
|
|
+ public Map<String, Object> patentStarSearchApi(PatentStarListDto patentStarListDto) throws IOException {
|
|
|
+ String formQuery = patentStarListDto.getCurrentQuery();
|
|
|
patentStarListDto.setCurrentQuery(PatentStarApiService.formatQuery(formQuery));
|
|
|
String json = JSONObject.toJSONString(patentStarListDto);
|
|
|
String url = "http://s.patentstar.com.cn/SearchAPI/PatentSearch/ResultGet";
|
|
@@ -119,16 +119,16 @@ public class PatentStarApiService {
|
|
|
Response response = okHttpClient.newCall(request).execute();
|
|
|
// 判断请求是否成功
|
|
|
if (response.isSuccessful()) {
|
|
|
- JSONObject jsonObject =JSONObject.parseObject(Objects.requireNonNull(response.body()).string());
|
|
|
- JSONObject Data= (JSONObject)jsonObject.get("Data");
|
|
|
- List<StarPatentVO> starPatentVOS = JSONArray.parseArray(Data.get("List").toString(),StarPatentVO.class);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(Objects.requireNonNull(response.body()).string());
|
|
|
+ JSONObject Data = (JSONObject) jsonObject.get("Data");
|
|
|
+ List<StarPatentVO> starPatentVOS = JSONArray.parseArray(Data.get("List").toString(), StarPatentVO.class);
|
|
|
// 打印服务端返回结果
|
|
|
- // return Objects.requireNonNull(response.body()).string();
|
|
|
- Map<String,Object> reMap =new HashMap<>();
|
|
|
- reMap.put("size",patentStarListDto.getRowCount());
|
|
|
- reMap.put("current",patentStarListDto.getPageNum());
|
|
|
- reMap.put("records",starPatentVOS);
|
|
|
- reMap.put("total",Data.get("HitCount"));
|
|
|
+ // return Objects.requireNonNull(response.body()).string();
|
|
|
+ Map<String, Object> reMap = new HashMap<>();
|
|
|
+ reMap.put("size", patentStarListDto.getRowCount());
|
|
|
+ reMap.put("current", patentStarListDto.getPageNum());
|
|
|
+ reMap.put("records", starPatentVOS);
|
|
|
+ reMap.put("total", Data.get("HitCount"));
|
|
|
return reMap;
|
|
|
}
|
|
|
} catch (IOException e) {
|
|
@@ -136,12 +136,13 @@ public class PatentStarApiService {
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* @param appNo
|
|
|
* @return
|
|
|
* @throws IOException
|
|
|
* @author 李仁杰
|
|
|
- * 从专利之星获取摘要附图
|
|
|
+ * 从专利之星获取中国专利著录
|
|
|
*/
|
|
|
public String getCnBibApi(String appNo) throws IOException {
|
|
|
String url = "https://api.patentstar.com.cn/api/Patent/CnBibo/" + appNo;
|
|
@@ -178,7 +179,7 @@ public class PatentStarApiService {
|
|
|
* @return
|
|
|
* @throws IOException
|
|
|
* @author 李仁杰
|
|
|
- * 从专利之星获取摘要附图
|
|
|
+ * 从专利之星获取中国专利摘要附图
|
|
|
*/
|
|
|
public String getPictureApi(String patentNo) throws IOException {
|
|
|
String url = "https://api.patentstar.com.cn/api/Patent/CnMainImage/" + patentNo;
|
|
@@ -256,7 +257,7 @@ public class PatentStarApiService {
|
|
|
* 从专利之星获取中国专利法律状态
|
|
|
*/
|
|
|
public String getCnLegalApi(String appNo) throws IOException {
|
|
|
- String url = "https://api.patentstar.com.cn/api/Patent/CnLegal/"+appNo;
|
|
|
+ String url = "https://api.patentstar.com.cn/api/Patent/CnLegal/" + appNo;
|
|
|
String appId = "2000041";
|
|
|
String appkey = "F0E183D5F02C48E391F5FADF1B646F54";
|
|
|
Long currentTimeMillis = System.currentTimeMillis() / 1000;
|
|
@@ -293,8 +294,8 @@ public class PatentStarApiService {
|
|
|
* 从专利之星获取中国专利全文图片
|
|
|
*/
|
|
|
|
|
|
- public String getCnPdfApi(String appNo) throws IOException {
|
|
|
- String url = "https://api.patentstar.com.cn/api/Patent/CnPdf/"+appNo;
|
|
|
+ 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;
|
|
@@ -322,6 +323,7 @@ public class PatentStarApiService {
|
|
|
}
|
|
|
return "{}";
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* @param appNo
|
|
|
* @return
|
|
@@ -330,8 +332,8 @@ public class PatentStarApiService {
|
|
|
* 从专利之星获取中国专利全文文本
|
|
|
*/
|
|
|
|
|
|
- public String getCnFullXmlApi(String appNo) throws IOException {
|
|
|
- String url = "https://api.patentstar.com.cn/api/Patent/CnFullXml/"+appNo;
|
|
|
+ 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;
|
|
@@ -367,8 +369,8 @@ public class PatentStarApiService {
|
|
|
* @author 李仁杰
|
|
|
* 从专利之星获取世界专利pdf
|
|
|
*/
|
|
|
- public String getEnPdfApi(String patentNo) throws IOException {
|
|
|
- String url = " https://api.patentstar.com.cn/api/Patent/EnPdf/"+patentNo;
|
|
|
+ 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;
|
|
@@ -404,8 +406,8 @@ public class PatentStarApiService {
|
|
|
* @author 李仁杰
|
|
|
* 从专利之星获取世界专利著录信息
|
|
|
*/
|
|
|
- public String getENBibApi(String patentNo) throws IOException {
|
|
|
- String url = "https://api.patentstar.com.cn/api/Patent/ENBib/"+patentNo;
|
|
|
+ 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;
|
|
@@ -441,8 +443,8 @@ public class PatentStarApiService {
|
|
|
* @author 李仁杰
|
|
|
* 从专利之星获取同族专利
|
|
|
*/
|
|
|
- public String getFamilyByPubNoApi(String patentNo) throws IOException {
|
|
|
- String url = "https://api.patentstar.com.cn/api/Patent/FamilyByPubNo/"+patentNo;
|
|
|
+ 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;
|
|
@@ -478,11 +480,11 @@ public class PatentStarApiService {
|
|
|
* @author 李仁杰
|
|
|
* 获得专利被引用次数api
|
|
|
*/
|
|
|
- public String getCitedNumByPubNoApi(String patentNo) throws IOException {
|
|
|
- String url = "https://api.patentstar.com.cn/api/Patent/CitedNumByPubNo/"+patentNo;
|
|
|
+ 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;
|
|
|
+ Long currentTimeMillis = System.currentTimeMillis() / 1000;
|
|
|
String Sign = appId + appkey + currentTimeMillis.toString();
|
|
|
String signMd5 = FormatUtil.MD5(Sign);
|
|
|
// 创建一个OkHttpClient对象
|
|
@@ -509,8 +511,8 @@ public class PatentStarApiService {
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
- String str ="(AB=电子 OR TI=电子)";
|
|
|
- String aa= PatentStarApiService.formatQuery(str);
|
|
|
- System.out.println(aa);
|
|
|
+ String str = "(AB=电子 OR TI=电子)";
|
|
|
+ String aa = formatQuery(str);
|
|
|
+ System.out.println(aa);
|
|
|
}
|
|
|
}
|