Merge branch 'feature/dda2' into feature/0611
Showing
1 changed file
with
11 additions
and
3 deletions
... | @@ -771,7 +771,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -771,7 +771,7 @@ class Command(BaseCommand, LoggerMixin): |
771 | # 'idcard': True or False, | 771 | # 'idcard': True or False, |
772 | # 'bs': None or normal or mobile, | 772 | # 'bs': None or normal or mobile, |
773 | # } | 773 | # } |
774 | report_list = [None, False, None, False] | 774 | report_list = [None, False, None, None] |
775 | do_dda = is_hil and doc.document_scheme == consts.DOC_SCHEME_LIST[1] | 775 | do_dda = is_hil and doc.document_scheme == consts.DOC_SCHEME_LIST[1] |
776 | except Exception as e: | 776 | except Exception as e: |
777 | self.online_log.error('{0} [process error (db filter)] [task={1}] [error={2}]'.format( | 777 | self.online_log.error('{0} [process error (db filter)] [task={1}] [error={2}]'.format( |
... | @@ -1039,6 +1039,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -1039,6 +1039,7 @@ class Command(BaseCommand, LoggerMixin): |
1039 | if dda_record is None: | 1039 | if dda_record is None: |
1040 | dda_record = DDARecords(application_id=doc.application_id) | 1040 | dda_record = DDARecords(application_id=doc.application_id) |
1041 | except Exception as e: | 1041 | except Exception as e: |
1042 | report_list[3] = False | ||
1042 | self.online_log.error('{0} [process error (dda db get)] [task={1}] ' | 1043 | self.online_log.error('{0} [process error (dda db get)] [task={1}] ' |
1043 | '[error={2}]'.format(self.log_base, task_str, traceback.format_exc())) | 1044 | '[error={2}]'.format(self.log_base, task_str, traceback.format_exc())) |
1044 | else: | 1045 | else: |
... | @@ -1118,6 +1119,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -1118,6 +1119,7 @@ class Command(BaseCommand, LoggerMixin): |
1118 | move_img_path_dict.setdefault( | 1119 | move_img_path_dict.setdefault( |
1119 | consts.IC_FIELD, set()).add(id_record.file_path) | 1120 | consts.IC_FIELD, set()).add(id_record.file_path) |
1120 | except Exception as e: | 1121 | except Exception as e: |
1122 | report_list[3] = False | ||
1121 | self.online_log.error( | 1123 | self.online_log.error( |
1122 | '{0} [process error (dda id process)] [task={1}] ' | 1124 | '{0} [process error (dda id process)] [task={1}] ' |
1123 | '[error={2}]'.format(self.log_base, task_str, | 1125 | '[error={2}]'.format(self.log_base, task_str, |
... | @@ -1146,6 +1148,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -1146,6 +1148,7 @@ class Command(BaseCommand, LoggerMixin): |
1146 | move_img_path_dict.setdefault( | 1148 | move_img_path_dict.setdefault( |
1147 | consts.BC_FIELD, set()).add(bc_record.file_path) | 1149 | consts.BC_FIELD, set()).add(bc_record.file_path) |
1148 | except Exception as e: | 1150 | except Exception as e: |
1151 | report_list[3] = False | ||
1149 | self.online_log.error( | 1152 | self.online_log.error( |
1150 | '{0} [process error (dda bc process)] [task={1}] ' | 1153 | '{0} [process error (dda bc process)] [task={1}] ' |
1151 | '[error={2}]'.format(self.log_base, task_str, | 1154 | '[error={2}]'.format(self.log_base, task_str, |
... | @@ -1187,6 +1190,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -1187,6 +1190,7 @@ class Command(BaseCommand, LoggerMixin): |
1187 | '{0} [dda process] [img path empty] [task={1}] ' | 1190 | '{0} [dda process] [img path empty] [task={1}] ' |
1188 | '[path={2}]'.format(self.log_base, task_str, path)) | 1191 | '[path={2}]'.format(self.log_base, task_str, path)) |
1189 | except Exception as e: | 1192 | except Exception as e: |
1193 | report_list[3] = False | ||
1190 | self.online_log.error( | 1194 | self.online_log.error( |
1191 | '{0} [process error (dda img move)] [task={1}] ' | 1195 | '{0} [process error (dda img move)] [task={1}] ' |
1192 | '[error={2}]'.format(self.log_base, task_str, traceback.format_exc())) | 1196 | '[error={2}]'.format(self.log_base, task_str, traceback.format_exc())) |
... | @@ -1218,16 +1222,19 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -1218,16 +1222,19 @@ class Command(BaseCommand, LoggerMixin): |
1218 | is_id=False, | 1222 | is_id=False, |
1219 | file_path=bc_img_path) | 1223 | file_path=bc_img_path) |
1220 | except Exception as e: | 1224 | except Exception as e: |
1225 | report_list[3] = False | ||
1221 | self.online_log.error( | 1226 | self.online_log.error( |
1222 | '{0} [process error (dda id&bc db save)] [task={1}] ' | 1227 | '{0} [process error (dda id&bc db save)] [task={1}] ' |
1223 | '[error={2}]'.format(self.log_base, task_str, traceback.format_exc())) | 1228 | '[error={2}]'.format(self.log_base, task_str, traceback.format_exc())) |
1224 | 1229 | ||
1225 | except Exception as e: | 1230 | except Exception as e: |
1231 | report_list[3] = False | ||
1226 | self.online_log.error( | 1232 | self.online_log.error( |
1227 | '{0} [process error (dda process)] [task={1}] ' | 1233 | '{0} [process error (dda process)] [task={1}] ' |
1228 | '[error={2}]'.format(self.log_base, task_str, traceback.format_exc())) | 1234 | '[error={2}]'.format(self.log_base, task_str, traceback.format_exc())) |
1229 | else: | 1235 | else: |
1230 | report_list[3] = True | 1236 | if report_list[3] is None: |
1237 | report_list[3] = True | ||
1231 | 1238 | ||
1232 | finally: | 1239 | finally: |
1233 | # report_dict = { | 1240 | # report_dict = { |
... | @@ -1298,7 +1305,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -1298,7 +1305,7 @@ class Command(BaseCommand, LoggerMixin): |
1298 | self.log_base, traceback.format_exc())) | 1305 | self.log_base, traceback.format_exc())) |
1299 | 1306 | ||
1300 | try: | 1307 | try: |
1301 | if report_list[3]: | 1308 | if report_list[3] is not None: |
1302 | report_table.objects.create( | 1309 | report_table.objects.create( |
1303 | case_number=doc.application_id, | 1310 | case_number=doc.application_id, |
1304 | request_team=RequestTeam.get_value(doc.document_scheme, 0), | 1311 | request_team=RequestTeam.get_value(doc.document_scheme, 0), |
... | @@ -1306,6 +1313,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -1306,6 +1313,7 @@ class Command(BaseCommand, LoggerMixin): |
1306 | input_file=doc.document_name, | 1313 | input_file=doc.document_name, |
1307 | transaction_start=doc.start_time, | 1314 | transaction_start=doc.start_time, |
1308 | transaction_end=end_time, | 1315 | transaction_end=end_time, |
1316 | successful_at_this_level=report_list[3], | ||
1309 | process_name=ProcessName.DDA.value, | 1317 | process_name=ProcessName.DDA.value, |
1310 | ) | 1318 | ) |
1311 | except Exception as e: | 1319 | except Exception as e: | ... | ... |
-
Please register or sign in to post a comment