From c27b02beb634aa8c702353efface531d2562d76c Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 12 Feb 2025 18:19:53 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E3=80=91IoT=EF=BC=9A=E5=A2=9E=E5=8A=A0=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=BE=85=E5=AE=9A=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/iot/dal/dataobject/device/IotDeviceDO.java | 2 ++ .../module/iot/dal/tdengine/IotDevicePropertyMapper.java | 3 ++- .../module/iot/service/product/IotProductServiceImpl.java | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/device/IotDeviceDO.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/device/IotDeviceDO.java index d991454765..4c52031fe6 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/device/IotDeviceDO.java +++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/device/IotDeviceDO.java @@ -122,6 +122,7 @@ public class IotDeviceDO extends TenantBaseDO { */ private String firmwareId; + // TODO @芋艿:【待定 003】:要不要增加 username?目前 tl 有,阿里云之类的没有 /** * 设备密钥,用于设备认证,需安全存储 */ @@ -144,6 +145,7 @@ public class IotDeviceDO extends TenantBaseDO { // TODO @haohao:是不是要枚举哈 private String authType; + // TODO @芋艿:【待定 002】:1)设备维护的时候,设置位置?类似 tl?;2)设备上传的时候,设置位置,类似 it? /** * 设备位置的纬度 */ diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/tdengine/IotDevicePropertyMapper.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/tdengine/IotDevicePropertyMapper.java index f2d6af97e9..e506b49d4b 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/tdengine/IotDevicePropertyMapper.java +++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/tdengine/IotDevicePropertyMapper.java @@ -32,6 +32,7 @@ public interface IotDevicePropertyMapper { default void alterProductPropertySTable(String productKey, List oldFields, List newFields) { + // TODO @芋艿:需要处理 device_key,重新发布的时候 oldFields.removeIf(field -> StrUtil.equalsAny(field.getField(), TDengineTableField.FIELD_TS, "report_time")); List addFields = newFields.stream().filter( // 新增的字段 @@ -51,7 +52,7 @@ public interface IotDevicePropertyMapper { modifyTypeFields.add(newField); return; } - if (newField.getLength()!= null) { + if (newField.getLength() != null) { if (newField.getLength() > oldField.getLength()) { modifyLengthFields.add(newField); } else if (newField.getLength() < oldField.getLength()) { diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/product/IotProductServiceImpl.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/product/IotProductServiceImpl.java index fc2300b7cb..b77a7e0e1b 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/product/IotProductServiceImpl.java +++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/product/IotProductServiceImpl.java @@ -121,9 +121,9 @@ public class IotProductServiceImpl implements IotProductService { // 1. 校验存在 validateProductExists(id); - // 2. 产品是发布状态 + // 2. 更新为发布状态,需要创建产品超级表数据模型 + // TODO @芋艿:【待定 001】1)是否需要操作后,在 redis 进行缓存,实现一个“快照”的情况,类似 tl; if (Objects.equals(status, IotProductStatusEnum.PUBLISHED.getStatus())) { - // 创建产品超级表数据模型 devicePropertyDataService.defineDevicePropertyData(id); }