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
95ba61d5
authored
2021-12-08 14:04:42 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'fix/1207' into feature/se
2 parents
ab767794
4ea50975
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
src/apps/doc/consts.py
src/celery_compare/tasks.py
src/apps/doc/consts.py
View file @
95ba61d
...
...
@@ -1501,7 +1501,7 @@ HMH_EN = 'Mortgage Waiver Letter'
JYPZ_EN
=
'Used Car Document'
AFC_CONTRACT_EN
=
'AFC Contract'
SKIP_CARD
=
{
ID_EN
,
RP_EN
,
SME_BL_EN
}
SKIP_CARD
=
{
SME_BL_EN
}
ID_COMPARE_LOGIC
=
{
...
...
src/celery_compare/tasks.py
View file @
95ba61d
...
...
@@ -1527,8 +1527,6 @@ def se_afc_contract_compare(license_en, ocr_res_dict, strip_list):
ocr_res
=
ocr_res_list
.
pop
()
for
name
,
value
in
strip_list
:
ocr_str_or_list
=
ocr_res
.
get
(
compare_logic
[
name
][
0
])
if
name
==
consts
.
SE_AFC_CON_FIELD
[
21
]:
if
len
(
value
)
==
3
:
reason
=
[]
...
...
@@ -1548,27 +1546,29 @@ def se_afc_contract_compare(license_en, ocr_res_dict, strip_list):
result
=
consts
.
RESULT_N
reason
=
consts
.
GZS_REASON_1
ocr_str
=
empty_str
elif
isinstance
(
ocr_str_or_list
,
str
)
or
isinstance
(
ocr_str_or_list
,
list
):
result
=
getattr
(
cp
,
compare_logic
[
name
][
1
])(
value
,
ocr_str_or_list
,
**
compare_logic
[
name
][
2
])
if
isinstance
(
ocr_str_or_list
,
list
):
ocr_str
=
json
.
dumps
(
ocr_str_or_list
)
else
:
ocr_str
=
ocr_str_or_list
reason
=
compare_logic
[
name
][
3
]
else
:
result
=
consts
.
RESULT_N
ocr_str
=
empty_str
reason
=
compare_logic
[
name
][
3
]
ocr_str_or_list
=
ocr_res
.
get
(
compare_logic
[
name
][
0
])
if
isinstance
(
ocr_str_or_list
,
str
)
or
isinstance
(
ocr_str_or_list
,
list
):
result
=
getattr
(
cp
,
compare_logic
[
name
][
1
])(
value
,
ocr_str_or_list
,
**
compare_logic
[
name
][
2
])
if
isinstance
(
ocr_str_or_list
,
list
):
ocr_str
=
json
.
dumps
(
ocr_str_or_list
)
else
:
ocr_str
=
ocr_str_or_list
reason
=
compare_logic
[
name
][
3
]
else
:
result
=
consts
.
RESULT_N
ocr_str
=
empty_str
reason
=
compare_logic
[
name
][
3
]
img_path
=
empty_str
error_type
=
empty_error_type
if
result
==
consts
.
RESULT_Y
else
ErrorType
.
OCR
.
value
if
isinstance
(
value
,
list
):
value
=
json
.
dumps
(
value
)
value
=
json
.
dumps
(
value
,
ensure_ascii
=
False
)
result_field_list
.
append
((
name
,
value
,
result
,
ocr_str
,
img_path
,
error_type
,
reason
))
else
:
for
name
,
value
in
strip_list
:
if
isinstance
(
value
,
list
):
value
=
json
.
dumps
(
value
)
value
=
json
.
dumps
(
value
,
ensure_ascii
=
False
)
result_field_list
.
append
((
name
,
value
,
consts
.
RESULT_N
,
empty_str
,
empty_str
,
ErrorType
.
NF
.
value
,
'{0}未找到'
.
format
(
license_en
)))
...
...
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