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/images/2/20230904/b2dc2354-83fd-4fdc-8dfc-973789c7de75.jpeg b/images/2/20230904/b2dc2354-83fd-4fdc-8dfc-973789c7de75.jpeg new file mode 100644 index 0000000..a23ca2f Binary files /dev/null and b/images/2/20230904/b2dc2354-83fd-4fdc-8dfc-973789c7de75.jpeg differ diff --git a/logs/hw-mqtt-broker/all.log.2023-08-30.0.gz b/logs/hw-mqtt-broker/all.log.2023-08-30.0.gz new file mode 100644 index 0000000..2bc4cde Binary files /dev/null and b/logs/hw-mqtt-broker/all.log.2023-08-30.0.gz differ diff --git a/logs/hw-mqtt-broker/all.log.2023-08-31.0.gz b/logs/hw-mqtt-broker/all.log.2023-08-31.0.gz new file mode 100644 index 0000000..f880f85 Binary files /dev/null and b/logs/hw-mqtt-broker/all.log.2023-08-31.0.gz differ diff --git a/logs/hw-mqtt-broker/all.log.2023-09-01.0.gz b/logs/hw-mqtt-broker/all.log.2023-09-01.0.gz new file mode 100644 index 0000000..eda10eb Binary files /dev/null and b/logs/hw-mqtt-broker/all.log.2023-09-01.0.gz differ diff --git a/logs/hw-mqtt-broker/all.log.2023-09-02.0.gz b/logs/hw-mqtt-broker/all.log.2023-09-02.0.gz new file mode 100644 index 0000000..1e590e0 Binary files /dev/null and b/logs/hw-mqtt-broker/all.log.2023-09-02.0.gz differ diff --git a/logs/hw-mqtt-broker/all.log.2023-09-03.0.gz b/logs/hw-mqtt-broker/all.log.2023-09-03.0.gz new file mode 100644 index 0000000..79ae8f9 Binary files /dev/null and b/logs/hw-mqtt-broker/all.log.2023-09-03.0.gz differ diff --git a/logs/hw-mqtt-broker/all.log.2023-09-04.0.gz b/logs/hw-mqtt-broker/all.log.2023-09-04.0.gz new file mode 100644 index 0000000..0d14e07 Binary files /dev/null and b/logs/hw-mqtt-broker/all.log.2023-09-04.0.gz differ diff --git a/logs/hw-mqtt-broker/error.log.2023-08-30.0.gz b/logs/hw-mqtt-broker/error.log.2023-08-30.0.gz new file mode 100644 index 0000000..a9448ce Binary files /dev/null and b/logs/hw-mqtt-broker/error.log.2023-08-30.0.gz differ diff --git a/logs/hw-mqtt-broker/error.log.2023-08-31.0.gz b/logs/hw-mqtt-broker/error.log.2023-08-31.0.gz new file mode 100644 index 0000000..9dd9e98 Binary files /dev/null and b/logs/hw-mqtt-broker/error.log.2023-08-31.0.gz differ diff --git a/logs/hw-mqtt-broker/error.log.2023-09-01.0.gz b/logs/hw-mqtt-broker/error.log.2023-09-01.0.gz new file mode 100644 index 0000000..f31e23e Binary files /dev/null and b/logs/hw-mqtt-broker/error.log.2023-09-01.0.gz differ diff --git a/logs/hw-mqtt-broker/error.log.2023-09-02.0.gz b/logs/hw-mqtt-broker/error.log.2023-09-02.0.gz new file mode 100644 index 0000000..94f7c9f Binary files /dev/null and b/logs/hw-mqtt-broker/error.log.2023-09-02.0.gz differ diff --git a/logs/hw-mqtt-broker/error.log.2023-09-03.0.gz b/logs/hw-mqtt-broker/error.log.2023-09-03.0.gz new file mode 100644 index 0000000..4ffa6bd Binary files /dev/null and b/logs/hw-mqtt-broker/error.log.2023-09-03.0.gz differ diff --git a/pom.xml b/pom.xml index a5d18f9..0901ec0 100644 --- a/pom.xml +++ b/pom.xml @@ -213,6 +213,13 @@ ${ruoyi.version} + + + com.ruoyi + hw-api-tdengine + ${ruoyi.version} + + diff --git a/ruoyi-api/hw-api-tdengine/src/main/java/com/ruoyi/tdengine/api/RemoteTdEngineService.java b/ruoyi-api/hw-api-tdengine/src/main/java/com/ruoyi/tdengine/api/RemoteTdEngineService.java index ca71a67..9b83e0e 100644 --- a/ruoyi-api/hw-api-tdengine/src/main/java/com/ruoyi/tdengine/api/RemoteTdEngineService.java +++ b/ruoyi-api/hw-api-tdengine/src/main/java/com/ruoyi/tdengine/api/RemoteTdEngineService.java @@ -51,5 +51,6 @@ public interface RemoteTdEngineService { @PostMapping("/tdengine/getCountOfHistoryData") R getCountOfHistoryData(@Validated @RequestBody TdHistorySelectDto tdHistorySelectDto); - + @PostMapping("/tdengine/getOnlineDevicesGroupByDay") + R getOnlineDevicesGroupByDay(@Validated @RequestBody DeviceStatus queryDeviceStatus); } diff --git a/ruoyi-api/hw-api-tdengine/src/main/java/com/ruoyi/tdengine/api/domain/DeviceStatus.java b/ruoyi-api/hw-api-tdengine/src/main/java/com/ruoyi/tdengine/api/domain/DeviceStatus.java new file mode 100644 index 0000000..08f3edb --- /dev/null +++ b/ruoyi-api/hw-api-tdengine/src/main/java/com/ruoyi/tdengine/api/domain/DeviceStatus.java @@ -0,0 +1,63 @@ +package com.ruoyi.tdengine.api.domain; + +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * @Description: 设备状态对象 + * @ClassName: DeviceStatus + * @Author : xins + * @Date :2023-09-05 11:35 + * @Version :1.0 + */ +public class DeviceStatus extends BaseEntity { + + private Long ts; + + private String deviceCode; + + private int deviceType; + + private int onlineStatus; + + private Long sceneId; + + public Long getTs() { + return ts; + } + + public void setTs(Long ts) { + this.ts = ts; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public int getDeviceType() { + return deviceType; + } + + public void setDeviceType(int deviceType) { + this.deviceType = deviceType; + } + + public int getOnlineStatus() { + return onlineStatus; + } + + public void setOnlineStatus(int onlineStatus) { + this.onlineStatus = onlineStatus; + } + + public Long getSceneId() { + return sceneId; + } + + public void setSceneId(Long sceneId) { + this.sceneId = sceneId; + } +} diff --git a/ruoyi-api/hw-api-tdengine/src/main/java/com/ruoyi/tdengine/api/factory/RemoteTdEngineFallbackFactory.java b/ruoyi-api/hw-api-tdengine/src/main/java/com/ruoyi/tdengine/api/factory/RemoteTdEngineFallbackFactory.java index 4a82b59..64c1a65 100644 --- a/ruoyi-api/hw-api-tdengine/src/main/java/com/ruoyi/tdengine/api/factory/RemoteTdEngineFallbackFactory.java +++ b/ruoyi-api/hw-api-tdengine/src/main/java/com/ruoyi/tdengine/api/factory/RemoteTdEngineFallbackFactory.java @@ -10,6 +10,13 @@ import org.springframework.stereotype.Component; import java.util.Map; +/** + * @Description: TDengine服务降级处理 + * @ClassName: RemoteTdEngineFallbackFactory + * @Author : xins + * @Date :2023-09-01 14:14 + * @Version :1.0 + */ @Component public class RemoteTdEngineFallbackFactory implements FallbackFactory { @@ -73,6 +80,11 @@ public class RemoteTdEngineFallbackFactory implements FallbackFactory getOnlineDevicesGroupByDay(DeviceStatus queryDeviceStatus) { + return R.fail("获取设备状态失败:" + throwable.getMessage()); + } + }; } } diff --git a/ruoyi-api/hw-api-tdengine/src/main/java/test.java b/ruoyi-api/hw-api-tdengine/src/main/java/test.java new file mode 100644 index 0000000..35bd049 --- /dev/null +++ b/ruoyi-api/hw-api-tdengine/src/main/java/test.java @@ -0,0 +1,6 @@ +public class test { + + public static void main(String[] args) { + System.out.println(System.currentTimeMillis()); + } +} diff --git a/ruoyi-api/hw-api-tdengine/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/ruoyi-api/hw-api-tdengine/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..e812c49 --- /dev/null +++ b/ruoyi-api/hw-api-tdengine/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1,2 @@ +com.ruoyi.tdengine.api.factory.RemoteTdEngineFallbackFactory + diff --git a/ruoyi-common/hw-common-i18n/src/main/java/com/ruoyi/i18n/config/I18nConfig.java b/ruoyi-common/hw-common-i18n/src/main/java/com/ruoyi/i18n/config/I18nConfig.java index 9c0b006..b29a696 100644 --- a/ruoyi-common/hw-common-i18n/src/main/java/com/ruoyi/i18n/config/I18nConfig.java +++ b/ruoyi-common/hw-common-i18n/src/main/java/com/ruoyi/i18n/config/I18nConfig.java @@ -49,18 +49,18 @@ public class I18nConfig implements WebMvcConfigurer return lci; } - @Bean - public MessageSource messageSource() { - ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); - messageSource.setBasenames("classpath:i18n/messages"); - messageSource.setDefaultEncoding("utf-8"); - //设置缓存时间1个小时 1*60*60*1000毫秒 - //可以设置成-1表示永久缓存,设置成0表示每次都从文件中读取 - messageSource.setCacheMillis(1*60*60*1000); - messageSource.setFallbackToSystemLocale(true); - - return messageSource; - } +// @Bean +// public MessageSource messageSource() { +// ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); +// messageSource.setBasenames("classpath:i18n/messages"); +// messageSource.setDefaultEncoding("utf-8"); +// //设置缓存时间1个小时 1*60*60*1000毫秒 +// //可以设置成-1表示永久缓存,设置成0表示每次都从文件中读取 +// messageSource.setCacheMillis(1*60*60*1000); +// messageSource.setFallbackToSystemLocale(true); +// +// return messageSource; +// } @Override diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/HwDictConstants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/HwDictConstants.java new file mode 100644 index 0000000..cc2f169 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/HwDictConstants.java @@ -0,0 +1,29 @@ +package com.ruoyi.common.core.constant; + +/** + * @Description: 平台常量字典信息 + * @ClassName: HwDictConstants + * @Author : xins + * @Date :2023-09-03 12:27 + * @Version :1.0 + */ +public class HwDictConstants { + + public static final String EFFECTIVE_TIME_FLAG_LONG = "1";//长期有效 + public static final String EFFECTIVE_TIME_FLAG_RANGE = "2";//时间范围 + + public static final String AREA_SHAPE_FLAG_POLYGN = "1";//多边形 + public static final String AREA_SHAPE_FLAG_CIRCULA = "2";//圆形 + + public static final String DEFAULT_FUNCTION_LONGITUDE_IDENTIFIER = "longitude";//经度标识符 + public static final String DEFAULT_FUNCTION_LATITUDE_IDENTIFIER = "latitude";//纬度标识符 + + public static final String ELECTRONIC_FENCE_TRIGGER_STATUS_EXIT = "1";//电子围栏触发状态:出界 + public static final String ELECTRONIC_FENCE_TRIGGER_STATUS_ENTRY = "2";//电子围栏触发状态:入界 + + public static final String ALARM_INFO_TYPE_DEVICE = "1";//设备报警 + public static final String ALARM_INFO_TYPE_MONITOR_UNIT = "2";//监控单元 + public static final String ALARM_INFO_TYPE_OFFLINE = "3";//离线报警 + public static final String ALARM_INFO_TYPE_ELECTRONIC_FENCE = "4";//电子围栏 + +} 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 e5c87b8..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 @@ -1,8 +1,67 @@ package com.ruoyi.common.core.constant; +import java.util.HashMap; +import java.util.Map; + +/** + * @Description: TdEngine服务常量 + * @ClassName: TdEngineConstants + * @Author : xins + * @Date :2023-09-05 9:47 + * @Version :1.0 + */ public class TdEngineConstants { - public static final String DEFAULT_FIRST_FIELD_NAME = "ts"; + public static final String DEFAULT_FIRST_FIELD_NAME = "ts";//timestamp格式首字段,必须 + + public static final String DEFAULT_ORDER_BY_MODE = "desc";//默认排序方式,逆序 + + public static final String PAYLOAD_TS = "timestamp";//协议上传ts的key + + public static final String PAYLOAD_PARAM = "param";//协议上传的param key + + public static final String PAYLOAD_DATAVALUE = "datavalue";//协议上传数据的key + + public static final String PAYLOAD_DEVICE_CODE = "uid";//协议上传设备编号的key + + public static final String DEFAULT_DB_NAME_PREFIX = "db_scene_";//数据库名称前缀 + + public static final String DEFAULT_TABLE_NAME_PREFIX = "t_device_";//数据表名称前缀 + + 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 + */ + public static final Map TDENGINE_KEY_TRANSFER_MAP = new HashMap(); + + static { + TDENGINE_KEY_TRANSFER_MAP.put("value", "value1"); + } + + /** + * @return String + * @param: sceneId + * @description 获取数据库名称 + * @author xins + * @date 2023-09-05 9:42 + */ + public static String getDatabaseName(Long sceneId) { + return DEFAULT_DB_NAME_PREFIX + sceneId; + } + + /** + * @param: deviceId + * @return String + * @description 获取设备数据子表名称 + * @author xins + * @date 2023-09-05 9:42 + */ + public static String getDeviceDataTableName(Long deviceId) { + return DEFAULT_TABLE_NAME_PREFIX + deviceId; + } + - public static final String DEFAULT_ORDER_BY_MODE = "desc"; } diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/ResultEnums.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/ResultEnums.java new file mode 100644 index 0000000..2c0b4c1 --- /dev/null +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/ResultEnums.java @@ -0,0 +1,35 @@ +package com.ruoyi.common.core.enums; +/** + * @Description: 返回结果枚举 + * @ClassName: ResultEnums + * @Author : xins + * @Date :2023-09-01 13:40 + * @Version :1.0 + */ +public enum ResultEnums { + + SUCCESS(200,"成功"),FAIL(500,"失败"); + public Integer code; + public String message; + + ResultEnums(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwAreaController.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwAreaController.java new file mode 100644 index 0000000..5ede497 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwAreaController.java @@ -0,0 +1,103 @@ +package com.ruoyi.basic.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.basic.domain.HwArea; +import com.ruoyi.basic.service.IHwAreaService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; + +/** + * 区域管理Controller + * + * @author YINQ + * @date 2023-08-30 + */ +@RestController +@RequestMapping("/area") +public class HwAreaController extends BaseController +{ + @Autowired + private IHwAreaService hwAreaService; + + /** + * 查询区域管理列表 + */ + @RequiresPermissions("basic:area:list") + @GetMapping("/list") + public AjaxResult list(HwArea hwArea) + { + List list = hwAreaService.selectHwAreaList(hwArea); + return success(list); + } + + /** + * 导出区域管理列表 + */ + @RequiresPermissions("basic:area:export") + @Log(title = "区域管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, HwArea hwArea) + { + List list = hwAreaService.selectHwAreaList(hwArea); + ExcelUtil util = new ExcelUtil(HwArea.class); + util.exportExcel(response, list, "区域管理数据"); + } + + /** + * 获取区域管理详细信息 + */ + @RequiresPermissions("basic:area:query") + @GetMapping(value = "/{areaId}") + public AjaxResult getInfo(@PathVariable("areaId") Long areaId) + { + return success(hwAreaService.selectHwAreaByAreaId(areaId)); + } + + /** + * 新增区域管理 + */ + @RequiresPermissions("basic:area:add") + @Log(title = "区域管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody HwArea hwArea) + { + return toAjax(hwAreaService.insertHwArea(hwArea)); + } + + /** + * 修改区域管理 + */ + @RequiresPermissions("basic:area:edit") + @Log(title = "区域管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody HwArea hwArea) + { + return toAjax(hwAreaService.updateHwArea(hwArea)); + } + + /** + * 删除区域管理 + */ + @RequiresPermissions("basic:area:remove") + @Log(title = "区域管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{areaIds}") + public AjaxResult remove(@PathVariable Long[] areaIds) + { + return toAjax(hwAreaService.deleteHwAreaByAreaIds(areaIds)); + } +} diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwArea.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwArea.java new file mode 100644 index 0000000..0c62cd9 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwArea.java @@ -0,0 +1,72 @@ +package com.ruoyi.basic.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.TreeEntity; + +/** + * 区域管理对象 hw_area + * + * @author YINQ + * @date 2023-08-30 + */ +public class HwArea extends TreeEntity +{ + private static final long serialVersionUID = 1L; + + /** 区域ID */ + private Long areaId; + + /** 区域名称 */ + @Excel(name = "区域名称") + private String areaName; + + /** 区域状态 */ + @Excel(name = "区域状态") + private Long areaStatus; + + public void setAreaId(Long areaId) + { + this.areaId = areaId; + } + + public Long getAreaId() + { + return areaId; + } + public void setAreaName(String areaName) + { + this.areaName = areaName; + } + + public String getAreaName() + { + return areaName; + } + public void setAreaStatus(Long areaStatus) + { + this.areaStatus = areaStatus; + } + + public Long getAreaStatus() + { + return areaStatus; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("areaId", getAreaId()) + .append("areaName", getAreaName()) + .append("ancestors", getAncestors()) + .append("parentId", getParentId()) + .append("areaStatus", getAreaStatus()) + .append("orderNum", getOrderNum()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/HwAreaMapper.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/HwAreaMapper.java new file mode 100644 index 0000000..3183eaa --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/HwAreaMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.basic.mapper; + +import java.util.List; +import com.ruoyi.basic.domain.HwArea; + +/** + * 区域管理Mapper接口 + * + * @author YINQ + * @date 2023-08-30 + */ +public interface HwAreaMapper +{ + /** + * 查询区域管理 + * + * @param areaId 区域管理主键 + * @return 区域管理 + */ + public HwArea selectHwAreaByAreaId(Long areaId); + + /** + * 查询区域管理列表 + * + * @param hwArea 区域管理 + * @return 区域管理集合 + */ + public List selectHwAreaList(HwArea hwArea); + + /** + * 新增区域管理 + * + * @param hwArea 区域管理 + * @return 结果 + */ + public int insertHwArea(HwArea hwArea); + + /** + * 修改区域管理 + * + * @param hwArea 区域管理 + * @return 结果 + */ + public int updateHwArea(HwArea hwArea); + + /** + * 删除区域管理 + * + * @param areaId 区域管理主键 + * @return 结果 + */ + public int deleteHwAreaByAreaId(Long areaId); + + /** + * 批量删除区域管理 + * + * @param areaIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteHwAreaByAreaIds(Long[] areaIds); +} diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/IHwAreaService.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/IHwAreaService.java new file mode 100644 index 0000000..f84de22 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/IHwAreaService.java @@ -0,0 +1,61 @@ +package com.ruoyi.basic.service; + +import java.util.List; +import com.ruoyi.basic.domain.HwArea; + +/** + * 区域管理Service接口 + * + * @author YINQ + * @date 2023-08-30 + */ +public interface IHwAreaService +{ + /** + * 查询区域管理 + * + * @param areaId 区域管理主键 + * @return 区域管理 + */ + public HwArea selectHwAreaByAreaId(Long areaId); + + /** + * 查询区域管理列表 + * + * @param hwArea 区域管理 + * @return 区域管理集合 + */ + public List selectHwAreaList(HwArea hwArea); + + /** + * 新增区域管理 + * + * @param hwArea 区域管理 + * @return 结果 + */ + public int insertHwArea(HwArea hwArea); + + /** + * 修改区域管理 + * + * @param hwArea 区域管理 + * @return 结果 + */ + public int updateHwArea(HwArea hwArea); + + /** + * 批量删除区域管理 + * + * @param areaIds 需要删除的区域管理主键集合 + * @return 结果 + */ + public int deleteHwAreaByAreaIds(Long[] areaIds); + + /** + * 删除区域管理信息 + * + * @param areaId 区域管理主键 + * @return 结果 + */ + public int deleteHwAreaByAreaId(Long areaId); +} diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/impl/HwAreaServiceImpl.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/impl/HwAreaServiceImpl.java new file mode 100644 index 0000000..4202533 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/impl/HwAreaServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.basic.service.impl; + +import java.util.List; +import com.ruoyi.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.basic.mapper.HwAreaMapper; +import com.ruoyi.basic.domain.HwArea; +import com.ruoyi.basic.service.IHwAreaService; + +/** + * 区域管理Service业务层处理 + * + * @author YINQ + * @date 2023-08-30 + */ +@Service +public class HwAreaServiceImpl implements IHwAreaService +{ + @Autowired + private HwAreaMapper hwAreaMapper; + + /** + * 查询区域管理 + * + * @param areaId 区域管理主键 + * @return 区域管理 + */ + @Override + public HwArea selectHwAreaByAreaId(Long areaId) + { + return hwAreaMapper.selectHwAreaByAreaId(areaId); + } + + /** + * 查询区域管理列表 + * + * @param hwArea 区域管理 + * @return 区域管理 + */ + @Override + public List selectHwAreaList(HwArea hwArea) + { + return hwAreaMapper.selectHwAreaList(hwArea); + } + + /** + * 新增区域管理 + * + * @param hwArea 区域管理 + * @return 结果 + */ + @Override + public int insertHwArea(HwArea hwArea) + { + hwArea.setCreateTime(DateUtils.getNowDate()); + return hwAreaMapper.insertHwArea(hwArea); + } + + /** + * 修改区域管理 + * + * @param hwArea 区域管理 + * @return 结果 + */ + @Override + public int updateHwArea(HwArea hwArea) + { + hwArea.setUpdateTime(DateUtils.getNowDate()); + return hwAreaMapper.updateHwArea(hwArea); + } + + /** + * 批量删除区域管理 + * + * @param areaIds 需要删除的区域管理主键 + * @return 结果 + */ + @Override + public int deleteHwAreaByAreaIds(Long[] areaIds) + { + return hwAreaMapper.deleteHwAreaByAreaIds(areaIds); + } + + /** + * 删除区域管理信息 + * + * @param areaId 区域管理主键 + * @return 结果 + */ + @Override + public int deleteHwAreaByAreaId(Long areaId) + { + return hwAreaMapper.deleteHwAreaByAreaId(areaId); + } +} diff --git a/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwAreaMapper.xml b/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwAreaMapper.xml new file mode 100644 index 0000000..c548dd7 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwAreaMapper.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + select area_id, area_name, ancestors, parent_id, area_status, order_num, create_by, create_time, update_by, update_time from hw_area + + + + + + + + insert into hw_area + + area_name, + ancestors, + parent_id, + area_status, + order_num, + create_by, + create_time, + update_by, + update_time, + + + #{areaName}, + #{ancestors}, + #{parentId}, + #{areaStatus}, + #{orderNum}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update hw_area + + area_name = #{areaName}, + ancestors = #{ancestors}, + parent_id = #{parentId}, + area_status = #{areaStatus}, + order_num = #{orderNum}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where area_id = #{areaId} + + + + delete from hw_area where area_id = #{areaId} + + + + delete from hw_area where area_id in + + #{areaId} + + + \ No newline at end of file diff --git a/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwDictDataLanguageMapper.xml b/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwDictDataLanguageMapper.xml deleted file mode 100644 index 27a7df7..0000000 --- a/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwDictDataLanguageMapper.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - select data_language_id, dict_code, dict_label, language_code from hw_dict_data_language - - - - - - - - insert into hw_dict_data_language - - dict_code, - dict_label, - language_code, - - - #{dictCode}, - #{dictLabel}, - #{languageCode}, - - - - - update hw_dict_data_language - - dict_code = #{dictCode}, - dict_label = #{dictLabel}, - language_code = #{languageCode}, - - where data_language_id = #{dataLanguageId} - - - - delete from hw_dict_data_language where data_language_id = #{dataLanguageId} - - - - delete from hw_dict_data_language where data_language_id in - - #{dataLanguageId} - - - \ No newline at end of file diff --git a/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwDictDataMapper.xml b/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwDictDataMapper.xml deleted file mode 100644 index f7e6af6..0000000 --- a/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwDictDataMapper.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark from hw_dict_data - - - - - - - - - - - - insert into hw_dict_data - - dict_sort, - dict_label, - dict_value, - dict_type, - css_class, - list_class, - is_default, - status, - create_by, - create_time, - update_by, - update_time, - remark, - - - #{dictSort}, - #{dictLabel}, - #{dictValue}, - #{dictType}, - #{cssClass}, - #{listClass}, - #{isDefault}, - #{status}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - #{remark}, - - - - - update hw_dict_data - - dict_sort = #{dictSort}, - dict_label = #{dictLabel}, - dict_value = #{dictValue}, - dict_type = #{dictType}, - css_class = #{cssClass}, - list_class = #{listClass}, - is_default = #{isDefault}, - status = #{status}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - remark = #{remark}, - - where dict_code = #{dictCode} - - - - delete from hw_dict_data where dict_code = #{dictCode} - - - - delete from hw_dict_data where dict_code in - - #{dictCode} - - - \ No newline at end of file diff --git a/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwDictTypeMapper.xml b/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwDictTypeMapper.xml deleted file mode 100644 index 448d66e..0000000 --- a/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwDictTypeMapper.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - select dict_id, dict_name, dict_type, status, create_by, create_time, update_by, update_time, remark from hw_dict_type - - - - - - - - insert into hw_dict_type - - dict_name, - dict_type, - status, - create_by, - create_time, - update_by, - update_time, - remark, - - - #{dictName}, - #{dictType}, - #{status}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - #{remark}, - - - - - update hw_dict_type - - dict_name = #{dictName}, - dict_type = #{dictType}, - status = #{status}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - remark = #{remark}, - - where dict_id = #{dictId} - - - - delete from hw_dict_type where dict_id = #{dictId} - - - - delete from hw_dict_type where dict_id in - - #{dictId} - - - \ No newline at end of file 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-business/src/main/java/com/ruoyi/business/controller/HwAppController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwAppController.java new file mode 100644 index 0000000..e0b64bb --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwAppController.java @@ -0,0 +1,40 @@ +package com.ruoyi.business.controller; + +import com.ruoyi.business.domain.HwMonitorUnit; +import com.ruoyi.business.service.IHwMonitorUnitService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.page.TableDataInfo; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Description: 移动端Controller + * @ClassName: HwAppController + * @Date :2023-08-31 17:46 + * @Version :1.0 + */ +@RestController +@RequestMapping("/app") +public class HwAppController extends BaseController { + + @Autowired + private IHwMonitorUnitService hwMonitorUnitService; + + /** + * 查询监控单元列表 + */ + @RequiresPermissions("business:monitorUnit:list") + @GetMapping("/monitorUnit/list") + public TableDataInfo monitorUnitList(HwMonitorUnit hwMonitorUnit) + { + startPage(); + List list = hwMonitorUnitService.selectHwMonitorUnitList(hwMonitorUnit); + return getDataTable(list); + } + +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceModeController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceModeController.java new file mode 100644 index 0000000..5ab930a --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceModeController.java @@ -0,0 +1,105 @@ +package com.ruoyi.business.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.business.domain.HwDeviceMode; +import com.ruoyi.business.service.IHwDeviceModeService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 设备模型Controller + * + * @author xins + * @date 2023-09-04 + */ +@RestController +@RequestMapping("/deviceMode") +public class HwDeviceModeController extends BaseController +{ + @Autowired + private IHwDeviceModeService hwDeviceModeService; + + /** + * 查询设备模型列表 + */ + @RequiresPermissions("business:deviceMode:list") + @GetMapping("/list") + public TableDataInfo list(HwDeviceMode hwDeviceMode) + { + startPage(); + List list = hwDeviceModeService.selectHwDeviceModeList(hwDeviceMode); + return getDataTable(list); + } + + /** + * 导出设备模型列表 + */ + @RequiresPermissions("business:deviceMode:export") + @Log(title = "设备模型", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, HwDeviceMode hwDeviceMode) + { + List list = hwDeviceModeService.selectHwDeviceModeList(hwDeviceMode); + ExcelUtil util = new ExcelUtil(HwDeviceMode.class); + util.exportExcel(response, list, "设备模型数据"); + } + + /** + * 获取设备模型详细信息 + */ + @RequiresPermissions("business:deviceMode:query") + @GetMapping(value = "/{deviceModeId}") + public AjaxResult getInfo(@PathVariable("deviceModeId") Long deviceModeId) + { + return success(hwDeviceModeService.selectHwDeviceModeByDeviceModeId(deviceModeId)); + } + + /** + * 新增设备模型 + */ + @RequiresPermissions("business:deviceMode:add") + @Log(title = "设备模型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody HwDeviceMode hwDeviceMode) + { + return toAjax(hwDeviceModeService.insertHwDeviceMode(hwDeviceMode)); + } + + /** + * 修改设备模型 + */ + @RequiresPermissions("business:deviceMode:edit") + @Log(title = "设备模型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody HwDeviceMode hwDeviceMode) + { + return toAjax(hwDeviceModeService.updateHwDeviceMode(hwDeviceMode)); + } + + /** + * 删除设备模型 + */ + @RequiresPermissions("business:deviceMode:remove") + @Log(title = "设备模型", businessType = BusinessType.DELETE) + @DeleteMapping("/{deviceModeIds}") + public AjaxResult remove(@PathVariable Long[] deviceModeIds) + { + return toAjax(hwDeviceModeService.deleteHwDeviceModeByDeviceModeIds(deviceModeIds)); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceModeFunctionController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceModeFunctionController.java new file mode 100644 index 0000000..ea2d94b --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceModeFunctionController.java @@ -0,0 +1,105 @@ +package com.ruoyi.business.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.business.domain.HwDeviceModeFunction; +import com.ruoyi.business.service.IHwDeviceModeFunctionService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 设备模型功能Controller + * + * @author xins + * @date 2023-09-05 + */ +@RestController +@RequestMapping("/deviceModeFunction") +public class HwDeviceModeFunctionController extends BaseController +{ + @Autowired + private IHwDeviceModeFunctionService hwDeviceModeFunctionService; + + /** + * 查询设备模型功能列表 + */ + @RequiresPermissions("business:deviceModeFunction:list") + @GetMapping("/list") + public TableDataInfo list(HwDeviceModeFunction hwDeviceModeFunction) + { + startPage(); + List list = hwDeviceModeFunctionService.selectHwDeviceModeFunctionList(hwDeviceModeFunction); + return getDataTable(list); + } + + /** + * 导出设备模型功能列表 + */ + @RequiresPermissions("business:deviceModeFunction:export") + @Log(title = "设备模型功能", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, HwDeviceModeFunction hwDeviceModeFunction) + { + List list = hwDeviceModeFunctionService.selectHwDeviceModeFunctionList(hwDeviceModeFunction); + ExcelUtil util = new ExcelUtil(HwDeviceModeFunction.class); + util.exportExcel(response, list, "设备模型功能数据"); + } + + /** + * 获取设备模型功能详细信息 + */ + @RequiresPermissions("business:deviceModeFunction:query") + @GetMapping(value = "/{modeFunctionId}") + public AjaxResult getInfo(@PathVariable("modeFunctionId") Long modeFunctionId) + { + return success(hwDeviceModeFunctionService.selectHwDeviceModeFunctionByModeFunctionId(modeFunctionId)); + } + + /** + * 新增设备模型功能 + */ + @RequiresPermissions("business:deviceModeFunction:add") + @Log(title = "设备模型功能", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody HwDeviceModeFunction hwDeviceModeFunction) + { + return toAjax(hwDeviceModeFunctionService.insertHwDeviceModeFunction(hwDeviceModeFunction)); + } + + /** + * 修改设备模型功能 + */ + @RequiresPermissions("business:deviceModeFunction:edit") + @Log(title = "设备模型功能", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody HwDeviceModeFunction hwDeviceModeFunction) + { + return toAjax(hwDeviceModeFunctionService.updateHwDeviceModeFunction(hwDeviceModeFunction)); + } + + /** + * 删除设备模型功能 + */ + @RequiresPermissions("business:deviceModeFunction:remove") + @Log(title = "设备模型功能", businessType = BusinessType.DELETE) + @DeleteMapping("/{modeFunctionIds}") + public AjaxResult remove(@PathVariable Long[] modeFunctionIds) + { + return toAjax(hwDeviceModeFunctionService.deleteHwDeviceModeFunctionByModeFunctionIds(modeFunctionIds)); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwElectronicFenceController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwElectronicFenceController.java new file mode 100644 index 0000000..0068f1a --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwElectronicFenceController.java @@ -0,0 +1,105 @@ +package com.ruoyi.business.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.business.domain.HwElectronicFence; +import com.ruoyi.business.service.IHwElectronicFenceService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 电子围栏Controller + * + * @author xins + * @date 2023-09-04 + */ +@RestController +@RequestMapping("/electronicFence") +public class HwElectronicFenceController extends BaseController +{ + @Autowired + private IHwElectronicFenceService hwElectronicFenceService; + + /** + * 查询电子围栏列表 + */ + @RequiresPermissions("business:electronicFence:list") + @GetMapping("/list") + public TableDataInfo list(HwElectronicFence hwElectronicFence) + { + startPage(); + List list = hwElectronicFenceService.selectHwElectronicFenceList(hwElectronicFence); + return getDataTable(list); + } + + /** + * 导出电子围栏列表 + */ + @RequiresPermissions("business:electronicFence:export") + @Log(title = "电子围栏", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, HwElectronicFence hwElectronicFence) + { + List list = hwElectronicFenceService.selectHwElectronicFenceList(hwElectronicFence); + ExcelUtil util = new ExcelUtil(HwElectronicFence.class); + util.exportExcel(response, list, "电子围栏数据"); + } + + /** + * 获取电子围栏详细信息 + */ + @RequiresPermissions("business:electronicFence:query") + @GetMapping(value = "/{electronicFenceId}") + public AjaxResult getInfo(@PathVariable("electronicFenceId") Long electronicFenceId) + { + return success(hwElectronicFenceService.selectHwElectronicFenceByElectronicFenceId(electronicFenceId)); + } + + /** + * 新增电子围栏 + */ + @RequiresPermissions("business:electronicFence:add") + @Log(title = "电子围栏", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody HwElectronicFence hwElectronicFence) + { + return toAjax(hwElectronicFenceService.insertHwElectronicFence(hwElectronicFence)); + } + + /** + * 修改电子围栏 + */ + @RequiresPermissions("business:electronicFence:edit") + @Log(title = "电子围栏", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody HwElectronicFence hwElectronicFence) + { + return toAjax(hwElectronicFenceService.updateHwElectronicFence(hwElectronicFence)); + } + + /** + * 删除电子围栏 + */ + @RequiresPermissions("business:electronicFence:remove") + @Log(title = "电子围栏", businessType = BusinessType.DELETE) + @DeleteMapping("/{electronicFenceIds}") + public AjaxResult remove(@PathVariable Long[] electronicFenceIds) + { + return toAjax(hwElectronicFenceService.deleteHwElectronicFenceByElectronicFenceIds(electronicFenceIds)); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwFenceTargetController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwFenceTargetController.java new file mode 100644 index 0000000..ddb63d0 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwFenceTargetController.java @@ -0,0 +1,105 @@ +package com.ruoyi.business.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.business.domain.HwFenceTarget; +import com.ruoyi.business.service.IHwFenceTargetService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 电子围栏目标Controller + * + * @author xins + * @date 2023-09-04 + */ +@RestController +@RequestMapping("/fenceTarget") +public class HwFenceTargetController extends BaseController +{ + @Autowired + private IHwFenceTargetService hwFenceTargetService; + + /** + * 查询电子围栏目标列表 + */ + @RequiresPermissions("business:fenceTarget:list") + @GetMapping("/list") + public TableDataInfo list(HwFenceTarget hwFenceTarget) + { + startPage(); + List list = hwFenceTargetService.selectHwFenceTargetList(hwFenceTarget); + return getDataTable(list); + } + + /** + * 导出电子围栏目标列表 + */ + @RequiresPermissions("business:fenceTarget:export") + @Log(title = "电子围栏目标", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, HwFenceTarget hwFenceTarget) + { + List list = hwFenceTargetService.selectHwFenceTargetList(hwFenceTarget); + ExcelUtil util = new ExcelUtil(HwFenceTarget.class); + util.exportExcel(response, list, "电子围栏目标数据"); + } + + /** + * 获取电子围栏目标详细信息 + */ + @RequiresPermissions("business:fenceTarget:query") + @GetMapping(value = "/{targetId}") + public AjaxResult getInfo(@PathVariable("targetId") Long targetId) + { + return success(hwFenceTargetService.selectHwFenceTargetByTargetId(targetId)); + } + + /** + * 新增电子围栏目标 + */ + @RequiresPermissions("business:fenceTarget:add") + @Log(title = "电子围栏目标", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody HwFenceTarget hwFenceTarget) + { + return toAjax(hwFenceTargetService.insertHwFenceTarget(hwFenceTarget)); + } + + /** + * 修改电子围栏目标 + */ + @RequiresPermissions("business:fenceTarget:edit") + @Log(title = "电子围栏目标", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody HwFenceTarget hwFenceTarget) + { + return toAjax(hwFenceTargetService.updateHwFenceTarget(hwFenceTarget)); + } + + /** + * 删除电子围栏目标 + */ + @RequiresPermissions("business:fenceTarget:remove") + @Log(title = "电子围栏目标", businessType = BusinessType.DELETE) + @DeleteMapping("/{targetIds}") + public AjaxResult remove(@PathVariable Long[] targetIds) + { + return toAjax(hwFenceTargetService.deleteHwFenceTargetByTargetIds(targetIds)); + } +} 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 new file mode 100644 index 0000000..ab5d1be --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwMonitorPlatformController.java @@ -0,0 +1,9 @@ +package com.ruoyi.business.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/monitorPlatform") +public class HwMonitorPlatformController { +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwMonitorUnitController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwMonitorUnitController.java new file mode 100644 index 0000000..7545138 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwMonitorUnitController.java @@ -0,0 +1,105 @@ +package com.ruoyi.business.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.business.domain.HwMonitorUnit; +import com.ruoyi.business.service.IHwMonitorUnitService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 监控单元Controller + * + * @author YINQ + * @date 2023-08-31 + */ +@RestController +@RequestMapping("/monitorUnit") +public class HwMonitorUnitController extends BaseController +{ + @Autowired + private IHwMonitorUnitService hwMonitorUnitService; + + /** + * 查询监控单元列表 + */ + @RequiresPermissions("business:monitorUnit:list") + @GetMapping("/list") + public TableDataInfo list(HwMonitorUnit hwMonitorUnit) + { + startPage(); + List list = hwMonitorUnitService.selectHwMonitorUnitList(hwMonitorUnit); + return getDataTable(list); + } + + /** + * 导出监控单元列表 + */ + @RequiresPermissions("business:monitorUnit:export") + @Log(title = "监控单元", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, HwMonitorUnit hwMonitorUnit) + { + List list = hwMonitorUnitService.selectHwMonitorUnitList(hwMonitorUnit); + ExcelUtil util = new ExcelUtil(HwMonitorUnit.class); + util.exportExcel(response, list, "监控单元数据"); + } + + /** + * 获取监控单元详细信息 + */ + @RequiresPermissions("business:monitorUnit:query") + @GetMapping(value = "/{monitorUnitId}") + public AjaxResult getInfo(@PathVariable("monitorUnitId") Long monitorUnitId) + { + return success(hwMonitorUnitService.selectHwMonitorUnitByMonitorUnitId(monitorUnitId)); + } + + /** + * 新增监控单元 + */ + @RequiresPermissions("business:monitorUnit:add") + @Log(title = "监控单元", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody HwMonitorUnit hwMonitorUnit) + { + return toAjax(hwMonitorUnitService.insertHwMonitorUnit(hwMonitorUnit)); + } + + /** + * 修改监控单元 + */ + @RequiresPermissions("business:monitorUnit:edit") + @Log(title = "监控单元", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody HwMonitorUnit hwMonitorUnit) + { + return toAjax(hwMonitorUnitService.updateHwMonitorUnit(hwMonitorUnit)); + } + + /** + * 删除监控单元 + */ + @RequiresPermissions("business:monitorUnit:remove") + @Log(title = "监控单元", businessType = BusinessType.DELETE) + @DeleteMapping("/{monitorUnitIds}") + public AjaxResult remove(@PathVariable Long[] monitorUnitIds) + { + return toAjax(hwMonitorUnitService.deleteHwMonitorUnitByMonitorUnitIds(monitorUnitIds)); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwMonitorUnitTypeController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwMonitorUnitTypeController.java new file mode 100644 index 0000000..75205aa --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwMonitorUnitTypeController.java @@ -0,0 +1,105 @@ +package com.ruoyi.business.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.business.domain.HwMonitorUnitType; +import com.ruoyi.business.service.IHwMonitorUnitTypeService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 监控单元类型Controller + * + * @author YINQ + * @date 2023-08-31 + */ +@RestController +@RequestMapping("/monitorUnitType") +public class HwMonitorUnitTypeController extends BaseController +{ + @Autowired + private IHwMonitorUnitTypeService hwMonitorUnitTypeService; + + /** + * 查询监控单元类型列表 + */ + @RequiresPermissions("business:monitorUnitType:list") + @GetMapping("/list") + public TableDataInfo list(HwMonitorUnitType hwMonitorUnitType) + { + startPage(); + List list = hwMonitorUnitTypeService.selectHwMonitorUnitTypeList(hwMonitorUnitType); + return getDataTable(list); + } + + /** + * 导出监控单元类型列表 + */ + @RequiresPermissions("business:monitorUnitType:export") + @Log(title = "监控单元类型", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, HwMonitorUnitType hwMonitorUnitType) + { + List list = hwMonitorUnitTypeService.selectHwMonitorUnitTypeList(hwMonitorUnitType); + ExcelUtil util = new ExcelUtil(HwMonitorUnitType.class); + util.exportExcel(response, list, "监控单元类型数据"); + } + + /** + * 获取监控单元类型详细信息 + */ + @RequiresPermissions("business:monitorUnitType:query") + @GetMapping(value = "/{monitorUnitTypeId}") + public AjaxResult getInfo(@PathVariable("monitorUnitTypeId") Long monitorUnitTypeId) + { + return success(hwMonitorUnitTypeService.selectHwMonitorUnitTypeByMonitorUnitTypeId(monitorUnitTypeId)); + } + + /** + * 新增监控单元类型 + */ + @RequiresPermissions("business:monitorUnitType:add") + @Log(title = "监控单元类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody HwMonitorUnitType hwMonitorUnitType) + { + return toAjax(hwMonitorUnitTypeService.insertHwMonitorUnitType(hwMonitorUnitType)); + } + + /** + * 修改监控单元类型 + */ + @RequiresPermissions("business:monitorUnitType:edit") + @Log(title = "监控单元类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody HwMonitorUnitType hwMonitorUnitType) + { + return toAjax(hwMonitorUnitTypeService.updateHwMonitorUnitType(hwMonitorUnitType)); + } + + /** + * 删除监控单元类型 + */ + @RequiresPermissions("business:monitorUnitType:remove") + @Log(title = "监控单元类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{monitorUnitTypeIds}") + public AjaxResult remove(@PathVariable Long[] monitorUnitTypeIds) + { + return toAjax(hwMonitorUnitTypeService.deleteHwMonitorUnitTypeByMonitorUnitTypeIds(monitorUnitTypeIds)); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwSceneModeController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwSceneModeController.java new file mode 100644 index 0000000..d9103da --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwSceneModeController.java @@ -0,0 +1,105 @@ +package com.ruoyi.business.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.business.domain.HwSceneMode; +import com.ruoyi.business.service.IHwSceneModeService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 场景类型Controller + * + * @author YINQ + * @date 2023-08-31 + */ +@RestController +@RequestMapping("/sceneMode") +public class HwSceneModeController extends BaseController +{ + @Autowired + private IHwSceneModeService hwSceneModeService; + + /** + * 查询场景类型列表 + */ + @RequiresPermissions("business:sceneMode:list") + @GetMapping("/list") + public TableDataInfo list(HwSceneMode hwSceneMode) + { + startPage(); + List list = hwSceneModeService.selectHwSceneModeList(hwSceneMode); + return getDataTable(list); + } + + /** + * 导出场景类型列表 + */ + @RequiresPermissions("business:sceneMode:export") + @Log(title = "场景类型", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, HwSceneMode hwSceneMode) + { + List list = hwSceneModeService.selectHwSceneModeList(hwSceneMode); + ExcelUtil util = new ExcelUtil(HwSceneMode.class); + util.exportExcel(response, list, "场景类型数据"); + } + + /** + * 获取场景类型详细信息 + */ + @RequiresPermissions("business:sceneMode:query") + @GetMapping(value = "/{sceneModeId}") + public AjaxResult getInfo(@PathVariable("sceneModeId") Long sceneModeId) + { + return success(hwSceneModeService.selectHwSceneModeBySceneModeId(sceneModeId)); + } + + /** + * 新增场景类型 + */ + @RequiresPermissions("business:sceneMode:add") + @Log(title = "场景类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody HwSceneMode hwSceneMode) + { + return toAjax(hwSceneModeService.insertHwSceneMode(hwSceneMode)); + } + + /** + * 修改场景类型 + */ + @RequiresPermissions("business:sceneMode:edit") + @Log(title = "场景类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody HwSceneMode hwSceneMode) + { + return toAjax(hwSceneModeService.updateHwSceneMode(hwSceneMode)); + } + + /** + * 删除场景类型 + */ + @RequiresPermissions("business:sceneMode:remove") + @Log(title = "场景类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{sceneModeIds}") + public AjaxResult remove(@PathVariable Long[] sceneModeIds) + { + return toAjax(hwSceneModeService.deleteHwSceneModeBySceneModeIds(sceneModeIds)); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwTenantController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwTenantController.java new file mode 100644 index 0000000..2a5c99e --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwTenantController.java @@ -0,0 +1,105 @@ +package com.ruoyi.business.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.business.domain.HwTenant; +import com.ruoyi.business.service.IHwTenantService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 租户信息Controller + * + * @author xins + * @date 2023-09-04 + */ +@RestController +@RequestMapping("/tenant") +public class HwTenantController extends BaseController +{ + @Autowired + private IHwTenantService hwTenantService; + + /** + * 查询租户信息列表 + */ + @RequiresPermissions("business:tenant:list") + @GetMapping("/list") + public TableDataInfo list(HwTenant hwTenant) + { + startPage(); + List list = hwTenantService.selectHwTenantList(hwTenant); + return getDataTable(list); + } + + /** + * 导出租户信息列表 + */ + @RequiresPermissions("business:tenant:export") + @Log(title = "租户信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, HwTenant hwTenant) + { + List list = hwTenantService.selectHwTenantList(hwTenant); + ExcelUtil util = new ExcelUtil(HwTenant.class); + util.exportExcel(response, list, "租户信息数据"); + } + + /** + * 获取租户信息详细信息 + */ + @RequiresPermissions("business:tenant:query") + @GetMapping(value = "/{tenantId}") + public AjaxResult getInfo(@PathVariable("tenantId") Long tenantId) + { + return success(hwTenantService.selectHwTenantByTenantId(tenantId)); + } + + /** + * 新增租户信息 + */ + @RequiresPermissions("business:tenant:add") + @Log(title = "租户信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody HwTenant hwTenant) + { + return toAjax(hwTenantService.insertHwTenant(hwTenant)); + } + + /** + * 修改租户信息 + */ + @RequiresPermissions("business:tenant:edit") + @Log(title = "租户信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody HwTenant hwTenant) + { + return toAjax(hwTenantService.updateHwTenant(hwTenant)); + } + + /** + * 删除租户信息 + */ + @RequiresPermissions("business:tenant:remove") + @Log(title = "租户信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{tenantIds}") + public AjaxResult remove(@PathVariable Long[] tenantIds) + { + return toAjax(hwTenantService.deleteHwTenantByTenantIds(tenantIds)); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwDeviceMode.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwDeviceMode.java new file mode 100644 index 0000000..e995a90 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwDeviceMode.java @@ -0,0 +1,211 @@ +package com.ruoyi.business.domain; + +import java.util.List; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 设备模型对象 hw_device_mode + * + * @author xins + * @date 2023-09-04 + */ +public class HwDeviceMode extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 设备模型ID */ + private Long deviceModeId; + + /** 设备模型名称 */ + @Excel(name = "设备模型名称") + private String deviceModeName; + + /** 租户ID,关联hw_tenant的tenant_id */ + @Excel(name = "租户ID,关联hw_tenant的tenant_id") + private Long tenantId; + + /** 所属场景,关联hw_scene表的scene_id字段 */ + @Excel(name = "所属场景,关联hw_scene表的scene_id字段") + private Long sceneId; + + /** 语言code,关联表hw_language的language_code字段 */ + @Excel(name = "语言code,关联表hw_language的language_code字段") + private String languageCode; + + /** 定位标识(1:是,0:否) */ + @Excel(name = "定位标识", readConverterExp = "1=:是,0:否") + private String gpsFlag; + + /** 设备模型状态(1:启用,9:删除) */ + @Excel(name = "设备模型状态", readConverterExp = "1=:启用,9:删除") + private String deviceModeStatus; + + /** 是否通用物模型(1、是,0:否) */ + @Excel(name = "是否通用物模型", readConverterExp = "1=、是,0:否") + private String commonFlag; + + /** 模型分类(在平台字典数据表中定义) */ + @Excel(name = "模型分类", readConverterExp = "在=平台字典数据表中定义") + private Long modeClassfication; + + /** 设备模型图片地址 */ + @Excel(name = "设备模型图片地址") + private String deviceModePic; + + /** 预留字段,数据校验级别 */ + @Excel(name = "预留字段,数据校验级别") + private String dataVerifyLevel; + + /** 预留字段 */ + @Excel(name = "预留字段") + private String deviceModeField; + + /** 设备模型功能信息 */ + private List hwDeviceModeFunctionList; + + public void setDeviceModeId(Long deviceModeId) + { + this.deviceModeId = deviceModeId; + } + + public Long getDeviceModeId() + { + return deviceModeId; + } + public void setDeviceModeName(String deviceModeName) + { + this.deviceModeName = deviceModeName; + } + + public String getDeviceModeName() + { + return deviceModeName; + } + public void setTenantId(Long tenantId) + { + this.tenantId = tenantId; + } + + public Long getTenantId() + { + return tenantId; + } + public void setSceneId(Long sceneId) + { + this.sceneId = sceneId; + } + + public Long getSceneId() + { + return sceneId; + } + public void setLanguageCode(String languageCode) + { + this.languageCode = languageCode; + } + + public String getLanguageCode() + { + return languageCode; + } + public void setGpsFlag(String gpsFlag) + { + this.gpsFlag = gpsFlag; + } + + public String getGpsFlag() + { + return gpsFlag; + } + public void setDeviceModeStatus(String deviceModeStatus) + { + this.deviceModeStatus = deviceModeStatus; + } + + public String getDeviceModeStatus() + { + return deviceModeStatus; + } + public void setCommonFlag(String commonFlag) + { + this.commonFlag = commonFlag; + } + + public String getCommonFlag() + { + return commonFlag; + } + public void setModeClassfication(Long modeClassfication) + { + this.modeClassfication = modeClassfication; + } + + public Long getModeClassfication() + { + return modeClassfication; + } + public void setDeviceModePic(String deviceModePic) + { + this.deviceModePic = deviceModePic; + } + + public String getDeviceModePic() + { + return deviceModePic; + } + public void setDataVerifyLevel(String dataVerifyLevel) + { + this.dataVerifyLevel = dataVerifyLevel; + } + + public String getDataVerifyLevel() + { + return dataVerifyLevel; + } + public void setDeviceModeField(String deviceModeField) + { + this.deviceModeField = deviceModeField; + } + + public String getDeviceModeField() + { + return deviceModeField; + } + + public List getHwDeviceModeFunctionList() + { + return hwDeviceModeFunctionList; + } + + public void setHwDeviceModeFunctionList(List hwDeviceModeFunctionList) + { + this.hwDeviceModeFunctionList = hwDeviceModeFunctionList; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("deviceModeId", getDeviceModeId()) + .append("deviceModeName", getDeviceModeName()) + .append("tenantId", getTenantId()) + .append("sceneId", getSceneId()) + .append("languageCode", getLanguageCode()) + .append("gpsFlag", getGpsFlag()) + .append("deviceModeStatus", getDeviceModeStatus()) + .append("commonFlag", getCommonFlag()) + .append("modeClassfication", getModeClassfication()) + .append("deviceModePic", getDeviceModePic()) + .append("dataVerifyLevel", getDataVerifyLevel()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("deviceModeField", getDeviceModeField()) + .append("hwDeviceModeFunctionList", getHwDeviceModeFunctionList()) + .toString(); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwDeviceModeFunction.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwDeviceModeFunction.java new file mode 100644 index 0000000..ac81b36 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwDeviceModeFunction.java @@ -0,0 +1,320 @@ +package com.ruoyi.business.domain; + +import java.math.BigDecimal; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 设备模型功能对象 hw_device_mode_function + * + * @author xins + * @date 2023-09-04 + */ +public class HwDeviceModeFunction extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 设备模型功能ID */ + private Long modeFunctionId; + + /** 设备模型ID,关联表hw_device_mode的device_mode_id */ + @Excel(name = "设备模型ID,关联表hw_device_mode的device_mode_id") + private Long deviceModeId; + + /** 功能模式(1、属性,2、服务,3、事件) */ + @Excel(name = "功能模式", readConverterExp = "1=、属性,2、服务,3、事件") + private String functionMode; + + /** 坐标标识(1、经度,2、纬度) */ + @Excel(name = "坐标标识", readConverterExp = "1=、经度,2、纬度") + private String coordinate; + + /** 功能名称 */ + @Excel(name = "功能名称") + private String functionName; + + /** 标识符(支持大小写字母、数字和下划线,对外暂时不超过50个字符) */ + @Excel(name = "标识符", readConverterExp = "支=持大小写字母、数字和下划线,对外暂时不超过50个字符") + private String functionIdentifier; + + /** 功能类型(1、直采变量 2、手录变量 3、运算性变量) */ + @Excel(name = "功能类型(1、直采变量 2、手录变量 3、运算性变量)") + private String functionType; + + /** 数据类型(2、int,4、float,5、double,6、binary(image/base64),9、bool,10、string) */ + @Excel(name = "数据类型", readConverterExp = "2=、int,4、float,5、double,6、binary(image/base64),9、bool,10、string") + private Long dataType; + + /** 数据定义,按json保存,示例如下: + 1、取值范围:{'minValue':1,'maxValue':100}, + 2、枚举型: + {'1':'成功','2','失败','3','提示} + 3、bool型: + {'0':'关','1','开'} + 4、Text型: + {'dataLength':1024} + 5、String类型(此类型需要定义在数据字典中,支持多语言): + {'dateFormat':'String类型的UTC时间戳(毫秒)'} */ + @Excel(name = "数据定义,按json保存,示例如下:1、取值范围:{'minValue':1,'maxValue':100},2、枚举型:{'1':'成功','2','失败','3','提示}3、bool型: {'0':'关','1','开'}4、Text型:{'dataLength':1024}5、String类型", readConverterExp = "此=类型需要定义在数据字典中,支持多语言") + private String dataDefinition; + + /** 运算性变量公式(标识符1*标识符2*100) */ + @Excel(name = "运算性变量公式", readConverterExp = "标=识符1*标识符2*100") + private String functionFormula; + + /** 单位 */ + @Excel(name = "单位") + private String propertyUnit; + + /** 显示标识(0、不显示,1、显示,2、可累积显示) */ + @Excel(name = "显示标识", readConverterExp = "0=、不显示,1、显示,2、可累积显示") + private String displayFlag; + + /** 读写标识(1、读写,2、只读) */ + @Excel(name = "读写标识", readConverterExp = "1=、读写,2、只读") + private String rwFlag; + + /** 调用方式(1、异步,2、同步),当功能模式为服务时必填 */ + @Excel(name = "调用方式", readConverterExp = "1=、异步,2、同步") + private String invokeMethod; + + /** 事件类型(1、信息,2、告警,3、故障),当功能类型为事件时必填 */ + @Excel(name = "事件类型", readConverterExp = "1=、信息,2、告警,3、故障") + private String eventType; + + /** 预留字段,采集公式:设备上行数据经采集公式计算后显示,公式中的%s为占位符,是固定字段。 + 如: + 加:%s+10 + 减:%s-10 + 乘:%s10 + 除:%s/10 + 余数:%s%10 */ + @Excel(name = "预留字段,采集公式:设备上行数据经采集公式计算后显示,公式中的%s为占位符,是固定字段。如:加:%s+10减:%s-10乘:%s10除:%s/10余数:%s%10") + private String acquisitionFormula; + + /** 预留字段,顺序 */ + @Excel(name = "预留字段,顺序") + private Long orderFlag; + + /** 预留字段,寄存器 */ + @Excel(name = "预留字段,寄存器") + private String deviceRegister; + + /** 预留字段,步长 */ + @Excel(name = "预留字段,步长") + private BigDecimal propertyStep; + + /** 预留字段 */ + @Excel(name = "预留字段") + private String propertyField; + + public void setModeFunctionId(Long modeFunctionId) + { + this.modeFunctionId = modeFunctionId; + } + + public Long getModeFunctionId() + { + return modeFunctionId; + } + public void setDeviceModeId(Long deviceModeId) + { + this.deviceModeId = deviceModeId; + } + + public Long getDeviceModeId() + { + return deviceModeId; + } + public void setFunctionMode(String functionMode) + { + this.functionMode = functionMode; + } + + public String getFunctionMode() + { + return functionMode; + } + public void setCoordinate(String coordinate) + { + this.coordinate = coordinate; + } + + public String getCoordinate() + { + return coordinate; + } + public void setFunctionName(String functionName) + { + this.functionName = functionName; + } + + public String getFunctionName() + { + return functionName; + } + public void setFunctionIdentifier(String functionIdentifier) + { + this.functionIdentifier = functionIdentifier; + } + + public String getFunctionIdentifier() + { + return functionIdentifier; + } + public void setFunctionType(String functionType) + { + this.functionType = functionType; + } + + public String getFunctionType() + { + return functionType; + } + public void setDataType(Long dataType) + { + this.dataType = dataType; + } + + public Long getDataType() + { + return dataType; + } + public void setDataDefinition(String dataDefinition) + { + this.dataDefinition = dataDefinition; + } + + public String getDataDefinition() + { + return dataDefinition; + } + public void setFunctionFormula(String functionFormula) + { + this.functionFormula = functionFormula; + } + + public String getFunctionFormula() + { + return functionFormula; + } + public void setPropertyUnit(String propertyUnit) + { + this.propertyUnit = propertyUnit; + } + + public String getPropertyUnit() + { + return propertyUnit; + } + public void setDisplayFlag(String displayFlag) + { + this.displayFlag = displayFlag; + } + + public String getDisplayFlag() + { + return displayFlag; + } + public void setRwFlag(String rwFlag) + { + this.rwFlag = rwFlag; + } + + public String getRwFlag() + { + return rwFlag; + } + public void setInvokeMethod(String invokeMethod) + { + this.invokeMethod = invokeMethod; + } + + public String getInvokeMethod() + { + return invokeMethod; + } + public void setEventType(String eventType) + { + this.eventType = eventType; + } + + public String getEventType() + { + return eventType; + } + public void setAcquisitionFormula(String acquisitionFormula) + { + this.acquisitionFormula = acquisitionFormula; + } + + public String getAcquisitionFormula() + { + return acquisitionFormula; + } + public void setOrderFlag(Long orderFlag) + { + this.orderFlag = orderFlag; + } + + public Long getOrderFlag() + { + return orderFlag; + } + public void setDeviceRegister(String deviceRegister) + { + this.deviceRegister = deviceRegister; + } + + public String getDeviceRegister() + { + return deviceRegister; + } + public void setPropertyStep(BigDecimal propertyStep) + { + this.propertyStep = propertyStep; + } + + public BigDecimal getPropertyStep() + { + return propertyStep; + } + public void setPropertyField(String propertyField) + { + this.propertyField = propertyField; + } + + public String getPropertyField() + { + return propertyField; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("modeFunctionId", getModeFunctionId()) + .append("deviceModeId", getDeviceModeId()) + .append("functionMode", getFunctionMode()) + .append("coordinate", getCoordinate()) + .append("functionName", getFunctionName()) + .append("functionIdentifier", getFunctionIdentifier()) + .append("functionType", getFunctionType()) + .append("dataType", getDataType()) + .append("dataDefinition", getDataDefinition()) + .append("functionFormula", getFunctionFormula()) + .append("propertyUnit", getPropertyUnit()) + .append("displayFlag", getDisplayFlag()) + .append("rwFlag", getRwFlag()) + .append("invokeMethod", getInvokeMethod()) + .append("eventType", getEventType()) + .append("remark", getRemark()) + .append("acquisitionFormula", getAcquisitionFormula()) + .append("orderFlag", getOrderFlag()) + .append("deviceRegister", getDeviceRegister()) + .append("propertyStep", getPropertyStep()) + .append("propertyField", getPropertyField()) + .toString(); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwElectronicFence.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwElectronicFence.java new file mode 100644 index 0000000..9fe3f33 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwElectronicFence.java @@ -0,0 +1,224 @@ +package com.ruoyi.business.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 电子围栏对象 hw_electronic_fence + * + * @author xins + * @date 2023-09-04 + */ +public class HwElectronicFence extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 电子围栏ID */ + private Long electronicFenceId; + + /** 电子围栏名称 */ + @Excel(name = "电子围栏名称") + private String electronicFenceName; + + /** 所属场景,关联hw_scene表的scene_id字段 */ + @Excel(name = "所属场景,关联hw_scene表的scene_id字段") + private Long sceneId; + + /** 规则类型(1、设备,2、监控单元,3、场景) */ + @Excel(name = "规则类型", readConverterExp = "1=、设备,2、监控单元,3、场景") + private String fenceType; + + /** 生效时间标识(1、长期有效,2、时间范围) */ + @Excel(name = "生效时间标识", readConverterExp = "1=、长期有效,2、时间范围") + private String effectiveTimeFlag; + + /** 时区 */ + @Excel(name = "时区") + private String timeZone; + + /** 格式:开始时间_结束时间_状态,多个用|隔开(例如00:00_05:00_1|06:00_08:00_0),状态:(1、开启、2、关闭) */ + @Excel(name = "格式:开始时间_结束时间_状态,多个用|隔开", readConverterExp = "例=如00:00_05:00_1|06:00_08:00_0") + private String effectiveTime; + + /** 触发状态(0、关闭,1、出界,2、入界,3、双向) */ + @Excel(name = "触发状态", readConverterExp = "0=、关闭,1、出界,2、入界,3、双向") + private String triggerStatus; + + /** 区域形状(1、多边形,2、圆形) */ + @Excel(name = "区域形状", readConverterExp = "1=、多边形,2、圆形") + private String areaShapeFlag; + + /** 区域范围:为多边形时保存格式,经度_纬度,多个以|隔开;为圆形时的中心点和半径,下划线隔开 */ + @Excel(name = "区域范围:为多边形时保存格式,经度_纬度,多个以|隔开;为圆形时的中心点和半径,下划线隔开") + private String areaRange; + + /** 报警推送标识(1、是,0、否) */ + @Excel(name = "报警推送标识(1、是,0、否)") + private String fencePushFlag; + + /** 报警推送内容 */ + @Excel(name = "报警推送内容") + private String fencePushContent; + + /** 恢复正常推送内容 */ + @Excel(name = "恢复正常推送内容") + private String fenceRecoverContent; + + /** 预留字段 */ + @Excel(name = "预留字段") + private String fenceField; + + public void setElectronicFenceId(Long electronicFenceId) + { + this.electronicFenceId = electronicFenceId; + } + + public Long getElectronicFenceId() + { + return electronicFenceId; + } + public void setElectronicFenceName(String electronicFenceName) + { + this.electronicFenceName = electronicFenceName; + } + + public String getElectronicFenceName() + { + return electronicFenceName; + } + public void setSceneId(Long sceneId) + { + this.sceneId = sceneId; + } + + public Long getSceneId() + { + return sceneId; + } + public void setFenceType(String fenceType) + { + this.fenceType = fenceType; + } + + public String getFenceType() + { + return fenceType; + } + public void setEffectiveTimeFlag(String effectiveTimeFlag) + { + this.effectiveTimeFlag = effectiveTimeFlag; + } + + public String getEffectiveTimeFlag() + { + return effectiveTimeFlag; + } + public void setTimeZone(String timeZone) + { + this.timeZone = timeZone; + } + + public String getTimeZone() + { + return timeZone; + } + public void setEffectiveTime(String effectiveTime) + { + this.effectiveTime = effectiveTime; + } + + public String getEffectiveTime() + { + return effectiveTime; + } + public void setTriggerStatus(String triggerStatus) + { + this.triggerStatus = triggerStatus; + } + + public String getTriggerStatus() + { + return triggerStatus; + } + public void setAreaShapeFlag(String areaShapeFlag) + { + this.areaShapeFlag = areaShapeFlag; + } + + public String getAreaShapeFlag() + { + return areaShapeFlag; + } + public void setAreaRange(String areaRange) + { + this.areaRange = areaRange; + } + + public String getAreaRange() + { + return areaRange; + } + public void setFencePushFlag(String fencePushFlag) + { + this.fencePushFlag = fencePushFlag; + } + + public String getFencePushFlag() + { + return fencePushFlag; + } + public void setFencePushContent(String fencePushContent) + { + this.fencePushContent = fencePushContent; + } + + public String getFencePushContent() + { + return fencePushContent; + } + public void setFenceRecoverContent(String fenceRecoverContent) + { + this.fenceRecoverContent = fenceRecoverContent; + } + + public String getFenceRecoverContent() + { + return fenceRecoverContent; + } + public void setFenceField(String fenceField) + { + this.fenceField = fenceField; + } + + public String getFenceField() + { + return fenceField; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("electronicFenceId", getElectronicFenceId()) + .append("electronicFenceName", getElectronicFenceName()) + .append("sceneId", getSceneId()) + .append("fenceType", getFenceType()) + .append("effectiveTimeFlag", getEffectiveTimeFlag()) + .append("timeZone", getTimeZone()) + .append("effectiveTime", getEffectiveTime()) + .append("triggerStatus", getTriggerStatus()) + .append("areaShapeFlag", getAreaShapeFlag()) + .append("areaRange", getAreaRange()) + .append("fencePushFlag", getFencePushFlag()) + .append("fencePushContent", getFencePushContent()) + .append("fenceRecoverContent", getFenceRecoverContent()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("fenceField", getFenceField()) + .toString(); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwFenceTarget.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwFenceTarget.java new file mode 100644 index 0000000..0088e75 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwFenceTarget.java @@ -0,0 +1,66 @@ +package com.ruoyi.business.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 电子围栏目标对象 hw_fence_target + * + * @author xins + * @date 2023-09-04 + */ +public class HwFenceTarget extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 电子围栏ID */ + @Excel(name = "电子围栏ID") + private Long electronicFenceId; + + /** 目标类型(1、设备,2、监控单元) */ + @Excel(name = "目标类型", readConverterExp = "1=、设备,2、监控单元") + private String targetType; + + /** target_type为1时,关联表hw_device字段device_id +target_type为2时,关联表hw_monitor_unit字段monitor_unit_id */ + private Long targetId; + + public void setElectronicFenceId(Long electronicFenceId) + { + this.electronicFenceId = electronicFenceId; + } + + public Long getElectronicFenceId() + { + return electronicFenceId; + } + public void setTargetType(String targetType) + { + this.targetType = targetType; + } + + public String getTargetType() + { + return targetType; + } + public void setTargetId(Long targetId) + { + this.targetId = targetId; + } + + public Long getTargetId() + { + return targetId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("electronicFenceId", getElectronicFenceId()) + .append("targetType", getTargetType()) + .append("targetId", getTargetId()) + .toString(); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwMonitorUnit.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwMonitorUnit.java new file mode 100644 index 0000000..e2bcd05 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwMonitorUnit.java @@ -0,0 +1,183 @@ +package com.ruoyi.business.domain; + +import java.math.BigDecimal; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 监控单元对象 hw_monitor_unit + * + * @author YINQ + * @date 2023-08-31 + */ +public class HwMonitorUnit extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 监控单元ID */ + private Long monitorUnitId; + + /** 监控单元名称 */ + @Excel(name = "监控单元名称") + private String monitorUnitName; + + /** 所属场景 */ + @Excel(name = "所属场景") + private Long sceneId; + + /** 父级监控单元ID */ + @Excel(name = "父级监控单元ID") + private Long parentId; + + /** 监控单元类型ID */ + @Excel(name = "监控单元类型ID") + private Long monitorUnitTypeId; + + /** 区域ID */ + @Excel(name = "区域ID") + private Long areaId; + + /** 详细地址 */ + @Excel(name = "详细地址") + private String monitorAddress; + + /** 监控单元图片地址 */ + @Excel(name = "监控单元图片地址") + private String monitorPic; + + /** 保存周期 */ + @Excel(name = "保存周期") + private BigDecimal preserveTime; + + /** 状态 */ + @Excel(name = "状态") + private Long monitorUnitStatus; + + /** 预留字段 */ + @Excel(name = "预留字段") + private String monitorUnitField; + + public void setMonitorUnitId(Long monitorUnitId) + { + this.monitorUnitId = monitorUnitId; + } + + public Long getMonitorUnitId() + { + return monitorUnitId; + } + public void setMonitorUnitName(String monitorUnitName) + { + this.monitorUnitName = monitorUnitName; + } + + public String getMonitorUnitName() + { + return monitorUnitName; + } + public void setSceneId(Long sceneId) + { + this.sceneId = sceneId; + } + + public Long getSceneId() + { + return sceneId; + } + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + public Long getParentId() + { + return parentId; + } + public void setMonitorUnitTypeId(Long monitorUnitTypeId) + { + this.monitorUnitTypeId = monitorUnitTypeId; + } + + public Long getMonitorUnitTypeId() + { + return monitorUnitTypeId; + } + public void setAreaId(Long areaId) + { + this.areaId = areaId; + } + + public Long getAreaId() + { + return areaId; + } + public void setMonitorAddress(String monitorAddress) + { + this.monitorAddress = monitorAddress; + } + + public String getMonitorAddress() + { + return monitorAddress; + } + public void setMonitorPic(String monitorPic) + { + this.monitorPic = monitorPic; + } + + public String getMonitorPic() + { + return monitorPic; + } + public void setPreserveTime(BigDecimal preserveTime) + { + this.preserveTime = preserveTime; + } + + public BigDecimal getPreserveTime() + { + return preserveTime; + } + public void setMonitorUnitStatus(Long monitorUnitStatus) + { + this.monitorUnitStatus = monitorUnitStatus; + } + + public Long getMonitorUnitStatus() + { + return monitorUnitStatus; + } + public void setMonitorUnitField(String monitorUnitField) + { + this.monitorUnitField = monitorUnitField; + } + + public String getMonitorUnitField() + { + return monitorUnitField; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("monitorUnitId", getMonitorUnitId()) + .append("monitorUnitName", getMonitorUnitName()) + .append("sceneId", getSceneId()) + .append("parentId", getParentId()) + .append("monitorUnitTypeId", getMonitorUnitTypeId()) + .append("areaId", getAreaId()) + .append("monitorAddress", getMonitorAddress()) + .append("monitorPic", getMonitorPic()) + .append("preserveTime", getPreserveTime()) + .append("remark", getRemark()) + .append("monitorUnitStatus", getMonitorUnitStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("monitorUnitField", getMonitorUnitField()) + .toString(); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwMonitorUnitType.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwMonitorUnitType.java new file mode 100644 index 0000000..71a051b --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwMonitorUnitType.java @@ -0,0 +1,154 @@ +package com.ruoyi.business.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 监控单元类型对象 hw_monitor_unit_type + * + * @author YINQ + * @date 2023-08-31 + */ +public class HwMonitorUnitType extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 监控单元类型ID */ + private Long monitorUnitTypeId; + + /** 监控单元类型名称 */ + @Excel(name = "监控单元类型名称") + private String monitorUnitTypeName; + + /** 虚拟标识 */ + @Excel(name = "虚拟标识") + private String vitualFlag; + + /** 状态 */ + @Excel(name = "状态") + private String monitorUnitTypeStatus; + + /** 语言code */ + @Excel(name = "语言code") + private String languageCode; + + /** 通用标识(1:是,0:否) */ + @Excel(name = "通用标识", readConverterExp = "1=:是,0:否") + private String commonFlag; + + /** 所属场景 */ + @Excel(name = "所属场景") + private Long sceneId; + + /** 监控单元类型图标 */ + @Excel(name = "监控单元类型图标") + private String unitTypeIcon; + + /** 预留字段 */ + @Excel(name = "预留字段") + private String unitTypeField; + + public void setMonitorUnitTypeId(Long monitorUnitTypeId) + { + this.monitorUnitTypeId = monitorUnitTypeId; + } + + public Long getMonitorUnitTypeId() + { + return monitorUnitTypeId; + } + public void setMonitorUnitTypeName(String monitorUnitTypeName) + { + this.monitorUnitTypeName = monitorUnitTypeName; + } + + public String getMonitorUnitTypeName() + { + return monitorUnitTypeName; + } + public void setVitualFlag(String vitualFlag) + { + this.vitualFlag = vitualFlag; + } + + public String getVitualFlag() + { + return vitualFlag; + } + public void setMonitorUnitTypeStatus(String monitorUnitTypeStatus) + { + this.monitorUnitTypeStatus = monitorUnitTypeStatus; + } + + public String getMonitorUnitTypeStatus() + { + return monitorUnitTypeStatus; + } + public void setLanguageCode(String languageCode) + { + this.languageCode = languageCode; + } + + public String getLanguageCode() + { + return languageCode; + } + public void setCommonFlag(String commonFlag) + { + this.commonFlag = commonFlag; + } + + public String getCommonFlag() + { + return commonFlag; + } + public void setSceneId(Long sceneId) + { + this.sceneId = sceneId; + } + + public Long getSceneId() + { + return sceneId; + } + public void setUnitTypeIcon(String unitTypeIcon) + { + this.unitTypeIcon = unitTypeIcon; + } + + public String getUnitTypeIcon() + { + return unitTypeIcon; + } + public void setUnitTypeField(String unitTypeField) + { + this.unitTypeField = unitTypeField; + } + + public String getUnitTypeField() + { + return unitTypeField; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("monitorUnitTypeId", getMonitorUnitTypeId()) + .append("monitorUnitTypeName", getMonitorUnitTypeName()) + .append("vitualFlag", getVitualFlag()) + .append("monitorUnitTypeStatus", getMonitorUnitTypeStatus()) + .append("languageCode", getLanguageCode()) + .append("commonFlag", getCommonFlag()) + .append("sceneId", getSceneId()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("unitTypeIcon", getUnitTypeIcon()) + .append("unitTypeField", getUnitTypeField()) + .toString(); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwSceneMode.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwSceneMode.java new file mode 100644 index 0000000..d789ab5 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwSceneMode.java @@ -0,0 +1,126 @@ +package com.ruoyi.business.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 场景类型对象 hw_scene_mode + * + * @author YINQ + * @date 2023-08-31 + */ +public class HwSceneMode extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 类型ID */ + private Long sceneModeId; + + /** 类型名称 */ + @Excel(name = "类型名称") + private String sceneModeName; + + /** 自定义标识 */ + @Excel(name = "自定义标识") + private Long customFlag; + + /** 租户ID */ + @Excel(name = "租户ID") + private Long tenantId; + + /** 语言code */ + @Excel(name = "语言code") + private String languageCode; + + /** 状态 */ + @Excel(name = "状态") + private Long sceneModeStatus; + + /** 预留字段 */ + @Excel(name = "预留字段") + private String sceneModeField; + + public void setSceneModeId(Long sceneModeId) + { + this.sceneModeId = sceneModeId; + } + + public Long getSceneModeId() + { + return sceneModeId; + } + public void setSceneModeName(String sceneModeName) + { + this.sceneModeName = sceneModeName; + } + + public String getSceneModeName() + { + return sceneModeName; + } + public void setCustomFlag(Long customFlag) + { + this.customFlag = customFlag; + } + + public Long getCustomFlag() + { + return customFlag; + } + public void setTenantId(Long tenantId) + { + this.tenantId = tenantId; + } + + public Long getTenantId() + { + return tenantId; + } + public void setLanguageCode(String languageCode) + { + this.languageCode = languageCode; + } + + public String getLanguageCode() + { + return languageCode; + } + public void setSceneModeStatus(Long sceneModeStatus) + { + this.sceneModeStatus = sceneModeStatus; + } + + public Long getSceneModeStatus() + { + return sceneModeStatus; + } + public void setSceneModeField(String sceneModeField) + { + this.sceneModeField = sceneModeField; + } + + public String getSceneModeField() + { + return sceneModeField; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("sceneModeId", getSceneModeId()) + .append("sceneModeName", getSceneModeName()) + .append("customFlag", getCustomFlag()) + .append("tenantId", getTenantId()) + .append("languageCode", getLanguageCode()) + .append("remark", getRemark()) + .append("sceneModeStatus", getSceneModeStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("sceneModeField", getSceneModeField()) + .toString(); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwTenant.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwTenant.java new file mode 100644 index 0000000..7d0d79b --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwTenant.java @@ -0,0 +1,210 @@ +package com.ruoyi.business.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 租户信息对象 hw_tenant + * + * @author xins + * @date 2023-09-04 + */ +public class HwTenant extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 租户ID */ + private Long tenantId; + + /** 租户类型,(1、企业,2、个人) */ + @Excel(name = "租户类型,(1、企业,2、个人)") + private String tenantType; + + /** 租户名称 */ + @Excel(name = "租户名称") + private String tenantName; + + /** 行业类型,关联sys_dict_data的dict_type是hw_tenant_industry的dict_value */ + @Excel(name = "行业类型,关联sys_dict_data的dict_type是hw_tenant_industry的dict_value") + private Long tenantIndustry; + + /** 联系人姓名 */ + @Excel(name = "联系人姓名") + private String contactName; + + /** 联系人电话 */ + @Excel(name = "联系人电话") + private String contactPhone; + + /** 邮箱地址 */ + @Excel(name = "邮箱地址") + private String email; + + /** 区域ID,管理区域hw_area */ + @Excel(name = "区域ID,管理区域hw_area") + private Long areaId; + + /** 联系人地址 */ + @Excel(name = "联系人地址") + private String contactAddress; + + /** 状态(1、正常 9、删除) */ + @Excel(name = "状态", readConverterExp = "1=、正常,9=、删除") + private String tenantStatus; + + /** 是否外部注册(1、是 0、否) */ + @Excel(name = "是否外部注册", readConverterExp = "1=、是,0=、否") + private String isRegister; + + /** 租户等级,预留字段 */ + @Excel(name = "租户等级,预留字段") + private Long tenantGrade; + + /** 预留字段 */ + @Excel(name = "预留字段") + private String tenantField; + + public void setTenantId(Long tenantId) + { + this.tenantId = tenantId; + } + + public Long getTenantId() + { + return tenantId; + } + public void setTenantType(String tenantType) + { + this.tenantType = tenantType; + } + + public String getTenantType() + { + return tenantType; + } + public void setTenantName(String tenantName) + { + this.tenantName = tenantName; + } + + public String getTenantName() + { + return tenantName; + } + public void setTenantIndustry(Long tenantIndustry) + { + this.tenantIndustry = tenantIndustry; + } + + public Long getTenantIndustry() + { + return tenantIndustry; + } + public void setContactName(String contactName) + { + this.contactName = contactName; + } + + public String getContactName() + { + return contactName; + } + public void setContactPhone(String contactPhone) + { + this.contactPhone = contactPhone; + } + + public String getContactPhone() + { + return contactPhone; + } + public void setEmail(String email) + { + this.email = email; + } + + public String getEmail() + { + return email; + } + public void setAreaId(Long areaId) + { + this.areaId = areaId; + } + + public Long getAreaId() + { + return areaId; + } + public void setContactAddress(String contactAddress) + { + this.contactAddress = contactAddress; + } + + public String getContactAddress() + { + return contactAddress; + } + public void setTenantStatus(String tenantStatus) + { + this.tenantStatus = tenantStatus; + } + + public String getTenantStatus() + { + return tenantStatus; + } + public void setIsRegister(String isRegister) + { + this.isRegister = isRegister; + } + + public String getIsRegister() + { + return isRegister; + } + public void setTenantGrade(Long tenantGrade) + { + this.tenantGrade = tenantGrade; + } + + public Long getTenantGrade() + { + return tenantGrade; + } + public void setTenantField(String tenantField) + { + this.tenantField = tenantField; + } + + public String getTenantField() + { + return tenantField; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("tenantId", getTenantId()) + .append("tenantType", getTenantType()) + .append("tenantName", getTenantName()) + .append("tenantIndustry", getTenantIndustry()) + .append("contactName", getContactName()) + .append("contactPhone", getContactPhone()) + .append("email", getEmail()) + .append("areaId", getAreaId()) + .append("contactAddress", getContactAddress()) + .append("remark", getRemark()) + .append("tenantStatus", getTenantStatus()) + .append("isRegister", getIsRegister()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("tenantGrade", getTenantGrade()) + .append("tenantField", getTenantField()) + .toString(); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceModeFunctionMapper.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceModeFunctionMapper.java new file mode 100644 index 0000000..380cea6 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceModeFunctionMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.ruoyi.business.domain.HwDeviceModeFunction; + +/** + * 设备模型功能Mapper接口 + * + * @author xins + * @date 2023-09-05 + */ +public interface HwDeviceModeFunctionMapper +{ + /** + * 查询设备模型功能 + * + * @param modeFunctionId 设备模型功能主键 + * @return 设备模型功能 + */ + public HwDeviceModeFunction selectHwDeviceModeFunctionByModeFunctionId(Long modeFunctionId); + + /** + * 查询设备模型功能列表 + * + * @param hwDeviceModeFunction 设备模型功能 + * @return 设备模型功能集合 + */ + public List selectHwDeviceModeFunctionList(HwDeviceModeFunction hwDeviceModeFunction); + + /** + * 新增设备模型功能 + * + * @param hwDeviceModeFunction 设备模型功能 + * @return 结果 + */ + public int insertHwDeviceModeFunction(HwDeviceModeFunction hwDeviceModeFunction); + + /** + * 修改设备模型功能 + * + * @param hwDeviceModeFunction 设备模型功能 + * @return 结果 + */ + public int updateHwDeviceModeFunction(HwDeviceModeFunction hwDeviceModeFunction); + + /** + * 删除设备模型功能 + * + * @param modeFunctionId 设备模型功能主键 + * @return 结果 + */ + public int deleteHwDeviceModeFunctionByModeFunctionId(Long modeFunctionId); + + /** + * 批量删除设备模型功能 + * + * @param modeFunctionIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteHwDeviceModeFunctionByModeFunctionIds(Long[] modeFunctionIds); +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceModeMapper.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceModeMapper.java new file mode 100644 index 0000000..52b6ce8 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwDeviceModeMapper.java @@ -0,0 +1,87 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.ruoyi.business.domain.HwDeviceMode; +import com.ruoyi.business.domain.HwDeviceModeFunction; + +/** + * 设备模型Mapper接口 + * + * @author xins + * @date 2023-09-04 + */ +public interface HwDeviceModeMapper +{ + /** + * 查询设备模型 + * + * @param deviceModeId 设备模型主键 + * @return 设备模型 + */ + public HwDeviceMode selectHwDeviceModeByDeviceModeId(Long deviceModeId); + + /** + * 查询设备模型列表 + * + * @param hwDeviceMode 设备模型 + * @return 设备模型集合 + */ + public List selectHwDeviceModeList(HwDeviceMode hwDeviceMode); + + /** + * 新增设备模型 + * + * @param hwDeviceMode 设备模型 + * @return 结果 + */ + public int insertHwDeviceMode(HwDeviceMode hwDeviceMode); + + /** + * 修改设备模型 + * + * @param hwDeviceMode 设备模型 + * @return 结果 + */ + public int updateHwDeviceMode(HwDeviceMode hwDeviceMode); + + /** + * 删除设备模型 + * + * @param deviceModeId 设备模型主键 + * @return 结果 + */ + public int deleteHwDeviceModeByDeviceModeId(Long deviceModeId); + + /** + * 批量删除设备模型 + * + * @param deviceModeIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteHwDeviceModeByDeviceModeIds(Long[] deviceModeIds); + + /** + * 批量删除设备模型功能 + * + * @param deviceModeIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteHwDeviceModeFunctionByDeviceModeIds(Long[] deviceModeIds); + + /** + * 批量新增设备模型功能 + * + * @param hwDeviceModeFunctionList 设备模型功能列表 + * @return 结果 + */ + public int batchHwDeviceModeFunction(List hwDeviceModeFunctionList); + + + /** + * 通过设备模型主键删除设备模型功能信息 + * + * @param deviceModeId 设备模型ID + * @return 结果 + */ + public int deleteHwDeviceModeFunctionByDeviceModeId(Long deviceModeId); +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwElectronicFenceMapper.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwElectronicFenceMapper.java new file mode 100644 index 0000000..9abc269 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwElectronicFenceMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.ruoyi.business.domain.HwElectronicFence; + +/** + * 电子围栏Mapper接口 + * + * @author xins + * @date 2023-09-04 + */ +public interface HwElectronicFenceMapper +{ + /** + * 查询电子围栏 + * + * @param electronicFenceId 电子围栏主键 + * @return 电子围栏 + */ + public HwElectronicFence selectHwElectronicFenceByElectronicFenceId(Long electronicFenceId); + + /** + * 查询电子围栏列表 + * + * @param hwElectronicFence 电子围栏 + * @return 电子围栏集合 + */ + public List selectHwElectronicFenceList(HwElectronicFence hwElectronicFence); + + /** + * 新增电子围栏 + * + * @param hwElectronicFence 电子围栏 + * @return 结果 + */ + public int insertHwElectronicFence(HwElectronicFence hwElectronicFence); + + /** + * 修改电子围栏 + * + * @param hwElectronicFence 电子围栏 + * @return 结果 + */ + public int updateHwElectronicFence(HwElectronicFence hwElectronicFence); + + /** + * 删除电子围栏 + * + * @param electronicFenceId 电子围栏主键 + * @return 结果 + */ + public int deleteHwElectronicFenceByElectronicFenceId(Long electronicFenceId); + + /** + * 批量删除电子围栏 + * + * @param electronicFenceIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteHwElectronicFenceByElectronicFenceIds(Long[] electronicFenceIds); +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwFenceTargetMapper.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwFenceTargetMapper.java new file mode 100644 index 0000000..c2cb8e7 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwFenceTargetMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.ruoyi.business.domain.HwFenceTarget; + +/** + * 电子围栏目标Mapper接口 + * + * @author xins + * @date 2023-09-04 + */ +public interface HwFenceTargetMapper +{ + /** + * 查询电子围栏目标 + * + * @param targetId 电子围栏目标主键 + * @return 电子围栏目标 + */ + public HwFenceTarget selectHwFenceTargetByTargetId(Long targetId); + + /** + * 查询电子围栏目标列表 + * + * @param hwFenceTarget 电子围栏目标 + * @return 电子围栏目标集合 + */ + public List selectHwFenceTargetList(HwFenceTarget hwFenceTarget); + + /** + * 新增电子围栏目标 + * + * @param hwFenceTarget 电子围栏目标 + * @return 结果 + */ + public int insertHwFenceTarget(HwFenceTarget hwFenceTarget); + + /** + * 修改电子围栏目标 + * + * @param hwFenceTarget 电子围栏目标 + * @return 结果 + */ + public int updateHwFenceTarget(HwFenceTarget hwFenceTarget); + + /** + * 删除电子围栏目标 + * + * @param targetId 电子围栏目标主键 + * @return 结果 + */ + public int deleteHwFenceTargetByTargetId(Long targetId); + + /** + * 批量删除电子围栏目标 + * + * @param targetIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteHwFenceTargetByTargetIds(Long[] targetIds); +} 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 new file mode 100644 index 0000000..d3357a6 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwMonitorUnitMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.ruoyi.business.domain.HwMonitorUnit; + +/** + * 监控单元Mapper接口 + * + * @author YINQ + * @date 2023-08-31 + */ +public interface HwMonitorUnitMapper +{ + /** + * 查询监控单元 + * + * @param monitorUnitId 监控单元主键 + * @return 监控单元 + */ + public HwMonitorUnit selectHwMonitorUnitByMonitorUnitId(Long monitorUnitId); + + /** + * 查询监控单元列表 + * + * @param hwMonitorUnit 监控单元 + * @return 监控单元集合 + */ + public List selectHwMonitorUnitList(HwMonitorUnit hwMonitorUnit); + + /** + * 新增监控单元 + * + * @param hwMonitorUnit 监控单元 + * @return 结果 + */ + public int insertHwMonitorUnit(HwMonitorUnit hwMonitorUnit); + + /** + * 修改监控单元 + * + * @param hwMonitorUnit 监控单元 + * @return 结果 + */ + public int updateHwMonitorUnit(HwMonitorUnit hwMonitorUnit); + + /** + * 删除监控单元 + * + * @param monitorUnitId 监控单元主键 + * @return 结果 + */ + public int deleteHwMonitorUnitByMonitorUnitId(Long monitorUnitId); + + /** + * 批量删除监控单元 + * + * @param monitorUnitIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteHwMonitorUnitByMonitorUnitIds(Long[] monitorUnitIds); +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwMonitorUnitTypeMapper.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwMonitorUnitTypeMapper.java new file mode 100644 index 0000000..8494d32 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwMonitorUnitTypeMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.ruoyi.business.domain.HwMonitorUnitType; + +/** + * 监控单元类型Mapper接口 + * + * @author YINQ + * @date 2023-08-31 + */ +public interface HwMonitorUnitTypeMapper +{ + /** + * 查询监控单元类型 + * + * @param monitorUnitTypeId 监控单元类型主键 + * @return 监控单元类型 + */ + public HwMonitorUnitType selectHwMonitorUnitTypeByMonitorUnitTypeId(Long monitorUnitTypeId); + + /** + * 查询监控单元类型列表 + * + * @param hwMonitorUnitType 监控单元类型 + * @return 监控单元类型集合 + */ + public List selectHwMonitorUnitTypeList(HwMonitorUnitType hwMonitorUnitType); + + /** + * 新增监控单元类型 + * + * @param hwMonitorUnitType 监控单元类型 + * @return 结果 + */ + public int insertHwMonitorUnitType(HwMonitorUnitType hwMonitorUnitType); + + /** + * 修改监控单元类型 + * + * @param hwMonitorUnitType 监控单元类型 + * @return 结果 + */ + public int updateHwMonitorUnitType(HwMonitorUnitType hwMonitorUnitType); + + /** + * 删除监控单元类型 + * + * @param monitorUnitTypeId 监控单元类型主键 + * @return 结果 + */ + public int deleteHwMonitorUnitTypeByMonitorUnitTypeId(Long monitorUnitTypeId); + + /** + * 批量删除监控单元类型 + * + * @param monitorUnitTypeIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteHwMonitorUnitTypeByMonitorUnitTypeIds(Long[] monitorUnitTypeIds); +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwSceneModeMapper.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwSceneModeMapper.java new file mode 100644 index 0000000..971dc03 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwSceneModeMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.ruoyi.business.domain.HwSceneMode; + +/** + * 场景类型Mapper接口 + * + * @author YINQ + * @date 2023-08-31 + */ +public interface HwSceneModeMapper +{ + /** + * 查询场景类型 + * + * @param sceneModeId 场景类型主键 + * @return 场景类型 + */ + public HwSceneMode selectHwSceneModeBySceneModeId(Long sceneModeId); + + /** + * 查询场景类型列表 + * + * @param hwSceneMode 场景类型 + * @return 场景类型集合 + */ + public List selectHwSceneModeList(HwSceneMode hwSceneMode); + + /** + * 新增场景类型 + * + * @param hwSceneMode 场景类型 + * @return 结果 + */ + public int insertHwSceneMode(HwSceneMode hwSceneMode); + + /** + * 修改场景类型 + * + * @param hwSceneMode 场景类型 + * @return 结果 + */ + public int updateHwSceneMode(HwSceneMode hwSceneMode); + + /** + * 删除场景类型 + * + * @param sceneModeId 场景类型主键 + * @return 结果 + */ + public int deleteHwSceneModeBySceneModeId(Long sceneModeId); + + /** + * 批量删除场景类型 + * + * @param sceneModeIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteHwSceneModeBySceneModeIds(Long[] sceneModeIds); +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwTenantMapper.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwTenantMapper.java new file mode 100644 index 0000000..fe96e2f --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/mapper/HwTenantMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.ruoyi.business.domain.HwTenant; + +/** + * 租户信息Mapper接口 + * + * @author xins + * @date 2023-09-04 + */ +public interface HwTenantMapper +{ + /** + * 查询租户信息 + * + * @param tenantId 租户信息主键 + * @return 租户信息 + */ + public HwTenant selectHwTenantByTenantId(Long tenantId); + + /** + * 查询租户信息列表 + * + * @param hwTenant 租户信息 + * @return 租户信息集合 + */ + public List selectHwTenantList(HwTenant hwTenant); + + /** + * 新增租户信息 + * + * @param hwTenant 租户信息 + * @return 结果 + */ + public int insertHwTenant(HwTenant hwTenant); + + /** + * 修改租户信息 + * + * @param hwTenant 租户信息 + * @return 结果 + */ + public int updateHwTenant(HwTenant hwTenant); + + /** + * 删除租户信息 + * + * @param tenantId 租户信息主键 + * @return 结果 + */ + public int deleteHwTenantByTenantId(Long tenantId); + + /** + * 批量删除租户信息 + * + * @param tenantIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteHwTenantByTenantIds(Long[] tenantIds); +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwDeviceModeFunctionService.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwDeviceModeFunctionService.java new file mode 100644 index 0000000..b524c96 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwDeviceModeFunctionService.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.HwDeviceModeFunction; + +/** + * 设备模型功能Service接口 + * + * @author xins + * @date 2023-09-05 + */ +public interface IHwDeviceModeFunctionService +{ + /** + * 查询设备模型功能 + * + * @param modeFunctionId 设备模型功能主键 + * @return 设备模型功能 + */ + public HwDeviceModeFunction selectHwDeviceModeFunctionByModeFunctionId(Long modeFunctionId); + + /** + * 查询设备模型功能列表 + * + * @param hwDeviceModeFunction 设备模型功能 + * @return 设备模型功能集合 + */ + public List selectHwDeviceModeFunctionList(HwDeviceModeFunction hwDeviceModeFunction); + + /** + * 新增设备模型功能 + * + * @param hwDeviceModeFunction 设备模型功能 + * @return 结果 + */ + public int insertHwDeviceModeFunction(HwDeviceModeFunction hwDeviceModeFunction); + + /** + * 修改设备模型功能 + * + * @param hwDeviceModeFunction 设备模型功能 + * @return 结果 + */ + public int updateHwDeviceModeFunction(HwDeviceModeFunction hwDeviceModeFunction); + + /** + * 批量删除设备模型功能 + * + * @param modeFunctionIds 需要删除的设备模型功能主键集合 + * @return 结果 + */ + public int deleteHwDeviceModeFunctionByModeFunctionIds(Long[] modeFunctionIds); + + /** + * 删除设备模型功能信息 + * + * @param modeFunctionId 设备模型功能主键 + * @return 结果 + */ + public int deleteHwDeviceModeFunctionByModeFunctionId(Long modeFunctionId); +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwDeviceModeService.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwDeviceModeService.java new file mode 100644 index 0000000..c83ce6a --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwDeviceModeService.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.HwDeviceMode; + +/** + * 设备模型Service接口 + * + * @author xins + * @date 2023-09-04 + */ +public interface IHwDeviceModeService +{ + /** + * 查询设备模型 + * + * @param deviceModeId 设备模型主键 + * @return 设备模型 + */ + public HwDeviceMode selectHwDeviceModeByDeviceModeId(Long deviceModeId); + + /** + * 查询设备模型列表 + * + * @param hwDeviceMode 设备模型 + * @return 设备模型集合 + */ + public List selectHwDeviceModeList(HwDeviceMode hwDeviceMode); + + /** + * 新增设备模型 + * + * @param hwDeviceMode 设备模型 + * @return 结果 + */ + public int insertHwDeviceMode(HwDeviceMode hwDeviceMode); + + /** + * 修改设备模型 + * + * @param hwDeviceMode 设备模型 + * @return 结果 + */ + public int updateHwDeviceMode(HwDeviceMode hwDeviceMode); + + /** + * 批量删除设备模型 + * + * @param deviceModeIds 需要删除的设备模型主键集合 + * @return 结果 + */ + public int deleteHwDeviceModeByDeviceModeIds(Long[] deviceModeIds); + + /** + * 删除设备模型信息 + * + * @param deviceModeId 设备模型主键 + * @return 结果 + */ + public int deleteHwDeviceModeByDeviceModeId(Long deviceModeId); +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwElectronicFenceService.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwElectronicFenceService.java new file mode 100644 index 0000000..2f340b0 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwElectronicFenceService.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.HwElectronicFence; + +/** + * 电子围栏Service接口 + * + * @author xins + * @date 2023-09-04 + */ +public interface IHwElectronicFenceService +{ + /** + * 查询电子围栏 + * + * @param electronicFenceId 电子围栏主键 + * @return 电子围栏 + */ + public HwElectronicFence selectHwElectronicFenceByElectronicFenceId(Long electronicFenceId); + + /** + * 查询电子围栏列表 + * + * @param hwElectronicFence 电子围栏 + * @return 电子围栏集合 + */ + public List selectHwElectronicFenceList(HwElectronicFence hwElectronicFence); + + /** + * 新增电子围栏 + * + * @param hwElectronicFence 电子围栏 + * @return 结果 + */ + public int insertHwElectronicFence(HwElectronicFence hwElectronicFence); + + /** + * 修改电子围栏 + * + * @param hwElectronicFence 电子围栏 + * @return 结果 + */ + public int updateHwElectronicFence(HwElectronicFence hwElectronicFence); + + /** + * 批量删除电子围栏 + * + * @param electronicFenceIds 需要删除的电子围栏主键集合 + * @return 结果 + */ + public int deleteHwElectronicFenceByElectronicFenceIds(Long[] electronicFenceIds); + + /** + * 删除电子围栏信息 + * + * @param electronicFenceId 电子围栏主键 + * @return 结果 + */ + public int deleteHwElectronicFenceByElectronicFenceId(Long electronicFenceId); +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwFenceTargetService.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwFenceTargetService.java new file mode 100644 index 0000000..26b77d0 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwFenceTargetService.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.HwFenceTarget; + +/** + * 电子围栏目标Service接口 + * + * @author xins + * @date 2023-09-04 + */ +public interface IHwFenceTargetService +{ + /** + * 查询电子围栏目标 + * + * @param targetId 电子围栏目标主键 + * @return 电子围栏目标 + */ + public HwFenceTarget selectHwFenceTargetByTargetId(Long targetId); + + /** + * 查询电子围栏目标列表 + * + * @param hwFenceTarget 电子围栏目标 + * @return 电子围栏目标集合 + */ + public List selectHwFenceTargetList(HwFenceTarget hwFenceTarget); + + /** + * 新增电子围栏目标 + * + * @param hwFenceTarget 电子围栏目标 + * @return 结果 + */ + public int insertHwFenceTarget(HwFenceTarget hwFenceTarget); + + /** + * 修改电子围栏目标 + * + * @param hwFenceTarget 电子围栏目标 + * @return 结果 + */ + public int updateHwFenceTarget(HwFenceTarget hwFenceTarget); + + /** + * 批量删除电子围栏目标 + * + * @param targetIds 需要删除的电子围栏目标主键集合 + * @return 结果 + */ + public int deleteHwFenceTargetByTargetIds(Long[] targetIds); + + /** + * 删除电子围栏目标信息 + * + * @param targetId 电子围栏目标主键 + * @return 结果 + */ + public int deleteHwFenceTargetByTargetId(Long targetId); +} 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 new file mode 100644 index 0000000..32d5c29 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwMonitorUnitService.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.HwMonitorUnit; + +/** + * 监控单元Service接口 + * + * @author YINQ + * @date 2023-08-31 + */ +public interface IHwMonitorUnitService +{ + /** + * 查询监控单元 + * + * @param monitorUnitId 监控单元主键 + * @return 监控单元 + */ + public HwMonitorUnit selectHwMonitorUnitByMonitorUnitId(Long monitorUnitId); + + /** + * 查询监控单元列表 + * + * @param hwMonitorUnit 监控单元 + * @return 监控单元集合 + */ + public List selectHwMonitorUnitList(HwMonitorUnit hwMonitorUnit); + + /** + * 新增监控单元 + * + * @param hwMonitorUnit 监控单元 + * @return 结果 + */ + public int insertHwMonitorUnit(HwMonitorUnit hwMonitorUnit); + + /** + * 修改监控单元 + * + * @param hwMonitorUnit 监控单元 + * @return 结果 + */ + public int updateHwMonitorUnit(HwMonitorUnit hwMonitorUnit); + + /** + * 批量删除监控单元 + * + * @param monitorUnitIds 需要删除的监控单元主键集合 + * @return 结果 + */ + public int deleteHwMonitorUnitByMonitorUnitIds(Long[] monitorUnitIds); + + /** + * 删除监控单元信息 + * + * @param monitorUnitId 监控单元主键 + * @return 结果 + */ + public int deleteHwMonitorUnitByMonitorUnitId(Long monitorUnitId); +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwMonitorUnitTypeService.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwMonitorUnitTypeService.java new file mode 100644 index 0000000..27db2f5 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwMonitorUnitTypeService.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.HwMonitorUnitType; + +/** + * 监控单元类型Service接口 + * + * @author YINQ + * @date 2023-08-31 + */ +public interface IHwMonitorUnitTypeService +{ + /** + * 查询监控单元类型 + * + * @param monitorUnitTypeId 监控单元类型主键 + * @return 监控单元类型 + */ + public HwMonitorUnitType selectHwMonitorUnitTypeByMonitorUnitTypeId(Long monitorUnitTypeId); + + /** + * 查询监控单元类型列表 + * + * @param hwMonitorUnitType 监控单元类型 + * @return 监控单元类型集合 + */ + public List selectHwMonitorUnitTypeList(HwMonitorUnitType hwMonitorUnitType); + + /** + * 新增监控单元类型 + * + * @param hwMonitorUnitType 监控单元类型 + * @return 结果 + */ + public int insertHwMonitorUnitType(HwMonitorUnitType hwMonitorUnitType); + + /** + * 修改监控单元类型 + * + * @param hwMonitorUnitType 监控单元类型 + * @return 结果 + */ + public int updateHwMonitorUnitType(HwMonitorUnitType hwMonitorUnitType); + + /** + * 批量删除监控单元类型 + * + * @param monitorUnitTypeIds 需要删除的监控单元类型主键集合 + * @return 结果 + */ + public int deleteHwMonitorUnitTypeByMonitorUnitTypeIds(Long[] monitorUnitTypeIds); + + /** + * 删除监控单元类型信息 + * + * @param monitorUnitTypeId 监控单元类型主键 + * @return 结果 + */ + public int deleteHwMonitorUnitTypeByMonitorUnitTypeId(Long monitorUnitTypeId); +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwSceneModeService.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwSceneModeService.java new file mode 100644 index 0000000..2563f57 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwSceneModeService.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.HwSceneMode; + +/** + * 场景类型Service接口 + * + * @author YINQ + * @date 2023-08-31 + */ +public interface IHwSceneModeService +{ + /** + * 查询场景类型 + * + * @param sceneModeId 场景类型主键 + * @return 场景类型 + */ + public HwSceneMode selectHwSceneModeBySceneModeId(Long sceneModeId); + + /** + * 查询场景类型列表 + * + * @param hwSceneMode 场景类型 + * @return 场景类型集合 + */ + public List selectHwSceneModeList(HwSceneMode hwSceneMode); + + /** + * 新增场景类型 + * + * @param hwSceneMode 场景类型 + * @return 结果 + */ + public int insertHwSceneMode(HwSceneMode hwSceneMode); + + /** + * 修改场景类型 + * + * @param hwSceneMode 场景类型 + * @return 结果 + */ + public int updateHwSceneMode(HwSceneMode hwSceneMode); + + /** + * 批量删除场景类型 + * + * @param sceneModeIds 需要删除的场景类型主键集合 + * @return 结果 + */ + public int deleteHwSceneModeBySceneModeIds(Long[] sceneModeIds); + + /** + * 删除场景类型信息 + * + * @param sceneModeId 场景类型主键 + * @return 结果 + */ + public int deleteHwSceneModeBySceneModeId(Long sceneModeId); +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwTenantService.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwTenantService.java new file mode 100644 index 0000000..423abcb --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/IHwTenantService.java @@ -0,0 +1,61 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.HwTenant; + +/** + * 租户信息Service接口 + * + * @author xins + * @date 2023-09-04 + */ +public interface IHwTenantService +{ + /** + * 查询租户信息 + * + * @param tenantId 租户信息主键 + * @return 租户信息 + */ + public HwTenant selectHwTenantByTenantId(Long tenantId); + + /** + * 查询租户信息列表 + * + * @param hwTenant 租户信息 + * @return 租户信息集合 + */ + public List selectHwTenantList(HwTenant hwTenant); + + /** + * 新增租户信息 + * + * @param hwTenant 租户信息 + * @return 结果 + */ + public int insertHwTenant(HwTenant hwTenant); + + /** + * 修改租户信息 + * + * @param hwTenant 租户信息 + * @return 结果 + */ + public int updateHwTenant(HwTenant hwTenant); + + /** + * 批量删除租户信息 + * + * @param tenantIds 需要删除的租户信息主键集合 + * @return 结果 + */ + public int deleteHwTenantByTenantIds(Long[] tenantIds); + + /** + * 删除租户信息信息 + * + * @param tenantId 租户信息主键 + * @return 结果 + */ + public int deleteHwTenantByTenantId(Long tenantId); +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwDeviceModeFunctionServiceImpl.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwDeviceModeFunctionServiceImpl.java new file mode 100644 index 0000000..2e3a868 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwDeviceModeFunctionServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.business.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.business.mapper.HwDeviceModeFunctionMapper; +import com.ruoyi.business.domain.HwDeviceModeFunction; +import com.ruoyi.business.service.IHwDeviceModeFunctionService; + +/** + * 设备模型功能Service业务层处理 + * + * @author xins + * @date 2023-09-05 + */ +@Service +public class HwDeviceModeFunctionServiceImpl implements IHwDeviceModeFunctionService +{ + @Autowired + private HwDeviceModeFunctionMapper hwDeviceModeFunctionMapper; + + /** + * 查询设备模型功能 + * + * @param modeFunctionId 设备模型功能主键 + * @return 设备模型功能 + */ + @Override + public HwDeviceModeFunction selectHwDeviceModeFunctionByModeFunctionId(Long modeFunctionId) + { + return hwDeviceModeFunctionMapper.selectHwDeviceModeFunctionByModeFunctionId(modeFunctionId); + } + + /** + * 查询设备模型功能列表 + * + * @param hwDeviceModeFunction 设备模型功能 + * @return 设备模型功能 + */ + @Override + public List selectHwDeviceModeFunctionList(HwDeviceModeFunction hwDeviceModeFunction) + { + return hwDeviceModeFunctionMapper.selectHwDeviceModeFunctionList(hwDeviceModeFunction); + } + + /** + * 新增设备模型功能 + * + * @param hwDeviceModeFunction 设备模型功能 + * @return 结果 + */ + @Override + public int insertHwDeviceModeFunction(HwDeviceModeFunction hwDeviceModeFunction) + { + return hwDeviceModeFunctionMapper.insertHwDeviceModeFunction(hwDeviceModeFunction); + } + + /** + * 修改设备模型功能 + * + * @param hwDeviceModeFunction 设备模型功能 + * @return 结果 + */ + @Override + public int updateHwDeviceModeFunction(HwDeviceModeFunction hwDeviceModeFunction) + { + return hwDeviceModeFunctionMapper.updateHwDeviceModeFunction(hwDeviceModeFunction); + } + + /** + * 批量删除设备模型功能 + * + * @param modeFunctionIds 需要删除的设备模型功能主键 + * @return 结果 + */ + @Override + public int deleteHwDeviceModeFunctionByModeFunctionIds(Long[] modeFunctionIds) + { + return hwDeviceModeFunctionMapper.deleteHwDeviceModeFunctionByModeFunctionIds(modeFunctionIds); + } + + /** + * 删除设备模型功能信息 + * + * @param modeFunctionId 设备模型功能主键 + * @return 结果 + */ + @Override + public int deleteHwDeviceModeFunctionByModeFunctionId(Long modeFunctionId) + { + return hwDeviceModeFunctionMapper.deleteHwDeviceModeFunctionByModeFunctionId(modeFunctionId); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwDeviceModeServiceImpl.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwDeviceModeServiceImpl.java new file mode 100644 index 0000000..578fac5 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwDeviceModeServiceImpl.java @@ -0,0 +1,134 @@ +package com.ruoyi.business.service.impl; + +import java.util.List; +import com.ruoyi.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.ArrayList; +import com.ruoyi.common.core.utils.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import com.ruoyi.business.domain.HwDeviceModeFunction; +import com.ruoyi.business.mapper.HwDeviceModeMapper; +import com.ruoyi.business.domain.HwDeviceMode; +import com.ruoyi.business.service.IHwDeviceModeService; + +/** + * 设备模型Service业务层处理 + * + * @author xins + * @date 2023-09-04 + */ +@Service +public class HwDeviceModeServiceImpl implements IHwDeviceModeService +{ + @Autowired + private HwDeviceModeMapper hwDeviceModeMapper; + + /** + * 查询设备模型 + * + * @param deviceModeId 设备模型主键 + * @return 设备模型 + */ + @Override + public HwDeviceMode selectHwDeviceModeByDeviceModeId(Long deviceModeId) + { + return hwDeviceModeMapper.selectHwDeviceModeByDeviceModeId(deviceModeId); + } + + /** + * 查询设备模型列表 + * + * @param hwDeviceMode 设备模型 + * @return 设备模型 + */ + @Override + public List selectHwDeviceModeList(HwDeviceMode hwDeviceMode) + { + return hwDeviceModeMapper.selectHwDeviceModeList(hwDeviceMode); + } + + /** + * 新增设备模型 + * + * @param hwDeviceMode 设备模型 + * @return 结果 + */ + @Transactional + @Override + public int insertHwDeviceMode(HwDeviceMode hwDeviceMode) + { + hwDeviceMode.setCreateTime(DateUtils.getNowDate()); + int rows = hwDeviceModeMapper.insertHwDeviceMode(hwDeviceMode); + insertHwDeviceModeFunction(hwDeviceMode); + return rows; + } + + /** + * 修改设备模型 + * + * @param hwDeviceMode 设备模型 + * @return 结果 + */ + @Transactional + @Override + public int updateHwDeviceMode(HwDeviceMode hwDeviceMode) + { + hwDeviceMode.setUpdateTime(DateUtils.getNowDate()); + hwDeviceModeMapper.deleteHwDeviceModeFunctionByDeviceModeId(hwDeviceMode.getDeviceModeId()); + insertHwDeviceModeFunction(hwDeviceMode); + return hwDeviceModeMapper.updateHwDeviceMode(hwDeviceMode); + } + + /** + * 批量删除设备模型 + * + * @param deviceModeIds 需要删除的设备模型主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteHwDeviceModeByDeviceModeIds(Long[] deviceModeIds) + { + hwDeviceModeMapper.deleteHwDeviceModeFunctionByDeviceModeIds(deviceModeIds); + return hwDeviceModeMapper.deleteHwDeviceModeByDeviceModeIds(deviceModeIds); + } + + /** + * 删除设备模型信息 + * + * @param deviceModeId 设备模型主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteHwDeviceModeByDeviceModeId(Long deviceModeId) + { + hwDeviceModeMapper.deleteHwDeviceModeFunctionByDeviceModeId(deviceModeId); + return hwDeviceModeMapper.deleteHwDeviceModeByDeviceModeId(deviceModeId); + } + + /** + * 新增设备模型功能信息 + * + * @param hwDeviceMode 设备模型对象 + */ + public void insertHwDeviceModeFunction(HwDeviceMode hwDeviceMode) + { + List hwDeviceModeFunctionList = hwDeviceMode.getHwDeviceModeFunctionList(); + Long deviceModeId = hwDeviceMode.getDeviceModeId(); + if (StringUtils.isNotNull(hwDeviceModeFunctionList)) + { + List list = new ArrayList(); + for (HwDeviceModeFunction hwDeviceModeFunction : hwDeviceModeFunctionList) + { + hwDeviceModeFunction.setDeviceModeId(deviceModeId); + list.add(hwDeviceModeFunction); + } + if (list.size() > 0) + { + hwDeviceModeMapper.batchHwDeviceModeFunction(list); + } + } + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwElectronicFenceServiceImpl.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwElectronicFenceServiceImpl.java new file mode 100644 index 0000000..b30c579 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwElectronicFenceServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.business.service.impl; + +import java.util.List; +import com.ruoyi.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.business.mapper.HwElectronicFenceMapper; +import com.ruoyi.business.domain.HwElectronicFence; +import com.ruoyi.business.service.IHwElectronicFenceService; + +/** + * 电子围栏Service业务层处理 + * + * @author xins + * @date 2023-09-04 + */ +@Service +public class HwElectronicFenceServiceImpl implements IHwElectronicFenceService +{ + @Autowired + private HwElectronicFenceMapper hwElectronicFenceMapper; + + /** + * 查询电子围栏 + * + * @param electronicFenceId 电子围栏主键 + * @return 电子围栏 + */ + @Override + public HwElectronicFence selectHwElectronicFenceByElectronicFenceId(Long electronicFenceId) + { + return hwElectronicFenceMapper.selectHwElectronicFenceByElectronicFenceId(electronicFenceId); + } + + /** + * 查询电子围栏列表 + * + * @param hwElectronicFence 电子围栏 + * @return 电子围栏 + */ + @Override + public List selectHwElectronicFenceList(HwElectronicFence hwElectronicFence) + { + return hwElectronicFenceMapper.selectHwElectronicFenceList(hwElectronicFence); + } + + /** + * 新增电子围栏 + * + * @param hwElectronicFence 电子围栏 + * @return 结果 + */ + @Override + public int insertHwElectronicFence(HwElectronicFence hwElectronicFence) + { + hwElectronicFence.setCreateTime(DateUtils.getNowDate()); + return hwElectronicFenceMapper.insertHwElectronicFence(hwElectronicFence); + } + + /** + * 修改电子围栏 + * + * @param hwElectronicFence 电子围栏 + * @return 结果 + */ + @Override + public int updateHwElectronicFence(HwElectronicFence hwElectronicFence) + { + hwElectronicFence.setUpdateTime(DateUtils.getNowDate()); + return hwElectronicFenceMapper.updateHwElectronicFence(hwElectronicFence); + } + + /** + * 批量删除电子围栏 + * + * @param electronicFenceIds 需要删除的电子围栏主键 + * @return 结果 + */ + @Override + public int deleteHwElectronicFenceByElectronicFenceIds(Long[] electronicFenceIds) + { + return hwElectronicFenceMapper.deleteHwElectronicFenceByElectronicFenceIds(electronicFenceIds); + } + + /** + * 删除电子围栏信息 + * + * @param electronicFenceId 电子围栏主键 + * @return 结果 + */ + @Override + public int deleteHwElectronicFenceByElectronicFenceId(Long electronicFenceId) + { + return hwElectronicFenceMapper.deleteHwElectronicFenceByElectronicFenceId(electronicFenceId); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwFenceTargetServiceImpl.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwFenceTargetServiceImpl.java new file mode 100644 index 0000000..0e494f5 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwFenceTargetServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.business.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.business.mapper.HwFenceTargetMapper; +import com.ruoyi.business.domain.HwFenceTarget; +import com.ruoyi.business.service.IHwFenceTargetService; + +/** + * 电子围栏目标Service业务层处理 + * + * @author xins + * @date 2023-09-04 + */ +@Service +public class HwFenceTargetServiceImpl implements IHwFenceTargetService +{ + @Autowired + private HwFenceTargetMapper hwFenceTargetMapper; + + /** + * 查询电子围栏目标 + * + * @param targetId 电子围栏目标主键 + * @return 电子围栏目标 + */ + @Override + public HwFenceTarget selectHwFenceTargetByTargetId(Long targetId) + { + return hwFenceTargetMapper.selectHwFenceTargetByTargetId(targetId); + } + + /** + * 查询电子围栏目标列表 + * + * @param hwFenceTarget 电子围栏目标 + * @return 电子围栏目标 + */ + @Override + public List selectHwFenceTargetList(HwFenceTarget hwFenceTarget) + { + return hwFenceTargetMapper.selectHwFenceTargetList(hwFenceTarget); + } + + /** + * 新增电子围栏目标 + * + * @param hwFenceTarget 电子围栏目标 + * @return 结果 + */ + @Override + public int insertHwFenceTarget(HwFenceTarget hwFenceTarget) + { + return hwFenceTargetMapper.insertHwFenceTarget(hwFenceTarget); + } + + /** + * 修改电子围栏目标 + * + * @param hwFenceTarget 电子围栏目标 + * @return 结果 + */ + @Override + public int updateHwFenceTarget(HwFenceTarget hwFenceTarget) + { + return hwFenceTargetMapper.updateHwFenceTarget(hwFenceTarget); + } + + /** + * 批量删除电子围栏目标 + * + * @param targetIds 需要删除的电子围栏目标主键 + * @return 结果 + */ + @Override + public int deleteHwFenceTargetByTargetIds(Long[] targetIds) + { + return hwFenceTargetMapper.deleteHwFenceTargetByTargetIds(targetIds); + } + + /** + * 删除电子围栏目标信息 + * + * @param targetId 电子围栏目标主键 + * @return 结果 + */ + @Override + public int deleteHwFenceTargetByTargetId(Long targetId) + { + return hwFenceTargetMapper.deleteHwFenceTargetByTargetId(targetId); + } +} 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 new file mode 100644 index 0000000..6dd939d --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwMonitorUnitServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.business.service.impl; + +import java.util.List; +import com.ruoyi.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.business.mapper.HwMonitorUnitMapper; +import com.ruoyi.business.domain.HwMonitorUnit; +import com.ruoyi.business.service.IHwMonitorUnitService; + +/** + * 监控单元Service业务层处理 + * + * @author YINQ + * @date 2023-08-31 + */ +@Service +public class HwMonitorUnitServiceImpl implements IHwMonitorUnitService +{ + @Autowired + private HwMonitorUnitMapper hwMonitorUnitMapper; + + /** + * 查询监控单元 + * + * @param monitorUnitId 监控单元主键 + * @return 监控单元 + */ + @Override + public HwMonitorUnit selectHwMonitorUnitByMonitorUnitId(Long monitorUnitId) + { + return hwMonitorUnitMapper.selectHwMonitorUnitByMonitorUnitId(monitorUnitId); + } + + /** + * 查询监控单元列表 + * + * @param hwMonitorUnit 监控单元 + * @return 监控单元 + */ + @Override + public List selectHwMonitorUnitList(HwMonitorUnit hwMonitorUnit) + { + return hwMonitorUnitMapper.selectHwMonitorUnitList(hwMonitorUnit); + } + + /** + * 新增监控单元 + * + * @param hwMonitorUnit 监控单元 + * @return 结果 + */ + @Override + public int insertHwMonitorUnit(HwMonitorUnit hwMonitorUnit) + { + hwMonitorUnit.setCreateTime(DateUtils.getNowDate()); + return hwMonitorUnitMapper.insertHwMonitorUnit(hwMonitorUnit); + } + + /** + * 修改监控单元 + * + * @param hwMonitorUnit 监控单元 + * @return 结果 + */ + @Override + public int updateHwMonitorUnit(HwMonitorUnit hwMonitorUnit) + { + hwMonitorUnit.setUpdateTime(DateUtils.getNowDate()); + return hwMonitorUnitMapper.updateHwMonitorUnit(hwMonitorUnit); + } + + /** + * 批量删除监控单元 + * + * @param monitorUnitIds 需要删除的监控单元主键 + * @return 结果 + */ + @Override + public int deleteHwMonitorUnitByMonitorUnitIds(Long[] monitorUnitIds) + { + return hwMonitorUnitMapper.deleteHwMonitorUnitByMonitorUnitIds(monitorUnitIds); + } + + /** + * 删除监控单元信息 + * + * @param monitorUnitId 监控单元主键 + * @return 结果 + */ + @Override + public int deleteHwMonitorUnitByMonitorUnitId(Long monitorUnitId) + { + return hwMonitorUnitMapper.deleteHwMonitorUnitByMonitorUnitId(monitorUnitId); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwMonitorUnitTypeServiceImpl.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwMonitorUnitTypeServiceImpl.java new file mode 100644 index 0000000..7d63206 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwMonitorUnitTypeServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.business.service.impl; + +import java.util.List; +import com.ruoyi.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.business.mapper.HwMonitorUnitTypeMapper; +import com.ruoyi.business.domain.HwMonitorUnitType; +import com.ruoyi.business.service.IHwMonitorUnitTypeService; + +/** + * 监控单元类型Service业务层处理 + * + * @author YINQ + * @date 2023-08-31 + */ +@Service +public class HwMonitorUnitTypeServiceImpl implements IHwMonitorUnitTypeService +{ + @Autowired + private HwMonitorUnitTypeMapper hwMonitorUnitTypeMapper; + + /** + * 查询监控单元类型 + * + * @param monitorUnitTypeId 监控单元类型主键 + * @return 监控单元类型 + */ + @Override + public HwMonitorUnitType selectHwMonitorUnitTypeByMonitorUnitTypeId(Long monitorUnitTypeId) + { + return hwMonitorUnitTypeMapper.selectHwMonitorUnitTypeByMonitorUnitTypeId(monitorUnitTypeId); + } + + /** + * 查询监控单元类型列表 + * + * @param hwMonitorUnitType 监控单元类型 + * @return 监控单元类型 + */ + @Override + public List selectHwMonitorUnitTypeList(HwMonitorUnitType hwMonitorUnitType) + { + return hwMonitorUnitTypeMapper.selectHwMonitorUnitTypeList(hwMonitorUnitType); + } + + /** + * 新增监控单元类型 + * + * @param hwMonitorUnitType 监控单元类型 + * @return 结果 + */ + @Override + public int insertHwMonitorUnitType(HwMonitorUnitType hwMonitorUnitType) + { + hwMonitorUnitType.setCreateTime(DateUtils.getNowDate()); + return hwMonitorUnitTypeMapper.insertHwMonitorUnitType(hwMonitorUnitType); + } + + /** + * 修改监控单元类型 + * + * @param hwMonitorUnitType 监控单元类型 + * @return 结果 + */ + @Override + public int updateHwMonitorUnitType(HwMonitorUnitType hwMonitorUnitType) + { + hwMonitorUnitType.setUpdateTime(DateUtils.getNowDate()); + return hwMonitorUnitTypeMapper.updateHwMonitorUnitType(hwMonitorUnitType); + } + + /** + * 批量删除监控单元类型 + * + * @param monitorUnitTypeIds 需要删除的监控单元类型主键 + * @return 结果 + */ + @Override + public int deleteHwMonitorUnitTypeByMonitorUnitTypeIds(Long[] monitorUnitTypeIds) + { + return hwMonitorUnitTypeMapper.deleteHwMonitorUnitTypeByMonitorUnitTypeIds(monitorUnitTypeIds); + } + + /** + * 删除监控单元类型信息 + * + * @param monitorUnitTypeId 监控单元类型主键 + * @return 结果 + */ + @Override + public int deleteHwMonitorUnitTypeByMonitorUnitTypeId(Long monitorUnitTypeId) + { + return hwMonitorUnitTypeMapper.deleteHwMonitorUnitTypeByMonitorUnitTypeId(monitorUnitTypeId); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwSceneModeServiceImpl.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwSceneModeServiceImpl.java new file mode 100644 index 0000000..a81b07a --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwSceneModeServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.business.service.impl; + +import java.util.List; +import com.ruoyi.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.business.mapper.HwSceneModeMapper; +import com.ruoyi.business.domain.HwSceneMode; +import com.ruoyi.business.service.IHwSceneModeService; + +/** + * 场景类型Service业务层处理 + * + * @author YINQ + * @date 2023-08-31 + */ +@Service +public class HwSceneModeServiceImpl implements IHwSceneModeService +{ + @Autowired + private HwSceneModeMapper hwSceneModeMapper; + + /** + * 查询场景类型 + * + * @param sceneModeId 场景类型主键 + * @return 场景类型 + */ + @Override + public HwSceneMode selectHwSceneModeBySceneModeId(Long sceneModeId) + { + return hwSceneModeMapper.selectHwSceneModeBySceneModeId(sceneModeId); + } + + /** + * 查询场景类型列表 + * + * @param hwSceneMode 场景类型 + * @return 场景类型 + */ + @Override + public List selectHwSceneModeList(HwSceneMode hwSceneMode) + { + return hwSceneModeMapper.selectHwSceneModeList(hwSceneMode); + } + + /** + * 新增场景类型 + * + * @param hwSceneMode 场景类型 + * @return 结果 + */ + @Override + public int insertHwSceneMode(HwSceneMode hwSceneMode) + { + hwSceneMode.setCreateTime(DateUtils.getNowDate()); + return hwSceneModeMapper.insertHwSceneMode(hwSceneMode); + } + + /** + * 修改场景类型 + * + * @param hwSceneMode 场景类型 + * @return 结果 + */ + @Override + public int updateHwSceneMode(HwSceneMode hwSceneMode) + { + hwSceneMode.setUpdateTime(DateUtils.getNowDate()); + return hwSceneModeMapper.updateHwSceneMode(hwSceneMode); + } + + /** + * 批量删除场景类型 + * + * @param sceneModeIds 需要删除的场景类型主键 + * @return 结果 + */ + @Override + public int deleteHwSceneModeBySceneModeIds(Long[] sceneModeIds) + { + return hwSceneModeMapper.deleteHwSceneModeBySceneModeIds(sceneModeIds); + } + + /** + * 删除场景类型信息 + * + * @param sceneModeId 场景类型主键 + * @return 结果 + */ + @Override + public int deleteHwSceneModeBySceneModeId(Long sceneModeId) + { + return hwSceneModeMapper.deleteHwSceneModeBySceneModeId(sceneModeId); + } +} diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwTenantServiceImpl.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwTenantServiceImpl.java new file mode 100644 index 0000000..5c856e3 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwTenantServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.business.service.impl; + +import java.util.List; +import com.ruoyi.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.business.mapper.HwTenantMapper; +import com.ruoyi.business.domain.HwTenant; +import com.ruoyi.business.service.IHwTenantService; + +/** + * 租户信息Service业务层处理 + * + * @author xins + * @date 2023-09-04 + */ +@Service +public class HwTenantServiceImpl implements IHwTenantService +{ + @Autowired + private HwTenantMapper hwTenantMapper; + + /** + * 查询租户信息 + * + * @param tenantId 租户信息主键 + * @return 租户信息 + */ + @Override + public HwTenant selectHwTenantByTenantId(Long tenantId) + { + return hwTenantMapper.selectHwTenantByTenantId(tenantId); + } + + /** + * 查询租户信息列表 + * + * @param hwTenant 租户信息 + * @return 租户信息 + */ + @Override + public List selectHwTenantList(HwTenant hwTenant) + { + return hwTenantMapper.selectHwTenantList(hwTenant); + } + + /** + * 新增租户信息 + * + * @param hwTenant 租户信息 + * @return 结果 + */ + @Override + public int insertHwTenant(HwTenant hwTenant) + { + hwTenant.setCreateTime(DateUtils.getNowDate()); + return hwTenantMapper.insertHwTenant(hwTenant); + } + + /** + * 修改租户信息 + * + * @param hwTenant 租户信息 + * @return 结果 + */ + @Override + public int updateHwTenant(HwTenant hwTenant) + { + hwTenant.setUpdateTime(DateUtils.getNowDate()); + return hwTenantMapper.updateHwTenant(hwTenant); + } + + /** + * 批量删除租户信息 + * + * @param tenantIds 需要删除的租户信息主键 + * @return 结果 + */ + @Override + public int deleteHwTenantByTenantIds(Long[] tenantIds) + { + return hwTenantMapper.deleteHwTenantByTenantIds(tenantIds); + } + + /** + * 删除租户信息信息 + * + * @param tenantId 租户信息主键 + * @return 结果 + */ + @Override + public int deleteHwTenantByTenantId(Long tenantId) + { + return hwTenantMapper.deleteHwTenantByTenantId(tenantId); + } +} diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceModeFunctionMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceModeFunctionMapper.xml new file mode 100644 index 0000000..b24d576 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceModeFunctionMapper.xml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select mode_function_id, device_mode_id, function_mode, coordinate, function_name, function_identifier, function_type, data_type, data_definition, function_formula, property_unit, display_flag, rw_flag, invoke_method, event_type, remark, acquisition_formula, order_flag, device_register, property_step, property_field from hw_device_mode_function + + + + + + + + insert into hw_device_mode_function + + device_mode_id, + function_mode, + coordinate, + function_name, + function_identifier, + function_type, + data_type, + data_definition, + function_formula, + property_unit, + display_flag, + rw_flag, + invoke_method, + event_type, + remark, + acquisition_formula, + order_flag, + device_register, + property_step, + property_field, + + + #{deviceModeId}, + #{functionMode}, + #{coordinate}, + #{functionName}, + #{functionIdentifier}, + #{functionType}, + #{dataType}, + #{dataDefinition}, + #{functionFormula}, + #{propertyUnit}, + #{displayFlag}, + #{rwFlag}, + #{invokeMethod}, + #{eventType}, + #{remark}, + #{acquisitionFormula}, + #{orderFlag}, + #{deviceRegister}, + #{propertyStep}, + #{propertyField}, + + + + + update hw_device_mode_function + + device_mode_id = #{deviceModeId}, + function_mode = #{functionMode}, + coordinate = #{coordinate}, + function_name = #{functionName}, + function_identifier = #{functionIdentifier}, + function_type = #{functionType}, + data_type = #{dataType}, + data_definition = #{dataDefinition}, + function_formula = #{functionFormula}, + property_unit = #{propertyUnit}, + display_flag = #{displayFlag}, + rw_flag = #{rwFlag}, + invoke_method = #{invokeMethod}, + event_type = #{eventType}, + remark = #{remark}, + acquisition_formula = #{acquisitionFormula}, + order_flag = #{orderFlag}, + device_register = #{deviceRegister}, + property_step = #{propertyStep}, + property_field = #{propertyField}, + + where mode_function_id = #{modeFunctionId} + + + + delete from hw_device_mode_function where mode_function_id = #{modeFunctionId} + + + + delete from hw_device_mode_function where mode_function_id in + + #{modeFunctionId} + + + \ No newline at end of file diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceModeMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceModeMapper.xml new file mode 100644 index 0000000..a1e5cdb --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceModeMapper.xml @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select device_mode_id, device_mode_name, tenant_id, scene_id, language_code, gps_flag, device_mode_status, common_flag, mode_classfication, device_mode_pic, data_verify_level, remark, create_by, create_time, update_by, update_time, device_mode_field from hw_device_mode + + + + + + + + insert into hw_device_mode + + device_mode_name, + tenant_id, + scene_id, + language_code, + gps_flag, + device_mode_status, + common_flag, + mode_classfication, + device_mode_pic, + data_verify_level, + remark, + create_by, + create_time, + update_by, + update_time, + device_mode_field, + + + #{deviceModeName}, + #{tenantId}, + #{sceneId}, + #{languageCode}, + #{gpsFlag}, + #{deviceModeStatus}, + #{commonFlag}, + #{modeClassfication}, + #{deviceModePic}, + #{dataVerifyLevel}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{deviceModeField}, + + + + + update hw_device_mode + + device_mode_name = #{deviceModeName}, + tenant_id = #{tenantId}, + scene_id = #{sceneId}, + language_code = #{languageCode}, + gps_flag = #{gpsFlag}, + device_mode_status = #{deviceModeStatus}, + common_flag = #{commonFlag}, + mode_classfication = #{modeClassfication}, + device_mode_pic = #{deviceModePic}, + data_verify_level = #{dataVerifyLevel}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + device_mode_field = #{deviceModeField}, + + where device_mode_id = #{deviceModeId} + + + + delete from hw_device_mode where device_mode_id = #{deviceModeId} + + + + delete from hw_device_mode where device_mode_id in + + #{deviceModeId} + + + + + delete from hw_device_mode_function where device_mode_id in + + #{deviceModeId} + + + + + delete from hw_device_mode_function where device_mode_id = #{deviceModeId} + + + + insert into hw_device_mode_function( mode_function_id, device_mode_id, function_mode, coordinate, function_name, function_identifier, function_type, data_type, data_definition, function_formula, property_unit, display_flag, rw_flag, invoke_method, event_type, remark, acquisition_formula, order_flag, device_register, property_step, property_field) values + + ( #{item.modeFunctionId}, #{item.deviceModeId}, #{item.functionMode}, #{item.coordinate}, #{item.functionName}, #{item.functionIdentifier}, #{item.functionType}, #{item.dataType}, #{item.dataDefinition}, #{item.functionFormula}, #{item.propertyUnit}, #{item.displayFlag}, #{item.rwFlag}, #{item.invokeMethod}, #{item.eventType}, #{item.remark}, #{item.acquisitionFormula}, #{item.orderFlag}, #{item.deviceRegister}, #{item.propertyStep}, #{item.propertyField}) + + + \ No newline at end of file diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwElectronicFenceMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwElectronicFenceMapper.xml new file mode 100644 index 0000000..5c6892e --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwElectronicFenceMapper.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + select electronic_fence_id, electronic_fence_name, scene_id, fence_type, effective_time_flag, time_zone, effective_time, trigger_status, area_shape_flag, area_range, fence_push_flag, fence_push_content, fence_recover_content, remark, create_by, create_time, update_by, update_time, fence_field from hw_electronic_fence + + + + + + + + insert into hw_electronic_fence + + electronic_fence_name, + scene_id, + fence_type, + effective_time_flag, + time_zone, + effective_time, + trigger_status, + area_shape_flag, + area_range, + fence_push_flag, + fence_push_content, + fence_recover_content, + remark, + create_by, + create_time, + update_by, + update_time, + fence_field, + + + #{electronicFenceName}, + #{sceneId}, + #{fenceType}, + #{effectiveTimeFlag}, + #{timeZone}, + #{effectiveTime}, + #{triggerStatus}, + #{areaShapeFlag}, + #{areaRange}, + #{fencePushFlag}, + #{fencePushContent}, + #{fenceRecoverContent}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{fenceField}, + + + + + update hw_electronic_fence + + electronic_fence_name = #{electronicFenceName}, + scene_id = #{sceneId}, + fence_type = #{fenceType}, + effective_time_flag = #{effectiveTimeFlag}, + time_zone = #{timeZone}, + effective_time = #{effectiveTime}, + trigger_status = #{triggerStatus}, + area_shape_flag = #{areaShapeFlag}, + area_range = #{areaRange}, + fence_push_flag = #{fencePushFlag}, + fence_push_content = #{fencePushContent}, + fence_recover_content = #{fenceRecoverContent}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + fence_field = #{fenceField}, + + where electronic_fence_id = #{electronicFenceId} + + + + delete from hw_electronic_fence where electronic_fence_id = #{electronicFenceId} + + + + delete from hw_electronic_fence where electronic_fence_id in + + #{electronicFenceId} + + + \ No newline at end of file diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwFenceTargetMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwFenceTargetMapper.xml new file mode 100644 index 0000000..3ef51f6 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwFenceTargetMapper.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + select electronic_fence_id, target_type, target_id from hw_fence_target + + + + + + + + insert into hw_fence_target + + electronic_fence_id, + target_type, + target_id, + + + #{electronicFenceId}, + #{targetType}, + #{targetId}, + + + + + update hw_fence_target + + electronic_fence_id = #{electronicFenceId}, + target_type = #{targetType}, + + where target_id = #{targetId} + + + + delete from hw_fence_target where target_id = #{targetId} + + + + delete from hw_fence_target where target_id in + + #{targetId} + + + \ No newline at end of file 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 new file mode 100644 index 0000000..378bc82 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwMonitorUnitMapper.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select monitor_unit_id, monitor_unit_name, scene_id, parent_id, monitor_unit_type_id, area_id, monitor_address, monitor_pic, preserve_time, remark, monitor_unit_status, create_by, create_time, update_by, update_time, monitor_unit_field from hw_monitor_unit + + + + + + + + insert into hw_monitor_unit + + monitor_unit_name, + scene_id, + parent_id, + monitor_unit_type_id, + area_id, + monitor_address, + monitor_pic, + preserve_time, + remark, + monitor_unit_status, + create_by, + create_time, + update_by, + update_time, + monitor_unit_field, + + + #{monitorUnitName}, + #{sceneId}, + #{parentId}, + #{monitorUnitTypeId}, + #{areaId}, + #{monitorAddress}, + #{monitorPic}, + #{preserveTime}, + #{remark}, + #{monitorUnitStatus}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{monitorUnitField}, + + + + + update hw_monitor_unit + + monitor_unit_name = #{monitorUnitName}, + scene_id = #{sceneId}, + parent_id = #{parentId}, + monitor_unit_type_id = #{monitorUnitTypeId}, + area_id = #{areaId}, + monitor_address = #{monitorAddress}, + monitor_pic = #{monitorPic}, + preserve_time = #{preserveTime}, + remark = #{remark}, + monitor_unit_status = #{monitorUnitStatus}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + monitor_unit_field = #{monitorUnitField}, + + where monitor_unit_id = #{monitorUnitId} + + + + delete from hw_monitor_unit where monitor_unit_id = #{monitorUnitId} + + + + delete from hw_monitor_unit where monitor_unit_id in + + #{monitorUnitId} + + + \ No newline at end of file diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwMonitorUnitTypeMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwMonitorUnitTypeMapper.xml new file mode 100644 index 0000000..a69a7a8 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwMonitorUnitTypeMapper.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + select monitor_unit_type_id, monitor_unit_type_name, vitual_flag, monitor_unit_type_status, language_code, common_flag, scene_id, remark, create_by, create_time, update_by, update_time, unit_type_icon, unit_type_field from hw_monitor_unit_type + + + + + + + + insert into hw_monitor_unit_type + + monitor_unit_type_name, + vitual_flag, + monitor_unit_type_status, + language_code, + common_flag, + scene_id, + remark, + create_by, + create_time, + update_by, + update_time, + unit_type_icon, + unit_type_field, + + + #{monitorUnitTypeName}, + #{vitualFlag}, + #{monitorUnitTypeStatus}, + #{languageCode}, + #{commonFlag}, + #{sceneId}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{unitTypeIcon}, + #{unitTypeField}, + + + + + update hw_monitor_unit_type + + monitor_unit_type_name = #{monitorUnitTypeName}, + vitual_flag = #{vitualFlag}, + monitor_unit_type_status = #{monitorUnitTypeStatus}, + language_code = #{languageCode}, + common_flag = #{commonFlag}, + scene_id = #{sceneId}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + unit_type_icon = #{unitTypeIcon}, + unit_type_field = #{unitTypeField}, + + where monitor_unit_type_id = #{monitorUnitTypeId} + + + + delete from hw_monitor_unit_type where monitor_unit_type_id = #{monitorUnitTypeId} + + + + delete from hw_monitor_unit_type where monitor_unit_type_id in + + #{monitorUnitTypeId} + + + \ No newline at end of file diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwSceneModeMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwSceneModeMapper.xml new file mode 100644 index 0000000..3080572 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwSceneModeMapper.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + select scene_mode_id, scene_mode_name, custom_flag, tenant_id, language_code, remark, scene_mode_status, create_by, create_time, update_by, update_time, scene_mode_field from hw_scene_mode + + + + + + + + insert into hw_scene_mode + + scene_mode_name, + custom_flag, + tenant_id, + language_code, + remark, + scene_mode_status, + create_by, + create_time, + update_by, + update_time, + scene_mode_field, + + + #{sceneModeName}, + #{customFlag}, + #{tenantId}, + #{languageCode}, + #{remark}, + #{sceneModeStatus}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{sceneModeField}, + + + + + update hw_scene_mode + + scene_mode_name = #{sceneModeName}, + custom_flag = #{customFlag}, + tenant_id = #{tenantId}, + language_code = #{languageCode}, + remark = #{remark}, + scene_mode_status = #{sceneModeStatus}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + scene_mode_field = #{sceneModeField}, + + where scene_mode_id = #{sceneModeId} + + + + delete from hw_scene_mode where scene_mode_id = #{sceneModeId} + + + + delete from hw_scene_mode where scene_mode_id in + + #{sceneModeId} + + + \ No newline at end of file diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwTenantMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwTenantMapper.xml new file mode 100644 index 0000000..3c3f0a3 --- /dev/null +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwTenantMapper.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select tenant_id, tenant_type, tenant_name, tenant_industry, contact_name, contact_phone, email, area_id, contact_address, remark, tenant_status, is_register, create_by, create_time, update_by, update_time, tenant_grade, tenant_field from hw_tenant + + + + + + + + insert into hw_tenant + + tenant_type, + tenant_name, + tenant_industry, + contact_name, + contact_phone, + email, + area_id, + contact_address, + remark, + tenant_status, + is_register, + create_by, + create_time, + update_by, + update_time, + tenant_grade, + tenant_field, + + + #{tenantType}, + #{tenantName}, + #{tenantIndustry}, + #{contactName}, + #{contactPhone}, + #{email}, + #{areaId}, + #{contactAddress}, + #{remark}, + #{tenantStatus}, + #{isRegister}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{tenantGrade}, + #{tenantField}, + + + + + update hw_tenant + + tenant_type = #{tenantType}, + tenant_name = #{tenantName}, + tenant_industry = #{tenantIndustry}, + contact_name = #{contactName}, + contact_phone = #{contactPhone}, + email = #{email}, + area_id = #{areaId}, + contact_address = #{contactAddress}, + remark = #{remark}, + tenant_status = #{tenantStatus}, + is_register = #{isRegister}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + tenant_grade = #{tenantGrade}, + tenant_field = #{tenantField}, + + where tenant_id = #{tenantId} + + + + delete from hw_tenant where tenant_id = #{tenantId} + + + + delete from hw_tenant where tenant_id in + + #{tenantId} + + + \ No newline at end of file diff --git a/ruoyi-modules/hw-data-process/pom.xml b/ruoyi-modules/hw-data-process/pom.xml new file mode 100644 index 0000000..d2f099a --- /dev/null +++ b/ruoyi-modules/hw-data-process/pom.xml @@ -0,0 +1,120 @@ + + + + com.ruoyi + ruoyi-modules + 3.6.3 + + 4.0.0 + + ruoyi-modules-dataprocess + + + ruoyi-modules-dataprocess数据处理模块 + + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + + com.mysql + mysql-connector-j + + + + + com.ruoyi + ruoyi-common-datasource + + + + + com.ruoyi + ruoyi-common-datascope + + + + + com.ruoyi + ruoyi-common-log + + + + + com.ruoyi + ruoyi-common-swagger + + + + + net.dreamlu + mica-mqtt-client-spring-boot-starter + 2.1.0 + + + + + com.ruoyi + hw-api-tdengine + + + + org.locationtech.jts + jts-core + 1.19.0 + + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + + \ No newline at end of file diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/HwDataProcessApplication.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/HwDataProcessApplication.java new file mode 100644 index 0000000..3e10315 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/HwDataProcessApplication.java @@ -0,0 +1,34 @@ +package com.ruoyi.dataprocess; + +import com.ruoyi.common.security.annotation.EnableCustomConfig; +import com.ruoyi.common.security.annotation.EnableRyFeignClients; +import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * 系统模块 + * + * @author xins + */ +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableRyFeignClients +@SpringBootApplication +public class HwDataProcessApplication +{ + public static void main(String[] args) + { + SpringApplication.run(HwDataProcessApplication.class, args); + System.out.println("(♥◠‿◠)ノ゙ 数据处理模块启动成功 ლ(´ڡ`ლ)゙ \n" + + " .-------. ____ __ \n" + + " | _ _ \\ \\ \\ / / \n" + + " | ( ' ) | \\ _. / ' \n" + + " |(_ o _) / _( )_ .' \n" + + " | (_,_).' __ ___(_ o _)' \n" + + " | |\\ \\ | || |(_,_)' \n" + + " | | \\ `' /| `-' / \n" + + " | | \\ / \\ / \n" + + " ''-' `'-' `-..-' "); + } +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/amap/LocationVo.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/amap/LocationVo.java new file mode 100644 index 0000000..728eb6d --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/amap/LocationVo.java @@ -0,0 +1,46 @@ +package com.ruoyi.dataprocess.amap; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * @Description: 区域实体类(多边形还是圆形)。多边形记录多个多边形的list,圆形记录中心点的经纬度和半径 + * @ClassName: LocationVo + * @Author : xins + * @Date :2023-09-02 11:22 + * @Version :1.0 + */ +@Data +public class LocationVo implements Serializable { + private static final long serialVersionUID = 1L; + public static final int MARKER_TYPE_POLYGON = 1;//多边形 + public static final int MARKER_TYPE_CIRCULAR = 2;//圆形 + + //经度 + private Double longitude; + + //纬度 + private Double latitude; + + /** + * 半径,单位米 + */ +// @ApiModelProperty(value = "半径") + private Double radius; + + /** + * 标记类型:1圆,2多边形 + */ +// @ApiModelProperty(value = "标记类型:1圆,2多边形") + private int markerType; + + /** + * 多边形区域 + */ + private List> polygonList; +} + + diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/amap/PositionUtils.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/amap/PositionUtils.java new file mode 100644 index 0000000..fa634c4 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/amap/PositionUtils.java @@ -0,0 +1,185 @@ +package com.ruoyi.dataprocess.amap; + +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.Point; +import org.locationtech.jts.geom.Polygon; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class PositionUtils { + + /** + * @return boolean + * @param: locationVo 区域 + * @param: lng 要判断的点的经度 + * @param: lat 要判断的点的纬度 + * @description 判断定位是否在区域LocationVo内 + * @author xins + * @date 2023-09-02 12:47 + */ + public static boolean checkAddressInLocation(LocationVo locationVo, Double lng, Double lat) { + if (locationVo == null) { + return false; + } + if (lng != null && lat != null && lng.compareTo(0.000000000000) > 0 && lat.compareTo(0.000000000000) > 0) { + if (locationVo.getMarkerType() == LocationVo.MARKER_TYPE_CIRCULAR) {//如果是圆 + double distance = calculateLineDistance(lng,lat,locationVo.getLongitude(), locationVo.getLatitude()); + System.out.println("dis:"+distance); + return (distance - locationVo.getRadius()) <=0; + } else if (locationVo.getMarkerType() == LocationVo.MARKER_TYPE_POLYGON) { + //多个多边形点集合字符串 + List> coordinates = locationVo.getPolygonList(); + if (coordinates == null || coordinates.isEmpty()) { + return false; + } + //可以传好几个多边形 + for (List positionVos : coordinates) { + Coordinate[] coordinates1 = new Coordinate[positionVos.size() + 1]; + for (int i = 0; i < positionVos.size(); i++) { + BigDecimal longitudeB = positionVos.get(i).getLongitude(); + BigDecimal latitudeB = positionVos.get(i).getLatitude(); + if (longitudeB == null || latitudeB == null) {//数据异常 + return false; + } + + Double longitude = longitudeB.doubleValue(); + Double latitude = latitudeB.doubleValue(); + + Coordinate coordinate = new Coordinate(longitude, latitude); + coordinates1[i] = coordinate; + } + //是起点也是终点 + coordinates1[positionVos.size()] = new Coordinate(positionVos.get(0).getLongitude().doubleValue(), + positionVos.get(0).getLatitude().doubleValue()); + if (isPointInPolygon(lat.doubleValue(), lng.doubleValue(), coordinates1)) { + return true;//只需要定位在其中一个的多边形范围内 + } + } + return false; + } + return false; + } else { + return false; + } + } + + +// public static boolean checkWithinTheCircula(LocationVo circulaVo, Double lng, Double lat) {//判断点与圆心之间的距离和圆半径的关系 +// +// System.out.println(lng.subtract(circulaVo.getLongitude()).doubleValue()); +// System.out.println(lat.subtract(circulaVo.getLatitude()).doubleValue()); +// double d2 = Math.hypot(lng.subtract(circulaVo.getLongitude()), lat.subtract(circulaVo.getLatitude()).doubleValue()); +// +// System.out.println("d2==" + d2); +// +// double r = circulaVo.getRadius(); +// //圆外 +// if (d2 > r) { +// return false; +// } else {//圆内或圆上 +// return true; +// } +// } + + /** + * 判断坐标之间的距离 + * (高德地图Android库的反编译源码) + * + * @param longitude 待判断经度 + * @param latitude 待判断纬度 + * @param centerLon 中心点经度 + * @param centerLat 中心点纬度 + * @return 返回的距离,单位米 + */ + public static Double calculateLineDistance(double longitude, double latitude, double centerLon, double centerLat) { + if (longitude == 0 || latitude == 0 || centerLat == 0 || centerLon == 0) { + return -1.0; + } + longitude *= 0.01745329251994329; + latitude *= 0.01745329251994329; + centerLon *= 0.01745329251994329; + centerLat *= 0.01745329251994329; + double var10 = Math.sin(longitude); + double var12 = Math.sin(latitude); + double var14 = Math.cos(longitude); + double var16 = Math.cos(latitude); + double var18 = Math.sin(centerLon); + double var20 = Math.sin(centerLat); + double var22 = Math.cos(centerLon); + double var24 = Math.cos(centerLat); + double[] var28 = new double[3]; + double[] var29 = new double[3]; + var28[0] = var16 * var14; + var28[1] = var16 * var10; + var28[2] = var12; + var29[0] = var24 * var22; + var29[1] = var24 * var18; + var29[2] = var20; + double distance = Math.asin(Math.sqrt((var28[0] - var29[0]) * (var28[0] - var29[0]) + (var28[1] - var29[1]) * (var28[1] - var29[1]) + (var28[2] - var29[2]) * (var28[2] - var29[2])) / 2.0) * 1.27420015798544E7; + return distance; + } + + + /** + * 判断是否在多边形区域内 + * + * @param latitude 经度 + * @param longitude 纬度 + * @param polygonCoordinates 多边形点集合 + * @return + */ + public static boolean isPointInPolygon(double latitude, double longitude, Coordinate[] polygonCoordinates) { + GeometryFactory geometryFactory = new GeometryFactory(); + Point point = geometryFactory.createPoint(new Coordinate(longitude, latitude)); + Polygon polygon = geometryFactory.createPolygon(polygonCoordinates); + + return polygon.touches(point) || polygon.contains(point); + } + + + public static void main(String[] args) { + LocationVo locationVo = new LocationVo(); + locationVo.setMarkerType(LocationVo.MARKER_TYPE_POLYGON); + + List> polygonList = new ArrayList<>(); + List postionList = new ArrayList<>(); + //林和西地铁站 + postionList.add(new PositionVo(new BigDecimal("113.323947"), new BigDecimal("23.141525"))); + //五羊邨地铁站 + postionList.add(new PositionVo(new BigDecimal(113.314119), new BigDecimal(23.119977))); + //体育中心南地铁站 + postionList.add(new PositionVo(new BigDecimal(113.324247), new BigDecimal(23.134501))); + //猎德地铁站 + postionList.add(new PositionVo(new BigDecimal(113.331972), new BigDecimal(23.118477))); + polygonList.add(postionList); + locationVo.setPolygonList(polygonList); + + +// boolean check1 = checkAddressInLocation(locationVo,new BigDecimal(113.323239),new BigDecimal(23.135428)); +// System.out.println(check1); +// check1 = checkAddressInLocation(locationVo,new BigDecimal(113.321522),new BigDecimal(23.13381)); +// System.out.println(check1); +// check1 = checkAddressInLocation(locationVo,new BigDecimal(113.324462),new BigDecimal(23.127002)); +// System.out.println(check1); +// check1 = checkAddressInLocation(locationVo,new BigDecimal(113.324247),new BigDecimal(23.116188)); +// System.out.println(check1); +// check1 = checkAddressInLocation(locationVo,new BigDecimal(113.319773),new BigDecimal(23.121664)); +// System.out.println(check1); +// check1 = checkAddressInLocation(locationVo,new BigDecimal(113.307757),new BigDecimal(23.127249)); +// System.out.println(check1); + + + LocationVo circulrVo = new LocationVo(); + circulrVo.setRadius(9.0056); + circulrVo.setLongitude(116.404172); + circulrVo.setLatitude(39.916605); + circulrVo.setMarkerType(LocationVo.MARKER_TYPE_CIRCULAR); + + boolean check2 = checkAddressInLocation(circulrVo, 116.404072, 39.916605); + System.out.println(check2); + + } +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/amap/PositionVo.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/amap/PositionVo.java new file mode 100644 index 0000000..1af05fb --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/amap/PositionVo.java @@ -0,0 +1,24 @@ +package com.ruoyi.dataprocess.amap; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @Description: 要判断的点的实体类 + * @ClassName: PositionUtils.Postion + * @Author : xins + * @Date :2023-09-02 12:11 + * @Version :1.0 + */ +@Data +public class PositionVo{ + private BigDecimal longitude; + + private BigDecimal latitude; + + public PositionVo(BigDecimal longitude, BigDecimal latitude) { + this.longitude = longitude; + this.latitude = latitude; + } +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/common/AmapUtils.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/common/AmapUtils.java new file mode 100644 index 0000000..bc04947 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/common/AmapUtils.java @@ -0,0 +1,136 @@ +package com.ruoyi.dataprocess.common; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description: 高德地图计算工具类 + * @ClassName: AmapUtils + * @Author : xins + * @Date :2023-09-02 11:13 + * @Version :1.0 + */ +public class AmapUtils { + + public static class Poi{ + private Double lat; + private Double lng; + public Poi(Double lng,Double lat){ + this.lat = lat; + this.lng = lng; + } + + } + + /** + * 计算经纬度围成的实际面积(平方公里) + * @return + */ + public static BigDecimal getArea(List ring){ + double sJ = 6378137; + double Hq = 0.017453292519943295; + double c = sJ *Hq; + double d = 0; + + if (3 > ring.size()) { + return new BigDecimal( 0); + } + + for (int i = 0; i < ring.size() - 1; i ++){ + Poi h = ring.get(i); + Poi k = ring.get(i + 1); + double u = h.lng * c * Math.cos(h.lat * Hq); + double hhh = h.lat * c; + double v = k.lng * c * Math.cos(k.lat *Hq); + d = d + (u * k.lat * c - v * hhh); + } + Poi g1 = ring.get(ring.size()-1); + Poi point = ring.get(0); + double eee = g1.lng * c * Math.cos(g1.lat * Hq); + double g2 = g1.lat * c; + double k = point.lng * c * Math.cos(point.lat * Hq); + d += eee * point.lat * c - k * g2; + return new BigDecimal( 0.5*Math.abs(d)).divide(new BigDecimal(1000000)); + } + public static void main(String[] args) { + List poiList = new ArrayList(); + //林和西地铁站 + poiList.add(new Poi(113.323947,23.141525)); + //五羊邨地铁站 + poiList.add(new Poi(113.314119,23.119977)); + //体育中心南地铁站 + poiList.add(new Poi(113.324247,23.134501)); + //猎德地铁站 + poiList.add(new Poi(113.331972,23.118477)); + + BigDecimal area = getArea(poiList); + System.out.println( "面积:"+ area + "平方米" ); + + //天河体育馆 + Poi inPoi = new Poi(113.323239,23.135428); + //天河路 + Poi inPoi2 = new Poi(113.321522,23.13381); + //黄埔大道 + Poi outPoi = new Poi(113.324462,23.127002); + // 大剧院 + Poi outPoi2 = new Poi(113.324247,23.116188); + // 天河中学 + Poi outPoi3 = new Poi(113.319773,23.121664); + // 杨箕地铁站 + Poi outPoi4 = new Poi(113.307757,23.127249); + + System.out.println("inPoi是否在圈内:" + IsPtInPoly(inPoi.lng,inPoi.lat,poiList) ); + System.out.println("inPoi2是否在圈内:" + IsPtInPoly(inPoi2.lng,inPoi2.lat,poiList) ); + + System.out.println("outPoi是否在圈内:" + IsPtInPoly(outPoi.lng,outPoi.lat,poiList) ); + System.out.println("outPoi2是否在圈内:" + IsPtInPoly(outPoi2.lng,outPoi2.lat,poiList) ); + System.out.println("outPoi3是否在圈内:" + IsPtInPoly(outPoi3.lng,outPoi3.lat,poiList) ); + System.out.println("outPoi4是否在圈内:" + IsPtInPoly(outPoi4.lng,outPoi4.lat,poiList) ); + } + + + + + public static boolean IsPtInPoly(double ALon, double ALat, List APoints) + { + int iSum = 0, iCount; + double dLon1, dLon2, dLat1, dLat2, dLon; + if (APoints.size() < 3) + return false; + iCount = APoints.size(); + for (int i = 0; i < iCount - 1; i++) + { + if (i == iCount - 1) + { + dLon1 = APoints.get(i).lng; + dLat1 = APoints.get(i).lat; + dLon2 = APoints.get(0).lng; + dLat2 = APoints.get(0).lat; + } + else + { + dLon1 = APoints.get(i).lng; + dLat1 = APoints.get(i).lat; + dLon2 = APoints.get(i+1).lng; + dLat2 = APoints.get(i+1).lat; + } + //以下语句判断A点是否在边的两端点的水平平行线之间,在则可能有交点,开始判断交点是否在左射线上 + if (((ALat >= dLat1) && (ALat < dLat2)) || ((ALat >= dLat2) && (ALat < dLat1))) + { + if (Math.abs(dLat1 - dLat2) > 0) + { + //得到 A点向左射线与边的交点的x坐标: + dLon = dLon1 - ((dLon1 - dLon2) * (dLat1 - ALat)) / (dLat1 - dLat2); + + // 如果交点在A点左侧(说明是做射线与边的交点),则射线与边的全部交点数加一: + if (dLon < ALon) + iSum++; + } + } + } + if (iSum % 2 != 0) + return true; + return false; + } +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/common/ImageUtils.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/common/ImageUtils.java new file mode 100644 index 0000000..457f2b7 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/common/ImageUtils.java @@ -0,0 +1,155 @@ +package com.ruoyi.dataprocess.common; + +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.utils.uuid.UUID; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.*; +import java.text.SimpleDateFormat; +import java.util.Base64; +import java.util.Date; + +/** + * @Description: 图片工具类 + * @ClassName: ImageUtils + * @Author : xins + * @Date :2023-09-04 15:57 + * @Version :1.0 + */ +public class ImageUtils { + + public static final String BASE64_PREFIX = "data:image/";//base64图片前缀 + public static final String BASE64_SUFFIX = ";base64";//base64图片后缀 + + /** + * @param imagePatternArr + * @return String + * @param: base64Str + * @description 校验base64字符串是否是图片, 并且返回图片类型 + * @author xins + * @date 2023-09-04 16:05 + */ + public static String getImageType(String base64Str, String[] imagePatternArr) { + for (String imagePattern : imagePatternArr) { + String base64Pattern = BASE64_PREFIX + imagePattern + BASE64_SUFFIX; + if (base64Str.indexOf(base64Pattern) > -1) { + return imagePattern; + } + } + return ""; + } + + /** + * @return String + * @param: imageFileName + * @description 图片转base64 + * @author xins + * @date 2023-09-04 15:58 + */ + public static String convertImageToBase64(String imageFileName) { + ByteArrayOutputStream baos = null; + try { + //获取图片类型 + String suffix = imageFileName.substring(imageFileName.lastIndexOf(".") + 1); + //构建文件 + File imageFile = new File(imageFileName); + //通过ImageIO把文件读取成BufferedImage对象 + BufferedImage bufferedImage = ImageIO.read(imageFile); + //构建字节数组输出流 + baos = new ByteArrayOutputStream(); + //写入流 + ImageIO.write(bufferedImage, suffix, baos); + //通过字节数组流获取字节数组 + byte[] bytes = baos.toByteArray(); + //获取JDK8里的编码器Base64.Encoder转为base64字符 + return Base64.getEncoder().encodeToString(bytes); + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + if (baos != null) { + baos.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + return null; + } + + + /** + * @param: base64 + * @param: imageFileName + * @description base64字符串转图片 + * @author xins + * @date 2023-09-04 15:59 + */ + public static String convertBase64ToImage(String base64Str, String imagePath, String imageType, Long deviceId) { + // 解密 + try { + String fileName = UUID.randomUUID().toString().concat(".").concat(imageType); + SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); + Date date = new Date(); + String dateStr = format.format(date); + + String fullPath = imagePath + File.separator + deviceId + + File.separator + dateStr; + File file = new File(fullPath); + if (!file.exists()) { + file.mkdirs(); + } + + // 去掉base64前缀 data:image/jpeg;base64, + String imageFileName = fullPath + File.separator + fileName; + base64Str = base64Str.substring(base64Str.indexOf(",", 1) + 1); + // 解密,解密的结果是一个byte数组 + Base64.Decoder decoder = Base64.getDecoder(); + byte[] imgbytes = decoder.decode(base64Str); + for (int i = 0; i < imgbytes.length; ++i) { + if (imgbytes[i] < 0) { + imgbytes[i] += 256; + } + } + + // 保存图片 + OutputStream out = new FileOutputStream(imageFileName); + out.write(imgbytes); + out.flush(); + out.close(); + // 返回图片的相对路径 = 图片分类路径+图片名+图片后缀 + return imageFileName; + } catch (IOException e) { + return null; + } + + } + + + public static String getFileContent(FileInputStream fis, String encoding) throws IOException { + try (BufferedReader br = new BufferedReader(new InputStreamReader(fis, encoding))) { + StringBuilder sb = new StringBuilder(); + String line; + while ((line = br.readLine()) != null) { + sb.append(line); + } + return sb.toString(); + } + } + + + public static void main(String[] args) throws IOException { + // 从txt文件中读取base64字符串 + FileInputStream fis = new FileInputStream("e://base64test/base64test5.txt"); + String base64Str = getFileContent(fis, "UTF-8"); + String[] imagePatternArr = {"png", "jpg", "jpeg"}; + String imageType = ImageUtils.getImageType(base64Str, imagePatternArr); + ImageUtils.convertBase64ToImage(base64Str,"images",imageType,2L); + + // 将base64字符串翻译成图片 + + + } + +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/common/SpringBeanUtils.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/common/SpringBeanUtils.java new file mode 100644 index 0000000..2893d94 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/common/SpringBeanUtils.java @@ -0,0 +1,77 @@ +package com.ruoyi.dataprocess.common; + +import org.springframework.beans.factory.DisposableBean; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Service; + +@Service +public class SpringBeanUtils implements ApplicationContextAware, DisposableBean { + private static ApplicationContext applicationContext = null; + + + /** + * 取得存储在静态变量中的ApplicationContext. + */ + public static ApplicationContext getApplicationContext() { + assertContextInjected(); + return applicationContext; + } + + /** + * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. + */ + @SuppressWarnings("unchecked") + public static T getBean(String name) { +// log.debug("从SpringContextHolder中取出Bean:" + name); + assertContextInjected(); + return (T) applicationContext.getBean(name); + } + + /** + * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. + */ + public static T getBean(Class requiredType) { + assertContextInjected(); + return applicationContext.getBean(requiredType); + } + + /** + * 清除SpringContextHolder中的ApplicationContext为Null. + */ + public static void clearHolder() { +// log.debug("清除SpringContextHolder中的ApplicationContext:" +// + applicationContext); + applicationContext = null; + } + + /** + * 实现ApplicationContextAware接口, 注入Context到静态变量中. + */ + @Override + public void setApplicationContext(ApplicationContext applicationContext) { + + if (SpringBeanUtils.applicationContext != null) { +// log.warn("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + SpringContextHolder.applicationContext); + } + + SpringBeanUtils.applicationContext = applicationContext; // NOSONAR + } + + /** + * 实现DisposableBean接口, 在Context关闭时清理静态变量. + */ + @Override + public void destroy() throws Exception { + SpringBeanUtils.clearHolder(); + } + + /** + * 检查ApplicationContext不为空. + */ + private static void assertContextInjected() { + if (applicationContext == null) { + throw new IllegalStateException("applicaitonContext属性未注入, 请在applicationContext.xml中定义SpringBeanUtils."); + } + } +} \ No newline at end of file diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/config/RedisMessageListenerConfig.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/config/RedisMessageListenerConfig.java new file mode 100644 index 0000000..067e31a --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/config/RedisMessageListenerConfig.java @@ -0,0 +1,38 @@ +package com.ruoyi.dataprocess.config; + +import com.ruoyi.dataprocess.listener.RedisMessageListener; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.listener.PatternTopic; +import org.springframework.data.redis.listener.RedisMessageListenerContainer; + +import java.util.Arrays; +import java.util.List; + +@Configuration +public class RedisMessageListenerConfig { + + @Autowired + private RedisMessageListener redisMessageListener; + @Autowired + private RedisConnectionFactory redisConnectionFactory; + + /** + * 配置订阅关系 + */ + @Bean + public RedisMessageListenerContainer container() { + RedisMessageListenerContainer container = new RedisMessageListenerContainer(); + container.setConnectionFactory(redisConnectionFactory); + + //订阅频道 + List topicList = Arrays.asList(new PatternTopic("life.*"),new PatternTopic("*.life")); + container.addMessageListener(redisMessageListener, topicList); + + return container; + } + +} + diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/domain/HwAlarmInfo.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/domain/HwAlarmInfo.java new file mode 100644 index 0000000..b666f6e --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/domain/HwAlarmInfo.java @@ -0,0 +1,257 @@ +package com.ruoyi.dataprocess.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 报警信息对象 hw_alarm_info + * + * @author xins + * @date 2023-09-04 + */ +public class HwAlarmInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 报警信息ID */ + private Long alarmInfoId; + + /** 报警信息类型(1、设备报警,2、监控单元报警,3、离线报警,4、电子围栏) */ + @Excel(name = "报警信息类型", readConverterExp = "1=、设备报警,2、监控单元报警,3、离线报警,4、电子围栏") + private String alarmInfoType; + + /** 报警信息类型是1关联表alarm_rule的字段alarm_rule_id; + 报警信息类型是3关联表hw_offline_rule的字段offline_rule_id; + 报警信息类型是4关联表hw_electronic_fence的字段electronic_fence_id。 */ + @Excel(name = "报警信息类型是1关联表alarm_rule的字段alarm_rule_id;" + + "报警信息类型是3关联表hw_offline_rule的字段offline_rule_id; " + + "报警信息类型是4关联表hw_electronic_fence的字段electronic_fence_id。") + private Long alarmReleatedId; + + /** 报警设备ID,关联hw_device表的device_id字段 */ + @Excel(name = "报警设备ID,关联hw_device表的device_id字段") + private Long deviceId; + + /** 所属监控单元Id,关联表hw_monitor_unit字段monitor_unit_id */ + @Excel(name = "所属监控单元Id,关联表hw_monitor_unit字段monitor_unit_id") + private Long monitorUnitId; + + /** 所属场景ID,关联hw_scene的scene_id */ + @Excel(name = "所属场景ID,关联hw_scene的scene_id") + private Long sceneId; + + /** 报警级别,关联hw_alarm_level的字段alarm_level_id,报警信息类型为1、2和3时保存 */ + @Excel(name = "报警级别,关联hw_alarm_level的字段alarm_level_id,报警信息类型为1、2和3时保存") + private Long alarmLevelId; + + /** 报警类型,关联hw_alarm_type的字段alarm_type_id,报警信息类型为1和2时保存 */ + @Excel(name = "报警类型,关联hw_alarm_type的字段alarm_type_id,报警信息类型为1和2时保存") + private Long alarmTypeId; + + /** 设备模型功能ID */ + @Excel(name = "设备模型功能ID") + private Long modeFunctionId; + + /** 功能名称 */ + @Excel(name = "功能名称") + private String functionName; + + /** 标识符 */ + @Excel(name = "标识符") + private String functionIdentifier; + + /** 最新的值,如果是电子围栏则存经度_纬度 */ + @Excel(name = "最新的值,如果是电子围栏则存经度_纬度") + private String functionValue; + + /** 触发状态(1、出界,2、入界,3、双向),报警信息类型为4时保存 */ + @Excel(name = "触发状态", readConverterExp = "1=、出界,2、入界,3、双向") + private String triggerStatus; + + /** 处理状态(0、未处理 1、已处理) */ + @Excel(name = "处理状态", readConverterExp = "0=、未处理,1=、已处理") + private String handleStatus; + + /** 实际报警时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "实际报警时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date alarmTime; + + /** 预留字段 */ + @Excel(name = "预留字段") + private String alarmInfoField; + + public void setAlarmInfoId(Long alarmInfoId) + { + this.alarmInfoId = alarmInfoId; + } + + public Long getAlarmInfoId() + { + return alarmInfoId; + } + public void setAlarmInfoType(String alarmInfoType) + { + this.alarmInfoType = alarmInfoType; + } + + public String getAlarmInfoType() + { + return alarmInfoType; + } + public void setAlarmReleatedId(Long alarmReleatedId) + { + this.alarmReleatedId = alarmReleatedId; + } + + public Long getAlarmReleatedId() + { + return alarmReleatedId; + } + public void setDeviceId(Long deviceId) + { + this.deviceId = deviceId; + } + + public Long getDeviceId() + { + return deviceId; + } + public void setMonitorUnitId(Long monitorUnitId) + { + this.monitorUnitId = monitorUnitId; + } + + public Long getMonitorUnitId() + { + return monitorUnitId; + } + public void setSceneId(Long sceneId) + { + this.sceneId = sceneId; + } + + public Long getSceneId() + { + return sceneId; + } + public void setAlarmLevelId(Long alarmLevelId) + { + this.alarmLevelId = alarmLevelId; + } + + public Long getAlarmLevelId() + { + return alarmLevelId; + } + public void setAlarmTypeId(Long alarmTypeId) + { + this.alarmTypeId = alarmTypeId; + } + + public Long getAlarmTypeId() + { + return alarmTypeId; + } + public void setModeFunctionId(Long modeFunctionId) + { + this.modeFunctionId = modeFunctionId; + } + + public Long getModeFunctionId() + { + return modeFunctionId; + } + public void setFunctionName(String functionName) + { + this.functionName = functionName; + } + + public String getFunctionName() + { + return functionName; + } + public void setFunctionIdentifier(String functionIdentifier) + { + this.functionIdentifier = functionIdentifier; + } + + public String getFunctionIdentifier() + { + return functionIdentifier; + } + public void setFunctionValue(String functionValue) + { + this.functionValue = functionValue; + } + + public String getFunctionValue() + { + return functionValue; + } + public void setTriggerStatus(String triggerStatus) + { + this.triggerStatus = triggerStatus; + } + + public String getTriggerStatus() + { + return triggerStatus; + } + public void setHandleStatus(String handleStatus) + { + this.handleStatus = handleStatus; + } + + public String getHandleStatus() + { + return handleStatus; + } + public void setAlarmTime(Date alarmTime) + { + this.alarmTime = alarmTime; + } + + public Date getAlarmTime() + { + return alarmTime; + } + public void setAlarmInfoField(String alarmInfoField) + { + this.alarmInfoField = alarmInfoField; + } + + public String getAlarmInfoField() + { + return alarmInfoField; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("alarmInfoId", getAlarmInfoId()) + .append("alarmInfoType", getAlarmInfoType()) + .append("alarmReleatedId", getAlarmReleatedId()) + .append("deviceId", getDeviceId()) + .append("monitorUnitId", getMonitorUnitId()) + .append("sceneId", getSceneId()) + .append("alarmLevelId", getAlarmLevelId()) + .append("alarmTypeId", getAlarmTypeId()) + .append("modeFunctionId", getModeFunctionId()) + .append("functionName", getFunctionName()) + .append("functionIdentifier", getFunctionIdentifier()) + .append("functionValue", getFunctionValue()) + .append("triggerStatus", getTriggerStatus()) + .append("handleStatus", getHandleStatus()) + .append("alarmTime", getAlarmTime()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("alarmInfoField", getAlarmInfoField()) + .toString(); + } +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/domain/HwDevice.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/domain/HwDevice.java new file mode 100644 index 0000000..46d25c5 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/domain/HwDevice.java @@ -0,0 +1,341 @@ +package com.ruoyi.dataprocess.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 设备信息对象 hw_device + * + * @author xins + * @date 2023-08-24 + */ +public class HwDevice extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 设备ID */ + private Long deviceId; + + /** 设备编号 */ + @Excel(name = "设备编号") + private String deviceCode; + + /** 设备名称 */ + @Excel(name = "设备名称") + private String deviceName; + + /** 所属场景,关联hw_scene表的scene_id字段 */ + @Excel(name = "所属场景,关联hw_scene表的scene_id字段") + private Long sceneId; + + /** 所属监控单元,关联表hw_monitor_unit字段monitor_unit_id */ + @Excel(name = "所属监控单元,关联表hw_monitor_unit字段monitor_unit_id") + private Long monitorUnitId; + + /** 设备类型(1:网关设备,2:网关子设备,3:直连设备) */ + @Excel(name = "设备类型", readConverterExp = "1=:网关设备,2:网关子设备,3:直连设备") + private String deviceType; + + /** 联网方式(1:Wi-Fi,2、蜂窝(2G/3G/4G/5G),3、以太网,4、其他) */ + @Excel(name = "联网方式(1:Wi-Fi,2、蜂窝(2G/3G/4G/5G),3、以太网,4、其他)") + private String networkingMode; + + /** 接入协议(1、MQTT) */ + @Excel(name = "接入协议", readConverterExp = "1=、MQTT") + private Long accessProtocol; + + /** 数据格式(1、Json) */ + @Excel(name = "数据格式", readConverterExp = "1=、Json") + private Long dataFormat; + + /** 关联设备,hw_device表中国的device_id */ + @Excel(name = "关联设备,hw_device表中国的device_id") + private Long releatedDeviceId; + + /** 设备模型,关联表hw_device_mode的字段device_mode_id */ + @Excel(name = "设备模型,关联表hw_device_mode的字段device_mode_id") + private Long deviceModeId; + + /** 接入网关协议(1、Modbus) + OPC-UA,Modbus,北向接入(阿里云、小度接入),南向接入,视频类接入,通道类接入,自定义接入 */ + @Excel(name = "接入网关协议", readConverterExp = "1=、Modbus") + private Long accessGwProtocol; + + /** 激活状态(1、激活,0、未激活) */ + @Excel(name = "激活状态", readConverterExp = "1=、激活,0、未激活") + private String activeStatus; + + /** 设备状态(0、测试,1、发布,9、删除) */ + @Excel(name = "设备状态", readConverterExp = "0=、测试,1、发布,9、删除") + private String deviceStatus; + + /** 设备激活时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "设备激活时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date activeTime; + + /** 设备图片地址(如果为空则可以使用设备模型图片) */ + @Excel(name = "设备图片地址", readConverterExp = "如=果为空则可以使用设备模型图片") + private String devicePic; + + /** 网络地址 */ + @Excel(name = "网络地址") + private String ipAddress; + + /** 预留字段,设备所在区域ID,关联表hw_area字段area_id) */ + @Excel(name = "预留字段,设备所在区域ID,关联表hw_area字段area_id)") + private Long areaId; + + /** 预留字段,设备位置(手动定位(在地图上选择设备所在的固定位置),自动定位(设备自动定位位置,关联网关自动定位位置。目前仅G780V2(固件版本V2.2.0之后)、PLCNET510、G800 V2和ModbusRTU(云端轮询)定位型变量支持选择自动定位功能)) */ + @Excel(name = "预留字段,设备位置", readConverterExp = "手=动定位(在地图上选择设备所在的固定位置") + private String deviceLocation; + + /** 当前固件版本(Linux系统) */ + @Excel(name = "当前固件版本(Linux系统)") + private String currentModuleVersion; + + /** 当前单片机固件版本 */ + @Excel(name = "当前单片机固件版本") + private String currentSinglechipVersion; + + /** 预留字段 */ + @Excel(name = "预留字段") + private String deviceField; + + public void setDeviceId(Long deviceId) + { + this.deviceId = deviceId; + } + + public Long getDeviceId() + { + return deviceId; + } + public void setDeviceCode(String deviceCode) + { + this.deviceCode = deviceCode; + } + + public String getDeviceCode() + { + return deviceCode; + } + public void setDeviceName(String deviceName) + { + this.deviceName = deviceName; + } + + public String getDeviceName() + { + return deviceName; + } + public void setSceneId(Long sceneId) + { + this.sceneId = sceneId; + } + + public Long getSceneId() + { + return sceneId; + } + public void setMonitorUnitId(Long monitorUnitId) + { + this.monitorUnitId = monitorUnitId; + } + + public Long getMonitorUnitId() + { + return monitorUnitId; + } + public void setDeviceType(String deviceType) + { + this.deviceType = deviceType; + } + + public String getDeviceType() + { + return deviceType; + } + public void setNetworkingMode(String networkingMode) + { + this.networkingMode = networkingMode; + } + + public String getNetworkingMode() + { + return networkingMode; + } + public void setAccessProtocol(Long accessProtocol) + { + this.accessProtocol = accessProtocol; + } + + public Long getAccessProtocol() + { + return accessProtocol; + } + public void setDataFormat(Long dataFormat) + { + this.dataFormat = dataFormat; + } + + public Long getDataFormat() + { + return dataFormat; + } + public void setReleatedDeviceId(Long releatedDeviceId) + { + this.releatedDeviceId = releatedDeviceId; + } + + public Long getReleatedDeviceId() + { + return releatedDeviceId; + } + public void setDeviceModeId(Long deviceModeId) + { + this.deviceModeId = deviceModeId; + } + + public Long getDeviceModeId() + { + return deviceModeId; + } + public void setAccessGwProtocol(Long accessGwProtocol) + { + this.accessGwProtocol = accessGwProtocol; + } + + public Long getAccessGwProtocol() + { + return accessGwProtocol; + } + public void setActiveStatus(String activeStatus) + { + this.activeStatus = activeStatus; + } + + public String getActiveStatus() + { + return activeStatus; + } + public void setDeviceStatus(String deviceStatus) + { + this.deviceStatus = deviceStatus; + } + + public String getDeviceStatus() + { + return deviceStatus; + } + public void setActiveTime(Date activeTime) + { + this.activeTime = activeTime; + } + + public Date getActiveTime() + { + return activeTime; + } + public void setDevicePic(String devicePic) + { + this.devicePic = devicePic; + } + + public String getDevicePic() + { + return devicePic; + } + public void setIpAddress(String ipAddress) + { + this.ipAddress = ipAddress; + } + + public String getIpAddress() + { + return ipAddress; + } + public void setAreaId(Long areaId) + { + this.areaId = areaId; + } + + public Long getAreaId() + { + return areaId; + } + public void setDeviceLocation(String deviceLocation) + { + this.deviceLocation = deviceLocation; + } + + public String getDeviceLocation() + { + return deviceLocation; + } + public void setCurrentModuleVersion(String currentModuleVersion) + { + this.currentModuleVersion = currentModuleVersion; + } + + public String getCurrentModuleVersion() + { + return currentModuleVersion; + } + public void setCurrentSinglechipVersion(String currentSinglechipVersion) + { + this.currentSinglechipVersion = currentSinglechipVersion; + } + + public String getCurrentSinglechipVersion() + { + return currentSinglechipVersion; + } + public void setDeviceField(String deviceField) + { + this.deviceField = deviceField; + } + + public String getDeviceField() + { + return deviceField; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("deviceId", getDeviceId()) + .append("deviceCode", getDeviceCode()) + .append("deviceName", getDeviceName()) + .append("sceneId", getSceneId()) + .append("monitorUnitId", getMonitorUnitId()) + .append("deviceType", getDeviceType()) + .append("networkingMode", getNetworkingMode()) + .append("accessProtocol", getAccessProtocol()) + .append("dataFormat", getDataFormat()) + .append("releatedDeviceId", getReleatedDeviceId()) + .append("deviceModeId", getDeviceModeId()) + .append("accessGwProtocol", getAccessGwProtocol()) + .append("activeStatus", getActiveStatus()) + .append("deviceStatus", getDeviceStatus()) + .append("activeTime", getActiveTime()) + .append("devicePic", getDevicePic()) + .append("ipAddress", getIpAddress()) + .append("areaId", getAreaId()) + .append("deviceLocation", getDeviceLocation()) + .append("currentModuleVersion", getCurrentModuleVersion()) + .append("currentSinglechipVersion", getCurrentSinglechipVersion()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("deviceField", getDeviceField()) + .toString(); + } +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/domain/HwElectronicFence.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/domain/HwElectronicFence.java new file mode 100644 index 0000000..13ead56 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/domain/HwElectronicFence.java @@ -0,0 +1,205 @@ +package com.ruoyi.dataprocess.domain; + +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +public class HwElectronicFence extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 电子围栏ID */ + private Long electronicFenceId; + + /** 电子围栏名称 */ + @Excel(name = "电子围栏名称") + private String electronicFenceName; + + /** 所属场景 */ + @Excel(name = "所属场景") + private Long sceneId; + + /** 规则类型 */ + @Excel(name = "规则类型") + private Long fenceType; + + /** 生效时间标识 */ + @Excel(name = "生效时间标识") + private String effectiveTimeFlag; + + /** 生效时间:开始时间_结束时间_状态,多个用|隔开(例如00:00_05:00_1|06:00_08:00_0),状态:(1、开启、2、关闭) */ + @Excel(name = "生效时间:开始时间_结束时间_状态,多个用|隔开", readConverterExp = "例=如00:00_05:00_1|06:00_08:00_0") + private String effectiveTime; + + /** 触发状态(0、关闭,1、出界,2、入界,3、双向) */ + @Excel(name = "触发状态", readConverterExp = "0=、关闭,1、出界,2、入界,3、双向") + private String triggerStatus; + + /** 区域形状(1、多边形,2、圆形) */ + @Excel(name = "区域形状", readConverterExp = "1=、多边形,2、圆形") + private String areaShapeFlag; + + /** 区域范围:为多边形时保存格式,经度_纬度,多个以|隔开;为圆形时的中心点和半径,下划线隔开 */ + @Excel(name = "区域范围", readConverterExp = "为多边形时保存格式为经度_纬度,多个以|隔开;为圆形时的中心点和半径,下划线") + private String areaRange; + + /** 报警推送标识(1、是,0、否) */ + @Excel(name = "报警推送标识(1、是,0、否)") + private Long fencePushFlag; + + /** 报警推送内容 */ + @Excel(name = "报警推送内容") + private String fencePushContent; + + /** 恢复正常推送内容 */ + @Excel(name = "恢复正常推送内容") + private String fenceRecoverContent; + + /** 预留字段 */ + @Excel(name = "预留字段") + private String fenceField; + + public void setElectronicFenceId(Long electronicFenceId) + { + this.electronicFenceId = electronicFenceId; + } + + public Long getElectronicFenceId() + { + return electronicFenceId; + } + public void setElectronicFenceName(String electronicFenceName) + { + this.electronicFenceName = electronicFenceName; + } + + public String getElectronicFenceName() + { + return electronicFenceName; + } + public void setSceneId(Long sceneId) + { + this.sceneId = sceneId; + } + + public Long getSceneId() + { + return sceneId; + } + public void setFenceType(Long fenceType) + { + this.fenceType = fenceType; + } + + public Long getFenceType() + { + return fenceType; + } + public void setEffectiveTimeFlag(String effectiveTimeFlag) + { + this.effectiveTimeFlag = effectiveTimeFlag; + } + + public String getEffectiveTimeFlag() + { + return effectiveTimeFlag; + } + public void setEffectiveTime(String effectiveTime) + { + this.effectiveTime = effectiveTime; + } + + public String getEffectiveTime() + { + return effectiveTime; + } + public void setTriggerStatus(String triggerStatus) + { + this.triggerStatus = triggerStatus; + } + + public String getTriggerStatus() + { + return triggerStatus; + } + public void setAreaShapeFlag(String areaShapeFlag) + { + this.areaShapeFlag = areaShapeFlag; + } + + public String getAreaShapeFlag() + { + return areaShapeFlag; + } + public void setAreaRange(String areaRange) + { + this.areaRange = areaRange; + } + + public String getAreaRange() + { + return areaRange; + } + + public void setFencePushFlag(Long fencePushFlag) + { + this.fencePushFlag = fencePushFlag; + } + + public Long getFencePushFlag() + { + return fencePushFlag; + } + public void setFencePushContent(String fencePushContent) + { + this.fencePushContent = fencePushContent; + } + + public String getFencePushContent() + { + return fencePushContent; + } + public void setFenceRecoverContent(String fenceRecoverContent) + { + this.fenceRecoverContent = fenceRecoverContent; + } + + public String getFenceRecoverContent() + { + return fenceRecoverContent; + } + public void setFenceField(String fenceField) + { + this.fenceField = fenceField; + } + + public String getFenceField() + { + return fenceField; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("electronicFenceId", getElectronicFenceId()) + .append("electronicFenceName", getElectronicFenceName()) + .append("sceneId", getSceneId()) + .append("fenceType", getFenceType()) + .append("effectiveTimeFlag", getEffectiveTimeFlag()) + .append("effectiveTime", getEffectiveTime()) + .append("triggerStatus", getTriggerStatus()) + .append("areaShapeFlag", getAreaShapeFlag()) + .append("areaRange", getAreaRange()) + .append("fencePushFlag", getFencePushFlag()) + .append("fencePushContent", getFencePushContent()) + .append("fenceRecoverContent", getFenceRecoverContent()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("fenceField", getFenceField()) + .toString(); + } +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/listener/RedisMessageListener.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/listener/RedisMessageListener.java new file mode 100644 index 0000000..d31516a --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/listener/RedisMessageListener.java @@ -0,0 +1,30 @@ +package com.ruoyi.dataprocess.listener; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.connection.Message; +import org.springframework.data.redis.connection.MessageListener; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.stereotype.Component; + +@Component +@Slf4j +public class RedisMessageListener implements MessageListener { + + @Autowired + private RedisTemplate redisTemplate; + + @Override + public void onMessage(Message message, byte[] pattern) { + + RedisSerializer keySerializer = redisTemplate.getKeySerializer(); + RedisSerializer valueSerializer = redisTemplate.getValueSerializer(); + + log.info("----------Life接收到发布者消息----------"); + log.info("|频道:{}",keySerializer.deserialize(message.getChannel())); + log.info("|当前监听器绑定的pattern:{}",new String(pattern)); + log.info("|消息内容:{}",valueSerializer.deserialize(message.getBody())); + log.info("---------------------------------"); + } +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mapper/HwAlarmInfoMapper.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mapper/HwAlarmInfoMapper.java new file mode 100644 index 0000000..9c8c387 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mapper/HwAlarmInfoMapper.java @@ -0,0 +1,20 @@ +package com.ruoyi.dataprocess.mapper; + +import com.ruoyi.dataprocess.domain.HwAlarmInfo; + +/** + * 报警信息Mapper接口 + * + * @author xins + * @date 2023-09-04 + */ +public interface HwAlarmInfoMapper { + /** + * 新增报警信息 + * + * @param hwAlarmInfo 报警信息 + * @return 结果 + */ + public int insertHwAlarmInfo(HwAlarmInfo hwAlarmInfo); + +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mapper/HwDeviceMapper.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mapper/HwDeviceMapper.java new file mode 100644 index 0000000..6f60e55 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mapper/HwDeviceMapper.java @@ -0,0 +1,25 @@ +package com.ruoyi.dataprocess.mapper; + + +import com.ruoyi.dataprocess.domain.HwDevice; + +import java.util.List; + +/** + * 设备信息Mapper接口 + * + * @author xins + * @date 2023-08-24 + */ +public interface HwDeviceMapper +{ + /** + * 查询设备信息 + * + * @param deviceCode 设备编号,唯一 + * @return 设备信息 + */ + public HwDevice selectHwDeviceByDeviceCode(String deviceCode); + + +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mapper/HwElectronicFenceMapper.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mapper/HwElectronicFenceMapper.java new file mode 100644 index 0000000..0375416 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mapper/HwElectronicFenceMapper.java @@ -0,0 +1,50 @@ +package com.ruoyi.dataprocess.mapper; + + +import com.ruoyi.dataprocess.domain.HwElectronicFence; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Description: 电子围栏实体类 + * @ClassName: HwElectronicFenceMapper + * @Author : xins + * @Date :2023-09-03 11:48 + * @Version :1.0 + */ +public interface HwElectronicFenceMapper { + + public List selectSuitableElectronicFenceList(@Param("deviceId") Long deviceId, + @Param("monitorUnitId") Long monitorUnitId, + @Param("sceneId") Long sceneId); + + /** + * @param: deviceId + * @description 根据设备ID获取电子围栏配置 + * @author xins + * @date 2023-09-03 12:10 + * @return List + */ + public List selectElectronicFencesByDeviceId(Long deviceId); + + /** + * @param: monitorUnitId + * @description 根据监控单元ID获取电子围栏配置 + * @author xins + * @date 2023-09-03 12:11 + * @return List + */ + public List selectElectronicFencesByMonitorUnitId(Long monitorUnitId); + + /** + * @param: sceneId + * @description 根据场景Id获取电子围栏配置 + * @author xins + * @date 2023-09-03 12:11 + * @return List + */ + public List selectElectronicFencesBySceneId(Long sceneId); + + +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mqtt/client/config/MqttConfiguration.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mqtt/client/config/MqttConfiguration.java new file mode 100644 index 0000000..7f9b9ce --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mqtt/client/config/MqttConfiguration.java @@ -0,0 +1,239 @@ +package com.ruoyi.dataprocess.mqtt.client.config; + +import com.ruoyi.dataprocess.mqtt.client.listener.MqttClientConnectListener; +import com.ruoyi.dataprocess.service.IDataProcessService; +import com.ruoyi.dataprocess.service.IDeviceStatusService; +import net.dreamlu.iot.mqtt.codec.MqttPublishMessage; +import net.dreamlu.iot.mqtt.codec.MqttQoS; +import net.dreamlu.iot.mqtt.codec.MqttSubAckMessage; +import net.dreamlu.iot.mqtt.core.client.IMqttClientMessageListener; +import net.dreamlu.iot.mqtt.core.client.MqttClient; +import net.dreamlu.iot.mqtt.core.client.MqttClientCreator; +import net.dreamlu.iot.mqtt.spring.client.MqttClientCustomizer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.tio.core.ChannelContext; + +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; + +//mqtt: +// client: +// enabled: true # 是否开启客户端,默认:false 使用到的场景有限,非必要请不要启用 +// ip: 127.0.0.1 # 连接的服务端 ip ,默认:127.0.0.1 +// port: 1883 # 端口:默认:1883 +// name: Mica-Mqtt-Client # 名称,默认:Mica-Mqtt-Client +// clientId: 000001 # 客户端Id(非常重要,一般为设备 sn,不可重复) +// user-name: mica # 认证的用户名 +// password: 123456 # 认证的密码 +// timeout: 5 # 超时时间,单位:秒,默认:5秒 +// reconnect: true # 是否重连,默认:true +// re-interval: 5000 # 重连时间,默认 5000 毫秒 +// version: MQTT_5 # mqtt 协议版本,默认:3.1.1 +// read-buffer-size: 8KB # 接收数据的 buffer size,默认:8k +// max-bytes-in-message: 10MB # 消息解析最大 bytes 长度,默认:10M +// buffer-allocator: heap # 堆内存和堆外内存,默认:堆内存 +// keep-alive-secs: 60 # keep-alive 时间,单位:秒 +// clean-session: true # mqtt clean session,默认:true +// use-ssl: false # 是否启用 ssl,默认:false + +//todo:read-buffer-size +@Configuration +public class MqttConfiguration { + private static final Logger logger = LoggerFactory.getLogger(MqttConfiguration.class); + + @Value("${mqtt.client.ip}") + String ip; + @Value("${mqtt.client.port}") + int port; + @Value("${mqtt.client.username}") + String username; + @Value("${mqtt.client.password}") + String password; + @Value("${mqtt.client.clientId}") + String clientId; + @Value("${mqtt.client.timeout}") + int timeOut; + @Value("${mqtt.client.keepalive}") + int keepAlive; + @Value("${mqtt.client.qos}") + int qos; + @Value("${mqtt.client.dataTopicFilter}") + String dataTopicFilter; + @Value("${mqtt.client.deviceStatusTopic}") + String deviceStatusTopic; + @Value("${mqtt.client.imagePath}") + String imagePath; + @Value("${mqtt.client.imagePatterns}") + String imagePatterns; + + @Autowired + private IDataProcessService dataProcessService; + + @Autowired + private IDeviceStatusService deviceStatusService; + + @Bean//注入spring + public MqttClientCustomizer mqttClientCustomizer() { + return new MqttClientCustomizer() { + @Override + public void customize(MqttClientCreator creator) { + // 此处可自定义配置 creator,会覆盖 yml 中的配置 + System.out.println("----------------MqttServerCustomizer-----------------"); + MqttClient client = creator.ip(ip) + .port(port) + .username(username) + .password(password) + .timeout(timeOut) + .keepAliveSecs(keepAlive) +// 如果包体过大,建议将此参数设置和 maxBytesInMessage 一样大 +// .readBufferSize(1024 * 10) +// 最大包体长度,如果包体过大需要设置此参数 +// .maxBytesInMessage(1024 * 10) +// .version(MqttVersion.MQTT_5) +// 连接监听 + .connectListener(new MqttClientConnectListener()) + .willMessage(builder -> { + builder.topic("/test/offline") + .messageText("down") + .retain(false) + .qos(MqttQoS.AT_MOST_ONCE); // 遗嘱消息 + }) + // 同步连接,也可以使用 connect() 异步(可以避免 broker 没启动照成启动卡住),但是下面的订阅和发布可能还没连接成功。 + .connectSync(); + String[] topicArr = {dataTopicFilter, deviceStatusTopic}; + + client.subscribe(topicArr, MqttQoS.valueOf(qos), new IMqttClientMessageListener() { + @Override + public void onSubscribed(ChannelContext context, String topicFilter, MqttQoS mqttQoS, MqttSubAckMessage message) { + IMqttClientMessageListener.super.onSubscribed(context, topicFilter, mqttQoS, message); + } + + @Override + public void onSubscribed(ChannelContext context, String topicFilter, MqttQoS mqttQoS) { + IMqttClientMessageListener.super.onSubscribed(context, topicFilter, mqttQoS); + } + + @Override + public void onMessage(ChannelContext channelContext, String topic, MqttPublishMessage mqttPublishMessage, ByteBuffer payload) { + System.out.println("dataprocessservice:" + dataProcessService); + String payloadString = new String(payload.array(), StandardCharsets.UTF_8); + System.out.println("paa:" + topic); + logger.info("topic:{} payload:{}", topic, payloadString); + System.out.println(topic+"----"+dataTopicFilter); + System.out.println(topic.startsWith(dataTopicFilter)); + if (topic.startsWith(dataTopicFilter.replace("#",""))) { + dataProcessService.processBusinessData(payloadString, imagePath, imagePatterns); + } else if (topic.equals(deviceStatusTopic)) { + deviceStatusService.handleDeviceStatus(); + } + } + }); + +// client.subscribe(topicArr,MqttQoS.valueOf(1),new MqttClientMessageListener()); +// client.subQos0(dataTopic,new MqttClientMessageListener()); + } + }; + } + + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public int getPort() { + return port; + } + + public void setPort(int port) { + this.port = port; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public int getTimeOut() { + return timeOut; + } + + public void setTimeOut(int timeOut) { + this.timeOut = timeOut; + } + + public int getKeepAlive() { + return keepAlive; + } + + public void setKeepAlive(int keepAlive) { + this.keepAlive = keepAlive; + } + + public int getQos() { + return qos; + } + + public void setQos(int qos) { + this.qos = qos; + } + + public String getDataTopicFilter() { + return dataTopicFilter; + } + + public void setDataTopicFilter(String dataTopicFilter) { + this.dataTopicFilter = dataTopicFilter; + } + + public String getDeviceStatusTopic() { + return deviceStatusTopic; + } + + public void setDeviceStatusTopic(String deviceStatusTopic) { + this.deviceStatusTopic = deviceStatusTopic; + } + + public String getImagePath() { + return imagePath; + } + + public void setImagePath(String imagePath) { + this.imagePath = imagePath; + } + + public String getImagePatterns() { + return imagePatterns; + } + + public void setImagePatterns(String imagePatterns) { + this.imagePatterns = imagePatterns; + } +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mqtt/client/controller/ClientController.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mqtt/client/controller/ClientController.java new file mode 100644 index 0000000..bcc85f2 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mqtt/client/controller/ClientController.java @@ -0,0 +1,29 @@ +//package com.ruoyi.dataprocess.mqtt.client.controller; +// +//import com.ruoyi.dataprocess.mqtt.client.service.ClientService; +//import io.swagger.v3.oas.annotations.Operation; +//import io.swagger.v3.oas.annotations.tags.Tag; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.web.bind.annotation.*; +// +//@Tag(name = "Mqtt::客户端") +//@RequestMapping("/mqtt/client") +//@RestController +//public class ClientController { +// +// @Autowired +// private ClientService service; +// +// @Operation(summary = "publish") +// @PostMapping("/publish") +// public boolean publish(@RequestBody String body) { +// return service.publish(body); +// } +// +// @Operation(summary = "sub") +// @GetMapping("/sub") +// public boolean sub() { +// return service.sub(); +// } +// +//} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mqtt/client/listener/MqttClientConnectListener.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mqtt/client/listener/MqttClientConnectListener.java new file mode 100644 index 0000000..ba274d6 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mqtt/client/listener/MqttClientConnectListener.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2019-2029, Dreamlu 卢春梦 (596392912@qq.com & dreamlu.net). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.ruoyi.dataprocess.mqtt.client.listener; + +import net.dreamlu.iot.mqtt.core.client.IMqttClientConnectListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.tio.core.ChannelContext; + +/** + * 客户端连接状态监听 + * + * @author L.cm + */ +@Service +public class MqttClientConnectListener implements IMqttClientConnectListener { + private static final Logger logger = LoggerFactory.getLogger(MqttClientConnectListener.class); + + @Override + public void onConnected(ChannelContext context, boolean isReconnect) { + if (isReconnect) { + logger.info("重连 mqtt 服务器重连成功..."); + } else { + logger.info("连接 mqtt 服务器成功..."); + } + } + + @Override + public void onDisconnect(ChannelContext channelContext, Throwable throwable, String remark, boolean isRemove) { + logger.error("mqtt 链接断开 remark:{} isRemove:{}", remark, isRemove, throwable); + } + +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mqtt/client/listener/MqttClientMessageListener.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mqtt/client/listener/MqttClientMessageListener.java new file mode 100644 index 0000000..fd8f22c --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mqtt/client/listener/MqttClientMessageListener.java @@ -0,0 +1,67 @@ +//package com.ruoyi.dataprocess.mqtt.client.listener; +// +//import com.alibaba.fastjson.JSONArray; +//import com.alibaba.fastjson.JSONObject; +//import com.ruoyi.common.core.constant.TdEngineConstants; +//import com.ruoyi.common.core.domain.R; +//import com.ruoyi.common.core.enums.ResultEnums; +//import com.ruoyi.common.core.utils.SpringUtils; +//import com.ruoyi.common.core.utils.StringUtils; +//import com.ruoyi.dataprocess.common.SpringBeanUtils; +//import com.ruoyi.dataprocess.mapper.HwDeviceMapper; +//import com.ruoyi.dataprocess.mqtt.client.config.MqttConfiguration; +//import com.ruoyi.dataprocess.service.IDataProcessService; +//import com.ruoyi.system.api.RemoteFileService; +//import com.ruoyi.system.api.factory.RemoteFileFallbackFactory; +//import com.ruoyi.tdengine.api.RemoteTdEngineService; +//import com.ruoyi.tdengine.api.domain.TdField; +//import net.dreamlu.iot.mqtt.codec.MqttPublishMessage; +//import net.dreamlu.iot.mqtt.core.client.IMqttClientMessageListener; +//import org.slf4j.Logger; +//import org.slf4j.LoggerFactory; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; +//import org.springframework.stereotype.Controller; +//import org.springframework.stereotype.Service; +//import org.tio.core.ChannelContext; +// +//import javax.annotation.PostConstruct; +//import javax.annotation.Resource; +//import java.nio.ByteBuffer; +//import java.nio.charset.StandardCharsets; +//import java.util.List; +// +///** +// * 客户端消息监听的另一种方式 +// * +// * @author L.cm +// */ +//@Service +//public class MqttClientMessageListener implements IMqttClientMessageListener { +// private static final Logger logger = LoggerFactory.getLogger(MqttClientMessageListener.class); +// +// private IDataProcessService dataProcessService; +// +//// @PostConstruct +//// public void init() { +//// remoteTdEngineService = SpringBeanUtils.getBean(RemoteTdEngineService.class); +//// System.out.println("--***-"+remoteTdEngineService); +//// +//// } +// +// @Override +// public void onMessage(ChannelContext context, String topic, MqttPublishMessage message, ByteBuffer payload) { +// String payloadString = new String(payload.array(), StandardCharsets.UTF_8); +// System.out.println("paa:" + topic); +//// System.out.println("data"+dataProcessService); +// if(dataProcessService == null){ +// dataProcessService = SpringBeanUtils.getBean(IDataProcessService.class); +// } +//// if(topic.startsWith(MqttConfiguration)) +// dataProcessService.processBusinessData(payloadString); +// logger.info("topic:{} payload:{}", topic, payloadString); +// } +// +// +//} +// diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mqtt/client/service/ClientService.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mqtt/client/service/ClientService.java new file mode 100644 index 0000000..480a783 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/mqtt/client/service/ClientService.java @@ -0,0 +1,45 @@ +//package com.ruoyi.dataprocess.mqtt.client.service; +// +//import com.ruoyi.dataprocess.mqtt.client.config.MqttConfiguration; +//import com.ruoyi.dataprocess.mqtt.client.listener.MqttClientConnectListener; +//import com.ruoyi.dataprocess.mqtt.client.listener.MqttClientMessageListener; +//import net.dreamlu.iot.mqtt.codec.MqttQoS; +//import net.dreamlu.iot.mqtt.core.client.MqttClient; +//import net.dreamlu.iot.mqtt.spring.client.MqttClientTemplate; +//import org.slf4j.Logger; +//import org.slf4j.LoggerFactory; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; +//import org.springframework.stereotype.Service; +// +//import javax.annotation.PostConstruct; +//import java.nio.charset.StandardCharsets; +//import java.util.Arrays; +// +///** +// * @Description: MQTT客户端服务 +// * @ClassName: ClientService +// * @Author : xins +// * @Date :2023-08-31 14:33 +// * @Version :1.0 +// */ +//public class ClientService { +// private static final Logger logger = LoggerFactory.getLogger(ClientService.class); +// +// private MqttClientTemplate client; +// +// public boolean publish(String body) { +// client.publish("/test/client", body.getBytes(StandardCharsets.UTF_8)); +// return true; +// } +// +// public boolean sub(String topic) { +// client.subQos0(topic, new MqttClientMessageListener()); +//// String[] topicsArr = topics.split(","); +//// Arrays.asList(topicsArr).forEach(topicFilter -> +//// client.subQos0(topicFilter, new MqttClientMessageListener()) +//// ); +// return true; +// } +// +//} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/service/IDataProcessService.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/service/IDataProcessService.java new file mode 100644 index 0000000..18fe45e --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/service/IDataProcessService.java @@ -0,0 +1,15 @@ +package com.ruoyi.dataprocess.service; + +public interface IDataProcessService { + + /** + * @param: jsonData + * @param imagePath + * @param imagePatterns + * @description 处理业务数据 + * @author xins + * @date 2023-08-31 16:16 + */ + public void processBusinessData(String jsonData,String imagePath,String imagePatterns); + +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/service/IDeviceStatusService.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/service/IDeviceStatusService.java new file mode 100644 index 0000000..99f5a34 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/service/IDeviceStatusService.java @@ -0,0 +1,13 @@ +package com.ruoyi.dataprocess.service; + +/** + * @Description: 设备状态处理接口 + * @ClassName: IDeviceStatusService + * @Author : xins + * @Date :2023-09-04 15:32 + * @Version :1.0 + */ +public interface IDeviceStatusService { + + public void handleDeviceStatus(); +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/service/impl/DataProcessServiceImpl.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/service/impl/DataProcessServiceImpl.java new file mode 100644 index 0000000..759ebec --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/service/impl/DataProcessServiceImpl.java @@ -0,0 +1,294 @@ +package com.ruoyi.dataprocess.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.core.constant.HwDictConstants; +import com.ruoyi.common.core.constant.TdEngineConstants; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.enums.ResultEnums; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.dataprocess.amap.LocationVo; +import com.ruoyi.dataprocess.amap.PositionUtils; +import com.ruoyi.dataprocess.amap.PositionVo; +import com.ruoyi.dataprocess.common.ImageUtils; +import com.ruoyi.dataprocess.domain.HwAlarmInfo; +import com.ruoyi.dataprocess.domain.HwDevice; +import com.ruoyi.dataprocess.domain.HwElectronicFence; +import com.ruoyi.dataprocess.mapper.HwAlarmInfoMapper; +import com.ruoyi.dataprocess.mapper.HwDeviceMapper; +import com.ruoyi.dataprocess.mapper.HwElectronicFenceMapper; +import com.ruoyi.dataprocess.service.IDataProcessService; +import com.ruoyi.tdengine.api.RemoteTdEngineService; +import com.ruoyi.tdengine.api.domain.TdField; +import com.ruoyi.tdengine.api.domain.TdTableVo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @Description: 数据处理业务类 + * @ClassName: DataProcessServiceImpl + * @Author : xins + * @Date :2023-09-04 8:58 + * @Version :1.0 + */ +@Service +public class DataProcessServiceImpl implements IDataProcessService { + + private static final Logger logger = LoggerFactory.getLogger(DataProcessServiceImpl.class); + @Resource + private RemoteTdEngineService remoteTdEngineService; + + @Autowired + private HwDeviceMapper hwDeviceMapper; + + @Autowired + private HwElectronicFenceMapper hwElectronicFenceMapper; + + @Autowired + private HwAlarmInfoMapper hwAlarmInfoMapper; + + /** + * @param imagePath + * @param imagePatterns + * @param: jsonData + * @description 处理业务数据 + * @author xins + * @date 2023-08-31 16:16 + */ + @Override + public void processBusinessData(String jsonData, String imagePath, String imagePatterns) { + JSONObject json = JSON.parseObject(jsonData); + Long ts = json.getLong(TdEngineConstants.PAYLOAD_TS); + String tsStr = String.valueOf(ts); + if (tsStr.length() == 10) { + ts = ts * 1000; + } + JSONArray paramArr = json.getJSONArray(TdEngineConstants.PAYLOAD_PARAM); +// System.out.println(this.hwDeviceMapper); +// System.out.println(this.remoteTdEngineService); + for (int i = 0; i < paramArr.size(); i++) { + JSONObject paramJson = paramArr.getJSONObject(i); + JSONObject dataValueJson = paramJson.getJSONObject(TdEngineConstants.PAYLOAD_DATAVALUE); + String deviceCode = dataValueJson.getString(TdEngineConstants.PAYLOAD_DEVICE_CODE); + HwDevice hwDevice = hwDeviceMapper.selectHwDeviceByDeviceCode(deviceCode); + Long sceneId = hwDevice.getSceneId(); + Long deviceId = hwDevice.getDeviceId(); + Long monitorUnitId = hwDevice.getMonitorUnitId(); + String databaseName = TdEngineConstants.DEFAULT_DB_NAME_PREFIX + sceneId; + String tableName = TdEngineConstants.DEFAULT_TABLE_NAME_PREFIX + deviceId; + + dataValueJson.remove(TdEngineConstants.PAYLOAD_DEVICE_CODE); + TdTableVo tdTableVo = new TdTableVo(); + List schemaFields = new ArrayList<>(); + + //添加timestamp字段,默认字段名称是ts,协议上传的key是timestamp + TdField firstTdField = new TdField(); + firstTdField.setFieldName(TdEngineConstants.DEFAULT_FIRST_FIELD_NAME); + firstTdField.setFieldValue(ts); + schemaFields.add(firstTdField); + + Object longitude = null; + Object latitude = null; + + for (Map.Entry entry : dataValueJson.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + + /** + * 先对key进行转换,例如对于key是value的需要转换成value1; + */ + key = TdEngineConstants.TDENGINE_KEY_TRANSFER_MAP.get(key) == null ? key + : TdEngineConstants.TDENGINE_KEY_TRANSFER_MAP.get(key); + System.out.println(key + "---" + value); + + if (value instanceof String) { + String valueStr = (String) value; + if (StringUtils.isNotBlank(valueStr)) { + /** + * 先判读是否是图片,并获取图片名称, 获取到证明是图片 + */ + String[] imagePatternArr = imagePatterns.split(","); + String imageType = ImageUtils.getImageType(valueStr, imagePatternArr); + if (StringUtils.isNotBlank(imageType)) { + //保存图片,并返回图片详细地址进行赋值保存 + String imageFileName = ImageUtils.convertBase64ToImage(valueStr, imagePath, imageType, deviceId); + if (StringUtils.isNotBlank(imageFileName)) { + value = imageFileName; + } else { + continue; + } + } + + TdField tdField = new TdField(); + tdField.setFieldName(key); + tdField.setFieldValue(value); + schemaFields.add(tdField); + } + } else { + TdField tdField = new TdField(); + tdField.setFieldName(key); + tdField.setFieldValue(value); + schemaFields.add(tdField); + + //经纬度判断 + if (key.equalsIgnoreCase(HwDictConstants.DEFAULT_FUNCTION_LONGITUDE_IDENTIFIER)) { + longitude = value; + } else if (key.equalsIgnoreCase(HwDictConstants.DEFAULT_FUNCTION_LATITUDE_IDENTIFIER)) { + latitude = value; + } + } + } + + System.out.println(databaseName + "---" + tableName); + tdTableVo.setDatabaseName(databaseName); + tdTableVo.setTableName(tableName); + tdTableVo.setSchemaFields(schemaFields); + + System.out.println("longtitude:" + longitude + "latit:" + latitude); + + final R insertResult = this.remoteTdEngineService.insertTable(tdTableVo); + if (insertResult.getCode() == ResultEnums.SUCCESS.getCode()) { + logger.info("Insert data result: {}", insertResult.getMsg()); + } else { + logger.error("Insert data Exception: {},data:{}", insertResult.getMsg(), jsonData); + } + + if (longitude != null && latitude != null) { + checkElectronicFence(deviceId, monitorUnitId, sceneId, longitude, latitude, ts); + } + } + } + + /** + * @param: deviceId + * @param: monitorUnitId + * @param: sceneId + * @param: longitude + * @param: latitude + * @param: ts + * @description 校验此设备电子围栏 + * @author xins + * @date 2023-09-04 14:04 + */ + private void checkElectronicFence(Long deviceId, Long monitorUnitId, Long sceneId, Object longitude, Object latitude, Long ts) { + List hwElectronicFences = hwElectronicFenceMapper.selectElectronicFencesByDeviceId(deviceId); + if (StringUtils.isEmpty(hwElectronicFences)) { + System.out.println("---------"); + hwElectronicFences = hwElectronicFenceMapper.selectElectronicFencesByMonitorUnitId(monitorUnitId); + } + if (StringUtils.isEmpty(hwElectronicFences)) { + hwElectronicFences = hwElectronicFenceMapper.selectElectronicFencesBySceneId(sceneId); + System.out.println("---------33333"); + } + + if (StringUtils.isNotEmpty(hwElectronicFences)) { + hwElectronicFences.forEach(hwElectronicFence -> { + String effectiveTimeFlag = hwElectronicFence.getEffectiveTimeFlag(); + String triggerStatus = hwElectronicFence.getTriggerStatus(); + boolean isAlarmed = false;//是否报警 + if (effectiveTimeFlag.equals(HwDictConstants.EFFECTIVE_TIME_FLAG_LONG)) { + String areaShapeFlag = hwElectronicFence.getAreaShapeFlag(); + String areaRange = hwElectronicFence.getAreaRange(); + if (areaShapeFlag.equals(HwDictConstants.AREA_SHAPE_FLAG_POLYGN)) { + LocationVo polygonVo = new LocationVo(); + polygonVo.setMarkerType(LocationVo.MARKER_TYPE_POLYGON); + List> polygonList = new ArrayList<>(); + List postionList = new ArrayList<>(); + String[] areaRangeArr = areaRange.split("_");//多个点,每个点的经纬度信息(经度_纬度) + for (String areaRange1 : areaRangeArr) { + String[] areaRange1Arr = areaRange1.split(","); + String longitudeStr = areaRange1Arr[0]; + String latitudeStr = areaRange1Arr[1]; + postionList.add(new PositionVo(new BigDecimal(longitudeStr), new BigDecimal(latitudeStr))); + polygonList.add(postionList); + } + + polygonVo.setPolygonList(polygonList); + + /** + * 传入的longitude和latitude是object类型,本身有可能是BigDecimal,Double,Long和Integer,先转成String再转成Double + */ + boolean isWithin = PositionUtils.checkAddressInLocation(polygonVo, Double.valueOf(String.valueOf(longitude)), Double.valueOf(String.valueOf(latitude))); + if (triggerStatus.equals(HwDictConstants.ELECTRONIC_FENCE_TRIGGER_STATUS_EXIT) && !isWithin) {//如果电子围栏配置是出界,而此设备出界则报警 + isAlarmed = true; + } else if (triggerStatus.equals(HwDictConstants.ELECTRONIC_FENCE_TRIGGER_STATUS_ENTRY) && isWithin) {//如果电子围栏配置是入界,而此设备入界则报警 + isAlarmed = true; + } + System.out.println("iswithin" + isWithin); + + } else if (areaShapeFlag.equals(HwDictConstants.AREA_SHAPE_FLAG_CIRCULA)) { + String[] areaRangeArr = areaRange.split(","); + String longitudeStr = areaRangeArr[0]; + String latitudeStr = areaRangeArr[1]; + String radiusStr = areaRangeArr[2]; + LocationVo circulrVo = new LocationVo(); + circulrVo.setRadius(Double.valueOf(radiusStr)); + circulrVo.setLongitude(Double.valueOf(longitudeStr)); + circulrVo.setLatitude(Double.valueOf(latitudeStr)); + circulrVo.setMarkerType(LocationVo.MARKER_TYPE_CIRCULAR); + boolean isWithin = PositionUtils.checkAddressInLocation(circulrVo, Double.valueOf(String.valueOf(longitude)), Double.valueOf(String.valueOf(latitude))); + System.out.println("iswithin:" + isWithin); + if (triggerStatus.equals(HwDictConstants.ELECTRONIC_FENCE_TRIGGER_STATUS_EXIT) && !isWithin) {//如果电子围栏配置是出界,而此设备出界则报警 + isAlarmed = true; + } else if (triggerStatus.equals(HwDictConstants.ELECTRONIC_FENCE_TRIGGER_STATUS_ENTRY) && isWithin) {//如果电子围栏配置是入界,而此设备入界则报警 + isAlarmed = true; + } + } + } + + if (isAlarmed) { + HwAlarmInfo hwAralmInfo = new HwAlarmInfo(); + hwAralmInfo.setAlarmInfoType(HwDictConstants.ALARM_INFO_TYPE_ELECTRONIC_FENCE); + hwAralmInfo.setAlarmReleatedId(hwElectronicFence.getElectronicFenceId()); + hwAralmInfo.setDeviceId(deviceId); + hwAralmInfo.setMonitorUnitId(monitorUnitId); + hwAralmInfo.setSceneId(sceneId); + hwAralmInfo.setFunctionValue(longitude + "_" + latitude); + hwAralmInfo.setTriggerStatus(triggerStatus); + hwAralmInfo.setAlarmTime(new Date(ts)); + hwAralmInfo.setCreateTime(new Date()); + hwAlarmInfoMapper.insertHwAlarmInfo(hwAralmInfo); + } + }); + } + } + + public static void main(String[] args) { + System.out.println(System.currentTimeMillis()); + SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); + Date date = new Date(); + System.out.println(format.format(date)); + Object jsonData = "{\n" + + "\n" + + " \"timestamp\": 1689814424,\"type\": \"CMD_REPORTDATA\",\n" + + " \"param\": [\n{\n" + + " \"datatype\": \"cttemperature\",\n" + + "\"datavalue\": {\n" + + " \"uid\": \"0009340109040126\", \"alias\": \"\",\n" + + " \"value\": 25.6,\n" + + " \"voltage\": 3.76,\n" + + " \"rssi\": -80\n" + + " } },\n" + + " {\"datatype\": \"cttemperature\",\n" + + " \"datavalue\": {\n" + + " \"uid1\": \"00093440109040924\",\n" + + " \"alias\": \"\",\n" + + " \"value\": 25.6,\n" + + " \"voltage\": 3.64,\n" + + " \"rssi\": -87\n" + + " }\n" + + " }]}"; + + } +} diff --git a/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/service/impl/DeviceStatusServiceImpl.java b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/service/impl/DeviceStatusServiceImpl.java new file mode 100644 index 0000000..c90474f --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/java/com/ruoyi/dataprocess/service/impl/DeviceStatusServiceImpl.java @@ -0,0 +1,27 @@ +package com.ruoyi.dataprocess.service.impl; + +import com.ruoyi.dataprocess.service.IDeviceStatusService; +import com.ruoyi.tdengine.api.RemoteTdEngineService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * @Description: 设备状态处理服务 + * @ClassName: DeviceStatusServiceImpl + * @Author : xins + * @Date :2023-09-04 15:31 + * @Version :1.0 + */ +@Service +public class DeviceStatusServiceImpl implements IDeviceStatusService { + + @Resource + private RemoteTdEngineService remoteTdEngineService; + + @Override + public void handleDeviceStatus(){ + + System.out.println("handleDeviceStatus"); + } +} diff --git a/ruoyi-modules/hw-data-process/src/main/resources/ClientService.java b/ruoyi-modules/hw-data-process/src/main/resources/ClientService.java new file mode 100644 index 0000000..ba43d31 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/resources/ClientService.java @@ -0,0 +1,32 @@ +package com.ruoyi.dataprocess.mqtt.client.service; + +import net.dreamlu.iot.mqtt.spring.client.MqttClientTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.nio.charset.StandardCharsets; + +/** + * @author wsq + */ +@Service +public class ClientService { + private static final Logger logger = LoggerFactory.getLogger(ClientService.class); + @Autowired + private MqttClientTemplate client; + + public boolean publish(String body) { + client.publish("/test/client", body.getBytes(StandardCharsets.UTF_8)); + return true; + } + + public boolean sub() { + client.subQos0("/test/#", (context, topic, message, payload) -> { + logger.info(topic + '\t' + new String(payload, StandardCharsets.UTF_8)); + }); + return true; + } + +} diff --git a/ruoyi-modules/hw-data-process/src/main/resources/MqttClientConnectListener.java b/ruoyi-modules/hw-data-process/src/main/resources/MqttClientConnectListener.java new file mode 100644 index 0000000..e4f1ecc --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/resources/MqttClientConnectListener.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2019-2029, Dreamlu 卢春梦 (596392912@qq.com & dreamlu.net). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.ruoyi.dataprocess.mqtt.client.listener; + +import net.dreamlu.iot.mqtt.core.client.MqttClientCreator; +import net.dreamlu.iot.mqtt.spring.client.event.MqttConnectedEvent; +import net.dreamlu.iot.mqtt.spring.client.event.MqttDisconnectEvent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.event.EventListener; +import org.springframework.stereotype.Service; + +/** + * 客户端连接状态监听 + * + * @author L.cm + */ +@Service +public class MqttClientConnectListener { + private static final Logger logger = LoggerFactory.getLogger(MqttClientConnectListener.class); + + @Autowired + private MqttClientCreator mqttClientCreator; + + @EventListener + public void onConnected(MqttConnectedEvent event) { + logger.info("MqttConnectedEvent:{}", event); + } + + @EventListener + public void onDisconnect(MqttDisconnectEvent event) { + logger.info("MqttDisconnectEvent:{}", event); + // 在断线时更新 clientId、username、password + mqttClientCreator.clientId("newClient" + System.currentTimeMillis()) + .username("newUserName") + .password("newPassword"); + } + +} diff --git a/ruoyi-modules/hw-data-process/src/main/resources/banner.txt b/ruoyi-modules/hw-data-process/src/main/resources/banner.txt new file mode 100644 index 0000000..fbd45f5 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/resources/banner.txt @@ -0,0 +1,10 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} + _ _ + (_) | | + _ __ _ _ ___ _ _ _ ______ ___ _ _ ___ | |_ ___ _ __ ___ +| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \ +| | | |_| || (_) || |_| || | \__ \| |_| |\__ \| |_ | __/| | | | | | +|_| \__,_| \___/ \__, ||_| |___/ \__, ||___/ \__| \___||_| |_| |_| + __/ | __/ | + |___/ |___/ \ No newline at end of file diff --git a/ruoyi-modules/hw-data-process/src/main/resources/bootstrap.yml b/ruoyi-modules/hw-data-process/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..856d7d0 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/resources/bootstrap.yml @@ -0,0 +1,25 @@ +# Tomcat +server: + port: 9603 + +# Spring +spring: + application: + # 应用名称 + name: hw-data-process + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 127.0.0.1:8848 + config: + # 配置中心地址 + 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-data-process/src/main/resources/logback.xml b/ruoyi-modules/hw-data-process/src/main/resources/logback.xml new file mode 100644 index 0000000..4554898 --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/resources/logback.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-modules/hw-data-process/src/main/resources/mapper/dataprocess/HwAlarmInfoMapper.xml b/ruoyi-modules/hw-data-process/src/main/resources/mapper/dataprocess/HwAlarmInfoMapper.xml new file mode 100644 index 0000000..15aa31f --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/resources/mapper/dataprocess/HwAlarmInfoMapper.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into hw_alarm_info + + alarm_info_type, + alarm_releated_id, + device_id, + monitor_unit_id, + scene_id, + alarm_level_id, + alarm_type_id, + mode_function_id, + function_name, + function_identifier, + function_value, + trigger_status, + handle_status, + alarm_time, + create_time, + update_by, + update_time, + alarm_info_field, + + + #{alarmInfoType}, + #{alarmReleatedId}, + #{deviceId}, + #{monitorUnitId}, + #{sceneId}, + #{alarmLevelId}, + #{alarmTypeId}, + #{modeFunctionId}, + #{functionName}, + #{functionIdentifier}, + #{functionValue}, + #{triggerStatus}, + #{handleStatus}, + #{alarmTime}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{alarmInfoField}, + + + + + \ No newline at end of file diff --git a/ruoyi-modules/hw-data-process/src/main/resources/mapper/dataprocess/HwDeviceMapper.xml b/ruoyi-modules/hw-data-process/src/main/resources/mapper/dataprocess/HwDeviceMapper.xml new file mode 100644 index 0000000..d192fcf --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/resources/mapper/dataprocess/HwDeviceMapper.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select device_id, device_code, scene_id, monitor_unit_id, device_type, device_mode_id, device_status from hw_device + + + + + + \ No newline at end of file diff --git a/ruoyi-modules/hw-data-process/src/main/resources/mapper/dataprocess/HwElectronicFenceMapper.xml b/ruoyi-modules/hw-data-process/src/main/resources/mapper/dataprocess/HwElectronicFenceMapper.xml new file mode 100644 index 0000000..01f3d5a --- /dev/null +++ b/ruoyi-modules/hw-data-process/src/main/resources/mapper/dataprocess/HwElectronicFenceMapper.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + select electronic_fence_id, electronic_fence_name, scene_id, fence_type, effective_time_flag, effective_time, trigger_status, area_shape_flag, + area_range, fence_push_flag, fence_push_content, fence_recover_content + from hw_electronic_fence hef + + + + + + + + + + + \ 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 284a2ec..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,6 +1,6 @@ # Tomcat server: - port: 9206 + port: 9604 # Spring spring: @@ -12,9 +12,12 @@ spring: 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 # 共享配置 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/HwTdengineApplication.java b/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/HwTdengineApplication.java index c7fafc9..4487601 100644 --- a/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/HwTdengineApplication.java +++ b/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/HwTdengineApplication.java @@ -9,7 +9,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; /** * 系统模块 * - * @author ruoyi + * @author xins */ @EnableCustomConfig @EnableCustomSwagger2 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 b16b57a..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 @@ -4,6 +4,7 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.hw.validated.tdengine.AddTdSTableColumn; import com.ruoyi.common.core.hw.validated.tdengine.InsertTdTable; import com.ruoyi.tdengine.api.domain.*; +import com.ruoyi.tdengine.service.IDeviceStatusService; import com.ruoyi.tdengine.service.ITdEngineService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RestController; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * @ClassDescription: TdEngine Controller @@ -32,6 +34,9 @@ public class TdEngineController { @Autowired private ITdEngineService tdEngineService; + @Autowired + private IDeviceStatusService deviceStatusService; + private static final Logger log = LoggerFactory.getLogger(TdEngineController.class); /* @description 创建数据库 @@ -257,7 +262,6 @@ public class TdEngineController { } } - /** * @return R * @param: tdSelectDto @@ -368,4 +372,37 @@ public class TdEngineController { } } + + /** + * @return R + * @param: tdSelectDto + * @description 获取每天在线设备信息 + * @author xins + * @date 2023-08-29 11:26 + */ + @PostMapping("/getOnlineDevicesGroupByDay") + public R getOnlineDevicesGroupByDay(@RequestBody DeviceStatus queryDeviceStatus) { + try { + List deviceStatuses = this.deviceStatusService.getOnlineDevicesGroupByDay(queryDeviceStatus); + Map> deviceStatusMap = deviceStatuses.stream() + .collect(Collectors.groupingBy(DeviceStatus::getTs)); + deviceStatusMap.forEach((k,v)->{ + System.out.println(k+"----"+v); + }); + + return R.ok(deviceStatusMap); + } catch (UncategorizedSQLException e) { + String message = e.getCause().getMessage(); + try { + message = message.substring(message.lastIndexOf("invalid operation")); + } catch (Exception ex) { + } + log.error(message); + return R.fail(message); + } catch (Exception e) { + log.error(e.getMessage()); + return R.fail(e.getMessage()); + } + } + } diff --git a/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/mapper/DeviceStatusMapper.java b/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/mapper/DeviceStatusMapper.java new file mode 100644 index 0000000..c306225 --- /dev/null +++ b/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/mapper/DeviceStatusMapper.java @@ -0,0 +1,24 @@ +package com.ruoyi.tdengine.mapper; + +import com.ruoyi.tdengine.api.domain.DeviceStatus; + +import java.util.List; + +/** + * @Description:TDengine设备状态信息交互接口 + * @ClassName: DeviceStatusMapper + * @Author : xins + * @Date :2023-09-05 13:20 + * @Version :1.0 + */ +public interface DeviceStatusMapper { + + /** + * @param: deviceStatus + * @description 获取每天在线设备列表 + * @author xins + * @date 2023-09-05 11:43 + * @return List + */ + List getOnlineDevicesGroupByDay(DeviceStatus deviceStatus); +} diff --git a/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/mapper/TdEngineMapper.java b/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/mapper/TdEngineMapper.java index 05b0a11..98e0e4d 100644 --- a/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/mapper/TdEngineMapper.java +++ b/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/mapper/TdEngineMapper.java @@ -7,7 +7,7 @@ import java.util.List; import java.util.Map; /** - * @ClassDescription: + * @ClassDescription:TDengine数据库交互接口 * @ClassName: TdEngineMapper * @Author: thinglinks * @Date: 2021-12-27 14:52:34 diff --git a/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/service/IDeviceStatusService.java b/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/service/IDeviceStatusService.java new file mode 100644 index 0000000..b039129 --- /dev/null +++ b/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/service/IDeviceStatusService.java @@ -0,0 +1,17 @@ +package com.ruoyi.tdengine.service; + +import com.ruoyi.tdengine.api.domain.DeviceStatus; + +import java.util.List; + +public interface IDeviceStatusService { + + /** + * @param: DeviceStatus + * @description 获取时间范围内每天的在线设备 + * @author xins + * @date 2023-09-05 13:23 + * @return List + */ + public List getOnlineDevicesGroupByDay(DeviceStatus queryDeviceStatus); +} 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 new file mode 100644 index 0000000..6154076 --- /dev/null +++ b/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/service/impl/DeviceStatusServiceImpl.java @@ -0,0 +1,52 @@ +package com.ruoyi.tdengine.service.impl; + +import com.ruoyi.common.core.constant.TdEngineConstants; +import com.ruoyi.tdengine.api.domain.DeviceStatus; +import com.ruoyi.tdengine.mapper.DeviceStatusMapper; +import com.ruoyi.tdengine.service.IDeviceStatusService; +import org.springframework.beans.factory.annotation.Autowired; +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 + * @Version :1.0 + */ +@Service +public class DeviceStatusServiceImpl implements IDeviceStatusService { + + @Autowired + private DeviceStatusMapper deviceStatusMapper; + + /** + * @return List + * @param: DeviceStatus + * @description 获取时间范围内每天的在线设备 + * @author xins + * @date 2023-09-05 13:23 + */ + @Override + public List getOnlineDevicesGroupByDay(DeviceStatus queryDeviceStatus) { + + 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(); +// params.put("beginTime", beginTime); +// params.put("endTime", endTime); +// queryDeviceStatus.setParams(params); +// if (sceneId != null) { +// queryDeviceStatus.setSceneId(sceneId); +// } + + List deviceStatuses = deviceStatusMapper.getOnlineDevicesGroupByDay(queryDeviceStatus); + + return deviceStatuses; + } +} diff --git a/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/service/impl/TdEngineServiceImpl.java b/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/service/impl/TdEngineServiceImpl.java index 8f0875c..8571556 100644 --- a/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/service/impl/TdEngineServiceImpl.java +++ b/ruoyi-modules/hw-tdengine/src/main/java/com/ruoyi/tdengine/service/impl/TdEngineServiceImpl.java @@ -1,10 +1,8 @@ package com.ruoyi.tdengine.service.impl; import com.ruoyi.common.core.constant.TdEngineConstants; -import com.ruoyi.tdengine.api.domain.TdField; -import com.ruoyi.tdengine.api.domain.TdFieldVo; -import com.ruoyi.tdengine.api.domain.TdHistorySelectDto; -import com.ruoyi.tdengine.api.domain.TdSelectDto; +import com.ruoyi.tdengine.api.domain.*; +import com.ruoyi.tdengine.mapper.DeviceStatusMapper; import com.ruoyi.tdengine.mapper.TdEngineMapper; import com.ruoyi.tdengine.service.ITdEngineService; import org.apache.commons.lang3.StringUtils; @@ -32,6 +30,7 @@ public class TdEngineServiceImpl implements ITdEngineService { @Autowired private TdEngineMapper tdEngineMapper; + // @Autowired // private RedisService redisService; @@ -114,8 +113,8 @@ public class TdEngineServiceImpl implements ITdEngineService { * @date 2023-08-30 11:03 */ @Override - public void alterTableTag(String databaseName,String tableName,String tagName,Object tagValue){ - this.tdEngineMapper.alterTableTag(databaseName,tableName,tagName,tagValue); + public void alterTableTag(String databaseName, String tableName, String tagName, Object tagValue) { + this.tdEngineMapper.alterTableTag(databaseName, tableName, tagName, tagValue); } /** @@ -208,11 +207,11 @@ public class TdEngineServiceImpl implements ITdEngineService { /** + * @return Long * @param: tdHistorySelectDto * @description 获取历史记录的数量 * @author xins * @date 2023-08-29 16:54 - * @return Long */ @Override public Long getCountOfHistoryData(TdHistorySelectDto tdHistorySelectDto) throws Exception { @@ -223,9 +222,6 @@ public class TdEngineServiceImpl implements ITdEngineService { return countMap.get("dataCount"); } - - - // // /** // * 检查数据库表是否存在 diff --git a/ruoyi-modules/hw-tdengine/src/main/resources/mapper/tdengine/DeviceStatusMapper.xml b/ruoyi-modules/hw-tdengine/src/main/resources/mapper/tdengine/DeviceStatusMapper.xml new file mode 100644 index 0000000..6698952 --- /dev/null +++ b/ruoyi-modules/hw-tdengine/src/main/resources/mapper/tdengine/DeviceStatusMapper.xml @@ -0,0 +1,18 @@ + + + + + + + + + diff --git a/ruoyi-modules/hw-tdengine/src/main/resources/mapper/tdengine/TdEngineMapper.xml b/ruoyi-modules/hw-tdengine/src/main/resources/mapper/tdengine/TdEngineMapper.xml index 0db8c2f..c4132ab 100644 --- a/ruoyi-modules/hw-tdengine/src/main/resources/mapper/tdengine/TdEngineMapper.xml +++ b/ruoyi-modules/hw-tdengine/src/main/resources/mapper/tdengine/TdEngineMapper.xml @@ -7,105 +7,105 @@ - create table if not exists #{databaseName}.#{superTableName} - (${firstFieldName} timestamp, + create table if not exists #{databaseName}.#{superTableName} + (${firstFieldName} timestamp, - - - ${item.fieldName} - - - - - timestamp - - - tinyint - - - smallint - - - int - - - bigint - - - float - - - double - - - binary - - - nchar - - - bool - - - json - - - + + + ${item.fieldName} + + + + + timestamp + + + tinyint + + + smallint + + + int + + + bigint + + + float + + + double + + + binary + + + nchar + + + bool + + + json + + + - - (#{item.size}) - - - ) tags - - - - ${item.fieldName} - - - - - timestamp - - - int - - - bigint - - - float - - - double - - - binary - - - smallint - - - tinyint - - - bool - - - nchar - - - json - - - - - (#{item.size}) - - - + + (#{item.size}) + + + ) tags + + + + ${item.fieldName} + + + + + timestamp + + + int + + + bigint + + + float + + + double + + + binary + + + smallint + + + tinyint + + + bool + + + nchar + + + json + + + + + (#{item.size}) + + + create table if not exists #{databaseName}.#{tableName} @@ -180,19 +180,36 @@ - insert into #{databaseName}.#{tableName} - - ${item.fieldName} - + + insert into #{databaseName}.#{tableName} ${item.fieldName} values #{item.fieldValue} + + + - + + + diff --git a/ruoyi-modules/pom.xml b/ruoyi-modules/pom.xml index b5a5a35..2207434 100644 --- a/ruoyi-modules/pom.xml +++ b/ruoyi-modules/pom.xml @@ -27,6 +27,7 @@ hw-business hw-basic hw-tdengine + hw-data-process ruoyi-modules diff --git a/ruoyi-ui/src/api/basic/area.js b/ruoyi-ui/src/api/basic/area.js new file mode 100644 index 0000000..442cfbb --- /dev/null +++ b/ruoyi-ui/src/api/basic/area.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询区域管理列表 +export function listArea(query) { + return request({ + url: '/basic/area/list', + method: 'get', + params: query + }) +} + +// 查询区域管理详细 +export function getArea(areaId) { + return request({ + url: '/basic/area/' + areaId, + method: 'get' + }) +} + +// 新增区域管理 +export function addArea(data) { + return request({ + url: '/basic/area', + method: 'post', + data: data + }) +} + +// 修改区域管理 +export function updateArea(data) { + return request({ + url: '/basic/area', + method: 'put', + data: data + }) +} + +// 删除区域管理 +export function delArea(areaId) { + return request({ + url: '/basic/area/' + areaId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/basic/language.js b/ruoyi-ui/src/api/basic/language.js new file mode 100644 index 0000000..7d79cf7 --- /dev/null +++ b/ruoyi-ui/src/api/basic/language.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询语言信息列表 +export function listLanguage(query) { + return request({ + url: '/basic/language/list', + method: 'get', + params: query + }) +} + +// 查询语言信息详细 +export function getLanguage(languageId) { + return request({ + url: '/basic/language/' + languageId, + method: 'get' + }) +} + +// 新增语言信息 +export function addLanguage(data) { + return request({ + url: '/basic/language', + method: 'post', + data: data + }) +} + +// 修改语言信息 +export function updateLanguage(data) { + return request({ + url: '/basic/language', + method: 'put', + data: data + }) +} + +// 删除语言信息 +export function delLanguage(languageId) { + return request({ + url: '/basic/language/' + languageId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/business/deviceMode.js b/ruoyi-ui/src/api/business/deviceMode.js new file mode 100644 index 0000000..3a6ff6a --- /dev/null +++ b/ruoyi-ui/src/api/business/deviceMode.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询设备模型列表 +export function listDeviceMode(query) { + return request({ + url: '/business/deviceMode/list', + method: 'get', + params: query + }) +} + +// 查询设备模型详细 +export function getDeviceMode(deviceModeId) { + return request({ + url: '/business/deviceMode/' + deviceModeId, + method: 'get' + }) +} + +// 新增设备模型 +export function addDeviceMode(data) { + return request({ + url: '/business/deviceMode', + method: 'post', + data: data + }) +} + +// 修改设备模型 +export function updateDeviceMode(data) { + return request({ + url: '/business/deviceMode', + method: 'put', + data: data + }) +} + +// 删除设备模型 +export function delDeviceMode(deviceModeId) { + return request({ + url: '/business/deviceMode/' + deviceModeId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/business/deviceModeFunction.js b/ruoyi-ui/src/api/business/deviceModeFunction.js new file mode 100644 index 0000000..1b708cb --- /dev/null +++ b/ruoyi-ui/src/api/business/deviceModeFunction.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询设备模型功能列表 +export function listDeviceModeFunction(query) { + return request({ + url: '/business/deviceModeFunction/list', + method: 'get', + params: query + }) +} + +// 查询设备模型功能详细 +export function getDeviceModeFunction(modeFunctionId) { + return request({ + url: '/business/deviceModeFunction/' + modeFunctionId, + method: 'get' + }) +} + +// 新增设备模型功能 +export function addDeviceModeFunction(data) { + return request({ + url: '/business/deviceModeFunction', + method: 'post', + data: data + }) +} + +// 修改设备模型功能 +export function updateDeviceModeFunction(data) { + return request({ + url: '/business/deviceModeFunction', + method: 'put', + data: data + }) +} + +// 删除设备模型功能 +export function delDeviceModeFunction(modeFunctionId) { + return request({ + url: '/business/deviceModeFunction/' + modeFunctionId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/business/electronicFence.js b/ruoyi-ui/src/api/business/electronicFence.js new file mode 100644 index 0000000..5a70cc2 --- /dev/null +++ b/ruoyi-ui/src/api/business/electronicFence.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询电子围栏列表 +export function listElectronicFence(query) { + return request({ + url: '/business/electronicFence/list', + method: 'get', + params: query + }) +} + +// 查询电子围栏详细 +export function getElectronicFence(electronicFenceId) { + return request({ + url: '/business/electronicFence/' + electronicFenceId, + method: 'get' + }) +} + +// 新增电子围栏 +export function addElectronicFence(data) { + return request({ + url: '/business/electronicFence', + method: 'post', + data: data + }) +} + +// 修改电子围栏 +export function updateElectronicFence(data) { + return request({ + url: '/business/electronicFence', + method: 'put', + data: data + }) +} + +// 删除电子围栏 +export function delElectronicFence(electronicFenceId) { + return request({ + url: '/business/electronicFence/' + electronicFenceId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/business/fenceTarget.js b/ruoyi-ui/src/api/business/fenceTarget.js new file mode 100644 index 0000000..0b1e434 --- /dev/null +++ b/ruoyi-ui/src/api/business/fenceTarget.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询电子围栏目标列表 +export function listFenceTarget(query) { + return request({ + url: '/business/fenceTarget/list', + method: 'get', + params: query + }) +} + +// 查询电子围栏目标详细 +export function getFenceTarget(targetId) { + return request({ + url: '/business/fenceTarget/' + targetId, + method: 'get' + }) +} + +// 新增电子围栏目标 +export function addFenceTarget(data) { + return request({ + url: '/business/fenceTarget', + method: 'post', + data: data + }) +} + +// 修改电子围栏目标 +export function updateFenceTarget(data) { + return request({ + url: '/business/fenceTarget', + method: 'put', + data: data + }) +} + +// 删除电子围栏目标 +export function delFenceTarget(targetId) { + return request({ + url: '/business/fenceTarget/' + targetId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/business/monitorUnit.js b/ruoyi-ui/src/api/business/monitorUnit.js new file mode 100644 index 0000000..dc75589 --- /dev/null +++ b/ruoyi-ui/src/api/business/monitorUnit.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询监控单元列表 +export function listMonitorUnit(query) { + return request({ + url: '/business/monitorUnit/list', + method: 'get', + params: query + }) +} + +// 查询监控单元详细 +export function getMonitorUnit(monitorUnitId) { + return request({ + url: '/business/monitorUnit/' + monitorUnitId, + method: 'get' + }) +} + +// 新增监控单元 +export function addMonitorUnit(data) { + return request({ + url: '/business/monitorUnit', + method: 'post', + data: data + }) +} + +// 修改监控单元 +export function updateMonitorUnit(data) { + return request({ + url: '/business/monitorUnit', + method: 'put', + data: data + }) +} + +// 删除监控单元 +export function delMonitorUnit(monitorUnitId) { + return request({ + url: '/business/monitorUnit/' + monitorUnitId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/business/monitorUnitType.js b/ruoyi-ui/src/api/business/monitorUnitType.js new file mode 100644 index 0000000..a7acfcc --- /dev/null +++ b/ruoyi-ui/src/api/business/monitorUnitType.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询监控单元类型列表 +export function listMonitorUnitType(query) { + return request({ + url: '/business/monitorUnitType/list', + method: 'get', + params: query + }) +} + +// 查询监控单元类型详细 +export function getMonitorUnitType(monitorUnitTypeId) { + return request({ + url: '/business/monitorUnitType/' + monitorUnitTypeId, + method: 'get' + }) +} + +// 新增监控单元类型 +export function addMonitorUnitType(data) { + return request({ + url: '/business/monitorUnitType', + method: 'post', + data: data + }) +} + +// 修改监控单元类型 +export function updateMonitorUnitType(data) { + return request({ + url: '/business/monitorUnitType', + method: 'put', + data: data + }) +} + +// 删除监控单元类型 +export function delMonitorUnitType(monitorUnitTypeId) { + return request({ + url: '/business/monitorUnitType/' + monitorUnitTypeId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/business/sceneMode.js b/ruoyi-ui/src/api/business/sceneMode.js new file mode 100644 index 0000000..3c9c805 --- /dev/null +++ b/ruoyi-ui/src/api/business/sceneMode.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询场景类型列表 +export function listSceneMode(query) { + return request({ + url: '/business/sceneMode/list', + method: 'get', + params: query + }) +} + +// 查询场景类型详细 +export function getSceneMode(sceneModeId) { + return request({ + url: '/business/sceneMode/' + sceneModeId, + method: 'get' + }) +} + +// 新增场景类型 +export function addSceneMode(data) { + return request({ + url: '/business/sceneMode', + method: 'post', + data: data + }) +} + +// 修改场景类型 +export function updateSceneMode(data) { + return request({ + url: '/business/sceneMode', + method: 'put', + data: data + }) +} + +// 删除场景类型 +export function delSceneMode(sceneModeId) { + return request({ + url: '/business/sceneMode/' + sceneModeId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/business/tenant.js b/ruoyi-ui/src/api/business/tenant.js new file mode 100644 index 0000000..1416eeb --- /dev/null +++ b/ruoyi-ui/src/api/business/tenant.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询租户信息列表 +export function listTenant(query) { + return request({ + url: '/business/tenant/list', + method: 'get', + params: query + }) +} + +// 查询租户信息详细 +export function getTenant(tenantId) { + return request({ + url: '/business/tenant/' + tenantId, + method: 'get' + }) +} + +// 新增租户信息 +export function addTenant(data) { + return request({ + url: '/business/tenant', + method: 'post', + data: data + }) +} + +// 修改租户信息 +export function updateTenant(data) { + return request({ + url: '/business/tenant', + method: 'put', + data: data + }) +} + +// 删除租户信息 +export function delTenant(tenantId) { + return request({ + url: '/business/tenant/' + tenantId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 71907b6..a1be94d 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -161,7 +161,22 @@ export const dynamicRoutes = [ meta: { title: '修改生成配置', activeMenu: '/tool/gen' } } ] + }, + { + path: '/deviceMode/mode-edit', + component: Layout, + hidden: true, + permissions: ['business:deviceMode:edit'], + children: [ + { + path: 'index/:deviceModeId(\\d+)', + component: () => import('@/views/business/deviceMode/editDeviceMode'), + name: 'ModeEdit', + meta: { title: '修改设备模型', activeMenu: '/business/deviceMode' } + } + ] } + ] // 防止连续点击多次路由报错 diff --git a/ruoyi-ui/src/views/basic/area/index.vue b/ruoyi-ui/src/views/basic/area/index.vue new file mode 100644 index 0000000..2281434 --- /dev/null +++ b/ruoyi-ui/src/views/basic/area/index.vue @@ -0,0 +1,331 @@ + + + diff --git a/ruoyi-ui/src/views/basic/language/index.vue b/ruoyi-ui/src/views/basic/language/index.vue new file mode 100644 index 0000000..7f36fba --- /dev/null +++ b/ruoyi-ui/src/views/basic/language/index.vue @@ -0,0 +1,310 @@ + + + diff --git a/ruoyi-ui/src/views/business/deviceMode/deviceModeAttribute.vue b/ruoyi-ui/src/views/business/deviceMode/deviceModeAttribute.vue new file mode 100644 index 0000000..d09bd45 --- /dev/null +++ b/ruoyi-ui/src/views/business/deviceMode/deviceModeAttribute.vue @@ -0,0 +1,551 @@ + + + diff --git a/ruoyi-ui/src/views/business/deviceMode/deviceModeEvent.vue b/ruoyi-ui/src/views/business/deviceMode/deviceModeEvent.vue new file mode 100644 index 0000000..d09bd45 --- /dev/null +++ b/ruoyi-ui/src/views/business/deviceMode/deviceModeEvent.vue @@ -0,0 +1,551 @@ + + + diff --git a/ruoyi-ui/src/views/business/deviceMode/deviceModeService.vue b/ruoyi-ui/src/views/business/deviceMode/deviceModeService.vue new file mode 100644 index 0000000..d09bd45 --- /dev/null +++ b/ruoyi-ui/src/views/business/deviceMode/deviceModeService.vue @@ -0,0 +1,551 @@ + + + diff --git a/ruoyi-ui/src/views/business/deviceMode/editDeviceMode.vue b/ruoyi-ui/src/views/business/deviceMode/editDeviceMode.vue new file mode 100644 index 0000000..b8b909b --- /dev/null +++ b/ruoyi-ui/src/views/business/deviceMode/editDeviceMode.vue @@ -0,0 +1,128 @@ + + diff --git a/ruoyi-ui/src/views/business/deviceMode/index.vue b/ruoyi-ui/src/views/business/deviceMode/index.vue new file mode 100644 index 0000000..a982530 --- /dev/null +++ b/ruoyi-ui/src/views/business/deviceMode/index.vue @@ -0,0 +1,592 @@ + + + diff --git a/ruoyi-ui/src/views/business/electronicFence/index.vue b/ruoyi-ui/src/views/business/electronicFence/index.vue new file mode 100644 index 0000000..456f38c --- /dev/null +++ b/ruoyi-ui/src/views/business/electronicFence/index.vue @@ -0,0 +1,400 @@ + + + diff --git a/ruoyi-ui/src/views/business/monitorUnit/index.vue b/ruoyi-ui/src/views/business/monitorUnit/index.vue new file mode 100644 index 0000000..7bb11a1 --- /dev/null +++ b/ruoyi-ui/src/views/business/monitorUnit/index.vue @@ -0,0 +1,381 @@ + + + diff --git a/ruoyi-ui/src/views/business/monitorUnitType/index.vue b/ruoyi-ui/src/views/business/monitorUnitType/index.vue new file mode 100644 index 0000000..cd2ec60 --- /dev/null +++ b/ruoyi-ui/src/views/business/monitorUnitType/index.vue @@ -0,0 +1,356 @@ + + + diff --git a/ruoyi-ui/src/views/business/sceneMode/index.vue b/ruoyi-ui/src/views/business/sceneMode/index.vue new file mode 100644 index 0000000..f5d4594 --- /dev/null +++ b/ruoyi-ui/src/views/business/sceneMode/index.vue @@ -0,0 +1,325 @@ + + + diff --git a/ruoyi-ui/src/views/business/tenant/index.vue b/ruoyi-ui/src/views/business/tenant/index.vue new file mode 100644 index 0000000..bf55312 --- /dev/null +++ b/ruoyi-ui/src/views/business/tenant/index.vue @@ -0,0 +1,404 @@ + + + diff --git a/sh.exe.stackdump b/sh.exe.stackdump new file mode 100644 index 0000000..e69de29