From bd439692745f5bf48741f0c76849837d92a5dfa7 Mon Sep 17 00:00:00 2001 From: "13621160019@163.com" <13621160019@163.com> Date: Fri, 17 Sep 2021 12:24:25 +0800 Subject: [PATCH] added column ID to StoreBatch Excel Exporter in API --- myems-api/excelexporters/storebatch.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/myems-api/excelexporters/storebatch.py b/myems-api/excelexporters/storebatch.py index 247661db..a58c74bd 100644 --- a/myems-api/excelexporters/storebatch.py +++ b/myems-api/excelexporters/storebatch.py @@ -136,18 +136,24 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting ws['B6'].font = name_font ws['B6'].alignment = c_c_alignment ws['B6'].fill = table_fill - ws['B6'] = '名称' + ws['B6'] = 'ID' ws['C6'].border = f_border - ws['C6'].alignment = c_c_alignment ws['C6'].font = name_font + ws['C6'].alignment = c_c_alignment ws['C6'].fill = table_fill - ws['C6'] = '空间' + ws['C6'] = 'Name' + + ws['D6'].border = f_border + ws['D6'].alignment = c_c_alignment + ws['D6'].font = name_font + ws['D6'].fill = table_fill + ws['D6'] = 'Space' ca_len = len(report['energycategories']) for i in range(0, ca_len): - col = chr(ord('D') + i) + col = chr(ord('E') + i) ws[col + '6'].fill = table_fill ws[col + '6'].font = name_font ws[col + '6'].alignment = c_c_alignment @@ -157,20 +163,24 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting current_row_number = 7 for i in range(0, len(report['stores'])): - ws['B' + str(current_row_number)].font = title_font ws['B' + str(current_row_number)].border = f_border ws['B' + str(current_row_number)].alignment = c_c_alignment - ws['B' + str(current_row_number)] = report['stores'][i]['store_name'] + ws['B' + str(current_row_number)] = report['stores'][i]['id'] ws['C' + str(current_row_number)].font = title_font ws['C' + str(current_row_number)].border = f_border ws['C' + str(current_row_number)].alignment = c_c_alignment - ws['C' + str(current_row_number)] = report['stores'][i]['space_name'] + ws['C' + str(current_row_number)] = report['stores'][i]['store_name'] + + ws['D' + str(current_row_number)].font = title_font + ws['D' + str(current_row_number)].border = f_border + ws['D' + str(current_row_number)].alignment = c_c_alignment + ws['D' + str(current_row_number)] = report['stores'][i]['space_name'] ca_len = len(report['stores'][i]['values']) for j in range(0, ca_len): - col = chr(ord('D') + j) + col = chr(ord('E') + j) ws[col + str(current_row_number)].font = data_font ws[col + str(current_row_number)].border = f_border ws[col + str(current_row_number)].alignment = c_c_alignment