MOD:非fsm比对前先判断有没有cms信息,避免等待4分钟过程中来了cms信息且是fsm导致的比对逻辑错误
Showing
1 changed file
with
25 additions
and
25 deletions
... | @@ -3820,31 +3820,6 @@ def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_ | ... | @@ -3820,31 +3820,6 @@ def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_ |
3820 | '[is_cms={6}]'.format(log_base, application_entity, application_id, uniq_seq, ocr_res_id, | 3820 | '[is_cms={6}]'.format(log_base, application_entity, application_id, uniq_seq, ocr_res_id, |
3821 | is_ca, is_cms)) | 3821 | is_ca, is_cms)) |
3822 | 3822 | ||
3823 | # 查看此订单号下是否有未完成的文件,如果有,等?分钟 | ||
3824 | doc_wait_file_class = HILDoc if application_entity == consts.HIL_PREFIX else AFCDoc | ||
3825 | doc_wait_file_result = doc_wait_file_class.objects.filter(application_id=application_id, status=1).first() | ||
3826 | compare_log.info('doc_wait_file_result:{0}'.format(doc_wait_file_result)) | ||
3827 | compare_log.info('{0} [comparison unfinished file check] [entity={1}] [id={2}] [doc_wait_file_result={3}]'.format(log_base, application_entity, application_id, doc_wait_file_result)) | ||
3828 | if doc_wait_file_result is not None: | ||
3829 | # 实时查询延迟时间 | ||
3830 | try: | ||
3831 | delay_time_config = Configs.objects.filter(id=4).first() | ||
3832 | if delay_time_config is not None and delay_time_config.value is not None and delay_time_config.value.isdigit(): | ||
3833 | delay_time = delay_time_config.value | ||
3834 | else: | ||
3835 | delay_time = 0 | ||
3836 | except Exception as e: | ||
3837 | delay_time = 0 | ||
3838 | compare_log.info('[get delay_time_config fail] [error={0}]'.format(traceback.format_exc())) | ||
3839 | compare_log.info('delay_time:{0}'.format(delay_time)) | ||
3840 | compare_log.info('{0} [comparison unfinished file wait delay_time start] [entity={1}] [id={2}] [doc_id={3}]'.format(log_base, application_entity, application_id, doc_wait_file_result.id)) | ||
3841 | try: | ||
3842 | time.sleep(int(delay_time)) | ||
3843 | except Exception as e: | ||
3844 | compare_log.info('[sleep error] [error={0}]'.format(traceback.format_exc())) | ||
3845 | 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)) | ||
3846 | |||
3847 | |||
3848 | # 根据application_id查找最新的比对信息,如果没有,结束 | 3823 | # 根据application_id查找最新的比对信息,如果没有,结束 |
3849 | if is_ca: | 3824 | if is_ca: |
3850 | comparison_class = HILComparisonInfo if application_entity == consts.HIL_PREFIX else AFCComparisonInfo | 3825 | comparison_class = HILComparisonInfo if application_entity == consts.HIL_PREFIX else AFCComparisonInfo |
... | @@ -3883,6 +3858,31 @@ def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_ | ... | @@ -3883,6 +3858,31 @@ def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_ |
3883 | uniq_seq, ocr_res_id, is_ca, is_cms)) | 3858 | uniq_seq, ocr_res_id, is_ca, is_cms)) |
3884 | return | 3859 | return |
3885 | 3860 | ||
3861 | # 查看此订单号下是否有未完成的文件,如果有,等?分钟 | ||
3862 | doc_wait_file_class = HILDoc if application_entity == consts.HIL_PREFIX else AFCDoc | ||
3863 | doc_wait_file_result = doc_wait_file_class.objects.filter(application_id=application_id, status=1).first() | ||
3864 | compare_log.info('doc_wait_file_result:{0}'.format(doc_wait_file_result)) | ||
3865 | compare_log.info('{0} [comparison unfinished file check] [entity={1}] [id={2}] [doc_wait_file_result={3}]'.format(log_base, application_entity, application_id, doc_wait_file_result)) | ||
3866 | if doc_wait_file_result is not None: | ||
3867 | # 实时查询延迟时间 | ||
3868 | try: | ||
3869 | delay_time_config = Configs.objects.filter(id=4).first() | ||
3870 | if delay_time_config is not None and delay_time_config.value is not None and delay_time_config.value.isdigit(): | ||
3871 | delay_time = delay_time_config.value | ||
3872 | else: | ||
3873 | delay_time = 0 | ||
3874 | except Exception as e: | ||
3875 | delay_time = 0 | ||
3876 | compare_log.info('[get delay_time_config fail] [error={0}]'.format(traceback.format_exc())) | ||
3877 | compare_log.info('delay_time:{0}'.format(delay_time)) | ||
3878 | compare_log.info('{0} [comparison unfinished file wait delay_time start] [entity={1}] [id={2}] [doc_id={3}]'.format(log_base, application_entity, application_id, doc_wait_file_result.id)) | ||
3879 | try: | ||
3880 | time.sleep(int(delay_time)) | ||
3881 | except Exception as e: | ||
3882 | compare_log.info('[sleep error] [error={0}]'.format(traceback.format_exc())) | ||
3883 | 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)) | ||
3884 | |||
3885 | |||
3886 | if is_ca: | 3886 | if is_ca: |
3887 | ca_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res_dict) | 3887 | ca_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res_dict) |
3888 | else: | 3888 | else: | ... | ... |
-
Please register or sign in to post a comment