bd738e36 by 周伟奇

fix keywords

1 parent 454bef83
......@@ -37,7 +37,7 @@ DEALER_CODE = 'ocr_situ_group'
# ---------银行流水模板相关--------------------------------------------------------------------------------------------
TRANS = str.maketrans('Cc((oODlLmAsSbg', '000000011345569')
TRANS = str.maketrans('Cc((oODlLAsSbgE', '000000011455699')
CARD_RATIO = 0.9
UNKNOWN_CARD = '未知卡号'
......
......@@ -429,7 +429,6 @@ class Command(BaseCommand, LoggerMixin):
# EDMS异常:下载异常-->回队列-->邮件;上传异常-->重新上传队列-->邮件
# 算法异常:第一道异常-->识别失败-->邮件;第二道异常-->识别失败-->邮件
# TODO 数据库断联问题
# TODO EDMS API GATEWAY
def handle(self, *args, **kwargs):
sleep_second = int(conf.SLEEP_SECOND)
max_sleep_second = int(conf.MAX_SLEEP_SECOND)
......@@ -464,11 +463,11 @@ class Command(BaseCommand, LoggerMixin):
license_summary = {}
unknown_summary = {}
interest_keyword = Keywords.objects.filter(
type=KeywordsType.INTEREST.value).values_list('keyword', flat=True)
type=KeywordsType.INTEREST.value, on_off=True).values_list('keyword', flat=True)
salary_keyword = Keywords.objects.filter(
type=KeywordsType.SALARY.value).values_list('keyword', flat=True)
type=KeywordsType.SALARY.value, on_off=True).values_list('keyword', flat=True)
loan_keyword = Keywords.objects.filter(
type__in=[KeywordsType.LOAN.value, KeywordsType.ALI_WECHART.value]).values_list(
type__in=[KeywordsType.LOAN.value, KeywordsType.ALI_WECHART.value], on_off=True).values_list(
'keyword', flat=True)
wb = BSWorkbook(interest_keyword, salary_keyword, loan_keyword)
......@@ -504,8 +503,8 @@ class Command(BaseCommand, LoggerMixin):
else:
try:
# 5.上传至EDMS
# self.edms.upload(excel_path, doc, business_type)
print('upload pass')
self.edms.upload(excel_path, doc, business_type)
# print('upload pass')
except Exception as e:
doc.status = DocStatus.UPLOAD_FAILED.value
doc.save()
......
......@@ -191,9 +191,9 @@ class BSWorkbook(Workbook):
def create_meta_sheet(self, card):
if self.worksheets[0].title == 'Sheet':
ms = self.worksheets[0]
ms.title = '{0}({1})'.format(self.meta_sheet_title, card)
ms.title = '{0}({1})'.format(self.meta_sheet_title, card[-6:])
else:
ms = self.create_sheet('{0}({1})'.format(self.meta_sheet_title, card))
ms = self.create_sheet('{0}({1})'.format(self.meta_sheet_title, card[-6:]))
return ms
def build_meta_sheet(self, card, confidence, code, print_time, start_date, end_date):
......@@ -243,7 +243,7 @@ class BSWorkbook(Workbook):
else:
over_cell.number_format = numbers.FORMAT_NUMBER_COMMA_SEPARATED1
# 3.4.额转数值
# 3.4.额转数值
try:
try:
if isinstance(amount_cell.value, str): # TODO 可在转化数字失败后,再替换
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!