1.1.3 监控单元Controller修改

dev
zhouhy 1 year ago
parent 8854095388
commit bbfa19c0a8

@ -160,6 +160,7 @@ public class HwMonitorPlatformController extends BaseController {
* */
@PostMapping("/SubDevice")
public SubDeviceSumVo subDevice(Long sceneId){
SubDeviceSumVo subDeviceSumVos = hwMonitorUnitService.selectSubDeviceSum(sceneId);
return subDeviceSumVos;
@ -170,6 +171,7 @@ public class HwMonitorPlatformController extends BaseController {
* */
@PostMapping("/ElectronicNumVo")
public TableDataInfo ElectronicNumVo(Long sceneId){
List<EleMonitorDeviceSumVo> eleMonitorDeviceSumVos = hwElectronicFenceService.selectEleTypeNums(sceneId);
return getDataTable(eleMonitorDeviceSumVos);
}
@ -180,6 +182,7 @@ public class HwMonitorPlatformController extends BaseController {
@PostMapping("/selectMonitorUnitSub")
//ok
public HwMonitorUnit selectMonitorUnitSub(Long monitorUnitId){
HwMonitorUnit hwMonitorUnits = hwMonitorUnitService.selectHwMonitorUnitByMonitorUnitId(monitorUnitId);
return hwMonitorUnits;
@ -199,9 +202,10 @@ public class HwMonitorPlatformController extends BaseController {
*
* */
@PostMapping("/selectLatestDataByTags")
public TableDataInfo selectLatestDataByTags(Long monitorUnitId){
List<Map<String, Object>> list= hwMonitorUnitService.selectLatestDataByTags(monitorUnitId);
return getDataTable(list);
public R<Map<String, Map<String, Object>>>selectLatestDataByTags(Long monitorUnitId){
R<Map<String, Map<String, Object>>> mapR = hwMonitorUnitService.selectLatestDataByTags(monitorUnitId);
return mapR;
}
/**
*
@ -213,8 +217,9 @@ public class HwMonitorPlatformController extends BaseController {
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser sysUser = loginUser.getSysUser();
Long tenantId = sysUser.getTenantId();
List<HwScene> hwScenes = hwSceneService.selectHwSceneByTenantId(tenantId);
hwScenes.get(0).setDefaultFlag("1");
List<HwScene> hwScenes = hwSceneService.selectHwSceneByTenantId(1l);
if (hwScenes.size()!=0){
hwScenes.get(0).setDefaultFlag("1");}
return getDataTable(hwScenes);
}
}

@ -5,6 +5,7 @@ import java.util.Map;
import com.ruoyi.business.domain.HwMonitorUnit;
import com.ruoyi.business.domain.VO.*;
import com.ruoyi.common.core.domain.R;
/**
@ -76,7 +77,7 @@ public interface IHwMonitorUnitService
*
*
* @return*/
public List<Map<String, Object>> selectLatestDataByTags(Long monitorUnitId);
public R<Map<String, Map<String, Object>>> selectLatestDataByTags(Long monitorUnitId);
/**

@ -13,6 +13,7 @@ import com.ruoyi.business.domain.VO.*;
import com.ruoyi.business.mapper.HwDeviceMapper;
import com.ruoyi.business.mapper.HwElectronicFenceMapper;
import com.ruoyi.common.core.constant.TdEngineConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.tdengine.api.RemoteTdEngineService;
@ -249,8 +250,9 @@ public class HwMonitorUnitServiceImpl implements IHwMonitorUnitService
}
@Override
public List<Map<String, Object>> selectLatestDataByTags(Long monitorUnitId) {
List<Map<String, Object>> latestData = new ArrayList<Map<String, Object>>();
public R<Map<String, Map<String, Object>>> selectLatestDataByTags(Long monitorUnitId) {
//
R<Map<String, Map<String, Object>>> latestDataByTags = new R<Map<String,Map<String, Object>>>();
List<HwDevice> hwDevices = hwDeviceMapper.selectDeviceByMonitorId(monitorUnitId);
TdSelectDto tdSelectDto = new TdSelectDto();
for (int i = 0; i < hwDevices.size(); i++){
@ -258,9 +260,9 @@ public class HwMonitorUnitServiceImpl implements IHwMonitorUnitService
tdSelectDto.setTableName(TdEngineConstants.getDeviceDataTableName(hwDevices.get(i).getDeviceId()));
tdSelectDto.setTagsName(hwDevices.get(i).getDeviceCode());
latestData = (List<Map<String, Object>>) remoteTdEgineService.getLatestDataByTags(tdSelectDto);
latestDataByTags = remoteTdEgineService.getLatestDataByTags(tdSelectDto);
}
return latestData;
return latestDataByTags;
}
//todo SysDeptServiceImpl类中的递归方法recursionFn(以实现)

@ -91,12 +91,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectHwSceneByTenantId0" parameterType="Long" resultMap="HwSceneResult">
<include refid="selectHwSceneVo"/>
where order by update_time desc
order by update_time desc
</select>
<select id="selectHwSceneByTenantIdNot0" parameterType="Long" resultMap="HwSceneResult">
<include refid="selectHwSceneVo"/>
where tenant_id = #{tenantId}
and
order by update_time desc
</select>
<select id="selectHwSceneBySceneId" parameterType="Long" resultMap="HwSceneResult">

Loading…
Cancel
Save