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
8ca21b2b
authored
2021-07-12 18:09:45 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'feature/se_compare3' into feature/0611
2 parents
8e3db97b
f5984e39
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
34 deletions
src/apps/doc/consts.py
src/apps/doc/views.py
src/celery_compare/tasks.py
src/apps/doc/consts.py
View file @
8ca21b2
...
...
@@ -1388,14 +1388,14 @@ BC_COMPARE_LOGIC = {
}
DDA_COMPARE_LOGIC
=
{
'applicationId(1)'
:
(
'check_Num'
,
),
'applicationId(2)'
:
(
'check_Num'
,
),
'bankName'
:
(
'to_bank'
,
),
'companyName'
:
(
'to_company'
,
),
'customerName'
:
(
DDA_IC_NAME
,
),
'idNum'
:
(
DDA_IC_ID
,
),
'accountHolderName'
:
(
DDA_BC_NAME
,
),
'accountNo'
:
(
DDA_BC_ID
,
),
'applicationId(1)'
:
(
'check_Num'
,
'se_common_compare'
,
{}
),
'applicationId(2)'
:
(
'check_Num'
,
'se_common_compare'
,
{}
),
'bankName'
:
(
'to_bank'
,
'se_common_compare'
,
{}
),
'companyName'
:
(
'to_company'
,
'se_company_compare'
,
{}
),
'customerName'
:
(
DDA_IC_NAME
,
'se_common_compare'
,
{}
),
'idNum'
:
(
DDA_IC_ID
,
'se_common_compare'
,
{}
),
'accountHolderName'
:
(
DDA_BC_NAME
,
'se_common_compare'
,
{}
),
'accountNo'
:
(
DDA_BC_ID
,
'se_common_compare'
,
{}
),
}
...
...
src/apps/doc/views.py
View file @
8ca21b2
...
...
@@ -751,6 +751,8 @@ class DocView(GenericView, DocHandler):
class
CompareResultView
(
GenericView
):
permission_classes
=
[]
authentication_classes
=
[]
# 获取比对结果
@use_args
(
compare_result_args
,
location
=
'querystring'
)
...
...
src/celery_compare/tasks.py
View file @
8ca21b2
...
...
@@ -497,7 +497,7 @@ def get_se_compare_info(last_obj, application_entity):
field_input
.
append
((
field
,
individual_info
[
field
]))
license_dict
[
license_en
]
=
field_input
if
individual_info
[
'secondIdType'
]
in
consts
.
SE_SECOND_ID_FIELD_MAPPING
:
if
individual_info
.
get
(
'secondIdType'
)
in
consts
.
SE_SECOND_ID_FIELD_MAPPING
:
second_license_en
,
second_field_list
=
consts
.
SE_SECOND_ID_FIELD_MAPPING
[
individual_info
[
'secondIdType'
]]
if
second_license_en
not
in
license_dict
:
second_field_input
=
[]
...
...
@@ -675,31 +675,32 @@ def se_compare_process(compare_info, ocr_res_dict):
for
info_key
,
info_value
in
compare_info
.
items
():
if
info_key
==
'individualCusInfo'
:
for
idx
,
license_dict
in
info_value
.
items
():
for
license_en
,
field_list
in
license_dict
.
items
():
failure_field
=
[]
result_field_list
=
se_compare_license
(
license_en
,
ocr_res_dict
,
field_list
)
for
name
,
value
,
result
,
ocr_str
in
result_field_list
:
total_fields
+=
1
if
result
==
consts
.
RESULT_N
:
failed_count
+=
1
successful_at_this_level
=
False
failure_field
.
append
(
name
)
compare_result
.
append
(
{
'Info'
:
info_key
,
'Index'
:
idx
,
'License'
:
license_en
,
'Field'
:
name
,
'Input'
:
value
,
'OCR'
:
ocr_str
,
'Result'
:
result
,
'Position'
:
''
,
'Image'
:
''
,
'errorType'
:
''
,
}
)
failure_reason
.
setdefault
(
license_en
,
[])
.
append
(
'/'
.
join
(
failure_field
))
for
idx
,
license_list
in
info_value
.
items
():
for
license_dict
in
license_list
:
for
license_en
,
field_list
in
license_dict
.
items
():
failure_field
=
[]
result_field_list
=
se_compare_license
(
license_en
,
ocr_res_dict
,
field_list
)
for
name
,
value
,
result
,
ocr_str
in
result_field_list
:
total_fields
+=
1
if
result
==
consts
.
RESULT_N
:
failed_count
+=
1
successful_at_this_level
=
False
failure_field
.
append
(
name
)
compare_result
.
append
(
{
'Info'
:
info_key
,
'Index'
:
idx
,
'License'
:
license_en
,
'Field'
:
name
,
'Input'
:
value
,
'OCR'
:
ocr_str
,
'Result'
:
result
,
'Position'
:
''
,
'Image'
:
''
,
'errorType'
:
''
,
}
)
failure_reason
.
setdefault
(
license_en
,
[])
.
append
(
'/'
.
join
(
failure_field
))
else
:
for
license_en
,
field_list
in
info_value
.
items
():
failure_field
=
[]
...
...
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