Commit 6b0a587b authored by pengxiong's avatar pengxiong

fix2

parent cff68d2c
......@@ -138,7 +138,8 @@ class HoldDiagnoseReport(Base, BaseModel):
allow_field = set(allow_field) & set(allow_field)
else:
allow_field = all_field
self.file = pdf_folder + self.file
if self.file:
self.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
......@@ -181,7 +182,8 @@ class HoldReport(Base, BaseModel):
allow_field = set(allow_field) & set(allow_field)
else:
allow_field = all_field
self.file = pdf_folder + self.file
if self.file:
self.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
......@@ -224,7 +226,8 @@ class PeriodicReport(Base, BaseModel):
allow_field = set(allow_field) & set(allow_field)
else:
allow_field = all_field
self.file = pdf_folder + self.file
if self.file:
self.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
......
......@@ -189,11 +189,11 @@ def make_report(args):
record_id = report_record.id
pid = os.fork()
if pid == 0:
try:
dt = DataIntegrate(ifa_id=ifa_id, customer_id=customer_id, pdf_name=pdf_name, type=type)
dt.render_data(data=report_data)
except:
pass
# try:
dt = DataIntegrate(ifa_id=ifa_id, customer_id=customer_id, pdf_name=pdf_name, type=type)
dt.render_data(data=report_data)
# except:
# pass
with TAMP_SQL(tamp_diagnose_app_engine) as tamp_diagnose_app:
tamp_diagnose_session = tamp_diagnose_app.session
hold_report = tamp_diagnose_session.query(HoldReport).filter(and_(
......
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