From 24f2e65f2b722befadfe7751f3470fa5d29f12e5 Mon Sep 17 00:00:00 2001 From: kerwincui <164770707@qq.com> Date: Mon, 6 Jun 2022 13:11:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=BF=AE=E6=94=B9=E5=AE=9A?= =?UTF-8?q?=E4=BD=8D=E5=AD=97=E6=AE=B5=E5=90=8D=E7=A7=B0=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=AE=BE=E5=A4=87=E6=91=98=E8=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/iot/domain/Device.java | 21 ++++++-- .../ruoyi/iot/model/DeviceAllShortOutput.java | 10 ++-- .../ruoyi/iot/model/DeviceShortOutput.java | 10 ++-- .../java/com/ruoyi/iot/mqtt/EmqxService.java | 2 +- .../iot/service/impl/DeviceServiceImpl.java | 4 +- .../resources/mapper/iot/DeviceMapper.xml | 25 ++++----- vue/src/views/iot/device/device-edit.vue | 51 +++++++++++++++---- vue/src/views/iot/device/index.vue | 2 +- 8 files changed, 85 insertions(+), 40 deletions(-) diff --git a/springboot/wumei-iot/src/main/java/com/ruoyi/iot/domain/Device.java b/springboot/wumei-iot/src/main/java/com/ruoyi/iot/domain/Device.java index 6804a8f7..cce34c7f 100644 --- a/springboot/wumei-iot/src/main/java/com/ruoyi/iot/domain/Device.java +++ b/springboot/wumei-iot/src/main/java/com/ruoyi/iot/domain/Device.java @@ -97,17 +97,28 @@ public class Device extends BaseEntity private String imgUrl; /** 是否自定义位置 **/ - private Integer isCustomLocation; + private Integer locationWay; + + /** 设备摘要 **/ + private String summary; /** 删除标志(0代表存在 2代表删除) */ private String delFlag; - public Integer getIsCustomLocation() { - return isCustomLocation; + public String getSummary() { + return summary; } - public void setIsCustomLocation(Integer isCustomLocation) { - this.isCustomLocation = isCustomLocation; + public void setSummary(String summary) { + this.summary = summary; + } + + public Integer getlocationWay() { + return locationWay; + } + + public void setlocationWay(Integer locationWay) { + this.locationWay = locationWay; } public String getImgUrl() { diff --git a/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/DeviceAllShortOutput.java b/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/DeviceAllShortOutput.java index 22224811..9fa6a977 100644 --- a/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/DeviceAllShortOutput.java +++ b/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/DeviceAllShortOutput.java @@ -47,7 +47,7 @@ public class DeviceAllShortOutput private Date activeTime; /** 是否自定义位置 **/ - private Integer isCustomLocation; + private Integer locationWay; /** 设备地址 */ private String networkAddress; @@ -82,12 +82,12 @@ public class DeviceAllShortOutput this.latitude = latitude; } - public Integer getIsCustomLocation() { - return isCustomLocation; + public Integer getlocationWay() { + return locationWay; } - public void setIsCustomLocation(Integer isCustomLocation) { - this.isCustomLocation = isCustomLocation; + public void setlocationWay(Integer locationWay) { + this.locationWay = locationWay; } public Integer getIsShadow() { diff --git a/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/DeviceShortOutput.java b/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/DeviceShortOutput.java index dd0d8a2d..adcfca99 100644 --- a/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/DeviceShortOutput.java +++ b/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/DeviceShortOutput.java @@ -88,7 +88,7 @@ public class DeviceShortOutput private Date activeTime; /** 是否自定义位置 **/ - private Integer isCustomLocation; + private Integer locationWay; /** 图片地址 */ private String imgUrl; @@ -101,12 +101,12 @@ public class DeviceShortOutput private List boolList; private List readOnlyList; - public Integer getIsCustomLocation() { - return isCustomLocation; + public Integer getlocationWay() { + return locationWay; } - public void setIsCustomLocation(Integer isCustomLocation) { - this.isCustomLocation = isCustomLocation; + public void setlocationWay(Integer locationWay) { + this.locationWay = locationWay; } public String getImgUrl() { diff --git a/springboot/wumei-iot/src/main/java/com/ruoyi/iot/mqtt/EmqxService.java b/springboot/wumei-iot/src/main/java/com/ruoyi/iot/mqtt/EmqxService.java index 383a475b..f37f7c8f 100644 --- a/springboot/wumei-iot/src/main/java/com/ruoyi/iot/mqtt/EmqxService.java +++ b/springboot/wumei-iot/src/main/java/com/ruoyi/iot/mqtt/EmqxService.java @@ -133,7 +133,7 @@ public class EmqxService { device.setProductId(productId); device.setSerialNumber(deviceNum); // 未采用设备定位则清空定位,定位方式(1=ip自动定位,2=设备定位,3=自定义) - if(device.getIsCustomLocation()!=2){ + if(device.getlocationWay()!=2){ device.setLatitude(null); device.setLongitude(null); } diff --git a/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceServiceImpl.java b/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceServiceImpl.java index 6cb283b5..65f56ff4 100644 --- a/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceServiceImpl.java +++ b/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceServiceImpl.java @@ -472,7 +472,7 @@ public class DeviceServiceImpl implements IDeviceService { device.setActiveTime(DateUtils.getNowDate()); device.setIsShadow(0); device.setRssi(0); - device.setIsCustomLocation(1); // 1-自动定位,2-设备定位,3-自定义位置 + device.setlocationWay(1); // 1-自动定位,2-设备定位,3-自定义位置 device.setCreateTime(DateUtils.getNowDate()); device.setThingsModelValue(JSONObject.toJSONString(getThingsModelDefaultValue(device.getProductId()))); // 随机位置 @@ -609,7 +609,7 @@ public class DeviceServiceImpl implements IDeviceService { device.setActiveTime(DateUtils.getNowDate()); } // 定位方式(1=ip自动定位,2=设备定位,3=自定义) - if (device.getIsCustomLocation() == 1) { + if (device.getlocationWay() == 1) { device.setNetworkIp(ipAddress); setLocation(ipAddress, device); } diff --git a/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceMapper.xml b/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceMapper.xml index 4b67f1e7..bc49a8d8 100644 --- a/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceMapper.xml +++ b/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceMapper.xml @@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + @@ -29,6 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -46,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + @@ -62,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + @@ -96,15 +97,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select device_id, device_name, product_id, product_name, user_id, user_name, tenant_id, tenant_name, serial_number, firmware_version, status, rssi,is_shadow ,is_custom_location,things_model_value,network_address, network_ip, longitude, latitude, active_time, create_time, update_time, img_url,remark from iot_device + select device_id, device_name, product_id, product_name, user_id, user_name, tenant_id, tenant_name, serial_number, firmware_version, status, rssi,is_shadow ,location_way,things_model_value,network_address, network_ip, longitude, latitude, active_time, create_time, update_time, img_url,summary,remark from iot_device - select device_id, device_name, product_id, product_name, user_id, user_name, tenant_id, tenant_name, serial_number, firmware_version, status,rssi,is_shadow ,is_custom_location,things_model_value, active_time,img_url from iot_device + select device_id, device_name, product_id, product_name, user_id, user_name, tenant_id, tenant_name, serial_number, firmware_version, status,rssi,is_shadow ,location_way,things_model_value, active_time,img_url from iot_device - select device_id, device_name,product_id, serial_number, status,is_shadow ,is_custom_location,things_model_value, active_time from iot_device + select device_id, device_name,product_id, serial_number, status,is_shadow ,location_way,things_model_value, active_time from iot_device select d.device_id, d.device_name, d.product_name, d.user_name, d.serial_number, d.firmware_version, d.status,d.rssi,d.is_shadow , - d.is_custom_location, d.active_time,d.network_address,d.longitude,latitude + d.location_way, d.active_time,d.network_address,d.longitude,latitude from iot_device d left join iot_device_user u on u.device_id = d.device_id @@ -147,7 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"