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
cfc27721
Commit
cfc27721
authored
Jan 15, 2020
by
高宇强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gyq
parent
91f66031
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
0 deletions
+84
-0
igirl-zcapi/app/base/api/impl/action/enterpriseQuery.js
+6
-0
igirl-zcapi/app/base/service/impl/enterprise/enterpriseSve.js
+78
-0
No files found.
igirl-zcapi/app/base/api/impl/action/enterpriseQuery.js
View file @
cfc27721
...
...
@@ -43,6 +43,12 @@ class EnterpriseQueryAPI extends APIBase {
case
"licenseListByAuthor"
:
//获取企业证照信息列表
opResult
=
await
this
.
enterSve
.
licenseListByAuthor
(
action_body
);
break
;
case
"ipCountByAuthor"
:
//获取企业域名信息数量
opResult
=
await
this
.
enterSve
.
ipCountByAuthor
(
action_body
);
break
;
case
"ipListByAuthor"
:
//获取企业域名信息列表
opResult
=
await
this
.
enterSve
.
ipListByAuthor
(
action_body
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
igirl-zcapi/app/base/service/impl/enterprise/enterpriseSve.js
View file @
cfc27721
...
...
@@ -6,6 +6,7 @@ class EnterpriseService {
this
.
gxgyUrl
=
settings
.
reqEsAddrIc
()
+
"enterprise_chain_gxgy/_search"
;
this
.
licenseUrl
=
settings
.
reqEsAddrIc
()
+
"enterprise_chain_license/_search"
;
this
.
gameUrl
=
settings
.
reqEsAddrIc
()
+
"enterprise_chain_game/_search"
;
this
.
ipUrl
=
settings
.
reqEsAddrIc
()
+
"bigdata_ip_back/_search"
;
};
async
getConvertSemiangleStr
(
str
)
{
//半角转全角
...
...
@@ -360,6 +361,83 @@ class EnterpriseService {
return
System
.
getResult2
(
null
,
"获取数据出错"
);
};
};
async
ipCountByAuthor
(
obj
)
{
//获取企业域名信息数量
var
author
=
obj
.
author
==
null
||
obj
.
author
==
""
||
obj
.
author
==
"undefined"
?
""
:
obj
.
author
;
if
(
author
==
""
)
{
return
System
.
getResult2
(
null
,
"企业名称不能为空"
);
}
author
=
await
this
.
getConvertSemiangleStr
(
author
);
var
params
=
{
"query"
:
{
"term"
:
{
"company_name.raw"
:
author
}
},
"size"
:
0
};
var
rc
=
System
.
getObject
(
"util.execClient"
);
var
rtn
=
null
;
var
requrl
=
this
.
ipUrl
;
try
{
rtn
=
await
rc
.
execPost
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
return
System
.
getResult2
(
j
.
hits
.
total
,
null
);
}
catch
(
e
)
{
return
System
.
getResult2
(
null
,
"获取数据出错"
);
};
};
async
ipListByAuthor
(
obj
)
{
//获取企业域名信息列表
var
author
=
obj
.
author
==
null
||
obj
.
author
==
""
||
obj
.
author
==
"undefined"
?
""
:
obj
.
author
;
var
pagesize
=
obj
.
page_size
==
null
||
obj
.
page_size
==
""
||
obj
.
page_size
==
"undefined"
?
10
:
obj
.
page_size
;
var
from
=
obj
.
current_page
==
null
||
obj
.
current_page
==
""
||
obj
.
current_page
==
"undefined"
?
0
:
Number
((
obj
.
current_page
-
1
)
*
pagesize
);
if
(
author
==
""
)
{
return
System
.
getResult2
(
null
,
"企业名称不能为空"
);
}
author
=
await
this
.
getConvertSemiangleStr
(
author
);
var
params
=
{
"query"
:
{
"term"
:
{
"company_name.raw"
:
author
}
},
"from"
:
from
,
"size"
:
pagesize
,
"_source"
:
[
"company_name"
,
"card_num"
,
"web_adress"
,
"phone"
,
"phone1"
,
"phone2"
]
};
var
rc
=
System
.
getObject
(
"util.execClient"
);
var
rtn
=
null
;
var
requrl
=
this
.
ipUrl
;
try
{
rtn
=
await
rc
.
execPost
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
var
res
=
{};
res
.
total
=
0
;
res
.
data
=
[];
if
(
j
.
hits
.
total
>
0
)
{
res
.
total
=
j
.
hits
.
total
;
for
(
var
x
in
j
.
hits
.
hits
)
{
res
.
data
.
push
(
j
.
hits
.
hits
[
x
][
"_source"
]);
}
}
return
System
.
getResult2
(
res
,
null
);
}
catch
(
e
)
{
return
System
.
getResult2
(
null
,
"获取数据出错"
);
};
};
}
module
.
exports
=
EnterpriseService
;
...
...
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