|
|
|
|
@ -272,7 +272,7 @@ def deal_docx(folder_path, save_path=None, time_type=0,over_load_value=0):
|
|
|
|
|
count = 0
|
|
|
|
|
for i in range(len(need_district_statistics)):
|
|
|
|
|
current_poweroff_value = need_district_statistics[i][1]
|
|
|
|
|
if current_poweroff_value == poweroff_value:
|
|
|
|
|
if current_poweroff_value == poweroff_value and other_count >0:
|
|
|
|
|
count += 1
|
|
|
|
|
else:
|
|
|
|
|
top5_name_list.append(need_district_statistics[i][0])
|
|
|
|
|
@ -280,6 +280,11 @@ def deal_docx(folder_path, save_path=None, time_type=0,over_load_value=0):
|
|
|
|
|
top_dod_dict[need_district_statistics[i][0]] = top5_dod_analysis(
|
|
|
|
|
need_district_statistics[i], district_stat_before
|
|
|
|
|
)
|
|
|
|
|
if count >0 :
|
|
|
|
|
top5_name_list.append(f"其他{count + other_count}家单位")
|
|
|
|
|
top5_poweroff_list.append(poweroff_value)
|
|
|
|
|
top_dod_dict["其他单位"] = "—"
|
|
|
|
|
"""
|
|
|
|
|
if count == 1 and other_count==0:
|
|
|
|
|
top5_name_list.append(
|
|
|
|
|
need_district_statistics[len(need_district_statistics) - 1][0]
|
|
|
|
|
@ -297,7 +302,7 @@ def deal_docx(folder_path, save_path=None, time_type=0,over_load_value=0):
|
|
|
|
|
top5_name_list.append(f"其他{count + other_count}家单位")
|
|
|
|
|
top5_poweroff_list.append(poweroff_value)
|
|
|
|
|
top_dod_dict["其他单位"] = "—"
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
# old_version
|
|
|
|
|
"""
|
|
|
|
|
if len(district_statistics) >= 5:
|
|
|
|
|
@ -429,6 +434,7 @@ def deal_docx(folder_path, save_path=None, time_type=0,over_load_value=0):
|
|
|
|
|
short_precentage,
|
|
|
|
|
important_stop_outage,
|
|
|
|
|
type,
|
|
|
|
|
total_yesterday
|
|
|
|
|
) = count_change_outage(doc_dict["have_important"])
|
|
|
|
|
# 获取舆情数字信息
|
|
|
|
|
today_sentiment, type_sentiment, yesterday_sentiment, result_sentiment = (
|
|
|
|
|
@ -515,10 +521,9 @@ def deal_docx(folder_path, save_path=None, time_type=0,over_load_value=0):
|
|
|
|
|
|
|
|
|
|
# 替换模板字符串
|
|
|
|
|
replace_text_in_docx(electricity_daily_simple, replacements_simple)
|
|
|
|
|
|
|
|
|
|
datas = {
|
|
|
|
|
"停电用户\n(万户)": {
|
|
|
|
|
"昨天": total_outage + change_outage,
|
|
|
|
|
"昨天": total_yesterday,
|
|
|
|
|
"今天": total_outage,
|
|
|
|
|
},
|
|
|
|
|
"过载配变\n(台)": {"昨天": over_load_before, "今天": doc_dict_over_load},
|
|
|
|
|
@ -788,11 +793,11 @@ def deal_docx(folder_path, save_path=None, time_type=0,over_load_value=0):
|
|
|
|
|
# 表4中的插入位置
|
|
|
|
|
start_tb4_row = 2
|
|
|
|
|
start_tb4_col = 8
|
|
|
|
|
if not top_5_results.empty:
|
|
|
|
|
data = top_5_results.values
|
|
|
|
|
if top_5_results:
|
|
|
|
|
#data = top_5_results.values
|
|
|
|
|
copy_sta_table(
|
|
|
|
|
electricity_daily.tables[1],
|
|
|
|
|
data,
|
|
|
|
|
top_5_results,
|
|
|
|
|
start_tb4_row,
|
|
|
|
|
start_tb4_col,
|
|
|
|
|
)
|
|
|
|
|
|