Commit a6a82595 by 宋毅

tj

parent 1b0269d4
......@@ -11,55 +11,35 @@ class PatentQueryAPI extends APIBase {
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
async springBoard(pobj, qobj, req) {
if (!pobj.actionProcess) {
return system.getResult(null, "actionProcess参数不能为空");
}
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req);
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(action_process, action_type, action_body, req) {
async opActionProcess(pobj, action_type, req) {
var opResult = null;
switch (action_type) {
case "test"://测试
opResult = system.getResultSuccess(null, "测试成功");
break;
case "CommomSearchbyApplicant"://根据申请人查询聚合
opResult = await this.patentSve.CommomSearchbyApplicant(action_body, req);
break;
case "paCountByApplicantName"://根据申请人获取专利量
opResult = await this.patentSve.paCountByApplicantName(action_body, req);
break;
case "paShortListByApplicantName"://根据申请人获取专利详情列表
opResult = await this.patentSve.paShortListByApplicantName(action_body, req);
break;
case "paDetailsBypubNo"://根据公开或授权号获取专利详情列表
opResult = await this.patentSve.paDetailsBypubNo(action_body, req);
break;
case "paDetailsByfilingNo"://根据申请号获取专利详情列表
opResult = await this.patentSve.paDetailsByfilingNo(action_body, req);
break;
case "softwareCountByAuthor"://根据公司名称得到软著量
opResult = await this.patentSve.softwareCountByAuthor(action_body, req);
break;
case "softwareListByAuthor"://根据公司名称得到软著详情
opResult = await this.patentSve.softwareListByAuthor(action_body, req);
break;
case "softwareDetailsByregNum"://根据登记号获取软著详情
opResult = await this.patentSve.softwareDetailsByregNum(action_body, req);
break;
case "worksCountByAuthor"://根据公司名称得到著作权量
opResult = await this.patentSve.worksCountByAuthor(action_body, req);
break;
case "worksListByAuthor"://根据公司名称得到著作权详情
opResult = await this.patentSve.worksListByAuthor(action_body, req);
break;
case "worksDetailsByregNum"://根据登记号获取著作权详情
opResult = await this.patentSve.worksDetailsByregNum(action_body, req);
opResult = await this.patentSve.opReqResult(pobj, req);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
......
const System = require("../../../system");
var settings = require("../../../../config/settings");
const querystring = require('querystring');
class PatentycService {
const AppServiceBase = require("../../app.base");
class PatentycService extends AppServiceBase {
constructor() {
super();
this.zcApiUrl = settings.reqZcApi();
this.execClient = System.getObject("util.execClient");
};
async opReqResult(pobj, req) {
var url = this.zcApiUrl + "action/patentQuery/springBoard";
async opReqResult(reqUrl, queryobj, req) {
var rtn = await this.execClient.execPushDataPost(queryobj, reqUrl, req.headers["token"], req.headers["request-id"]);
var data = JSON.parse(rtn.stdout);
return data;
};
//根据申请人查询聚合
async CommomSearchbyApplicant(queryobj, req) {
var url = this.zcApiUrl + "api/action/patentQuery/CommomSearchbyApplicant";
return await this.opReqResult(url, queryobj, req);
};
//根据申请人获取专利量
async paCountByApplicantName(queryobj, req) {
var url = this.zcApiUrl + "api/action/patentQuery/paCountByApplicantName";
return await this.opReqResult(url, queryobj, req);
};
//根据申请人获取专利详情列表
async paShortListByApplicantName(queryobj, req) {
var url = this.zcApiUrl + "api/action/patentQuery/paShortListByApplicantName";
return await this.opReqResult(url, queryobj, req);
};
//根据公开或授权号获取专利详情列表
async paDetailsBypubNo(queryobj, req) {
var url = this.zcApiUrl + "api/action/patentQuery/paDetailsBypubNo";
return await this.opReqResult(url, queryobj, req);
};
//根据申请号获取专利详情列表
async paDetailsByfilingNo(queryobj, req) {
var url = this.zcApiUrl + "api/action/patentQuery/paDetailsByfilingNo";
return await this.opReqResult(url, queryobj, req);
};
//根据公司名称得到软著量
async softwareCountByAuthor(queryobj, req) {
var url = this.zcApiUrl + "api/action/patentQuery/softwareCountByAuthor";
return await this.opReqResult(url, queryobj, req);
};
//根据公司名称得到软著详情
async softwareListByAuthor(queryobj, req) {
var url = this.zcApiUrl + "api/action/patentQuery/softwareListByAuthor";
return await this.opReqResult(url, queryobj, req);
};
//根据登记号获取软著详情
async softwareDetailsByregNum(queryobj, req) {
var url = this.zcApiUrl + "api/action/patentQuery/softwareDetailsByregNum";
return await this.opReqResult(url, queryobj, req);
};
//根据公司名称得到著作权量
async worksCountByAuthor(queryobj, req) {
var url = this.zcApiUrl + "api/action/patentQuery/worksCountByAuthor";
return await this.opReqResult(url, queryobj, req);
};
//根据公司名称得到著作权详情
async worksListByAuthor(queryobj, req) {
var url = this.zcApiUrl + "api/action/patentQuery/worksListByAuthor";
return await this.opReqResult(url, queryobj, req);
};
//根据登记号获取著作权详情
async worksDetailsByregNum(queryobj, req) {
var url = this.zcApiUrl + "api/action/patentQuery/worksDetailsByregNum";
return await this.opReqResult(url, queryobj, req);
};
var result = await this.restPostUrl(pobj, url);
return result;
}
}
module.exports = PatentycService;
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