Commit 800b0fcd by 蒋勇

d

parent 557cd4e8
......@@ -36,18 +36,21 @@ def charts(datalist, charttype, pngpath):
axisline_opts=opts.AxisLineOpts(linestyle_opts=opts.LineStyleOpts(color=[(0.3, "#67e0e3"), (0.7, "#37a2da"), (1, "#fd666d")], width=35)),
label_opts=opts.LabelOpts(font_size=55,formatter="{value}%"))
if img:
print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
make_snapshot(snapshot, img.render(), pngpath)
return True
else:
return False
except Exception as e:
print("ExceptionExceptionExceptionExceptionExceptionException>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>ExceptionExceptionExceptionException")
print(e)
print("ExceptionExceptionExceptionExceptionExceptionException>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>ExceptionExceptionExceptionException")
return False
#生成报告(es工商、财务信息、风险监测(仪表盘图))
def WriteReport(Else_info,Companyinfo,Fi_dict,Risk_info):
tpl = DocxTemplate('tax_word_model.docx')
tpl = DocxTemplate('./tax_word_model.docx')
context={}
#其他传入参数
context['CreatTime']=Else_info['CreatTime']
......@@ -144,10 +147,11 @@ def WriteReport(Else_info,Companyinfo,Fi_dict,Risk_info):
context["VAT_XZJX_Risk_desc"] = str(Risk_info["Risk_VAT_XZJX"]["describe"]).replace("['","").replace("']","").replace("'","")
context["CT_FX_Risk_desc"] = str(Risk_info["Risk_CT_FX"]["describe"]).replace("['","").replace("']","").replace("'","")
context["ALLT_FX_Risk_desc"] = str(Risk_info["Risk_ALLT_FX"]["describe"]).replace("['","").replace("']","").replace("'","")
print("ddddddddddddddddddddddddddddddddddd");
tpl.render(context)
addr = "/tmp/TaxRiskReport.docx"
# addr = "G://TaxRiskReport26.docx"
print("ddddddddddddddddddddddddddddddddddd");
tpl.save(addr)
print(addr,"+++++++++")
return addr
......@@ -194,13 +198,17 @@ def UpdateTaskRptUrl(batchid, rptUrl):
# 风险监测自动报告接口
@server.route('/gsb/api/report2', methods=['POST'])
@server.route('/gsb/api/git 2', methods=['POST'])
def report():
if request.method =='POST':
print("=======调用风险检测自动报告接口")
data = request.json
json_str = json.dumps(data)
GetAllinfo = json.loads(json_str)
# print(data)
# print("ccccccccccccccccccccccccccccc")
# json_str = json.dumps(data)
# print(json_str);
GetAllinfo = json.loads(data)
print(GetAllinfo)
companyname=GetAllinfo["company_name"] #获取监测企业名称
batchid=GetAllinfo["Task_Num"] #获取任务号
companyname = strQ2B(companyname)
......
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