Merge branch 'feature/weixin-bs-2' into feature/uat-tmp
Showing
3 changed files
with
13 additions
and
2 deletions
| ... | @@ -1504,7 +1504,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -1504,7 +1504,7 @@ class Command(BaseCommand, LoggerMixin): |
| 1504 | self.log_base, traceback.format_exc())) | 1504 | self.log_base, traceback.format_exc())) |
| 1505 | # error_list.append(1) | 1505 | # error_list.append(1) |
| 1506 | # return | 1506 | # return |
| 1507 | elif classify_1_str == '12': # weixin e-bs | 1507 | elif classify_1_str == '12' or classify_1_str == '29': # weixin e-bs 或e-invoice 都走微信电子流水逻辑 |
| 1508 | try: | 1508 | try: |
| 1509 | max_img_count = 500 | 1509 | max_img_count = 500 |
| 1510 | for times in range(consts.RETRY_TIMES): | 1510 | for times in range(consts.RETRY_TIMES): | ... | ... |
| ... | @@ -11,6 +11,8 @@ from openpyxl import Workbook | ... | @@ -11,6 +11,8 @@ from openpyxl import Workbook |
| 11 | from openpyxl.styles import PatternFill, numbers | 11 | from openpyxl.styles import PatternFill, numbers |
| 12 | from openpyxl.utils import get_column_letter | 12 | from openpyxl.utils import get_column_letter |
| 13 | from apps.doc import consts | 13 | from apps.doc import consts |
| 14 | import logging | ||
| 15 | online_log = logging.getLogger('online') | ||
| 14 | 16 | ||
| 15 | 17 | ||
| 16 | class BSWorkbook(Workbook): | 18 | class BSWorkbook(Workbook): |
| ... | @@ -561,7 +563,7 @@ class BSWorkbook(Workbook): | ... | @@ -561,7 +563,7 @@ class BSWorkbook(Workbook): |
| 561 | outlay_cell = None if outlay_cell_idx is None or outlay_cell_idx >= length else rows[outlay_cell_idx] | 563 | outlay_cell = None if outlay_cell_idx is None or outlay_cell_idx >= length else rows[outlay_cell_idx] |
| 562 | borrow_cell = None if borrow_cell_idx is None or borrow_cell_idx >= length else rows[borrow_cell_idx] | 564 | borrow_cell = None if borrow_cell_idx is None or borrow_cell_idx >= length else rows[borrow_cell_idx] |
| 563 | 565 | ||
| 564 | summary_cell_value = None if summary_cell is None else summary_cell.value | 566 | summary_cell_value = None if summary_cell is None else summary_cell.value.strip() |
| 565 | date_cell_value = None if date_cell is None else date_cell.value | 567 | date_cell_value = None if date_cell is None else date_cell.value |
| 566 | amount_cell_value = None if amount_cell is None else amount_cell.value | 568 | amount_cell_value = None if amount_cell is None else amount_cell.value |
| 567 | over_cell_value = None if over_cell is None else over_cell.value | 569 | over_cell_value = None if over_cell is None else over_cell.value |
| ... | @@ -638,6 +640,7 @@ class BSWorkbook(Workbook): | ... | @@ -638,6 +640,7 @@ class BSWorkbook(Workbook): |
| 638 | 640 | ||
| 639 | # 3.2.提取信息、高亮 | 641 | # 3.2.提取信息、高亮 |
| 640 | # row = summary_cell.row | 642 | # row = summary_cell.row |
| 643 | # online_log.info('[ti qu xin xi gao liang =========== >] [summary_cell_value={0}]'.format(summary_cell_value)) | ||
| 641 | if summary_cell is not None: | 644 | if summary_cell is not None: |
| 642 | # 关键词1提取 | 645 | # 关键词1提取 |
| 643 | if summary_cell_value in self.interest_keyword: | 646 | if summary_cell_value in self.interest_keyword: | ... | ... |
| ... | @@ -700,6 +700,10 @@ class UploadDocView(GenericView, DocHandler): | ... | @@ -700,6 +700,10 @@ class UploadDocView(GenericView, DocHandler): |
| 700 | classify_1 = 12 | 700 | classify_1 = 12 |
| 701 | self.running_log.info('[weixin bs process] [doc_id={0}]'.format(doc.id)) | 701 | self.running_log.info('[weixin bs process] [doc_id={0}]'.format(doc.id)) |
| 702 | 702 | ||
| 703 | if classify_1 == 0 and (document_name.startswith("dzfp_")): | ||
| 704 | classify_1 = 29 | ||
| 705 | self.running_log.info('[dzfp process] [doc_id={0}]'.format(doc.id)) | ||
| 706 | |||
| 703 | 707 | ||
| 704 | if document_name.endswith('.zip') or document_name.endswith('.rar') or document_name.endswith('.ZIP') \ | 708 | if document_name.endswith('.zip') or document_name.endswith('.rar') or document_name.endswith('.ZIP') \ |
| 705 | or document_name.endswith('.RAR'): | 709 | or document_name.endswith('.RAR'): |
| ... | @@ -1280,6 +1284,10 @@ class DocView(DocGenericView, DocHandler): | ... | @@ -1280,6 +1284,10 @@ class DocView(DocGenericView, DocHandler): |
| 1280 | classify_1 = 12 | 1284 | classify_1 = 12 |
| 1281 | self.running_log.info('[weixin bs process] [doc_id={0}]'.format(doc.id)) | 1285 | self.running_log.info('[weixin bs process] [doc_id={0}]'.format(doc.id)) |
| 1282 | 1286 | ||
| 1287 | if classify_1 == 0 and (document_name.startswith("dzfp_")): | ||
| 1288 | classify_1 = 29 | ||
| 1289 | self.running_log.info('[dzfp process] [doc_id={0}]'.format(doc.id)) | ||
| 1290 | |||
| 1283 | # tasks = ['{0}{1}{2}'.format(prefix, consts.SPLIT_STR, doc.id)] | 1291 | # tasks = ['{0}{1}{2}'.format(prefix, consts.SPLIT_STR, doc.id)] |
| 1284 | task = consts.SPLIT_STR.join([prefix, str(doc.id), str(classify_1)]) | 1292 | task = consts.SPLIT_STR.join([prefix, str(doc.id), str(classify_1)]) |
| 1285 | enqueue_res = rh.enqueue([task], is_priority) | 1293 | enqueue_res = rh.enqueue([task], is_priority) | ... | ... |
-
Please register or sign in to post a comment