Commit b167b419f4001be7ecbf544d25c6934f6bf0e2bf
1 parent
1a2639e4
fix:【iot 物联网】增强 jdk8 的兼容性
Showing
2 changed files
with
4 additions
and
8 deletions
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/YudaoWebAutoConfiguration.java
| ... | ... | @@ -50,7 +50,7 @@ public class YudaoWebAutoConfiguration { |
| 50 | 50 | |
| 51 | 51 | @Override |
| 52 | 52 | public RequestMappingHandlerMapping getRequestMappingHandlerMapping() { |
| 53 | - var mapping = new RequestMappingHandlerMapping(); | |
| 53 | + RequestMappingHandlerMapping mapping = new RequestMappingHandlerMapping(); | |
| 54 | 54 | // 实例化时就带上前缀 |
| 55 | 55 | mapping.setPathPrefixes(buildPathPrefixes(webProperties)); |
| 56 | 56 | return mapping; | ... | ... |
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/scene/IotSceneRuleServiceImpl.java
| ... | ... | @@ -240,24 +240,20 @@ public class IotSceneRuleServiceImpl implements IotSceneRuleService { |
| 240 | 240 | * @return 规则场景列表 |
| 241 | 241 | */ |
| 242 | 242 | private List<IotSceneRuleDO> getMatchedSceneRuleListByMessage(IotDeviceMessage message) { |
| 243 | - // 1. 匹配设备 | |
| 244 | - // TODO 缓存 @puhui999:可能需要 getSelf() | |
| 245 | 243 | // 1.1 通过 deviceId 获取设备信息 |
| 246 | 244 | IotDeviceDO device = getSelf().deviceService.getDeviceFromCache(message.getDeviceId()); |
| 247 | 245 | if (device == null) { |
| 248 | 246 | log.warn("[getMatchedSceneRuleListByMessage][设备({}) 不存在]", message.getDeviceId()); |
| 249 | - return List.of(); | |
| 247 | + return ListUtil.of(); | |
| 250 | 248 | } |
| 251 | - | |
| 252 | 249 | // 1.2 通过 productId 获取产品信息 |
| 253 | 250 | IotProductDO product = getSelf().productService.getProductFromCache(device.getProductId()); |
| 254 | 251 | if (product == null) { |
| 255 | 252 | log.warn("[getMatchedSceneRuleListByMessage][产品({}) 不存在]", device.getProductId()); |
| 256 | - return List.of(); | |
| 253 | + return ListUtil.of(); | |
| 257 | 254 | } |
| 258 | - | |
| 259 | 255 | // 1.3 获取匹配的规则场景 |
| 260 | - List<IotSceneRuleDO> sceneRules = getSceneRuleListByProductIdAndDeviceIdFromCache( | |
| 256 | + List<IotSceneRuleDO> sceneRules = getSelf().getSceneRuleListByProductIdAndDeviceIdFromCache( | |
| 261 | 257 | product.getId(), device.getId()); |
| 262 | 258 | if (CollUtil.isEmpty(sceneRules)) { |
| 263 | 259 | return sceneRules; | ... | ... |