Merge branch 'feature/CHINARPA-5015'
Showing
2 changed files
with
59 additions
and
12 deletions
| ... | @@ -1503,7 +1503,7 @@ SE_DYSYR_VALUE = '无' | ... | @@ -1503,7 +1503,7 @@ SE_DYSYR_VALUE = '无' |
| 1503 | SE_LAYOUT_VALUE = '旧版-旧打印、新版-新打印' | 1503 | SE_LAYOUT_VALUE = '旧版-旧打印、新版-新打印' |
| 1504 | SE_GB_NEW_FIELD = ['vinNo'] | 1504 | SE_GB_NEW_FIELD = ['vinNo'] |
| 1505 | SE_GB_USED_FIELD = ['customerName', 'idNum', 'date'] | 1505 | SE_GB_USED_FIELD = ['customerName', 'idNum', 'date'] |
| 1506 | SE_BS_FIELD = ['户名', '打印日期', '流水日期', '(担保人1)户名', '(担保人1)打印日期', '(担保人1)流水日期', '(担保人2)户名', '(担保人2)打印日期', '(担保人2)流水日期'] | 1506 | SE_BS_FIELD = ['户名', '打印日期', '流水日期', '(担保人1)户名', '(担保人1)打印日期', '(担保人1)流水日期', '(担保人2)户名', '(担保人2)打印日期', '(担保人2)流水日期', '类型'] |
| 1507 | SE_HMH_FIELD = ['借款人/承租人姓名', '借款人/承租人证件号', '申请号', '渠道', '签字'] | 1507 | SE_HMH_FIELD = ['借款人/承租人姓名', '借款人/承租人证件号', '申请号', '渠道', '签字'] |
| 1508 | SE_BD_FIELD = ['被保险人姓名', '被保险人证件号码', '车架号', '机动车损失保险金额', '第三者责任保险金额', '绝对免赔率', '保险起始日期', '保险截止日期', '保单章', '第一受益人', '保险费合计'] | 1508 | SE_BD_FIELD = ['被保险人姓名', '被保险人证件号码', '车架号', '机动车损失保险金额', '第三者责任保险金额', '绝对免赔率', '保险起始日期', '保险截止日期', '保单章', '第一受益人', '保险费合计'] |
| 1509 | JDMPV_VALUE = ['-', '--', '0%', '0.00', '/', '0', ''] | 1509 | JDMPV_VALUE = ['-', '--', '0%', '0.00', '/', '0', ''] |
| ... | @@ -2017,6 +2017,7 @@ BS_COMPARE_LOGIC = { | ... | @@ -2017,6 +2017,7 @@ BS_COMPARE_LOGIC = { |
| 2017 | '流水日期': ('timedelta', 'se_bs_date_compare', {}, '主共借人银行流水日期不满足3个月'), | 2017 | '流水日期': ('timedelta', 'se_bs_date_compare', {}, '主共借人银行流水日期不满足3个月'), |
| 2018 | '(担保人1)流水日期': ('timedelta', 'se_bs_date_compare', {}, '担保人1银行流水日期不满足3个月'), | 2018 | '(担保人1)流水日期': ('timedelta', 'se_bs_date_compare', {}, '担保人1银行流水日期不满足3个月'), |
| 2019 | '(担保人2)流水日期': ('timedelta', 'se_bs_date_compare', {}, '担保人2银行流水日期不满足3个月'), | 2019 | '(担保人2)流水日期': ('timedelta', 'se_bs_date_compare', {}, '担保人2银行流水日期不满足3个月'), |
| 2020 | '类型': ('bankStatement_type', 'se_bs_type_compare', {}, '高风险经销商流水类型异常'), | ||
| 2020 | } | 2021 | } |
| 2021 | 2022 | ||
| 2022 | BS_COMPARE_LOGIC_AUTO = { | 2023 | BS_COMPARE_LOGIC_AUTO = { |
| ... | @@ -2029,6 +2030,7 @@ BS_COMPARE_LOGIC_AUTO = { | ... | @@ -2029,6 +2030,7 @@ BS_COMPARE_LOGIC_AUTO = { |
| 2029 | '流水日期': ('timedelta', 'se_bs_date_compare', {}, '主共借人银行流水日期不满足2个月'), | 2030 | '流水日期': ('timedelta', 'se_bs_date_compare', {}, '主共借人银行流水日期不满足2个月'), |
| 2030 | '(担保人1)流水日期': ('timedelta', 'se_bs_date_compare', {}, '担保人1银行流水日期不满足2个月'), | 2031 | '(担保人1)流水日期': ('timedelta', 'se_bs_date_compare', {}, '担保人1银行流水日期不满足2个月'), |
| 2031 | '(担保人2)流水日期': ('timedelta', 'se_bs_date_compare', {}, '担保人2银行流水日期不满足2个月'), | 2032 | '(担保人2)流水日期': ('timedelta', 'se_bs_date_compare', {}, '担保人2银行流水日期不满足2个月'), |
| 2033 | '类型': ('bankStatement_type', 'se_bs_type_compare', {}, '高风险经销商流水类型异常'), | ||
| 2032 | } | 2034 | } |
| 2033 | 2035 | ||
| 2034 | SPECIAL_REASON = '主共借人未提供银行流水,含担保人需人工查看直系亲属关系' | 2036 | SPECIAL_REASON = '主共借人未提供银行流水,含担保人需人工查看直系亲属关系' | ... | ... |
| ... | @@ -1205,6 +1205,8 @@ def get_se_cms_compare_info_auto(application_id, last_obj, application_entity, d | ... | @@ -1205,6 +1205,8 @@ def get_se_cms_compare_info_auto(application_id, last_obj, application_entity, d |
| 1205 | compare_info['bankInfo'] = bank_info | 1205 | compare_info['bankInfo'] = bank_info |
| 1206 | 1206 | ||
| 1207 | # 银行流水 -------------------------------------------------------------------- | 1207 | # 银行流水 -------------------------------------------------------------------- |
| 1208 | #增加 allow_bs_type 默认值,防止不需要比对流水的申请报错 | ||
| 1209 | allow_bs_type = '全部' | ||
| 1208 | if cms_info.get('autoApprovedDetails', {}).get('aaType', '') in ['CAA1', 'CAA2'] and \ | 1210 | if cms_info.get('autoApprovedDetails', {}).get('aaType', '') in ['CAA1', 'CAA2'] and \ |
| 1209 | '无需提供银行流水' not in cms_info.get('autoApprovedDetails', {}).get('PolicyComments', ''): | 1211 | '无需提供银行流水' not in cms_info.get('autoApprovedDetails', {}).get('PolicyComments', ''): |
| 1210 | date_timedelta = 60 if auto else 90 | 1212 | date_timedelta = 60 if auto else 90 |
| ... | @@ -1221,6 +1223,14 @@ def get_se_cms_compare_info_auto(application_id, last_obj, application_entity, d | ... | @@ -1221,6 +1223,14 @@ def get_se_cms_compare_info_auto(application_id, last_obj, application_entity, d |
| 1221 | (consts.SE_BS_FIELD[2], date_timedelta), | 1223 | (consts.SE_BS_FIELD[2], date_timedelta), |
| 1222 | ] | 1224 | ] |
| 1223 | 1225 | ||
| 1226 | #在比对逻辑中添加字段 | ||
| 1227 | if '仅接受银行流水' in cms_info.get('autoApprovedDetails', {}).get('PolicyComments', ''): | ||
| 1228 | #bs_field_input.append((consts.SE_BS_FIELD[9], '仅接受银行流水')) | ||
| 1229 | allow_bs_type = '仅接受银行流水' | ||
| 1230 | else: | ||
| 1231 | #bs_field_input.append((consts.SE_BS_FIELD[9], '全部')) | ||
| 1232 | allow_bs_type = '全部' | ||
| 1233 | |||
| 1224 | dbr_bs_role_list = [] | 1234 | dbr_bs_role_list = [] |
| 1225 | for dbr_bs_role, _, _ in main_role_info.get(consts.APPLICANT_TYPE_ORDER[2], []): | 1235 | for dbr_bs_role, _, _ in main_role_info.get(consts.APPLICANT_TYPE_ORDER[2], []): |
| 1226 | dbr_bs_role_list.append(dbr_bs_role) | 1236 | dbr_bs_role_list.append(dbr_bs_role) |
| ... | @@ -1481,7 +1491,7 @@ def get_se_cms_compare_info_auto(application_id, last_obj, application_entity, d | ... | @@ -1481,7 +1491,7 @@ def get_se_cms_compare_info_auto(application_id, last_obj, application_entity, d |
| 1481 | hil_contract_2_input.append((key, empty_str)) | 1491 | hil_contract_2_input.append((key, empty_str)) |
| 1482 | contract_info[consts.HIL_CONTRACT_2_EN] = hil_contract_2_input | 1492 | contract_info[consts.HIL_CONTRACT_2_EN] = hil_contract_2_input |
| 1483 | compare_info['contract'] = contract_info | 1493 | compare_info['contract'] = contract_info |
| 1484 | return compare_info, cms_info.get('autoApprovedDetails', {}).get('aaType', ''), is_gsyh | 1494 | return compare_info, cms_info.get('autoApprovedDetails', {}).get('aaType', ''), is_gsyh, allow_bs_type |
| 1485 | else: | 1495 | else: |
| 1486 | # AFC合同------------------------------------------------------------------------------------------------------ | 1496 | # AFC合同------------------------------------------------------------------------------------------------------ |
| 1487 | vehicle_principal_str = str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0')) | 1497 | vehicle_principal_str = str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0')) |
| ... | @@ -1560,7 +1570,7 @@ def get_se_cms_compare_info_auto(application_id, last_obj, application_entity, d | ... | @@ -1560,7 +1570,7 @@ def get_se_cms_compare_info_auto(application_id, last_obj, application_entity, d |
| 1560 | contract_info[consts.AFC_CONTRACT_QRS_EN] = afc_contract_qrs_input | 1570 | contract_info[consts.AFC_CONTRACT_QRS_EN] = afc_contract_qrs_input |
| 1561 | 1571 | ||
| 1562 | compare_info['contract'] = contract_info | 1572 | compare_info['contract'] = contract_info |
| 1563 | return compare_info, cms_info.get('autoApprovedDetails', {}).get('aaType', ''), is_gsyh | 1573 | return compare_info, cms_info.get('autoApprovedDetails', {}).get('aaType', ''), is_gsyh, allow_bs_type |
| 1564 | 1574 | ||
| 1565 | 1575 | ||
| 1566 | def get_se_cms_compare_info(application_id, last_obj, application_entity, detect_list, data_source, auto=False, ignore_bank=False): | 1576 | def get_se_cms_compare_info(application_id, last_obj, application_entity, detect_list, data_source, auto=False, ignore_bank=False): |
| ... | @@ -1865,6 +1875,8 @@ def get_se_cms_compare_info(application_id, last_obj, application_entity, detect | ... | @@ -1865,6 +1875,8 @@ def get_se_cms_compare_info(application_id, last_obj, application_entity, detect |
| 1865 | compare_info['bankInfo'] = bank_info | 1875 | compare_info['bankInfo'] = bank_info |
| 1866 | 1876 | ||
| 1867 | # 银行流水 -------------------------------------------------------------------- | 1877 | # 银行流水 -------------------------------------------------------------------- |
| 1878 | #增加 allow_bs_type 默认值,防止不需要比对流水的申请报错 | ||
| 1879 | allow_bs_type = '全部' | ||
| 1868 | if cms_info.get('autoApprovedDetails', {}).get('aaType', '') in ['CAA1', 'CAA2'] and \ | 1880 | if cms_info.get('autoApprovedDetails', {}).get('aaType', '') in ['CAA1', 'CAA2'] and \ |
| 1869 | '无需提供银行流水' not in cms_info.get('autoApprovedDetails', {}).get('PolicyComments', ''): | 1881 | '无需提供银行流水' not in cms_info.get('autoApprovedDetails', {}).get('PolicyComments', ''): |
| 1870 | date_timedelta = 60 if auto else 90 | 1882 | date_timedelta = 60 if auto else 90 |
| ... | @@ -1881,6 +1893,14 @@ def get_se_cms_compare_info(application_id, last_obj, application_entity, detect | ... | @@ -1881,6 +1893,14 @@ def get_se_cms_compare_info(application_id, last_obj, application_entity, detect |
| 1881 | (consts.SE_BS_FIELD[2], date_timedelta), | 1893 | (consts.SE_BS_FIELD[2], date_timedelta), |
| 1882 | ] | 1894 | ] |
| 1883 | 1895 | ||
| 1896 | #在比对逻辑中添加字段 | ||
| 1897 | if '仅接受银行流水' in cms_info.get('autoApprovedDetails', {}).get('PolicyComments', ''): | ||
| 1898 | #bs_field_input.append((consts.SE_BS_FIELD[9], '仅接受银行流水')) | ||
| 1899 | allow_bs_type = '仅接受银行流水' | ||
| 1900 | else: | ||
| 1901 | #bs_field_input.append((consts.SE_BS_FIELD[9], '全部')) | ||
| 1902 | allow_bs_type = '全部' | ||
| 1903 | |||
| 1884 | dbr_bs_role_list = [] | 1904 | dbr_bs_role_list = [] |
| 1885 | for dbr_bs_role, _, _ in main_role_info.get(consts.APPLICANT_TYPE_ORDER[2], []): | 1905 | for dbr_bs_role, _, _ in main_role_info.get(consts.APPLICANT_TYPE_ORDER[2], []): |
| 1886 | dbr_bs_role_list.append(dbr_bs_role) | 1906 | dbr_bs_role_list.append(dbr_bs_role) |
| ... | @@ -2107,7 +2127,7 @@ def get_se_cms_compare_info(application_id, last_obj, application_entity, detect | ... | @@ -2107,7 +2127,7 @@ def get_se_cms_compare_info(application_id, last_obj, application_entity, detect |
| 2107 | hil_contract_2_input.append((key, empty_str)) | 2127 | hil_contract_2_input.append((key, empty_str)) |
| 2108 | contract_info[consts.HIL_CONTRACT_2_EN] = hil_contract_2_input | 2128 | contract_info[consts.HIL_CONTRACT_2_EN] = hil_contract_2_input |
| 2109 | compare_info['contract'] = contract_info | 2129 | compare_info['contract'] = contract_info |
| 2110 | return compare_info, cms_info.get('applicationVersion', 1), cms_info.get('autoApprovedDetails', {}).get('aaType', ''), is_gsyh | 2130 | return compare_info, cms_info.get('applicationVersion', 1), cms_info.get('autoApprovedDetails', {}).get('aaType', ''), is_gsyh, allow_bs_type |
| 2111 | else: | 2131 | else: |
| 2112 | # AFC合同------------------------------------------------------------------------------------------------------ | 2132 | # AFC合同------------------------------------------------------------------------------------------------------ |
| 2113 | vehicle_principal_str = str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0')) | 2133 | vehicle_principal_str = str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0')) |
| ... | @@ -2185,10 +2205,10 @@ def get_se_cms_compare_info(application_id, last_obj, application_entity, detect | ... | @@ -2185,10 +2205,10 @@ def get_se_cms_compare_info(application_id, last_obj, application_entity, detect |
| 2185 | afc_contract_qrs_input = [(consts.SE_AFC_CON_QRS_FIELD[0], '{0}{1}{2}'.format(role_count, consts.SPLIT_STR, full_no))] | 2205 | afc_contract_qrs_input = [(consts.SE_AFC_CON_QRS_FIELD[0], '{0}{1}{2}'.format(role_count, consts.SPLIT_STR, full_no))] |
| 2186 | contract_info[consts.AFC_CONTRACT_QRS_EN] = afc_contract_qrs_input | 2206 | contract_info[consts.AFC_CONTRACT_QRS_EN] = afc_contract_qrs_input |
| 2187 | compare_info['contract'] = contract_info | 2207 | compare_info['contract'] = contract_info |
| 2188 | return compare_info, cms_info.get('applicationVersion', 1), cms_info.get('autoApprovedDetails', {}).get('aaType', ''), is_gsyh | 2208 | return compare_info, cms_info.get('applicationVersion', 1), cms_info.get('autoApprovedDetails', {}).get('aaType', ''), is_gsyh, allow_bs_type |
| 2189 | 2209 | ||
| 2190 | 2210 | ||
| 2191 | def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type): | 2211 | def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type, allow_bs_type): |
| 2192 | # 主共借至少提供一个 | 2212 | # 主共借至少提供一个 |
| 2193 | # 有担保人,担保人必须提供。主共借没有时,修改comment:人工查看担保人亲属关系 | 2213 | # 有担保人,担保人必须提供。主共借没有时,修改comment:人工查看担保人亲属关系 |
| 2194 | 2214 | ||
| ... | @@ -2202,6 +2222,7 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type): | ... | @@ -2202,6 +2222,7 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type): |
| 2202 | field_img_path_dict = dict() | 2222 | field_img_path_dict = dict() |
| 2203 | 2223 | ||
| 2204 | if ocr_res_str is not None: | 2224 | if ocr_res_str is not None: |
| 2225 | # 字段在比对逻辑中添加的,这个地方不用改,如果要是在get_info时添加,要改这个 | ||
| 2205 | pre_field_list = strip_list[:3] | 2226 | pre_field_list = strip_list[:3] |
| 2206 | dbr1_field_list = strip_list[3:6] | 2227 | dbr1_field_list = strip_list[3:6] |
| 2207 | dbr2_field_list = strip_list[6:] | 2228 | dbr2_field_list = strip_list[6:] |
| ... | @@ -2220,11 +2241,18 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type): | ... | @@ -2220,11 +2241,18 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type): |
| 2220 | auto_paper_verify_false_idx_list = [] | 2241 | auto_paper_verify_false_idx_list = [] |
| 2221 | auto_elec_verify_false_idx_list = [] | 2242 | auto_elec_verify_false_idx_list = [] |
| 2222 | 2243 | ||
| 2244 | all_zhifubao_weixin = True | ||
| 2245 | |||
| 2223 | for tmp_idx, ocr_res in enumerate(ocr_res_list): | 2246 | for tmp_idx, ocr_res in enumerate(ocr_res_list): |
| 2224 | correct_count = 0 | 2247 | correct_count = 0 |
| 2225 | pre_tmp_res_part = {} | 2248 | pre_tmp_res_part = {} |
| 2226 | verify_bool = ocr_res.get('verify', False) | 2249 | verify_bool = ocr_res.get('verify', False) |
| 2227 | e_bank = ocr_res.get('e_bank', False) | 2250 | e_bank = ocr_res.get('e_bank', False) |
| 2251 | bankStatement_type = ocr_res.get('bankStatement_type', '') | ||
| 2252 | # 如果是高风险经销商,cms信息中包含‘仅接受银行流水’,但是识别出的流水是支付宝/微信,直接跳过这个文件,就当不存在 | ||
| 2253 | if allow_bs_type == '仅接受银行流水' and bankStatement_type in ['12', '13', '48']: | ||
| 2254 | continue | ||
| 2255 | all_zhifubao_weixin = False | ||
| 2228 | #verify_list.append(verify_bool) | 2256 | #verify_list.append(verify_bool) |
| 2229 | if not verify_bool: | 2257 | if not verify_bool: |
| 2230 | verify_false_idx_list.append(str(tmp_idx+1)) | 2258 | verify_false_idx_list.append(str(tmp_idx+1)) |
| ... | @@ -2309,11 +2337,23 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type): | ... | @@ -2309,11 +2337,23 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type): |
| 2309 | reason = reason1 + reason2 | 2337 | reason = reason1 + reason2 |
| 2310 | result_field_list.append((name, empty_str, result, json.dumps(verify_list, ensure_ascii=False), empty_str, empty_error_type, reason)) | 2338 | result_field_list.append((name, empty_str, result, json.dumps(verify_list, ensure_ascii=False), empty_str, empty_error_type, reason)) |
| 2311 | 2339 | ||
| 2340 | |||
| 2341 | if all_zhifubao_weixin: | ||
| 2342 | # 核查点名称,cms传值,比对结果,ocr结果,图片路径,错误类型,错误描述 | ||
| 2343 | result_field_list.append(('类型', allow_bs_type, consts.RESULT_N, '全部为支付宝/微信', empty_str, ErrorType.NF.value, '高风险经销商流水类型异常')) | ||
| 2344 | else: | ||
| 2345 | result_field_list.append(('类型', allow_bs_type, consts.RESULT_Y, '包含支持的流水类型', empty_str, empty_error_type, '')) | ||
| 2346 | |||
| 2312 | # 担保人1 | 2347 | # 担保人1 |
| 2313 | dbr1_best_res = {} | 2348 | dbr1_best_res = {} |
| 2314 | if len(dbr1_field_list) > 0: | 2349 | if len(dbr1_field_list) > 0: |
| 2315 | max_correct_count = 0 | 2350 | max_correct_count = 0 |
| 2316 | for ocr_res in ocr_res_list: | 2351 | for ocr_res in ocr_res_list: |
| 2352 | bankStatement_type = ocr_res.get('bankStatement_type', '') | ||
| 2353 | # 如果是高风险经销商,cms信息中包含‘仅接受银行流水’,但是识别出的流水是支付宝/微信,直接跳过这个文件,就当不存在 | ||
| 2354 | if allow_bs_type == '仅接受银行流水' and bankStatement_type in ['12', '13', '48']: | ||
| 2355 | continue | ||
| 2356 | |||
| 2317 | correct_count = 0 | 2357 | correct_count = 0 |
| 2318 | dbr1_tmp_res_part = {} | 2358 | dbr1_tmp_res_part = {} |
| 2319 | for idx, (name, value) in enumerate(dbr1_field_list): | 2359 | for idx, (name, value) in enumerate(dbr1_field_list): |
| ... | @@ -2346,6 +2386,10 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type): | ... | @@ -2346,6 +2386,10 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type): |
| 2346 | if len(dbr1_field_list) > 0: | 2386 | if len(dbr1_field_list) > 0: |
| 2347 | max_correct_count = 0 | 2387 | max_correct_count = 0 |
| 2348 | for ocr_res in ocr_res_list: | 2388 | for ocr_res in ocr_res_list: |
| 2389 | bankStatement_type = ocr_res.get('bankStatement_type', '') | ||
| 2390 | # 如果是高风险经销商,cms信息中包含‘仅接受银行流水’,但是识别出的流水是支付宝/微信,直接跳过这个文件,就当不存在 | ||
| 2391 | if allow_bs_type == '仅接受银行流水' and bankStatement_type in ['12', '13', '48']: | ||
| 2392 | continue | ||
| 2349 | correct_count = 0 | 2393 | correct_count = 0 |
| 2350 | dbr2_tmp_res_part = {} | 2394 | dbr2_tmp_res_part = {} |
| 2351 | for idx, (name, value) in enumerate(dbr2_field_list): | 2395 | for idx, (name, value) in enumerate(dbr2_field_list): |
| ... | @@ -3253,7 +3297,7 @@ def se_mvc34_compare(license_en, ocr_res_dict, field_list): | ... | @@ -3253,7 +3297,7 @@ def se_mvc34_compare(license_en, ocr_res_dict, field_list): |
| 3253 | return result_field_list, field_img_path_dict | 3297 | return result_field_list, field_img_path_dict |
| 3254 | 3298 | ||
| 3255 | 3299 | ||
| 3256 | def se_compare_process(compare_info, ocr_res_dict, is_gsyh, is_auto, id_res_list, aa_type): | 3300 | def se_compare_process(compare_info, ocr_res_dict, is_gsyh, is_auto, id_res_list, aa_type, allow_bs_type): |
| 3257 | # individualCusInfo | 3301 | # individualCusInfo |
| 3258 | # corporateCusInfo | 3302 | # corporateCusInfo |
| 3259 | # vehicleInfo | 3303 | # vehicleInfo |
| ... | @@ -3350,7 +3394,8 @@ def se_compare_process(compare_info, ocr_res_dict, is_gsyh, is_auto, id_res_list | ... | @@ -3350,7 +3394,8 @@ def se_compare_process(compare_info, ocr_res_dict, is_gsyh, is_auto, id_res_list |
| 3350 | elif license_en == consts.AFC_CONTRACT_QRS_EN: | 3394 | elif license_en == consts.AFC_CONTRACT_QRS_EN: |
| 3351 | result_field_list, field_img_path_dict = se_contract_qrs_compare(license_en, ocr_res_dict, strip_list) | 3395 | result_field_list, field_img_path_dict = se_contract_qrs_compare(license_en, ocr_res_dict, strip_list) |
| 3352 | elif license_en == consts.BS_EN: | 3396 | elif license_en == consts.BS_EN: |
| 3353 | result_field_list, field_img_path_dict = se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type) | 3397 | # 银行流水的比对,是只要有正确的就可以,所以没有按照时间顺序,先比最新的,在比最早的,如果以后要改逻辑,切记这个 |
| 3398 | result_field_list, field_img_path_dict = se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type, allow_bs_type) | ||
| 3354 | elif license_en == consts.FS_EN: | 3399 | elif license_en == consts.FS_EN: |
| 3355 | result_field_list, field_img_path_dict = se_fs_compare(license_en, ocr_res_dict, strip_list) | 3400 | result_field_list, field_img_path_dict = se_fs_compare(license_en, ocr_res_dict, strip_list) |
| 3356 | else: | 3401 | else: |
| ... | @@ -3439,11 +3484,11 @@ def se_compare_auto(application_id, application_entity, ocr_res_id, last_obj, oc | ... | @@ -3439,11 +3484,11 @@ def se_compare_auto(application_id, application_entity, ocr_res_id, last_obj, oc |
| 3439 | try: | 3484 | try: |
| 3440 | # 比对逻辑 | 3485 | # 比对逻辑 |
| 3441 | # detect_list = se_result_detect(ocr_res_dict) | 3486 | # detect_list = se_result_detect(ocr_res_dict) |
| 3442 | compare_info, aa_type, is_gsyh = get_se_cms_compare_info_auto( | 3487 | compare_info, aa_type, is_gsyh, allow_bs_type = get_se_cms_compare_info_auto( |
| 3443 | application_id, last_obj, application_entity, data_source, ignore_bank=ignore_bank) | 3488 | application_id, last_obj, application_entity, data_source, ignore_bank=ignore_bank) |
| 3444 | compare_result, total_fields, failed_count, successful_at_this_level, failure_reason_str, \ | 3489 | compare_result, total_fields, failed_count, successful_at_this_level, failure_reason_str, \ |
| 3445 | cn_failure_reason_str, bs_failure_reason_str, _, field_result_dict = se_compare_process( | 3490 | cn_failure_reason_str, bs_failure_reason_str, _, field_result_dict = se_compare_process( |
| 3446 | compare_info, ocr_res_dict, is_gsyh, True, id_res_list, aa_type) | 3491 | compare_info, ocr_res_dict, is_gsyh, True, id_res_list, aa_type, allow_bs_type) |
| 3447 | compare_log.info('{0} [Auto SE] [compare success] [entity={1}] [id={2}] [ocr_res_id={3}] [result={4}]'.format( | 3492 | compare_log.info('{0} [Auto SE] [compare success] [entity={1}] [id={2}] [ocr_res_id={3}] [result={4}]'.format( |
| 3448 | log_base, application_entity, application_id, ocr_res_id, compare_result)) | 3493 | log_base, application_entity, application_id, ocr_res_id, compare_result)) |
| 3449 | except Exception as e: | 3494 | except Exception as e: |
| ... | @@ -3506,11 +3551,11 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res | ... | @@ -3506,11 +3551,11 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res |
| 3506 | # 比对逻辑 | 3551 | # 比对逻辑 |
| 3507 | start_time = datetime.now() | 3552 | start_time = datetime.now() |
| 3508 | detect_list = se_result_detect(ocr_res_dict) | 3553 | detect_list = se_result_detect(ocr_res_dict) |
| 3509 | compare_info, application_version, aa_type, is_gsyh = get_se_cms_compare_info( | 3554 | compare_info, application_version, aa_type, is_gsyh, allow_bs_type = get_se_cms_compare_info( |
| 3510 | application_id, last_obj, application_entity, detect_list, data_source, ignore_bank=ignore_bank) | 3555 | application_id, last_obj, application_entity, detect_list, data_source, ignore_bank=ignore_bank) |
| 3511 | compare_result, total_fields, failed_count, successful_at_this_level, failure_reason_str, \ | 3556 | compare_result, total_fields, failed_count, successful_at_this_level, failure_reason_str, \ |
| 3512 | cn_failure_reason_str, bs_failure_reason_str, rpa_failure_reason, field_result_dict = se_compare_process( | 3557 | cn_failure_reason_str, bs_failure_reason_str, rpa_failure_reason, field_result_dict = se_compare_process( |
| 3513 | compare_info, ocr_res_dict, is_gsyh, False, id_res_list, aa_type) | 3558 | compare_info, ocr_res_dict, is_gsyh, False, id_res_list, aa_type, allow_bs_type) |
| 3514 | compare_log.info('{0} [SE] [compare success] [entity={1}] [id={2}] [ocr_res_id={3}] [result={4}]'.format( | 3559 | compare_log.info('{0} [SE] [compare success] [entity={1}] [id={2}] [ocr_res_id={3}] [result={4}]'.format( |
| 3515 | log_base, application_entity, application_id, ocr_res_id, compare_result)) | 3560 | log_base, application_entity, application_id, ocr_res_id, compare_result)) |
| 3516 | except Exception as e: | 3561 | except Exception as e: | ... | ... |
-
Please register or sign in to post a comment