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
0d242292
Commit
0d242292
authored
Feb 19, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
c287fd34
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
10 deletions
+22
-10
rpt_result/GetRiskinfoFromJson.py
+1
-1
rpt_result/getcompanyinfofromES.py
+19
-6
rpt_result/main.py
+2
-3
No files found.
rpt_result/GetRiskinfoFromJson.py
View file @
0d242292
...
...
@@ -35,7 +35,7 @@ def CreatBdictFromJson(GetAllinfo):
# print(dict_all)
# 获取传入的参数
GetAllinfo
=
GetAllinfo
GetAllinfo_new
=
eval
(
GetAllinfo
.
get
(
"ri"
,
None
))
# 如果key不存在,会返回None,因此需进行判断
GetAllinfo_new
=
GetAllinfo
.
get
(
"ri"
,
None
)
# 如果key不存在,会返回None,因此需进行判断
for
factors_name
,
value
in
dict_all
.
items
():
try
:
dict_all
[
factors_name
][
"status"
]
=
GetAllinfo_new
[
factors_name
]
...
...
rpt_result/getcompanyinfofromES.py
View file @
0d242292
...
...
@@ -31,10 +31,26 @@ def GetComanyinfoFromES(companyname):
es
=
Elasticsearch
([
esip
],
http_auth
=
(
esuser
,
espassword
),
port
=
esport
,
timeout
=
15000
)
companyinfo
=
es
.
search
(
index
=
"bigdata_ic_gsb_company_op"
,
body
=
{
"query"
:
{
"bool"
:
{
"must"
:
{
"term"
:
{
"company_name.raw"
:
companyname
}}}}})
companylist
=
{}
companylist
=
{
"companyname"
:
companyname
,
"legal_person"
:
"-"
,
"cred_code"
:
"-"
,
"province"
:
"-"
,
"city"
:
"-"
,
"reg_location"
:
"-"
,
"establish_time"
:
"-"
,
"company_cate_1"
:
"-"
,
"company_org_type"
:
"-"
,
"reg_institute"
:
"-"
,
"reg_capital"
:
"-"
,
"reg_status"
:
"-"
,
"from_time"
:
"-"
,
"to_time"
:
"-"
,
"approved_time"
:
"-"
,
"business_scope"
:
"-"
}
if
companyinfo
[
"hits"
][
"hits"
]:
for
row
in
companyinfo
[
"hits"
][
"hits"
]:
companyname
=
row
[
'_source'
][
"company_name"
]
# 公司名称
legal_person
=
row
[
'_source'
][
"legal_person"
]
# 法定代表人
if
legal_person
is
None
:
legal_person
=
"_"
...
...
@@ -102,6 +118,4 @@ def GetComanyinfoFromES(companyname):
companylist
[
"to_time"
]
=
to_time
companylist
[
"approved_time"
]
=
approved_time
companylist
[
"business_scope"
]
=
business_scope
return
companylist
# a=GetComanyinfoFromES("用友网络科技股份有限公司")
# print(a)
\ No newline at end of file
return
companylist
rpt_result/main.py
View file @
0d242292
...
...
@@ -186,9 +186,9 @@ def UpdateTaskRptUrl(batchid, rptUrl):
companyInfo_New
=
json
.
loads
(
UpdateInfo
.
text
)
# 访问接口返回的信息
print
(
companyInfo_New
)
if
companyInfo_New
[
"msg"
]
==
"操作成功"
:
return
batchid
+
"报告已更新完成"
return
str
(
batchid
)
+
"报告已更新完成"
else
:
return
batchid
+
"报告更新失败"
return
str
(
batchid
)
+
"报告更新失败"
...
...
@@ -217,5 +217,4 @@ def report():
return
"请输入检测公司名称"
server
.
run
(
host
=
'0.0.0.0'
,
port
=
80
,
debug
=
True
)
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