|
|
|
@ -1,10 +1,12 @@
|
|
|
|
|
package com.xydl.cac.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.xydl.cac.entity.IcdIed;
|
|
|
|
|
import com.xydl.cac.entity.IedDlConfig;
|
|
|
|
|
import com.xydl.cac.entity.NSensor;
|
|
|
|
|
import com.xydl.cac.exception.BusinessException;
|
|
|
|
|
import com.xydl.cac.repository.IedDlConfigRepository;
|
|
|
|
|
import com.xydl.cac.repository.NSensorRepository;
|
|
|
|
|
import com.xydl.cac.service.IcdFileConfigService;
|
|
|
|
|
import com.xydl.cac.service.IedDlConfigService;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -24,15 +26,24 @@ public class IedDlConfigServiceImpl implements IedDlConfigService {
|
|
|
|
|
IedDlConfigRepository repository;
|
|
|
|
|
@Resource
|
|
|
|
|
NSensorRepository sensorRepository;
|
|
|
|
|
@Resource
|
|
|
|
|
IcdFileConfigService configService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<IedDlConfig> listAll() {
|
|
|
|
|
List<IedDlConfig> list = repository.findAll();
|
|
|
|
|
List<IcdIed> iedList = configService.listIed();
|
|
|
|
|
for (IedDlConfig item : list) {
|
|
|
|
|
List<NSensor> sensorList = sensorRepository.findByDevId(item.getDevId());
|
|
|
|
|
if (!CollectionUtils.isEmpty(sensorList)) {
|
|
|
|
|
item.setSensor(sensorList.get(0));
|
|
|
|
|
}
|
|
|
|
|
for (IcdIed ied : iedList) {
|
|
|
|
|
if (ied.getId().intValue() == item.getIedId().intValue()) {
|
|
|
|
|
item.setIed(ied);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|