Commit ec40e23a authored by pengxiong's avatar pengxiong

file拼接

parent 8a571a17
......@@ -138,8 +138,9 @@ class HoldDiagnoseReport(Base, BaseModel):
allow_field = set(allow_field) & set(allow_field)
else:
allow_field = all_field
file = ''
if self.file:
self.file = pdf_folder + self.file
file = pdf_folder + self.file
data = {c: int(getattr(self, c).timestamp()) if isinstance(getattr(self, c), datetime.datetime) else getattr(self, c) for c in allow_field}
with TAMP_SQL(tamp_user_engine) as tamp_user, TAMP_SQL(tamp_diagnose_app_engine) as tamp_diagnose_app:
tamp_user_session = tamp_user.session
......@@ -151,6 +152,7 @@ class HoldDiagnoseReport(Base, BaseModel):
res = res.fetchone()
res2 = res2.fetchone()
if data:
data['file'] = file
if res:
data['author_name'] = res[0]
else:
......@@ -182,8 +184,9 @@ class HoldReport(Base, BaseModel):
allow_field = set(allow_field) & set(allow_field)
else:
allow_field = all_field
file = ''
if self.file:
self.file = pdf_folder + self.file
file = pdf_folder + self.file
data = {c: int(getattr(self, c).timestamp()) if isinstance(getattr(self, c), datetime.datetime) else getattr(self, c) for c in allow_field}
with TAMP_SQL(tamp_user_engine) as tamp_user, TAMP_SQL(tamp_diagnose_app_engine) as tamp_diagnose_app:
tamp_user_session = tamp_user.session
......@@ -195,6 +198,7 @@ class HoldReport(Base, BaseModel):
res = res.fetchone()
res2 = res2.fetchone()
if data:
data['file'] = file
if res:
data['author_name'] = res[0]
else:
......@@ -226,8 +230,9 @@ class PeriodicReport(Base, BaseModel):
allow_field = set(allow_field) & set(allow_field)
else:
allow_field = all_field
file = ''
if self.file:
self.file = pdf_folder + self.file
file = pdf_folder + self.file
data = {c: int(getattr(self, c).timestamp()) if isinstance(getattr(self, c), datetime.datetime) else getattr(self, c) for c in allow_field}
with TAMP_SQL(tamp_user_engine) as tamp_user, TAMP_SQL(tamp_diagnose_app_engine) as tamp_diagnose_app:
tamp_user_session = tamp_user.session
......@@ -239,6 +244,7 @@ class PeriodicReport(Base, BaseModel):
res = res.fetchone()
res2 = res2.fetchone()
if data:
data['file'] = file
if res:
data['author_name'] = res[0]
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment