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
4eccdb7d
authored
2021-07-09 11:40:15 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix TCSEP selfEmployedSubType
1 parent
7b3b25a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
src/celery_compare/tasks.py
src/celery_compare/tasks.py
View file @
4eccdb7
...
...
@@ -88,6 +88,9 @@ def field_compare(info_dict, ocr_res_dict, ocr_field, compare_list, res_set,
break
for
idx
,
compare_tuple
in
enumerate
(
compare_list
):
input_str
=
info_dict
.
get
(
compare_tuple
[
0
])
if
not
isinstance
(
input_str
,
str
)
and
compare_tuple
[
0
]
==
'selfEmployedSubType'
:
continue
ocr_str
=
ocr_res
.
get
(
compare_tuple
[
1
])
compare_res
,
ocr_output
=
getattr
(
cp
,
compare_tuple
[
2
])(
input_str
,
ocr_str
,
idx
,
**
compare_tuple
[
3
])
...
...
@@ -388,7 +391,7 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id):
ocr_res_id
,
res_text
))
compare_log
.
info
(
'{0} [task success] [entity={1}] [id={2}] [uniq_seq={3}] [ocr_res_id={4}]'
.
format
(
log_base
,
application_entity
,
application_id
,
uniq_seq
,
ocr_res_id
))
finally
:
try
:
end_time
=
datetime
.
now
()
if
compare_failed
:
...
...
@@ -428,13 +431,13 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id):
total_fields
+=
3
if
not
successful_at_this_level
:
for
field_name
,
_
,
_
,
_
,
result_field
in
consts
.
TCSEP
:
if
individual
.
get
(
result_field
)
!=
consts
.
RESULT_Y
:
if
result_field
in
individual
and
individual
.
get
(
result_field
)
!=
consts
.
RESULT_Y
:
field_list
.
append
(
field_name
)
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
:
...
...
@@ -445,7 +448,7 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id):
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
:
...
...
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