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