FIX
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: | ... | ... |
... | @@ -688,6 +688,10 @@ class UploadDocView(GenericView, DocHandler): | ... | @@ -688,6 +688,10 @@ class UploadDocView(GenericView, DocHandler): |
688 | classify_1 = 12 | 688 | classify_1 = 12 |
689 | self.running_log.info('[weixin bs process] [doc_id={0}]'.format(doc.id)) | 689 | self.running_log.info('[weixin bs process] [doc_id={0}]'.format(doc.id)) |
690 | 690 | ||
691 | if classify_1 == 0 and (document_name.startswith("dzfp_")): | ||
692 | classify_1 = 29 | ||
693 | self.running_log.info('[dzfp process] [doc_id={0}]'.format(doc.id)) | ||
694 | |||
691 | 695 | ||
692 | if document_name.endswith('.zip') or document_name.endswith('.rar') or document_name.endswith('.ZIP') \ | 696 | if document_name.endswith('.zip') or document_name.endswith('.rar') or document_name.endswith('.ZIP') \ |
693 | or document_name.endswith('.RAR'): | 697 | or document_name.endswith('.RAR'): |
... | @@ -1247,6 +1251,10 @@ class DocView(DocGenericView, DocHandler): | ... | @@ -1247,6 +1251,10 @@ class DocView(DocGenericView, DocHandler): |
1247 | classify_1 = 12 | 1251 | classify_1 = 12 |
1248 | self.running_log.info('[weixin bs process] [doc_id={0}]'.format(doc.id)) | 1252 | self.running_log.info('[weixin bs process] [doc_id={0}]'.format(doc.id)) |
1249 | 1253 | ||
1254 | if classify_1 == 0 and (document_name.startswith("dzfp_")): | ||
1255 | classify_1 = 29 | ||
1256 | self.running_log.info('[dzfp process] [doc_id={0}]'.format(doc.id)) | ||
1257 | |||
1250 | # tasks = ['{0}{1}{2}'.format(prefix, consts.SPLIT_STR, doc.id)] | 1258 | # tasks = ['{0}{1}{2}'.format(prefix, consts.SPLIT_STR, doc.id)] |
1251 | task = consts.SPLIT_STR.join([prefix, str(doc.id), str(classify_1)]) | 1259 | task = consts.SPLIT_STR.join([prefix, str(doc.id), str(classify_1)]) |
1252 | enqueue_res = rh.enqueue([task], is_priority) | 1260 | enqueue_res = rh.enqueue([task], is_priority) | ... | ... |
-
Please register or sign in to post a comment