diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/DeviceMonitorController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/DeviceMonitorController.java index 795b093..1c53cfe 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/DeviceMonitorController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/DeviceMonitorController.java @@ -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 baseMonitorunitInfoDtos = - baseMonitorunitInfoService.selectBaseMonitorunitInfoDtoList( - new BaseMonitorunitInfo(monitorunitId)); + baseMonitorunitInfoService.selectBaseMonitorunitInfoDtoList(new BaseMonitorunitInfo(monitorunitId)); + baseMonitorunitInfoDtos.forEach(x->{ + List 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); } diff --git a/ruoyi-admin/src/main/resources/templates/section/transformer-detail.html b/ruoyi-admin/src/main/resources/templates/section/transformer-detail.html index 29e8550..846cc88 100644 --- a/ruoyi-admin/src/main/resources/templates/section/transformer-detail.html +++ b/ruoyi-admin/src/main/resources/templates/section/transformer-detail.html @@ -416,12 +416,12 @@
-

设备编号:10kv 主变压器001

+
@@ -469,7 +469,7 @@ multiSelect: $('#chk-select-multi').is(':checked'), onNodeSelected: function (event, node) { $('#selectable-output').prepend('

' + node.text + ' was selected

'); - if(node.nodeId > 0){ + if (node.nodeId > 0) { monitorUnitModule(node.href); sensorCollectionRefresh(node.href); } @@ -500,10 +500,10 @@