65be0b78 by 冯轩

Merge branch 'feature/CHINARPA-5153' into feature/uat-tmp

2 parents b9c80f62 5c6ceb05
...@@ -2290,6 +2290,7 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type, allow_ ...@@ -2290,6 +2290,7 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type, allow_
2290 auto_paper_verify_list = [] 2290 auto_paper_verify_list = []
2291 auto_elec_verify_list = [] 2291 auto_elec_verify_list = []
2292 auto_paper_verify_false_idx_list = [] 2292 auto_paper_verify_false_idx_list = []
2293 auto_paper_verify_true_idx_list = []
2293 auto_elec_verify_false_idx_list = [] 2294 auto_elec_verify_false_idx_list = []
2294 2295
2295 all_zhifubao_weixin = True 2296 all_zhifubao_weixin = True
...@@ -2314,8 +2315,11 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type, allow_ ...@@ -2314,8 +2315,11 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type, allow_
2314 auto_elec_verify_false_idx_list.append(str(tmp_idx+1)) 2315 auto_elec_verify_false_idx_list.append(str(tmp_idx+1))
2315 else: 2316 else:
2316 auto_paper_verify_list.append(verify_bool) 2317 auto_paper_verify_list.append(verify_bool)
2317 verify_list.append(False) 2318 verify_list.append(verify_bool)
2319 if not verify_bool:
2318 auto_paper_verify_false_idx_list.append(str(tmp_idx+1)) 2320 auto_paper_verify_false_idx_list.append(str(tmp_idx+1))
2321 else:
2322 auto_paper_verify_true_idx_list.append(str(tmp_idx+1))
2319 2323
2320 for idx, (name, value) in enumerate(pre_field_list): 2324 for idx, (name, value) in enumerate(pre_field_list):
2321 ocr_str_or_list = ocr_res.get(compare_logic[name][0]) 2325 ocr_str_or_list = ocr_res.get(compare_logic[name][0])
...@@ -2352,43 +2356,84 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type, allow_ ...@@ -2352,43 +2356,84 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type, allow_
2352 2356
2353 # 非FSM Full CAA1 2357 # 非FSM Full CAA1
2354 # 2023.12 auto CAA1 也使用此逻辑(之前非FSM auto CAA1不判断真伪) 2358 # 2023.12 auto CAA1 也使用此逻辑(之前非FSM auto CAA1不判断真伪)
2355 if aa_type == 'CAA1': 2359 # ---------- 以下 CHINARPA-5153 作废
2356 name = '真伪' 2360 # if aa_type == 'CAA1':
2357 # 若仅提供纸质流水,则默认真伪为N2 2361 # name = '真伪'
2358 if not auto_elec_verify_list: 2362 # # 若仅提供纸质流水,则默认真伪为N2
2359 result = consts.RESULT_N2 2363 # if not auto_elec_verify_list:
2360 reason = '<关注>第{0}份流水为纸质版,请核查流水真伪。'.format('、'.join(auto_paper_verify_false_idx_list)) 2364 # result = consts.RESULT_N2
2361 # 若仅提供电子流水,逐一比对,有false为N1,全部true为Y 2365 # reason = '<关注>第{0}份流水为纸质版,请核查流水真伪。'.format('、'.join(auto_paper_verify_false_idx_list))
2362 if not auto_paper_verify_list: 2366 # # 若仅提供电子流水,逐一比对,有false为N1,全部true为Y
2363 result = consts.RESULT_Y if all(auto_elec_verify_list) else consts.RESULT_N1 2367 # if not auto_paper_verify_list:
2364 reason = '<关注>第{0}份电子流水疑似造假,请核查excel。'.format('、'.join(auto_elec_verify_false_idx_list)) 2368 # result = consts.RESULT_Y if all(auto_elec_verify_list) else consts.RESULT_N1
2365 #同时包含,同时返回N1,N2 2369 # reason = '<关注>第{0}份电子流水疑似造假,请核查excel。'.format('、'.join(auto_elec_verify_false_idx_list))
2366 if auto_elec_verify_list and auto_paper_verify_list: 2370 # #同时包含,同时返回N1,N2
2367 result = consts.RESULT_Y if all(auto_elec_verify_list) else consts.RESULT_N1 2371 # if auto_elec_verify_list and auto_paper_verify_list:
2368 reason1 = '<关注>第{0}份电子流水疑似造假,请核查excel。'.format('、'.join(auto_elec_verify_false_idx_list)) 2372 # result = consts.RESULT_Y if all(auto_elec_verify_list) else consts.RESULT_N1
2369 reason2 = '<关注>第{0}份流水为纸质版,请核查流水真伪。'.format('、'.join(auto_paper_verify_false_idx_list)) 2373 # reason1 = '<关注>第{0}份电子流水疑似造假,请核查excel。'.format('、'.join(auto_elec_verify_false_idx_list))
2370 reason = reason1 + '\n' + reason2 2374 # reason2 = '<关注>第{0}份流水为纸质版,请核查流水真伪。'.format('、'.join(auto_paper_verify_false_idx_list))
2371 result_field_list.append((name, empty_str, result, json.dumps(verify_list, ensure_ascii=False), empty_str, empty_error_type, reason)) 2375 # reason = reason1 + '\n' + reason2
2372 # 非FSM Full & Auto CAA2 目前逻辑和上面的完全一样 2376 # result_field_list.append((name, empty_str, result, json.dumps(verify_list, ensure_ascii=False), empty_str, empty_error_type, reason))
2373 elif aa_type == 'CAA2' : 2377 # # 非FSM Full & Auto CAA2 目前逻辑和上面的完全一样
2378 # elif aa_type == 'CAA2' :
2379 # name = '真伪'
2380 # # 若仅提供纸质流水,则默认真伪为N2
2381 # if not auto_elec_verify_list:
2382 # result = consts.RESULT_N2
2383 # reason = '<关注>第{0}份流水为纸质版,请核查流水真伪。'.format('、'.join(auto_paper_verify_false_idx_list))
2384 # # 若仅提供电子流水,逐一比对,有false为N1,全部true为Y
2385 # if not auto_paper_verify_list:
2386 # result = consts.RESULT_Y if all(auto_elec_verify_list) else consts.RESULT_N1
2387 # reason = '<关注>第{0}份电子流水疑似造假,请核查excel。'.format('、'.join(auto_elec_verify_false_idx_list))
2388 # #同时包含,同时返回N1,N2
2389 # if auto_elec_verify_list and auto_paper_verify_list:
2390 # result = consts.RESULT_Y if all(auto_elec_verify_list) else consts.RESULT_N1
2391 # reason1 = '<关注>第{0}份电子流水疑似造假,请核查excel。'.format('、'.join(auto_elec_verify_false_idx_list))
2392 # reason2 = '<关注>第{0}份流水为纸质版,请核查流水真伪。'.format('、'.join(auto_paper_verify_false_idx_list))
2393 # reason = reason1 + '\n' + reason2
2394 # result_field_list.append((name, empty_str, result, json.dumps(verify_list, ensure_ascii=False), empty_str, empty_error_type, reason))
2395 # ---------- 以上 CHINARPA-5153 作废
2396 # 【具体分支描述可以看java代码】
2397 if aa_type == 'CAA1' or aa_type == 'CAA2':
2374 name = '真伪' 2398 name = '真伪'
2375 # 若仅提供纸质流水,则默认真伪为N2 2399 reason_n1 = '<关注>第{0}份电子流水疑似造假,请核查excel。'.format('、'.join(auto_elec_verify_false_idx_list))
2376 if not auto_elec_verify_list: 2400 reason_n2 = '<关注>第{0}份流水为纸质版,请核查流水真伪。'.format('、'.join(auto_paper_verify_true_idx_list))
2377 result = consts.RESULT_N2 2401 reason_n3 = '<关注>第{0}份纸质流水疑似造假,请核查excel。'.format('、'.join(auto_paper_verify_false_idx_list))
2378 reason = '<关注>第{0}份流水为纸质版,请核查流水真伪。'.format('、'.join(auto_paper_verify_false_idx_list)) 2402
2379 # 若仅提供电子流水,逐一比对,有false为N1,全部true为Y
2380 if not auto_paper_verify_list:
2381 result = consts.RESULT_Y if all(auto_elec_verify_list) else consts.RESULT_N1
2382 reason = '<关注>第{0}份电子流水疑似造假,请核查excel。'.format('、'.join(auto_elec_verify_false_idx_list))
2383 #同时包含,同时返回N1,N2
2384 if auto_elec_verify_list and auto_paper_verify_list: 2403 if auto_elec_verify_list and auto_paper_verify_list:
2385 result = consts.RESULT_Y if all(auto_elec_verify_list) else consts.RESULT_N1 2404 # 有电子流水,有纸质流水,则需逐一判断电子流水属性或纸质流水检测结果
2386 reason1 = '<关注>第{0}份电子流水疑似造假,请核查excel。'.format('、'.join(auto_elec_verify_false_idx_list)) 2405 elecTrue = len(auto_elec_verify_false_idx_list) <= 0
2387 reason2 = '<关注>第{0}份流水为纸质版,请核查流水真伪。'.format('、'.join(auto_paper_verify_false_idx_list)) 2406 paperTrue = len(auto_paper_verify_false_idx_list) <= 0
2388 reason = reason1 + '\n' + reason2 2407 paperNotClear = len(auto_paper_verify_true_idx_list) > 0
2408 if not elecTrue and not paperTrue and paperNotClear:
2409 reason = reason_n1 + '\n' + reason_n2 + '\n' + reason_n3
2410 elif not elecTrue and not paperTrue:
2411 reason = reason_n1 + '\n' + reason_n3
2412 elif not elecTrue and paperNotClear:
2413 reason = reason_n1 + '\n' + reason_n2
2414 elif elecTrue and not paperTrue and paperNotClear:
2415 reason = reason_n2 + '\n' + reason_n3
2416 elif elecTrue and paperNotClear:
2417 reason = reason_n2
2418 elif elecTrue and not paperTrue:
2419 reason = reason_n3
2420 result = consts.RESULT_Y if elecTrue and paperTrue and not paperNotClear else consts.RESULT_N
2421 elif auto_elec_verify_list and not auto_paper_verify_list:
2422 # 只有电子流水,以电子为准
2423 reason = reason_n1
2424 result = consts.RESULT_Y if all(auto_elec_verify_list) else consts.RESULT_N
2425 elif not auto_elec_verify_list:
2426 paperTrue = len(auto_paper_verify_false_idx_list) <= 0
2427 paperNotClear = len(auto_paper_verify_true_idx_list) > 0
2428 if not paperTrue and paperNotClear:
2429 reason = reason_n2 + '\n' + reason_n3
2430 elif paperNotClear:
2431 reason = reason_n2
2432 elif not paperTrue:
2433 reason = reason_n3
2434 result = consts.RESULT_N
2389 result_field_list.append((name, empty_str, result, json.dumps(verify_list, ensure_ascii=False), empty_str, empty_error_type, reason)) 2435 result_field_list.append((name, empty_str, result, json.dumps(verify_list, ensure_ascii=False), empty_str, empty_error_type, reason))
2390 2436
2391
2392 if all_zhifubao_weixin: 2437 if all_zhifubao_weixin:
2393 # 核查点名称,cms传值,比对结果,ocr结果,图片路径,错误类型,错误描述 2438 # 核查点名称,cms传值,比对结果,ocr结果,图片路径,错误类型,错误描述
2394 result_field_list.append(('类型', allow_bs_type, consts.RESULT_N, '全部为支付宝/微信', empty_str, ErrorType.NF.value, '高风险经销商流水类型异常')) 2439 result_field_list.append(('类型', allow_bs_type, consts.RESULT_N, '全部为支付宝/微信', empty_str, ErrorType.NF.value, '高风险经销商流水类型异常'))
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!