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
fa4970f7
Commit
fa4970f7
authored
Feb 14, 2022
by
赵宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
5d0ea281
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
32 deletions
+70
-32
apps/view_360company/view.py
+27
-24
apps/view_atlas/view.py
+43
-8
apps/view_index/view.py
+0
-0
No files found.
apps/view_360company/view.py
View file @
fa4970f7
...
...
@@ -26,32 +26,35 @@ def get_all_enterprise():
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
try
:
enterprise_all_counts
=
len
(
Enterprise
.
query
.
all
())
# print(enterprise_all_counts)
enterprise_list
=
Enterprise
.
query
.
paginate
(
page
,
perpage
)
.
items
# counts = len(enterprise_list)
# print(enterprise_list)
if
enterprise_list
:
data
=
[{
"id"
:
enterprise
.
id
,
"company"
:
enterprise
.
company_name
,
# 企业名
"area"
:
enterprise
.
city
+
enterprise
.
district
,
"createtime"
:
enterprise
.
build_date
,
"legal"
:
enterprise
.
legal
,
"capital"
:
enterprise
.
capital
,
"entype"
:
enterprise
.
entype
,
"address"
:
enterprise
.
address
,
"telephone"
:
enterprise
.
telephone
,
"fianacing"
:
'融资企业'
if
enterprise
.
fianacing
==
"1"
else
''
,
"quoted_company"
:
'上市企业'
if
enterprise
.
quoted_company
==
"1"
else
''
,
"high_new"
:
'高新技术企业'
if
enterprise
.
high_new
==
'1'
else
"-
"
,
"tbe"
:
'科技型中小企业'
if
enterprise
.
tbe
==
'1'
else
"-
"
,
"quoted_enterprise"
:
'上市企业'
if
enterprise
.
quoted_company
==
'1'
else
"-
"
,
"unicorn"
:
'独角兽企业'
if
enterprise
.
unicorn
==
'1'
else
"-
"
,
"dengl"
:
'瞪羚'
if
enterprise
.
dengl
==
'1'
else
"-
"
,
"isfive"
:
'中国500强'
if
enterprise
.
isfive
==
'1'
else
"-
"
,
"zjtg"
:
'专精特新企业'
if
enterprise
.
zjtg
==
'1'
else
"-
"
,
"zjtg_gjjxjr"
:
'国家级专精特新小巨人企业'
if
enterprise
.
zjtg_gjjxjr
==
'1'
else
"-
"
,
"zjtg_sjxjr"
:
'省级专精特新小巨人企业'
if
enterprise
.
zjtg_sjxjr
==
'1'
else
"-
"
,
"tbe_sjmy"
:
'省级民营科技企业'
if
enterprise
.
tbe_sjmy
==
'1'
else
"-
"
,
}
for
enterprise
in
enterprise_list
]
data
=
{
"data"
:
[{
"id"
:
enterprise
.
id
,
"company"
:
enterprise
.
company_name
,
# 企业名
"area"
:
enterprise
.
city
+
enterprise
.
district
,
"createtime"
:
enterprise
.
build_date
,
"legal"
:
enterprise
.
legal
,
"capital"
:
enterprise
.
capital
,
"entype"
:
enterprise
.
entype
,
"address"
:
enterprise
.
address
,
"telephone"
:
enterprise
.
telephone
,
"fianacing"
:
'融资企业'
if
enterprise
.
fianacing
==
"1"
else
''
,
"quoted_company"
:
'上市企业'
if
enterprise
.
quoted_company
==
"1"
else
''
,
"high_new"
:
'高新技术企业'
if
enterprise
.
high_new
==
'1'
else
"
"
,
"tbe"
:
'科技型中小企业'
if
enterprise
.
tbe
==
'1'
else
"
"
,
"quoted_enterprise"
:
'上市企业'
if
enterprise
.
quoted_company
==
'1'
else
"
"
,
"unicorn"
:
'独角兽企业'
if
enterprise
.
unicorn
==
'1'
else
"
"
,
"dengl"
:
'瞪羚'
if
enterprise
.
dengl
==
'1'
else
"
"
,
"isfive"
:
'中国500强'
if
enterprise
.
isfive
==
'1'
else
"
"
,
"zjtg"
:
'专精特新企业'
if
enterprise
.
zjtg
==
'1'
else
"
"
,
"zjtg_gjjxjr"
:
'国家级专精特新小巨人企业'
if
enterprise
.
zjtg_gjjxjr
==
'1'
else
"
"
,
"zjtg_sjxjr"
:
'省级专精特新小巨人企业'
if
enterprise
.
zjtg_sjxjr
==
'1'
else
"
"
,
"tbe_sjmy"
:
'省级民营科技企业'
if
enterprise
.
tbe_sjmy
==
'1'
else
"
"
,
}
for
enterprise
in
enterprise_list
],
"size"
:
enterprise_all_counts
}
else
:
return
jsonify
(
code
=
RET
.
NODATA
,
msg
=
"查无数据"
)
except
Exception
as
e
:
...
...
apps/view_atlas/view.py
View file @
fa4970f7
...
...
@@ -406,7 +406,8 @@ def industry_policy():
"""产业政策数据"""
req_dict
=
request
.
get_json
()
inid
=
req_dict
.
get
(
"inid"
)
# 行业id
industry_level
=
req_dict
.
get
(
"industry_level"
)
# 行业等级,(父行业高端设备等五个为"1",子行业为"2")
industry_level
=
req_dict
.
get
(
"industry_level"
)
# 行业等级,(父行业高端设备等五个为1,子行业为2)
policy_level
=
req_dict
.
get
(
"policy_level"
)
# 政策等级,(国家级为1,省级为2,市级为3,区县为4,开发区为5)
page
=
req_dict
.
get
(
"page"
)
# 分页页码
perpage
=
req_dict
.
get
(
"perpage"
)
# 分页大小
...
...
@@ -417,15 +418,49 @@ def industry_policy():
indu_policy
=
''
size
=
''
name
=
Industry
.
query
.
filter_by
(
nid
=
inid
)
.
first
()
.
oname
# 获取导航对应的真名
print
(
name
)
if
industry_level
==
1
:
indu_policy
=
InduPolicy
.
query
.
filter
(
InduPolicy
.
navigator
.
like
(
"
%
{}
%
"
.
format
(
name
)))
size
=
indu_policy
.
count
()
# 分页总数
indu_policy
=
indu_policy
.
paginate
(
page
,
perpage
)
.
items
if
policy_level
==
1
:
# 国家级
indu_policy
=
InduPolicy
.
query
.
filter
(
InduPolicy
.
navigator
.
like
(
"
%
{}
%
"
.
format
(
name
)),
InduPolicy
.
level
==
"国家级"
)
size
=
indu_policy
.
count
()
# 分页总数
indu_policy
=
indu_policy
.
paginate
(
page
,
perpage
)
.
items
if
policy_level
==
2
:
# 省级
indu_policy
=
InduPolicy
.
query
.
filter
(
InduPolicy
.
navigator
.
like
(
"
%
{}
%
"
.
format
(
name
)),
InduPolicy
.
level
==
"省级"
)
size
=
indu_policy
.
count
()
# 分页总数
indu_policy
=
indu_policy
.
paginate
(
page
,
perpage
)
.
items
if
policy_level
==
3
:
# 市级
indu_policy
=
InduPolicy
.
query
.
filter
(
InduPolicy
.
navigator
.
like
(
"
%
{}
%
"
.
format
(
name
)),
InduPolicy
.
level
==
"市级"
)
size
=
indu_policy
.
count
()
# 分页总数
indu_policy
=
indu_policy
.
paginate
(
page
,
perpage
)
.
items
if
policy_level
==
4
:
# 区县
indu_policy
=
InduPolicy
.
query
.
filter
(
InduPolicy
.
navigator
.
like
(
"
%
{}
%
"
.
format
(
name
)),
InduPolicy
.
level
==
"区县"
)
size
=
indu_policy
.
count
()
# 分页总数
indu_policy
=
indu_policy
.
paginate
(
page
,
perpage
)
.
items
if
policy_level
==
5
:
# 开发区
indu_policy
=
InduPolicy
.
query
.
filter
(
InduPolicy
.
navigator
.
like
(
"
%
{}
%
"
.
format
(
name
)),
InduPolicy
.
level
==
"开发区"
)
size
=
indu_policy
.
count
()
# 分页总数
indu_policy
=
indu_policy
.
paginate
(
page
,
perpage
)
.
items
if
industry_level
==
2
:
indu_policy
=
InduPolicy
.
query
.
filter
(
InduPolicy
.
navigat
.
like
(
"
%
{}
%
"
.
format
(
name
)))
size
=
indu_policy
.
count
()
# 分页总数
indu_policy
=
indu_policy
.
paginate
(
page
,
perpage
)
.
items
if
policy_level
==
1
:
# 国家级
indu_policy
=
InduPolicy
.
query
.
filter
(
InduPolicy
.
navigat
.
like
(
"
%
{}
%
"
.
format
(
name
)),
InduPolicy
.
level
==
"国家级"
)
size
=
indu_policy
.
count
()
# 分页总数
indu_policy
=
indu_policy
.
paginate
(
page
,
perpage
)
.
items
if
policy_level
==
2
:
# 省级
indu_policy
=
InduPolicy
.
query
.
filter
(
InduPolicy
.
navigat
.
like
(
"
%
{}
%
"
.
format
(
name
)),
InduPolicy
.
level
==
"省级"
)
size
=
indu_policy
.
count
()
# 分页总数
indu_policy
=
indu_policy
.
paginate
(
page
,
perpage
)
.
items
if
policy_level
==
3
:
# 市级
indu_policy
=
InduPolicy
.
query
.
filter
(
InduPolicy
.
navigat
.
like
(
"
%
{}
%
"
.
format
(
name
)),
InduPolicy
.
level
==
"市级"
)
size
=
indu_policy
.
count
()
# 分页总数
indu_policy
=
indu_policy
.
paginate
(
page
,
perpage
)
.
items
if
policy_level
==
4
:
# 区县
indu_policy
=
InduPolicy
.
query
.
filter
(
InduPolicy
.
navigat
.
like
(
"
%
{}
%
"
.
format
(
name
)),
InduPolicy
.
level
==
"区县"
)
size
=
indu_policy
.
count
()
# 分页总数
indu_policy
=
indu_policy
.
paginate
(
page
,
perpage
)
.
items
if
policy_level
==
5
:
# 开发区
indu_policy
=
InduPolicy
.
query
.
filter
(
InduPolicy
.
navigat
.
like
(
"
%
{}
%
"
.
format
(
name
)),
InduPolicy
.
level
==
"开发区"
)
size
=
indu_policy
.
count
()
# 分页总数
indu_policy
=
indu_policy
.
paginate
(
page
,
perpage
)
.
items
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
DBERR
,
msg
=
"数据库查询错误"
)
...
...
apps/view_index/view.py
View file @
fa4970f7
This diff is collapsed.
Click to expand it.
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