42159da8 by 周伟奇

fix keywords amount

1 parent e3d719b8
...@@ -400,7 +400,7 @@ class BSWorkbook(Workbook): ...@@ -400,7 +400,7 @@ class BSWorkbook(Workbook):
400 elif classify == consts.NYYH_CLASSIFY: 400 elif classify == consts.NYYH_CLASSIFY:
401 row_value = self.rm_second_row(row_value, amount_cell_idx, over_cell_idx) 401 row_value = self.rm_second_row(row_value, amount_cell_idx, over_cell_idx)
402 new_ws.append(row_value) 402 new_ws.append(row_value)
403 # 3.2.提取信息、高亮 403
404 amount_mapping = {} 404 amount_mapping = {}
405 amount_fill_row = set() 405 amount_fill_row = set()
406 406
...@@ -422,20 +422,6 @@ class BSWorkbook(Workbook): ...@@ -422,20 +422,6 @@ class BSWorkbook(Workbook):
422 outlay_cell_value = None if outlay_cell is None else outlay_cell.value 422 outlay_cell_value = None if outlay_cell is None else outlay_cell.value
423 borrow_cell_value = None if borrow_cell is None else borrow_cell.value 423 borrow_cell_value = None if borrow_cell is None else borrow_cell.value
424 424
425 # row = summary_cell.row
426 if summary_cell is not None:
427 # 关键词1提取
428 if summary_cell_value in self.interest_keyword:
429 ms.append((summary_cell_value, date_cell_value, amount_cell_value))
430 # 关键词2提取至临时表
431 elif summary_cell_value in self.salary_keyword:
432 tmp_ws.append((summary_cell_value, date_cell_value, amount_cell_value))
433 # 贷款关键词高亮
434 elif summary_cell_value in high_light_keyword:
435 summary_cell.fill = self.amount_fill
436 if amount_cell is not None:
437 amount_cell.fill = self.amount_fill
438
439 # 3.3.余额转数值 425 # 3.3.余额转数值
440 over_success = False 426 over_success = False
441 if over_cell is not None: 427 if over_cell is not None:
...@@ -491,6 +477,23 @@ class BSWorkbook(Workbook): ...@@ -491,6 +477,23 @@ class BSWorkbook(Workbook):
491 rows[result_idx].value = '=IF({2}{0}=ROUND(SUM({2}{1},{3}{0}),4), "{4}", "{5}")'.format( 477 rows[result_idx].value = '=IF({2}{0}=ROUND(SUM({2}{1},{3}{0}),4), "{4}", "{5}")'.format(
492 amount_cell.row, amount_cell.row - 1, over_col_letter, amount_col_letter, *self.proof_res) 478 amount_cell.row, amount_cell.row - 1, over_col_letter, amount_col_letter, *self.proof_res)
493 479
480 # 3.2.提取信息、高亮
481 # row = summary_cell.row
482 if summary_cell is not None:
483 # 关键词1提取
484 if summary_cell_value in self.interest_keyword:
485 new_amount_cell_value = None if amount_cell is None else amount_cell.value
486 ms.append((summary_cell_value, date_cell_value, new_amount_cell_value))
487 # 关键词2提取至临时表
488 elif summary_cell_value in self.salary_keyword:
489 new_amount_cell_value = None if amount_cell is None else amount_cell.value
490 tmp_ws.append((summary_cell_value, date_cell_value, new_amount_cell_value))
491 # 贷款关键词高亮
492 elif summary_cell_value in high_light_keyword:
493 summary_cell.fill = self.amount_fill
494 if amount_cell is not None:
495 amount_cell.fill = self.amount_fill
496
494 # 3.6.同一天相同进出账高亮 497 # 3.6.同一天相同进出账高亮
495 del amount_mapping 498 del amount_mapping
496 for row in amount_fill_row: 499 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!