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
2e1140de
Commit
2e1140de
authored
Mar 31, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20230331
parent
119e1bfc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
16 deletions
+24
-16
apps/view_360company/view.py
+2
-3
apps/view_atlas/view.py
+4
-4
apps/view_map/view.py
+18
-9
No files found.
apps/view_360company/view.py
View file @
2e1140de
...
...
@@ -264,9 +264,8 @@ def search():
try
:
es
=
Elasticsearch
([{
'host'
:
'39.100.39.50'
,
'port'
:
9200
}])
# data = es.search(index="jincheng_pictext_index_202301131004_a6181e52", body=body)
# data = es.search(index="jincheng_pictext_index_202302281056_9053decc", body=body)
data
=
es
.
search
(
index
=
"jincheng_pictext_index_202303161620_76c624b8"
,
body
=
body
)
# data = es.search(index="jincheng_pictext_index_202303161620_76c624b8", body=body)
data
=
es
.
search
(
index
=
"jc_enterperise1"
,
body
=
body
)
data_list
=
[]
# print(data_list)
size
=
data
[
"hits"
][
'total'
]
...
...
apps/view_atlas/view.py
View file @
2e1140de
...
...
@@ -1108,7 +1108,7 @@ def search_enterprise():
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
'查询出错!'
)
def
get_
company
_li
(
product
):
def
get_
product
_li
(
product
):
res_two_li
=
[]
res_three_li
=
[]
product_id
=
IndustryChain
.
query
.
filter_by
(
industry_name
=
product
)
.
first
()
.
id
...
...
@@ -1189,7 +1189,7 @@ def industry_enterprise():
if
product
:
# 点击上级环节,展示本级所有企业
product_li
=
get_
company
_li
(
product
)
product_li
=
get_
product
_li
(
product
)
company1
=
[]
for
product
in
product_li
:
company2
=
''
...
...
@@ -1199,8 +1199,8 @@ def industry_enterprise():
company1
+=
company2
company1
=
set
(
company1
)
size
=
len
(
company1
)
company1
=
sorted
(
company1
,
key
=
lambda
x
:
x
.
hots
,
reverse
=
True
)
companys
=
company1
[(
page
-
1
)
*
perpage
:
page
*
perpage
]
company1
=
sorted
(
company1
,
key
=
lambda
x
:
x
.
hots
,
reverse
=
True
)
# 排序
companys
=
company1
[(
page
-
1
)
*
perpage
:
page
*
perpage
]
# 分页
# companys = company1.order_by(Company.hots.desc()).paginate(page, perpage).items # 企业热度倒序
else
:
...
...
apps/view_map/view.py
View file @
2e1140de
...
...
@@ -11,6 +11,7 @@ import json
import
requests
from
apps
import
db
,
constants
,
redis_store
from
apps.view_360company.view
import
create_body
from
view_atlas.view
import
get_product_li
'''本页接口使用全国企业库enterprise'''
graph
=
conn_neo4j
()
...
...
@@ -417,12 +418,6 @@ def attract_enterprise():
Enterprise
.
c_type1
==
inid
,
Enterprise
.
c_type2
==
inid
))
if
product
:
enterprise
=
enterprise
.
filter
(
or_
(
Enterprise
.
product_all
.
like
(
"
%
{}
%
"
.
format
(
product
)),
Enterprise
.
product_all1
.
like
(
"
%
{}
%
"
.
format
(
product
)),
Enterprise
.
product_all2
.
like
(
"
%
{}
%
"
.
format
(
product
))
))
enterprise_obj
=
enterprise
.
filter
(
# Enterprise.product_all.like("%{}%".format(product)) if product else text(''),
...
...
@@ -445,9 +440,23 @@ def attract_enterprise():
Enterprise
.
chain_master
==
'1'
if
qualificat
==
'链主企业'
else
text
(
''
),
Enterprise
.
serve
==
'1'
if
qualificat
==
'限额以上服务业企业'
else
text
(
''
)
)
size
=
enterprise_obj
.
count
()
enterprise_obj_list
=
enterprise_obj
.
order_by
(
Enterprise
.
hots
.
desc
())
.
paginate
(
page
,
perpage
)
.
items
if
product
:
company1
=
[]
product_li
=
get_product_li
(
product
)
for
product
in
product_li
:
enterprise
=
enterprise
.
filter
(
or_
(
Enterprise
.
product_all
.
like
(
"
%
{}
%
"
.
format
(
product
)),
Enterprise
.
product_all1
.
like
(
"
%
{}
%
"
.
format
(
product
)),
Enterprise
.
product_all2
.
like
(
"
%
{}
%
"
.
format
(
product
))
))
.
all
()
company1
+=
enterprise
company1
=
set
(
company1
)
size
=
len
(
company1
)
company1
=
sorted
(
company1
,
key
=
lambda
x
:
x
.
hots
,
reverse
=
True
)
# 排序
enterprise_obj_list
=
company1
[(
page
-
1
)
*
perpage
:
page
*
perpage
]
# 分页
else
:
size
=
enterprise_obj
.
count
()
enterprise_obj_list
=
enterprise_obj
.
order_by
(
Enterprise
.
hots
.
desc
())
.
paginate
(
page
,
perpage
)
.
items
df
=
[{
"id"
:
i
.
id
,
"company_name"
:
i
.
company_name
,
...
...
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