Commit 6b0a587b authored by pengxiong's avatar pengxiong

fix2

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