4e23f1f3 by 冯轩

Merge branch 'hotfix/2025-04'

2 parents 1a883ccb f3491a1e
...@@ -1344,8 +1344,8 @@ class Command(BaseCommand, LoggerMixin): ...@@ -1344,8 +1344,8 @@ class Command(BaseCommand, LoggerMixin):
1344 except Exception as e: 1344 except Exception as e:
1345 self.online_log.error('{0} [process error (get doc info out)] [error={1}]'.format( 1345 self.online_log.error('{0} [process error (get doc info out)] [error={1}]'.format(
1346 self.log_base, traceback.format_exc())) 1346 self.log_base, traceback.format_exc()))
1347 error_list.append(1) 1347 # error_list.append(1)
1348 return 1348 # return
1349 else: 1349 else:
1350 doc_data_path = os.path.join(self.data_dir, business_type, consts.TMP_DIR_NAME, str(doc.id)) 1350 doc_data_path = os.path.join(self.data_dir, business_type, consts.TMP_DIR_NAME, str(doc.id))
1351 os.makedirs(doc_data_path, exist_ok=True) 1351 os.makedirs(doc_data_path, exist_ok=True)
...@@ -1502,8 +1502,8 @@ class Command(BaseCommand, LoggerMixin): ...@@ -1502,8 +1502,8 @@ class Command(BaseCommand, LoggerMixin):
1502 except Exception as e: 1502 except Exception as e:
1503 self.online_log.error('{0} [process error (db save)] [error={1}]'.format( 1503 self.online_log.error('{0} [process error (db save)] [error={1}]'.format(
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 else: # e-contract or or e-fsm-contract or e-hmh 1507 else: # e-contract or or e-fsm-contract or e-hmh
1508 try: 1508 try:
1509 # pdf下载 处理 图片存储 识别 1509 # pdf下载 处理 图片存储 识别
...@@ -1645,8 +1645,8 @@ class Command(BaseCommand, LoggerMixin): ...@@ -1645,8 +1645,8 @@ class Command(BaseCommand, LoggerMixin):
1645 except Exception as e: 1645 except Exception as e:
1646 self.online_log.error('{0} [process error (db save)] [error={1}]'.format( 1646 self.online_log.error('{0} [process error (db save)] [error={1}]'.format(
1647 self.e_log_base, traceback.format_exc())) 1647 self.e_log_base, traceback.format_exc()))
1648 error_list.append(1) 1648 # error_list.append(1)
1649 return 1649 # return
1650 1650
1651 def img_2_ocr_1(self, img_queue, todo_count_dict, res_dict, finish_queue, lock, url, error_list): 1651 def img_2_ocr_1(self, img_queue, todo_count_dict, res_dict, finish_queue, lock, url, error_list):
1652 while len(error_list) == 0 or not img_queue.empty(): 1652 while len(error_list) == 0 or not img_queue.empty():
......
...@@ -3938,29 +3938,6 @@ def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_ ...@@ -3938,29 +3938,6 @@ def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_
3938 ocr_res_id, is_ca, is_cms)) 3938 ocr_res_id, is_ca, is_cms))
3939 return 3939 return
3940 3940
3941 # 根据application_id查找OCR累计结果指定license字段,如果没有,结束
3942 if is_ca:
3943 result_class = HILOCRResult if application_entity == consts.HIL_PREFIX else AFCOCRResult
3944 ca_ocr_res_dict = dict()
3945 else:
3946 result_class = HILSEOCRResult if application_entity == consts.HIL_PREFIX else AFCSEOCRResult
3947 ca_result_class = HILOCRResult if application_entity == consts.HIL_PREFIX else AFCOCRResult
3948 # if ocr_res_id is None:
3949 ca_ocr_res_dict = ca_result_class.objects.filter(application_id=application_id).values(
3950 *consts.CA_ADD_COMPARE_FIELDS).first()
3951 # else:
3952 # ca_ocr_res_dict = ca_result_class.objects.filter(id=ocr_res_id).values(
3953 # *consts.CA_ADD_COMPARE_FIELDS).first()
3954 if ocr_res_id is None:
3955 ocr_res_dict = result_class.objects.filter(application_id=application_id).values(*consts.COMPARE_FIELDS).first()
3956 else:
3957 ocr_res_dict = result_class.objects.filter(id=ocr_res_id).values(*consts.COMPARE_FIELDS).first()
3958 if ocr_res_dict is None:
3959 compare_log.info('{0} [ocr info empty] [entity={1}] [id={2}] [uniq_seq={3}] [ocr_res_id={4}] '
3960 '[is_ca={5}] [is_cms]={6}'.format(log_base, application_entity, application_id,
3961 uniq_seq, ocr_res_id, is_ca, is_cms))
3962 return
3963
3964 # 查看此订单号下是否有未完成的文件,如果有,等?分钟 3941 # 查看此订单号下是否有未完成的文件,如果有,等?分钟
3965 try: 3942 try:
3966 doc_wait_file_class = HILDoc if application_entity == consts.HIL_PREFIX else AFCDoc 3943 doc_wait_file_class = HILDoc if application_entity == consts.HIL_PREFIX else AFCDoc
...@@ -3988,7 +3965,29 @@ def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_ ...@@ -3988,7 +3965,29 @@ def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_
3988 except Exception as e: 3965 except Exception as e:
3989 compare_log.info('[sleep error] [error={0}]'.format(traceback.format_exc())) 3966 compare_log.info('[sleep error] [error={0}]'.format(traceback.format_exc()))
3990 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)) 3967 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))
3991 3968
3969 # 根据application_id查找OCR累计结果指定license字段,如果没有,结束
3970 if is_ca:
3971 result_class = HILOCRResult if application_entity == consts.HIL_PREFIX else AFCOCRResult
3972 ca_ocr_res_dict = dict()
3973 else:
3974 result_class = HILSEOCRResult if application_entity == consts.HIL_PREFIX else AFCSEOCRResult
3975 ca_result_class = HILOCRResult if application_entity == consts.HIL_PREFIX else AFCOCRResult
3976 # if ocr_res_id is None:
3977 ca_ocr_res_dict = ca_result_class.objects.filter(application_id=application_id).values(
3978 *consts.CA_ADD_COMPARE_FIELDS).first()
3979 # else:
3980 # ca_ocr_res_dict = ca_result_class.objects.filter(id=ocr_res_id).values(
3981 # *consts.CA_ADD_COMPARE_FIELDS).first()
3982 if ocr_res_id is None:
3983 ocr_res_dict = result_class.objects.filter(application_id=application_id).values(*consts.COMPARE_FIELDS).first()
3984 else:
3985 ocr_res_dict = result_class.objects.filter(id=ocr_res_id).values(*consts.COMPARE_FIELDS).first()
3986 if ocr_res_dict is None:
3987 compare_log.info('{0} [ocr info empty] [entity={1}] [id={2}] [uniq_seq={3}] [ocr_res_id={4}] '
3988 '[is_ca={5}] [is_cms]={6}'.format(log_base, application_entity, application_id,
3989 uniq_seq, ocr_res_id, is_ca, is_cms))
3990 return
3992 3991
3993 if is_ca: 3992 if is_ca:
3994 ca_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res_dict) 3993 ca_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res_dict)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!