Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mancheng
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
Administrator
mancheng
Commits
e8264d65
Commit
e8264d65
authored
Jan 09, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20230109
parent
fc7532b5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
17 deletions
+16
-17
apps/view_atlas/view.py
+16
-17
No files found.
apps/view_atlas/view.py
View file @
e8264d65
...
@@ -137,13 +137,19 @@ def find_up_thr1(industry_type, industry_id):
...
@@ -137,13 +137,19 @@ def find_up_thr1(industry_type, industry_id):
"chain_name_id"
:
chain_one_obj
.
id
"chain_name_id"
:
chain_one_obj
.
id
}
for
chain_one_obj
in
chain_one_obj_list
]
}
for
chain_one_obj
in
chain_one_obj_list
]
for
pname_one
in
res_one
:
# 一级节点
for
pname_one
in
res_one
:
# 一级节点
chain_name
1
=
pname_one
[
"chain_name"
]
chain_name
=
pname_one
[
"chain_name"
]
total_count
=
0
total_count
=
0
node_one
=
''
# 一级的企业数量
# 一级的企业数量
company_count
=
get_count
(
chain_name
1
)
company_count
=
get_count
(
chain_name
)
total_count
+=
company_count
total_count
+=
company_count
# 一级
node_one
=
{
"node"
:
"{}"
.
format
(
chain_name
),
"level"
:
2
,
"company_count"
:
total_count
,
"subNodeList"
:
[]
}
# 获取二级节点
# 获取二级节点
chain_two_obj_list
=
IndustryChain
.
query
.
filter_by
(
relate_id
=
pname_one
[
"chain_name_id"
])
.
all
()
chain_two_obj_list
=
IndustryChain
.
query
.
filter_by
(
relate_id
=
pname_one
[
"chain_name_id"
])
.
all
()
res_two
=
[{
"chain_name"
:
chain_two_obj
.
industry_name
,
res_two
=
[{
"chain_name"
:
chain_two_obj
.
industry_name
,
...
@@ -152,13 +158,13 @@ def find_up_thr1(industry_type, industry_id):
...
@@ -152,13 +158,13 @@ def find_up_thr1(industry_type, industry_id):
for
item
in
res_two
:
for
item
in
res_two
:
pname_two
=
item
pname_two
=
item
chain_name
2
=
pname_two
[
"chain_name"
]
chain_name
=
pname_two
[
"chain_name"
]
company_count
=
get_count
(
chain_name
2
)
company_count
=
get_count
(
chain_name
)
total_count
+=
company_count
total_count
+=
company_count
# 二级
# 二级
node_two
=
{
node_two
=
{
"node"
:
"{}"
.
format
(
chain_name
2
),
"node"
:
"{}"
.
format
(
chain_name
),
"level"
:
3
,
"level"
:
3
,
"company_count"
:
company_count
,
"company_count"
:
company_count
,
"subNodeList"
:
[]
"subNodeList"
:
[]
...
@@ -170,25 +176,18 @@ def find_up_thr1(industry_type, industry_id):
...
@@ -170,25 +176,18 @@ def find_up_thr1(industry_type, industry_id):
}
for
chain_three_obj
in
chain_three_obj_list
]
}
for
chain_three_obj
in
chain_three_obj_list
]
for
itm
in
res_three
:
for
itm
in
res_three
:
pname_thr
=
itm
pname_thr
=
itm
chain_name
3
=
pname_thr
[
"chain_name"
]
chain_name
=
pname_thr
[
"chain_name"
]
company_count
=
get_count
(
chain_name
3
)
company_count
=
get_count
(
chain_name
)
total_count
+=
company_count
total_count
+=
company_count
# 三级
# 三级
node_thr
=
{
node_thr
=
{
"node"
:
"{}"
.
format
(
chain_name
3
),
"node"
:
"{}"
.
format
(
chain_name
),
"level"
:
4
,
"level"
:
4
,
"company_count"
:
company_count
,
"company_count"
:
company_count
,
"subNodeList"
:
[]
"subNodeList"
:
[]
}
}
node_two
[
"subNodeList"
]
.
append
(
node_thr
)
node_two
[
"subNodeList"
]
.
append
(
node_thr
)
# 一级
node_one
=
{
"node"
:
"{}"
.
format
(
chain_name1
),
"level"
:
2
,
"company_count"
:
total_count
,
"subNodeList"
:
[]
}
node_one
[
"subNodeList"
]
.
append
(
node_two
)
node_one
[
"subNodeList"
]
.
append
(
node_two
)
data
[
"subNodeList"
]
.
append
(
node_one
)
data
[
"subNodeList"
]
.
append
(
node_one
)
return
data
return
data
...
...
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