diff --git a/das/src/main/java/com/das/modules/node/service/impl/DataServiceImpl.java b/das/src/main/java/com/das/modules/node/service/impl/DataServiceImpl.java index 8fc28f8b..cae27f97 100644 --- a/das/src/main/java/com/das/modules/node/service/impl/DataServiceImpl.java +++ b/das/src/main/java/com/das/modules/node/service/impl/DataServiceImpl.java @@ -267,24 +267,24 @@ public class DataServiceImpl implements DataService { keyValueMap.put(key, high.get(fieldName).asDouble()); } adminRedisTemplate.mSet(keyValueMap); - Long dataTime = data.getTime(); - - // 存入td库 - List highList = new ArrayList<>(); - List lowList = new ArrayList<>(); - RTData rtHighData = RTData.builder() - .dataTime(dataTime) - .deviceId(Long.valueOf(deviceId)) - .values(highFieldMap) - .build(); - RTData rtLowData = RTData.builder() - .dataTime(dataTime) - .deviceId(Long.valueOf(deviceId)) - .values(highFieldMap) - .build(); - highList.add(rtHighData); - lowList.add(rtLowData); - tdEngineService.updateYCHighValues(highList, iotModelCode); - tdEngineService.updateYCLowValues(lowList, iotModelCode); +// Long dataTime = data.getTime(); +// +// // 存入td库 +// List highList = new ArrayList<>(); +// List lowList = new ArrayList<>(); +// RTData rtHighData = RTData.builder() +// .dataTime(dataTime) +// .deviceId(Long.valueOf(deviceId)) +// .values(highFieldMap) +// .build(); +// RTData rtLowData = RTData.builder() +// .dataTime(dataTime) +// .deviceId(Long.valueOf(deviceId)) +// .values(highFieldMap) +// .build(); +// highList.add(rtHighData); +// lowList.add(rtLowData); +// tdEngineService.updateYCHighValues(highList, iotModelCode); +// tdEngineService.updateYCLowValues(lowList, iotModelCode); } } diff --git a/docs/_sidebar.md b/docs/_sidebar.md index b734321e..b18bdbdb 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -1,3 +1,7 @@ - [首页](/) - [API说明](api/) + - [系统管理接口](api/systemmgr.md) + - [设备管理接口](api/equipment.md) + - [节点管理接口](api/node.md) + - [数据访问接口](api/data.md) - [数据采集](datacollect/) \ No newline at end of file diff --git a/docs/api/_sidebar.md b/docs/api/_sidebar.md index 516ee848..328af778 100644 --- a/docs/api/_sidebar.md +++ b/docs/api/_sidebar.md @@ -1,4 +1 @@ -* [返回首页](/) -* [设备模块](equipment.md) -* [节点模块](node.md) -* [系统管理模块](systemmgr.md) \ No newline at end of file +* [返回首页](/) \ No newline at end of file diff --git a/docs/api/data.md b/docs/api/data.md new file mode 100644 index 00000000..6cf7b7e1 --- /dev/null +++ b/docs/api/data.md @@ -0,0 +1,54 @@ +# 数据访问接口 + +## API接口一览表 + +| 接口分类 | 接口描述 | API接口 | 权限 | +|--------|-------------|------------------------------| ---------------------------- | +| 数据查询 | 实时数据查询 | /api/data/snapshot | | +| | 历史区间数据查询 | /api/data/history | | +| | 历史断面数据查询 | /api/data/history/snapshot | | + + +## 数据查询接口 + +### 实时数据查询 + +POST 请求接口 + +> /api/data/snapshot + +请求参数 + + +```json +{ + "deviceId":"129476828342323", + "attributes":["power","windSpeed","dailyUsageHours","monthlyUsageHours"] +} +``` +入参描述 + +| 参数名 | 参数类型 | 可选 | 描述 | +| ------------ | -------- | ---- |------| +| deviceId | String | no | 设备ID | +| attributes | StringArray | no | 要查询实时数据的设备属性列表 | + +返回报文 + +```json +{ + "code": 200, + "msg": "操作成功", + "success": true, + "data": { + "power": 56.2, + "windSpeed": 45.3, + "dailyUsageHours": 20, + "monthlyUsageHours": 78, + .... + } +} +``` +返参描述 + +data 中以字典的方式,返回查询的属性的实时值。 diff --git a/ui/dasadmin/.env.development b/ui/dasadmin/.env.development index c8c70d94..d5455a0b 100644 --- a/ui/dasadmin/.env.development +++ b/ui/dasadmin/.env.development @@ -6,9 +6,10 @@ VITE_BASE_PATH = './' # 代理配置(开发使用),必须在一行中 # 本地 - # VITE_APP_PROXY=[["/api","http://10.65.57.55:8080/api"]] +# VITE_APP_PROXY=[["/api","http://192.168.130.12:8080/api"]] # 线上 VITE_APP_PROXY=[["/api","https://test.jsspisoft.com/api"]] + diff --git a/ui/dasadmin/src/views/backend/auth/model/index.vue b/ui/dasadmin/src/views/backend/auth/model/index.vue index 054f7ead..0858f3dd 100644 --- a/ui/dasadmin/src/views/backend/auth/model/index.vue +++ b/ui/dasadmin/src/views/backend/auth/model/index.vue @@ -185,13 +185,28 @@ - - - - - - - +
+ + + + + + + + + + + + +
@@ -201,6 +216,9 @@ + + +