f5984e39 by 周伟奇

fix bug

1 parent 7268a3ce
...@@ -1353,14 +1353,14 @@ BC_COMPARE_LOGIC = { ...@@ -1353,14 +1353,14 @@ BC_COMPARE_LOGIC = {
1353 } 1353 }
1354 1354
1355 DDA_COMPARE_LOGIC = { 1355 DDA_COMPARE_LOGIC = {
1356 'applicationId(1)': ('check_Num', ), 1356 'applicationId(1)': ('check_Num', 'se_common_compare', {}),
1357 'applicationId(2)': ('check_Num', ), 1357 'applicationId(2)': ('check_Num', 'se_common_compare', {}),
1358 'bankName': ('to_bank', ), 1358 'bankName': ('to_bank', 'se_common_compare', {}),
1359 'companyName': ('to_company', ), 1359 'companyName': ('to_company', 'se_company_compare', {}),
1360 'customerName': (DDA_IC_NAME, ), 1360 'customerName': (DDA_IC_NAME, 'se_common_compare', {}),
1361 'idNum': (DDA_IC_ID, ), 1361 'idNum': (DDA_IC_ID, 'se_common_compare', {}),
1362 'accountHolderName': (DDA_BC_NAME, ), 1362 'accountHolderName': (DDA_BC_NAME, 'se_common_compare', {}),
1363 'accountNo': (DDA_BC_ID, ), 1363 'accountNo': (DDA_BC_ID, 'se_common_compare', {}),
1364 } 1364 }
1365 1365
1366 1366
......
...@@ -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')
......
...@@ -453,7 +453,7 @@ def get_se_compare_info(last_obj, application_entity): ...@@ -453,7 +453,7 @@ def get_se_compare_info(last_obj, application_entity):
453 field_input.append((field, individual_info[field])) 453 field_input.append((field, individual_info[field]))
454 license_dict[license_en] = field_input 454 license_dict[license_en] = field_input
455 455
456 if individual_info['secondIdType'] in consts.SE_SECOND_ID_FIELD_MAPPING: 456 if individual_info.get('secondIdType') in consts.SE_SECOND_ID_FIELD_MAPPING:
457 second_license_en, second_field_list = consts.SE_SECOND_ID_FIELD_MAPPING[individual_info['secondIdType']] 457 second_license_en, second_field_list = consts.SE_SECOND_ID_FIELD_MAPPING[individual_info['secondIdType']]
458 if second_license_en not in license_dict: 458 if second_license_en not in license_dict:
459 second_field_input = [] 459 second_field_input = []
...@@ -631,31 +631,32 @@ def se_compare_process(compare_info, ocr_res_dict): ...@@ -631,31 +631,32 @@ def se_compare_process(compare_info, ocr_res_dict):
631 631
632 for info_key, info_value in compare_info.items(): 632 for info_key, info_value in compare_info.items():
633 if info_key == 'individualCusInfo': 633 if info_key == 'individualCusInfo':
634 for idx, license_dict in info_value.items(): 634 for idx, license_list in info_value.items():
635 for license_en, field_list in license_dict.items(): 635 for license_dict in license_list:
636 failure_field = [] 636 for license_en, field_list in license_dict.items():
637 result_field_list = se_compare_license(license_en, ocr_res_dict, field_list) 637 failure_field = []
638 for name, value, result, ocr_str in result_field_list: 638 result_field_list = se_compare_license(license_en, ocr_res_dict, field_list)
639 total_fields += 1 639 for name, value, result, ocr_str in result_field_list:
640 if result == consts.RESULT_N: 640 total_fields += 1
641 failed_count += 1 641 if result == consts.RESULT_N:
642 successful_at_this_level = False 642 failed_count += 1
643 failure_field.append(name) 643 successful_at_this_level = False
644 compare_result.append( 644 failure_field.append(name)
645 { 645 compare_result.append(
646 'Info': info_key, 646 {
647 'Index': idx, 647 'Info': info_key,
648 'License': license_en, 648 'Index': idx,
649 'Field': name, 649 'License': license_en,
650 'Input': value, 650 'Field': name,
651 'OCR': ocr_str, 651 'Input': value,
652 'Result': result, 652 'OCR': ocr_str,
653 'Position': '', 653 'Result': result,
654 'Image': '', 654 'Position': '',
655 'errorType': '', 655 'Image': '',
656 } 656 'errorType': '',
657 ) 657 }
658 failure_reason.setdefault(license_en, []).append('/'.join(failure_field)) 658 )
659 failure_reason.setdefault(license_en, []).append('/'.join(failure_field))
659 else: 660 else:
660 for license_en, field_list in info_value.items(): 661 for license_en, field_list in info_value.items():
661 failure_field = [] 662 failure_field = []
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!