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
02829c89
authored
2021-06-07 17:14:45 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix vino
1 parent
a6d6598e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
30 deletions
src/apps/doc/consts.py
src/celery_compare/tasks.py
src/apps/doc/consts.py
View file @
02829c8
...
...
@@ -1194,8 +1194,9 @@ UC_ORDER = ('vinNo', 'manufactureDate', 'firstRegistrationDate')
CO_ORDER
=
(
'customerType'
,
'customerChineseName'
,
'legalRepName'
,
'idNum'
,
'businessLicenseNo'
,
'taxRegistrationCode'
,
'incorporationDate'
,
'businessLicenseDueDate'
,
'capitalRegAmount'
)
PREFIX_MVC
=
'GB'
PREFIX_DL
=
'DL'
PREFIX_MVC
=
'G'
PREFIX_DL
=
'V'
SPLIT
=
';'
# --------------- DDA 保存图片 --------------------
DDA_FIELD
=
'DDA'
...
...
src/celery_compare/tasks.py
View file @
02829c8
...
...
@@ -261,39 +261,27 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id):
dl_find
,
dl_vinos
=
usedcar_info_compare
(
order_usedcar_info
,
ocr_res_dict
,
consts
.
DL_OCR_FIELD
,
consts
.
PCUSD_DL
,
res_set
)
# if mvc_find is True and dl_find is False:
# vino = dl_vinos[-1] if len(dl_vinos) > 0 else ''
# order_usedcar_info[consts.PCUSD_MVC[0][0]] = '{0}: {1}'.format(consts.PREFIX_MVC, vino)
# order_usedcar_info[consts.PCUSD_MVC[0][4]] = consts.RESULT_N
# elif mvc_find is False and dl_find is True:
# vino = mvc_vinos[-1] if len(mvc_vinos) > 0 else ''
# order_usedcar_info[consts.PCUSD_MVC[0][0]] = '{0}: {1}'.format(consts.PREFIX_DL, vino)
# order_usedcar_info[consts.PCUSD_MVC[0][4]] = consts.RESULT_N
# elif mvc_find is False and dl_find is False:
# vino_list = []
# mvc_vino = mvc_vinos[-1] if len(mvc_vinos) > 0 else ''
# dl_vino = dl_vinos[-1] if len(dl_vinos) > 0 else ''
# vino_list.append('{0}: {1}'.format(consts.PREFIX_MVC, mvc_vino))
# vino_list.append(dl_vinos[-1])
# vino = '、'.join('{0}: {1}'.format(consts.PREFIX_DL, dl_vino))
# order_usedcar_info[consts.PCUSD_MVC[0][0]] = vino
if
mvc_find
is
True
and
dl_find
is
False
:
vino
=
dl_vinos
[
0
]
if
len
(
dl_vinos
)
>
0
else
''
order_usedcar_info
[
consts
.
PCUSD_MVC
[
0
][
0
]]
=
vino
vino
=
dl_vinos
[
-
1
]
if
len
(
dl_vinos
)
>
0
else
''
order_usedcar_info
[
consts
.
PCUSD_MVC
[
0
][
0
]]
=
'{0}-{1} {2} {3}-{4}'
.
format
(
consts
.
PREFIX_MVC
,
consts
.
RESULT_Y
,
consts
.
SPLIT
,
consts
.
PREFIX_DL
,
vino
)
order_usedcar_info
[
consts
.
PCUSD_MVC
[
0
][
4
]]
=
consts
.
RESULT_N
elif
mvc_find
is
False
and
dl_find
is
True
:
vino
=
mvc_vinos
[
0
]
if
len
(
mvc_vinos
)
>
0
else
''
order_usedcar_info
[
consts
.
PCUSD_MVC
[
0
][
0
]]
=
vino
vino
=
mvc_vinos
[
-
1
]
if
len
(
mvc_vinos
)
>
0
else
''
order_usedcar_info
[
consts
.
PCUSD_MVC
[
0
][
0
]]
=
'{0}-{1} {2} {3}-{4}'
.
format
(
consts
.
PREFIX_MVC
,
vino
,
consts
.
SPLIT
,
consts
.
PREFIX_DL
,
consts
.
RESULT_Y
)
order_usedcar_info
[
consts
.
PCUSD_MVC
[
0
][
4
]]
=
consts
.
RESULT_N
elif
mvc_find
is
False
and
dl_find
is
False
:
vino_list
=
[]
if
len
(
mvc_vinos
)
>
0
:
vino_list
.
append
(
mvc_vinos
[
0
])
if
len
(
dl_vinos
)
>
0
:
vino_list
.
append
(
dl_vinos
[
0
])
vino
=
'、'
.
join
(
vino_list
)
order_usedcar_info
[
consts
.
PCUSD_MVC
[
0
][
0
]]
=
vino
if
len
(
mvc_vinos
)
==
0
and
len
(
dl_vinos
)
==
0
:
order_usedcar_info
[
consts
.
PCUSD_MVC
[
0
][
0
]]
=
None
order_usedcar_info
[
consts
.
PCUSD_MVC
[
0
][
4
]]
=
consts
.
RESULT_NA
else
:
mvc_vino
=
mvc_vinos
[
-
1
]
if
len
(
mvc_vinos
)
>
0
else
''
dl_vino
=
dl_vinos
[
-
1
]
if
len
(
dl_vinos
)
>
0
else
''
vino
=
'{0}-{1} {2} {3}-{4}'
.
format
(
consts
.
PREFIX_MVC
,
mvc_vino
,
consts
.
SPLIT
,
consts
.
PREFIX_DL
,
dl_vino
)
order_usedcar_info
[
consts
.
PCUSD_MVC
[
0
][
0
]]
=
vino
order_usedcar_info
[
consts
.
PCUSD_MVC
[
0
][
4
]]
=
consts
.
RESULT_N
comparison_res
[
'OCR_Input'
][
'usedCarInfo'
]
=
order_usedcar_info
...
...
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