|
|
|
@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.ruoyi.common.json.JsonUtils;
|
|
|
|
|
import com.ruoyi.system.domain.BaseDeviceParam;
|
|
|
|
|
import com.ruoyi.system.domain.BaseMonitorunitInfo;
|
|
|
|
|
import com.ruoyi.system.domain.BaseSensorInfo;
|
|
|
|
|
import com.ruoyi.system.domain.dto.BaseMonitorunitInfoDto;
|
|
|
|
|
import com.ruoyi.system.domain.dto.BaseSensorInfoDto;
|
|
|
|
|
import com.ruoyi.system.service.IBaseDeviceParamService;
|
|
|
|
|
import com.ruoyi.system.service.IBaseMonitorunitInfoService;
|
|
|
|
|
import com.ruoyi.system.service.IBaseSensorInfoService;
|
|
|
|
|
import lombok.Data;
|
|
|
|
@ -39,6 +41,9 @@ public class DeviceMonitorController {
|
|
|
|
|
|
|
|
|
|
@Autowired private StringRedisTemplate redisTemplate;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IBaseDeviceParamService baseDeviceParamService;
|
|
|
|
|
|
|
|
|
|
private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -119,8 +124,15 @@ public class DeviceMonitorController {
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String getMonitorUnitInfo(String monitorunitId) {
|
|
|
|
|
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtos =
|
|
|
|
|
baseMonitorunitInfoService.selectBaseMonitorunitInfoDtoList(
|
|
|
|
|
new BaseMonitorunitInfo(monitorunitId));
|
|
|
|
|
baseMonitorunitInfoService.selectBaseMonitorunitInfoDtoList(new BaseMonitorunitInfo(monitorunitId));
|
|
|
|
|
baseMonitorunitInfoDtos.forEach(x->{
|
|
|
|
|
List<BaseDeviceParam> baseDeviceParams = baseDeviceParamService.selectBaseDeviceParamList(new BaseDeviceParam(x.getMonitorunitId(), 0L));
|
|
|
|
|
BaseDeviceParam[] deviceParams = new BaseDeviceParam[baseDeviceParams.size()];
|
|
|
|
|
for (int i = 0; i < baseDeviceParams.size(); i++){
|
|
|
|
|
deviceParams[i] = baseDeviceParams.get(i);
|
|
|
|
|
}
|
|
|
|
|
x.setDeviceParams(deviceParams);
|
|
|
|
|
});
|
|
|
|
|
return JSONArray.toJSONString(baseMonitorunitInfoDtos);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|