Merge branch 'feature/se_compare_yh' into feature/0611
Showing
1 changed file
with
11 additions
and
5 deletions
| ... | @@ -650,7 +650,7 @@ def ca_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res | ... | @@ -650,7 +650,7 @@ def ca_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res |
| 650 | if len(field_list) > 0: | 650 | if len(field_list) > 0: |
| 651 | field_failed['individualCusInfo'].append(';'.join(field_list)) | 651 | field_failed['individualCusInfo'].append(';'.join(field_list)) |
| 652 | 652 | ||
| 653 | corporate_res = comparison_res.get('OCR_Input', {}).get('corporateCusInfo', {}) | 653 | corporate_res = comparison_res.get('OCR_Input', {}).get('corporateCusInfo') |
| 654 | if corporate_res is not None: | 654 | if corporate_res is not None: |
| 655 | total_fields += 8 | 655 | total_fields += 8 |
| 656 | if not successful_at_this_level: | 656 | if not successful_at_this_level: |
| ... | @@ -661,7 +661,7 @@ def ca_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res | ... | @@ -661,7 +661,7 @@ def ca_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res |
| 661 | if len(corporate_field_list) > 0: | 661 | if len(corporate_field_list) > 0: |
| 662 | field_failed['corporateCusInfo'].append(';'.join(corporate_field_list)) | 662 | field_failed['corporateCusInfo'].append(';'.join(corporate_field_list)) |
| 663 | 663 | ||
| 664 | used_car_res = comparison_res.get('OCR_Input', {}).get('usedCarInfo', {}) | 664 | used_car_res = comparison_res.get('OCR_Input', {}).get('usedCarInfo') |
| 665 | if used_car_res is not None: | 665 | if used_car_res is not None: |
| 666 | total_fields += 3 | 666 | total_fields += 3 |
| 667 | if not successful_at_this_level: | 667 | if not successful_at_this_level: |
| ... | @@ -1048,7 +1048,7 @@ def se_compare_process(compare_info, ocr_res_dict): | ... | @@ -1048,7 +1048,7 @@ def se_compare_process(compare_info, ocr_res_dict): |
| 1048 | } | 1048 | } |
| 1049 | ) | 1049 | ) |
| 1050 | if len(failure_field) > 0: | 1050 | if len(failure_field) > 0: |
| 1051 | failure_reason.setdefault(license_en, []).append('/'.join(failure_field)) | 1051 | failure_reason.setdefault(info_key, []).append(';'.join(failure_field)) |
| 1052 | else: | 1052 | else: |
| 1053 | for license_en, field_list in info_value.items(): | 1053 | for license_en, field_list in info_value.items(): |
| 1054 | failure_field = [] | 1054 | failure_field = [] |
| ... | @@ -1077,11 +1077,16 @@ def se_compare_process(compare_info, ocr_res_dict): | ... | @@ -1077,11 +1077,16 @@ def se_compare_process(compare_info, ocr_res_dict): |
| 1077 | } | 1077 | } |
| 1078 | ) | 1078 | ) |
| 1079 | if len(failure_field) > 0: | 1079 | if len(failure_field) > 0: |
| 1080 | failure_reason.setdefault(license_en, []).append('/'.join(failure_field)) | 1080 | failure_reason.setdefault(info_key, []).append(';'.join(failure_field)) |
| 1081 | if failed_count == 0: | 1081 | if failed_count == 0: |
| 1082 | failure_reason_str = '' | 1082 | failure_reason_str = '' |
| 1083 | else: | 1083 | else: |
| 1084 | failure_reason_str = json.dumps(failure_reason) | 1084 | reason_list = [] |
| 1085 | for key, value in failure_reason.items(): | ||
| 1086 | if len(value) > 0: | ||
| 1087 | value_str = json.dumps(value) | ||
| 1088 | reason_list.append('{0}: {1}'.format(key, value_str)) | ||
| 1089 | failure_reason_str = '、'.join(reason_list) | ||
| 1085 | return compare_result, total_fields, failed_count, successful_at_this_level, failure_reason_str | 1090 | return compare_result, total_fields, failed_count, successful_at_this_level, failure_reason_str |
| 1086 | 1091 | ||
| 1087 | 1092 | ||
| ... | @@ -1093,6 +1098,7 @@ def se_result_detect(ocr_res_dict): | ... | @@ -1093,6 +1098,7 @@ def se_result_detect(ocr_res_dict): |
| 1093 | detect_list.append(ocr_res_str is None) | 1098 | detect_list.append(ocr_res_str is None) |
| 1094 | return detect_list | 1099 | return detect_list |
| 1095 | 1100 | ||
| 1101 | |||
| 1096 | def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res_dict): | 1102 | def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res_dict): |
| 1097 | try: | 1103 | try: |
| 1098 | # 比对逻辑 | 1104 | # 比对逻辑 | ... | ... |
-
Please register or sign in to post a comment