APIv1_统计信息 - 17kong/yiqikong-wiki GitHub Wiki

收费记录

获取单个/多个仪器统计信息

通用获取单个/多个仪器统计信息接口

GET /dashboard

参数

{
    "equipment": ["123"], // 仪器uuid, 一台或多台
    "resource": ["charge", "follow", "record", "sample", "status", "training"], // 统计项, 依次为累计计费, 关注人数, 使用时长相关, 累计送样, 故障时间, 培训次数; 数组至少存在其中之一
    "time": ["bt", "2020-01-01 00:00:00", "2020-01-01 23:59:59"] // 统计时段
}

响应

第一层级对象根据传入参数的resource决定

Status: 200 OK
-
{
    "charge": {
        "total": {
            "charge_amount": 129000 // 累计收费
        },
        // 明细 下同
        "detail": [{
            "equipment": "66835801fde83e6e7fd2fb56b466c5ea04d30c54",
            "charge_amount": "129000"
        }]
    },
    "follow": {
        "total": {
            "follow_numbers": 10 // 关注人数
        },
        "detail": [{
            "equipment": "66835801fde83e6e7fd2fb56b466c5ea04d30c54",
            "follow_numbers": "10"
        }]
    },
    "record": {
        "total": {
            "use_numbers": 5, // 使用人数
            "service_times": 60, // 服务次数
            "service_time": 1351 // 服务时长(s)
        },
        "detail": [{
            "equipment": "66835801fde83e6e7fd2fb56b466c5ea04d30c54",
            "use_numbers": "5",
            "service_times": "60",
            "service_time": "1351"
        }]
    },
    "sample": {
        "total": {
            "sample_times": 32 // 累计测样
        },
        "detail": [{
            "equipment": "66835801fde83e6e7fd2fb56b466c5ea04d30c54",
            "sample_times": "32"
        }]
    },
    "status": {
        "total": {
            "break_time": 0, // 故障时长(s)
            "break_times": 0 // 故障次数
        },
        "detail": []
    },
    "training": {
        "total": {
            "training_times": 40, // 累计培训
            "approved_times": 25 // 培训申请次数
        },
        "detail": [{
            "equipment": "66835801fde83e6e7fd2fb56b466c5ea04d30c54",
            "training_times": "40",
            "approved_times": "25"
        }]
    }
}

获取单个/多个仪器统计图表

通用获取单个/多个仪器统计图表接口

GET /charts

参数

{
    "equipment": ["123"], // 仪器uuid, 一台或多台
    "resource": ["charge", "record", "sample", "status", "training"], // 统计项, 依次为累计计费, 关注人数, 使用时长相关, 累计送样, 故障时间, 培训次数; 数组至少存在其中之一
    "time": ["bt", "2020-01-01 00:00:00", "2020-01-01 23:59:59"], // 统计时段
    "unit": "day", // 聚合单位 支持 day || month
}

响应

第一层级对象根据传入参数的resource决定

Status: 200 OK
-
{
    "charge": {
        "detail": [{
            "date": "2020-01-01",
            "charge_amount": "129000" // date内产生累计收费
        },
        ...
        ]
    },
    "record": {
        "detail": [{
            "date": "2020-01-01",
            "use_numbers": "5", // date内使用次数
            "service_times": "60", // date内服务次数
            "service_time": "1351"// date内使用时长(s)
        },
        ...
        ]
    },
    "sample": {
        "detail": [{
            "date": "2020-01-01",
            "sample_times": "32" // date内累计测样
        },
        ...]
    },
    "status": {
        "detail": {
            "date": "2020-01-01",
            "break_time": 0, // date内故障时长
            "break_times": 0 // date内故障次数
        },
    },
    "training": {
        "detail": {
            "date": "2020-01-01",
            "training_times": 40, // date内累计培训
            "approved_times": 25 // date内培训申请次数
        },
        ...
        ]
    }
}