91571bac by 周伟奇

fix card *

1 parent ea51917a
......@@ -295,7 +295,7 @@ class BSWorkbook(Workbook):
def build_meta_sheet(self, card, confidence, code, print_time, start_date, end_date):
metadata_rows = self.build_metadata_rows(confidence, code, print_time, start_date, end_date)
ms = self.create_sheet('{0}({1})'.format(self.meta_sheet_title, card[-6:]))
ms = self.create_sheet('{0}({1})'.format(self.meta_sheet_title, card))
for row in metadata_rows:
ms.append(row)
return ms
......@@ -394,7 +394,7 @@ class BSWorkbook(Workbook):
for month in sorted(month_mapping.keys()):
# 3.1.拷贝数据
parts = month_mapping.get(month)
new_ws = self.create_sheet('{0}({1})'.format(month, card[-6:]))
new_ws = self.create_sheet('{0}({1})'.format(month, card))
new_ws.append(header)
for part in parts:
ws = self.get_sheet_by_name(part[0])
......@@ -540,6 +540,10 @@ class BSWorkbook(Workbook):
# }
# }
for card, summary in bs_summary.items():
try:
new_card = card[-6:].replace('*', '')
except Exception as e:
new_card = '异常卡号'
# 1.原表表头收集、按照月份分割
# 1.1 总结首行信息
classify = summary.get('classify', 0)
......@@ -571,7 +575,7 @@ class BSWorkbook(Workbook):
# 2.元信息提取表
confidence = self.get_confidence(max_find_count)
ms = self.build_meta_sheet(card,
ms = self.build_meta_sheet(new_card,
confidence,
summary.get('code'),
summary.get('print_time'),
......@@ -584,7 +588,7 @@ class BSWorkbook(Workbook):
for month_list in month_mapping.values():
month_list.sort(key=lambda x: x[-1], reverse=is_reverse)
self.build_month_sheet(ms, card, month_mapping, is_reverse, statistics_header_info, max_column, classify)
self.build_month_sheet(ms, new_card, month_mapping, is_reverse, statistics_header_info, max_column, classify)
# 4.删除原表
for sheet in sheets_list:
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!