Merge branch 'feature/se_compare3' into feature/0611
Showing
3 changed files
with
37 additions
and
34 deletions
... | @@ -1388,14 +1388,14 @@ BC_COMPARE_LOGIC = { | ... | @@ -1388,14 +1388,14 @@ BC_COMPARE_LOGIC = { |
1388 | } | 1388 | } |
1389 | 1389 | ||
1390 | DDA_COMPARE_LOGIC = { | 1390 | DDA_COMPARE_LOGIC = { |
1391 | 'applicationId(1)': ('check_Num', ), | 1391 | 'applicationId(1)': ('check_Num', 'se_common_compare', {}), |
1392 | 'applicationId(2)': ('check_Num', ), | 1392 | 'applicationId(2)': ('check_Num', 'se_common_compare', {}), |
1393 | 'bankName': ('to_bank', ), | 1393 | 'bankName': ('to_bank', 'se_common_compare', {}), |
1394 | 'companyName': ('to_company', ), | 1394 | 'companyName': ('to_company', 'se_company_compare', {}), |
1395 | 'customerName': (DDA_IC_NAME, ), | 1395 | 'customerName': (DDA_IC_NAME, 'se_common_compare', {}), |
1396 | 'idNum': (DDA_IC_ID, ), | 1396 | 'idNum': (DDA_IC_ID, 'se_common_compare', {}), |
1397 | 'accountHolderName': (DDA_BC_NAME, ), | 1397 | 'accountHolderName': (DDA_BC_NAME, 'se_common_compare', {}), |
1398 | 'accountNo': (DDA_BC_ID, ), | 1398 | 'accountNo': (DDA_BC_ID, 'se_common_compare', {}), |
1399 | } | 1399 | } |
1400 | 1400 | ||
1401 | 1401 | ... | ... |
... | @@ -751,6 +751,8 @@ class DocView(GenericView, DocHandler): | ... | @@ -751,6 +751,8 @@ class DocView(GenericView, DocHandler): |
751 | 751 | ||
752 | 752 | ||
753 | class CompareResultView(GenericView): | 753 | class CompareResultView(GenericView): |
754 | permission_classes = [] | ||
755 | authentication_classes = [] | ||
754 | 756 | ||
755 | # 获取比对结果 | 757 | # 获取比对结果 |
756 | @use_args(compare_result_args, location='querystring') | 758 | @use_args(compare_result_args, location='querystring') | ... | ... |
... | @@ -497,7 +497,7 @@ def get_se_compare_info(last_obj, application_entity): | ... | @@ -497,7 +497,7 @@ def get_se_compare_info(last_obj, application_entity): |
497 | field_input.append((field, individual_info[field])) | 497 | field_input.append((field, individual_info[field])) |
498 | license_dict[license_en] = field_input | 498 | license_dict[license_en] = field_input |
499 | 499 | ||
500 | if individual_info['secondIdType'] in consts.SE_SECOND_ID_FIELD_MAPPING: | 500 | if individual_info.get('secondIdType') in consts.SE_SECOND_ID_FIELD_MAPPING: |
501 | second_license_en, second_field_list = consts.SE_SECOND_ID_FIELD_MAPPING[individual_info['secondIdType']] | 501 | second_license_en, second_field_list = consts.SE_SECOND_ID_FIELD_MAPPING[individual_info['secondIdType']] |
502 | if second_license_en not in license_dict: | 502 | if second_license_en not in license_dict: |
503 | second_field_input = [] | 503 | second_field_input = [] |
... | @@ -675,31 +675,32 @@ def se_compare_process(compare_info, ocr_res_dict): | ... | @@ -675,31 +675,32 @@ def se_compare_process(compare_info, ocr_res_dict): |
675 | 675 | ||
676 | for info_key, info_value in compare_info.items(): | 676 | for info_key, info_value in compare_info.items(): |
677 | if info_key == 'individualCusInfo': | 677 | if info_key == 'individualCusInfo': |
678 | for idx, license_dict in info_value.items(): | 678 | for idx, license_list in info_value.items(): |
679 | for license_en, field_list in license_dict.items(): | 679 | for license_dict in license_list: |
680 | failure_field = [] | 680 | for license_en, field_list in license_dict.items(): |
681 | result_field_list = se_compare_license(license_en, ocr_res_dict, field_list) | 681 | failure_field = [] |
682 | for name, value, result, ocr_str in result_field_list: | 682 | result_field_list = se_compare_license(license_en, ocr_res_dict, field_list) |
683 | total_fields += 1 | 683 | for name, value, result, ocr_str in result_field_list: |
684 | if result == consts.RESULT_N: | 684 | total_fields += 1 |
685 | failed_count += 1 | 685 | if result == consts.RESULT_N: |
686 | successful_at_this_level = False | 686 | failed_count += 1 |
687 | failure_field.append(name) | 687 | successful_at_this_level = False |
688 | compare_result.append( | 688 | failure_field.append(name) |
689 | { | 689 | compare_result.append( |
690 | 'Info': info_key, | 690 | { |
691 | 'Index': idx, | 691 | 'Info': info_key, |
692 | 'License': license_en, | 692 | 'Index': idx, |
693 | 'Field': name, | 693 | 'License': license_en, |
694 | 'Input': value, | 694 | 'Field': name, |
695 | 'OCR': ocr_str, | 695 | 'Input': value, |
696 | 'Result': result, | 696 | 'OCR': ocr_str, |
697 | 'Position': '', | 697 | 'Result': result, |
698 | 'Image': '', | 698 | 'Position': '', |
699 | 'errorType': '', | 699 | 'Image': '', |
700 | } | 700 | 'errorType': '', |
701 | ) | 701 | } |
702 | failure_reason.setdefault(license_en, []).append('/'.join(failure_field)) | 702 | ) |
703 | failure_reason.setdefault(license_en, []).append('/'.join(failure_field)) | ||
703 | else: | 704 | else: |
704 | for license_en, field_list in info_value.items(): | 705 | for license_en, field_list in info_value.items(): |
705 | failure_field = [] | 706 | failure_field = [] | ... | ... |
-
Please register or sign in to post a comment