Commit 36cdd28c by dong

fix20221209

parent 652e93ce
......@@ -48,20 +48,21 @@ def verify_identity(token, action_name):
mobile = user_obj.mobile
operation_mobile = user_obj.mobile
role_id = user_obj.role_id # 权限id
district_name = user_obj.district_name # 所属区县
unit = user_obj.unit # 所属机构
section = user_obj.section # 所属部门
# district_name = user_obj.district_name # 所属区县
unit = user_obj.belong_organization # 所属机构
section = user_obj.belong_department # 所属部门
belong_unit = ''
if district_name and unit and section:
belong_unit = district_name + unit + section
elif district_name and unit:
belong_unit = district_name + unit
elif district_name and section:
belong_unit = district_name + section
elif district_name:
belong_unit = district_name
elif unit:
# if district_name and unit and section:
# belong_unit = district_name + unit + section
# elif district_name and unit:
# belong_unit = district_name + unit
# elif district_name and section:
# belong_unit = district_name + section
# elif district_name:
# belong_unit = district_name
# elif unit:
if unit:
belong_unit = unit
elif section:
belong_unit = section
......
......@@ -10,6 +10,7 @@ import datetime
from apps.view_choose import api_address
from apps.view_choose.common import Common
from apps.util import verify_token
"""产业地图页面"""
......@@ -38,7 +39,7 @@ def show_area():
token = request.headers['token']
district_name = get_district_name(token, district_name)
# district_name = get_district_name(token, district_name)
area_data = []
# 今年的1月1号
......@@ -263,7 +264,7 @@ def month_rate():
token = request.headers['token']
district_name = get_district_name(token, district_name)
# district_name = get_district_name(token, district_name)
com = Common()
data_list = []
......@@ -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])
data = {"quarter": "第一季度",
"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
}
data_list.append(data)
......@@ -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])
data = {"quarter": "第二季度",
"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
}
data_list.append(data)
......@@ -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])
data = {"quarter": "第三季度",
"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
}
data_list.append(data)
......@@ -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])
data = {"quarter": "第四季度",
"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
}
data_list.append(data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment