Commit 27a0aca516fb1cc6250bceae9cce2731cc30a798
1 parent
8f2c65a4
fix:【iot】IotSceneRuleServiceImpl 缓存处理不正确,导致 getSelf NPE 问题
Showing
1 changed file
with
2 additions
and
2 deletions
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/scene/IotSceneRuleServiceImpl.java
| @@ -241,13 +241,13 @@ public class IotSceneRuleServiceImpl implements IotSceneRuleService { | @@ -241,13 +241,13 @@ public class IotSceneRuleServiceImpl implements IotSceneRuleService { | ||
| 241 | */ | 241 | */ |
| 242 | private List<IotSceneRuleDO> getMatchedSceneRuleListByMessage(IotDeviceMessage message) { | 242 | private List<IotSceneRuleDO> getMatchedSceneRuleListByMessage(IotDeviceMessage message) { |
| 243 | // 1.1 通过 deviceId 获取设备信息 | 243 | // 1.1 通过 deviceId 获取设备信息 |
| 244 | - IotDeviceDO device = getSelf().deviceService.getDeviceFromCache(message.getDeviceId()); | 244 | + IotDeviceDO device = deviceService.getDeviceFromCache(message.getDeviceId()); |
| 245 | if (device == null) { | 245 | if (device == null) { |
| 246 | log.warn("[getMatchedSceneRuleListByMessage][设备({}) 不存在]", message.getDeviceId()); | 246 | log.warn("[getMatchedSceneRuleListByMessage][设备({}) 不存在]", message.getDeviceId()); |
| 247 | return ListUtil.of(); | 247 | return ListUtil.of(); |
| 248 | } | 248 | } |
| 249 | // 1.2 通过 productId 获取产品信息 | 249 | // 1.2 通过 productId 获取产品信息 |
| 250 | - IotProductDO product = getSelf().productService.getProductFromCache(device.getProductId()); | 250 | + IotProductDO product = productService.getProductFromCache(device.getProductId()); |
| 251 | if (product == null) { | 251 | if (product == null) { |
| 252 | log.warn("[getMatchedSceneRuleListByMessage][产品({}) 不存在]", device.getProductId()); | 252 | log.warn("[getMatchedSceneRuleListByMessage][产品({}) 不存在]", device.getProductId()); |
| 253 | return ListUtil.of(); | 253 | return ListUtil.of(); |