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
33c7ea9a
authored
2021-06-04 15:53:41 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix dda report
1 parent
50b74a85
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 @
33c7ea9
...
...
@@ -755,7 +755,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
(
...
...
@@ -1023,6 +1023,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
:
...
...
@@ -1102,6 +1103,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
,
...
...
@@ -1130,6 +1132,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
,
...
...
@@ -1171,6 +1174,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
()))
...
...
@@ -1202,16 +1206,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 = {
...
...
@@ -1282,7 +1289,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
),
...
...
@@ -1290,6 +1297,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