Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
16f1c875
Commit
16f1c875
authored
Feb 06, 2020
by
高宇强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gyq
parent
4f0c6712
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
34 deletions
+48
-34
igirl-zcapi/app/base/service/impl/enterprise/enterpriseSve.js
+48
-34
No files found.
igirl-zcapi/app/base/service/impl/enterprise/enterpriseSve.js
View file @
16f1c875
...
@@ -11,6 +11,7 @@ class EnterpriseService {
...
@@ -11,6 +11,7 @@ class EnterpriseService {
this
.
qccUrl
=
"http://api.qichacha.com/ECIV4/GetDetailsByName"
;
this
.
qccUrl
=
"http://api.qichacha.com/ECIV4/GetDetailsByName"
;
this
.
patentApi
=
System
.
getObject
(
"api.patent.chinapatentsearch"
);
this
.
patentApi
=
System
.
getObject
(
"api.patent.chinapatentsearch"
);
this
.
copyApi
=
System
.
getObject
(
"api.patent.copyrightsearch"
);
this
.
copyApi
=
System
.
getObject
(
"api.patent.copyrightsearch"
);
this
.
redisClient
=
System
.
getObject
(
"util.redisClient"
);
};
};
async
getcountAll
(
obj
){
//获取企业所有证照数量
async
getcountAll
(
obj
){
//获取企业所有证照数量
...
@@ -125,32 +126,44 @@ class EnterpriseService {
...
@@ -125,32 +126,44 @@ class EnterpriseService {
return
System
.
getResult2
(
null
,
"企业名称不能为空"
);
return
System
.
getResult2
(
null
,
"企业名称不能为空"
);
}
}
author
=
await
this
.
getConvertSemiangleStr
(
author
);
author
=
await
this
.
getConvertSemiangleStr
(
author
);
var
Timespan
=
parseInt
(
Date
.
now
()
/
1000
);
//秒级时间戳
var
childName
=
await
this
.
redisClient
.
get
(
"qichacha_QccBranches:"
+
author
);
var
Token
=
md5
(
"74805b02bf2f46feaa3bdb24feecfbc1"
+
Timespan
.
toString
()
+
"5D92FB79060AFCBFD3D4BC7AE7A3D225"
);
if
(
childName
){
Token
=
Token
.
toUpperCase
();
console
.
log
(
childName
);
var
params
=
{
return
System
.
getResult2
(
JSON
.
parse
(
childName
),
"获取数据成功"
);
key
:
"74805b02bf2f46feaa3bdb24feecfbc1"
,
keyword
:
author
}
}
var
rc
=
System
.
getObject
(
"util.restClient"
);
else
{
var
data
=
querystring
.
stringify
(
params
);
var
rtn
=
null
;
var
Timespan
=
parseInt
(
Date
.
now
()
/
1000
);
//秒级时间戳
try
{
var
Token
=
md5
(
"74805b02bf2f46feaa3bdb24feecfbc1"
+
Timespan
.
toString
()
+
"5D92FB79060AFCBFD3D4BC7AE7A3D225"
);
rtn
=
await
rc
.
execGetZZ
(
params
,
this
.
qccUrl
,
Token
,
Timespan
);
Token
=
Token
.
toUpperCase
();
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
var
params
=
{
if
(
result
.
Status
==
"200"
){
key
:
"74805b02bf2f46feaa3bdb24feecfbc1"
,
return
System
.
getResult2
(
result
.
Result
.
Branches
,
"获取数据出错"
);
keyword
:
author
}
}
else
if
(
result
.
Status
==
"201"
){
var
rc
=
System
.
getObject
(
"util.restClient"
);
return
System
.
getResult2
(
null
,
"查询无结果"
);
var
data
=
querystring
.
stringify
(
params
);
}
var
rtn
=
null
;
else
{
try
{
return
System
.
getResult2
(
null
,
"获取数据出错"
);
rtn
=
await
rc
.
execGetZZ
(
params
,
this
.
qccUrl
,
Token
,
Timespan
);
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
Status
==
"200"
){
}
catch
(
e
){
//await this.redisClient.set("qichacha_QccBranches:" + author, result.Result.Branches.join("-"));
return
System
.
getResult2
(
null
,
"获取数据出错"
);
await
this
.
redisClient
.
setWithEx
(
"qichacha_QccBranches:"
+
author
,
JSON
.
stringify
(
result
.
Result
.
Branches
),
31536000
);
return
System
.
getResult2
(
result
.
Result
.
Branches
,
"获取数据成功"
);
}
else
if
(
result
.
Status
==
"201"
){
return
System
.
getResult2
(
null
,
"查询无结果"
);
}
else
{
return
System
.
getResult2
(
null
,
"获取数据出错"
);
}
}
catch
(
e
){
return
System
.
getResult2
(
null
,
"获取数据出错"
);
}
}
}
};
};
...
@@ -769,14 +782,15 @@ class EnterpriseService {
...
@@ -769,14 +782,15 @@ class EnterpriseService {
}
}
module
.
exports
=
EnterpriseService
;
module
.
exports
=
EnterpriseService
;
// var tesk = new EnterpriseService();
var
tesk
=
new
EnterpriseService
();
// var parm = {
var
parm
=
{
// author: "淘宝(中国)软件有限公司"
//author: "淘宝(中国)软件有限公司"
// };
author
:
"华为技术有限公司"
// tesk.GetcountAll(parm).then(function (result) {
};
// console.log(result);
tesk
.
getQccBranches
(
parm
).
then
(
function
(
result
)
{
// // console.log(result.data.data[0]);
console
.
log
(
result
);
// }).catch(function (e) {
// console.log(result.data.data[0]);
// console.log(e);
}).
catch
(
function
(
e
)
{
// });
console
.
log
(
e
);
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment