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
36cdd28c
Commit
36cdd28c
authored
Dec 09, 2022
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20221209
parent
652e93ce
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
18 deletions
+20
-18
apps/util.py
+13
-12
apps/view_choose/map_view.py
+7
-6
No files found.
apps/util.py
View file @
36cdd28c
...
@@ -48,20 +48,21 @@ def verify_identity(token, action_name):
...
@@ -48,20 +48,21 @@ def verify_identity(token, action_name):
mobile
=
user_obj
.
mobile
mobile
=
user_obj
.
mobile
operation_mobile
=
user_obj
.
mobile
operation_mobile
=
user_obj
.
mobile
role_id
=
user_obj
.
role_id
# 权限id
role_id
=
user_obj
.
role_id
# 权限id
district_name
=
user_obj
.
district_name
# 所属区县
#
district_name = user_obj.district_name # 所属区县
unit
=
user_obj
.
unit
# 所属机构
unit
=
user_obj
.
belong_organization
# 所属机构
section
=
user_obj
.
section
# 所属部门
section
=
user_obj
.
belong_department
# 所属部门
belong_unit
=
''
belong_unit
=
''
if
district_name
and
unit
and
section
:
# if district_name and unit and section:
belong_unit
=
district_name
+
unit
+
section
# belong_unit = district_name + unit + section
elif
district_name
and
unit
:
# elif district_name and unit:
belong_unit
=
district_name
+
unit
# belong_unit = district_name + unit
elif
district_name
and
section
:
# elif district_name and section:
belong_unit
=
district_name
+
section
# belong_unit = district_name + section
elif
district_name
:
# elif district_name:
belong_unit
=
district_name
# belong_unit = district_name
elif
unit
:
# elif unit:
if
unit
:
belong_unit
=
unit
belong_unit
=
unit
elif
section
:
elif
section
:
belong_unit
=
section
belong_unit
=
section
...
...
apps/view_choose/map_view.py
View file @
36cdd28c
...
@@ -10,6 +10,7 @@ import datetime
...
@@ -10,6 +10,7 @@ import datetime
from
apps.view_choose
import
api_address
from
apps.view_choose
import
api_address
from
apps.view_choose.common
import
Common
from
apps.view_choose.common
import
Common
from
apps.util
import
verify_token
"""产业地图页面"""
"""产业地图页面"""
...
@@ -38,7 +39,7 @@ def show_area():
...
@@ -38,7 +39,7 @@ def show_area():
token
=
request
.
headers
[
'token'
]
token
=
request
.
headers
[
'token'
]
district_name
=
get_district_name
(
token
,
district_name
)
#
district_name = get_district_name(token, district_name)
area_data
=
[]
area_data
=
[]
# 今年的1月1号
# 今年的1月1号
...
@@ -263,7 +264,7 @@ def month_rate():
...
@@ -263,7 +264,7 @@ def month_rate():
token
=
request
.
headers
[
'token'
]
token
=
request
.
headers
[
'token'
]
district_name
=
get_district_name
(
token
,
district_name
)
#
district_name = get_district_name(token, district_name)
com
=
Common
()
com
=
Common
()
data_list
=
[]
data_list
=
[]
...
@@ -312,7 +313,7 @@ def month_rate():
...
@@ -312,7 +313,7 @@ def month_rate():
one_factory_total_area
=
sum
([
float
(
area_obj
.
empty_area
if
area_obj
.
empty_area
else
0
)
for
area_obj
in
one_factory_area_obj_list
])
one_factory_total_area
=
sum
([
float
(
area_obj
.
empty_area
if
area_obj
.
empty_area
else
0
)
for
area_obj
in
one_factory_area_obj_list
])
data
=
{
"quarter"
:
"第一季度"
,
data
=
{
"quarter"
:
"第一季度"
,
"land_total_area"
:
one_land_total_area
,
"land_total_area"
:
one_land_total_area
,
"build_total_area"
:
one_build_total_area
,
"build_total_area"
:
round
(
one_build_total_area
,
2
)
,
"factory_total_area"
:
one_factory_total_area
"factory_total_area"
:
one_factory_total_area
}
}
data_list
.
append
(
data
)
data_list
.
append
(
data
)
...
@@ -325,7 +326,7 @@ def month_rate():
...
@@ -325,7 +326,7 @@ def month_rate():
two_factory_total_area
=
sum
([
float
(
area_obj
.
empty_area
if
area_obj
.
empty_area
else
0
)
for
area_obj
in
two_factory_area_obj_list
])
two_factory_total_area
=
sum
([
float
(
area_obj
.
empty_area
if
area_obj
.
empty_area
else
0
)
for
area_obj
in
two_factory_area_obj_list
])
data
=
{
"quarter"
:
"第二季度"
,
data
=
{
"quarter"
:
"第二季度"
,
"land_total_area"
:
two_total_area
,
"land_total_area"
:
two_total_area
,
"build_total_area"
:
two_build_total_area
,
"build_total_area"
:
round
(
two_build_total_area
,
2
)
,
"factory_total_area"
:
two_factory_total_area
"factory_total_area"
:
two_factory_total_area
}
}
data_list
.
append
(
data
)
data_list
.
append
(
data
)
...
@@ -338,7 +339,7 @@ def month_rate():
...
@@ -338,7 +339,7 @@ def month_rate():
three_factory_total_area
=
sum
([
float
(
area_obj
.
empty_area
if
area_obj
.
empty_area
else
0
)
for
area_obj
in
three_factory_area_obj_list
])
three_factory_total_area
=
sum
([
float
(
area_obj
.
empty_area
if
area_obj
.
empty_area
else
0
)
for
area_obj
in
three_factory_area_obj_list
])
data
=
{
"quarter"
:
"第三季度"
,
data
=
{
"quarter"
:
"第三季度"
,
"land_total_area"
:
three_total_area
,
"land_total_area"
:
three_total_area
,
"build_total_area"
:
three_build_total_area
,
"build_total_area"
:
round
(
three_build_total_area
,
2
)
,
"factory_total_area"
:
three_factory_total_area
"factory_total_area"
:
three_factory_total_area
}
}
data_list
.
append
(
data
)
data_list
.
append
(
data
)
...
@@ -351,7 +352,7 @@ def month_rate():
...
@@ -351,7 +352,7 @@ def month_rate():
four_factory_total_area
=
sum
([
float
(
area_obj
.
empty_area
if
area_obj
.
empty_area
else
0
)
for
area_obj
in
four_factory_area_obj_list
])
four_factory_total_area
=
sum
([
float
(
area_obj
.
empty_area
if
area_obj
.
empty_area
else
0
)
for
area_obj
in
four_factory_area_obj_list
])
data
=
{
"quarter"
:
"第四季度"
,
data
=
{
"quarter"
:
"第四季度"
,
"land_total_area"
:
four_total_area
,
"land_total_area"
:
four_total_area
,
"build_total_area"
:
four_build_total_area
,
"build_total_area"
:
round
(
four_build_total_area
,
2
)
,
"factory_total_area"
:
four_factory_total_area
"factory_total_area"
:
four_factory_total_area
}
}
data_list
.
append
(
data
)
data_list
.
append
(
data
)
...
...
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