Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
1f3873b4
authored
2025-02-17 18:30:40 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
init 5153
1 parent
9717cceb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
20 deletions
src/celery_compare/tasks.py
src/celery_compare/tasks.py
View file @
1f3873b
...
...
@@ -2288,6 +2288,7 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type, allow_
auto_paper_verify_list
=
[]
auto_elec_verify_list
=
[]
auto_paper_verify_false_idx_list
=
[]
auto_paper_verify_true_idx_list
=
[]
auto_elec_verify_false_idx_list
=
[]
all_zhifubao_weixin
=
True
...
...
@@ -2312,8 +2313,11 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type, allow_
auto_elec_verify_false_idx_list
.
append
(
str
(
tmp_idx
+
1
))
else
:
auto_paper_verify_list
.
append
(
verify_bool
)
verify_list
.
append
(
False
)
verify_list
.
append
(
verify_bool
)
if
not
verify_bool
:
auto_paper_verify_false_idx_list
.
append
(
str
(
tmp_idx
+
1
))
else
:
auto_paper_verify_true_idx_list
.
append
(
str
(
tmp_idx
+
1
))
for
idx
,
(
name
,
value
)
in
enumerate
(
pre_field_list
):
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_
# 非FSM Full CAA1
# 2023.12 auto CAA1 也使用此逻辑(之前非FSM auto CAA1不判断真伪)
if
aa_type
==
'CAA1'
:
# ---------- 以下 CHINARPA-5153 作废
# if aa_type == 'CAA1':
# name = '真伪'
# # 若仅提供纸质流水,则默认真伪为N2
# if not auto_elec_verify_list:
# result = consts.RESULT_N2
# reason = '<关注>第{0}份流水为纸质版,请核查流水真伪。'.format('、'.join(auto_paper_verify_false_idx_list))
# # 若仅提供电子流水,逐一比对,有false为N1,全部true为Y
# if not auto_paper_verify_list:
# result = consts.RESULT_Y if all(auto_elec_verify_list) else consts.RESULT_N1
# reason = '<关注>第{0}份电子流水疑似造假,请核查excel。'.format('、'.join(auto_elec_verify_false_idx_list))
# #同时包含,同时返回N1,N2
# if auto_elec_verify_list and auto_paper_verify_list:
# result = consts.RESULT_Y if all(auto_elec_verify_list) else consts.RESULT_N1
# reason1 = '<关注>第{0}份电子流水疑似造假,请核查excel。'.format('、'.join(auto_elec_verify_false_idx_list))
# reason2 = '<关注>第{0}份流水为纸质版,请核查流水真伪。'.format('、'.join(auto_paper_verify_false_idx_list))
# reason = reason1 + '\n' + reason2
# result_field_list.append((name, empty_str, result, json.dumps(verify_list, ensure_ascii=False), empty_str, empty_error_type, reason))
# # 非FSM Full & Auto CAA2 目前逻辑和上面的完全一样
# elif aa_type == 'CAA2' :
# name = '真伪'
# # 若仅提供纸质流水,则默认真伪为N2
# if not auto_elec_verify_list:
# result = consts.RESULT_N2
# reason = '<关注>第{0}份流水为纸质版,请核查流水真伪。'.format('、'.join(auto_paper_verify_false_idx_list))
# # 若仅提供电子流水,逐一比对,有false为N1,全部true为Y
# if not auto_paper_verify_list:
# result = consts.RESULT_Y if all(auto_elec_verify_list) else consts.RESULT_N1
# reason = '<关注>第{0}份电子流水疑似造假,请核查excel。'.format('、'.join(auto_elec_verify_false_idx_list))
# #同时包含,同时返回N1,N2
# if auto_elec_verify_list and auto_paper_verify_list:
# result = consts.RESULT_Y if all(auto_elec_verify_list) else consts.RESULT_N1
# reason1 = '<关注>第{0}份电子流水疑似造假,请核查excel。'.format('、'.join(auto_elec_verify_false_idx_list))
# reason2 = '<关注>第{0}份流水为纸质版,请核查流水真伪。'.format('、'.join(auto_paper_verify_false_idx_list))
# reason = reason1 + '\n' + reason2
# result_field_list.append((name, empty_str, result, json.dumps(verify_list, ensure_ascii=False), empty_str, empty_error_type, reason))
# ---------- 以上 CHINARPA-5153 作废
# 【具体分支描述可以看java代码】
if
aa_type
==
'CAA1'
or
aa_type
==
'CAA2'
:
name
=
'真伪'
# 若仅提供纸质流水,则默认真伪为N2
if
not
auto_elec_verify_list
:
result
=
consts
.
RESULT_N2
reason
=
'<关注>第{0}份流水为纸质版,请核查流水真伪。'
.
format
(
'、'
.
join
(
auto_paper_verify_false_idx_list
))
# 若仅提供电子流水,逐一比对,有false为N1,全部true为Y
if
not
auto_paper_verify_list
:
result
=
consts
.
RESULT_Y
if
all
(
auto_elec_verify_list
)
else
consts
.
RESULT_N1
reason
=
'<关注>第{0}份电子流水疑似造假,请核查excel。'
.
format
(
'、'
.
join
(
auto_elec_verify_false_idx_list
))
#同时包含,同时返回N1,N2
reason_n1
=
'<关注>第{0}份电子流水疑似造假,请核查excel。'
.
format
(
'、'
.
join
(
auto_elec_verify_false_idx_list
))
reason_n2
=
'<关注>第{0}份流水为纸质版,请核查流水真伪。'
.
format
(
'、'
.
join
(
auto_paper_verify_true_idx_list
))
reason_n3
=
'<关注>第{0}份纸质流水疑似造假,请核查excel。'
.
format
(
'、'
.
join
(
auto_paper_verify_false_idx_list
))
if
auto_elec_verify_list
and
auto_paper_verify_list
:
result
=
consts
.
RESULT_Y
if
all
(
auto_elec_verify_list
)
else
consts
.
RESULT_N1
reason1
=
'<关注>第{0}份电子流水疑似造假,请核查excel。'
.
format
(
'、'
.
join
(
auto_elec_verify_false_idx_list
))
reason2
=
'<关注>第{0}份流水为纸质版,请核查流水真伪。'
.
format
(
'、'
.
join
(
auto_paper_verify_false_idx_list
))
reason
=
reason1
+
'
\n
'
+
reason2
result_field_list
.
append
((
name
,
empty_str
,
result
,
json
.
dumps
(
verify_list
,
ensure_ascii
=
False
),
empty_str
,
empty_error_type
,
reason
))
# 非FSM Full & Auto CAA2 目前逻辑和上面的完全一样
elif
aa_type
==
'CAA2'
:
name
=
'真伪'
# 有电子流水,有纸质流水,则需逐一判断电子流水属性或纸质流水检测结果
elecTrue
=
len
(
auto_elec_verify_false_idx_list
)
<=
0
paperTrue
=
len
(
auto_paper_verify_false_idx_list
)
<=
0
paperNotClear
=
len
(
auto_paper_verify_true_idx_list
)
>
0
if
not
elecTrue
and
not
paperTrue
and
paperNotClear
:
reason
=
reason_n1
+
'
\n
'
+
reason_n2
+
'
\n
'
+
reason_n3
elif
not
elecTrue
and
not
paperTrue
:
reason
=
reason_n1
+
'
\n
'
+
reason_n3
elif
not
elecTrue
and
paperNotClear
:
reason
=
reason_n1
+
'
\n
'
+
reason_n2
elif
elecTrue
and
not
paperTrue
and
paperNotClear
:
reason
=
reason_n2
+
'
\n
'
+
reason_n3
elif
elecTrue
and
paperNotClear
:
reason
=
reason_n2
elif
elecTrue
and
not
paperTrue
:
reason
=
reason_n3
result
=
consts
.
RESULT_Y
if
elecTrue
and
paperTrue
and
not
paperNotClear
else
consts
.
RESULT_N
elif
auto_elec_verify_list
and
not
auto_paper_verify_list
:
# 只有电子流水,以电子为准
reason
=
reason_n1
result
=
consts
.
RESULT_Y
if
all
(
auto_elec_verify_list
)
else
consts
.
RESULT_N
elif
not
auto_elec_verify_list
:
result
=
consts
.
RESULT_N
paperTrue
=
len
(
auto_paper_verify_false_idx_list
)
<=
0
paperNotClear
=
len
(
auto_paper_verify_true_idx_list
)
>
0
if
not
paperTrue
and
paperNotClear
:
rea
# 若仅提供纸质流水,则默认真伪为N2
if
not
auto_elec_verify_list
:
result
=
consts
.
RESULT_N2
...
...
@@ -2386,7 +2444,6 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type, allow_
reason
=
reason1
+
'
\n
'
+
reason2
result_field_list
.
append
((
name
,
empty_str
,
result
,
json
.
dumps
(
verify_list
,
ensure_ascii
=
False
),
empty_str
,
empty_error_type
,
reason
))
if
all_zhifubao_weixin
:
# 核查点名称,cms传值,比对结果,ocr结果,图片路径,错误类型,错误描述
result_field_list
.
append
((
'类型'
,
allow_bs_type
,
consts
.
RESULT_N
,
'全部为支付宝/微信'
,
empty_str
,
ErrorType
.
NF
.
value
,
'高风险经销商流水类型异常'
))
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment