Commit 6d098050 by 高宇强

gyq

parent c34218bd
var APIBase = require("../../api.base");
var system = require("../../../system");
class LicenseQueryAPI extends APIBase {
constructor() {
super();
this.liecseSve = system.getObject("service.licenses.licenseSve");
}
/**
* 接口跳转-POST请求
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj.actionType, pobj.actionBody);
return result;
}
async opActionProcess(action_type, action_body) {
var opResult = null;
switch (action_type) {
case "test"://测试
opResult = system.getResultSuccess(null, "测试成功");
break;
case "getLicenses"://根据公司得到推荐要办的证书
opResult = await this.liecseSve.getLicenses(action_body);
break;
// case "getLicenfgfg"://根据公司得到推荐要办的证书
// opResult = await this.liecseSve.getLicenfgfg(action_body);
// break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
}
module.exports = LicenseQueryAPI;
var tesk = new LicenseQueryAPI();
var parm = {
actionType:"getLicenfgfg",
actionBody:{name:"上海盛霄云计算技术有限公司"}
};
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
......@@ -74,8 +74,8 @@ module.exports = PatentQueryAPI;
// var tesk = new PatentQueryAPI();
// var parm = {
// actionType:"worksListByAuthor",
// actionBody:{author:"胡超超"}
// actionType:"paShortListByApplicantName",
// actionBody:{applicant_name:"中国专利信息中心"}
// };
// tesk.springBoard(parm).then(function(result){
// console.log(result);
......
......@@ -1155,12 +1155,13 @@ auther:sy
"filing_name",
"pub_status_now",
"filing_no",
"filing_date",
"gr_date",
"filing_time",
"gr_time",
"gr_no",
"pub_date",
"pub_time",
"pub_no",
"agency_name",
"applicant_name",
"inventor_name",
"main_ipc",
"abstr_text",
......@@ -1252,12 +1253,13 @@ auther:sy
"filing_name",
"pub_status_now",
"filing_no",
"filing_date",
"gr_date",
"filing_time",
"gr_time",
"gr_no",
"pub_date",
"pub_time",
"pub_no",
"agency_name",
"applicant_name",
"inventor_name",
"main_ipc",
"abstr_text",
......@@ -1336,12 +1338,13 @@ auther:sy
"filing_name",
"pub_status_now",
"filing_no",
"filing_date",
"gr_date",
"filing_time",
"gr_time",
"gr_no",
"pub_date",
"pub_time",
"pub_no",
"agency_name",
"applicant_name",
"inventor_name",
"main_ipc",
"abstr_text",
......
const System = require("../../../system");
// const ServiceBase = require("../../sve.base");
const querystring = require('querystring');
class LicenseService {
constructor() {
this.licenseUrl = "http://43.247.184.92:8111/gsb/api/Licenses";
};
async getLicenses(obj) {//根据公司得到推荐要办的证书
var name = obj.name == null ? "" : obj.name;
if (name == "") {
return System.getResult2(null, "参数不能为空");
}
var params = {"name": name};
var rc = System.getObject("util.execClient");
//var data = querystring.stringify(params);
var rtn = null;
try {
rtn = await rc.execPost(params, this.licenseUrl);
var result = JSON.parse(rtn.stdout);
return System.getResult2(result, null);
} catch (e) {
return System.getResult2(null, "获取数据出错");
}
};
}
module.exports = LicenseService;
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