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
ec3d4ea3
Commit
ec3d4ea3
authored
Dec 08, 2022
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20221208
parent
2f07ed92
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
265 additions
and
121 deletions
+265
-121
apps/view_atlas/view.py
+155
-19
apps/view_map/view.py
+109
-99
apps/view_radar/view.py
+0
-2
apps/view_user/view.py
+1
-1
No files found.
apps/view_atlas/view.py
View file @
ec3d4ea3
...
...
@@ -157,9 +157,9 @@ def industry_resource():
if
select_flag
==
1
:
# 高等院校
try
:
if
industry_level
==
1
:
college
=
College
.
query
.
filter
(
College
.
navigator
.
like
(
"
%
{}
%
"
.
format
(
name
)))
else
:
college
=
College
.
query
.
filter
(
College
.
navigat
.
like
(
"
%
{}
%
"
.
format
(
name
)))
# else:
# college = College.query.filter(College.navigat.like("%{}%".format(name)))
size
=
college
.
count
()
college
=
college
.
paginate
(
page
,
perpage
)
.
items
...
...
@@ -196,9 +196,9 @@ def industry_resource():
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"查询成功"
,
data
=
data
)
elif
select_flag
==
3
:
# 创新平台3
if
industry_level
==
1
:
lab
=
Lab
.
query
.
filter
(
Lab
.
navigator
.
like
(
"
%
{}
%
"
.
format
(
name
)))
else
:
lab
=
Lab
.
query
.
filter
(
Lab
.
navigat
.
like
(
"
%
{}
%
"
.
format
(
name
)))
# else:
# lab = Lab.query.filter(Lab.navigat.like("%{}%".format(name)))
size
=
lab
.
count
()
lab
=
lab
.
paginate
(
page
,
perpage
)
.
items
data
=
{
"df"
:
[{
"id"
:
i
.
id
,
...
...
@@ -798,14 +798,14 @@ def industry_enterprise():
if
product
:
company
=
company
.
filter
(
Company
.
product_all
.
like
(
"
%
{}
%
"
.
format
(
product
)))
company
=
company
.
filter
(
Company
.
high_new
==
'1'
if
aptitude
==
'
是否
高新技术企业'
else
text
(
''
),
Company
.
tbe
==
'1'
if
aptitude
==
'
是否
科技型中小企业'
else
text
(
''
),
Company
.
quoted_company
==
'1'
if
aptitude
==
'
是否
上市企业'
else
text
(
''
),
Company
.
sxmon
==
'1'
if
aptitude
==
'
是否
山西民营100强'
else
text
(
''
),
Company
.
zjtg
==
'1'
if
aptitude
==
'
是否
为山西专精特新企业'
else
text
(
''
),
Company
.
high_new
==
'1'
if
aptitude
==
'高新技术企业'
else
text
(
''
),
Company
.
tbe
==
'1'
if
aptitude
==
'科技型中小企业'
else
text
(
''
),
Company
.
quoted_company
==
'1'
if
aptitude
==
'上市企业'
else
text
(
''
),
Company
.
sxmon
==
'1'
if
aptitude
==
'山西民营100强'
else
text
(
''
),
Company
.
zjtg
==
'1'
if
aptitude
==
'为山西专精特新企业'
else
text
(
''
),
Company
.
unicorn
==
'1'
if
aptitude
==
'独角兽企业'
else
text
(
''
),
Company
.
dengl
==
'1'
if
aptitude
==
'瞪羚'
else
text
(
''
),
Company
.
isfive
==
'1'
if
aptitude
==
'
是否
中国500强'
else
text
(
''
),
Company
.
isfive
==
'1'
if
aptitude
==
'中国500强'
else
text
(
''
),
Company
.
scale
==
'1'
if
aptitude
==
'规模以上企业'
else
text
(
''
),
Company
.
serve
==
'1'
if
aptitude
==
'限额以上服务业'
else
text
(
''
),
)
...
...
@@ -822,14 +822,14 @@ def industry_enterprise():
"address"
:
i
.
address
,
"telephone"
:
i
.
telephone
,
"hosts"
:
'企业热度'
if
i
.
hots
else
''
,
"high_new"
:
'
是否
高新技术企业'
if
i
.
high_new
==
'1'
else
''
,
"tbe"
:
'
是否
科技型中小企业'
if
i
.
tbe
==
'1'
else
''
,
"quoted_company"
:
'
是否
上市企业'
if
i
.
quoted_company
==
'1'
else
''
,
"sxmon"
:
'
是否
山西民营100强'
if
i
.
sxmon
==
'1'
else
''
,
"zjtg"
:
'
是否
为山西专精特新企业'
if
i
.
zjtg
==
'1'
else
''
,
"high_new"
:
'高新技术企业'
if
i
.
high_new
==
'1'
else
''
,
"tbe"
:
'科技型中小企业'
if
i
.
tbe
==
'1'
else
''
,
"quoted_company"
:
'上市企业'
if
i
.
quoted_company
==
'1'
else
''
,
"sxmon"
:
'山西民营100强'
if
i
.
sxmon
==
'1'
else
''
,
"zjtg"
:
'为山西专精特新企业'
if
i
.
zjtg
==
'1'
else
''
,
"unicorn"
:
'独角兽企业'
if
i
.
unicorn
==
'1'
else
''
,
"dengl"
:
'瞪羚'
if
i
.
dengl
==
'1'
else
''
,
"isfive"
:
'
是否
中国500强'
if
i
.
isfive
==
'1'
else
''
,
"isfive"
:
'中国500强'
if
i
.
isfive
==
'1'
else
''
,
"scale"
:
'规模以上企业'
if
i
.
scale
==
'1'
else
''
,
"serve"
:
'限额以上服务业'
if
i
.
serve
==
'1'
else
''
}
for
i
in
companys
]
...
...
@@ -901,9 +901,145 @@ def indu_collect():
indu
=
Industry
.
query
.
filter_by
(
nid
=
_id
)
.
first
()
user
.
industry
.
remove
(
indu
)
db
.
session
.
commit
()
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"取消
收藏
"
,
collect
=
"2"
)
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"取消
成功
"
,
collect
=
"2"
)
else
:
return
jsonify
(
code
=
RET
.
DATAERR
,
msg
=
"参数异常"
)
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
\ No newline at end of file
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
"""骨干企业散点图色块图"""
# 颜色计数
def
jishu
(
num
):
if
num
>=
0
and
num
<=
50
:
return
"#72D4F1"
if
num
>
50
and
num
<=
100
:
return
"#00BAF6"
if
num
>
100
and
num
<=
200
:
return
"#4F9FFF"
if
num
>
200
and
num
<=
500
:
return
"#4265F6"
if
num
>
500
and
num
<=
1000
:
return
"#0052d6"
if
num
>
1000
:
return
"#0245AE"
# 招商地图下的色块图(同右侧得数量分布饼图)
@api_atlas.route
(
'/AttractMap'
,
methods
=
[
'POST'
])
# @login_required
def
attract_map
():
'''招商地图'''
req_dict
=
request
.
get_json
()
inid
=
req_dict
.
get
(
"inid"
)
# 行业id
province
=
req_dict
.
get
(
"province"
)
city
=
req_dict
.
get
(
"city"
)
district
=
req_dict
.
get
(
"district"
)
product
=
req_dict
.
get
(
"product"
)
# 产业产品选择
try
:
enterprise
=
Company
.
query
.
filter_by
(
c_type
=
inid
)
if
product
:
enterprise
=
enterprise
.
filter
(
Company
.
product_all
.
like
(
"
%
{}
%
"
.
format
(
product
)))
# print(enterprise)
df
=
list
()
if
not
province
:
# 全国,省数据
provinces
=
Company
.
query
.
with_entities
(
Company
.
province
)
.
distinct
()
.
all
()
provinces
=
[
i
[
0
]
for
i
in
provinces
if
i
[
0
]]
# 拿到省份的无重复值
for
pro
in
provinces
:
num
=
enterprise
.
filter_by
(
province
=
pro
)
.
count
()
province_data
=
Company
.
query
.
filter_by
(
province
=
pro
)
.
first
()
df
.
append
({
"name"
:
pro
,
"value"
:
num
,
"color"
:
jishu
(
num
),
"jwd"
:
{
"lng"
:
province_data
.
p_lng
,
"lat"
:
province_data
.
p_lat
}})
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
df
)
if
province
and
not
city
:
# 省-》市数据
cities
=
Company
.
query
.
filter_by
(
province
=
province
)
.
with_entities
(
Company
.
city
)
.
distinct
()
.
all
()
cities
=
[
i
[
0
]
for
i
in
cities
if
i
[
0
]]
# 拿到城市的无重复值
for
cit
in
cities
:
num
=
enterprise
.
filter_by
(
province
=
province
,
city
=
cit
)
.
count
()
city_data
=
Company
.
query
.
filter_by
(
province
=
province
,
city
=
cit
)
.
first
()
df
.
append
({
"name"
:
cit
,
"value"
:
num
,
"color"
:
jishu
(
num
),
"jwd"
:
{
"lng"
:
city_data
.
c_lng
,
"lat"
:
city_data
.
c_lat
}})
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
df
)
if
province
and
city
and
not
district
:
# 市-》区数据
districts
=
Company
.
query
.
filter_by
(
province
=
province
,
city
=
city
)
.
with_entities
(
Company
.
district
)
.
distinct
()
.
all
()
districts
=
[
i
[
0
]
for
i
in
districts
if
i
[
0
]]
# 拿到区县的无重复值
for
dis
in
districts
:
num
=
enterprise
.
filter_by
(
province
=
province
,
city
=
city
,
district
=
dis
)
.
count
()
district_data
=
Company
.
query
.
filter_by
(
province
=
province
,
city
=
city
,
district
=
dis
)
.
first
()
df
.
append
({
"name"
:
dis
,
"value"
:
num
,
"color"
:
jishu
(
num
),
"jwd"
:
{
"lng"
:
district_data
.
d_lng
,
"lat"
:
district_data
.
d_lat
}})
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
df
)
if
province
and
city
and
district
:
# 区数据
num
=
enterprise
.
filter_by
(
province
=
province
,
city
=
city
,
district
=
district
)
.
count
()
district_data
=
Company
.
query
.
filter_by
(
province
=
province
,
city
=
city
,
district
=
district
)
.
first
()
print
(
district_data
)
if
district_data
:
df
.
append
({
"name"
:
district
,
"value"
:
num
,
"color"
:
""
,
"jwd"
:
{
"lng"
:
district_data
.
d_lng
,
"lat"
:
district_data
.
d_lat
}})
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
df
)
else
:
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"无满足条件数据"
,
data
=
df
)
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
# 招商地图下的散点图(至区后)
@api_atlas.route
(
'/AttractSdmap'
,
methods
=
[
'POST'
])
# @login_required
def
attract_sdmap
():
'''招商地图'''
req_dict
=
request
.
get_json
()
inid
=
req_dict
.
get
(
"inid"
)
# 行业id
province
=
req_dict
.
get
(
"province"
)
city
=
req_dict
.
get
(
"city"
)
district
=
req_dict
.
get
(
"district"
)
product
=
req_dict
.
get
(
"product"
)
# 产业产品选择
# 校验参数完整性
if
not
all
([
district
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
try
:
if
inid
:
enterprise
=
Company
.
query
.
filter_by
(
c_type
=
inid
)
else
:
enterprise
=
Company
.
query
.
filter_by
()
if
district
:
enterprise
=
enterprise
.
filter_by
(
province
=
province
,
city
=
city
,
district
=
district
)
if
product
:
enterprise
=
enterprise
.
filter
(
Company
.
product_all
.
like
(
"
%
{}
%
"
.
format
(
product
)))
enterprise
=
enterprise
.
all
()
data
=
[]
if
enterprise
:
for
com
in
enterprise
:
data
.
append
({
"id"
:
com
.
id
,
"name"
:
com
.
company_name
,
"jwd"
:
{
"lng"
:
com
.
lng
,
# 企业地址出的经纬度
"lat"
:
com
.
lat
}
})
# 上下中游
else
:
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取失败,无数据"
,
data
=
data
)
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
\ No newline at end of file
apps/view_map/view.py
View file @
ec3d4ea3
from
flask
import
g
,
current_app
,
request
,
jsonify
,
session
from
sqlalchemy
import
or_
from
apps.view_map
import
api_map
from
apps.util
import
login_required
,
verify_token
from
apps.utils.response_code
import
RET
...
...
@@ -54,7 +56,7 @@ def attract_map():
province_data
=
Enterprise
.
query
.
filter_by
(
province
=
pro
)
.
first
()
df
.
append
({
"name"
:
pro
,
"value"
:
num
,
#
"color": jishu(num),
"color"
:
jishu
(
num
),
"jwd"
:
{
"lng"
:
province_data
.
p_lng
,
"lat"
:
province_data
.
p_lat
}})
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
df
)
...
...
@@ -66,7 +68,7 @@ def attract_map():
city_data
=
Enterprise
.
query
.
filter_by
(
province
=
province
,
city
=
cit
)
.
first
()
df
.
append
({
"name"
:
cit
,
"value"
:
num
,
#
"color": jishu(num),
"color"
:
jishu
(
num
),
"jwd"
:
{
"lng"
:
city_data
.
c_lng
,
"lat"
:
city_data
.
c_lat
}})
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
df
)
...
...
@@ -79,7 +81,7 @@ def attract_map():
district_data
=
Enterprise
.
query
.
filter_by
(
province
=
province
,
city
=
city
,
district
=
dis
)
.
first
()
df
.
append
({
"name"
:
dis
,
"value"
:
num
,
#
"color": jishu(num),
"color"
:
jishu
(
num
),
"jwd"
:
{
"lng"
:
district_data
.
d_lng
,
"lat"
:
district_data
.
d_lat
}})
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
df
)
...
...
@@ -90,7 +92,7 @@ def attract_map():
if
district_data
:
df
.
append
({
"name"
:
district
,
"value"
:
num
,
#
"color": "",
"color"
:
""
,
"jwd"
:
{
"lng"
:
district_data
.
d_lng
,
"lat"
:
district_data
.
d_lat
}})
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
df
)
else
:
...
...
@@ -164,104 +166,55 @@ def enterprise():
太原市企业列表
:return:
'''
# req_dict = request.get_json()
# inid = req_dict.get("inid") # 行业id
# page = req_dict.get("page") # 分页页码
# perpage = req_dict.get("perpage") # 分页大小
# province = req_dict.get("province")
# city = req_dict.get("city")
# district = req_dict.get("district")
# product = req_dict.get("product") # 产业产品选择
#
# if not all([page, perpage]):
# return jsonify(code=RET.PARAMERR, msg="参数不完整")
#
# try:
# if inid: # 子行业分类
# enterprise = Enterprise.query.filter_by(c_type=inid)
# else:
# enterprise = Enterprise.query.filter_by()
# # 区域选择
# if province:
# enterprise = enterprise.filter_by(province=province)
# if city:
# enterprise = enterprise.filter_by(city=city)
# if district:
# enterprise = enterprise.filter_by(district=district)
# if product:
# enterprise = enterprise.filter(Enterprise.product_all.like("%{}%".format(product)))
# size = enterprise.count()
# enterprise = enterprise.order_by(Enterprise.hots.desc()).paginate(page, perpage).items # 企业热度倒序
#
# df = [{"id": i.id,
# "company_name": i.company_name,
# "hots": i.hots,
# "aptitude": ['是否高新技术企业' if i.high_new == '1' else
# '是否科技型中小企业' if i.tbe == '1' else
# '是否上市企业' if i.quoted_company == '1' else
# '是否山西民营100强' if i.sxmon == '1' else
# '是否为山西专精特新企业' if i.zjtg == '1' else
# '独角兽企业' if i.unicorn == '1' else
# '瞪羚' if i.dengl == '1' else
# '是否中国500强' if i.isfive == '1' else
# '规模以上企业' if i.scale == '1' else
# '限额以上服务业' if i.serve == '1' else '']
# } for i in enterprise]
# data = {"size": size, "df": df}
# except Exception as e:
# current_app.logger.error(e)
# return jsonify(code=RET.DBERR, msg="数据库查询错误")
#
# return jsonify(code=RET.OK, msg="获取成功", data=data)
req_dic
=
request
.
get_json
()
entype
=
req_dic
[
'entype'
]
aptitude
=
req_dic
[
'aptitude'
]
# 资质
company_name
=
req_dic
[
'company_name'
]
status
=
req_dic
[
'status'
]
page
=
req_dic
[
'page'
]
per_page
=
req_dic
[
'per_page'
]
req_dict
=
request
.
get_json
()
inid
=
req_dict
.
get
(
"inid"
)
# 行业id
page
=
req_dict
.
get
(
"page"
)
# 分页页码
perpage
=
req_dict
.
get
(
"perpage"
)
# 分页大小
province
=
req_dict
.
get
(
"province"
)
city
=
req_dict
.
get
(
"city"
)
district
=
req_dict
.
get
(
"district"
)
product
=
req_dict
.
get
(
"product"
)
# 产业产品选择
try
:
enterprise_obj
=
Enterprise
.
query
.
filter
(
or_
(
Enterprise
.
entype
==
entype
,
Enterprise
.
company_name
.
like
(
'
%
{}
%
'
.
format
(
company_name
)),
Enterprise
.
status
==
status
,
Enterprise
.
high_new
==
'1'
if
aptitude
==
'是否高新技术企业'
else
text
(
''
),
Enterprise
.
tbe
==
'1'
if
aptitude
==
'是否科技型中小企业'
else
text
(
''
),
Enterprise
.
quoted_company
==
'1'
if
aptitude
==
'是否上市企业'
else
text
(
''
),
Enterprise
.
sxmon
==
'1'
if
aptitude
==
'是否山西民营100强'
else
text
(
''
),
Enterprise
.
zjtg
==
'1'
if
aptitude
==
'是否为山西专精特新企业'
else
text
(
''
),
Enterprise
.
unicorn
==
'1'
if
aptitude
==
'独角兽企业'
else
text
(
''
),
Enterprise
.
dengl
==
'1'
if
aptitude
==
'瞪羚'
else
text
(
''
),
Enterprise
.
isfive
==
'1'
if
aptitude
==
'是否中国500强'
else
text
(
''
),
Enterprise
.
scale
==
'1'
if
aptitude
==
'规模以上企业'
else
text
(
''
),
Enterprise
.
serve
==
'1'
if
aptitude
==
'限额以上服务业'
else
text
(
''
),
))
size
=
enterprise_obj
.
count
()
if
not
all
([
page
,
perpage
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
enterprise_obj_list
=
enterprise_obj
.
paginate
(
page
,
per_page
)
.
items
data
=
[{
"id"
:
enterprise_obj
.
id
,
"enterprise_name"
:
enterprise_obj
.
enterprise_name
,
"district"
:
enterprise_obj
.
district
,
"entype"
:
enterprise_obj
.
entype
,
"aptitude"
:
[
"是否高新技术企业"
if
enterprise_obj
.
high_new
==
'1'
else
"是否科技型中小企业"
if
enterprise_obj
.
tbe
==
'1'
else
"是否上市企业"
if
enterprise_obj
.
quoted_company
==
'1'
else
"是否山西民营100强"
if
enterprise_obj
.
sxmon
==
'1'
else
"是否为山西专精特新企业"
if
enterprise_obj
.
zjtg
==
'1'
else
"独角兽企业"
if
enterprise_obj
.
unicorn
==
'1'
else
"瞪羚"
if
enterprise_obj
.
dengl
==
'1'
else
"是否中国500强"
if
enterprise_obj
.
isfive
==
'1'
else
"规模以上企业"
if
enterprise_obj
.
scale
==
'1'
else
"限额以上服务业"
if
enterprise_obj
.
serve
==
'1'
else
''
]
}
for
enterprise_obj
in
enterprise_obj_list
]
data
=
{
"size"
:
size
,
"df"
:
data
}
try
:
if
inid
:
# 子行业分类
enterprise
=
Enterprise
.
query
.
filter_by
(
c_type
=
inid
)
else
:
enterprise
=
Enterprise
.
query
.
filter_by
()
# 区域选择
if
province
:
enterprise
=
enterprise
.
filter_by
(
province
=
province
)
if
city
:
enterprise
=
enterprise
.
filter_by
(
city
=
city
)
if
district
:
enterprise
=
enterprise
.
filter_by
(
district
=
district
)
if
product
:
enterprise
=
enterprise
.
filter
(
Enterprise
.
product_all
.
like
(
"
%
{}
%
"
.
format
(
product
)))
size
=
enterprise
.
count
()
enterprise
=
enterprise
.
order_by
(
Enterprise
.
hots
.
desc
())
.
paginate
(
page
,
perpage
)
.
items
# 企业热度倒序
return
jsonify
(
code
=
RET
.
OK
,
data
=
data
,
msg
=
'查询成功。'
)
df
=
[{
"id"
:
i
.
id
,
"company_name"
:
i
.
company_name
,
"hots"
:
i
.
hots
,
"aptitude"
:
[
'是否高新技术企业'
if
i
.
high_new
==
'1'
else
'是否科技型中小企业'
if
i
.
tbe
==
'1'
else
'是否上市企业'
if
i
.
quoted_company
==
'1'
else
'是否山西民营100强'
if
i
.
sxmon
==
'1'
else
'是否为山西专精特新企业'
if
i
.
zjtg
==
'1'
else
'独角兽企业'
if
i
.
unicorn
==
'1'
else
'瞪羚'
if
i
.
dengl
==
'1'
else
'是否中国500强'
if
i
.
isfive
==
'1'
else
'规模以上企业'
if
i
.
scale
==
'1'
else
'限额以上服务业'
if
i
.
serve
==
'1'
else
''
]
}
for
i
in
enterprise
]
data
=
{
"size"
:
size
,
"df"
:
df
}
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
'查询出错!'
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
# 招商地图下的散点图(至区后)
...
...
@@ -305,4 +258,61 @@ def attract_sdmap():
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
\ No newline at end of file
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
"""以下为202212月改版后需求新增"""
# 企业搜索
@api_map.route
(
'/SearchEnterprises'
,
methods
=
[
'POST'
])
def
search_enterprise
():
req_dic
=
request
.
get_json
()
entype
=
req_dic
[
'entype'
]
aptitude
=
req_dic
[
'aptitude'
]
# 资质
company_name
=
req_dic
[
'company_name'
]
status
=
req_dic
[
'status'
]
page
=
req_dic
[
'page'
]
per_page
=
req_dic
[
'per_page'
]
try
:
enterprise_obj
=
Enterprise
.
query
.
filter
(
or_
(
Enterprise
.
entype
==
entype
,
Enterprise
.
company_name
.
like
(
'
%
{}
%
'
.
format
(
company_name
)),
Enterprise
.
status
==
status
,
Enterprise
.
high_new
==
'1'
if
aptitude
==
'是否高新技术企业'
else
text
(
''
),
Enterprise
.
tbe
==
'1'
if
aptitude
==
'是否科技型中小企业'
else
text
(
''
),
Enterprise
.
quoted_company
==
'1'
if
aptitude
==
'是否上市企业'
else
text
(
''
),
Enterprise
.
sxmon
==
'1'
if
aptitude
==
'是否山西民营100强'
else
text
(
''
),
Enterprise
.
zjtg
==
'1'
if
aptitude
==
'是否为山西专精特新企业'
else
text
(
''
),
Enterprise
.
unicorn
==
'1'
if
aptitude
==
'独角兽企业'
else
text
(
''
),
Enterprise
.
dengl
==
'1'
if
aptitude
==
'瞪羚'
else
text
(
''
),
Enterprise
.
isfive
==
'1'
if
aptitude
==
'是否中国500强'
else
text
(
''
),
Enterprise
.
scale
==
'1'
if
aptitude
==
'规模以上企业'
else
text
(
''
),
Enterprise
.
serve
==
'1'
if
aptitude
==
'限额以上服务业'
else
text
(
''
),
))
size
=
enterprise_obj
.
count
()
enterprise_obj_list
=
enterprise_obj
.
paginate
(
page
,
per_page
)
.
items
data
=
[{
"id"
:
enterprise_obj
.
id
,
"enterprise_name"
:
enterprise_obj
.
enterprise_name
,
"district"
:
enterprise_obj
.
district
,
"entype"
:
enterprise_obj
.
entype
,
"aptitude"
:
[
"是否高新技术企业"
if
enterprise_obj
.
high_new
==
'1'
else
"是否科技型中小企业"
if
enterprise_obj
.
tbe
==
'1'
else
"是否上市企业"
if
enterprise_obj
.
quoted_company
==
'1'
else
"是否山西民营100强"
if
enterprise_obj
.
sxmon
==
'1'
else
"是否为山西专精特新企业"
if
enterprise_obj
.
zjtg
==
'1'
else
"独角兽企业"
if
enterprise_obj
.
unicorn
==
'1'
else
"瞪羚"
if
enterprise_obj
.
dengl
==
'1'
else
"是否中国500强"
if
enterprise_obj
.
isfive
==
'1'
else
"规模以上企业"
if
enterprise_obj
.
scale
==
'1'
else
"限额以上服务业"
if
enterprise_obj
.
serve
==
'1'
else
''
]
}
for
enterprise_obj
in
enterprise_obj_list
]
data
=
{
"size"
:
size
,
"df"
:
data
}
return
jsonify
(
code
=
RET
.
OK
,
data
=
data
,
msg
=
'查询成功。'
)
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
'查询出错!'
)
\ No newline at end of file
apps/view_radar/view.py
View file @
ec3d4ea3
...
...
@@ -465,13 +465,11 @@ def radar_enums():
# 校验参数完整性
if
not
all
([
inid
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
try
:
# name_query = "radar" + str(inid) + str("".join(area)) + str(product)
# if redis_store.get(name_query) is not None:
# data = json.loads(redis_store.get(name_query))
# return jsonify(code=RET.OK, msg="获取成功", data=data)
enterprise
=
Enterprise
.
query
.
filter_by
(
c_type
=
inid
)
num_all
=
enterprise
.
count
()
# 企业列表选择 1234567 500强企业-上市企业-高新技术企业-专精特新企业-独角兽企业--瞪羚企业-科技型中小企业
...
...
apps/view_user/view.py
View file @
ec3d4ea3
...
...
@@ -90,7 +90,7 @@ def back_login():
param
=
req_dict
.
get
(
"param"
)
# 揭秘参数
req_dict
=
json
.
loads
(
decrypt
(
param
))
# name = req_dict.get('name')
name
=
req_dict
.
get
(
'
mobil
e'
)
name
=
req_dict
.
get
(
'
nam
e'
)
password
=
req_dict
.
get
(
'password'
)
# 校验参数完整性
...
...
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