abbffc2b by 冯轩

FIX

1 parent 01854092
......@@ -1504,7 +1504,7 @@ class Command(BaseCommand, LoggerMixin):
self.log_base, traceback.format_exc()))
# error_list.append(1)
# return
elif classify_1_str == '12': # weixin e-bs
elif classify_1_str == '12' or classify_1_str == '29': # weixin e-bs 或e-invoice 都走微信电子流水逻辑
try:
max_img_count = 500
for times in range(consts.RETRY_TIMES):
......
......@@ -11,6 +11,8 @@ from openpyxl import Workbook
from openpyxl.styles import PatternFill, numbers
from openpyxl.utils import get_column_letter
from apps.doc import consts
import logging
online_log = logging.getLogger('online')
class BSWorkbook(Workbook):
......@@ -561,7 +563,7 @@ class BSWorkbook(Workbook):
outlay_cell = None if outlay_cell_idx is None or outlay_cell_idx >= length else rows[outlay_cell_idx]
borrow_cell = None if borrow_cell_idx is None or borrow_cell_idx >= length else rows[borrow_cell_idx]
summary_cell_value = None if summary_cell is None else summary_cell.value
summary_cell_value = None if summary_cell is None else summary_cell.value.strip()
date_cell_value = None if date_cell is None else date_cell.value
amount_cell_value = None if amount_cell is None else amount_cell.value
over_cell_value = None if over_cell is None else over_cell.value
......@@ -638,6 +640,7 @@ class BSWorkbook(Workbook):
# 3.2.提取信息、高亮
# row = summary_cell.row
# online_log.info('[ti qu xin xi gao liang =========== >] [summary_cell_value={0}]'.format(summary_cell_value))
if summary_cell is not None:
# 关键词1提取
if summary_cell_value in self.interest_keyword:
......
......@@ -688,6 +688,10 @@ class UploadDocView(GenericView, DocHandler):
classify_1 = 12
self.running_log.info('[weixin bs process] [doc_id={0}]'.format(doc.id))
if classify_1 == 0 and (document_name.startswith("dzfp_")):
classify_1 = 29
self.running_log.info('[dzfp process] [doc_id={0}]'.format(doc.id))
if document_name.endswith('.zip') or document_name.endswith('.rar') or document_name.endswith('.ZIP') \
or document_name.endswith('.RAR'):
......@@ -1247,6 +1251,10 @@ class DocView(DocGenericView, DocHandler):
classify_1 = 12
self.running_log.info('[weixin bs process] [doc_id={0}]'.format(doc.id))
if classify_1 == 0 and (document_name.startswith("dzfp_")):
classify_1 = 29
self.running_log.info('[dzfp process] [doc_id={0}]'.format(doc.id))
# tasks = ['{0}{1}{2}'.format(prefix, consts.SPLIT_STR, doc.id)]
task = consts.SPLIT_STR.join([prefix, str(doc.id), str(classify_1)])
enqueue_res = rh.enqueue([task], is_priority)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!