Commit cab282ea by v_vjyjiang

gyq

parent 01630ff5
......@@ -77,8 +77,11 @@ class PatentQueryAPI extends APIBase {
opResult = await this.cpatentsearchApi.CommomSearchbyInventor(action_body);
break;
case "AffairsearchbyFilingno"://根据申请号查询并根据法律状态日期排序
opResult = await this.caffairsearchApi.SearchbyFilingno(action_body);
break;
opResult = await this.caffairsearchApi.SearchbyFilingno(action_body);
break;
case "paDataOrderByPubno"://查询所有专利,按公开日倒序排列
opResult = await this.cpatentsearchApi.paDataOrderByPubno(action_body);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -1315,6 +1315,54 @@ auther:sy
}
};
async paDataOrderByPubno(obj){//查询所有专利,按公开日倒序排列
var pagesize = obj.page_size == null || obj.page_size == "" || obj.page_size == "undefined" ? 20 : obj.page_size;
var from = obj.current_page == null || obj.current_page == "" || obj.current_page == "undefined" ? 0 : Number((obj.current_page - 1) * pagesize);
var params = {
"query": {
"bool": {
"must": []
}
},
"from": from,
"size": pagesize,
"_source": [
"filing_name",
"filing_no",
"pub_no",
"abstr_text"
],
"sort": [
{
"pub_date": "desc"
}
]
};
var rc = System.getObject("util.execClient");
var rtn = null;
var requrl = this.patentUrl;
try {
rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout);
var res = {};
res.total = 0;
res.data = [];
if (j.hits.total > 0) {
res.total = j.hits.total;
for (let index = 0; index < j.hits.hits.length; index++) {
const element = j.hits.hits[index];
if (element) {
res.data.push(element["_source"]);
}
}
}
return System.getResult2(res, null);
} catch (e) {
return System.getResult2(null, "获取数据出错");
}
};
async paDetailsByfilingNo(obj) {
var filingNo = obj.filingNo == null || obj.filingNo == "" || obj.filingNo == "undefined" || obj.filingNo == "null" ? "" : obj.filingNo;
if (filingNo == "") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment