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
290726d8
authored
2021-06-04 15:54:03 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'feature/dda2' into feature/0611
2 parents
9f451c37
33c7ea9a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
src/apps/doc/management/commands/ocr_process.py
src/apps/doc/management/commands/ocr_process.py
View file @
290726d
...
...
@@ -771,7 +771,7 @@ class Command(BaseCommand, LoggerMixin):
# 'idcard': True or False,
# 'bs': None or normal or mobile,
# }
report_list
=
[
None
,
False
,
None
,
Fals
e
]
report_list
=
[
None
,
False
,
None
,
Non
e
]
do_dda
=
is_hil
and
doc
.
document_scheme
==
consts
.
DOC_SCHEME_LIST
[
1
]
except
Exception
as
e
:
self
.
online_log
.
error
(
'{0} [process error (db filter)] [task={1}] [error={2}]'
.
format
(
...
...
@@ -1039,6 +1039,7 @@ class Command(BaseCommand, LoggerMixin):
if
dda_record
is
None
:
dda_record
=
DDARecords
(
application_id
=
doc
.
application_id
)
except
Exception
as
e
:
report_list
[
3
]
=
False
self
.
online_log
.
error
(
'{0} [process error (dda db get)] [task={1}] '
'[error={2}]'
.
format
(
self
.
log_base
,
task_str
,
traceback
.
format_exc
()))
else
:
...
...
@@ -1118,6 +1119,7 @@ class Command(BaseCommand, LoggerMixin):
move_img_path_dict
.
setdefault
(
consts
.
IC_FIELD
,
set
())
.
add
(
id_record
.
file_path
)
except
Exception
as
e
:
report_list
[
3
]
=
False
self
.
online_log
.
error
(
'{0} [process error (dda id process)] [task={1}] '
'[error={2}]'
.
format
(
self
.
log_base
,
task_str
,
...
...
@@ -1146,6 +1148,7 @@ class Command(BaseCommand, LoggerMixin):
move_img_path_dict
.
setdefault
(
consts
.
BC_FIELD
,
set
())
.
add
(
bc_record
.
file_path
)
except
Exception
as
e
:
report_list
[
3
]
=
False
self
.
online_log
.
error
(
'{0} [process error (dda bc process)] [task={1}] '
'[error={2}]'
.
format
(
self
.
log_base
,
task_str
,
...
...
@@ -1187,6 +1190,7 @@ class Command(BaseCommand, LoggerMixin):
'{0} [dda process] [img path empty] [task={1}] '
'[path={2}]'
.
format
(
self
.
log_base
,
task_str
,
path
))
except
Exception
as
e
:
report_list
[
3
]
=
False
self
.
online_log
.
error
(
'{0} [process error (dda img move)] [task={1}] '
'[error={2}]'
.
format
(
self
.
log_base
,
task_str
,
traceback
.
format_exc
()))
...
...
@@ -1218,16 +1222,19 @@ class Command(BaseCommand, LoggerMixin):
is_id
=
False
,
file_path
=
bc_img_path
)
except
Exception
as
e
:
report_list
[
3
]
=
False
self
.
online_log
.
error
(
'{0} [process error (dda id&bc db save)] [task={1}] '
'[error={2}]'
.
format
(
self
.
log_base
,
task_str
,
traceback
.
format_exc
()))
except
Exception
as
e
:
report_list
[
3
]
=
False
self
.
online_log
.
error
(
'{0} [process error (dda process)] [task={1}] '
'[error={2}]'
.
format
(
self
.
log_base
,
task_str
,
traceback
.
format_exc
()))
else
:
report_list
[
3
]
=
True
if
report_list
[
3
]
is
None
:
report_list
[
3
]
=
True
finally
:
# report_dict = {
...
...
@@ -1298,7 +1305,7 @@ class Command(BaseCommand, LoggerMixin):
self
.
log_base
,
traceback
.
format_exc
()))
try
:
if
report_list
[
3
]:
if
report_list
[
3
]
is
not
None
:
report_table
.
objects
.
create
(
case_number
=
doc
.
application_id
,
request_team
=
RequestTeam
.
get_value
(
doc
.
document_scheme
,
0
),
...
...
@@ -1306,6 +1313,7 @@ class Command(BaseCommand, LoggerMixin):
input_file
=
doc
.
document_name
,
transaction_start
=
doc
.
start_time
,
transaction_end
=
end_time
,
successful_at_this_level
=
report_list
[
3
],
process_name
=
ProcessName
.
DDA
.
value
,
)
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