Browse Source

新增视频大屏摄像头在线数接口

main
sjh 10 months ago
parent
commit
21829e6d49
  1. 35
      src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java
  2. 18
      src/main/java/com/biutag/supervision/mapper/WvpDeviceChannelMapper.java
  3. 333
      src/main/java/com/biutag/supervision/pojo/entity/WvpDeviceChannel.java
  4. 11
      src/main/java/com/biutag/supervision/service/WvpDeviceChannelService.java
  5. 6
      src/main/resources/application-dev.yml
  6. 6
      src/main/resources/application-prod.yml

35
src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java

@ -2,8 +2,13 @@ package com.biutag.supervision.controller.datav;
import com.alibaba.fastjson.JSONObject;
import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.mapper.WvpDeviceChannelMapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.vo.*;
import com.biutag.supervision.pojo.entity.WvpDeviceChannel;
import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo;
import com.biutag.supervision.pojo.vo.VideoSuperviseCountVo;
import com.biutag.supervision.pojo.vo.VideoSuperviseMapIconVo;
import com.biutag.supervision.service.VideoSuperviseService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -35,10 +40,38 @@ public class DataVVideoSuperviseController {
private final VideoSuperviseService videoSuperviseService;
private final NegativeMapper negativeMapper;
private final WvpDeviceChannelMapper wvpDeviceChannelMapper;
//region 左边
/**
* 获取视频督察摄像头数量
*
* @return
*/
@Operation(summary = "摄像头数量")
@GetMapping("/getVideoStatus")
public Result<JSONObject> getVideoStatus() {
List<WvpDeviceChannel> videoStatus = wvpDeviceChannelMapper.getVideoStatus();
if (videoStatus == null || videoStatus.isEmpty()) {
JSONObject data = new JSONObject();
data.fluentPut("on", 0);
data.fluentPut("all", 0);
data.fluentPut("percentage", "0%");
return Result.success(data);
}
long onCount = videoStatus.stream()
.filter(channel -> "ON".equals(channel.getStatus()))
.count();
int percentage = (int) Math.round((onCount * 100.0) / videoStatus.size());
JSONObject data = new JSONObject();
data.fluentPut("on", onCount);
data.fluentPut("all", videoStatus.size());
data.fluentPut("percentage", percentage + "%");
return Result.success(data);
}
/**
* 获取视频督察大屏问题数排名
*

18
src/main/java/com/biutag/supervision/mapper/WvpDeviceChannelMapper.java

@ -0,0 +1,18 @@
package com.biutag.supervision.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.WvpDeviceChannel;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@DS("wvp")
public interface WvpDeviceChannelMapper extends BaseMapper<WvpDeviceChannel> {
@Select("SELECT status " +
"FROM wvp_device_channel " +
"WHERE address != '0.0.0.0' " +
"AND status is not null " +
"AND longitude is not null;")
List<WvpDeviceChannel> getVideoStatus();
}

333
src/main/java/com/biutag/supervision/pojo/entity/WvpDeviceChannel.java

@ -0,0 +1,333 @@
package com.biutag.supervision.pojo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;
@Setter
@Getter
public class WvpDeviceChannel {
//
@TableId(value = "id", type = IdType.AUTO)
private Long id;
//
@TableField("device_id")
private String deviceId;
//
@TableField("name")
private String name;
//
@TableField("manufacturer")
private String manufacturer;
//
@TableField("model")
private String model;
//
@TableField("owner")
private String owner;
//
@TableField("civil_code")
private String civilCode;
//
@TableField("block")
private String block;
//
@TableField("address")
private String address;
//
@TableField("parental")
private Integer parental;
//
@TableField("parent_id")
private String parentId;
//
@TableField("safety_way")
private Integer safetyWay;
//
@TableField("register_way")
private Integer registerWay;
//
@TableField("cert_num")
private String certNum;
//
@TableField("certifiable")
private Integer certifiable;
//
@TableField("err_code")
private Integer errCode;
//
@TableField("end_time")
private String endTime;
//
@TableField("secrecy")
private Integer secrecy;
//
@TableField("ip_address")
private String ipAddress;
//
@TableField("port")
private Integer port;
//
@TableField("password")
private String password;
//
@TableField("status")
private String status;
//
@TableField("longitude")
private Double longitude;
//
@TableField("latitude")
private Double latitude;
//
@TableField("ptz_type")
private Integer ptzType;
//
@TableField("position_type")
private Integer positionType;
//
@TableField("room_type")
private Integer roomType;
//
@TableField("use_type")
private Integer useType;
//
@TableField("supply_light_type")
private Integer supplyLightType;
//
@TableField("direction_type")
private Integer directionType;
//
@TableField("resolution")
private String resolution;
//
@TableField("business_group_id")
private String businessGroupId;
//
@TableField("download_speed")
private String downloadSpeed;
//
@TableField("svc_space_support_mod")
private Integer svcSpaceSupportMod;
//
@TableField("svc_time_support_mode")
private Integer svcTimeSupportMode;
//
@TableField("create_time")
private String createTime;
//
@TableField("update_time")
private String updateTime;
//
@TableField("sub_count")
private Integer subCount;
//
@TableField("stream_id")
private String streamId;
//
@TableField("has_audio")
private Boolean hasAudio;
//
@TableField("gps_time")
private String gpsTime;
//
@TableField("stream_identification")
private String streamIdentification;
//
@TableField("channel_type")
private Integer channelType;
//
@TableField("gb_device_id")
private String gbDeviceId;
//
@TableField("gb_name")
private String gbName;
//
@TableField("gb_manufacturer")
private String gbManufacturer;
//
@TableField("gb_model")
private String gbModel;
//
@TableField("gb_owner")
private String gbOwner;
//
@TableField("gb_civil_code")
private String gbCivilCode;
//
@TableField("gb_block")
private String gbBlock;
//
@TableField("gb_address")
private String gbAddress;
//
@TableField("gb_parental")
private Integer gbParental;
//
@TableField("gb_parent_id")
private String gbParentId;
//
@TableField("gb_safety_way")
private Integer gbSafetyWay;
//
@TableField("gb_register_way")
private Integer gbRegisterWay;
//
@TableField("gb_cert_num")
private String gbCertNum;
//
@TableField("gb_certifiable")
private Integer gbCertifiable;
//
@TableField("gb_err_code")
private Integer gbErrCode;
//
@TableField("gb_end_time")
private String gbEndTime;
//
@TableField("gb_secrecy")
private Integer gbSecrecy;
//
@TableField("gb_ip_address")
private String gbIpAddress;
//
@TableField("gb_port")
private Integer gbPort;
//
@TableField("gb_password")
private String gbPassword;
//
@TableField("gb_status")
private String gbStatus;
//
@TableField("gb_longitude")
private String gbLongitude;
//
@TableField("gb_latitude")
private String gbLatitude;
//
@TableField("gb_business_group_id")
private String gbBusinessGroupId;
//
@TableField("gb_ptz_type")
private Integer gbPtzType;
//
@TableField("gb_position_type")
private Integer gbPositionType;
//
@TableField("gb_room_type")
private Integer gbRoomType;
//
@TableField("gb_use_type")
private Integer gbUseType;
//
@TableField("gb_supply_light_type")
private Integer gbSupplyLightType;
//
@TableField("gb_direction_type")
private Integer gbDirectionType;
//
@TableField("gb_resolution")
private String gbResolution;
//
@TableField("gb_download_speed")
private String gbDownloadSpeed;
//
@TableField("gb_svc_space_support_mod")
private Integer gbSvcSpaceSupportMod;
//
@TableField("gb_svc_time_support_mode")
private Integer gbSvcTimeSupportMode;
//
@TableField("record_plan_id")
private Integer recordPlanId;
//
@TableField("data_type")
private Integer dataType;
//
@TableField("data_device_id")
private Integer dataDeviceId;
}

11
src/main/java/com/biutag/supervision/service/WvpDeviceChannelService.java

@ -0,0 +1,11 @@
package com.biutag.supervision.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.pojo.entity.WvpDeviceChannel;
import com.biutag.supervision.mapper.WvpDeviceChannelMapper;
import org.springframework.stereotype.Service;
@Service
public class WvpDeviceChannelService extends ServiceImpl<WvpDeviceChannelMapper, WvpDeviceChannel> {
}

6
src/main/resources/application-dev.yml

@ -38,6 +38,12 @@ spring:
url: jdbc:postgresql://58.51.152.18:10642/mailbox?currentSchema=mailbox
username: alphay
password: alphay@123
wvp:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.31.217.20:31868/wvp2?serverTimezone=GMT%2B8
username: root
password: ip12341234
druid:
min-evictable-idle-time-millis: 300000
test-on-borrow: false

6
src/main/resources/application-prod.yml

@ -38,6 +38,12 @@ spring:
url: jdbc:postgresql://65.47.60.178:5432/mailbox?currentSchema=mailbox
username: dba
password: Ip12341234
wvp:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://65.47.6.109:3306/wvp2?serverTimezone=GMT%2B8&useSSL=false
username: root
password: ip12341234
druid:
min-evictable-idle-time-millis: 300000

Loading…
Cancel
Save