42159da8 by 周伟奇

fix keywords amount

1 parent e3d719b8
......@@ -400,7 +400,7 @@ class BSWorkbook(Workbook):
elif classify == consts.NYYH_CLASSIFY:
row_value = self.rm_second_row(row_value, amount_cell_idx, over_cell_idx)
new_ws.append(row_value)
# 3.2.提取信息、高亮
amount_mapping = {}
amount_fill_row = set()
......@@ -422,20 +422,6 @@ class BSWorkbook(Workbook):
outlay_cell_value = None if outlay_cell is None else outlay_cell.value
borrow_cell_value = None if borrow_cell is None else borrow_cell.value
# row = summary_cell.row
if summary_cell is not None:
# 关键词1提取
if summary_cell_value in self.interest_keyword:
ms.append((summary_cell_value, date_cell_value, amount_cell_value))
# 关键词2提取至临时表
elif summary_cell_value in self.salary_keyword:
tmp_ws.append((summary_cell_value, date_cell_value, amount_cell_value))
# 贷款关键词高亮
elif summary_cell_value in high_light_keyword:
summary_cell.fill = self.amount_fill
if amount_cell is not None:
amount_cell.fill = self.amount_fill
# 3.3.余额转数值
over_success = False
if over_cell is not None:
......@@ -491,6 +477,23 @@ class BSWorkbook(Workbook):
rows[result_idx].value = '=IF({2}{0}=ROUND(SUM({2}{1},{3}{0}),4), "{4}", "{5}")'.format(
amount_cell.row, amount_cell.row - 1, over_col_letter, amount_col_letter, *self.proof_res)
# 3.2.提取信息、高亮
# row = summary_cell.row
if summary_cell is not None:
# 关键词1提取
if summary_cell_value in self.interest_keyword:
new_amount_cell_value = None if amount_cell is None else amount_cell.value
ms.append((summary_cell_value, date_cell_value, new_amount_cell_value))
# 关键词2提取至临时表
elif summary_cell_value in self.salary_keyword:
new_amount_cell_value = None if amount_cell is None else amount_cell.value
tmp_ws.append((summary_cell_value, date_cell_value, new_amount_cell_value))
# 贷款关键词高亮
elif summary_cell_value in high_light_keyword:
summary_cell.fill = self.amount_fill
if amount_cell is not None:
amount_cell.fill = self.amount_fill
# 3.6.同一天相同进出账高亮
del amount_mapping
for row in amount_fill_row:
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!