Commit 70e2c2d1 authored by peng.xiaozhe's avatar peng.xiaozhe

首页获取指数信息bug修复 能耗None设置为0计算

parent 4754c324
......@@ -103,7 +103,7 @@ async def carbon_emission_index_service(cid, start, end):
# 3. 碳排指数
# 3.1 能耗偏差
if energy_standard:
deviation = (energy_standard - conversion_year) / energy_standard
deviation = (energy_standard - conversion_year) / energy_standard if conversion_year else 1
# 3.2 碳排指数
c_index = carbon_index(deviation)
# 4. 达标情况
......
......@@ -23,7 +23,7 @@ from unify_api.modules.home_page.procedures.count_info_pds import other_info, \
electric_use_info, cid_alarm_importance_count, \
alarm_importance_count_total, power_factor, current_load, \
get_company_charge_price, health_status_res, carbon_status_res_web, \
optimization_count_info, economic_index_desc
optimization_count_info, economic_index_desc, electric_use_info_new15
from unify_api.modules.home_page.procedures.count_info_proxy_pds import \
alarm_percentage_count, alarm_safe_power
from unify_api.modules.tsp_water.dao.drop_dust_dao import \
......@@ -421,7 +421,7 @@ async def all_index_info_service(cid):
health_index = round(health_index)
health_status = health_status_res(health_index, "web")
# 2. 安全指数
elec_info = await electric_use_info(cid)
elec_info = await electric_use_info_new15(cid)
safety_index = elec_info.electric_use_score
safety_status = safety_ratio_res(safety_index, "web")
# 3. 碳排指数
......
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