Merge branch 'fix/1207' into feature/se
Showing
2 changed files
with
6 additions
and
6 deletions
... | @@ -1501,7 +1501,7 @@ HMH_EN = 'Mortgage Waiver Letter' | ... | @@ -1501,7 +1501,7 @@ HMH_EN = 'Mortgage Waiver Letter' |
1501 | JYPZ_EN = 'Used Car Document' | 1501 | JYPZ_EN = 'Used Car Document' |
1502 | AFC_CONTRACT_EN = 'AFC Contract' | 1502 | AFC_CONTRACT_EN = 'AFC Contract' |
1503 | 1503 | ||
1504 | SKIP_CARD = {ID_EN, RP_EN, SME_BL_EN} | 1504 | SKIP_CARD = {SME_BL_EN} |
1505 | 1505 | ||
1506 | 1506 | ||
1507 | ID_COMPARE_LOGIC = { | 1507 | ID_COMPARE_LOGIC = { | ... | ... |
... | @@ -1527,8 +1527,6 @@ def se_afc_contract_compare(license_en, ocr_res_dict, strip_list): | ... | @@ -1527,8 +1527,6 @@ def se_afc_contract_compare(license_en, ocr_res_dict, strip_list): |
1527 | ocr_res = ocr_res_list.pop() | 1527 | ocr_res = ocr_res_list.pop() |
1528 | 1528 | ||
1529 | for name, value in strip_list: | 1529 | for name, value in strip_list: |
1530 | ocr_str_or_list = ocr_res.get(compare_logic[name][0]) | ||
1531 | |||
1532 | if name == consts.SE_AFC_CON_FIELD[21]: | 1530 | if name == consts.SE_AFC_CON_FIELD[21]: |
1533 | if len(value) == 3: | 1531 | if len(value) == 3: |
1534 | reason = [] | 1532 | reason = [] |
... | @@ -1548,7 +1546,9 @@ def se_afc_contract_compare(license_en, ocr_res_dict, strip_list): | ... | @@ -1548,7 +1546,9 @@ def se_afc_contract_compare(license_en, ocr_res_dict, strip_list): |
1548 | result = consts.RESULT_N | 1546 | result = consts.RESULT_N |
1549 | reason = consts.GZS_REASON_1 | 1547 | reason = consts.GZS_REASON_1 |
1550 | ocr_str = empty_str | 1548 | ocr_str = empty_str |
1551 | elif isinstance(ocr_str_or_list, str) or isinstance(ocr_str_or_list, list): | 1549 | else: |
1550 | ocr_str_or_list = ocr_res.get(compare_logic[name][0]) | ||
1551 | if isinstance(ocr_str_or_list, str) or isinstance(ocr_str_or_list, list): | ||
1552 | result = getattr(cp, compare_logic[name][1])(value, ocr_str_or_list, **compare_logic[name][2]) | 1552 | result = getattr(cp, compare_logic[name][1])(value, ocr_str_or_list, **compare_logic[name][2]) |
1553 | if isinstance(ocr_str_or_list, list): | 1553 | if isinstance(ocr_str_or_list, list): |
1554 | ocr_str = json.dumps(ocr_str_or_list) | 1554 | ocr_str = json.dumps(ocr_str_or_list) |
... | @@ -1563,12 +1563,12 @@ def se_afc_contract_compare(license_en, ocr_res_dict, strip_list): | ... | @@ -1563,12 +1563,12 @@ def se_afc_contract_compare(license_en, ocr_res_dict, strip_list): |
1563 | img_path = empty_str | 1563 | img_path = empty_str |
1564 | error_type = empty_error_type if result == consts.RESULT_Y else ErrorType.OCR.value | 1564 | error_type = empty_error_type if result == consts.RESULT_Y else ErrorType.OCR.value |
1565 | if isinstance(value, list): | 1565 | if isinstance(value, list): |
1566 | value = json.dumps(value) | 1566 | value = json.dumps(value, ensure_ascii=False) |
1567 | result_field_list.append((name, value, result, ocr_str, img_path, error_type, reason)) | 1567 | result_field_list.append((name, value, result, ocr_str, img_path, error_type, reason)) |
1568 | else: | 1568 | else: |
1569 | for name, value in strip_list: | 1569 | for name, value in strip_list: |
1570 | if isinstance(value, list): | 1570 | if isinstance(value, list): |
1571 | value = json.dumps(value) | 1571 | value = json.dumps(value, ensure_ascii=False) |
1572 | result_field_list.append((name, value, consts.RESULT_N, empty_str, empty_str, ErrorType.NF.value, | 1572 | result_field_list.append((name, value, consts.RESULT_N, empty_str, empty_str, ErrorType.NF.value, |
1573 | '{0}未找到'.format(license_en))) | 1573 | '{0}未找到'.format(license_en))) |
1574 | 1574 | ... | ... |
-
Please register or sign in to post a comment