140571d0 by 冯轩

Merge branch 'hotfix/2025-06'

2 parents 664104f6 22ff4376
......@@ -3939,6 +3939,8 @@ def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_
'[is_ca={5}] [is_cms]={6}'.format(log_base, application_entity, application_id, uniq_seq,
ocr_res_id, is_ca, is_cms))
return
else:
compare_log.info('{0} [comparison info 1] [entity={1}] [id={2}] [last_obj={3}]'.format(log_base, application_entity, application_id, last_obj))
# 查看此订单号下是否有未完成的文件,如果有,等?分钟
try:
......@@ -3968,6 +3970,10 @@ def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_
compare_log.info('[sleep error] [error={0}]'.format(traceback.format_exc()))
compare_log.info('{0} [comparison unfinished file wait delay_time end] [entity={1}] [id={2}] [doc_id={3}]'.format(log_base, application_entity, application_id, doc_wait_file_result.id))
# 等待结束后,重新查询cms最新信息
last_obj = comparison_class.objects.filter(application_id=application_id).last()
compare_log.info('{0} [comparison info 2] [entity={1}] [id={2}] [last_obj={3}]'.format(log_base, application_entity, application_id, last_obj))
# 根据application_id查找OCR累计结果指定license字段,如果没有,结束
if is_ca:
result_class = HILOCRResult if application_entity == consts.HIL_PREFIX else AFCOCRResult
......
......@@ -11,6 +11,7 @@ from apps.account.authentication import OAuth2AuthenticationWithUser
from apps.doc.models import NscInvoice
import json
from datetime import datetime
import traceback
params = {
'invoiceCode': fields.Str(required=True, validate=validate.Length(max=128)),
......@@ -39,6 +40,7 @@ class NSCInvoiceView(GenericView):
@use_args(input_args, location='data')
def post(self, request, args): # interface_report mpos to ocr
try:
content = args.get('content', {})
invoice_code = content.get('invoiceCode', '')
invoice_number = content.get('invoiceNumber', '')
......@@ -54,6 +56,8 @@ class NSCInvoiceView(GenericView):
vat_rate = content.get('vatRate', 0.0)
NscInvoice.objects.create(vin=vin, content=json.dumps(content), create_time=datetime.now())
except Exception as e:
LoggerMixin.running_log.info('[NSCInvoice save failed] [error={0}]'.format(traceback.format_exc()))
return response.ok()
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!