Commit c34218bd by 高宇强

gyq

parent 6b4ac18e
......@@ -72,14 +72,14 @@ class PatentQueryAPI extends APIBase {
}
module.exports = PatentQueryAPI;
var tesk = new PatentQueryAPI();
var parm = {
actionType:"paCountByApplicantName",
actionBody:{applicant_name:"上海华虹宏力半导体制造有限公司"}
};
tesk.springBoard(parm).then(function(result){
console.log(result);
// console.log(result.data.rows[0]);
}).catch(function(e){
console.log(e);
});
\ No newline at end of file
// var tesk = new PatentQueryAPI();
// var parm = {
// actionType:"worksListByAuthor",
// actionBody:{author:"胡超超"}
// };
// tesk.springBoard(parm).then(function(result){
// console.log(result);
// console.log(result.data.data[0]);
// }).catch(function(e){
// console.log(e);
// });
\ No newline at end of file
......@@ -1090,7 +1090,7 @@ auther:sy
var j = JSON.parse(rtn.stdout);
return System.getResult2(j.hits.total, null);
} catch (e) {
return rtn = System.getResult2(null, "获取数据出错");
return System.getResult2(null, "获取数据出错");
}
};
......@@ -1178,9 +1178,18 @@ auther:sy
try {
rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout);
return System.getResult2(j.hits, null);
var res = {};
res.total =0;
res.data = [];
if (j.hits.total >0){
res.total = j.hits.total;
for (var x in j.hits.hits){
res.data.push(j.hits.hits[x]["_source"]);
}
}
return System.getResult2(res, null);
} catch (e) {
return rtn = System.getResult2(null, "获取数据出错");
return System.getResult2(null, "获取数据出错");
}
};
......@@ -1282,9 +1291,18 @@ auther:sy
try {
rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout);
return System.getResult2(j.hits, null);
var res = {};
res.total =0;
res.data = [];
if (j.hits.total >0){
res.total = j.hits.total;
for (var x in j.hits.hits){
res.data.push(j.hits.hits[x]["_source"]);
}
}
return System.getResult2(res, null);
} catch (e) {
return rtn = System.getResult2(null, "获取数据出错");
return System.getResult2(null, "获取数据出错");
}
};
......@@ -1341,9 +1359,18 @@ auther:sy
try {
rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout);
return System.getResult2(j.hits, null);
var res = {};
res.total =0;
res.data = [];
if (j.hits.total >0){
res.total = j.hits.total;
for (var x in j.hits.hits){
res.data.push(j.hits.hits[x]["_source"]);
}
}
return System.getResult2(res, null);
} catch (e) {
return rtn = System.getResult2(null, "获取数据出错");
return System.getResult2(null, "获取数据出错");
}
};
......
......@@ -149,18 +149,19 @@ class CopyRightSearchApi extends ApiBase {
try {
rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout);
return rtn = {
status: 0,
msg: "操作成功",
data: j.hits
};
var res = {};
res.total =0;
res.data = [];
if (j.hits.total >0){
res.total = j.hits.total;
for (var x in j.hits.hits){
res.data.push(j.hits.hits[x]["_source"]);
}
}
return System.getResult2(res, null);
}
catch (e) {
return rtn = {
status: -1,
msg: "操作失败",
data: null
};
return System.getResult2(null, "获取数据出错");
};
};
......@@ -224,18 +225,19 @@ class CopyRightSearchApi extends ApiBase {
try {
rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout);
return rtn = {
status: 0,
msg: "操作成功",
data: j.hits
};
var res = {};
res.total =0;
res.data = [];
if (j.hits.total >0){
res.total = j.hits.total;
for (var x in j.hits.hits){
res.data.push(j.hits.hits[x]["_source"]);
}
}
return System.getResult2(res, null);
}
catch (e) {
return rtn = {
status: -1,
msg: "操作失败",
data: null
};
return System.getResult2(null, "获取数据出错");
};
};
......@@ -318,7 +320,7 @@ auther:sy
*/
async worksListByAuthor(obj) {
var author = obj.author == null || obj.author == "" || obj.author == "undefined" ? "" : obj.author;
var pagesize = obj.page_size == null || obj.page_size == "" || obj.page_size == "undefined" ? 20 : obj.page_size;
var pagesize = obj.page_size == null || obj.page_size == "" || obj.page_size == "undefined" ? 10 : obj.page_size;
var from = obj.current_page == null || obj.current_page == "" || obj.current_page == "undefined" ? 0 : Number((obj.current_page - 1) * pagesize);
if (author == "") {
......@@ -353,18 +355,19 @@ auther:sy
try {
rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout);
return rtn = {
status: 0,
msg: "操作成功",
data: j.hits
};
var res = {};
res.total =0;
res.data = [];
if (j.hits.total >0){
res.total = j.hits.total;
for (var x in j.hits.hits){
res.data.push(j.hits.hits[x]["_source"]);
}
}
return System.getResult2(res, null);
}
catch (e) {
return rtn = {
status: -1,
msg: "操作失败",
data: null
};
return System.getResult2(null, "获取数据出错");
};
};
......@@ -427,18 +430,19 @@ auther:sy
try {
rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout);
return rtn = {
status: 0,
msg: "操作成功",
data: j.hits
};
var res = {};
res.total =0;
res.data = [];
if (j.hits.total >0){
res.total = j.hits.total;
for (var x in j.hits.hits){
res.data.push(j.hits.hits[x]["_source"]);
}
}
return System.getResult2(res, null);
}
catch (e) {
return rtn = {
status: -1,
msg: "操作失败",
data: null
};
return System.getResult2(null, "获取数据出错");
};
};
}
......
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