|
|
|
@ -72,6 +72,15 @@ public class NSensorServiceImpl implements NSensorService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void fillOtherName(NSensor sensor) throws Exception {
|
|
|
|
|
ModevType modevType = modevTypeService.detail(sensor.getTypeId());
|
|
|
|
|
sensor.setTableName(modevType.getTablename());
|
|
|
|
|
sensor.setTypeName(modevType.getMc());
|
|
|
|
|
Zsb zsb = zsbService.detail(sensor.getZsbId());
|
|
|
|
|
sensor.setZsbName(zsb.getMc());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Page<NSensor> list(int pageNum, int pageSize) throws Exception {
|
|
|
|
|
PageRequest request = PageRequest.of(pageNum, pageSize);
|
|
|
|
@ -116,12 +125,16 @@ public class NSensorServiceImpl implements NSensorService {
|
|
|
|
|
throw new BusinessException("未找到该装置");
|
|
|
|
|
}
|
|
|
|
|
NSensor sensor = optional.get();
|
|
|
|
|
if (StringUtils.isBlank(sensor.getTableName())) {
|
|
|
|
|
throw new BusinessException("该装置缺少table_name信息");
|
|
|
|
|
if (sensor.getTypeId() == null) {
|
|
|
|
|
throw new BusinessException("该装置缺少类型id信息");
|
|
|
|
|
}
|
|
|
|
|
if (sensor.getDevId() == null) {
|
|
|
|
|
throw new BusinessException("该装置缺少dev_id信息");
|
|
|
|
|
}
|
|
|
|
|
this.fillOtherName(sensor);
|
|
|
|
|
if (StringUtils.isBlank(sensor.getTableName())) {
|
|
|
|
|
throw new BusinessException("该装置类型" + sensor.getTypeName() + "缺少table_name信息");
|
|
|
|
|
}
|
|
|
|
|
List<NPoint> points = pointRepository.findBySensorIdAndType(sensor.getId(), YaoCe);
|
|
|
|
|
if (CollectionUtils.isEmpty(points)) {
|
|
|
|
|
throw new BusinessException("该装置缺少属性点表信息");
|
|
|
|
|