1f3873b4 by 冯轩

init 5153

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