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
1aae327e
authored
2021-09-08 18:40:12 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'feature/se_compare_yh' into feature/0611
2 parents
8c324ae7
5fd061c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
src/celery_compare/tasks.py
src/celery_compare/tasks.py
View file @
1aae327
...
...
@@ -650,7 +650,7 @@ def ca_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res
if
len
(
field_list
)
>
0
:
field_failed
[
'individualCusInfo'
]
.
append
(
';'
.
join
(
field_list
))
corporate_res
=
comparison_res
.
get
(
'OCR_Input'
,
{})
.
get
(
'corporateCusInfo'
,
{}
)
corporate_res
=
comparison_res
.
get
(
'OCR_Input'
,
{})
.
get
(
'corporateCusInfo'
)
if
corporate_res
is
not
None
:
total_fields
+=
8
if
not
successful_at_this_level
:
...
...
@@ -661,7 +661,7 @@ def ca_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res
if
len
(
corporate_field_list
)
>
0
:
field_failed
[
'corporateCusInfo'
]
.
append
(
';'
.
join
(
corporate_field_list
))
used_car_res
=
comparison_res
.
get
(
'OCR_Input'
,
{})
.
get
(
'usedCarInfo'
,
{}
)
used_car_res
=
comparison_res
.
get
(
'OCR_Input'
,
{})
.
get
(
'usedCarInfo'
)
if
used_car_res
is
not
None
:
total_fields
+=
3
if
not
successful_at_this_level
:
...
...
@@ -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