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
560316ec
authored
2022-01-26 17:16:21 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix ltgt
1 parent
20f285b0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
16 deletions
src/apps/doc/consts.py
src/apps/doc/management/commands/folder_ltgt_process.py
src/celery_compare/tasks.py
src/apps/doc/consts.py
View file @
560316e
...
...
@@ -833,14 +833,9 @@ MVC_SE_FIELD_ORDER_3_4 = (
(
'解除抵押日期'
,
'解除抵押日期'
),
)
MVC_SE_FIELD_ORDER_1_2_LTGT
=
((
'1.机动车所有人/身份证名称/号码'
,
'机动车所有人/身份证明名称/号码'
),
(
'编号'
,
'机动车登记证书编号'
),)
MVC_SE_FIELD_ORDER_3_4_LTGT
=
(
(
'身份证名称/号码'
,
'身份证明名称/号码'
),
(
'机动车登记证书编号'
,
'机动车登记证书编号'
),
(
'抵押登记日期'
,
'抵押登记日期'
),
)
MVC_SE_FIELD_ORDER_LTGT
=
((
'1.机动车所有人/身份证名称/号码'
,
'机动车所有人/身份证明名称/号码'
),
(
'4.机动车登记编号'
,
'机动车登记证书编号'
),
(
'抵押登记日期'
,
'抵押登记日期'
),)
# 机动车销售统一发票
MVI_CN_NAME
=
'机动车销售统一发票'
...
...
src/apps/doc/management/commands/folder_ltgt_process.py
View file @
560316e
...
...
@@ -90,8 +90,7 @@ class Command(BaseCommand, LoggerMixin):
consts
.
CONTRACT_CLASSIFY
:
(
consts
.
CONTRACT_CN_NAME
,
None
,
None
,
consts
.
AFC_CON_FIELD_ORDER_LTGT
),
consts
.
VAT_CLASSIFY
:
(
consts
.
VAT_CN_NAME
,
None
,
None
,
consts
.
VATS_FIELD_ORDER
),
consts
.
IC_CLASSIFY
:
(
consts
.
IC_CN_NAME
,
'有效期限'
,
consts
.
IC_FIELD_ORDER_3
,
consts
.
IC_FIELD_ORDER_2
),
consts
.
MVC_CLASSIFY
:
(
consts
.
MVC_CN_NAME
,
'机动车登记证书编号'
,
consts
.
MVC_SE_FIELD_ORDER_3_4_LTGT
,
consts
.
MVC_SE_FIELD_ORDER_1_2_LTGT
),
consts
.
MVC_CLASSIFY
:
(
consts
.
MVC_CN_NAME
,
None
,
None
,
consts
.
MVC_SE_FIELD_ORDER_LTGT
),
}
# ocr相关
self
.
ocr_url
=
conf
.
OCR_URL_FOLDER
...
...
@@ -605,12 +604,12 @@ class Command(BaseCommand, LoggerMixin):
if
key_field
is
not
None
and
len
(
side_field_order
)
>
len
(
field_order
):
first_head_row
=
[]
for
a
,
_
in
side_field_order
:
first_head_row
.
append
(
a
)
for
_
,
b
in
side_field_order
:
first_head_row
.
append
(
b
)
else
:
first_head_row
=
[]
for
a
,
_
in
field_order
:
first_head_row
.
append
(
a
)
for
_
,
b
in
field_order
:
first_head_row
.
append
(
b
)
if
key_field
is
not
None
and
key_field
in
result
[
self
.
RESULT_KEY
]:
head_fields
=
[]
...
...
@@ -734,15 +733,28 @@ class Command(BaseCommand, LoggerMixin):
if
isinstance
(
result
,
dict
)
and
len
(
result
)
>
0
:
date_str
=
time
.
strftime
(
"
%
Y-
%
m-
%
d"
)
for
c
,
res_list
in
result
.
items
():
for
res
in
res_list
:
if
c
==
consts
.
MVC_CLASSIFY
:
rebuild_res
=
{}
for
tmp_res
in
res_list
:
rebuild_res
.
update
(
tmp_res
)
result_queue
.
put
(
{
self
.
CLASSIFY_KEY
:
c
,
self
.
RESULT_KEY
:
res
,
self
.
RESULT_KEY
:
re
build_re
s
,
self
.
DATE_KEY
:
date_str
,
self
.
FILE_KEY
:
name
,
}
)
else
:
for
res
in
res_list
:
result_queue
.
put
(
{
self
.
CLASSIFY_KEY
:
c
,
self
.
RESULT_KEY
:
res
,
self
.
DATE_KEY
:
date_str
,
self
.
FILE_KEY
:
name
,
}
)
def
handle
(
self
,
*
args
,
**
kwargs
):
if
len
(
self
.
input_dirs
)
==
0
:
...
...
src/celery_compare/tasks.py
View file @
560316e
...
...
@@ -2741,6 +2741,16 @@ def se_compare_auto(application_id, application_entity, ocr_res_id, last_obj, oc
auto_obj
.
ocr_whole_result_pass
=
full_result
auto_obj
.
ocr_auto_result
=
json
.
dumps
(
compare_result
)
auto_obj
.
ocr_latest_comparison_time
=
datetime
.
now
()
auto_obj
.
rpa_result
=
None
auto_obj
.
rpa_1st_eye_tat
=
None
auto_obj
.
rpa_2nd_eye_tat
=
None
auto_obj
.
rpa_3rd_eye_tat
=
None
auto_obj
.
rpa_total_tat
=
None
auto_obj
.
rpa_activated_time
=
None
auto_obj
.
rpa_get_case_from_ocr_time
=
None
auto_obj
.
rpa_get_case_from_oc_time
=
None
auto_obj
.
rpa_payment_authorize_time
=
None
auto_obj
.
rpa_second_eye_time
=
None
auto_obj
.
save
()
compare_log
.
info
(
'{0} [Auto SE] [result save success] [entity={1}] [id={2}] [ocr_res_id={3}]'
.
format
(
log_base
,
application_entity
,
application_id
,
ocr_res_id
))
...
...
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