|
@@ -3,6 +3,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 org.jeecg.common.util.oConvertUtils;
|
|
|
+import org.jeecg.modules.deviceLesm.entity.DeviceInformation;
|
|
|
import org.jeecg.modules.deviceLesm.mapper.DeviceInformationMapper;
|
|
|
import org.jeecg.modules.events.entity.LeanEventsHost;
|
|
|
import org.jeecg.modules.events.entity.LeanEventsHostEditParam;
|
|
@@ -84,12 +85,17 @@ public class LeanEventsHostServiceImpl extends ServiceImpl<LeanEventsHostMapper,
|
|
|
}
|
|
|
// 处理辅设备标题列表
|
|
|
List<String> deviceChildTites = Arrays.asList(leanEventsHost.getDeviceInformationList().split(","));
|
|
|
- List<String> resChildTites = deviceInformationMapper.selectBatchIds(deviceChildTites)
|
|
|
- .stream()
|
|
|
- .map(x -> x.getId() + "|" + x.getDeviceTitle())
|
|
|
- .collect(Collectors.toList());
|
|
|
- // 更新 LeanEventsHost 对象的辅设备配置信息ID集
|
|
|
- leanEventsHost.setDeviceInformationList(String.join(",", resChildTites));
|
|
|
+ List<DeviceInformation> deviceInformationList = deviceInformationMapper.selectBatchIds(deviceChildTites);
|
|
|
+ if (!oConvertUtils.listIsNotEmpty(deviceInformationList)){
|
|
|
+ leanEventsHost.setDeviceInformationList(null);
|
|
|
+ }else {
|
|
|
+ List<String> resChildTites = deviceInformationList.stream()
|
|
|
+ .map(x -> x.getId() + "|" + x.getDeviceTitle())
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ // 更新 LeanEventsHost 对象的辅设备配置信息ID集
|
|
|
+ leanEventsHost.setDeviceInformationList(String.join(",", resChildTites));
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
|
|
|
leanEventsHosts.forEach(x ->{
|
|
@@ -100,7 +106,14 @@ public class LeanEventsHostServiceImpl extends ServiceImpl<LeanEventsHostMapper,
|
|
|
if (!oConvertUtils.listIsNotEmpty(leanEventsHostResultList)){
|
|
|
return leanEventsHostResultList;
|
|
|
}
|
|
|
- List<String> list =leanEventsHostResultList.stream().map(LeanEventsHostResult::getDeviceInformationList).collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<LeanEventsHostResult> leanEventsHostResultList1 = leanEventsHostResultList.stream()
|
|
|
+ .filter(s -> oConvertUtils.isNotEmpty(s.getDeviceInformationList()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (!oConvertUtils.listIsNotEmpty(leanEventsHostResultList1)){
|
|
|
+ return leanEventsHostResultList;
|
|
|
+ }
|
|
|
+ List<String> list =leanEventsHostResultList1.stream().map(LeanEventsHostResult::getDeviceInformationList).collect(Collectors.toList());
|
|
|
|
|
|
List<String> deviceInformationIdIds = new ArrayList<>();
|
|
|
list.forEach(s ->{
|