|
|
@ -1,8 +1,10 @@
|
|
|
|
package com.xydl.cac.service.impl;
|
|
|
|
package com.xydl.cac.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import com.xydl.cac.entity.IedDlConfig;
|
|
|
|
import com.xydl.cac.entity.IedDlConfig;
|
|
|
|
|
|
|
|
import com.xydl.cac.entity.NSensor;
|
|
|
|
import com.xydl.cac.exception.BusinessException;
|
|
|
|
import com.xydl.cac.exception.BusinessException;
|
|
|
|
import com.xydl.cac.repository.IedDlConfigRepository;
|
|
|
|
import com.xydl.cac.repository.IedDlConfigRepository;
|
|
|
|
|
|
|
|
import com.xydl.cac.repository.NSensorRepository;
|
|
|
|
import com.xydl.cac.service.IedDlConfigService;
|
|
|
|
import com.xydl.cac.service.IedDlConfigService;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@ -20,10 +22,18 @@ public class IedDlConfigServiceImpl implements IedDlConfigService {
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
IedDlConfigRepository repository;
|
|
|
|
IedDlConfigRepository repository;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
NSensorRepository sensorRepository;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<IedDlConfig> listAll() {
|
|
|
|
public List<IedDlConfig> listAll() {
|
|
|
|
List<IedDlConfig> list = repository.findAll();
|
|
|
|
List<IedDlConfig> list = repository.findAll();
|
|
|
|
|
|
|
|
for (IedDlConfig item : list) {
|
|
|
|
|
|
|
|
List<NSensor> sensorList = sensorRepository.findByDevId(item.getDevId());
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(sensorList)) {
|
|
|
|
|
|
|
|
item.setSensor(sensorList.get(0));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return list;
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|