感知设备与视频设备接口更新,

develop
hanrenchun 10 months ago
parent 18eecf0a36
commit 3f30f6068c

@ -3,6 +3,9 @@ package com.ruoyi.database.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.database.domain.DevopsDeviceInfo;
import com.ruoyi.database.domain.DevopsDeviceStatus;
import com.ruoyi.database.domain.DevopsVideoInfo;
import com.ruoyi.database.domain.DevopsVideoStatus;
import com.ruoyi.database.service.DevopsDeviceInfoService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
@ -10,6 +13,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.database.service.DevopsDeviceStatusService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@ -17,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
@ -32,13 +37,24 @@ import java.util.List;
public class DevopsDeviceInfoController extends BaseController {
private final DevopsDeviceInfoService devopsDeviceInfoService;
private final DevopsDeviceStatusService devopsDeviceStatusService;
@GetMapping
@ApiOperation("查询智能设备信息表")
public TableDataInfo<DevopsDeviceInfo> list(DevopsDeviceInfo devopsDeviceInfo) {
startPage();
List<DevopsDeviceInfo> list = devopsDeviceInfoService.list(new QueryWrapper<>(devopsDeviceInfo));
return getDataTable(list);
List<DevopsDeviceStatus> list1 = devopsDeviceStatusService.lambdaQuery().eq(DevopsDeviceStatus::getIsOnline, 1).list();
ArrayList<String> strings = new ArrayList<>();
for (DevopsDeviceStatus devopsDeviceStatus : list1) {
strings.add(devopsDeviceStatus.getGbsChannelNo());
}
List<DevopsDeviceInfo> list = devopsDeviceInfoService.lambdaQuery().in(DevopsDeviceInfo::getGbsChannelNo,strings).list();
ArrayList<DevopsDeviceInfo> devopsDeviceInfos = new ArrayList<>();
for (DevopsDeviceInfo deviceInfo : list){
deviceInfo.setIsOnline(1);
devopsDeviceInfos.add(deviceInfo);
}
return getDataTable(devopsDeviceInfos);
}
@PostMapping
@ -47,7 +63,6 @@ public class DevopsDeviceInfoController extends BaseController {
public AjaxResult insert(@RequestBody DevopsDeviceInfo devopsDeviceInfo) {
return toAjax(devopsDeviceInfoService.save(devopsDeviceInfo));
}
@PutMapping
@ApiOperation("修改智能设备信息表")
@Log(title = "智能设备信息表", businessType = BusinessType.UPDATE)

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.business.domain.dto.DevopsVideoInfoDto;
import com.ruoyi.common.utils.StringKit;
import com.ruoyi.database.domain.DevopsVideoInfo;
import com.ruoyi.database.domain.DevopsVideoStatus;
import com.ruoyi.database.service.DevopsVideoInfoService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
@ -12,13 +13,16 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.database.service.DevopsVideoStatusService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.checkerframework.checker.units.qual.A;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
@ -34,13 +38,24 @@ import java.util.List;
public class DevopsVideoInfoController extends BaseController {
private final DevopsVideoInfoService devopsVideoInfoService;
private final DevopsVideoStatusService devopsVideoStatusService;
@GetMapping
@ApiOperation("查询视频监控设备表")
public TableDataInfo<DevopsVideoInfo> list(DevopsVideoInfo devopsVideoInfo) {
startPage();
List<DevopsVideoInfo> list = devopsVideoInfoService.list(new QueryWrapper<>(devopsVideoInfo));
return getDataTable(list);
List<DevopsVideoStatus> list1 = devopsVideoStatusService.lambdaQuery().eq(DevopsVideoStatus::getIsOnline, 1).list();
ArrayList<String> strings = new ArrayList<>();
for (DevopsVideoStatus devopsVideoStatus : list1) {
strings.add(devopsVideoStatus.getGbsChannelNo());
}
List<DevopsVideoInfo> list = devopsVideoInfoService.lambdaQuery().in(DevopsVideoInfo::getGbsChannelNo,strings).list();
ArrayList<DevopsVideoInfo> devopsVideoInfos = new ArrayList<>();
for (DevopsVideoInfo devopsVideoInfo1 : list){
devopsVideoInfo1.setIsOnline(1);
devopsVideoInfos.add(devopsVideoInfo1);
}
return getDataTable(devopsVideoInfos);
}
@PostMapping
@ -96,7 +111,6 @@ public class DevopsVideoInfoController extends BaseController {
}
/**
*
*/

@ -24,6 +24,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**

@ -229,6 +229,8 @@ public class DevopsDeviceInfo extends BaseEntity {
@TableField(exist = false)
private String isDoorwayVideoCn;
@TableField(exist = false)
private Integer isOnline;
/**
* region_id
*/

@ -196,4 +196,7 @@ public class DevopsVideoInfo extends BaseEntity {
@Excel(name = "通道号")
private Integer channelNo;
@TableField(exist = false)
private Integer isOnline;
}

Loading…
Cancel
Save