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
565e6101
Commit
565e6101
authored
Dec 09, 2022
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20221209
parent
c0cbbe52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
2 deletions
+81
-2
apps/view_radar/view.py
+81
-2
No files found.
apps/view_radar/view.py
View file @
565e6101
...
...
@@ -1103,4 +1103,83 @@ def radar_enums():
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"获取成功"
,
data
=
data
)
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
=
"数据库查询错误"
)
# 具体类型企业列表查询
@api_radar.route
(
"/enterList"
,
methods
=
[
"POST"
])
def
newList
():
'''查看企业列表——外加详情'''
req_dict
=
request
.
get_json
()
inid
=
req_dict
.
get
(
"inid"
)
# 行业id
area
=
req_dict
.
get
(
"area"
)
# [省,市,区]
if
len
(
area
)
==
3
:
province
=
area
[
0
]
city
=
area
[
1
]
district
=
area
[
2
]
else
:
province
=
""
city
=
""
district
=
""
product
=
req_dict
.
get
(
"product"
)
# 企业产品
select
=
req_dict
.
get
(
"select"
)
# 企业列表选择 1234567 瞪羚-高新-科技型中小企业-上市-融资-独角兽-全部
page
=
req_dict
.
get
(
"page"
)
perpage
=
req_dict
.
get
(
"perpage"
)
name
=
req_dict
.
get
(
"name"
)
if
not
all
([
inid
,
select
,
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
)))
if
name
:
# 有可能会变成模糊查询
enterprise
=
enterprise
.
filter
(
Enterprise
.
company_name
.
like
(
"
%
{}
%
"
.
format
(
name
)))
if
select
==
"1"
:
# 瞪羚
remind
=
"瞪羚企业"
enterprise
=
enterprise
.
filter_by
(
dengl
=
"1"
)
elif
select
==
"2"
:
# 高新
remind
=
"高新技术企业"
enterprise
=
enterprise
.
filter_by
(
high_new
=
"1"
)
elif
select
==
"3"
:
# 科技型中小企业
remind
=
"科技型中小企业"
enterprise
=
enterprise
.
filter_by
(
tbe
=
"1"
)
elif
select
==
"4"
:
# 上市
remind
=
"上市企业"
enterprise
=
enterprise
.
filter_by
(
quoted_company
=
"1"
)
elif
select
==
"5"
:
# 融资
remind
=
"融资企业"
enterprise
=
enterprise
.
filter_by
(
fianacing
=
"1"
)
elif
select
==
"6"
:
# 独角兽
remind
=
"独角兽企业"
enterprise
=
enterprise
.
filter_by
(
unicorn
=
"1"
)
else
:
remind
=
""
enterprise
=
enterprise
size
=
enterprise
.
count
()
enters
=
enterprise
.
paginate
(
page
,
perpage
)
.
items
enter
=
[{
"id"
:
i
.
id
,
"name"
:
i
.
company_name
,
"industry"
:
i
.
company_industry
if
i
.
company_industry
else
"-"
,
# 行业
"build_date"
:
str
(
i
.
build_date
)[:
10
]
if
i
.
build_date
else
"-"
,
# 时间
"capital"
:
i
.
capital
if
i
.
capital
else
"-"
,
# 注册资本
}
for
i
in
enters
]
data
=
{
"remind"
:
remind
,
"enter"
:
enter
,
"size"
:
size
}
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"查找成功"
,
data
=
data
)
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库错误"
)
\ No newline at end of file
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