设备端单日营养日报接口说明
设备端根据人员 uuid 和日期查询单日营养日报。该接口不需要登录 token,也不读取 header token,直接使用请求体中的人员 uuid 定位人员。
请求说明
POST/terminal/analysis.Analysis/daily
Header
Content-Type: application/json
不需要传
Access-Token。设备端身份由请求体中的 uuid 表示。Body
{
"uuid": "人员uuid",
"date": "2026-06-15"
}
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
uuid |
string | 是 | 人员 uuid,对应人员表 staff.uuid。 |
date |
string | 是 | 查询日期,格式 YYYY-MM-DD。 |
成功响应
{
"code": 0,
"message": "success",
"data": {
"meal_data": [
{
"id": 2436,
"dishes_id": 4903,
"dishes_weight": 300,
"dishes_name": "测试",
"file_id": 0,
"meal_times": 1,
"energy": 567,
"carbohydrate": 16.1,
"protein": 24.8,
"fat": 44.3,
"file_url": ""
},
{
"id": 2437,
"dishes_id": 4897,
"dishes_weight": "100.00",
"dishes_name": "干煸藕丝",
"file_id": 0,
"meal_times": 1,
"energy": 113.89,
"carbohydrate": 9.97,
"protein": 1.15,
"fat": 8.25,
"file_url": ""
},
{
"id": 2438,
"dishes_id": 4898,
"dishes_weight": 300,
"dishes_name": "糖醋包菜",
"file_id": 0,
"meal_times": 1,
"energy": 266.16,
"carbohydrate": 34.79,
"protein": 1.53,
"fat": 13.42,
"file_url": ""
},
{
"id": 2439,
"dishes_id": 4899,
"dishes_weight": 300,
"dishes_name": "青菜油果",
"file_id": 0,
"meal_times": 1,
"energy": 745.8,
"carbohydrate": 0.42,
"protein": 0,
"fat": 82.66,
"file_url": ""
},
{
"id": 2440,
"dishes_id": 4900,
"dishes_weight": 300,
"dishes_name": "Array",
"file_id": 0,
"meal_times": 1,
"energy": 0,
"carbohydrate": 0,
"protein": 0,
"fat": 0,
"file_url": ""
},
{
"id": 2441,
"dishes_id": 4901,
"dishes_weight": 300,
"dishes_name": "西红柿炒鸡蛋0001",
"file_id": 0,
"meal_times": 1,
"energy": 81.99,
"carbohydrate": 4.01,
"protein": 4.26,
"fat": 5.71,
"file_url": ""
},
{
"id": 2442,
"dishes_id": 4902,
"dishes_weight": 300,
"dishes_name": "山西到喜爱面",
"file_id": 0,
"meal_times": 1,
"energy": 177.64,
"carbohydrate": 37.23,
"protein": 5.92,
"fat": 1.78,
"file_url": ""
},
{
"id": 2443,
"dishes_id": 4896,
"dishes_weight": "100.00",
"dishes_name": "青瓜木耳",
"file_id": 0,
"meal_times": 1,
"energy": 41.43,
"carbohydrate": 5.13,
"protein": 1.08,
"fat": 2.29,
"file_url": ""
},
{
"id": 2444,
"dishes_id": 4895,
"dishes_weight": "100.00",
"dishes_name": "茭白毛豆鸡丝",
"file_id": 0,
"meal_times": 1,
"energy": 253.39,
"carbohydrate": 0.74,
"protein": 24.61,
"fat": 16.88,
"file_url": ""
},
{
"id": 2445,
"dishes_id": 4894,
"dishes_weight": "100.00",
"dishes_name": "海带肉丝",
"file_id": 0,
"meal_times": 1,
"energy": 344.19,
"carbohydrate": 10.13,
"protein": 6.61,
"fat": 30.75,
"file_url": ""
}
],
"supply_data": {
"energy": {
"reality": 6269,
"recommend": "2343.13"
},
"carbohydrate": {
"reality": 303.6,
"recommend": 322,
"status": 2,
"ratio": 32
},
"protein": {
"reality": 143,
"recommend": 117,
"status": 3,
"ratio": 15
},
"fat": {
"reality": 501.8,
"recommend": 65,
"status": 3,
"ratio": 53
}
},
"ratio_data": {
"1": {
"reality": 2591,
"recommend": "633-773",
"status": 3,
"ratio": 41
},
"2": {
"reality": 1839,
"recommend": "844-1031",
"status": 3,
"ratio": 29
},
"3": {
"reality": 1839,
"recommend": "633-773",
"status": 3,
"ratio": 29
},
"4": {
"reality": 6269,
"recommend": "2109-2577",
"status": 3
}
},
"dishes_type_data": {
"dishes_category": [
{
"id": 1,
"name": "主食",
"count": 9
},
{
"id": 6,
"name": "素菜",
"count": 12
},
{
"id": 8,
"name": "荤菜",
"count": 1
},
{
"id": 11,
"name": "蛋奶坚果",
"count": 0
},
{
"id": 15,
"name": "水果",
"count": 0
},
{
"id": 17,
"name": "汤饮",
"count": 0
}
],
"dishes_sum": 22,
"food_category": [
{
"name": "谷薯",
"field": "gushu_number",
"count": 3
},
{
"name": "畜禽水产",
"field": "xuqinshuichan_number",
"count": 2
},
{
"name": "蔬菜",
"field": "vegetable_number",
"count": 5
},
{
"name": "水果",
"field": "fruit_number",
"count": 0
},
{
"name": "蛋奶大豆",
"field": "dannaidou_number",
"count": 3
},
{
"name": "坚果",
"field": "nut_number",
"count": 0
}
],
"category_sum": 13
},
"vitamin_data": {
"dietary_fiber": {
"recommend": "25.00",
"actual": 36.55,
"ratio": 146,
"status": 3
},
"va": {
"recommend": "800.00",
"actual": 296.18,
"ratio": 37,
"status": 1
},
"vc": {
"recommend": "100.00",
"actual": 50.98,
"ratio": 51,
"status": 1
},
"zinc": {
"recommend": "12.50",
"actual": 20.85,
"ratio": 167,
"status": 3
},
"iron": {
"recommend": "12.00",
"actual": 47.49,
"ratio": 396,
"status": 3
},
"calcium": {
"recommend": "800.00",
"actual": 585.01,
"ratio": 73,
"status": 1
},
"sodium": {
"recommend": "1500.00",
"actual": 38324.57,
"ratio": 2555,
"status": 3
},
"purine": {
"recommend": 1000,
"actual": 267.39,
"ratio": 27,
"status": 2
},
"sfa": {
"recommend": "70.2939",
"actual": 59.27,
"ratio": 84,
"status": 2
},
"gl": {
"recommend": 20,
"actual": 13,
"ratio": 81,
"status": 2
}
}
}
}
失败响应
缺少参数
{
"code": 400,
"message": "缺少必要参数",
"data": []
}
人员不存在
{
"code": 500,
"message": "人员不存在",
"data": []
}
服务异常
{
"code": 500,
"message": "错误信息",
"data": []
}
响应字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
code |
number | 业务响应码,成功为 0。 |
message |
string | 响应消息。 |
data.meal_data |
array | 当日餐单数据。 |
data.supply_data |
object | 当日能量、碳水、蛋白质、脂肪摄入分析。 |
data.ratio_data |
object | 早餐、午餐、晚餐、总摄入的能量分析。键 1、2、3、4 分别对应早餐、午餐、晚餐、总摄入。 |
data.dishes_type_data |
object | 菜品分类和食材分类均衡统计。 |
data.vitamin_data |
object | 关键营养素摄入分析,包括膳食纤维、维生素 A、维生素 C、锌、铁、钙、钠、嘌呤、饱和脂肪酸、GL 等。 |
状态值说明
| status | 说明 |
|---|---|
0 |
GL 专用低风险状态。 |
1 |
偏低。 |
2 |
适中或未超标。 |
3 |
偏高或超标。 |
调用示例
curl -X POST 'https://你的域名/terminal/analysis.Analysis/daily' \
-H 'Content-Type: application/json' \
-d '{
"uuid": "人员uuid",
"date": "2026-06-15"
}'
实现位置
/Users/liang/AndroidStudioProjects/zhct/zhctproject/ai_api/app/terminal/controller/analysis/Analysis.php
/Users/liang/AndroidStudioProjects/zhct/zhctproject/ai_api/app/terminal/controller/Controller.php
/Users/liang/AndroidStudioProjects/zhct/zhctproject/ai_api/app/api/service/analysis/Analysis.php