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
672251b1
Commit
672251b1
authored
Jan 04, 2022
by
赵宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'fix'
parent
fa9bbc3e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
apps/atlas/view_graph.py
+6
-4
apps/utils/neo4j_conn.py
+3
-2
No files found.
apps/atlas/view_graph.py
View file @
672251b1
...
@@ -141,12 +141,13 @@ def industry_enterprise():
...
@@ -141,12 +141,13 @@ def industry_enterprise():
req_dict
=
request
.
get_json
()
req_dict
=
request
.
get_json
()
inid
=
req_dict
.
get
(
"inid"
)
# 行业id
inid
=
req_dict
.
get
(
"inid"
)
# 行业id
industry_level
=
req_dict
.
get
(
"industry_level"
)
# 行业等级,(父行个为"1",子行业为"2")
industry_level
=
req_dict
.
get
(
"industry_level"
)
# 行业等级,(父行个为"1",子行业为"2")
product
=
req_dict
.
get
(
"product"
)
page
=
req_dict
.
get
(
"page"
)
# 分页页码
page
=
req_dict
.
get
(
"page"
)
# 分页页码
perpage
=
req_dict
.
get
(
"perpage"
)
# 分页大小
perpage
=
req_dict
.
get
(
"perpage"
)
# 分页大小
# sorts = req_dict.get("sorts") # 排序 sorts "1"按时间降序 ,“2”按热度降序
# sorts = req_dict.get("sorts") # 排序 sorts "1"按时间降序 ,“2”按热度降序
# 校验参数完整性
# 校验参数完整性
if
not
all
([
in
id
,
in
dustry_level
,
page
,
perpage
]):
if
not
all
([
industry_level
,
page
,
perpage
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
try
:
try
:
...
@@ -154,10 +155,11 @@ def industry_enterprise():
...
@@ -154,10 +155,11 @@ def industry_enterprise():
company
=
Company
.
query
.
filter_by
(
f_type
=
inid
,
city
=
"晋城市"
)
company
=
Company
.
query
.
filter_by
(
f_type
=
inid
,
city
=
"晋城市"
)
else
:
else
:
company
=
Company
.
query
.
filter_by
(
c_type
=
inid
,
city
=
"晋城市"
)
company
=
Company
.
query
.
filter_by
(
c_type
=
inid
,
city
=
"晋城市"
)
if
product
:
company
=
Company
.
query
.
filter
(
Company
.
product_all
.
like
(
"
%
{}
%
"
.
format
(
product
)))
size
=
company
.
count
()
size
=
company
.
count
()
# if sorts == 1:
# companys = company.order_by(Company.build_date.desc()).paginate(page, perpage).items # 企业热度倒序
# else:
companys
=
company
.
order_by
(
Company
.
hots
.
desc
())
.
paginate
(
page
,
perpage
)
.
items
# 企业热度倒序
companys
=
company
.
order_by
(
Company
.
hots
.
desc
())
.
paginate
(
page
,
perpage
)
.
items
# 企业热度倒序
df
=
[{
"id"
:
i
.
id
,
df
=
[{
"id"
:
i
.
id
,
...
...
apps/utils/neo4j_conn.py
View file @
672251b1
...
@@ -2,8 +2,9 @@ from py2neo import Graph
...
@@ -2,8 +2,9 @@ from py2neo import Graph
def
conn_neo4j
():
def
conn_neo4j
():
# graph = Graph("http://localhost:7474", username="neo4j", password="123456")
# graph = Graph("http://localhost:7474", username="neo4j", password="123456") # 本地neo4j
graph
=
Graph
(
"http://localhost:7476"
,
username
=
"neo4j"
,
password
=
"123456"
)
graph
=
Graph
(
"http://localhost:7476"
,
username
=
"neo4j"
,
password
=
"123456"
)
# 上传到50服务器前需更改
# graph = Graph("http://39.100.39.50:7476/", username="neo4j", password="123456") # 测试50服务器上的neo4j时使用
return
graph
return
graph
...
...
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