update bug

This commit is contained in:
P3ngSaM 2022-05-18 16:31:57 +08:00
parent 652cc034cb
commit cce319cb3d
1 changed files with 10 additions and 7 deletions

View File

@ -154,12 +154,14 @@ def environment_energy(param):
total.append(round(year_param['公司当年消耗的天然气(立方米)'] * 38.9310, 2))
total.append(round(year_param['公司当年消耗的煤气(立方米)'] * 17.0000, 2))
total.append(round(year_param['公司当年消耗的电(千瓦时)'] * 11.8400, 2))
# 每年能耗
amount = sum(total)
res = dict()
res['amount'] = round(amount, 2)
# 每年每万元收入能耗
res['money_amount'] = round(amount / income, 2)
res['amount'] = amount
num = 2
while round(amount / income, num) == 0.0:
num += 1
res['money_amount'] = round(amount / income, num + 1)
return res
def calculate_three_year_data():
@ -255,12 +257,13 @@ def environment_standard_coal(param):
total.append(round(year_param['公司当年消耗的天然气(立方米)'] * 1.3300, 2))
total.append(round(year_param['公司当年消耗的煤气(立方米)'] * 0.5700, 2))
total.append(round(year_param['公司当年消耗的电(千瓦时)'] * 0.4040, 2))
# 每年排放总量
amount = sum(total)
res = dict()
res['amount'] = amount
# 每年每万元收入二氧化碳排放量
res['money_amount'] = round(amount / income, 2)
num = 2
while round(amount / income, num) == 0.0:
num += 1
res['money_amount'] = round(amount / income, num + 1)
return res
def calculate_three_year_data():