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
5fd061c0
authored
2021-09-08 18:39:04 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix se report failure_reason
1 parent
0970d38c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
src/celery_compare/tasks.py
src/celery_compare/tasks.py
View file @
5fd061c
...
...
@@ -1048,7 +1048,7 @@ def se_compare_process(compare_info, ocr_res_dict):
}
)
if
len
(
failure_field
)
>
0
:
failure_reason
.
setdefault
(
license_en
,
[])
.
append
(
'/
'
.
join
(
failure_field
))
failure_reason
.
setdefault
(
info_key
,
[])
.
append
(
';
'
.
join
(
failure_field
))
else
:
for
license_en
,
field_list
in
info_value
.
items
():
failure_field
=
[]
...
...
@@ -1077,11 +1077,16 @@ def se_compare_process(compare_info, ocr_res_dict):
}
)
if
len
(
failure_field
)
>
0
:
failure_reason
.
setdefault
(
license_en
,
[])
.
append
(
'/
'
.
join
(
failure_field
))
failure_reason
.
setdefault
(
info_key
,
[])
.
append
(
';
'
.
join
(
failure_field
))
if
failed_count
==
0
:
failure_reason_str
=
''
else
:
failure_reason_str
=
json
.
dumps
(
failure_reason
)
reason_list
=
[]
for
key
,
value
in
failure_reason
.
items
():
if
len
(
value
)
>
0
:
value_str
=
json
.
dumps
(
value
)
reason_list
.
append
(
'{0}: {1}'
.
format
(
key
,
value_str
))
failure_reason_str
=
'、'
.
join
(
reason_list
)
return
compare_result
,
total_fields
,
failed_count
,
successful_at_this_level
,
failure_reason_str
...
...
@@ -1093,6 +1098,7 @@ def se_result_detect(ocr_res_dict):
detect_list
.
append
(
ocr_res_str
is
None
)
return
detect_list
def
se_compare
(
application_id
,
application_entity
,
ocr_res_id
,
last_obj
,
ocr_res_dict
):
try
:
# 比对逻辑
...
...
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