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
ae56a619
authored
2021-09-06 18:06:49 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix DDA
1 parent
bfa90f18
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
src/celery_compare/tasks.py
src/celery_compare/tasks.py
View file @
ae56a61
...
...
@@ -847,6 +847,10 @@ def get_se_compare_info(last_obj, application_entity, detect_list):
bank_field_input
=
[]
for
bank_field
in
consts
.
SE_BANK_FIELD
:
bank_field_input
.
append
((
bank_field
,
bank_info_dict
[
bank_field
]))
if
'工商'
in
bank_info_dict
.
get
(
consts
.
SE_BANK_FIELD
[
-
1
],
''
):
is_gsyh
=
True
else
:
is_gsyh
=
False
bank_info
[
consts
.
BC_EN
]
=
bank_field_input
dda_field_input
=
[]
...
...
@@ -874,7 +878,7 @@ def get_se_compare_info(last_obj, application_entity, detect_list):
other_info
[
consts
.
HMH_EN
]
=
hmh_field_input
compare_info
[
'other'
]
=
other_info
return
compare_info
return
compare_info
,
is_gsyh
def
se_compare_license
(
license_en
,
ocr_res_dict
,
field_list
):
...
...
@@ -1003,7 +1007,7 @@ def se_mvc34_compare(license_en, ocr_res_dict, field_list):
return
result_field_list
def
se_compare_process
(
compare_info
,
ocr_res_dict
):
def
se_compare_process
(
compare_info
,
ocr_res_dict
,
is_gsyh
):
# individualCusInfo
# corporateCusInfo
# vehicleInfo
...
...
@@ -1053,7 +1057,7 @@ def se_compare_process(compare_info, ocr_res_dict):
else
:
result_field_list
,
no_ocr_result
=
se_compare_license
(
license_en
,
ocr_res_dict
,
field_list
)
for
name
,
value
,
result
,
ocr_str
,
img_path
,
error_type
in
result_field_list
:
if
license_en
!=
consts
.
DDA_EN
or
not
no_ocr_result
:
if
license_en
!=
consts
.
DDA_EN
or
not
no_ocr_result
or
is_gsyh
:
total_fields
+=
1
if
result
==
consts
.
RESULT_N
:
failed_count
+=
1
...
...
@@ -1095,9 +1099,9 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res
# 比对逻辑
start_time
=
datetime
.
now
()
detect_list
=
se_result_detect
(
ocr_res_dict
)
compare_info
=
get_se_compare_info
(
last_obj
,
application_entity
,
detect_list
)
compare_info
,
is_gsyh
=
get_se_compare_info
(
last_obj
,
application_entity
,
detect_list
)
compare_result
,
total_fields
,
failed_count
,
successful_at_this_level
,
failure_reason_str
=
se_compare_process
(
compare_info
,
ocr_res_dict
)
compare_info
,
ocr_res_dict
,
is_gsyh
)
compare_log
.
info
(
'{0} [SE] [compare success] [entity={1}] [id={2}] [ocr_res_id={3}] [result={4}]'
.
format
(
log_base
,
application_entity
,
application_id
,
ocr_res_id
,
compare_result
))
except
Exception
as
e
:
...
...
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