ADD:log
Showing
1 changed file
with
7 additions
and
3 deletions
... | @@ -2574,6 +2574,7 @@ def se_compare_license(license_en, ocr_res_dict, field_list): | ... | @@ -2574,6 +2574,7 @@ def se_compare_license(license_en, ocr_res_dict, field_list): |
2574 | return result_field_list, no_ocr_result, field_img_path_dict | 2574 | return result_field_list, no_ocr_result, field_img_path_dict |
2575 | 2575 | ||
2576 | def se_fs_compare(license_en, ocr_res_dict, field_list): | 2576 | def se_fs_compare(license_en, ocr_res_dict, field_list): |
2577 | compare_log.info('{0} [se_fs_compare] start'.format(log_base)) | ||
2577 | ocr_field, compare_logic, special_expiry_date = consts.SE_COMPARE_FIELD[license_en] | 2578 | ocr_field, compare_logic, special_expiry_date = consts.SE_COMPARE_FIELD[license_en] |
2578 | 2579 | ||
2579 | is_find = False | 2580 | is_find = False |
... | @@ -2583,16 +2584,19 @@ def se_fs_compare(license_en, ocr_res_dict, field_list): | ... | @@ -2583,16 +2584,19 @@ def se_fs_compare(license_en, ocr_res_dict, field_list): |
2583 | section_img_info = dict() | 2584 | section_img_info = dict() |
2584 | field_img_path_dict = dict() | 2585 | field_img_path_dict = dict() |
2585 | ocr_res_str = ocr_res_dict.get(ocr_field) | 2586 | ocr_res_str = ocr_res_dict.get(ocr_field) |
2587 | compare_log.info('{0} [se_fs_compare] ocr_res:{1}'.format(log_base, ocr_res_str)) | ||
2586 | if ocr_res_str is not None: | 2588 | if ocr_res_str is not None: |
2587 | ocr_res_list = json.loads(ocr_res_str) | 2589 | ocr_res_list = json.loads(ocr_res_str) |
2588 | 2590 | ||
2589 | length = len(ocr_res_list) | 2591 | length = len(ocr_res_list) |
2590 | 2592 | ||
2591 | # 先判断最后一次上传的文件是不是包括3个,如果不是直接返回"未提供财报或财报不完整" | ||
2592 | last_ocr_str = ocr_res_list[length-1] | 2593 | last_ocr_str = ocr_res_list[length-1] |
2594 | compare_log.info('{0} [se_fs_compare] [code len {1}] [stamp len {2}] ]'.format(log_base, len(last_ocr_str.get('code',{})), len(last_ocr_str.get('stamp',{})))) | ||
2595 | |||
2593 | if len(last_ocr_str.get('code',{})) != 3 or len(last_ocr_str.get('stamp',{})) != 3: | 2596 | if len(last_ocr_str.get('code',{})) != 3 or len(last_ocr_str.get('stamp',{})) != 3: |
2594 | compare_log.info('{0} [se_fs_compare] last ocr result len < 3'.format(log_base)) | 2597 | # 先判断最后一次上传的文件是不是包括3个,如果不是直接返回"未提供财报或财报不完整" |
2595 | else: | 2598 | compare_log.info('{0} [se_fs_compare error] last ocr result len < 3'.format(log_base)) |
2599 | else: | ||
2596 | for res_idx in range(length-1, -1, -1): | 2600 | for res_idx in range(length-1, -1, -1): |
2597 | if is_find: | 2601 | if is_find: |
2598 | break | 2602 | break | ... | ... |
-
Please register or sign in to post a comment