Merge branch 'feature/ca_compare' into feature/0611
Showing
1 changed file
with
7 additions
and
4 deletions
... | @@ -88,6 +88,9 @@ def field_compare(info_dict, ocr_res_dict, ocr_field, compare_list, res_set, | ... | @@ -88,6 +88,9 @@ def field_compare(info_dict, ocr_res_dict, ocr_field, compare_list, res_set, |
88 | break | 88 | break |
89 | for idx, compare_tuple in enumerate(compare_list): | 89 | for idx, compare_tuple in enumerate(compare_list): |
90 | input_str = info_dict.get(compare_tuple[0]) | 90 | input_str = info_dict.get(compare_tuple[0]) |
91 | if not isinstance(input_str, str) and compare_tuple[0] == 'selfEmployedSubType': | ||
92 | continue | ||
93 | |||
91 | ocr_str = ocr_res.get(compare_tuple[1]) | 94 | ocr_str = ocr_res.get(compare_tuple[1]) |
92 | compare_res, ocr_output = getattr(cp, compare_tuple[2])( | 95 | compare_res, ocr_output = getattr(cp, compare_tuple[2])( |
93 | input_str, ocr_str, idx, **compare_tuple[3]) | 96 | input_str, ocr_str, idx, **compare_tuple[3]) |
... | @@ -388,7 +391,7 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id): | ... | @@ -388,7 +391,7 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id): |
388 | ocr_res_id, res_text)) | 391 | ocr_res_id, res_text)) |
389 | compare_log.info('{0} [task success] [entity={1}] [id={2}] [uniq_seq={3}] [ocr_res_id={4}]'.format( | 392 | compare_log.info('{0} [task success] [entity={1}] [id={2}] [uniq_seq={3}] [ocr_res_id={4}]'.format( |
390 | log_base, application_entity, application_id, uniq_seq, ocr_res_id)) | 393 | log_base, application_entity, application_id, uniq_seq, ocr_res_id)) |
391 | finally: | 394 | |
392 | try: | 395 | try: |
393 | end_time = datetime.now() | 396 | end_time = datetime.now() |
394 | if compare_failed: | 397 | if compare_failed: |
... | @@ -428,13 +431,13 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id): | ... | @@ -428,13 +431,13 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id): |
428 | total_fields += 3 | 431 | total_fields += 3 |
429 | if not successful_at_this_level: | 432 | if not successful_at_this_level: |
430 | for field_name, _, _, _, result_field in consts.TCSEP: | 433 | for field_name, _, _, _, result_field in consts.TCSEP: |
431 | if individual.get(result_field) != consts.RESULT_Y: | 434 | if result_field in individual and individual.get(result_field) != consts.RESULT_Y: |
432 | field_list.append(field_name) | 435 | field_list.append(field_name) |
433 | 436 | ||
434 | if len(field_list) > 0: | 437 | if len(field_list) > 0: |
435 | field_failed['individualCusInfo'].append(';'.join(field_list)) | 438 | field_failed['individualCusInfo'].append(';'.join(field_list)) |
436 | 439 | ||
437 | corporate_res = comparison_res.get('OCR_Input', {}).get('corporateCusInfo') | 440 | corporate_res = comparison_res.get('OCR_Input', {}).get('corporateCusInfo', {}) |
438 | if corporate_res is not None: | 441 | if corporate_res is not None: |
439 | total_fields += 8 | 442 | total_fields += 8 |
440 | if not successful_at_this_level: | 443 | if not successful_at_this_level: |
... | @@ -445,7 +448,7 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id): | ... | @@ -445,7 +448,7 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id): |
445 | if len(corporate_field_list) > 0: | 448 | if len(corporate_field_list) > 0: |
446 | field_failed['corporateCusInfo'].append(';'.join(corporate_field_list)) | 449 | field_failed['corporateCusInfo'].append(';'.join(corporate_field_list)) |
447 | 450 | ||
448 | used_car_res = comparison_res.get('OCR_Input', {}).get('usedCarInfo') | 451 | used_car_res = comparison_res.get('OCR_Input', {}).get('usedCarInfo', {}) |
449 | if used_car_res is not None: | 452 | if used_car_res is not None: |
450 | total_fields += 3 | 453 | total_fields += 3 |
451 | if not successful_at_this_level: | 454 | if not successful_at_this_level: | ... | ... |
-
Please register or sign in to post a comment