mirror of
https://github.com/YunaiV/ruoyi-vue-pro.git
synced 2025-10-27 11:46:05 +08:00
fix:【iot 物联网】增强 jdk8 的兼容性
This commit is contained in:
@ -50,7 +50,7 @@ public class YudaoWebAutoConfiguration {
|
||||
|
||||
@Override
|
||||
public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
|
||||
var mapping = new RequestMappingHandlerMapping();
|
||||
RequestMappingHandlerMapping mapping = new RequestMappingHandlerMapping();
|
||||
// 实例化时就带上前缀
|
||||
mapping.setPathPrefixes(buildPathPrefixes(webProperties));
|
||||
return mapping;
|
||||
|
||||
@ -240,24 +240,20 @@ public class IotSceneRuleServiceImpl implements IotSceneRuleService {
|
||||
* @return 规则场景列表
|
||||
*/
|
||||
private List<IotSceneRuleDO> getMatchedSceneRuleListByMessage(IotDeviceMessage message) {
|
||||
// 1. 匹配设备
|
||||
// TODO 缓存 @puhui999:可能需要 getSelf()
|
||||
// 1.1 通过 deviceId 获取设备信息
|
||||
IotDeviceDO device = getSelf().deviceService.getDeviceFromCache(message.getDeviceId());
|
||||
if (device == null) {
|
||||
log.warn("[getMatchedSceneRuleListByMessage][设备({}) 不存在]", message.getDeviceId());
|
||||
return List.of();
|
||||
return ListUtil.of();
|
||||
}
|
||||
|
||||
// 1.2 通过 productId 获取产品信息
|
||||
IotProductDO product = getSelf().productService.getProductFromCache(device.getProductId());
|
||||
if (product == null) {
|
||||
log.warn("[getMatchedSceneRuleListByMessage][产品({}) 不存在]", device.getProductId());
|
||||
return List.of();
|
||||
return ListUtil.of();
|
||||
}
|
||||
|
||||
// 1.3 获取匹配的规则场景
|
||||
List<IotSceneRuleDO> sceneRules = getSceneRuleListByProductIdAndDeviceIdFromCache(
|
||||
List<IotSceneRuleDO> sceneRules = getSelf().getSceneRuleListByProductIdAndDeviceIdFromCache(
|
||||
product.getId(), device.getId());
|
||||
if (CollUtil.isEmpty(sceneRules)) {
|
||||
return sceneRules;
|
||||
|
||||
Reference in New Issue
Block a user