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
552480b8
Commit
552480b8
authored
Mar 21, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20230319
parent
163efc05
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
apps/view_atlas/view_es_con.py
+5
-2
apps/view_index/view.py
+2
-1
No files found.
apps/view_atlas/view_es_con.py
View file @
552480b8
...
@@ -358,10 +358,13 @@ def get_semic_map():
...
@@ -358,10 +358,13 @@ def get_semic_map():
# 1、根据公司查询产品
# 1、根据公司查询产品
body
=
body_by_companyName
(
company_name
)
body
=
body_by_companyName
(
company_name
)
result_es
=
json
.
loads
(
requests
.
post
(
url
=
url
,
json
=
body
)
.
text
)
result_es
=
json
.
loads
(
requests
.
post
(
url
=
url
,
json
=
body
)
.
text
)
if
result_es
[
"status"
]
==
404
:
# if result_es["status"] == 404:
# return jsonify(code=RET.NODATA, msg="无相关供应链地图数据!")
try
:
products
=
list
(
set
([
i
[
"_source"
][
"product"
]
for
i
in
result_es
[
"hits"
][
"hits"
]]))
# 无需去重,最终数据不会出现重复项
except
:
return
jsonify
(
code
=
RET
.
NODATA
,
msg
=
"无相关供应链地图数据!"
)
return
jsonify
(
code
=
RET
.
NODATA
,
msg
=
"无相关供应链地图数据!"
)
products
=
list
(
set
([
i
[
"_source"
][
"product"
]
for
i
in
result_es
[
"hits"
][
"hits"
]]))
# 无需去重,最终数据不会出现重复项
# print("直接产品:", products)
# print("直接产品:", products)
# 2、查询上下游产品
# 2、查询上下游产品
products_center
=
list
()
products_center
=
list
()
...
...
apps/view_index/view.py
View file @
552480b8
...
@@ -1222,7 +1222,7 @@ def get_enterprise_patent():
...
@@ -1222,7 +1222,7 @@ def get_enterprise_patent():
# 校验参数完整性
# 校验参数完整性
if
not
all
([
id
]):
if
not
all
([
id
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
name_query
=
"GetEnterprisePatent"
+
str
(
id
)
name_query
=
"GetEnterprisePatent"
+
type
+
str
(
id
)
if
redis_store
.
get
(
name_query
)
is
not
None
:
if
redis_store
.
get
(
name_query
)
is
not
None
:
data
=
json
.
loads
(
redis_store
.
get
(
name_query
))
data
=
json
.
loads
(
redis_store
.
get
(
name_query
))
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
...
@@ -1249,6 +1249,7 @@ def get_enterprise_patent():
...
@@ -1249,6 +1249,7 @@ def get_enterprise_patent():
"inventor"
:
data
.
inventor
"inventor"
:
data
.
inventor
}
for
data
in
data_info9
if
data_info9
]
}
for
data
in
data_info9
if
data_info9
]
# redis缓存
# redis缓存
redis_store
.
setex
(
name_query
,
30
*
24
*
3600
,
json
.
dumps
(
data
))
redis_store
.
setex
(
name_query
,
30
*
24
*
3600
,
json
.
dumps
(
data
))
except
Exception
as
e
:
except
Exception
as
e
:
current_app
.
logger
.
error
(
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