heqinwei 7df5e3fa23 初始git 7 years ago
..
doc 7df5e3fa23 初始git 7 years ago
README.md 7df5e3fa23 初始git 7 years ago

README.md

数据接口=

备忘
1. 应该有机制保证每次获取数据时访问量不会对数据库所在服务器产生过大负荷
2. 数据接口修改权限应当只分配给管理员,使用权限应当和图表一致并继承系统的权限配置
3. 数据接口最终应该只传递单一的一个表

数据接口配置档内容

  1. 数据来源:
    • 可按名称关联数据库中的一个或多个表
    • 可上传CSV(或xls转CSV)
  2. 获取表头,判断原生数据各列数据的默认类型并写入元数据metadata:
    • index 索引(编号)
    • time 时间戳:
    • categorical 类别
    • scale 标量
    • ordinal 序值
    • string 字符串
  3. 种类标签 tag
  4. 其他元信息:
    • created_by 创建人
    • created_time 创建时间
    • used 使用中: 正在使用这个数据接口的图表数量

数据接口API

get_data(data_connector, time_span=all, filter=none, columns=all)

    - 按参数产生SQL语句,从数据库获取原生数据,和元数据一起打包成JSON。
    - 可以接受以下参数:
        - data_connector: 调用的数据接口
        - time_span:时间跨度
        - filter:筛选规则
        - columns: 所选数据列
数据接口配置界面草案示例

Image

Image

Image

传回JSON格式草案示例
{
    "metadata": ["index", "categorical", "time", "categorical", "categorical", "categorical", "index", "index", "string", "string", "scale", "scale", "scale", "scale", "time", "time", "scale", "scale", "scale", "scale", "categorical", "index", "index", "categorical", "string", "string", "string", "string", "string", "string", "time", "string", "string", "scale", "scale", "scale"
    ],
    "data": [
        ["订单编号", "单据状态", "日期",  "订单类型", "客户名称", "打印状态", "订单序号", "物料编号", "物料名称", "物料规格", "数量", "已出货数", "未发货数", "已转数量", "交货日期", "PMC回复交期","定价", "单价","金额", "不含税单价", "明细状态", "预测单号", "预测序号", "币别", "业务员", "部门", "应收客户", "收货客户", "收款条件", "录入人","录入日期", "明细备注", "主表备注", "已转制造数量", "毛利率%", "成本单价"],
        ["SS20180508001", "已审核", "2018/5/8", "国内销售", "合肥雪祺电器有限公司", "未打印", "7", "88101716", "冰箱控制板", "雪祺基本型定频66K(DA000714301),RoHS", 73, 0, 73, 0, "2018/5/9", "2018/5/9", 57.7, 57.7, 4212.1, 49.741379, "已审核", "0", "RMB", "马成雨", "合肥雪祺电器有限公司", "合肥雪祺电器有限公司", "票到1月后付6个月承兑", "徐小秀", "2018/5/8", "", "", 73, 100, 0],
        ["SS20180508001", "已审核", "2018/5/8", "国内销售", "合肥雪祺电器有限公司", "未打印", "6", "88101486", "冰箱显示板", "美菱窄屏DA000418212,雪祺,RoHS", 129, 0, 129 ,0, "2018/5/9", "2018/5/9", 32.2, 32.2, 4153.8, 27.758621, "已审核", "0", "RMB", "马成雨", "合肥雪祺电器有限公司", "合肥雪祺电器有限公司", "票到1月后付6个月承兑", "徐小秀", "2018/5/8", "", "", 129, 100, 0]
    ]
}