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
fe778d81
Commit
fe778d81
authored
Feb 25, 2022
by
赵宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20220225
parent
d7f90bba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
apps/utils/neo4j_conn.py
+2
-2
apps/view_atlas/view_es_con.py
+12
-6
No files found.
apps/utils/neo4j_conn.py
View file @
fe778d81
...
...
@@ -3,9 +3,9 @@ from py2neo import Graph
def
conn_neo4j
():
# graph = Graph("http://localhost:7474", username="neo4j", password="123456") # 本地neo4j
graph
=
Graph
(
"http://localhost:7476"
,
username
=
"neo4j"
,
password
=
"123456"
)
# 上传到50服务器前需更改
#
graph = Graph("http://localhost:7476", username="neo4j", password="123456") # 上传到50服务器前需更改
# graph = Graph("http://39.100.39.50:7476", username="neo4j", password="123456") # 测试50服务器上的neo4j时使用
#
graph = Graph("http://39.100.39.50:7475", username="neo4j", password="century-english-almanac-havana-golf-9040") # 太原的neo4j,测试是借用
graph
=
Graph
(
"http://39.100.39.50:7475"
,
username
=
"neo4j"
,
password
=
"century-english-almanac-havana-golf-9040"
)
# 太原的neo4j,测试是借用
return
graph
...
...
apps/view_atlas/view_es_con.py
View file @
fe778d81
...
...
@@ -5,6 +5,7 @@ from apps.view_atlas import api_atlas
from
apps.util
import
login_required
from
apps.utils.response_code
import
RET
from
apps.utils.neo4j_conn
import
conn_neo4j
from
..models
import
Enterprise
graph
=
conn_neo4j
()
...
...
@@ -369,14 +370,19 @@ def get_semic_map():
companys_return
=
json
.
loads
(
requests
.
post
(
url
=
url
,
json
=
body
)
.
text
)
companys
.
extend
([
i
[
"_source"
]
for
i
in
companys_return
[
"hits"
][
"hits"
]])
data
=
list
()
data
=
{}
supplier
=
list
()
if
companys
:
for
item
in
companys
:
data
.
append
({
"name"
:
item
[
"company_name"
],
"jwd"
:
{
"lng"
:
item
[
"lng"
],
# 园区地址出的经纬度
"lat"
:
item
[
"lat"
]}
})
supplier
.
append
({
"name"
:
item
[
"company_name"
],
"value"
:
[
item
[
"lng"
],
item
[
"lat"
]]
})
# 获取本公司的经纬度
enterprise
=
Enterprise
.
query
.
filter_by
(
company_name
=
company_name
)
.
first
()
enterprise_lng
=
enterprise
.
lng
enterprise_lat
=
enterprise
.
lat
data
[
'SupplyEnterprise'
]
=
[{
'name'
:
company_name
,
"value"
:
[
enterprise_lng
,
enterprise_lat
]}]
data
[
'supplier'
]
=
supplier
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
except
Exception
as
e
:
current_app
.
logger
.
error
(
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