diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/DevopsDeviceInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/DevopsDeviceInfoController.java index 09095f2..f18e7dc 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/DevopsDeviceInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/DevopsDeviceInfoController.java @@ -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 list(DevopsDeviceInfo devopsDeviceInfo) { startPage(); - List list = devopsDeviceInfoService.list(new QueryWrapper<>(devopsDeviceInfo)); - return getDataTable(list); + List list1 = devopsDeviceStatusService.lambdaQuery().eq(DevopsDeviceStatus::getIsOnline, 1).list(); + ArrayList strings = new ArrayList<>(); + for (DevopsDeviceStatus devopsDeviceStatus : list1) { + strings.add(devopsDeviceStatus.getGbsChannelNo()); + } + List list = devopsDeviceInfoService.lambdaQuery().in(DevopsDeviceInfo::getGbsChannelNo,strings).list(); + ArrayList 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) diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/DevopsVideoInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/DevopsVideoInfoController.java index 5c0ab8f..ef5e8fb 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/DevopsVideoInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/DevopsVideoInfoController.java @@ -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 list(DevopsVideoInfo devopsVideoInfo) { startPage(); - List list = devopsVideoInfoService.list(new QueryWrapper<>(devopsVideoInfo)); - return getDataTable(list); + List list1 = devopsVideoStatusService.lambdaQuery().eq(DevopsVideoStatus::getIsOnline, 1).list(); + ArrayList strings = new ArrayList<>(); + for (DevopsVideoStatus devopsVideoStatus : list1) { + strings.add(devopsVideoStatus.getGbsChannelNo()); + } + List list = devopsVideoInfoService.lambdaQuery().in(DevopsVideoInfo::getGbsChannelNo,strings).list(); + ArrayList 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 { } - /** * 一键导入 */ diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/TransitVehicleRecordController.java b/gather-app/src/main/java/com/ruoyi/database/controller/TransitVehicleRecordController.java index 51c93a3..aa0b9ac 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/TransitVehicleRecordController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/TransitVehicleRecordController.java @@ -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; /** diff --git a/gather-app/src/main/java/com/ruoyi/database/domain/DevopsDeviceInfo.java b/gather-app/src/main/java/com/ruoyi/database/domain/DevopsDeviceInfo.java index 23ae86b..5e8cc0a 100644 --- a/gather-app/src/main/java/com/ruoyi/database/domain/DevopsDeviceInfo.java +++ b/gather-app/src/main/java/com/ruoyi/database/domain/DevopsDeviceInfo.java @@ -229,6 +229,8 @@ public class DevopsDeviceInfo extends BaseEntity { @TableField(exist = false) private String isDoorwayVideoCn; + @TableField(exist = false) + private Integer isOnline; /** * 商汤region_id */ diff --git a/gather-app/src/main/java/com/ruoyi/database/domain/DevopsVideoInfo.java b/gather-app/src/main/java/com/ruoyi/database/domain/DevopsVideoInfo.java index 35c75ab..b0d3f4f 100644 --- a/gather-app/src/main/java/com/ruoyi/database/domain/DevopsVideoInfo.java +++ b/gather-app/src/main/java/com/ruoyi/database/domain/DevopsVideoInfo.java @@ -196,4 +196,7 @@ public class DevopsVideoInfo extends BaseEntity { @Excel(name = "通道号") private Integer channelNo; + @TableField(exist = false) + private Integer isOnline; + }