Commit 0fddbcf0 authored by pengxiong's avatar pengxiong

fix

parent c933f949
......@@ -7,6 +7,7 @@
# @Software : PyCharm
# -----------------------------------------------------------------------------
import datetime
import json
import time
import uuid
......@@ -18,6 +19,7 @@ from flask import make_response
from app.api.engine import config
from app.service.report_service import get_report_list, delete_report, get_one_report, edit_report, make_report
from app.service.template_manage_service import get_make_report_data
from app.utils.format_transfer import npEncoder
from app.utils.html_to_pdf import html_to_pdf
from app.api.engine import pdf_folder, redis, env, TAMP_SQL, tamp_diagnose_app_engine
from app.utils.jinjia2html_v2 import DataIntegrate
......@@ -48,7 +50,7 @@ class ReportHandlers(Resource):
"message": "成功",
"attributes": data
}
return resp
return json.dumps(resp, cls=npEncoder, ensure_ascii=False)
def post(self):
"""保存报告."""
......
......@@ -195,9 +195,9 @@ def get_make_report_data(args):
if not template:
template = res.custom_template
template = json.loads(template)
# dt = DataIntegrate(ifa_id=ifa_id, customer_id=customer_id, type=type)
# data = dt.get_template_data(template)
data = template
dt = DataIntegrate(ifa_id=ifa_id, customer_id=customer_id, type=type)
data = dt.get_template_data(template)
# data = template
return data
......
......@@ -1669,7 +1669,7 @@
</div>
<div class="dcell">
<div class="page_text">
{{{brand_name}}<br>
{{brand_name}}<br>
工作室
</div>
</div>
......
......@@ -308,8 +308,8 @@ class DataIntegrate:
if __name__ == '__main__':
start = time.time()
dt = DataIntegrate(ifa_id='USER_INFO15917850824287', customer_id='6716613802534121472', type=2)
dt = DataIntegrate(ifa_id='USER_INFO15917850824287', customer_id='6716613802534121472', type=1)
data = dt.get_template_data()
print(sys.getsizeof(data)*8)
print(data)
# dt.render_data()
print('耗时{}秒'.format(round(time.time()-start, 2)))
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