背景
本人在公司负责清结算系统,类似半中台的系统,没有页面,纯靠人工对比数据,数据量大,关键字段多,每次看的眼睛发酸,还容易漏掉某些字段数据。为此做了个【订单分账数据可视化页面】
功能介绍
直接上图
技术站:flask+html+css+js
main.py 添加接口映射
from root.roots_controller import roots
app = Flask(__name__, template_folder='templates')
# 接口工具
app.register_blueprint(roots, url_prefix='/')
控制层 controller.py
from flask import Blueprint, render_template,request as req
from framework import http
from service.caiwu_service import caiwu_service
roots = Blueprint('root', __name__)
@roots.route('/clearingList', methods=['get'])
def clearing_list():
return render_template('order_detail.html')
@roots.route('/api/data', methods=['POST'])
def get_data():
print(req.get_json())
xx = req.json.get("xx")
xx = req.json.get("xx")
xx = req.json.get("xx")
host = "http://xxx"
url = "/xx/xx/query"
if env == "ol":
host = "xxxx"
if not isinstance(xx, str):
return "订单编号不合法"
if not isinstance(xx, str):
return "xx不合法"
request = http.Request()
request.host = host
request.path = url
request.method = "post"
request.data = {
"xx": xx,
"xx": xx
}
r = request.send()
response = r.json()
data = response.get('data')
return data
html放在template文件夹-view层
总结
算是一次小小的尝试吧,给自己的测试工作节约时间。快乐上班