|
@@ -2,6 +2,7 @@ package org.jeecg.modules.events.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
import org.jeecg.modules.deviceLesm.entity.DeviceInformation;
|
|
|
import org.jeecg.modules.deviceLesm.mapper.DeviceInformationMapper;
|
|
@@ -31,6 +32,7 @@ import java.util.stream.Collectors;
|
|
|
* @Version: V1.0
|
|
|
*/
|
|
|
@Service
|
|
|
+@Slf4j
|
|
|
public class LeanEventsHostServiceImpl extends ServiceImpl<LeanEventsHostMapper, LeanEventsHost> implements ILeanEventsHostService {
|
|
|
|
|
|
@Resource
|
|
@@ -66,6 +68,7 @@ public class LeanEventsHostServiceImpl extends ServiceImpl<LeanEventsHostMapper,
|
|
|
leanEventsHostConfigService.saveBatch(leanEventsHostConfigList);
|
|
|
}
|
|
|
}
|
|
|
+ log.info("{}", "编辑精益事件设备启停配置表更新设备ID缓存");
|
|
|
updateEviceInformationCache();
|
|
|
}
|
|
|
|
|
@@ -97,20 +100,19 @@ public class LeanEventsHostServiceImpl extends ServiceImpl<LeanEventsHostMapper,
|
|
|
}
|
|
|
|
|
|
});
|
|
|
-
|
|
|
leanEventsHosts.forEach(x ->{
|
|
|
LeanEventsHostResult leanEventsHostResult = new LeanEventsHostResult();
|
|
|
BeanUtils.copyProperties(x, leanEventsHostResult);
|
|
|
leanEventsHostResultList.add(leanEventsHostResult);
|
|
|
});
|
|
|
- if (!oConvertUtils.listIsNotEmpty(leanEventsHostResultList)){
|
|
|
+ if (oConvertUtils.listIsEmpty(leanEventsHostResultList)){
|
|
|
return leanEventsHostResultList;
|
|
|
}
|
|
|
|
|
|
List<LeanEventsHostResult> leanEventsHostResultList1 = leanEventsHostResultList.stream()
|
|
|
.filter(s -> oConvertUtils.isNotEmpty(s.getDeviceInformationList()))
|
|
|
.collect(Collectors.toList());
|
|
|
- if (!oConvertUtils.listIsNotEmpty(leanEventsHostResultList1)){
|
|
|
+ if (oConvertUtils.listIsEmpty(leanEventsHostResultList1)){
|
|
|
return leanEventsHostResultList;
|
|
|
}
|
|
|
List<String> list =leanEventsHostResultList1.stream().map(LeanEventsHostResult::getDeviceInformationList).collect(Collectors.toList());
|
|
@@ -149,6 +151,8 @@ public class LeanEventsHostServiceImpl extends ServiceImpl<LeanEventsHostMapper,
|
|
|
allSubDeviceInformationList.addAll(Arrays.asList(x.split(",")));
|
|
|
});
|
|
|
List<String> cacheSubDeviceInformationList = allSubDeviceInformationList.stream().distinct().collect(Collectors.toList());
|
|
|
+ log.info("{}{}", "更新主设备ID集合keyMainString:", mainDeviceInformationIds);
|
|
|
+ log.info("{}{}", "更新辅设备ID集合keySubString:", cacheSubDeviceInformationList);
|
|
|
redisTemplate.opsForValue().set(keyMainString, mainDeviceInformationIds);
|
|
|
redisTemplate.opsForValue().set(keySubString, cacheSubDeviceInformationList);
|
|
|
}
|