From d8601fc60fc057b1421869d86e1e138a7a8290a0 Mon Sep 17 00:00:00 2001 From: xins Date: Tue, 5 Sep 2023 15:12:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8B=A5=E4=BE=9D=E5=BE=AE=E6=9C=8D=E5=8A=A11.?= =?UTF-8?q?1.1=E7=89=88=E6=9C=AC=EF=BC=9A=201=E3=80=81tdengine=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E8=8E=B7=E5=8F=96=E8=AE=BE=E5=A4=87=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/httpRequests/http-requests-log.http | 1398 +++++++++++++++++ .../core/constant/TdEngineConstants.java | 13 +- .../src/main/java/com/ruoyi/Main.java | 22 - .../src/main/resources/bootstrap.yml | 17 +- ruoyi-modules/hw-tdengine/.gitignore | 38 + .../controller/TdEngineController.java | 2 +- .../service/impl/DeviceStatusServiceImpl.java | 16 +- sh.exe.stackdump | 0 8 files changed, 1457 insertions(+), 49 deletions(-) create mode 100644 .idea/httpRequests/http-requests-log.http delete mode 100644 ruoyi-modules/hw-business/src/main/java/com/ruoyi/Main.java create mode 100644 ruoyi-modules/hw-tdengine/.gitignore create mode 100644 sh.exe.stackdump diff --git a/.idea/httpRequests/http-requests-log.http b/.idea/httpRequests/http-requests-log.http new file mode 100644 index 0000000..c227406 --- /dev/null +++ b/.idea/httpRequests/http-requests-log.http @@ -0,0 +1,1398 @@ +POST http://localhost:9602/tdengine/getOnlineDevicesGroupByDay +Content-Type: application/json +Content-Length: 71 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "params": { "beginTime":1666666666666,"endTime":1766666666666 } + +} + +<> 2023-09-05T151123.200.json + +### + +POST http://localhost:9602/tdengine/getOnlineDevicesGroupByDay +Content-Type: application/json +Content-Length: 71 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "params": { "beginTime":1666666666666,"endTime":1766666666666 } + +} + +<> 2023-09-05T151121.200.json + +### + +POST http://localhost:9602/tdengine/getOnlineDevicesGroupByDay +Content-Type: application/json +Content-Length: 71 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "params": { "beginTime":1666666666666,"endTime":1766666666666 } + +} + +<> 2023-09-05T151106.200.json + +### + +POST http://localhost:9602/tdengine/getOnlineDevicesGroupByDay +Content-Type: application/json +Content-Length: 102 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "params": {"superTableName":"st_ds_1", + "beginTime":1666666666666,"endTime":1766666666666 } + +} + +<> 2023-09-05T150635.200.json + +### + +POST http://localhost:9602/tdengine/getOnlineDevicesGroupByDay +Content-Type: application/json +Content-Length: 102 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "params": {"superTableName":"st_ds_1", + "beginTime":1666666666666,"endTime":1766666666666 } + +} + +<> 2023-09-05T150420.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_4", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693683999996 + } + ] +} + +<> 2023-09-05T150015.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_4", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693583999996 + } + ] +} + +<> 2023-09-05T150007.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_4", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693582999996 + } + ] +} + +<> 2023-09-05T150004.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_4", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693581999996 + } + ] +} + +<> 2023-09-05T145959.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_3", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693772969706 + } + ] +} + +<> 2023-09-05T145949.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_3", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 1 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693772969106 + } + ] +} + +<> 2023-09-05T145933.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_3", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 1 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693672969106 + } + ] +} + +<> 2023-09-05T145928.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_3", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693572969106 + } + ] +} + +<> 2023-09-05T145916.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_3", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 1 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693572949106 + } + ] +} + +<> 2023-09-05T145911.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_3", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 1 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693571949106 + } + ] +} + +<> 2023-09-05T145907.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_2", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 1 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693326578166 + } + ] +} + +<> 2023-09-05T145851.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_2", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 1 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693326378166 + } + ] +} + +<> 2023-09-05T145821.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_2", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693326368166 + } + ] +} + +<> 2023-09-05T145814.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_2", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693316368166 + } + ] +} + +<> 2023-09-05T145810.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_1", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693766689106 + } + ] +} + +<> 2023-09-05T145759.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_1", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 1 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693666689106 + } + ] +} + +<> 2023-09-05T145750.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_1", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 1 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693616689106 + } + ] +} + +<> 2023-09-05T145745.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_1", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 1 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693616589106 + } + ] +} + +<> 2023-09-05T145741.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 292 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "tableName": "t_ds_1", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693616189106 + } + ] +} + +<> 2023-09-05T145734.200.json + +### + +POST http://localhost:9602/tdengine/createTable +Content-Type: application/json +Content-Length: 494 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "superTableName": "st_ds", + "tableName": "t_ds_4", + "tagsFieldValues": [ + { + "fieldName": "deviceCode", + "fieldValue": "'0009340109040_33a'" + }, + { + "fieldName": "deviceName", + "fieldValue": "'定位传感器'" + }, + { + "fieldName": "deviceModeId", + "fieldValue": 1 + }, + { + "fieldName": "monitorUnitId", + "fieldValue": 1 + }, + { + "fieldName": "sceneId", + "fieldValue": 1 + } + ] +} + +<> 2023-09-05T145715.200.json + +### + +POST http://localhost:9602/tdengine/createTable +Content-Type: application/json +Content-Length: 492 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "superTableName": "st_ds", + "tableName": "t_ds_3", + "tagsFieldValues": [ + { + "fieldName": "deviceCode", + "fieldValue": "0009340109040924" + }, + { + "fieldName": "deviceName", + "fieldValue": "'温度传感器2'" + }, + { + "fieldName": "deviceModeId", + "fieldValue": 1 + }, + { + "fieldName": "monitorUnitId", + "fieldValue": 1 + }, + { + "fieldName": "sceneId", + "fieldValue": 1 + } + ] +} + +<> 2023-09-05T145711.200.json + +### + +POST http://localhost:9602/tdengine/createTable +Content-Type: application/json +Content-Length: 492 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "superTableName": "st_ds", + "tableName": "t_ds_2", + "tagsFieldValues": [ + { + "fieldName": "deviceCode", + "fieldValue": "0009340109040126" + }, + { + "fieldName": "deviceName", + "fieldValue": "'温度传感器1'" + }, + { + "fieldName": "deviceModeId", + "fieldValue": 1 + }, + { + "fieldName": "monitorUnitId", + "fieldValue": 1 + }, + { + "fieldName": "sceneId", + "fieldValue": 1 + } + ] +} + +<> 2023-09-05T145708.200.json + +### + +POST http://localhost:9602/tdengine/createTable +Content-Type: application/json +Content-Length: 467 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "superTableName": "st_ds", + "tableName": "t_ds_1", + "tagsFieldValues": [ + { + "fieldName": "deviceCode", + "fieldValue": "1" + }, + { + "fieldName": "deviceName", + "fieldValue": "'基站'" + }, + { + "fieldName": "deviceModeId", + "fieldValue": 1 + }, + { + "fieldName": "monitorUnitId", + "fieldValue": 1 + }, + { + "fieldName": "sceneId", + "fieldValue": 1 + } + ] +} + +<> 2023-09-05T145704.200.json + +### + +POST http://localhost:9602/tdengine/createSuperTable +Content-Type: application/json +Content-Length: 667 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_hwsaas", + "superTableName": "st_ds", + "firstFieldName": "ts", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "dataTypeCode": 8 + }, + { + "fieldName": "deviceType", + "dataTypeCode": 8 + } + ], + "tagsFields": [ + { + "fieldName": "deviceCode", + "dataTypeCode": 10, + "size": 50 + }, + { + "fieldName": "deviceName", + "dataTypeCode": 10, + "size": 200 + }, + { + "fieldName": "deviceModeId", + "dataTypeCode": 2 + }, + { + "fieldName": "monitorUnitId", + "dataTypeCode": 2 + }, + { + "fieldName": "sceneId", + "dataTypeCode": 2 + } + ] +} + +<> 2023-09-05T145614.200.json + +### + +POST http://localhost:9602/tdengine/getOnlineDevicesGroupByDay +Content-Type: application/json +Content-Length: 130 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "params": {"databaseName":"db_scene_1","superTableName":"st_ds_1", + "beginTime":1666666666666,"endTime":1766666666666 } + +} + +<> 2023-09-05T144005.200.json + +### + +POST http://localhost:9602/tdengine/getOnlineDevicesGroupByDay +Content-Type: application/json +Content-Length: 130 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "params": {"databaseName":"db_scene_1","superTableName":"st_ds_1", + "beginTime":1666666666666,"endTime":1766666666666 } + +} + +<> 2023-09-05T144003.200.json + +### + +POST http://localhost:9602/tdengine/getOnlineDevicesGroupByDay +Content-Type: application/json +Content-Length: 130 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "params": {"databaseName":"db_scene_1","superTableName":"st_ds_1", + "beginTime":1666666666666,"endTime":1766666666666 } + +} + +<> 2023-09-05T143711.200.json + +### + +POST http://localhost:9602/tdengine/getOnlineDevicesGroupByDay +Content-Type: application/json +Content-Length: 130 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "params": {"databaseName":"db_scene_1","superTableName":"st_ds_1", + "beginTime":1666666666666,"endTime":1766666666666 } + +} + +<> 2023-09-05T143237.200.json + +### + +POST http://localhost:9602/tdengine/getOnlineDevicesGroupByDay +Content-Type: application/json +Content-Length: 130 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "params": {"databaseName":"db_scene_1","superTableName":"st_ds_1", + "beginTime":1666666666666,"endTime":1766666666666 } + +} + +<> 2023-09-05T142515.200.json + +### + +POST http://localhost:9602/tdengine/getOnlineDevicesGroupByDay +Content-Type: application/json +Content-Length: 130 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "params": {"databaseName":"db_scene_1","superTableName":"st_ds_1", + "beginTime":1666666666666,"endTime":1766666666666 } + +} + +<> 2023-09-05T142512.200.json + +### + +POST http://localhost:9602/tdengine/getOnlineDevicesGroupByDay +Content-Type: application/json +Content-Length: 128 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "params": {"databaseName":"db_scene_1","superTableName":"st_ds", + "beginTime":1666666666666,"endTime":1766666666666 } + +} + +<> 2023-09-05T142508.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 293 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_scene_1", + "tableName": "t_ds_4", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693589999996 + } + ] +} + +<> 2023-09-05T142413.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 293 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_scene_1", + "tableName": "t_ds_4", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 1 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693589999906 + } + ] +} + +<> 2023-09-05T142405.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 293 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_scene_1", + "tableName": "t_ds_4", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 1 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693389999906 + } + ] +} + +<> 2023-09-05T142353.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 293 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_scene_1", + "tableName": "t_ds_3", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 1 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693579949106 + } + ] +} + +<> 2023-09-05T142336.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 293 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_scene_1", + "tableName": "t_ds_3", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693379949106 + } + ] +} + +<> 2023-09-05T142320.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 293 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_scene_1", + "tableName": "t_ds_3", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693279949106 + } + ] +} + +<> 2023-09-05T142305.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 293 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_scene_1", + "tableName": "t_ds_2", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693376368166 + } + ] +} + +<> 2023-09-05T142258.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 293 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_scene_1", + "tableName": "t_ds_2", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 1 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693276368166 + } + ] +} + +<> 2023-09-05T142242.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 293 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_scene_1", + "tableName": "t_ds_2", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 1 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693176368166 + } + ] +} + +<> 2023-09-05T142237.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 293 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_scene_1", + "tableName": "t_ds_2", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 1 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693176268166 + } + ] +} + +<> 2023-09-05T142233.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 293 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_scene_1", + "tableName": "t_ds_2", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693176168166 + } + ] +} + +<> 2023-09-05T142218.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 293 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_scene_1", + "tableName": "t_ds_1", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693696189106 + } + ] +} + +<> 2023-09-05T142206.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 293 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_scene_1", + "tableName": "t_ds_1", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 0 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693296189106 + } + ] +} + +<> 2023-09-05T142158.200.json + +### + +POST http://localhost:9602/tdengine/insertTable +Content-Type: application/json +Content-Length: 293 +Connection: Keep-Alive +User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.8) +Accept-Encoding: br,deflate,gzip,x-gzip + +{ + "databaseName": "db_scene_1", + "tableName": "t_ds_1", + "schemaFields": [ + { + "fieldName": "onlineStatus", + "fieldValue": 1 + }, + { + "fieldName": "deviceType", + "fieldValue": 1 + }, + { + "fieldName": "ts", + "fieldValue": 1693296188106 + } + ] +} + +<> 2023-09-05T142143.200.json + +### + diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/TdEngineConstants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/TdEngineConstants.java index 17e136d..d2f7ba0 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/TdEngineConstants.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/TdEngineConstants.java @@ -28,9 +28,10 @@ public class TdEngineConstants { public static final String DEFAULT_TABLE_NAME_PREFIX = "t_device_";//数据表名称前缀 - public static final String DEFAULT_DEVICE_STATUS_SUPER_TABLE_NAME_PREFIX = "st_ds";//设备状态超级表名称 + public static final String DEFAULT_DEVICE_STATUS_SUPER_TABLE_NAME= "st_ds";//设备状态超级表名称 public static final String DEFAULT_DEVICE_STATUS_TABLE_NAME_PREFIX = "t_ds_";//设备状态数据表名称前缀 + public static final String PLATFORM_DB_NAME = "db_hwsaas";//全局数据库名称 /** * 需要转换的key */ @@ -62,15 +63,5 @@ public class TdEngineConstants { return DEFAULT_TABLE_NAME_PREFIX + deviceId; } - /** - * @param: sceneId - * @return String - * @description 获取设备状态超级表名称 - * @author xins - * @date 2023-09-05 9:42 - */ - public static String getDeviceStatusSuperTableName(Long sceneId) { - return DEFAULT_DEVICE_STATUS_SUPER_TABLE_NAME_PREFIX + sceneId; - } } diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/Main.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/Main.java deleted file mode 100644 index 4922143..0000000 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/Main.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.ruoyi; - -import com.ruoyi.i18n.utils.MessageUtils; - -// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`, -// then press Enter. You can now see whitespace characters in your code. -public class Main { - public static void main(String[] args) { - // Press Alt+Enter with your caret at the highlighted text to see how - // IntelliJ IDEA suggests fixing it. - System.out.printf("Hello and welcome!"); - String dd = MessageUtils.getMessages("user.login.username"); - System.out.println("dddd:"+dd); - // Press Shift+F10 or click the green arrow button in the gutter to run the code. - for (int i = 1; i <= 5; i++) { - - // Press Shift+F9 to start debugging your code. We have set one breakpoint - // for you, but you can always add more by pressing Ctrl+F8. - System.out.println("i = " + i); - } - } -} \ No newline at end of file diff --git a/ruoyi-modules/hw-mqtt-broker/src/main/resources/bootstrap.yml b/ruoyi-modules/hw-mqtt-broker/src/main/resources/bootstrap.yml index 9044216..007734c 100644 --- a/ruoyi-modules/hw-mqtt-broker/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/hw-mqtt-broker/src/main/resources/bootstrap.yml @@ -1,22 +1,25 @@ # Tomcat server: - port: 9206 + port: 9604 # Spring spring: application: - # ???? + # 应用名称 name: hw-mqtt-broker profiles: - # ???? + # 环境配置 active: dev cloud: nacos: + discovery: + # 服务注册地址 + server-addr: 127.0.0.1:8848 config: - # ?????? - server-addr: huawei-nacos:8848 - # ?????? + # 配置中心地址 + server-addr: 127.0.0.1:8848 + # 配置文件格式 file-extension: yml - # ???? + # 共享配置 shared-configs: - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} diff --git a/ruoyi-modules/hw-tdengine/.gitignore b/ruoyi-modules/hw-tdengine/.gitignore new file mode 100644 index 0000000..5ff6309 --- /dev/null +++ b/ruoyi-modules/hw-tdengine/.gitignore @@ -0,0 +1,38 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/controller/TdEngineController.java b/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/controller/TdEngineController.java index f6069c7..ddf2f1d 100644 --- a/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/controller/TdEngineController.java +++ b/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/controller/TdEngineController.java @@ -381,7 +381,7 @@ public class TdEngineController { * @date 2023-08-29 11:26 */ @PostMapping("/getOnlineDevicesGroupByDay") - public R getOnlineDevicesGroupByDay(@RequestBody DeviceStatus queryDeviceStatus) { + public R getOnlineDevicesGroupByDay(@RequestBody DeviceStatus queryDeviceStatus) { try { List deviceStatuses = this.deviceStatusService.getOnlineDevicesGroupByDay(queryDeviceStatus); Map> deviceStatusMap = deviceStatuses.stream() diff --git a/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/service/impl/DeviceStatusServiceImpl.java b/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/service/impl/DeviceStatusServiceImpl.java index 7538eaf..6154076 100644 --- a/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/service/impl/DeviceStatusServiceImpl.java +++ b/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/service/impl/DeviceStatusServiceImpl.java @@ -10,11 +10,12 @@ import org.springframework.stereotype.Service; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * @Description: 设备状态信息业务服务 * @ClassName: DeviceStatusServiceImpl - * @Author : xins - * @Date :2023-09-05 13:27 + * @Author : xins + * @Date :2023-09-05 13:27 * @Version :1.0 */ @Service @@ -24,20 +25,19 @@ public class DeviceStatusServiceImpl implements IDeviceStatusService { private DeviceStatusMapper deviceStatusMapper; /** + * @return List * @param: DeviceStatus * @description 获取时间范围内每天的在线设备 * @author xins * @date 2023-09-05 13:23 - * @return List */ @Override public List getOnlineDevicesGroupByDay(DeviceStatus queryDeviceStatus) { -// Map params = new HashMap<>(); + + Map params = queryDeviceStatus.getParams(); + params.put("databaseName", TdEngineConstants.PLATFORM_DB_NAME); + params.put("superTableName", TdEngineConstants.DEFAULT_DEVICE_STATUS_SUPER_TABLE_NAME); // DeviceStatus queryDeviceStatus = new DeviceStatus(); -// String databaseName = TdEngineConstants.getDatabaseName(sceneId); -// String superTableName = TdEngineConstants.getDeviceStatusSuperTableName(sceneId); -// params.put("databaseName", databaseName); -// params.put("superTableName", superTableName); // params.put("beginTime", beginTime); // params.put("endTime", endTime); // queryDeviceStatus.setParams(params); diff --git a/sh.exe.stackdump b/sh.exe.stackdump new file mode 100644 index 0000000..e69de29