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 {
this
.
qccUrl
=
"http://api.qichacha.com/ECIV4/GetDetailsByName"
;
this
.
patentApi
=
System
.
getObject
(
"api.patent.chinapatentsearch"
);
this
.
copyApi
=
System
.
getObject
(
"api.patent.copyrightsearch"
);
this
.
redisClient
=
System
.
getObject
(
"util.redisClient"
);
};
async
getcountAll
(
obj
){
//获取企业所有证照数量
...
...
@@ -125,32 +126,44 @@ class EnterpriseService {
return
System
.
getResult2
(
null
,
"企业名称不能为空"
);
}
author
=
await
this
.
getConvertSemiangleStr
(
author
);
var
Timespan
=
parseInt
(
Date
.
now
()
/
1000
);
//秒级时间戳
var
Token
=
md5
(
"74805b02bf2f46feaa3bdb24feecfbc1"
+
Timespan
.
toString
()
+
"5D92FB79060AFCBFD3D4BC7AE7A3D225"
);
Token
=
Token
.
toUpperCase
();
var
params
=
{
key
:
"74805b02bf2f46feaa3bdb24feecfbc1"
,
keyword
:
author
var
childName
=
await
this
.
redisClient
.
get
(
"qichacha_QccBranches:"
+
author
);
if
(
childName
){
console
.
log
(
childName
);
return
System
.
getResult2
(
JSON
.
parse
(
childName
),
"获取数据成功"
);
}
var
rc
=
System
.
getObject
(
"util.restClient"
);
var
data
=
querystring
.
stringify
(
params
);
var
rtn
=
null
;
try
{
rtn
=
await
rc
.
execGetZZ
(
params
,
this
.
qccUrl
,
Token
,
Timespan
);
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
Status
==
"200"
){
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
,
"获取数据出错"
);
else
{
var
Timespan
=
parseInt
(
Date
.
now
()
/
1000
);
//秒级时间戳
var
Token
=
md5
(
"74805b02bf2f46feaa3bdb24feecfbc1"
+
Timespan
.
toString
()
+
"5D92FB79060AFCBFD3D4BC7AE7A3D225"
);
Token
=
Token
.
toUpperCase
();
var
params
=
{
key
:
"74805b02bf2f46feaa3bdb24feecfbc1"
,
keyword
:
author
}
var
rc
=
System
.
getObject
(
"util.restClient"
);
var
data
=
querystring
.
stringify
(
params
);
var
rtn
=
null
;
try
{
rtn
=
await
rc
.
execGetZZ
(
params
,
this
.
qccUrl
,
Token
,
Timespan
);
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
Status
==
"200"
){
//await this.redisClient.set("qichacha_QccBranches:" + author, result.Result.Branches.join("-"));
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 {
}
module
.
exports
=
EnterpriseService
;
// var tesk = new EnterpriseService();
// var parm = {
// author: "淘宝(中国)软件有限公司"
// };
// tesk.GetcountAll(parm).then(function (result) {
// console.log(result);
// // console.log(result.data.data[0]);
// }).catch(function (e) {
// console.log(e);
// });
var
tesk
=
new
EnterpriseService
();
var
parm
=
{
//author: "淘宝(中国)软件有限公司"
author
:
"华为技术有限公司"
};
tesk
.
getQccBranches
(
parm
).
then
(
function
(
result
)
{
console
.
log
(
result
);
// console.log(result.data.data[0]);
}).
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