|
|
|
@ -8,10 +8,7 @@ import com.xydl.cac.model.SensorDetail;
|
|
|
|
|
import com.xydl.cac.model.SensorUpdateModel;
|
|
|
|
|
import com.xydl.cac.repository.NPointRepository;
|
|
|
|
|
import com.xydl.cac.repository.NSensorRepository;
|
|
|
|
|
import com.xydl.cac.service.DataService;
|
|
|
|
|
import com.xydl.cac.service.NSensorService;
|
|
|
|
|
import com.xydl.cac.service.UnitService;
|
|
|
|
|
import com.xydl.cac.service.ZsbService;
|
|
|
|
|
import com.xydl.cac.service.*;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
@ -39,6 +36,8 @@ public class NSensorServiceImpl implements NSensorService {
|
|
|
|
|
DataService dataService;
|
|
|
|
|
@Resource
|
|
|
|
|
ZsbService zsbService;
|
|
|
|
|
@Resource
|
|
|
|
|
ModevTypeService modevTypeService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<NSensor> listAll(Integer zsbid) throws Exception {
|
|
|
|
@ -48,12 +47,13 @@ public class NSensorServiceImpl implements NSensorService {
|
|
|
|
|
} else {
|
|
|
|
|
list = repository.findByZsbId(zsbid);
|
|
|
|
|
}
|
|
|
|
|
this.fillZsbName(list);
|
|
|
|
|
this.fillOtherNames(list);
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void fillZsbName(List<NSensor> list) throws Exception {
|
|
|
|
|
private void fillOtherNames(List<NSensor> list) throws Exception {
|
|
|
|
|
List<Zsb> zsbList = zsbService.listAll(null);
|
|
|
|
|
List<ModevType> modevTypeList = modevTypeService.listAll();
|
|
|
|
|
if (!CollectionUtils.isEmpty(list) && !CollectionUtils.isEmpty(zsbList)) {
|
|
|
|
|
for (NSensor sensor : list) {
|
|
|
|
|
for (Zsb zsb : zsbList) {
|
|
|
|
@ -62,6 +62,12 @@ public class NSensorServiceImpl implements NSensorService {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (ModevType type : modevTypeList) {
|
|
|
|
|
if (type.getId().equals(sensor.getTypeId())) {
|
|
|
|
|
sensor.setTypeName(type.getMc());
|
|
|
|
|
sensor.setTableName(type.getTablename());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -70,7 +76,7 @@ public class NSensorServiceImpl implements NSensorService {
|
|
|
|
|
public Page<NSensor> list(int pageNum, int pageSize) throws Exception {
|
|
|
|
|
PageRequest request = PageRequest.of(pageNum, pageSize);
|
|
|
|
|
Page<NSensor> result = repository.findAll(request);
|
|
|
|
|
this.fillZsbName(result.getContent());
|
|
|
|
|
this.fillOtherNames(result.getContent());
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|