From 93bf5a3dcd577f7d0715b09ba5dab09fb269b900 Mon Sep 17 00:00:00 2001 From: zhouhy Date: Wed, 13 Sep 2023 18:19:47 +0800 Subject: [PATCH] =?UTF-8?q?1.1.3=20=E7=9B=91=E6=8E=A7=E5=8D=95=E5=85=83Con?= =?UTF-8?q?troller=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 | 965 ++---------------- .../HwMonitorPlatformController.java | 6 +- .../ruoyi/business/mapper/HwDeviceMapper.java | 1 + .../business/mapper/HwMonitorUnitMapper.java | 2 +- .../service/IHwMonitorUnitService.java | 2 +- .../impl/HwMonitorUnitServiceImpl.java | 44 +- .../mapper/business/HwMonitorUnitMapper.xml | 12 +- 7 files changed, 153 insertions(+), 879 deletions(-) diff --git a/.idea/httpRequests/http-requests-log.http b/.idea/httpRequests/http-requests-log.http index ab74258..d0be8a9 100644 --- a/.idea/httpRequests/http-requests-log.http +++ b/.idea/httpRequests/http-requests-log.http @@ -1,1063 +1,318 @@ -GET http://localhost:9601/monitorPlatform/monitorPercentage +POST http://localhost:9601/monitorPlatform/selectLatestDataByTags -<> 2023-09-13T042534.200.json +<> 2023-09-13T061701.200.json ### -GET http://localhost:9601/monitorPlatform/monitorPercentage +POST http://localhost:9601/monitorPlatform/selectLatestDataByTags -<> 2023-09-13T041522.200.json +<> 2023-09-13T061655.200.json ### -GET http://localhost:9601/monitorPlatform/monitorUnitPercentage +POST http://localhost:9601/monitorPlatform/selectLatestDataByTags -<> 2023-09-13T041504.200.json +<> 2023-09-13T061503.200.json ### -GET http://localhost:9601/monitorPlatform/monitorUnitPercentage +POST http://localhost:9601/monitorPlatform/selectLatestDataByTags -<> 2023-09-13T035712.200.json +<> 2023-09-13T061452.200.json ### -POST http://localhost:9601/monitorPlatform/selectDeviceByDeviceModeByMonitorUnitId -{21321321}: +POST http://localhost:9601/monitorPlatform/SelectSecne -<> 2023-09-13T035612.400.html +<> 2023-09-13T061340.200.json ### -GET http://localhost:9601/monitorPlatform/monitorUnitPercentage +POST http://localhost:9601/monitorPlatform/SelectSecne -<> 2023-09-13T035551.200.json +<> 2023-09-13T061335.200.json ### -GET http://localhost:9601/monitorPlatform/monitorUnitPercentage +POST http://localhost:9601/monitorPlatform/getDeviceOperations -<> 2023-09-13T035541.200.json +<> 2023-09-13T061308.200.json ### -POST http://localhost:9601/monitorPlatform/treeList +POST http://localhost:9601/monitorPlatform/getDeviceOperations -<> 2023-09-13T035533.200.json +<> 2023-09-13T061257.200.json ### -GET http://localhost:9601/tenant/list +POST http://localhost:9601/monitorPlatform/SelectSecne -<> 2023-09-11T045735.200.json +<> 2023-09-13T061249.200.json ### -GET http://localhost:9601/monitorUnit/alarmStats +POST http://localhost:9601/monitorPlatform/selectLatestDataByTags -<> 2023-09-11T045659.200.json +<> 2023-09-13T061231.200.json ### -POST http://localhost:9601/monitorUnit/SelectSecne - -<> 2023-09-11T045623.200.json +POST http://localhost:9601/monitorPlatform/selectMonitorUnitSub ### -POST http://localhost/monitorUnit/getDeviceOperations +POST http://localhost:9601/monitorPlatform/ElectronicNumVo - } +<> 2023-09-13T061202.200.json ### -POST http://localhost:9601/monitorUnit/export +POST http://localhost:9601/monitorPlatform/SubDevice +{: +{"sceneId": "123"} +}: -<> 2023-09-05T031749.200.json +<> 2023-09-13T061009.400.html ### -GET http://localhost:9601/monitorUnit/ElectronicNumVo +POST http://localhost:9601/monitorPlatform/SubDevice +{"sceneId": "123"} +<> 2023-09-13T060718.200.json: +<> 2023-09-13T060624.200.json: -<> 2023-09-05T031734.200.json +<> 2023-09-13T060937.400.html ### -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 } +POST http://localhost:9601/monitorPlatform/SubDevice +{sceneId: 123} +<> 2023-09-13T060718.200.json: +<> 2023-09-13T060624.200.json: -} - -<> 2023-09-05T151123.200.json +<> 2023-09-13T060905.400.html ### -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 } +POST http://localhost:9601/monitorPlatform/SubDevice -} - -<> 2023-09-05T151121.200.json +<> 2023-09-13T060718.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 } +POST http://localhost:9601/monitorPlatform/SubDevice -} - -<> 2023-09-05T151106.200.json +<> 2023-09-13T060624.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 +GET http://localhost:9601/monitorPlatform/alarmStats -{ - "params": {"superTableName":"st_ds_1", - "beginTime":1666666666666,"endTime":1766666666666 } - -} - -<> 2023-09-05T150635.200.json +<> 2023-09-13T060618.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 } - -} +POST http://localhost:9601/monitorPlatform/limitSubMonitorUnit -<> 2023-09-05T150420.200.json +<> 2023-09-13T060616.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 +GET http://localhost:9601/monitorPlatform/alarmStats -{ - "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 +<> 2023-09-13T060506.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 +POST http://localhost:9601/monitorPlatform/limitSubMonitorUnit -{ - "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 +<> 2023-09-13T060502.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 - } - ] -} +GET http://localhost:9601/monitorPlatform/sceneAllNums -<> 2023-09-05T150004.200.json +<> 2023-09-13T060450.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 +GET http://localhost:9601/monitorPlatform/sceneAllNums -{ - "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 +<> 2023-09-13T060330.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 +GET http://localhost:9601/monitorPlatform/allNums -{ - "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 +<> 2023-09-13T060322.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 - } - ] -} +GET http://localhost:9601/monitorPlatform/allNums -<> 2023-09-05T145933.200.json +<> 2023-09-13T060138.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 +GET http://localhost:9601/monitorPlatform/allNums -{ - "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 +<> 2023-09-13T055901.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 +GET http://localhost:9601/monitorPlatform/allNums -{ - "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 +<> 2023-09-13T055320.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 - } - ] -} +GET http://localhost:9601/monitorPlatform/allNums -<> 2023-09-05T145911.200.json +<> 2023-09-13T055144.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 - } - ] -} +GET http://localhost:9601/monitorPlatform/monitorUnitPercentage -<> 2023-09-05T145907.200.json +<> 2023-09-13T051210.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 +GET http://localhost:9601/monitorPlatform/alarmStats -{ - "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 +<> 2023-09-13T051159.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 - } - ] -} +GET http://localhost:9601/monitorPlatform/alarmStats -<> 2023-09-05T145821.200.json +<> 2023-09-13T050258.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 - } - ] -} +GET http://localhost:9601/monitorPlatform/monitorPercentage -<> 2023-09-05T145814.200.json +<> 2023-09-13T044426.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 - } - ] -} +GET http://localhost:9601/monitorPlatform/monitorPercentage -<> 2023-09-05T145810.200.json +<> 2023-09-13T044310.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 - } - ] -} +GET http://localhost:9601/monitorPlatform/monitorUnitPercentage -<> 2023-09-05T145759.200.json +<> 2023-09-13T044215.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 - } - ] -} +GET http://localhost:9601/monitorPlatform/monitorPercentage -<> 2023-09-05T145750.200.json +<> 2023-09-13T044040.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 - } - ] -} +GET http://localhost:9601/monitorPlatform/monitorPercentage -<> 2023-09-05T145745.200.json +<> 2023-09-13T042534.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 - } - ] -} +GET http://localhost:9601/monitorPlatform/monitorPercentage -<> 2023-09-05T145741.200.json +<> 2023-09-13T041522.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 - } - ] -} +GET http://localhost:9601/monitorPlatform/monitorUnitPercentage -<> 2023-09-05T145734.200.json +<> 2023-09-13T041504.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 - } - ] -} +GET http://localhost:9601/monitorPlatform/monitorUnitPercentage -<> 2023-09-05T145715.200.json +<> 2023-09-13T035712.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 - } - ] -} +POST http://localhost:9601/monitorPlatform/selectDeviceByDeviceModeByMonitorUnitId +{21321321}: -<> 2023-09-05T145711.200.json +<> 2023-09-13T035612.400.html ### -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 - } - ] -} +GET http://localhost:9601/monitorPlatform/monitorUnitPercentage -<> 2023-09-05T145708.200.json +<> 2023-09-13T035551.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 - } - ] -} +GET http://localhost:9601/monitorPlatform/monitorUnitPercentage -<> 2023-09-05T145704.200.json +<> 2023-09-13T035541.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 - } - ] -} +POST http://localhost:9601/monitorPlatform/treeList -<> 2023-09-05T145614.200.json +<> 2023-09-13T035533.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 } - -} +GET http://localhost:9601/tenant/list -<> 2023-09-05T144005.200.json +<> 2023-09-11T045735.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 } - -} +GET http://localhost:9601/monitorUnit/alarmStats -<> 2023-09-05T144003.200.json +<> 2023-09-11T045659.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 } - -} +POST http://localhost:9601/monitorUnit/SelectSecne -<> 2023-09-05T143711.200.json +<> 2023-09-11T045623.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 } - -} +POST http://localhost/monitorUnit/getDeviceOperations -<> 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 } - -} +POST http://localhost:9601/monitorUnit/export -<> 2023-09-05T142515.200.json +<> 2023-09-05T031749.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 } - -} +GET http://localhost:9601/monitorUnit/ElectronicNumVo -<> 2023-09-05T142512.200.json +<> 2023-09-05T031734.200.json ### POST http://localhost:9602/tdengine/getOnlineDevicesGroupByDay Content-Type: application/json -Content-Length: 128 +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": {"databaseName":"db_scene_1","superTableName":"st_ds", - "beginTime":1666666666666,"endTime":1766666666666 } + "params": { "beginTime":1666666666666,"endTime":1766666666666 } } -<> 2023-09-05T142508.200.json +<> 2023-09-05T151123.200.json ### diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwMonitorPlatformController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwMonitorPlatformController.java index 497a52d..569ad52 100644 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwMonitorPlatformController.java +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwMonitorPlatformController.java @@ -195,9 +195,9 @@ public class HwMonitorPlatformController extends BaseController { * @param sceneId 场景id * */ @PostMapping("/getDeviceOperations") - public Integer selectTdengine(String beginTime,String endTime,Long sceneId){ - int ints = hwMonitorUnitService.selectTdengine(beginTime,endTime,sceneId); - return ints; + public int[] selectTdengine(String beginTime,String endTime,Long sceneId){ + int ints[] = hwMonitorUnitService.selectTdengine(beginTime,endTime,sceneId); + return ints; } /** * 设备汇总 diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceMapper.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceMapper.java index 0a96cf5..40a40af 100644 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceMapper.java +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceMapper.java @@ -21,6 +21,7 @@ public interface HwDeviceMapper */ public HwDevice selectHwDeviceByDeviceId(Long deviceId); List selectDeviceByMonitorId(Long monitorUnitId); + Integer selectSumDeviceFlagNot0(); /** * 查询3. 设备各类型占所有设备数量百分比饼状图(左下角) diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwMonitorUnitMapper.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwMonitorUnitMapper.java index df73d1d..44186c2 100644 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwMonitorUnitMapper.java +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwMonitorUnitMapper.java @@ -40,7 +40,7 @@ public interface HwMonitorUnitMapper * */ public List selectLimitSubMonitorUnit(); Integer selectReleatedDeviceIdNums(Long deviceCode); - Integer selectDeviceNums(); + String selectDeviceNums(); Integer selectSubDeviceSum(Long sceneId); /** diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwMonitorUnitService.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwMonitorUnitService.java index 8ce773d..9c03b12 100644 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwMonitorUnitService.java +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwMonitorUnitService.java @@ -71,7 +71,7 @@ public interface IHwMonitorUnitService * 通过tdengine获取设备运行情况 * * @return*/ - public int selectTdengine(String beginTime,String endTime,Long sceneId); + public int[] selectTdengine(String beginTime, String endTime, Long sceneId); /** * 设备汇总 * diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwMonitorUnitServiceImpl.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwMonitorUnitServiceImpl.java index e851f7f..891d803 100644 --- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwMonitorUnitServiceImpl.java +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwMonitorUnitServiceImpl.java @@ -8,16 +8,13 @@ import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; -import com.github.pagehelper.PageHelper; import com.ruoyi.business.domain.HwDevice; -import com.ruoyi.business.domain.HwElectronicFence; import com.ruoyi.business.domain.VO.*; import com.ruoyi.business.mapper.HwDeviceMapper; import com.ruoyi.business.mapper.HwElectronicFenceMapper; import com.ruoyi.common.core.constant.TdEngineConstants; import com.ruoyi.common.core.utils.DateUtils; import com.ruoyi.common.core.utils.StringUtils; -import com.ruoyi.system.api.domain.SysDept; import com.ruoyi.tdengine.api.RemoteTdEngineService; import com.ruoyi.tdengine.api.domain.DeviceStatus; import com.ruoyi.tdengine.api.domain.TdSelectDto; @@ -108,17 +105,38 @@ public class HwMonitorUnitServiceImpl implements IHwMonitorUnitService public AllNumsVo selectAllNums() { //监控单元 String monitor = hwMonitorUnitMapper.selectSubSetNums(); - Integer integer = hwMonitorUnitMapper.selectDeviceNums(); - + String integer = hwMonitorUnitMapper.selectDeviceNums(); + System.out.println(monitor+" dsaas "+integer); + Integer monitor1 = 0; + Integer monitor2 = 0; AllNumsVo vo = new AllNumsVo(); - vo.setSubSum(Integer.valueOf(monitor)); - vo.setSum(integer); + if (monitor == null){ + monitor1 = 0; + } + else { + monitor1 = Integer.valueOf(monitor); + } + if (integer == null){ + monitor2 = 0; + } + else { + monitor2 = Integer.valueOf(integer); + } + vo.setSubSum(monitor1); + vo.setSum(monitor2); return vo; } + public static void main(String[] args) { + String str1 = "1"; + String str2 = null; + int q = Integer.valueOf(str2); + System.out.println(q); + } + @Override public List selectSenceAllNums() { List allNumsVos = hwMonitorUnitMapper.selectAllNums(); @@ -191,7 +209,7 @@ public class HwMonitorUnitServiceImpl implements IHwMonitorUnitService @Override // 加一个begintime参数,endtime参数 stream时间戳 从开始时间0点开始,结束时间23.59.59结束 - public int selectTdengine(String beginTime,String endTime,Long sceneId) { + public int[] selectTdengine(String beginTime, String endTime, Long sceneId) { DeviceStatus queryDeviceStatus = new DeviceStatus(); Map params = queryDeviceStatus.getParams(); @@ -209,21 +227,21 @@ public class HwMonitorUnitServiceImpl implements IHwMonitorUnitService if (sceneId != null) { queryDeviceStatus.setSceneId(sceneId); } - int value = 0; + int sum = 0; + int values[] = new int[10]; //todo 使用id(以解决) //map key时间戳,value List 对象 List list = (List) remoteTdEgineService.getOnlineDevicesGroupByDay(queryDeviceStatus); for (int i = 0; i < list.size(); i++) { if (list.get(i).getDeviceType()==1) { - sum =sum+ hwMonitorUnitMapper.selectReleatedDeviceIdNums(list.get(i).getDeviceId()); + values[i]=hwMonitorUnitMapper.selectReleatedDeviceIdNums(list.get(i).getDeviceId()); } else { - value++; + values[i] = hwDeviceMapper.selectSumDeviceFlagNot0(); } - value = value+sum; } - return value; + return values; //设备类型==网关 根据releated_device_id = 网关设备设备id查询个数 //网关子设备数+非网关设备数(getDeviceType()!=1) diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwMonitorUnitMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwMonitorUnitMapper.xml index 88ccd9b..ae27fc5 100644 --- a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwMonitorUnitMapper.xml +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwMonitorUnitMapper.xml @@ -97,13 +97,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select * from hw_monitor_unit where monitor_unit_id - not in (select parent_id from hw_monitor_unit) + not in (select parent_id from hw_monitor_unit where parent_id is not null) @@ -158,7 +158,7 @@ select b.monitor_unit_id,b.monitor_unit_name,sum from