Commit e4db9aa0 by 高宇强

gyq

parent d1638a61
...@@ -52,6 +52,9 @@ class EnterpriseQueryAPI extends APIBase { ...@@ -52,6 +52,9 @@ class EnterpriseQueryAPI extends APIBase {
case "getQccBranches"://获取企业的分支机构(从企查查获取) case "getQccBranches"://获取企业的分支机构(从企查查获取)
opResult = await this.enterSve.getQccBranches(action_body); opResult = await this.enterSve.getQccBranches(action_body);
break; break;
case "getcountAll"://获取企业所有证照数量
opResult = await this.enterSve.getcountAll(action_body);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -9,8 +9,116 @@ class EnterpriseService { ...@@ -9,8 +9,116 @@ class EnterpriseService {
this.gameUrl = settings.reqEsAddrIc() + "enterprise_chain_game/_search"; this.gameUrl = settings.reqEsAddrIc() + "enterprise_chain_game/_search";
this.ipUrl = settings.reqEsAddrIc() + "bigdata_ip_back/_search"; this.ipUrl = settings.reqEsAddrIc() + "bigdata_ip_back/_search";
this.qccUrl = "http://api.qichacha.com/ECIV4/GetDetailsByName"; this.qccUrl = "http://api.qichacha.com/ECIV4/GetDetailsByName";
this.patentApi = System.getObject("api.patent.chinapatentsearch");
this.copyApi = System.getObject("api.patent.copyrightsearch");
}; };
async getcountAll(obj){//获取企业所有证照数量
try{
var author = obj.author == null || obj.author == "" || obj.author == "undefined" ? "" : obj.author;
if (author == "") {
return System.getResult2(null, "企业名称不能为空");
}
author = await this.getConvertSemiangleStr(author);
var resdict = {
"知产证照":0,
"互联网经营":0,
"食品":0,
"网络文化":0,
"特种资质":0
}
var parms = {
"applicant_name": author
}
var licenses = [];
var patentCount = 0;
var res = await this.patentApi.paCountByApplicantName(parms);
if (res.status == 0){
patentCount = res.data;
}
var softCount = 0;
res = await this.copyApi.softwareCountByAuthor(obj);
if (res.status == 0){
softCount = res.data;
}
var worksCount = 0;
res = await this.copyApi.worksCountByAuthor(obj);
if (res.status == 0){
worksCount = res.data;
}
resdict["知产证照"] = patentCount + softCount + worksCount;
res = await this.gxCountByAuthor(obj);
var gxCount = 0;
if (res.status == 0){
gxCount = res.data;
}
resdict["特种资质"] = gxCount;
parms = {
"author":author,
"type":"网络游戏出版备案"
}
res = await this.gameCountByAuthor(parms);
var game1Count = 0;
var game2Count = 0;
if (res.status == 0){
game1Count = res.data;
}
parms = {
"author":author,
"type":"网络游戏运营备案"
}
res = await this.gameCountByAuthor(parms);
if (res.status == 0){
game2Count = res.data;
}
res = await this.licenseCountByAuthor(obj);
var webCount = 0;
var gbcount = 0;
var ICPCount = 0;
var IDCCount = 0;
var EDICount = 0;
if (res.status == 0){
for (var index =0;index < res.data.data.length;index++){
var temp = res.data.data[index];
if (temp){
if (temp["key"] == "网络文化经营许可证"){
webCount = temp["doc_count"];
}
else if (temp["key"] == "广播电视节目制作经营许可证"){
gbcount = temp["doc_count"];
}
else if (temp["key"] == "ICP许可证"){
ICPCount = temp["doc_count"];
}
else if (temp["key"] == "IDC许可证"){
IDCCount = temp["doc_count"];
}
else if (temp["key"] == "EDI许可证"){
EDICount = temp["doc_count"];
}
}
}
}
resdict["互联网经营"] = ICPCount + IDCCount + EDICount;
resdict["网络文化"] = webCount + gbcount + game1Count + game2Count;
return System.getResult2(resdict, null);
}
catch (e)
{
console.log(e);
return System.getResult2(null, "获取数据出错");
}
}
async getQccBranches(obj){//获取企业的分支机构(从企查查获取) async getQccBranches(obj){//获取企业的分支机构(从企查查获取)
var author = obj.author == null || obj.author == "" || obj.author == "undefined" ? "" : obj.author; var author = obj.author == null || obj.author == "" || obj.author == "undefined" ? "" : obj.author;
if (author == "") { if (author == "") {
...@@ -497,7 +605,7 @@ module.exports = EnterpriseService; ...@@ -497,7 +605,7 @@ module.exports = EnterpriseService;
// var parm = { // var parm = {
// author: "淘宝(中国)软件有限公司" // author: "淘宝(中国)软件有限公司"
// }; // };
// tesk.getQccBranches(parm).then(function (result) { // tesk.GetcountAll(parm).then(function (result) {
// console.log(result); // console.log(result);
// // console.log(result.data.data[0]); // // console.log(result.data.data[0]);
// }).catch(function (e) { // }).catch(function (e) {
......
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