33c7ea9a by 周伟奇

fix dda report

1 parent 50b74a85
......@@ -755,7 +755,7 @@ class Command(BaseCommand, LoggerMixin):
# 'idcard': True or False,
# 'bs': None or normal or mobile,
# }
report_list = [None, False, None, False]
report_list = [None, False, None, None]
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:
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!