4eccdb7d by 周伟奇

fix TCSEP selfEmployedSubType

1 parent 7b3b25a1
......@@ -88,6 +88,9 @@ def field_compare(info_dict, ocr_res_dict, ocr_field, compare_list, res_set,
break
for idx, compare_tuple in enumerate(compare_list):
input_str = info_dict.get(compare_tuple[0])
if not isinstance(input_str, str) and compare_tuple[0] == 'selfEmployedSubType':
continue
ocr_str = ocr_res.get(compare_tuple[1])
compare_res, ocr_output = getattr(cp, compare_tuple[2])(
input_str, ocr_str, idx, **compare_tuple[3])
......@@ -388,7 +391,7 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id):
ocr_res_id, res_text))
compare_log.info('{0} [task success] [entity={1}] [id={2}] [uniq_seq={3}] [ocr_res_id={4}]'.format(
log_base, application_entity, application_id, uniq_seq, ocr_res_id))
finally:
try:
end_time = datetime.now()
if compare_failed:
......@@ -428,13 +431,13 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id):
total_fields += 3
if not successful_at_this_level:
for field_name, _, _, _, result_field in consts.TCSEP:
if individual.get(result_field) != consts.RESULT_Y:
if result_field in individual and individual.get(result_field) != consts.RESULT_Y:
field_list.append(field_name)
if len(field_list) > 0:
field_failed['individualCusInfo'].append(';'.join(field_list))
corporate_res = comparison_res.get('OCR_Input', {}).get('corporateCusInfo')
corporate_res = comparison_res.get('OCR_Input', {}).get('corporateCusInfo', {})
if corporate_res is not None:
total_fields += 8
if not successful_at_this_level:
......@@ -445,7 +448,7 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id):
if len(corporate_field_list) > 0:
field_failed['corporateCusInfo'].append(';'.join(corporate_field_list))
used_car_res = comparison_res.get('OCR_Input', {}).get('usedCarInfo')
used_car_res = comparison_res.get('OCR_Input', {}).get('usedCarInfo', {})
if used_car_res is not None:
total_fields += 3
if not successful_at_this_level:
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!