将一期项目中相关代码合并到二期项目中去

This commit is contained in:
2025-12-25 10:54:44 +08:00
parent d575c638cc
commit ceae2f0039
145 changed files with 13261 additions and 60 deletions

View File

@@ -26,6 +26,94 @@
<groupId>com.ltgk.smartFishingPort</groupId>
<artifactId>smartFishingPort-system</artifactId>
</dependency>
<!-- 引入websocket的依赖包. -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<!--引入JWT-->
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.4.0</version>
</dependency>
<!-- spring security -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-spring-boot-starter</artifactId>
<version>2.2.1</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 对接海康综合安防管理平台 -->
<dependency>
<groupId>com.hikvision.ga</groupId>
<artifactId>artemis-http-client</artifactId>
<version>1.1.3</version>
</dependency>
<!--OKHttp-->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.14.0</version>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>javacv</artifactId>
<version>1.4.1</version>
</dependency>
<!-- 文件上传工具类 -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.3</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>2.2.10</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</dependency>
<!-- knife4j-->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,196 @@
package com.ltgk.smartFishingPort.common;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.TypeReference;
import com.ltgk.smartFishingPort.common.constant.DroneConstruct;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.Map;
import java.util.UUID;
/**
* 无人机客户端连接demo
*/
@Slf4j
@Component
public class DroneClientCommon {
@Value("${drone.key}")
private String droneKey; // 无人机密钥
@Value("${drone.url}")
private String droneUrl; // 无人机地址
@Value("${drone.url2}")
private String droneOneTouchTakeoffUrl; // 无人机地址
@Value("${drone.url3}")
private String startUrl; // 开启算法url
/**
* 获取无人机的uuid
* @return
*/
public static String getDroneUuid(){
return null;
}
/**
* 获取司空平台状态
* @return
*/
public DroneResponseBase getDroneSystemStatus(){
String resp = sendDroneGetRequest(DroneConstruct.SYSTEM_STATUS, null,null);
DroneResponseBase droneResponseBase = JSON.parseObject(resp, new TypeReference<DroneResponseBase>() {
});
return droneResponseBase;
}
/**
* 获取无人机通讯Token
* @return
*/
public static String getDroneToken(){
return null;
}
/**
* 无人机POST请求
*/
public String sendDronePostRequest(String url, String param, String uuid){
HttpRequest post = HttpUtil.createPost(droneUrl + url);
post.header("Content-Type", "application/json");
post.header("X-User-Token", droneKey);// token
post.header("X-Project-Uuid", uuid);//项目编号
post.header("X-Language", "zh");// 语言
post.header("X-Request-Id", UUID.randomUUID().toString());//请求唯一标识
post.body(param);
try (HttpResponse response = post.execute()) {
if (response.isOk()) {
log.info("sendDronePostRequest -- 发送无人机请求成功url{}", url);
String body = response.body();
return body;
} else {
log.error("sendDronePostRequest -- 发送无人机请求失败url{},失败原因:{}" , url,response.getStatus());
}
} catch (Exception e) {
log.error("sendDronePostRequest -- 发送无人机请求失败url{},失败原因:{}" , url,e.getMessage());
}
return null;
}
/**
* 无人机GET请求
*/
public String sendDroneGetRequest(String url, Map<String,Object> param, String uuid){
HttpRequest get = HttpUtil.createGet(droneUrl + url);
get.header("X-User-Token", droneKey);// token
get.header("X-Project-Uuid", uuid);//项目编号
get.header("X-Language", "zh");// 语言
get.header("X-Request-Id", UUID.randomUUID().toString());//请求唯一标识
if (ObjectUtils.isNotEmpty( param)){
param.forEach((k,v)->{
get.form(k,v);
});
}
try (HttpResponse response = get.execute()) {
if (response.isOk()) {
log.info("sendDroneGetRequest -- 发送无人机请求成功url{}", url);
String body = response.body();
return body;
} else {
log.error("sendDroneGetRequest -- 发送无人机请求失败url{},失败原因:{}" , url,response.getStatus());
}
} catch (Exception e) {
log.error("sendDroneGetRequest -- 发送无人机请求失败url{},失败原因:{}" , url,e.getMessage());
}
return null;
}
/**
* 无人机一键起降POST请求
*/
public String sendDroneOneTouchTakeoffPostRequest(String url, String param, String uuid){
HttpRequest post = HttpUtil.createPost(droneOneTouchTakeoffUrl + url);
post.header("Content-Type", "application/json");
post.header("X-User-Token", droneKey);// token
post.header("X-Project-Uuid", uuid);//项目编号
post.header("X-Language", "zh");// 语言
post.header("X-Request-Id", UUID.randomUUID().toString());//请求唯一标识
post.body(param);
try (HttpResponse response = post.execute()) {
if (response.isOk()) {
log.info("sendDroneOneTouchTakeoffPostRequest -- 发送无人机请求成功url{}", url);
String body = response.body();
return body;
} else {
log.error("sendDroneOneTouchTakeoffPostRequest -- 发送无人机请求失败url{},失败原因:{}" , url,response.getStatus());
}
} catch (Exception e) {
log.error("sendDroneOneTouchTakeoffPostRequest -- 发送无人机请求失败url{},失败原因:{}" , url,e.getMessage());
}
return null;
}
public String sendDroneOneTouchTakeoffGetRequest(String url, Map<String,Object> param, String uuid){
HttpRequest get = HttpUtil.createGet(droneOneTouchTakeoffUrl + url);
get.header("Content-Type", "application/json");
get.header("X-User-Token", droneKey);// token
get.header("X-Project-Uuid", uuid);//项目编号
get.header("X-Language", "zh");// 语言
get.header("X-Request-Id", UUID.randomUUID().toString());//请求唯一标识
if (ObjectUtils.isNotEmpty( param)){
param.forEach((k,v)->{
get.form(k,v);
});
}
try (HttpResponse response = get.execute()) {
if (response.isOk()) {
log.info("sendDroneOneTouchTakeoffGetRequest -- 发送无人机请求成功url{}", url);
String body = response.body();
return body;
} else {
log.error("sendDroneOneTouchTakeoffGetRequest -- 发送无人机请求失败url{},失败原因:{}" , url,response.getStatus());
}
} catch (Exception e) {
log.error("sendDroneOneTouchTakeoffGetRequest -- 发送无人机请求失败url{},失败原因:{}" , url,e.getMessage());
}
return null;
}
public String sendDroneOneTouchTakeoffDeleteRequest(String url, String param, String uuid){
HttpRequest delete = HttpRequest.delete(droneOneTouchTakeoffUrl + url);
delete.header("Content-Type", "application/json");
delete.header("X-User-Token", droneKey);// token
delete.header("X-Project-Uuid", uuid);//项目编号
delete.header("X-Language", "zh");// 语言
delete.header("X-Request-Id", UUID.randomUUID().toString());//请求唯一标识
delete.body(param);
try (HttpResponse response = delete.execute()) {
if (response.isOk()) {
log.info("sendDroneOneTouchTakeoffDeleteRequest -- 发送无人机请求成功url{}", url);
String body = response.body();
return body;
} else {
log.error("sendDroneOneTouchTakeoffDeleteRequest -- 发送无人机请求失败url{},失败原因:{}" , url,response.getStatus());
}
} catch (Exception e) {
log.error("sendDroneOneTouchTakeoffDeleteRequest -- 发送无人机请求失败url{},失败原因:{}" , url,e.getMessage());
}
return null;
}
public String sendVideoStreamDetectSwitch(String url, String param){
HttpRequest post = HttpUtil.createPost(startUrl + url);
post.header("Content-Type", "application/json");
post.body(param);
try (HttpResponse response = post.execute()) {
if (response.isOk()) {
log.info("sendVideoStreamDetectSwitch -- 发送开启算法请求成功url{},param:{}", url, param);
String body = response.body();
return body;
} else {
log.error("sendVideoStreamDetectSwitch -- 发送开启算法请求失败url{},失败原因:{},param:{}" , url,response.getStatus(),param);
}
} catch (Exception e) {
log.error("sendVideoStreamDetectSwitch -- 发送开启算法请求失败url{},失败原因:{},param:{}" , url,e.getMessage(),param);
}
return null;
}
}

View File

@@ -0,0 +1,18 @@
package com.ltgk.smartFishingPort.common;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class DroneResponseBase<T> {
@JsonProperty("code")
@ApiModelProperty(value = "响应码")
private Integer code;
@JsonProperty("message")
@ApiModelProperty(value = "响应信息")
private String message;
@JsonProperty("data")
@ApiModelProperty(value = "响应数据")
private T data;
}

View File

@@ -0,0 +1,146 @@
package com.ltgk.smartFishingPort.common;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.ltgk.smartFishingPort.common.utils.StringUtils;
import com.ltgk.smartFishingPort.domain.dto.BoatDynamicDto;
import com.ltgk.smartFishingPort.utils.GeoUtils;
import com.ltgk.smartFishingPort.websocket.work.SowWs;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.awt.geom.Point2D;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.stream.Collectors;
/**
* @Author: zhouyaoyao
* @Date 2025/8/6 14:40
* Description:
*/
@Slf4j
@Component
@RocketMQMessageListener(topic = "point-topic", consumerGroup = "boat-point-get")
public class RocketMQConsumer implements RocketMQListener<String> {
@Resource
@Qualifier("taskExecutor")
private TaskExecutor taskExecutor;
@Value("${geoJson}")
private String geoJson;
@Override
public void onMessage(String message) {
try {
// log.info("received message: {}",message);
// 2. 队列提交并行化
CompletableFuture.allOf(
CompletableFuture.runAsync(() -> this.addListToSaveQue(this.copyDynamicJsonToBoatDynamicDTO(message)), taskExecutor)
).exceptionally(ex -> {
log.error("队列提交失败", ex);
return null;
});
} catch (Exception e) {
log.info("消息异常:{}", e.getMessage());
}
}
private ConcurrentLinkedDeque<BoatDynamicDto> saveDataDeque = new ConcurrentLinkedDeque<>();
public synchronized boolean addListToSaveQue(BoatDynamicDto entity) {
try {
this.saveDataDeque.offer(entity);
if (this.saveDataDeque.size() > 200) {
this.submitJqQueueDataIfNeeded();
}
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
@Scheduled(fixedRate = 30 * 1000)
public void submitJqQueueDataIfNeeded() {
// 1. 加锁防止并发提交
synchronized (this) {
sendDynamic(saveDataDeque);
saveDataDeque.clear();
}
}
Map<String, BoatDynamicDto> globalMap;
public Map<String, BoatDynamicDto> getGlobalMap() {
if (Objects.isNull(globalMap)) {
return Maps.newHashMap();
} else {
return globalMap;
}
}
public List<BoatDynamicDto> getBoatDynamicList() {
if (CollectionUtils.isEmpty(globalMap)) {
return Lists.newArrayList();
} else {
return globalMap.values().stream().collect(Collectors.toList());
}
}
public void setGlobalMap(Map<String, BoatDynamicDto> globalMap) {
this.globalMap = globalMap;
}
public void sendDynamic(ConcurrentLinkedDeque<BoatDynamicDto> list) {
Map<String, BoatDynamicDto> map = list.stream()
.filter(f -> !Objects.isNull(f) && StringUtils.isNotBlank(f.getBoatName())).collect(
Collectors.groupingBy(BoatDynamicDto::getBoatName, Collectors.collectingAndThen(
Collectors.reducing((t1, t2) -> t1.getGpsTime().after(t2.getGpsTime()) ? t1 : t2), Optional::get))
);
Map<String, BoatDynamicDto> mapTmp = list.stream()
.filter(f -> !Objects.isNull(f) && StringUtils.isNotBlank(f.getBoatName())).collect(
Collectors.groupingBy(BoatDynamicDto::getTerminalCode, Collectors.collectingAndThen(
Collectors.reducing((t1, t2) -> t1.getGpsTime().after(t2.getGpsTime()) ? t1 : t2), Optional::get))
);
Map<String, BoatDynamicDto> globalMapTmp = getGlobalMap();
globalMapTmp.putAll(mapTmp);
setGlobalMap(globalMapTmp);
sowWs.sendMessage(new ArrayList<>(map.values()));
}
@Resource
SowWs sowWs;
public BoatDynamicDto copyDynamicJsonToBoatDynamicDTO(String dynamicJson) {
if (StringUtils.isBlank(dynamicJson)) {
return null;
}
BoatDynamicDto boatDynamic = JSONObject.parseObject(dynamicJson, BoatDynamicDto.class);
return boatDynamic;
}
public boolean pointInPolygon(Double lon, Double lat) {
List<Point2D.Double> points = new ArrayList<>();
Arrays.asList(geoJson.split(";")).forEach(point -> {
if (StringUtils.isNotBlank(point)) {
Point2D.Double point2D = new Point2D.Double(Double.parseDouble(point.split(",")[0]), Double.parseDouble(point.split(",")[1]));
points.add(point2D);
}
});
Point2D.Double point = new Point2D.Double(lon, lat);
return GeoUtils.isInPolygon(point, points);
}
}

View File

@@ -0,0 +1,21 @@
package com.ltgk.smartFishingPort.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@Configuration
public class TaskExecutorConfig {
@Bean("taskExecutor")
public TaskExecutor taskExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(10);
executor.setMaxPoolSize(20);
executor.setQueueCapacity(100);
executor.setThreadNamePrefix("rocketmq-consumer-");
executor.initialize();
return executor;
}
}

View File

@@ -0,0 +1,162 @@
package com.ltgk.smartFishingPort.controller;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.ltgk.smartFishingPort.common.constant.Constants;
import com.ltgk.smartFishingPort.common.core.domain.Response;
import com.ltgk.smartFishingPort.common.core.redis.RedisCache;
import com.ltgk.smartFishingPort.domain.dto.BoatDynamicDto;
import com.ltgk.smartFishingPort.domain.entity.BoatData;
import com.ltgk.smartFishingPort.domain.vo.CurrentAisDynamicVO;
import com.ltgk.smartFishingPort.service.IBoatDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@Api(tags = {"渔船档案模块"})
@RestController
@RequestMapping("/boatData")
public class BoatDataController {
@Resource
IBoatDataService boatDataService;
@Resource
RedisCache redisUtils;
// @Resource
// private ISolrService solrService;
@ApiOperation("根据识别船牌号查询船只信息")
@GetMapping("/getBaseInfoByShipPlate")
public Response getBaseInfoByShipPlate(@ApiParam("识别船牌") @RequestParam(value = "shipPlate") String shipPlate) {
Object obj = redisUtils.getCacheObject("ais-collect-name:" + shipPlate);
CurrentAisDynamicVO currentAisDynamicVO = new CurrentAisDynamicVO();
currentAisDynamicVO.setShipPlate(shipPlate);
if (Objects.isNull(obj)) {
currentAisDynamicVO.setAisStatus("未知");
return Response.ok(currentAisDynamicVO);
}
BoatDynamicDto boatDynamicDto = JSONObject.parseObject(obj.toString(), BoatDynamicDto.class);
// Map<String,Object> map = new HashMap<>();
// map.put("boatName",boatDynamicDto.getBoatNameEn());
// map.put("mmsi",boatDynamicDto.getTerminalCode());
// map.put("aisStatus","已开启");
// map.put("sog",boatDynamicDto.getSog());
// map.put("cog",boatDynamicDto.getSog());
currentAisDynamicVO.setBoatName(boatDynamicDto.getBoatNameEn());
currentAisDynamicVO.setMmsi(boatDynamicDto.getTerminalCode());
currentAisDynamicVO.setAisStatus("已开启");
currentAisDynamicVO.setSog(boatDynamicDto.getSog());
currentAisDynamicVO.setCog(boatDynamicDto.getCog());
currentAisDynamicVO.setLatitude(boatDynamicDto.getLatitude());
currentAisDynamicVO.setLongitude(boatDynamicDto.getLongitude());
currentAisDynamicVO.setDataSource(boatDynamicDto.getDataSource());
return Response.ok(currentAisDynamicVO);
}
@ApiOperation("根据全部AIS船只信息")
@GetMapping("/getAllAisDynamic")
public Response getAllAisDynamic() {
List<Object> objList = redisUtils.getMByScript("ais-collect-name:*");
if (Objects.isNull(objList) || CollectionUtils.isEmpty(objList)) {
return Response.ok();
}
List<CurrentAisDynamicVO> list = objList.stream().map(m -> {
BoatDynamicDto boatDynamicDto = JSONObject.parseObject(m.toString(), BoatDynamicDto.class);
CurrentAisDynamicVO currentAisDynamicVO = new CurrentAisDynamicVO();
currentAisDynamicVO.setShipPlate(boatDynamicDto.getBoatName());
currentAisDynamicVO.setBoatName(boatDynamicDto.getBoatNameEn());
currentAisDynamicVO.setMmsi(boatDynamicDto.getTerminalCode());
currentAisDynamicVO.setAisStatus("已开启");
currentAisDynamicVO.setSog(boatDynamicDto.getSog());
currentAisDynamicVO.setCog(boatDynamicDto.getCog());
currentAisDynamicVO.setLatitude(boatDynamicDto.getLatitude());
currentAisDynamicVO.setLongitude(boatDynamicDto.getLongitude());
currentAisDynamicVO.setDataSource(boatDynamicDto.getDataSource());
return currentAisDynamicVO;
}).filter(f -> "YingJue".equals(f.getDataSource())).collect(Collectors.toList());
return Response.ok(list);
}
/**
* 分页查询渔船档案信息
*
* @param boatData 渔船档案信息
* @return 查询结果
*/
@ApiOperation(value = "分页查询渔船档案信息")
@PostMapping("/page")
public Response page(BoatData boatData) {
IPage<BoatData> result = boatDataService.selectByPage(boatData);
return Response.ok(result);
}
@ApiOperation(value = "添加渔船档案信息")
@PostMapping("/save")
// @JwtUser
public Response save(BoatData boatData
// , @JwtUser UserInfo user
) {
// boatData.setCreateBy(user.getUserName());
// boatData.setUpdateBy(user.getUserName());
boatData.setDelFlag(Constants.FLAG_FALSE);
return Response.or(boatDataService.save(boatData));
}
@ApiOperation(value = "编辑渔船档案信息")
@PostMapping("/update")
// @JwtUser
public Response update(BoatData boatData
// , @JwtUser UserInfo user
) {
// boatData.setUpdateBy(user.getUserName());
return Response.or(boatDataService.updateById(boatData));
}
@ApiOperation(value = "删除渔船档案信息")
@PostMapping("/delete")
public Response delete(@ApiParam("ID 逗号隔开") @RequestParam("ids") String ids) {
List<String> idList = Arrays.asList(ids.split(","));
if (CollUtil.isEmpty(idList)) {
return Response.fail("请输入要删除的渔船档案ID");
}
return Response.or(boatDataService.removeByIds(idList));
}
/**
* 根据经纬度获取AIS数据中距离最近的点位且更新时间为±1分钟之内的数据
*
* @param longitude经度
* @param latitude维度
* @return ltgk.pm.video.base.Response
* @author Qi ChengBin
* @date 2025/12/2
*/
@ApiOperation(value = "根据经纬度来获取AIS数据中距离最近且不大于10米并且更新时间为5分钟之内的船的数据")
@PostMapping("/getNearestAisData")
public Response getNearestAisData(@ApiParam("经度") @RequestParam("longitude") String longitude, @ApiParam("纬度") @RequestParam("latitude") String latitude) {
return Response.ok(boatDataService.getNearestAisData(longitude, latitude));
}
// /**
// * 根据 mmsi 获取 24H 内 AIS 船舶轨迹信息
// *
// * @param mmsi: AIS 编号
// * @return ltgk.pm.video.base.Response
// * @author Qi ChengBin
// * @date 2025/12/23
// */
// @ApiOperation(value = "根据mmsi获取 24H 轨迹信息")
// @PostMapping("/findAISPointPositionByMmsi")
// public Response findAISPointPositionByMmsi(@ApiParam("mmsi") @RequestParam("mmsi") String mmsi) {
// return Response.ok(solrService.findAISPointPositionByMmsi(mmsi));
// }
}

View File

@@ -0,0 +1,39 @@
package com.ltgk.smartFishingPort.controller;
import com.ltgk.smartFishingPort.common.RocketMQConsumer;
import com.ltgk.smartFishingPort.common.core.domain.Response;
import com.ltgk.smartFishingPort.domain.dto.BoatDynamicDto;
import com.ltgk.smartFishingPort.service.IBoatDynamicService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 17:25
* Description:
*/
@RestController
@RequestMapping("/boatDynamic")
@Api(tags = {"船舶实时动态信息模块"})
public class BoatDynamicController {
@Resource
IBoatDynamicService boatDynamicService;
@Resource
RocketMQConsumer rocketMQConsumer;
@ApiOperation("查询当前渔船动态定位")
@PostMapping("/findByCurrent")
public Response findByCurrent() {
// LambdaQueryWrapper<BoatDynamic> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.ge(BoatDynamic::getGpsTime, DateUtils.formatDateTime(DateUtils.addDays(new Date(),-1),DateUtils.formatDefaultTimestamp));
// List<BoatDynamic> list = boatDynamicService.list();
List<BoatDynamicDto> boatDynamicDtos = rocketMQConsumer.getBoatDynamicList();
return Response.ok(boatDynamicDtos);
}
}

View File

@@ -0,0 +1,257 @@
package com.ltgk.smartFishingPort.controller;
import com.ltgk.smartFishingPort.common.core.domain.Response;
import com.ltgk.smartFishingPort.domain.drone.*;
import com.ltgk.smartFishingPort.domain.vo.*;
import com.ltgk.smartFishingPort.service.DroneService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import java.util.List;
@Slf4j
@Api(tags = "无人机模块")
@RestController
@RequestMapping("/rest/drone")
@Valid
public class DroneController {
@Autowired
private DroneService droneService;
/**
* 获取司空平台状态
*
* @return {@link DroneSystemStatusVO}
*/
@PostMapping("/getDroneSystemStatus")
@ApiOperation(value = "获取司空平台状态")
public Response<DroneSystemStatusVO> getDroneSystemStatus() {
return droneService.getDroneSystemStatus();
}
/**
* 获取项目列表
*
* @return {@link List<DroneProjectVO>}
*/
@PostMapping("/getDroneProject")
@ApiOperation(value = "获取项目列表")
public Response<List<DroneProjectVO>> getDroneProject() {
return droneService.getDroneProject();
}
/**
* 获取组织下的设备列表[机场场景] 飞行器开机后, 才能获得 camera_list 信息。
*
* @param
* @return {@link List<DeviceRespDto>}
*/
@PostMapping("/getDroneDevice")
@ApiOperation(value = "获取组织下的设备列表[机场场景] 飞行器开机后, 才能获得 camera_list 信息。")
public Response<List<DeviceRespDto>> getDroneDevice(@RequestBody @Validated DroneDeviceReq req) {
return droneService.getDroneDevice(req);
}
/**
* 实时控制指令下发
*
* @param req
* @return
*/
@PostMapping("/droneCommand")
@ApiOperation(value = "实时控制指令下发")
public Response<DroneSystemStatusVO> droneCommand(@RequestBody @Validated DroneCommandReq req) {
return droneService.droneCommand(req);
}
/**
* 机场相机切换
*
* @param req
* @return
*/
@PostMapping("/airportCameraSwitch")
@ApiOperation(value = "机场相机切换")
public Response<DroneSystemStatusVO> airportCameraSwitch(@RequestBody @Validated AirportCameraSwitchReq req) {
return droneService.airportCameraSwitch(req);
}
/**
* 飞行器镜头切换
*
* @param req
* @return
*/
@PostMapping("/droneCameraSwitch")
@ApiOperation(value = "飞行器镜头切换")
public Response<DroneSystemStatusVO> droneCameraSwitch(@RequestBody @Validated DroneCameraSwitchReq req) {
return droneService.droneCameraSwitch(req);
}
/**
* 飞行器控制权获取
*
* @param req
* @return
*/
@PostMapping("/droneControlObtain")
@ApiOperation(value = "飞行器控制权获取")
public Response<DroneControlObtainRespDto> droneControlObtain(@RequestBody @Validated DroneControlObtainReq req) {
return droneService.droneControlObtain(req);
}
/**
* 飞行器控制权释放
*
* @param req
* @return
*/
@PostMapping("/droneControlRelease")
@ApiOperation(value = "飞行器控制权释放")
public Response<DroneControlObtainRespDto> droneControlRelease(@RequestBody @Validated DroneControlObtainReq req) {
return droneService.droneControlRelease(req);
}
/**
* 飞行器控制权获取
*
* @param req
* @return
*/
@PostMapping("/droneControlObtainV2")
@ApiOperation(value = "飞行器控制权获取V2")
public Response<DroneControlObtainRespV2Dto> droneControlObtainV2(@RequestBody @Validated DroneControlObtainReqV2 req) {
return droneService.droneControlObtainV2(req);
}
/**
* 飞行器控制权状态
*
* @param req
* @return
*/
@PostMapping("/droneControlStatus")
@ApiOperation(value = "飞行器控制权状态")
public Response<List<DroneControlObtainRespV2Dto>> droneControlStatus(@RequestBody @Validated DroneControlStatusReq req) {
return droneService.droneControlStatus(req);
}
/**
* 获取航线详情
*/
@PostMapping("/getDroneWayLine")
@ApiOperation(value = "获取航线列表")
public Response<List<DroneWayLineRespDto>> getDroneWayLine(@RequestBody @Validated DroneDeviceReq req) {
return droneService.getDroneWayLine(req);
}
/**
* 获取航线详情
*/
@PostMapping("/getDroneWayLineDetail")
@ApiOperation(value = "获取航线详情")
public Response<DroneWayLineDetailRespDto> getDroneWayLineDetail(@RequestBody @Validated GetDroneWayLineDetailReq req) {
return droneService.getDroneWayLineDetail(req);
}
/**
* 创建飞行任务
*
* @param req
* @return
*/
@PostMapping("/createDroneTask")
@ApiOperation(value = "创建飞行任务")
public Response<DroneSystemStatusVO> createDroneTask(@RequestBody @Validated CreateDroneTaskReq req) {
return droneService.createDroneTask(req);
}
/**
* 更新飞行任务状态
*
* @param req
* @return
*/
@PostMapping("/updateDroneTaskStatus")
@ApiOperation(value = "更新飞行任务状态")
public Response<DroneSystemStatusVO> updateDroneTaskStatus(@RequestBody @Validated UpdateDroneTaskStatusReq req) {
return droneService.updateDroneTaskStatus(req);
}
/**
* 开启直播
*
* @param req
* @return {@link StartLiveReqRespDto}
*/
@PostMapping("/startLive")
@ApiOperation(value = "开启直播")
public Response<StartLiveReqRespDto> startLive(@RequestBody @Validated StartLiveReq req) {
return droneService.startLive(req);
}
@PostMapping("/getDroneTaskList")
@ApiOperation(value = "获取飞行任务列表")
public Response<List<DroneTaskRespDto>> getDroneTaskList(@RequestBody @Validated GetDroneTaskListReq req) {
return droneService.getDroneTaskList(req);
}
/**
* 无人机一键起飞
*
* @param req
* @return
*/
@PostMapping("/droneOneTouchTakeoff")
@ApiOperation(value = "无人机一键起飞")
public Response<DroneOneTouchTakeoffRespDto> droneOneTouchTakeoff(@RequestBody @Validated DroneOneTouchTakeoffReq req) {
return droneService.droneOneTouchTakeoff(req);
}
/**
* 获取视频流检测算法开关
*
* @return
*/
@PostMapping("/videoStreamDetectSwitch")
@ApiOperation(value = "获取视频流检测算法开关")
public Response<VideoStreamDetectSwitchResp> videoStreamDetectSwitch(@RequestBody @Validated VideoStreamDetectSwitchReq req) {
return droneService.videoStreamDetectSwitch(req);
}
/**
* 获取无人机视频流地址
*
* @param req
* @return ltgk.pm.video.base.Response<ltgk.pm.video.domain.vo.VideoStreamDetectSwitchResp>
* @author Qi ChengBin
* @date 2025/11/27
*/
@PostMapping("/getVideoStream")
@ApiOperation(value = "获取视频流地址")
public Response<VideoStreamDetectSwitchResp> getVideoStream(@RequestBody @Validated GetVideoStreamReq req) {
return droneService.getVideoStream(req);
}
/**
* 开启关闭无人机算法
*
* @param req:
* @return ltgk.pm.video.base.Response<ltgk.pm.video.domain.vo.VideoStreamDetectSwitchResp>
* @author Qi ChengBin
* @date 2025/11/27
*/
@PostMapping("/doStartOrStopUavAlgorithm")
@ApiOperation(value = "开启/关闭无人机算法")
public Response<VideoStreamDetectSwitchResp> doStartOrStopUavAlgorithm(@RequestBody @Validated GetVideoStreamReq req) {
return droneService.doStartOrStopUavAlgorithm(req);
}
}

View File

@@ -0,0 +1,527 @@
package com.ltgk.smartFishingPort.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists;
import com.ltgk.smartFishingPort.common.core.controller.BaseController;
import com.ltgk.smartFishingPort.common.core.domain.AjaxResult;
import com.ltgk.smartFishingPort.common.utils.MybatisUtil;
import com.ltgk.smartFishingPort.common.utils.StringUtils;
import com.ltgk.smartFishingPort.domain.dto.DsArtemisDTO;
import com.ltgk.smartFishingPort.domain.dto.VideoServoDTO;
import com.ltgk.smartFishingPort.domain.entity.DsVideo;
import com.ltgk.smartFishingPort.domain.vo.DsDynamicLkdVO;
import com.ltgk.smartFishingPort.service.IDsVideoService;
import com.ltgk.smartFishingPort.service.impl.ArtemisPostService;
import com.ltgk.smartFishingPort.service.impl.DsCameraService;
import com.ltgk.smartFishingPort.utils.CameraDegreesUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* <p>
* 视频监控管理表 前端控制器
* </p>
*
* @author zhouyaoyao
* @since 2025-01-19
*/
@Api(tags = "视频监控设备信息")
@RestController
@RequestMapping("/fishingPort/dsVideo")
public class DsVideoController extends BaseController {
@Resource
IDsVideoService dsVideoService;
@Resource
RedisTemplate redisTemplate;
@Resource
DsCameraService dsCameraService;
@ApiOperation(value = "查询列表数据")
@PostMapping("/getList")
public Object getList(@RequestBody DsVideo dsVideo) {
QueryWrapper<DsVideo> queryWrapper = MybatisUtil.notNullField(dsVideo);
List<DsVideo> list = dsVideoService.list(queryWrapper);
return success(list);
}
/**
* 视频监控层级列表
*
* @param dsVideo:
* @return com.yuhuan.common.core.domain.AjaxResult
* @author Qi ChengBin
* @date 2025/3/11
*/
@ApiOperation(value = "视频监控层级列表")
@PostMapping("/findVideoLevelList")
public AjaxResult findVideoLevelList(@RequestBody DsVideo dsVideo) {
LambdaQueryWrapper<DsVideo> wrapper = new LambdaQueryWrapper<>(dsVideo);
List<DsVideo> dsVideoList = dsVideoService.list(wrapper);
return success(dsVideoList.stream()
.collect(Collectors.groupingBy(DsVideo::getBelongUnit)));
}
@ApiOperation(value = "分页查询")
@PostMapping("/page")
public Object page(@RequestBody DsVideo dsVideo) {
QueryWrapper<DsVideo> queryWrapper = MybatisUtil.notNullField(dsVideo);
startPage(dsVideo.getPageNum(), dsVideo.getPageSize());
List<DsVideo> list = dsVideoService.list(queryWrapper);
return getDataTable(list);
}
@ApiOperation(value = "详情查询")
@PostMapping("/detail")
public Object page(@RequestParam("id") Long id) {
if (Objects.isNull(id)) {
return AjaxResult.error("id不能为空");
}
DsVideo dsVideo = dsVideoService.getById(id);
return success(dsVideo);
}
@ApiOperation(value = "添加")
@PostMapping("/save")
public Object save(@RequestBody DsVideo dsVideo) {
dsVideo.setCreateBy("SYS")
.setCreateAt(new Date())
.setUpdateBy("SYS")
.setUpdateAt(new Date());
AjaxResult result = toAjax(dsVideoService.save(dsVideo));
updateYunVideoList();
return result;
}
@ApiOperation(value = "编辑")
@PostMapping("/update")
public Object update(@RequestBody DsVideo dsVideo) {
dsVideo.setUpdateBy("SYS")
.setUpdateAt(new Date());
AjaxResult result = toAjax(dsVideoService.updateById(dsVideo));
updateYunVideoList();
return result;
}
@ApiOperation(value = "删除")
@PostMapping("/delete")
public Object delete(@RequestBody DsVideo dsVideo) {
AjaxResult result = toAjax(dsVideoService.removeById(dsVideo.getId()));
updateYunVideoList();
return result;
}
@ApiOperation("通过海康综合安防平台查询视频监控设备的预览视频流链接")
@PostMapping("/getPreviewUrlByArtemis")
public AjaxResult getPreviewUrlByArtemis(@RequestBody DsArtemisDTO dsArtemisDTO) {
String previewProtocol = dsArtemisDTO.getPreviewProtocol();
if (StringUtils.isEmpty(previewProtocol)) {
previewProtocol = "hls";
}
return AjaxResult.success(ArtemisPostService.getPreviewUrl(dsArtemisDTO.getVideoCode(), previewProtocol));
}
/**
* 光电联动反向定位,判断监控设备和将要联动的定位目标是否超出可视范围、是否处于视角遮挡区
*
* @return
*/
@ApiOperation("光电联动反向定位判断")
@PostMapping("/judgeMoveByGps")
public AjaxResult judgeMoveByGps(@RequestBody VideoServoDTO videoServoDTO) {
String deviceCode = videoServoDTO.getDeviceCode();
String gpsX = videoServoDTO.getGpsX();
String gpsY = videoServoDTO.getGpsY();
LambdaQueryWrapper<DsVideo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DsVideo::getVideoCode, deviceCode);
queryWrapper.last("limit 1");
DsVideo videos = dsVideoService.getOne(queryWrapper);
if (Objects.isNull(videos)) {
return error("未查到该摄像头");
}
// 默认可视距离 5KM
Double visibleDistance = 5d;
if (!Objects.isNull(videos.getVisionDistance())) {
visibleDistance = videos.getVisionDistance().doubleValue();
}
try {
double latitudeVal = videos.getLatitude().doubleValue();
double longitudeVal = videos.getLongitude().doubleValue();
double gpsXVal = Double.parseDouble(gpsX);
double gpsYVal = Double.parseDouble(gpsY);
double distance = CameraDegreesUtil.getDistance(longitudeVal, latitudeVal, gpsXVal, gpsYVal).setScale(5, RoundingMode.HALF_UP).doubleValue();
if (org.apache.commons.lang.StringUtils.isNotBlank(videos.getXRotateVal())) {
BigDecimal degreeX = CameraDegreesUtil.rotateForNorthByLR(longitudeVal, latitudeVal, gpsXVal, gpsYVal, videos.getRotateT());
double degreeXVal = degreeX.doubleValue();
degreeXVal = degreeXVal < 0 ? 360 + degreeXVal : degreeXVal;
double dxVal = degreeXVal;
String xRotateVal = videos.getXRotateVal();
List<Boolean> flags = Arrays.asList(xRotateVal.split(";")).stream().map(item -> {
String itemStr1 = item.split("-")[0];
String itemStr2 = item.split("-")[1];
double itemVal1 = Double.parseDouble(itemStr1);
double itemVal2 = Double.parseDouble(itemStr2);
return itemVal1 < dxVal && itemVal2 > dxVal;
}).collect(Collectors.toList());
if (!flags.contains(true)) {
return error("超出监控摄像头可视角度,此监控角度有遮挡");
}
}
if (distance > visibleDistance) {
return error("超出监控摄像头可视范围");
}
} catch (Exception e) {
logger.error(e.getMessage());
}
return success();
}
/**
* 云台类型监控设备列表,用于光电联动时获取联动目标附近的视频监控设备
*/
List<DsVideo> yunVideoCodeList = Lists.newArrayList();
/**
* 定时4个小时更新一次云台类型监控设备列表
*/
@Scheduled(cron = "0 0 0/4 * * ?")
public List<DsVideo> updateYunVideoList() {
LambdaQueryWrapper<DsVideo> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(DsVideo::getVideoType, "云台")
.eq(DsVideo::getRunStatus, "正常")
// 获取没有锁定的摄像头
.eq(DsVideo::getBeLock, 0)
;
queryWrapper.orderByAsc(DsVideo::getVideoName);
List<DsVideo> list = dsVideoService.list(queryWrapper);
if (!CollectionUtils.isEmpty(list)) {
yunVideoCodeList = list.stream()
.filter(f -> "云台".equals(f.getVideoType()) && StringUtils.isNotBlank(f.getVideoCode()))
.collect(Collectors.toList());
return yunVideoCodeList;
} else {
return Lists.newArrayList();
}
}
/**
* 光电联动反向定位联动控制,根据监控设备和将要联动的定位目标经纬度控制视频监控设备转动对焦
*
* @return
*/
@ApiOperation("光电联动反向定位联动控制")
@PostMapping("/sitMoveByGps")
public AjaxResult sitMoveByGps(@RequestBody VideoServoDTO videoServoDTO) {
String deviceCode = videoServoDTO.getDeviceCode();
String gpsX = videoServoDTO.getGpsX();
String gpsY = videoServoDTO.getGpsY();
String mmsi = videoServoDTO.getTerminalCode();
Object dynamicObj = redisTemplate.opsForValue().get("ais:" + mmsi);
Object radarDynamicObj = redisTemplate.opsForValue().get("radar-mmsi:" + mmsi);
DsDynamicLkdVO dynamicRadarVO = null;
if (!Objects.isNull(dynamicObj)) {
try {
dynamicRadarVO = JSONObject.parseObject(dynamicObj.toString(), DsDynamicLkdVO.class);
} catch (Exception e) {
System.out.println("解析 redis 中的 AIS 信息[" + dynamicObj.toString() + "]报错:" + e.getMessage());
}
}
if (!Objects.isNull(radarDynamicObj)) {
DsDynamicLkdVO dynamicRadarTmp = null;
try {
dynamicRadarTmp = JSONObject.parseObject(radarDynamicObj.toString(), DsDynamicLkdVO.class);
} catch (Exception e) {
System.out.println("解析 redis 中的 Radar 信息[" + radarDynamicObj.toString() + "]报错:" + e.getMessage());
}
if (!Objects.isNull(dynamicRadarVO)) {
Date gpsTime = dynamicRadarVO.getLocationTime();
if (gpsTime.before(dynamicRadarTmp.getLocationTime())) {
dynamicRadarVO = dynamicRadarTmp;
}
} else {
dynamicRadarVO = dynamicRadarTmp;
}
}
if (!Objects.isNull(dynamicRadarVO)) {
gpsX = dynamicRadarVO.getLongitude().toString();
gpsY = dynamicRadarVO.getLatitude().toString();
}
return dsVideoService.sitMoveByGps(deviceCode, gpsX, gpsY);
}
@ApiOperation("校准光电联动功能参数")
@PostMapping("/correctLinkageParam")
public AjaxResult correctLinkageParam(@RequestBody VideoServoDTO videoServoDTO) {
String mmsi = videoServoDTO.getTerminalCode();
String deviceCode = videoServoDTO.getDeviceCode();
Object dynamicObj = redisTemplate.opsForValue().get("ais:" + mmsi);
Object radarDynamicObj = redisTemplate.opsForValue().get("radar-mmsi:" + mmsi);
DsDynamicLkdVO dynamicRadarVO = null;
if (!Objects.isNull(dynamicObj)) {
try {
dynamicRadarVO = JSONObject.parseObject(dynamicObj.toString(), DsDynamicLkdVO.class);
} catch (Exception e) {
System.out.println("解析 redis 中的 AIS 信息[" + dynamicObj.toString() + "]报错:" + e.getMessage());
}
}
if (!Objects.isNull(radarDynamicObj)) {
DsDynamicLkdVO dynamicRadarTmp = null;
try {
dynamicRadarTmp = JSONObject.parseObject(radarDynamicObj.toString(), DsDynamicLkdVO.class);
} catch (Exception e) {
System.out.println("解析 redis 中的 Radar 信息[" + radarDynamicObj.toString() + "]报错:" + e.getMessage());
}
if (!Objects.isNull(dynamicRadarVO)) {
Date gpsTime = dynamicRadarVO.getLocationTime();
if (gpsTime.before(dynamicRadarTmp.getLocationTime())) {
dynamicRadarVO = dynamicRadarTmp;
}
} else {
dynamicRadarVO = dynamicRadarTmp;
}
}
if (Objects.isNull(dynamicRadarVO)) {
return AjaxResult.error();
}
LambdaQueryWrapper<DsVideo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DsVideo::getVideoCode, deviceCode);
queryWrapper.last(" limit 1");
DsVideo dsVideo = dsVideoService.getOne(queryWrapper);
if (Objects.isNull(dsVideo)) {
return AjaxResult.error();
}
Object ptzObj = dsCameraService.hkGetPtzCfg(dsVideo.getVideoIp(), dsVideo.getVideoPort(), dsVideo.getVideoAccount(), dsVideo.getVideoPassword());
if (Objects.isNull(ptzObj)) {
return AjaxResult.error();
}
JSONObject ptzJSONObj = JSONObject.parseObject(JSONObject.toJSONString(ptzObj));
System.out.println(JSONObject.toJSONString(ptzObj));
float pVal = ptzJSONObj.getFloat("pValue");
float tVal = ptzJSONObj.getFloat("tValue");
float zVal = ptzJSONObj.getFloat("zValue");
int rotateT = dsVideo.getRotateT();
Double height = dsVideo.getHeight().doubleValue();
double lon1 = dynamicRadarVO.getLongitude();
double lat1 = dynamicRadarVO.getLatitude();
double lon2 = dsVideo.getLongitude().doubleValue();
double lat2 = dsVideo.getLatitude().doubleValue();
String xValArr = dsVideo.getXValArr();
String yValArr = dsVideo.getYValArr();
String zNumValArr = dsVideo.getZNumValArr();
BigDecimal degreeX = CameraDegreesUtil.rotateForNorthByLR(lon2, lat2, lon1, lat1, rotateT);
double degreeXVal = degreeX.doubleValue() < 0 ? 360 + degreeX.doubleValue() : degreeX.doubleValue();
degreeX = new BigDecimal(degreeXVal);
BigDecimal degreeY = CameraDegreesUtil.rotateByUD(Objects.isNull(height) ? 0.2 : (height / 1000), lon2, lat2, lon1, lat1);
BigDecimal distance = CameraDegreesUtil.getDistance(lon1, lat1, lon2, lat2).setScale(5, RoundingMode.HALF_UP);
System.out.println("degreeX:" + degreeX + ",degreeY:" + degreeY + ",distance:" + distance);
double xVal = new BigDecimal(pVal).subtract(degreeX).setScale(8, BigDecimal.ROUND_UP).doubleValue();
double yVal = new BigDecimal(tVal).subtract(degreeY).setScale(8, BigDecimal.ROUND_UP).doubleValue();
double zNumVal = new BigDecimal(zVal).divide(distance, 8, BigDecimal.ROUND_UP).doubleValue();
JSONArray xValArray = null;
if (StringUtils.isNotBlank(xValArr)) {
xValArray = JSONArray.parseArray(xValArr);
} else {
xValArray = new JSONArray();
}
JSONObject xValArrItem = new JSONObject();
xValArrItem.put("distance", degreeX.setScale(8, BigDecimal.ROUND_UP).doubleValue());
xValArrItem.put("number", xVal);
xValArray.add(xValArrItem);
xValArr = JSONObject.toJSONString(xValArray);
JSONArray yValArray = null;
if (StringUtils.isNotBlank(yValArr)) {
yValArray = JSONArray.parseArray(yValArr);
} else {
yValArray = new JSONArray();
}
JSONObject yValArrItem = new JSONObject();
yValArrItem.put("distance", distance.setScale(8, BigDecimal.ROUND_UP).doubleValue());
yValArrItem.put("number", yVal);
yValArray.add(yValArrItem);
yValArr = JSONObject.toJSONString(yValArray);
JSONArray zNumValArray = null;
if (StringUtils.isNotBlank(zNumValArr)) {
zNumValArray = JSONArray.parseArray(zNumValArr);
} else {
zNumValArray = new JSONArray();
}
JSONObject zNumValItem = new JSONObject();
zNumValItem.put("distance", distance.setScale(8, BigDecimal.ROUND_UP).doubleValue());
zNumValItem.put("number", zNumVal);
zNumValArray.add(zNumValItem);
zNumValArr = JSONObject.toJSONString(zNumValArray);
boolean result = dsVideoService.lambdaUpdate()
.eq(DsVideo::getVideoIp, dsVideo.getVideoIp())
.set(DsVideo::getXValArr, xValArr)
.set(DsVideo::getYValArr, yValArr)
.set(DsVideo::getZNumValArr, zNumValArr)
.update();
return AjaxResult.success(result);
}
/**
* 光电联动查看监控设备列表
*
* @return 光电联动查看监控设备列表
*/
@ApiOperation("光电联动查看监控设备列表")
@PostMapping("/getDevicesForServo")
public AjaxResult getDevicesForServo(@RequestBody VideoServoDTO videoServoDTO) {
String gpsX = videoServoDTO.getGpsX();
String gpsY = videoServoDTO.getGpsY();
Double gpsXVal = Double.parseDouble(gpsX);
Double gpsYVal = Double.parseDouble(gpsY);
yunVideoCodeList = updateYunVideoList();
List<DsVideo> list = yunVideoCodeList.stream().map(v -> {
double latitudeVal = v.getLatitude().doubleValue();
double longitudeVal = v.getLongitude().doubleValue();
BigDecimal distance = CameraDegreesUtil.getDistance(longitudeVal, latitudeVal, gpsXVal, gpsYVal).setScale(5, RoundingMode.HALF_UP);
v.setDistance(distance);
v.setDistance1(distance);
// v.setDistanceVal(Objects.isNull(v.getVisionDistance()) ? 0 : distance.doubleValue() - v.getVisionDistance().doubleValue());
if (StringUtils.isNotBlank(v.getXRotateVal())) {
BigDecimal degreeX = CameraDegreesUtil.rotateForNorthByLR(longitudeVal, latitudeVal, gpsXVal, gpsYVal, v.getRotateT());
double degreeXVal = degreeX.doubleValue();
degreeXVal = degreeXVal < 0 ? 360 + degreeXVal : degreeXVal;
double dxVal = degreeXVal;
String xRotateVal = v.getXRotateVal();
List<Boolean> flags = Arrays.asList(xRotateVal.split(";")).stream().map(item -> {
String itemStr1 = item.split("-")[0];
String itemStr2 = item.split("-")[1];
double itemVal1 = Double.parseDouble(itemStr1);
double itemVal2 = Double.parseDouble(itemStr2);
return itemVal1 < dxVal && itemVal2 > dxVal;
}).collect(Collectors.toList());
if (!flags.contains(true)) {
// return Response.fail("超出监控摄像头可视范围");
v.setDistance1(Objects.isNull(v.getDistance()) ? v.getDistance() : v.getDistance().add(new BigDecimal(999)));
}
}
return v;
}).sorted(Comparator.comparing(DsVideo::getDistance1)).collect(Collectors.toList());
List<DsVideo> resultList = Lists.newArrayList();
if (CollectionUtils.isEmpty(yunVideoCodeList)) {
return AjaxResult.success(list);
}
for (int i = 0; i < list.size(); i++) {
if (i < 5) {
resultList.add(list.get(i));
}
}
return success(resultList);
}
/**
* 光电随动控制
*
* @return
*/
@ApiOperation("光电随动控制")
@PostMapping("/servoByRadar")
public AjaxResult servoByRadar(@RequestBody VideoServoDTO videoServoDTO) {
Set<String> tempPatternKey = redisTemplate.keys("servo:*");
String deviceCode = videoServoDTO.getDeviceCode();
String terminalCode = videoServoDTO.getTerminalCode();
if (!CollectionUtils.isEmpty(tempPatternKey)) {
tempPatternKey.stream()
.forEach(m -> {
String deviceCodeTmp = redisTemplate.opsForValue().get(m).toString();
if (deviceCode.trim().equals(deviceCodeTmp)) {
redisTemplate.delete("servo:" + m);
}
});
}
String gpsX = videoServoDTO.getGpsX();
String gpsY = videoServoDTO.getGpsY();
Object dynamicObj = redisTemplate.opsForValue().get("ais:" + terminalCode);
Object radarDynamicObj = redisTemplate.opsForValue().get("radar-mmsi:" + terminalCode);
DsDynamicLkdVO dynamicRadarVO = null;
if (!Objects.isNull(dynamicObj)) {
try {
dynamicRadarVO = JSONObject.parseObject(dynamicObj.toString(), DsDynamicLkdVO.class);
} catch (Exception e) {
System.out.println("解析 redis 中的 AIS 信息[" + dynamicObj.toString() + "]报错:" + e.getMessage());
}
}
if (!Objects.isNull(radarDynamicObj)) {
DsDynamicLkdVO dynamicRadarTmp = null;
try {
dynamicRadarTmp = JSONObject.parseObject(radarDynamicObj.toString(), DsDynamicLkdVO.class);
} catch (Exception e) {
System.out.println("解析 redis 中的 Radar 信息[" + radarDynamicObj.toString() + "]报错:" + e.getMessage());
}
if (!Objects.isNull(dynamicRadarVO)) {
Date gpsTime = dynamicRadarVO.getLocationTime();
if (gpsTime.before(dynamicRadarTmp.getLocationTime())) {
dynamicRadarVO = dynamicRadarTmp;
}
} else {
dynamicRadarVO = dynamicRadarTmp;
}
}
if (!Objects.isNull(dynamicRadarVO)) {
gpsX = dynamicRadarVO.getLongitude().toString();
gpsY = dynamicRadarVO.getLatitude().toString();
}
dsVideoService.sitMoveByGps(deviceCode, gpsX, gpsY);
redisTemplate.opsForValue().set("servo:" + terminalCode, deviceCode, 30, TimeUnit.MINUTES);
return success();
}
/**
* 光电随动控制退出
*
* @return
*/
@ApiOperation("光电随动控制退出")
@PostMapping("/servoByRadarExit")
public AjaxResult servoByRadarExit(@RequestBody VideoServoDTO videoServoDTO) {
String terminalCode = videoServoDTO.getTerminalCode();
redisTemplate.delete("servo:" + terminalCode);
return success();
}
/**
* 获取摄像头详细信息,并且获取摄像头相关的 PTZ
*
* @param dsVideo:
* @return com.yuhuan.common.core.domain.AjaxResult
* @author Qi ChengBin
* @date 2025/8/4
*/
@PostMapping("/getVideoInfo")
public AjaxResult getVideoInfo(@RequestBody DsVideo dsVideo) {
return success(dsVideoService.getVideoInfo(dsVideo));
}
/**
* 更新摄像头可视范围字段状态,并获取所有的开启了可视摄像头范围的相关数据
*
* @param dsVideo需开启摄像头可视范围的相关摄像头数据
* @return com.yuhuan.common.core.domain.AjaxResult
* @author Qi ChengBin
* @date 2025/9/15
*/
@PostMapping("/updateOneAndFindVideoInfoList")
public AjaxResult updateOneAndFindVideoInfoList(@RequestBody DsVideo dsVideo) {
return success(dsVideoService.updateOneAndFindVideoInfoList(dsVideo));
}
}

View File

@@ -0,0 +1,77 @@
package com.ltgk.smartFishingPort.controller;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ltgk.smartFishingPort.common.core.domain.Response;
import com.ltgk.smartFishingPort.domain.entity.EmergencyRescue;
import com.ltgk.smartFishingPort.service.IEmergencyRescueService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 16:11
* Description:
*/
@RestController
@RequestMapping("/emergencyRescue")
@Api(tags = "应急救援事故模块")
public class EmergencyRescueController {
@Resource
IEmergencyRescueService emergencyRescueService;
/**
* 分页查询应急救援事故
*
* @param entity 应急救援事故
* @return 查询结果
*/
@ApiOperation(value = "分页查询应急救援事故")
@PostMapping("/page")
public Response page(EmergencyRescue entity) {
IPage<EmergencyRescue> result = emergencyRescueService.selectByPage(entity);
return Response.ok(result);
}
@ApiOperation(value = "添加应急救援事故")
@PostMapping("/save")
// @JwtUser
public Response save(EmergencyRescue entity
// , @JwtUser UserInfo user
) {
// entity.setCreateBy(user.getUserName());
// entity.setUpdateBy(user.getUserName());
// entity.setDelFlag(Constants.FLAG_FALSE);
return Response.or(emergencyRescueService.save(entity));
}
@ApiOperation(value = "编辑应急救援事故")
@PostMapping("/update")
// @JwtUser
public Response update(EmergencyRescue entity
// , @JwtUser UserInfo user
) {
// entity.setUpdateBy(user.getUserName());
return Response.or(emergencyRescueService.updateById(entity));
}
@ApiOperation(value = "删除应急救援事故")
@PostMapping("/delete")
public Response delete(@ApiParam("ID 逗号隔开") @RequestParam("ids") String ids) {
List<String> idList = Arrays.asList(ids.split(","));
if (CollUtil.isEmpty(idList)) {
return Response.fail("请输入要删除的应急救援事故ID");
}
return Response.or(emergencyRescueService.removeByIds(idList));
}
}

View File

@@ -0,0 +1,341 @@
package com.ltgk.smartFishingPort.controller;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ltgk.smartFishingPort.common.constant.Constants;
import com.ltgk.smartFishingPort.common.core.domain.Response;
import com.ltgk.smartFishingPort.common.core.redis.RedisCache;
import com.ltgk.smartFishingPort.common.utils.MybatisUtil;
import com.ltgk.smartFishingPort.common.utils.StringUtils;
import com.ltgk.smartFishingPort.domain.entity.EnvEquipment;
import com.ltgk.smartFishingPort.domain.entity.UavEquipment;
import com.ltgk.smartFishingPort.domain.entity.VideoCamera;
import com.ltgk.smartFishingPort.mapper.EnvEquipmentMapper;
import com.ltgk.smartFishingPort.mapper.UavEquipmentMapper;
import com.ltgk.smartFishingPort.service.IVideoCameraService;
import com.ltgk.smartFishingPort.utils.ArtemisPostUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
/**
* <p>
* 监控设备表 前端控制器
* </p>
*
* @author zhou
* @since 2024-12-16
*/
@Api(tags = {"监控设备模块"})
@RestController
@RequestMapping("/videoCamera")
public class VideoCameraController {
@Autowired
RedisCache redisUtils;
@Autowired
IVideoCameraService videoCameraService;
@Resource
UavEquipmentMapper uavEquipmentMapper;
@Resource
EnvEquipmentMapper envEquipmentMapper;
@ApiOperation("分页查询监控设备列表")
@PostMapping("/findPage")
public Response findPage(VideoCamera videoCamera
, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo
, @RequestParam(value = "pageSize", defaultValue = "15") Integer pageSize) {
IPage<VideoCamera> page = videoCameraService.findPage(videoCamera, pageNo, pageSize);
return Response.ok(page);
}
@ApiOperation("分页查询无人机设备列表")
@PostMapping("/findUavPage")
public Response findUavPage(UavEquipment uavEquipment
, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo
, @RequestParam(value = "pageSize", defaultValue = "15") Integer pageSize) {
IPage<UavEquipment> page = new Page<>(pageNo, pageSize);
QueryWrapper<UavEquipment> wrapper = MybatisUtil.notNullField(uavEquipment);
IPage<UavEquipment> pageList = uavEquipmentMapper.selectPage(page, wrapper);
return Response.ok(pageList);
}
@ApiOperation("分页查询环境检测设备列表")
@PostMapping("/findEnvPage")
public Response findEnvPage(EnvEquipment envEquipment
, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo
, @RequestParam(value = "pageSize", defaultValue = "15") Integer pageSize) {
IPage<EnvEquipment> page = new Page<>(pageNo, pageSize);
String videoType = envEquipment.getVideoType();
envEquipment.setVideoType(null);
LambdaQueryWrapper<EnvEquipment> wrapper = MybatisUtil.notNullField(envEquipment).lambda();
if (StringUtils.isNotBlank(videoType)) {
wrapper.in(EnvEquipment::getVideoType, Arrays.asList(videoType.split(",")));
}
IPage<EnvEquipment> pageList = envEquipmentMapper.selectPage(page, wrapper);
return Response.ok(pageList);
}
/**
* SDK摄像头登录
*/
@ApiOperation("SDK摄像头登录DH")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "m_strIp", value = "摄像头ip", required = true),
// @ApiImplicitParam(name = "m_nPort", value = "摄像头端口", required = true),
// @ApiImplicitParam(name = "m_strUser", value = "摄像头用户名", required = true),
// @ApiImplicitParam(name = "m_strPassword", value = "摄像头密码", required = true)
// })
@PostMapping("/sdkLoginDH")
public Object sdkLogin(String m_strIp, String m_nPort, String m_strUser, String m_strPassword) {
String key = m_strIp + m_nPort + m_strUser + m_strPassword;
Object result = redisUtils.getCacheObject("DHLoginIp:" + m_strIp);
String lHandler = "";
if (result == null) {
Object loginResult = videoCameraService.loginDH(m_strIp, m_nPort, m_strUser, m_strPassword);
if (loginResult.toString().contains("true")) {
lHandler = String.valueOf(JSONObject.parseObject(loginResult.toString()).get("result"));
//有效期1h
redisUtils.setCacheObject("DHLoginIp:" + m_strIp, lHandler, 60 * 60 * 1, TimeUnit.SECONDS);
redisUtils.setCacheObject("DHLoginHandler:" + lHandler, m_strIp, 60 * 60 * 1, TimeUnit.SECONDS);
}
} else {
lHandler = result.toString();
}
return lHandler;
}
@ApiOperation("订阅车辆交通抓拍信息")
@PostMapping("/attachTrafficByAccount")
public Response attachTraffic(String m_strIp, String m_nPort, String m_strUser, String m_strPassword, Integer channelId) {
boolean result = videoCameraService.attachAlarmChanDHByAccount(m_strIp, m_nPort, m_strUser, m_strPassword, channelId.toString());
if (result) {
return Response.ok();
} else {
return Response.fail("操作失败");
}
}
@ApiOperation("订阅车辆交通抓拍信息")
@PostMapping("/attachTrafficByHandler")
public Response attachTraffic(Long loginHandler, Integer channelId) {
boolean result = videoCameraService.attachTraffic(loginHandler, channelId);
if (result) {
Object m_strIp = redisUtils.getCacheObject("DHLoginHandler:" + loginHandler);
if (!Objects.isNull(m_strIp)) {
redisUtils.setCacheObject("DHTrafficHandler:" + loginHandler, m_strIp, 60 * 60 * 6, TimeUnit.SECONDS);
}
}
return Response.or(result);
}
@ApiOperation("通过综合安防平台获取监控信息")
@PostMapping("/getHKMonitorPoint")
public Response getHKMonitorPoint() {
return Response.ok(ArtemisPostUtil.callPostStringApi());
}
/**
* 获取监控点预览取流URLv2
*
* @param cameraIndexCode 监控点唯一标识
* @return 调用结果
*/
@PostMapping("/getPreviewUrl")
public Response getPreviewUrl(@RequestParam("cameraIndexCode") String cameraIndexCode) {
return Response.ok(ArtemisPostUtil.getPreviewUrl(cameraIndexCode));
}
/**
* 云台操作
* 根据监控点编号进行云台操作接口
* 综合安防管理平台iSecure Center V1.0及以上版本
*
* @param cameraIndexCode 监控点唯一标识
* @param action 0-开始 1-停止 注GOTO_PRESET命令下填任意值均可转到预置点,建议填0即可
* @param command 不区分大小写,说明:
* LEFT 左转
* RIGHT右转
* UP 上转
* DOWN 下转
* ZOOM_IN 焦距变大
* ZOOM_OUT 焦距变小
* LEFT_UP 左上
* LEFT_DOWN 左下
* RIGHT_UP 右上
* RIGHT_DOWN 右下
* FOCUS_NEAR 焦点前移
* FOCUS_FAR 焦点后移
* IRIS_ENLARGE 光圈扩大
* IRIS_REDUCE 光圈缩小
* WIPER_SWITCH 接通雨刷开关
* START_RECORD_TRACK 开始记录轨迹
* STOP_RECORD_TRACK 停止记录轨迹
* START_TRACK 开始轨迹
* STOP_TRACK 停止轨迹;
* 以下命令presetIndex不可为空
* GOTO_PRESET到预置点
* @param speed 云台速度取值范围为1-100默认50
* @param presetIndex 预置点编号可通过查询预置点信息接口获取整数通常在300以内
* @return 查询结果
*/
@PostMapping("/controlByPtz")
public Response controlByPtz(@RequestParam("cameraIndexCode") String cameraIndexCode, @RequestParam("action") Integer action
, @RequestParam("command") String command, @RequestParam("speed") Integer speed, @RequestParam("presetIndex") Integer presetIndex) {
JSONObject obj = ArtemisPostUtil.controlling(cameraIndexCode, action, command, speed, presetIndex);
if (!Objects.isNull(obj)) {
boolean success = obj.getBoolean("success");
return Response.or(success);
} else {
return Response.or(false);
}
}
/**
* 云台跳转到指定预置点
* 综合安防管理平台iSecure Center V1.0及以上版本
*
* @param cameraIndexCode 监控点唯一标识
* @param speed 台速度取值范围为1-100默认50
* @param presetIndex 预置点编号可通过查询预置点信息接口获取整数通常在300以内
* @return 调用结果
*/
@PostMapping("/goToPreset")
public Response goToPreset(@RequestParam("cameraIndexCode") String cameraIndexCode, @RequestParam("speed") Integer speed
, @RequestParam("presetIndex") String presetIndex) {
JSONObject obj = ArtemisPostUtil.goToPreset(cameraIndexCode, speed, presetIndex);
if (!Objects.isNull(obj)) {
boolean success = obj.getBoolean("success");
return Response.or(success);
} else {
return Response.or(false);
}
}
/**
* 设置预置点信息
* 该接口用于设置监控点的预置点信息,若参数传已经存在的预置点编号,则可修改预置点信息
* 综合安防管理平台iSecure Center V1.2及以上版本
*
* @param cameraIndexCode 监控点唯一标识
* @param presetName 预置点名称
* @param presetIndex 预置点编号(1 - 300)
* @return 调用结果
* @throws Exception 抛出异常
*/
@PostMapping("/presetsAddition")
public Response presetsAddition(@RequestParam("cameraIndexCode") String cameraIndexCode, @RequestParam("presetName") String presetName
, @RequestParam("presetIndex") Integer presetIndex) {
return Response.ok(ArtemisPostUtil.presetsAddition(cameraIndexCode, presetName, presetIndex));
}
/**
* 查询预置点信息
* 该接口用于查询监控点的预置点信息。
* 综合安防管理平台iSecure Center V1.2及以上版本
*
* @param cameraIndexCode 监控点唯一标识
* @return 调用结果
*/
@PostMapping("/presetsSearches")
public Response presetsSearches(@RequestParam("cameraIndexCode") String cameraIndexCode) {
return Response.ok(ArtemisPostUtil.presetsSearches(cameraIndexCode));
}
/**
* 删除预置点信息
* 该接口用于删除监控点的预置点信息。
* 综合安防管理平台iSecure Center V1.2及以上版本
*
* @param cameraIndexCode 监控点唯一标识
* @param presetIndex 预置点编号
* @return 调用结果
*/
@PostMapping("/presetsDeletion")
public Response presetsDeletion(@RequestParam("cameraIndexCode") String cameraIndexCode, @RequestParam("presetIndex") Integer presetIndex) {
return Response.ok(ArtemisPostUtil.presetsDeletion(cameraIndexCode, presetIndex));
}
/**
* 3D放大
* 该接口用于控制监控点进行3D电子放大。
* 综合安防管理平台iSecure Center V1.2及以上版本
*
* @param cameraIndexCode 监控点唯一标识
* @param startX 开始放大的X坐标范围0-255。由于设备比例限制以及实际场景屏幕比例大小不同请按照如下坐标位计算方式计算入参屏幕X坐标/屏幕宽 * 255即该坐标位X坐标占总屏幕宽的比例*255。监控点会对startX、startY、endX 、endY四点围成的区域进行放大。
* @param startY 开始放大的Y坐标范围0-255由于设备比例限制以及实际场景屏幕比例大小不同请按照如下坐标位计算方式计算入参屏幕Y坐标/屏幕高 * 255即该坐标位Y坐标占总屏幕高的比例*255。监控点会对startX、startY、endX 、endY四点围成的区域进行放大。
* @param endX 结束放大的X坐标范围以及计算方式同startX
* @param endY 结束放大的Y坐标范围以及计算方式同startY
* @return 查询结果
*/
@PostMapping("/selZoom")
public Response selZoom(@RequestParam("cameraIndexCode") String cameraIndexCode, @RequestParam("startX") Integer startX
, @RequestParam("startY") Integer startY, @RequestParam("endX") Integer endX, @RequestParam("endY") Integer endY) {
return Response.ok(ArtemisPostUtil.selZoom(cameraIndexCode, startX, startY, endX, endY));
}
/**
* 分页查询视频监控信息
*
* @param videoCamera 视频监控信息
* @return 查询结果
*/
@ApiOperation(value = "分页查询视频监控信息")
@PostMapping("/page")
public Response page(VideoCamera videoCamera) {
IPage<VideoCamera> result = videoCameraService.selectByPage(videoCamera);
return Response.ok(result);
}
@ApiOperation(value = "添加视频监控信息")
@PostMapping("/save")
// @JwtUser
public Response save(VideoCamera videoCamera
// , @JwtUser UserInfo user
) {
// videoCamera.setCreateBy(user.getUserName());
// videoCamera.setUpdateBy(user.getUserName());
videoCamera.setDelFlag(Constants.FLAG_FALSE);
return Response.or(videoCameraService.save(videoCamera));
}
@ApiOperation(value = "编辑视频监控信息")
@PostMapping("/update")
// @JwtUser
public Response update(VideoCamera videoCamera
// , @JwtUser UserInfo user
) {
// videoCamera.setUpdateBy(user.getUserName());
return Response.or(videoCameraService.updateById(videoCamera));
}
@ApiOperation(value = "删除视频监控信息")
@PostMapping("/delete")
public Response delete(@ApiParam("ID 逗号隔开") @RequestParam("ids") String ids) {
List<String> idList = Arrays.asList(ids.split(","));
if (CollUtil.isEmpty(idList)) {
return Response.fail("请输入要删除的视频监控ID");
}
return Response.or(videoCameraService.removeByIds(idList));
}
}

View File

@@ -0,0 +1,324 @@
package com.ltgk.smartFishingPort.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.google.common.collect.Lists;
import com.ltgk.smartFishingPort.common.core.domain.Response;
import com.ltgk.smartFishingPort.common.utils.DateUtils;
import com.ltgk.smartFishingPort.common.utils.MybatisUtil;
import com.ltgk.smartFishingPort.domain.dto.UpdateVideoIdentificationDto;
import com.ltgk.smartFishingPort.domain.dto.VideoIdentificationDto;
import com.ltgk.smartFishingPort.domain.entity.VideoIdentification;
import com.ltgk.smartFishingPort.domain.vo.*;
import com.ltgk.smartFishingPort.service.IVideoIdentificationService;
import com.ltgk.smartFishingPort.utils.ExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
/**
* <p>
* 监控识别记录表 前端控制器
* </p>
*
* @author zhou
* @since 2024-12-10
*/
@Api(tags = {"视频识别信息模块"})
@RestController
@RequestMapping("/videoIdentification")
@Slf4j
public class VideoIdentificationController {
@Autowired
IVideoIdentificationService videoIdentificationService;
@Value("${url.picFile}")
private String picUrl;
@ApiOperation("添加视频检测预警信息")
@PostMapping(value = "/add")
public Response add(@ModelAttribute VideoIdentification videoIdentification) {
// String videoReplace = videoIdentification.getVideoUrl().replace("http://120.238.185.186:2001", "https://pyzhyg.panyu.gd.cn:7673");
// String pictureReplace = videoIdentification.getPictureUrl().replace("http://120.238.185.186:2001", "https://pyzhyg.panyu.gd.cn:7673");
// videoIdentification.setVideoUrl(videoReplace.replace("http://120.238.185.186:2002", "https://pyzhyg.panyu.gd.cn:7673"));
// videoIdentification.setPictureUrl(pictureReplace.replace("http://120.238.185.186:2002", "https://pyzhyg.panyu.gd.cn:7673"));
if ("卡口".equals(videoIdentification.getTakeType())) {
// 接收卡口数据
if (!"船牌识别".equals(videoIdentification.getIdentificationType())) {
return Response.ok();
}
// TODO: 接收数据时将图片的数据进行转换
videoIdentification.setCreateAt(new Date())
.setCreateBy("SYS-卡口")
.setUpdateAt(new Date())
.setUpdateBy("SYS-卡口");
} else {
// 接收无人机数据
videoIdentification.setCreateAt(new Date())
.setCreateBy("SYS-无人机")
.setUpdateAt(new Date())
.setUpdateBy("SYS-无人机");
}
return Response.or(videoIdentificationService.saveOrUpdate(videoIdentification));
}
@ApiOperation("添加视频检测预警信息")
@PostMapping(value = "/addByJson")
public Response addByJson(@RequestBody VideoIdentification videoIdentification) {
// String videoReplace = videoIdentification.getVideoUrl().replace("http://120.238.185.186:2001", "https://pyzhyg.panyu.gd.cn:7673");
// String pictureReplace = videoIdentification.getPictureUrl().replace("http://120.238.185.186:2001", "https://pyzhyg.panyu.gd.cn:7673");
// videoIdentification.setVideoUrl(videoReplace.replace("http://120.238.185.186:2002", "https://pyzhyg.panyu.gd.cn:7673"));
// videoIdentification.setPictureUrl(pictureReplace.replace("http://120.238.185.186:2002", "https://pyzhyg.panyu.gd.cn:7673"));
return Response.or(videoIdentificationService.saveOrUpdate(videoIdentification));
}
@ApiOperation("添加视频检测预警信息")
@PostMapping(value = "/addByTracker")
public Response addByTracker(@RequestBody VideoIdentificationDto videoIdentificationDto) {
VideoIdentification videoIdentification = new VideoIdentification();
BeanUtils.copyProperties(videoIdentificationDto, videoIdentification);
return Response.or(videoIdentificationService.saveOrUpdate(videoIdentification));
}
@ApiOperation("分页查询渔船识别记录")
@PostMapping("/findByPage")
public Response findByPage(VideoIdentificationDto videoIdentificationDto) {
IPage<VideoIdentification> pageResult = videoIdentificationService.findByPage(videoIdentificationDto);
return Response.ok(pageResult);
}
@ApiOperation("导出渔船识别记录EXCEL")
@GetMapping("/exportByCondition")
public void exportByCondition(VideoIdentificationDto videoIdentificationDto, HttpServletResponse response) throws Exception {
VideoIdentification param = new VideoIdentification();
BeanUtils.copyProperties(videoIdentificationDto, param);
QueryWrapper<VideoIdentification> queryWrapper = MybatisUtil.notNullField(param);
List<VideoIdentification> list = videoIdentificationService.list(queryWrapper);
List<VideoIdentificationVo> dtoList = list
.stream()
.map(m -> {
VideoIdentificationVo dto = new VideoIdentificationVo();
BeanUtils.copyProperties(m, dto);
return dto;
}).collect(Collectors.toList());
ExcelUtil<VideoIdentificationVo> util = new ExcelUtil<>(VideoIdentificationVo.class);
util.exportExcel(response, "渔船识别记录", "VideoIdentification", dtoList);
}
@ApiOperation("卡口流量趋势")
@GetMapping("/getPortTrend")
public Response getPortTrend() {
List<PortTrendVO> list = Lists.newArrayList();
Date now = DateUtils.addDays(new Date(), 1);
Date beforeDate = DateUtils.addDays(new Date(), -7);
Date dateTmp = beforeDate;
while (dateTmp.before(now)) {
PortTrendVO item = new PortTrendVO();
item.setTimeStr(DateUtils.parseDateToStr("yyyy-MM-dd", dateTmp));
item.setCount(Long.parseLong(new Random().nextInt(30) + 50 + ""));
list.add(item);
dateTmp = DateUtils.addDays(dateTmp, 1);
}
return Response.ok(list);
}
@ApiOperation("识别率")
@GetMapping("/getIdentityRate")
public Response getIdentityRate(@RequestParam("type") String type) {
int totalCount = new Random().nextInt(10) + 150;
int identityCount = new Random().nextInt(20) + 130;
if ("all".equals(type) || "year".equals(type)) {
totalCount = totalCount * 12;
identityCount = identityCount * 12;
}
String rate = (new BigDecimal(identityCount)).divide(new BigDecimal(totalCount), 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%";
// Map<String,Object> map = Maps.newHashMap();
// map.put("totalCount",totalCount);
// map.put("identityCount",identityCount);
// map.put("rate",rate);
IdentityRateVO identityRateVO = new IdentityRateVO();
identityRateVO.setTotalCount(totalCount);
identityRateVO.setIdentityCount(identityCount);
identityRateVO.setRate(rate);
return Response.ok(identityRateVO);
}
@ApiOperation("无人机执行次数")
@GetMapping("/getVAVOperateCount")
public Response getUAVOperateCount() {
int operateCount = new Random().nextInt(5) + 10;
int autoCount = new Random().nextInt(10) + 20;
// Map<String,Object> map = Maps.newHashMap();
// map.put("operateCount",operateCount);
// map.put("autoCount",autoCount);
UAVOperateCountVO uavOperateCountVO = new UAVOperateCountVO();
uavOperateCountVO.setOperateCount(operateCount);
uavOperateCountVO.setAutoCount(autoCount);
return Response.ok(uavOperateCountVO);
}
@ApiOperation("卡口识别累计")
@GetMapping("/getPortIdentityTotal")
public Response getPortIdentityTotal() {
int boatNameIdentityCount = new Random().nextInt(10) + 30;
int boatTypeIdentityCount = new Random().nextInt(15) + 50;
int notCloseDoorCount = new Random().nextInt(10) + 10;
int notWearSafeCount = new Random().nextInt(10) + 10;
int crossLineCount = new Random().nextInt(10) + 10;
int draftCount = new Random().nextInt(10) + 10;
// Map<String,Object> map = Maps.newHashMap();
// map.put("boatNameIdentityCount",boatNameIdentityCount);
// map.put("boatTypeIdentityCount",boatTypeIdentityCount);
// map.put("notCloseDoorCount",notCloseDoorCount);
// map.put("notWearSafeCount",notWearSafeCount);
// map.put("crossLineCount",crossLineCount);
// map.put("draftCount",draftCount);
PortIdentityTotalVO portIdentityTotalVO = new PortIdentityTotalVO(boatNameIdentityCount, boatTypeIdentityCount, notCloseDoorCount, notWearSafeCount, crossLineCount, draftCount);
return Response.ok(portIdentityTotalVO);
}
@ApiOperation("无人机识别累计")
@GetMapping("/getUAVIdentityTotal")
public Response getUAVIdentityTotal() {
int boatNameIdentityCount = new Random().nextInt(10) + 30;
int boatTypeIdentityCount = new Random().nextInt(15) + 50;
int dangerSignCount = new Random().nextInt(10) + 10;
int notCountrySignCount = new Random().nextInt(10) + 10;
int crossLineCount = new Random().nextInt(10) + 10;
int outSpeedCount = new Random().nextInt(10) + 10;
int notNormalBerthCount = new Random().nextInt(10) + 10;
int dropCount = new Random().nextInt(2);
int fireCount = new Random().nextInt(3);
int oilCount = new Random().nextInt(5) + 3;
// Map<String,Object> map = Maps.newHashMap();
// map.put("boatNameIdentityCount",boatNameIdentityCount);
// map.put("boatTypeIdentityCount",boatTypeIdentityCount);
// map.put("dangerSignCount",dangerSignCount);
// map.put("notCountrySignCount",notCountrySignCount);
// map.put("crossLineCount",crossLineCount);
// map.put("outSpeedCount",outSpeedCount);
// map.put("notNormalBerthCount",notNormalBerthCount);
// map.put("dropCount",dropCount);
// map.put("fireCount", fireCount);
// map.put("oilCount", oilCount);
UAVIdentityTotalVO uavIdentityTotalVO = new UAVIdentityTotalVO();
uavIdentityTotalVO.setBoatNameIdentityCount(boatNameIdentityCount);
uavIdentityTotalVO.setBoatTypeIdentityCount(boatTypeIdentityCount);
uavIdentityTotalVO.setDangerSignCount(dangerSignCount);
uavIdentityTotalVO.setNotCountrySignCount(notCountrySignCount);
uavIdentityTotalVO.setNotNormalBerthCount(notNormalBerthCount);
uavIdentityTotalVO.setCrossLineCount(crossLineCount);
uavIdentityTotalVO.setOutSpeedCount(outSpeedCount);
uavIdentityTotalVO.setDropCount(dropCount);
uavIdentityTotalVO.setOilCount(oilCount);
uavIdentityTotalVO.setFireCount(fireCount);
return Response.ok(uavIdentityTotalVO);
}
@ApiOperation("航道流速信息")
@GetMapping("/getWaterwayVelocity")
public Response getWaterwayVelocity(@RequestParam("waterwayVelocity") String waterwayVelocity) {
int deepSiteCode = new Random().nextInt(10);
int radarVelocity = new Random().nextInt(15) + 50;
int radarLevel = new Random().nextInt(10) + 10;
int pressureLevel = new Random().nextInt(10) + 10;
int temperature = new Random().nextInt(10) + 10;
int angle = new Random().nextInt(10) + 10;
// Map<String,Object> map = Maps.newHashMap();
// map.put("deepSiteCode",deepSiteCode);
// map.put("radarVelocity",radarVelocity);
// map.put("radarLevel",radarLevel);
// map.put("pressureLevel",pressureLevel);
// map.put("temperature",temperature);
// map.put("angle",angle);
WaterwayVelocityVO waterwayVelocityVO = new WaterwayVelocityVO();
waterwayVelocityVO.setDeepSiteCode(deepSiteCode);
;
waterwayVelocityVO.setRadarVelocity(radarVelocity);
waterwayVelocityVO.setRadarLevel(radarLevel);
waterwayVelocityVO.setPressureLevel(pressureLevel);
waterwayVelocityVO.setTemperature(temperature);
waterwayVelocityVO.setAngle(angle);
return Response.ok(waterwayVelocityVO);
}
@ApiOperation("航道气象信息")
@GetMapping("/getWaterwayWeather")
public Response getWaterwayWeather(@RequestParam("waterwayVelocity") String waterwayVelocity) {
int deepSiteCode = new Random().nextInt(10);
int temperature = new Random().nextInt(15) + 50;
int humidity = new Random().nextInt(10) + 10;
int windSpeed = new Random().nextInt(10) + 10;
int windDirect = new Random().nextInt(10) + 10;
int pressure = new Random().nextInt(10) + 10;
int rainFall = new Random().nextInt(10) + 10;
int illuminance = new Random().nextInt(10) + 10;
// Map<String,Object> map = Maps.newHashMap();
// map.put("deepSiteCode",deepSiteCode);
// map.put("temperature",temperature);
// map.put("humidity",humidity);
// map.put("windSpeed",windSpeed);
// map.put("windDirect",windDirect);
// map.put("pressure",pressure);
// map.put("rainFall",rainFall);
// map.put("illuminance",illuminance);
WaterwayWeatherVO waterwayWeatherVO = new WaterwayWeatherVO();
waterwayWeatherVO.setDeepSiteCode(deepSiteCode);
waterwayWeatherVO.setTemperature(temperature);
waterwayWeatherVO.setHumidity(humidity);
waterwayWeatherVO.setWindSpeed(windSpeed);
waterwayWeatherVO.setWindDirect(windDirect);
waterwayWeatherVO.setPressure(pressure);
waterwayWeatherVO.setRainFall(rainFall);
waterwayWeatherVO.setIlluminance(illuminance);
return Response.ok(waterwayWeatherVO);
}
/**
* 删除告警信息
*
* @param req
* @return ltgk.pm.video.base.Response
* @author Qi ChengBin
* @date 2025/12/1
*/
@ApiOperation("删除视频检测预警信息")
@PostMapping(value = "/removeVideoIdentification")
public Response removeVideoIdentification(@RequestBody UpdateVideoIdentificationDto req) {
return Response.or(videoIdentificationService.removeById(Long.parseLong(req.getId())));
}
/**
* 修改告警信息
*
* @param req
* @return ltgk.pm.video.base.Response
* @author Qi ChengBin
* @date 2025/12/1
*/
@ApiOperation("修改视频检测预警信息")
@PostMapping(value = "/updateVideoIdentification")
public Response updateVideoIdentification(@RequestBody UpdateVideoIdentificationDto req) {
VideoIdentification videoIdentification = new VideoIdentification();
BeanUtils.copyProperties(req, videoIdentification);
videoIdentification.setId(Long.parseLong(req.getId()));
return Response.or(videoIdentificationService.updateById(videoIdentification));
}
}

View File

@@ -0,0 +1,30 @@
package com.ltgk.smartFishingPort.domain.drone;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
@Data
@Accessors(chain = true)
public class AddStreamDetectTaskReq {
@JsonProperty("task_id")
@ApiModelProperty("任务ID")
private String task_id;
@JsonProperty("src_url")
@ApiModelProperty("源视频地址")
private String src_url;
@JsonProperty("dst_url")
@ApiModelProperty("目标视频地址")
private String dst_url;
@JsonProperty("class_codes")
@ApiModelProperty(value = "算法类别识别码,支持多个,以逗号分隔,参见识别编码统一说明")
private String class_codes;
@JsonProperty("device_sn")
@ApiModelProperty("设备SN")
private String device_sn;
}

View File

@@ -0,0 +1,111 @@
package com.ltgk.smartFishingPort.domain.drone;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class DeviceRespDto {
@JsonProperty("gateway")
@ApiModelProperty(value = "机舱")
private Gateway gateway;
@JsonProperty("drone")
@ApiModelProperty(value = "飞行器")
private Drone drone;
@Data
public static class Gateway{
@JsonProperty("sn")
@ApiModelProperty(value = "设备sn")
private String sn;
@JsonProperty("callsign")
@ApiModelProperty(value = "设备别名")
private String callsign;
@JsonProperty("device_model")
@ApiModelProperty(value = "设备模型")
private DeviceModel deviceModel;
@JsonProperty("device_online_status")
@ApiModelProperty(value = "设备在线状态")
private boolean deviceOnlineStatus;
@JsonProperty("mode_code")
@ApiModelProperty(value = "设备模式 0:空闲中,1:现场调试,2:远程调试,3:固件升级中,4:作业中")
private Integer modeCode;
@JsonProperty("camera_list")
@ApiModelProperty(value = "相机列表")
private List<GatewayCameraList> cameraList;
}
@Data
public static class DeviceModel{
@JsonProperty("key")
@ApiModelProperty(value = "Key设备唯一标识由domain-type-sub_type组成详细设备类型请参考https://developer.dji.com/doc/cloud-api-tutorial/cn/overview/product-support.html")
private String key;
@JsonProperty("domain")
@ApiModelProperty(value = "")
private String domain;
@JsonProperty("type")
@ApiModelProperty(value = "类型")
private String type;
@JsonProperty("sub_type")
@ApiModelProperty(value = "子类型")
private String sub_type;
@JsonProperty("name")
@ApiModelProperty(value = "设备型号")
private String name;
@JsonProperty("class")
@ApiModelProperty(value = "设备分类:机场,遥控器等")
private String classs;
}
@Data
public static class GatewayCameraList{
@JsonProperty("camera_index")
@ApiModelProperty(value = "相机索引")
private String cameraIndex;
@JsonProperty("available_camera_positions")
@ApiModelProperty(value = "可用的相机位置 indoor:舱内摄像头 outdoor:舱外摄像头")
private List<String> availableCameraPositions;
@JsonProperty("camera_position")
@ApiModelProperty(value = "当前相机位置")
private String cameraPosition;
}
@Data
public static class Drone{
@JsonProperty("sn")
@ApiModelProperty(value = "飞行器SN")
private String sn;
@JsonProperty("callsign")
@ApiModelProperty(value = "设备别名")
private String callsign;
@JsonProperty("device_model")
@ApiModelProperty(value = "设备模型")
private DeviceModel deviceModel;
@JsonProperty("device_online_status")
@ApiModelProperty(value = "设备在线状态")
private boolean deviceOnlineStatus;
@JsonProperty("mode_code")
@ApiModelProperty(value = "飞行器状态0:待机,1:起飞准备,2:起飞准备完毕,3:手动飞行,4:自动起飞,5:航线飞行,6:全景拍照,7:智能跟随,8:ADS-B 躲避,9:自动返航,10:自动降落,11:强制降落,12:三桨叶降落,13:升级中,14:未连接,15:APAS,16:虚拟摇杆状态,17:指令飞行,18:空中 RTK 收敛模式,19:机场选址中")
private Integer modeCode;
@JsonProperty("camera_list")
@ApiModelProperty(value = "相机列表")
private List<DroneCameraList> cameraList;
}
@Data
public static class DroneCameraList{
@JsonProperty("camera_index")
@ApiModelProperty(value = "相机索引")
private String cameraIndex;
@JsonProperty("lens_list")
@ApiModelProperty(value = "镜头列表")
private List<LensList> lens_list;
}
public static class LensList{
@JsonProperty("available_lens_types")
@ApiModelProperty(value = "可用镜头类型 normal:默认镜头 wide:广角镜头 zoom:变焦镜头 ir:红外镜头")
private List<String> availableLensTypes;
@JsonProperty("lens_type")
@ApiModelProperty(value = "当前镜头类型 normal:默认镜头 wide:广角镜头 zoom:变焦镜头 ir:红外镜头")
private String lensType;
}
}

View File

@@ -0,0 +1,51 @@
package com.ltgk.smartFishingPort.domain.drone;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class DroneControlObtainRespDto {
@JsonProperty("drone_sn")
@ApiModelProperty("飞行器SN")
private String drone_sn;
@JsonProperty("controls")
@ApiModelProperty("控制信息")
private List<Controls> controls;
@Data
public static class Controls {
@JsonProperty("type")
@ApiModelProperty("控制权类型flight 表示飞行控制权payload表示 负载控制权。")
private String type;
@JsonProperty("payload_index")
@ApiModelProperty("负载索引")
private String payload_index;
@JsonProperty("gateway")
@ApiModelProperty("网关信息")
private Gateway gateway;
@JsonProperty("user")
@ApiModelProperty("用户信息")
private User user;
}
@Data
public static class Gateway {
@JsonProperty("sn")
@ApiModelProperty("网关SN比如机场SN")
private String sn;
}
@Data
public static class User {
@JsonProperty("call_sign")
@ApiModelProperty("用户别名")
private String call_sign;
@JsonProperty("user_id")
@ApiModelProperty("用户ID")
private String user_id;
@JsonProperty("type")
@ApiModelProperty("控制权类型Cloud表示云端控制。")
private String type;
}
}

View File

@@ -0,0 +1,85 @@
package com.ltgk.smartFishingPort.domain.drone;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class DroneControlObtainRespV2Dto {
@JsonProperty("drone_sn")
@ApiModelProperty("飞行器SN")
private String drone_sn;
@JsonProperty("controls")
@ApiModelProperty("控制信息")
private List<Controls> controls;
@Data
public static class Controls {
@JsonProperty("type")
@ApiModelProperty("控制权类型flight 表示飞行控制权payload表示 负载控制权。")
private String type;
@JsonProperty("version")
@ApiModelProperty("控制权版本 (用于并发控制)")
private String version;
@JsonProperty("gateway")
@ApiModelProperty("网关信息")
private Gateway gateway;
@JsonProperty("user")
@ApiModelProperty("用户信息")
private User user;
@JsonProperty("key")
@ApiModelProperty("控制权限Key")
private String key;
@JsonProperty("spec")
@ApiModelProperty("控制权限的特定属性")
private Spec spec;
}
@Data
public static class Gateway {
@JsonProperty("sn")
@ApiModelProperty("网关SN比如机场SN")
private String sn;
@JsonProperty("id")
@ApiModelProperty("网关ID")
private String id;
@JsonProperty("device_model_class")
@ApiModelProperty("网关设备类型")
private String device_model_class;
@JsonProperty("auth_control_keys")
@ApiModelProperty("网关正在代理的云控控制权")
private String auth_control_keys;
}
@Data
public static class User {
@JsonProperty("call_sign")
@ApiModelProperty("用户别名")
private String call_sign;
@JsonProperty("user_id")
@ApiModelProperty("用户ID")
private String user_id;
@JsonProperty("type")
@ApiModelProperty("控制权类型Cloud表示云端控制。")
private String type;
}
@Data
public static class Spec {
@JsonProperty("is_cloud_control_auth")
@ApiModelProperty("是否正在等待授权")
private Boolean is_cloud_control_auth;
@JsonProperty("is_locked")
@ApiModelProperty("是否被锁定 (例如,被遥控器抢夺)")
private Boolean is_locked;
@JsonProperty("payload_index")
@ApiModelProperty("负载索引 (仅当类型为 payload 时有效)")
private String payload_index;
@JsonProperty("waiting_for_auth_user")
@ApiModelProperty("正在等待谁授权 (如果 IsCloudControlAuth 为 true)")
private String waiting_for_auth_user;
}
}

View File

@@ -0,0 +1,16 @@
package com.ltgk.smartFishingPort.domain.drone;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class DroneOneTouchTakeoffRespDto {
@ApiModelProperty("从起飞到降落的整体id")
@JsonProperty("flight_id")
private String flight_id;
@ApiModelProperty("单次操作的id")
@JsonProperty("fly_to_id")
private String fly_to_id;
}

View File

@@ -0,0 +1,14 @@
package com.ltgk.smartFishingPort.domain.drone;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class DroneResponseListBase<T> {
@JsonProperty("list")
@ApiModelProperty(value = "响应数据列表")
private List<T> list;
}

View File

@@ -0,0 +1,82 @@
package com.ltgk.smartFishingPort.domain.drone;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class DroneTaskRespDto {
@JsonProperty("name")
@ApiModelProperty("任务名称")
private String name;
@JsonProperty("task_type")
@ApiModelProperty("任务类型immediate:立即任务timed:单次定时任务recurring:重复任务continuous:连续任务,非必填,不填写则为全部类型")
private String task_type;
@JsonProperty("status")
@ApiModelProperty("任务状态数组waiting:待开始,starting_failure启动失败,executing执行中,paused 暂停,terminated终止,success成功,suspended挂起,timeout超时非必填不填写则为全部状态")
private String status;
@JsonProperty("sn")
@ApiModelProperty("执行任务的设备SN")
private String sn;
@JsonProperty("landing_dock_sn")
@ApiModelProperty("任务降落的设备SN若为空则表示仅使用一个设备")
private String landing_dock_sn;
@JsonProperty("begin_at")
@ApiModelProperty("任务设定的开始时间")
private String begin_at;
@JsonProperty("end_at")
@ApiModelProperty("任务设定的结束时间")
private String end_at;
@JsonProperty("run_at")
@ApiModelProperty("任务实际执行的时间")
private String run_at;
@JsonProperty("completed_at")
@ApiModelProperty("任务实际完成的时间")
private String completed_at;
@JsonProperty("wayline_uuid")
@ApiModelProperty("任务执行航线ID")
private String wayline_uuid;
@JsonProperty("folder_id")
@ApiModelProperty("任务关联的媒体文件夹ID")
private Integer folder_id;
@JsonProperty("current_waypoint_index")
@ApiModelProperty("任务已经飞完的航点数量")
private Integer current_waypoint_index;
@JsonProperty("total_waypoints")
@ApiModelProperty("任务的总航点数量")
private Integer total_waypoints;
@JsonProperty("media_upload_status")
@ApiModelProperty("媒体上传状态to_uploaduploadingupload_finished")
private String media_upload_status;
@JsonProperty("resumable_status")
@ApiModelProperty("断点续飞状态:‘’-不可续飞auto-自动续飞manual-手动续飞")
private Boolean resumable_status;
@JsonProperty("operations")
@ApiModelProperty("任务操作记录")
private Operations operations;
@JsonProperty("exceptions")
@ApiModelProperty("异常信息")
private Exceptions exceptions;
@Data
public static class Exceptions {
@JsonProperty("code")
@ApiModelProperty("任务执行错误码")
private String code;
@JsonProperty("message")
@ApiModelProperty("错误信息")
private String message;
@JsonProperty("happen_at")
@ApiModelProperty("错误发生的时间")
private String happen_at;
@JsonProperty("sn")
@ApiModelProperty("错误发生的设备")
private String sn;
}
@Data
public static class Operations {
@JsonProperty("operator_account")
@ApiModelProperty("任务操作者账号")
private String operator_account;
}
}

View File

@@ -0,0 +1,51 @@
package com.ltgk.smartFishingPort.domain.drone;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class DroneWayLineDetailRespDto {
@ApiModelProperty("航线唯一标识wayline_id")
@JsonProperty("id")
private String id;
@ApiModelProperty("航线名称")
@JsonProperty("name")
private String name;
@ApiModelProperty("航线文件下载链接")
@JsonProperty("download_url")
private String downloadUrl;
@JsonProperty("payload_information")
@ApiModelProperty("负载信息列表详细设备类型请参考https://developer.dji.com/doc")
private List<PayloadInformation> payloadInformation;
@ApiModelProperty("设备唯一标识由domain-type-sub_type组成详细设备类型请参考https://developer.dji.com/doc/cloud-api-tutorial/cn/overview/product-support.html")
@JsonProperty("device_model_key")
private String deviceModelKey;
@ApiModelProperty("航线类型waypoint:航点航线 mapping_2d:建图航拍对应司空2 中的面状航线下的正射采集 mapping_3d:倾斜摄影对应司空2 中的面状航线下的倾斜采集 mapping_strip:带状航线 facade:斜面航线 solid:几何体航线 mapping_gobject:贴近摄影")
@JsonProperty("template_type")
private List<String> templateType;
@ApiModelProperty("更新时间")
@JsonProperty("update_time")
private String updateTime;
@ApiModelProperty("航线长度")
@JsonProperty("distance")
private String distance;
@ApiModelProperty("航线航点个数")
@JsonProperty("wayline_point_nums")
private Integer waylinePointNums;
@Data
public static class PayloadInformation {
@ApiModelProperty("")
@JsonProperty("domain")
private String domain;
@ApiModelProperty("负载类型")
@JsonProperty("type")
private String type;
@ApiModelProperty("镜头类型 wide:广角,zoom:变焦,ir:红外")
@JsonProperty("lens_type")
private String lensType;
}
}

View File

@@ -0,0 +1,41 @@
package com.ltgk.smartFishingPort.domain.drone;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class DroneWayLineRespDto {
@ApiModelProperty("航线唯一标识wayline_id")
@JsonProperty("id")
private String id;
@ApiModelProperty("航线名称")
@JsonProperty("name")
private String name;
@JsonProperty("payload_information")
@ApiModelProperty("负载信息列表详细设备类型请参考https://developer.dji.com/doc")
private List<PayloadInformation> payloadInformation;
@ApiModelProperty("设备唯一标识由domain-type-sub_type组成详细设备类型请参考https://developer.dji.com/doc/cloud-api-tutorial/cn/overview/product-support.html")
@JsonProperty("device_model_key")
private String deviceModelKey;
@ApiModelProperty("航线类型waypoint:航点航线 mapping_2d:建图航拍对应司空2 中的面状航线下的正射采集 mapping_3d:倾斜摄影对应司空2 中的面状航线下的倾斜采集 mapping_strip:带状航线 facade:斜面航线 solid:几何体航线 mapping_gobject:贴近摄影")
@JsonProperty("template_type")
private List<String> templateType;
@ApiModelProperty("更新时间")
@JsonProperty("update_time")
private String updateTime;
@Data
public static class PayloadInformation {
@ApiModelProperty("")
@JsonProperty("domain")
private String domain;
@ApiModelProperty("负载类型")
@JsonProperty("type")
private String type;
@ApiModelProperty("镜头类型 wide:广角,zoom:变焦,ir:红外")
@JsonProperty("lens_type")
private String lensType;
}
}

View File

@@ -0,0 +1,40 @@
package com.ltgk.smartFishingPort.domain.drone;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ProjectRespDto {
@JsonProperty("name")
@ApiModelProperty(value = "项目名称")
private String name;
@JsonProperty("introduction")
@ApiModelProperty(value = "项目简介")
private String introduction;
@JsonProperty("uuid")
@ApiModelProperty(value = "项目uuid")
private String uuid;
@JsonProperty("org_uuid")
@ApiModelProperty(value = "组织uuid")
private String org_uuid;
@JsonProperty("created_at")
@ApiModelProperty(value = "创建时间")
private Long createdAt;
@JsonProperty("updated_at")
@ApiModelProperty(value = "更新时间")
private Long updatedAt;
@JsonProperty("project_work_center_point")
@ApiModelProperty(value = "项目作业中心点")
private ProjectWorkCenterPoint projectWorkCenterPoint;
@Data
public static class ProjectWorkCenterPoint{
@JsonProperty("latitude")
@ApiModelProperty(value = "项目作业中心点的纬度")
private String latitude;
@JsonProperty("longitude")
@ApiModelProperty(value = "项目作业中心点的经度")
private String longitude;
}
}

View File

@@ -0,0 +1,19 @@
package com.ltgk.smartFishingPort.domain.drone;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class StartLiveReqRespDto {
@JsonProperty("expire_ts")
@ApiModelProperty("直播推流Token有效期")
private Integer expire_ts;
@ApiModelProperty("直播拉流播放地址")
@JsonProperty("url")
private String url;
@ApiModelProperty("直播推流类型")
@JsonProperty("url_type")
private String url_type;
}

View File

@@ -0,0 +1,15 @@
package com.ltgk.smartFishingPort.domain.drone;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class VideoStreamResp {
@JsonProperty("code")
@ApiModelProperty(value = "非0表示异常")
private Integer code;
@JsonProperty("msg")
@ApiModelProperty(value = "如果任何已存在,返回:任务已存在")
private String msg;
}

View File

@@ -0,0 +1,44 @@
package com.ltgk.smartFishingPort.domain.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
public class AlarmDataResultDto implements Serializable {
private static final long serialVersionUID = 1L;
private int lCommand;
private Object result;
private Date alarmTime;
public int getlCommand() {
return lCommand;
}
public void setlCommand(int lCommand) {
this.lCommand = lCommand;
}
public Object getResult() {
return result;
}
public void setResult(Object result) {
this.result = result;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date getAlarmTime() {
return alarmTime;
}
public void setAlarmTime(Date alarmTime) {
this.alarmTime = alarmTime;
}
}

View File

@@ -0,0 +1,77 @@
package com.ltgk.smartFishingPort.domain.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 船舶实时动态实体类
*/
@Data
//@Document(collection = "boat_dynamic_data")
public class BoatDynamicDto implements Serializable {
private static final long serialVersionUID = 1L;
// @Id
private String uuid;
//@ApiModelProperty(value = "设备类型")
private String deviceType;
// @MongoField(condition = MongoUtil.LIKE)
//@ApiModelProperty(value = "终端号码")
private String terminalCode;
// @MongoField(condition = MongoUtil.LIKE)
//@ApiModelProperty(value = "渔船名称")
private String boatName;
private String boatNameEn;
//@ApiModelProperty(value = "经度")
// @Field(targetType = FieldType.DOUBLE)
private Double longitude;
//@ApiModelProperty(value = "纬度")
// @Field(targetType = FieldType.DOUBLE)
private Double latitude;
//@ApiModelProperty(value = "船速")
private String sog;
//@ApiModelProperty(value = "航向")
private String cog;
//@ApiModelProperty(value = "船艏向")
private String heading;
//@ApiModelProperty(value = "来源")
private String dataSource;
//@ApiModelProperty(value = "报文内容")
private String msgContent;
//@ApiModelProperty(value = "定位时间")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date gpsTime;
//@ApiModelProperty(value = "船长")
private BigDecimal boatLength;
//
// //@ApiModelProperty(value = "型宽")
// private BigDecimal moldedBreadth;
//
// private String shipId;
//
// private String boatLabel;
//
// private String region;
}

View File

@@ -0,0 +1,23 @@
package com.ltgk.smartFishingPort.domain.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Author: zhouyaoyao
* @Date 2025/1/22 13:42
* Description: 综合安防平台在controller层请求参数封装参数视图
*/
@Data
public class DsArtemisDTO {
@ApiModelProperty("视频监控设备编号")
@NotBlank(message = "视频监控设备编号不能为空")
private String videoCode;
@ApiModelProperty("视频流预览链接类型")
private String previewProtocol;
}

View File

@@ -0,0 +1,25 @@
package com.ltgk.smartFishingPort.domain.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @Author: zhouyaoyao
* @Date 2025/4/2 17:49
* Description: 光电联动功能调试参数对象
*/
@Data
public class LinkageParamDto implements Serializable {
/**
* 视频监控设备与联动目标的距离(公里)
*/
private Double distance;
/**
* 偏移量值
*/
private Double number;
}

View File

@@ -0,0 +1,150 @@
package com.ltgk.smartFishingPort.domain.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
* 更新监控识别告警记录对象
*
* @author Qi ChengBin
* @date 2025/12/01
*/
@Data
@Accessors(chain = true)
public class UpdateVideoIdentificationDto {
@ApiModelProperty(value = "主键")
private String id;
@ApiModelProperty(value = "识别类型(船体识别、船号识别)")
private String identificationType;
@ApiModelProperty(value = "抓拍类型(无人机、卡口)")
private String takeType;
@ApiModelProperty(value = "违规类型")
private String illegalType;
@ApiModelProperty(value = "有无AIS信号")
private String isHasAis;
@ApiModelProperty(value = "mmsi")
private String mmsi;
@ApiModelProperty(value = "AIS状态")
private String aisStatus;
@ApiModelProperty(value = "船舶名称")
private String boatName;
@ApiModelProperty(value = "船舶英文名称")
private String boatNameEn;
@ApiModelProperty(value = "摄像头名称")
private String videoName;
@ApiModelProperty(value = "进出港方向(进港、出港)")
private String entryOut;
@ApiModelProperty(value = "航向")
private String cog;
@ApiModelProperty(value = "街道")
private String streetName;
@ApiModelProperty(value = "原始图片保存路径")
private String sourcePicPath;
@ApiModelProperty(value = "识别图片保存路径")
private String trackerPicPath;
@ApiModelProperty(value = "船牌图片保存路径")
private String boatCodePath;
@ApiModelProperty(value = "抓拍视频链接")
private String videoUrl;
@ApiModelProperty(value = "抓拍时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date takeTime;
@ApiModelProperty(value = "创建人")
private String createBy;
@ApiModelProperty(value = "创建日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createAt;
@ApiModelProperty(value = "编辑人")
private String updateBy;
@ApiModelProperty(value = "编辑日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateAt;
@ApiModelProperty(value = "海康识别船名")
private String hkResult;
@ApiModelProperty(value = "系统识别船名")
private String sysShipName;
@ApiModelProperty(value = "系统更正标注船名")
private String sysUpdateName;
@ApiModelProperty(value = "系统识别结果正误")
private String systemResult;
@ApiModelProperty(value = "船型")
private String shipType;
@ApiModelProperty(value = "经度")
private BigDecimal longitude;
@ApiModelProperty(value = "纬度")
private BigDecimal latitude;
@ApiModelProperty(value = "救生衣状态")
private String jacketStatus;
@ApiModelProperty("船只长度")
private BigDecimal length;
@ApiModelProperty("船只高度")
private BigDecimal height;
@ApiModelProperty("船只高度范围")
private String heightRange;
@ApiModelProperty("船只速度")
private BigDecimal speed;
@ApiModelProperty("船只宽度")
private BigDecimal width;
@ApiModelProperty(value = "所属港口")
private String belongPort;
@ApiModelProperty("是否关闭舱门")
private String isCloseDoor;
@ApiModelProperty("越线偏航时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date crossLineTime;
@ApiModelProperty("吃水刻度")
private BigDecimal draftMarks;
@ApiModelProperty("备注")
private String remark;
}

View File

@@ -0,0 +1,316 @@
package com.ltgk.smartFishingPort.domain.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ltgk.smartFishingPort.utils.DateTimeConverter;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class VideoIdentificationDto implements Serializable {
private static final long serialVersionUID=1L;
@ExcelProperty(value = "摄像头名称")
@ApiModelProperty(value = "摄像头名称")
private String videoName;
@ExcelProperty(value = "抓拍时间", converter = DateTimeConverter.class)
@ApiModelProperty(value = "抓拍时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date takeTime;
@ApiModelProperty("抓拍时间-开始查询条件")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date beginTime;
@ApiModelProperty("抓拍时间-结束查询条件")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
@ExcelProperty(value = "所属港口")
@ApiModelProperty(value = "所属港口")
@TableField(value = "belong_port",condition = SqlCondition.LIKE)
private String belongPort;
@ExcelProperty(value = "船舶类型")
@ApiModelProperty(value = "船舶类型")
private String shipType;
@ExcelProperty(value = "船只长度")
@ApiModelProperty("船只长度")
private BigDecimal length;
@ExcelProperty(value = "船只高度")
@ApiModelProperty("船只高度")
private BigDecimal height;
@ExcelProperty(value = "船只高度范围")
@ApiModelProperty("船只高度范围")
private String heightRange;
@ExcelProperty(value = "船只速度")
@ApiModelProperty("船只速度")
private BigDecimal speed;
@ExcelProperty(value = "进出港方向")
@ApiModelProperty(value = "进出港方向(进港、出港)")
private String entryOut;
@ExcelProperty(value = "经度")
@ApiModelProperty(value="经度")
private BigDecimal longitude;
@ExcelProperty(value = "纬度")
@ApiModelProperty(value = "纬度")
private BigDecimal latitude;
@ExcelProperty(value = "救生衣状态")
@ApiModelProperty(value = "救生衣状态")
private String jacketStatus;
@ApiModelProperty(value = "原始图片保存路径")
private String sourcePicPath;
@ApiModelProperty(value = "识别图片保存路径")
private String trackerPicPath;
@ApiModelProperty(value = "船牌图片保存路径")
private String boatCodePath;
@ExcelProperty(value = "船舶名称")
@ApiModelProperty(value = "船舶名称")
@TableField(value = "belong_port",condition = SqlCondition.LIKE)
private String boatName;
@ExcelProperty(value = "识别类型")
@ApiModelProperty(value = "识别类型(船脸识别、船牌识别)")
private String identificationType;
@ApiModelProperty("页容量")
private Integer pageSize;
@ApiModelProperty("页码")
private Integer pageNo;
@TableField(exist = false)
private BigDecimal distance;
public BigDecimal getLength() {
return length;
}
public void setLength(BigDecimal length) {
this.length = length;
}
public String getVideoName() {
return videoName;
}
public void setVideoName(String videoName) {
this.videoName = videoName;
}
public Date getTakeTime() {
return takeTime;
}
public void setTakeTime(Date takeTime) {
this.takeTime = takeTime;
}
public Date getBeginTime() {
return beginTime;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String getBelongPort() {
return belongPort;
}
public void setBelongPort(String belongPort) {
this.belongPort = belongPort;
}
public String getShipType() {
return shipType;
}
public void setShipType(String shipType) {
this.shipType = shipType;
}
public BigDecimal getHeight() {
return height;
}
public void setHeight(BigDecimal height) {
this.height = height;
}
public String getHeightRange() {
return heightRange;
}
public void setHeightRange(String heightRange) {
this.heightRange = heightRange;
}
public BigDecimal getSpeed() {
return speed;
}
public void setSpeed(BigDecimal speed) {
this.speed = speed;
}
public String getEntryOut() {
return entryOut;
}
public void setEntryOut(String entryOut) {
this.entryOut = entryOut;
}
public BigDecimal getLongitude() {
return longitude;
}
public void setLongitude(BigDecimal longitude) {
this.longitude = longitude;
}
public BigDecimal getLatitude() {
return latitude;
}
public void setLatitude(BigDecimal latitude) {
this.latitude = latitude;
}
public String getJacketStatus() {
return jacketStatus;
}
public void setJacketStatus(String jacketStatus) {
this.jacketStatus = jacketStatus;
}
public String getSourcePicPath() {
return sourcePicPath;
}
public void setSourcePicPath(String sourcePicPath) {
this.sourcePicPath = sourcePicPath;
}
public String getTrackerPicPath() {
return trackerPicPath;
}
public void setTrackerPicPath(String trackerPicPath) {
this.trackerPicPath = trackerPicPath;
}
public String getBoatCodePath() {
return boatCodePath;
}
public void setBoatCodePath(String boatCodePath) {
this.boatCodePath = boatCodePath;
}
public String getBoatName() {
return boatName;
}
public void setBoatName(String boatName) {
this.boatName = boatName;
}
public String getIdentificationType() {
return identificationType;
}
public void setIdentificationType(String identificationType) {
this.identificationType = identificationType;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public Integer getPageNo() {
return pageNo;
}
public void setPageNo(Integer pageNo) {
this.pageNo = pageNo;
}
public BigDecimal getDistance() {
return distance;
}
public void setDistance(BigDecimal distance) {
this.distance = distance;
}
@ApiModelProperty(value = "航向")
private String cog;
@ApiModelProperty(value = "抓拍类型(无人机、卡口)")
private String takeType;
@ApiModelProperty(value = "违规类型")
private String illegalType;
@ApiModelProperty(value = "有无AIS信号")
private String isHasAis;
@ApiModelProperty(value = "AIS信号")
private String mmsi;
@ApiModelProperty(value = "AIS状态")
private String aisStatus;
@ApiModelProperty(value = "船舶英文名称")
@TableField("boat_name_en")
private String boatNameEn;
@ApiModelProperty(value = "街道")
@TableField("street_name")
private String streetName;
}

View File

@@ -0,0 +1,30 @@
package com.ltgk.smartFishingPort.domain.dto;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* @Author: zhouyaoyao
* @Date 2025/2/27 16:09
* Description:
*/
@Data
@Accessors(chain = true)
public class VideoServoDTO {
/**
* 监控设备编号
*/
private String deviceCode;
/**
* 联动目标终端号
*/
private String terminalCode;
/**
* 联动目标经度
*/
private String gpsX;
/**
* 联动目标纬度
*/
private String gpsY;
}

View File

@@ -0,0 +1,133 @@
package com.ltgk.smartFishingPort.domain.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author: zhouyaoyao
* @Date 2025/6/10 17:49
* Description:
*/
@TableName("haishiju.boat_data")
@Data
public class BoatData implements Serializable {
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 类型 */
@ApiModelProperty(value = "类型")
private String type;
/** 船号 */
@ApiModelProperty(value = "船号")
private String boatName;
/** 设备编号 */
@ApiModelProperty(value = "设备编号")
private String boatCode;
/** 船主 */
@ApiModelProperty(value = "船主")
private String boatOwner;
/** 手机 */
@ApiModelProperty(value = "手机")
private String ownerPhone;
/** 身份证号码 */
@ApiModelProperty(value = "身份证号码")
private String ownerIdcard;
/** 所在县区 */
@ApiModelProperty(value = "所在县区")
private String county;
/** 所在乡镇 */
@ApiModelProperty(value = "所在乡镇")
private String town;
/** 所在村委 */
@ApiModelProperty(value = "所在村委")
private String village;
/** 详细地址 */
@ApiModelProperty(value = "详细地址")
private String address;
/** 归属地 */
@ApiModelProperty(value = "归属地")
private String belongArea;
/** 设备厂商 */
@ApiModelProperty(value = "设备厂商")
private String factory;
/** 船舶类型 */
@ApiModelProperty(value = "船舶类型")
private String boatType;
/** 作业类型 */
@ApiModelProperty(value = "作业类型")
private String jobType;
/** 船体材质 */
@ApiModelProperty(value = "船体材质")
private String material;
/** 长(米) */
@ApiModelProperty(value = "")
private Long length;
/** 宽(米) */
@ApiModelProperty(value = "")
private Long width;
/** 深(米) */
@ApiModelProperty(value = "")
private Long deep;
/** 安装日期 */
@ApiModelProperty(value = "安装日期")
private String installDate;
/** 删除标记 */
private Integer delFlag;
/** 创建者 */
private String createBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 更新者 */
private String updateBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/** 备注 */
private String remark;
/**
* 页容量
*/
@TableField(exist = false)
private Integer pageSize;
/**
* 页码
*/
@TableField(exist = false)
private Integer pageNum;
}

View File

@@ -0,0 +1,81 @@
package com.ltgk.smartFishingPort.domain.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 船舶实时动态实体类
*/
@Accessors(chain = true)
@Data
@TableName("haishiju.boat_dynamic")
public class BoatDynamic implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "uuid",type = IdType.ASSIGN_UUID)
private String uuid;
@ApiModelProperty(value = "设备类型")
private String deviceType;
// @MongoField(condition = MongoUtil.LIKE)
@ApiModelProperty(value = "终端号码")
private String terminalCode;
// @MongoField(condition = MongoUtil.LIKE)
@ApiModelProperty(value = "渔船名称")
private String boatName;
@ApiModelProperty(value = "渔船英文名称")
private String boatNameEn;
@ApiModelProperty(value = "经度")
// @Field(targetType = FieldType.DOUBLE)
private BigDecimal longitude;
@ApiModelProperty(value = "纬度")
// @Field(targetType = FieldType.DOUBLE)
private BigDecimal latitude;
@ApiModelProperty(value = "船速")
private String sog;
@ApiModelProperty(value = "航向")
private String cog;
@ApiModelProperty(value = "船艏向")
private String heading;
@ApiModelProperty(value = "来源")
private String dataSource;
@ApiModelProperty(value = "定位时间")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date gpsTime;
@ApiModelProperty(value = "船长")
private BigDecimal boatLength;
@ApiModelProperty(value = "型宽")
private BigDecimal modelWidth;
private String region;
@ApiModelProperty("原始报文")
private String msg;
}

View File

@@ -0,0 +1,94 @@
package com.ltgk.smartFishingPort.domain.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 船舶轨迹表
* </p>
*
* @author zhou
* @since 2022-10-22
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("haishiju.boat_path")
@ApiModel(value = "BoatPath对象", description = "船舶轨迹表")
public class BoatPath extends Model<BoatPath> {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "UUID")
@TableId(value = "uuid", type = IdType.ASSIGN_UUID)
private String uuid;
@ApiModelProperty(value = "定位设备类型")
@TableField("device_type")
private String deviceType;
@ApiModelProperty(value = "定位设备终端号")
@TableField("terminal_code")
private String terminalCode;
@ApiModelProperty(value = "船舶名称")
@TableField("boat_name")
private String boatName;
@ApiModelProperty(value = "经度")
@TableField("longitude")
private BigDecimal longitude;
@ApiModelProperty(value = "纬度")
@TableField("latitude")
private BigDecimal latitude;
@ApiModelProperty(value = "速度")
@TableField("sog")
private String sog;
@ApiModelProperty(value = "航向")
@TableField("cog")
private String cog;
@ApiModelProperty(value = "船艏向")
@TableField("heading")
private String heading;
@ApiModelProperty(value = "定位时间")
@TableField("gps_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date gpsTime;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@Override
public Serializable pkVal() {
return this.uuid;
}
@TableField(exist = false)
private String bs;
}

View File

@@ -0,0 +1,238 @@
package com.ltgk.smartFishingPort.domain.entity;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 视频监控管理表
* </p>
*
* @author zhouyaoyao
* @since 2025-01-19
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("haishiju.ds_video")
@ApiModel(value = "DsVideo对象", description = "视频监控管理表")
public class DsVideo extends Model<DsVideo> {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.ASSIGN_ID)
private String id;
@ApiModelProperty(value = "监控编号")
@TableField(value = "video_code", condition = SqlCondition.LIKE)
private String videoCode;
@ApiModelProperty(value = "监控名称")
@TableField(value = "video_name", condition = SqlCondition.LIKE)
private String videoName;
@ApiModelProperty(value = "监控坐标经度")
@TableField("longitude")
private BigDecimal longitude;
@ApiModelProperty(value = "监控坐标纬度")
@TableField("latitude")
private BigDecimal latitude;
@ApiModelProperty(value = "监控安装高度(米)")
@TableField("height")
private BigDecimal height;
@ApiModelProperty(value = "可视距离(公里)")
@TableField("vision_distance")
private BigDecimal visionDistance;
@ApiModelProperty(value = "设备ip")
@TableField("video_ip")
private String videoIp;
@ApiModelProperty(value = "设备端口号")
@TableField("video_port")
private String videoPort;
@ApiModelProperty(value = "设备账号")
@TableField("video_account")
private String videoAccount;
@ApiModelProperty(value = "设备密码")
@TableField("video_password")
private String videoPassword;
@ApiModelProperty(value = "通道号")
@TableField("channel_no")
private String channelNo;
@ApiModelProperty(value = "所属渔港")
@TableField(value = "belong_port", condition = SqlCondition.LIKE)
private String belongPort;
@ApiModelProperty(value = "监控类型(球机、云台)")
@TableField("video_type")
private String videoType;
@ApiModelProperty(value = "镜头传感器类型(可见光、热成像)")
@TableField("sensor_type")
private String sensorType;
@ApiModelProperty(value = "监管所属单位")
@TableField(value = "belong_unit", condition = SqlCondition.LIKE)
private String belongUnit;
@ApiModelProperty(value = "运行状态")
@TableField("run_status")
private String runStatus;
@ApiModelProperty(value = "备注")
@TableField("remarks")
private String remarks;
@ApiModelProperty(value = "创建时间")
@TableField("create_at")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createAt;
@ApiModelProperty(value = "编辑时间")
@TableField("update_at")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateAt;
@ApiModelProperty(value = "创建人")
@TableField("create_by")
private String createBy;
@ApiModelProperty(value = "编辑人")
@TableField("update_by")
private String updateBy;
@ApiModelProperty(value = "报警划线坐标")
@TableField("line_point")
private String linePoint;
@ApiModelProperty(value = "视频预览链接")
@TableField("video_url")
private String videoUrl;
@ApiModelProperty(value = "是否智能识别渔船")
@TableField("is_analysis_boat")
private String isAnalysisBoat;
@ApiModelProperty(value = "删除标记")
@TableField("del_flag")
@TableLogic(delval = "1", value = "0")
@JsonIgnore
private Integer delFlag;
@ApiModelProperty(value = "行政区域编码")
private String areaCode;
@ApiModelProperty(value = "行政区域名称")
private String areaName;
/**
* 页容量
*/
@TableField(exist = false)
@JsonIgnore
private Integer pageSize;
/**
* 页码
*/
@TableField(exist = false)
@JsonIgnore
private Integer pageNum;
/**
* 热成像设备最大变倍参数
*/
@ApiModelProperty("热成像设备最大变倍参数")
private Double zRcxVal;
/**
* 俯仰角调节参数
*/
@ApiModelProperty("俯仰角调节参数")
private Double yVal;
private String yValArr;
/**
* 水平旋转调节参数
*/
@ApiModelProperty("水平旋转调节参数")
private Double xVal;
private String xValArr;
/**
* 距离与变倍参数换算参数
*/
@ApiModelProperty("距离与变倍参数换算参数")
private Double zNumVal;
private String zNumValArr;
/**
* 水平遮挡方位角区间
*/
@ApiModelProperty("水平遮挡方位角区间")
private String xRotateVal;
/**
* 可见光设备变倍最大参数
*/
@ApiModelProperty("可见光设备变倍最大参数")
private Double zMaxVal;
/**
* 监控顺逆时针旋转参数 -1: 旋转角度大于零,顺时针右侧旋转 旋转角度小于零逆时针左侧旋转1: 旋转角度大于零,逆时针右侧旋转 旋转角度小于零,顺时针左侧旋转
*/
private Integer rotateT;
/**
* 监控设备与联动目标的实际距离
*/
@TableField(exist = false)
private BigDecimal distance;
/**
* 监控设备与联动目标的距离(对比可视距离后)
*/
@TableField(exist = false)
private double distanceVal;
/**
* 监控设备与联动目标的距离(对比遮挡范围后)
*/
@TableField(exist = false)
private BigDecimal distance1;
@ApiModelProperty(value = "是否卡口1-是0-否")
@TableField("be_bayonet")
private Integer beBayonet;
@ApiModelProperty(value = "是否锁定1-是0-否")
@TableField("be_lock")
private Integer beLock;
@TableField(exist = false)
private JSONObject PTZCfg;
@ApiModelProperty(value = "是否开启可视范围1-是0-否")
@TableField(value = "whether_to_turn_on_the_view")
private Integer whetherToTurnOnTheView;
}

View File

@@ -0,0 +1,195 @@
package com.ltgk.smartFishingPort.domain.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 15:17
* Description:
*/
@TableName("haishiju.emergency_rescue")
@ApiModel("应急救援事故实体类")
@Data
public class EmergencyRescue extends Model<EmergencyRescue> {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id", type = IdType.ASSIGN_ID)
@ApiModelProperty("id")
private String id;
/**
* 经度
*/
@ApiModelProperty("经度")
private String longitude;
/**
* 纬度
*/
@ApiModelProperty("纬度")
private String latitude;
/**
* 事故船只
*/
@ApiModelProperty("事故船只")
private String accidentShip;
/**
* 发生时间
*/
@ApiModelProperty("发生时间")
private Date happenTime;
/**
* 应急预案状态(①应急救援预案 ②制定救援计划 ③实时救援监控 ④救援后期处置 ⑤已处置)
*/
@ApiModelProperty("应急预案状态(“1” 未处置 “2”已处置)")
private String emergencyStatus;
/**
* 事故名称
*/
@ApiModelProperty("事故名称")
private String accidentName;
/**
* 渔区
*/
@ApiModelProperty("渔区")
private String fishingArea;
/**
* 渔船信息
*/
@TableField(exist = false)
private List<BoatData> shipinfoNewList = Lists.newArrayList();
/**
* 事故类型
*/
@ApiModelProperty("事故类型")
private String accidentType;
/**
* 事故描述
*/
@ApiModelProperty("事故描述")
private String accidentBrief;
/**
* 创建时间
*/
@TableField(value = "create_time", fill = FieldFill.INSERT)
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 创建用户
*/
private Long createUser;
/**
* 修改时间
*/
@TableField(value = "update_time")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**
* 修改用户
*/
private Long updateUser;
/**
* 处置结果
*/
@ApiModelProperty("处置结果")
private String disposeResult;
/**
* 完成时间
*/
@ApiModelProperty("完成时间")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date completeTime;
/**
* 人员伤亡
*/
@ApiModelProperty("人员伤亡")
private String casualties;
/**
* 财产损失情况
*/
@ApiModelProperty("财产损失情况")
private String propertyDamage;
/**
* 参与救援船只
*/
@ApiModelProperty("参与救援船只")
private String rescueShip;
/**
* 备注
*/
@ApiModelProperty("备注")
private String remark;
// /**
// * 材料文件信息列表
// */
// @TableField(exist = false)
// @ApiModelProperty("材料文件信息列表,返回材料文件信息")
// private List<FileInfoVO> materialsFileList;
//
// /**
// * 现场照片文件信息列表
// */
// @TableField(exist = false)
// @ApiModelProperty("现场照片文件信息列表,返回现场照片文件信息")
// private List<FileInfoVO> sitePhotosFileList;
//
// /**
// * 事故报告文件信息列表
// */
// @TableField(exist = false)
// @ApiModelProperty("事故报告文件信息列表,返回事故报告文件信息")
// private List<FileInfoVO> accidentReportFileList;
/**
* 页容量
*/
@TableField(exist = false)
private Integer pageSize;
/**
* 页码
*/
@TableField(exist = false)
private Integer pageNum;
}

View File

@@ -0,0 +1,181 @@
package com.ltgk.smartFishingPort.domain.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 监控设备表
* </p>
*
* @author zhou
* @since 2024-12-16
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("haishiju.env_equipment")
@ApiModel(value="EnvEquipment对象", description="环境检测设备表")
public class EnvEquipment extends Model<EnvEquipment> {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "监控编号")
@TableField("video_code")
private String videoCode;
@ApiModelProperty(value = "视频源类型")
@TableField("source_type")
private String sourceType;
@ApiModelProperty(value = "摄像头名称")
@TableField("video_name")
private String videoName;
@ApiModelProperty(value = "摄像头类型")
@TableField("video_type")
private String videoType;
@ApiModelProperty(value = "摄像头图片")
@TableField("video_image")
private String videoImage;
@ApiModelProperty(value = "录入单位")
@TableField("depart_name")
private String departName;
@ApiModelProperty(value = "录入单位ID")
@TableField("depart_id")
private String departId;
@ApiModelProperty(value = "经度")
@TableField("longitude")
private BigDecimal longitude;
@ApiModelProperty(value = "纬度")
@TableField("latitude")
private BigDecimal latitude;
@ApiModelProperty(value = "运行状态(正常、不正常)")
@TableField("run_status")
private String runStatus;
@ApiModelProperty(value = "布设区域")
@TableField("layout_area")
private String layoutArea;
@ApiModelProperty(value = "联网类型(政务网)")
@TableField("innet_type")
private String innetType;
@ApiModelProperty(value = "摄像头所属单位")
@TableField("video_belong")
private String videoBelong;
@ApiModelProperty(value = "监控范围")
@TableField("range_info")
private String rangeInfo;
@ApiModelProperty(value = "视频预览链接")
@TableField("preview_url")
private String previewUrl;
@ApiModelProperty(value = "是否在使用")
@TableField("is_available")
private String isAvailable;
@ApiModelProperty(value = "传感器类型(可见光、热成像)")
@TableField("sensor_type")
private String sensorType;
@ApiModelProperty(value = "是否全景")
@TableField("is_ar")
private Integer isAr;
@ApiModelProperty(value = "是否用于智能分析")
@TableField("is_analyze")
private Integer isAnalyze;
@ApiModelProperty(value = "报警视频名称")
@TableField("alarm_video_name")
private String alarmVideoName;
@ApiModelProperty(value = "创建人")
@TableField("create_by")
private String createBy;
@ApiModelProperty(value = "编辑人")
@TableField("update_by")
private String updateBy;
@ApiModelProperty(value = "创建日期")
@TableField("create_at")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createAt;
@ApiModelProperty(value = "编辑日期")
@TableField("update_at")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateAt;
@ApiModelProperty(value = "删除标记")
@TableField("del_flag")
private Integer delFlag;
@ApiModelProperty(value = "备注")
@TableField("remark")
private String remark;
@ApiModelProperty(value = "回访功能0启用1未启用")
@TableField("play_back")
private Integer playBack;
/**
* 摄像头ip
*/
private String videosIp;
/**
* 摄像头端口
*/
private String videosPort;
/**
* 摄像头账户
*/
private String videosAccount;
/**
* 摄像头密码
*/
private String videosPass;
@Override
public Serializable pkVal() {
return this.id;
}
private Integer isSdkControl;
}

View File

@@ -0,0 +1,203 @@
package com.ltgk.smartFishingPort.domain.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 监控设备表
* </p>
*
* @author zhou
* @since 2024-12-16
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("haishiju.uav_equipment")
@ApiModel(value="UavEquipment对象", description="无人机设备表")
public class UavEquipment extends Model<UavEquipment> {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "监控编号")
@TableField("video_code")
private String videoCode;
@ApiModelProperty(value = "视频源类型")
@TableField("source_type")
private String sourceType;
@ApiModelProperty(value = "摄像头名称")
@TableField("video_name")
private String videoName;
@ApiModelProperty(value = "摄像头类型")
@TableField("video_type")
private String videoType;
@ApiModelProperty(value = "摄像头图片")
@TableField("video_image")
private String videoImage;
@ApiModelProperty(value = "录入单位")
@TableField("depart_name")
private String departName;
@ApiModelProperty(value = "录入单位ID")
@TableField("depart_id")
private String departId;
@ApiModelProperty(value = "经度")
@TableField("longitude")
private BigDecimal longitude;
@ApiModelProperty(value = "纬度")
@TableField("latitude")
private BigDecimal latitude;
@ApiModelProperty(value = "运行状态(正常、不正常)")
@TableField("run_status")
private String runStatus;
@ApiModelProperty(value = "布设区域")
@TableField("layout_area")
private String layoutArea;
@ApiModelProperty(value = "联网类型(政务网)")
@TableField("innet_type")
private String innetType;
@ApiModelProperty(value = "摄像头所属单位")
@TableField("video_belong")
private String videoBelong;
@ApiModelProperty(value = "监控范围")
@TableField("range_info")
private String rangeInfo;
@ApiModelProperty(value = "视频预览链接")
@TableField("preview_url")
private String previewUrl;
@ApiModelProperty(value = "是否在使用")
@TableField("is_available")
private String isAvailable;
@ApiModelProperty(value = "传感器类型(可见光、热成像)")
@TableField("sensor_type")
private String sensorType;
@ApiModelProperty(value = "是否全景")
@TableField("is_ar")
private Integer isAr;
@ApiModelProperty(value = "是否用于智能分析")
@TableField("is_analyze")
private Integer isAnalyze;
@ApiModelProperty(value = "报警视频名称")
@TableField("alarm_video_name")
private String alarmVideoName;
@ApiModelProperty(value = "创建人")
@TableField("create_by")
private String createBy;
@ApiModelProperty(value = "编辑人")
@TableField("update_by")
private String updateBy;
@ApiModelProperty(value = "创建日期")
@TableField("create_at")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createAt;
@ApiModelProperty(value = "编辑日期")
@TableField("update_at")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateAt;
@ApiModelProperty(value = "删除标记")
@TableField("del_flag")
private Integer delFlag;
@ApiModelProperty(value = "备注")
@TableField("remark")
private String remark;
@ApiModelProperty(value = "回访功能0启用1未启用")
@TableField("play_back")
private Integer playBack;
/**
* 摄像头ip
*/
private String videosIp;
/**
* 摄像头端口
*/
private String videosPort;
/**
* 摄像头账户
*/
private String videosAccount;
/**
* 摄像头密码
*/
private String videosPass;
@Override
public Serializable pkVal() {
return this.id;
}
private Integer isSdkControl;
@JsonProperty("gatewaySn")
@ApiModelProperty(value = "机巢sn")
@TableField("gateway_sn")
private String gatewaySn;
@JsonProperty("droneSn")
@ApiModelProperty(value = "无人机sn")
@TableField("drone_sn")
private String droneSn;
@JsonProperty("systemUuid")
@ApiModelProperty(value = "系统uuid")
@TableField("system_uuid")
private String systemUuid;
@ApiModelProperty(value = "海波高度")
@TableField("altitude")
@JsonProperty("altitude")
private BigDecimal altitude;
@ApiModelProperty(value = "离地高度")
@TableField("height")
@JsonProperty("height")
private BigDecimal height;
}

View File

@@ -0,0 +1,181 @@
package com.ltgk.smartFishingPort.domain.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 监控设备表
* </p>
*
* @author zhou
* @since 2024-12-16
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("haishiju.video_camera")
@ApiModel(value="VideoCamera对象", description="监控设备表")
public class VideoCamera extends Model<VideoCamera> {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "监控编号")
@TableField("video_code")
private String videoCode;
@ApiModelProperty(value = "视频源类型")
@TableField("source_type")
private String sourceType;
@ApiModelProperty(value = "摄像头名称")
@TableField("video_name")
private String videoName;
@ApiModelProperty(value = "摄像头类型")
@TableField("video_type")
private String videoType;
@ApiModelProperty(value = "摄像头图片")
@TableField("video_image")
private String videoImage;
@ApiModelProperty(value = "录入单位")
@TableField("depart_name")
private String departName;
@ApiModelProperty(value = "录入单位ID")
@TableField("depart_id")
private String departId;
@ApiModelProperty(value = "经度")
@TableField("longitude")
private BigDecimal longitude;
@ApiModelProperty(value = "纬度")
@TableField("latitude")
private BigDecimal latitude;
@ApiModelProperty(value = "运行状态(正常、不正常)")
@TableField("run_status")
private String runStatus;
@ApiModelProperty(value = "布设区域")
@TableField("layout_area")
private String layoutArea;
@ApiModelProperty(value = "联网类型(政务网)")
@TableField("innet_type")
private String innetType;
@ApiModelProperty(value = "摄像头所属单位")
@TableField("video_belong")
private String videoBelong;
@ApiModelProperty(value = "监控范围")
@TableField("range_info")
private String rangeInfo;
@ApiModelProperty(value = "视频预览链接")
@TableField("preview_url")
private String previewUrl;
@ApiModelProperty(value = "是否在使用")
@TableField("is_available")
private String isAvailable;
@ApiModelProperty(value = "传感器类型(可见光、热成像)")
@TableField("sensor_type")
private String sensorType;
@ApiModelProperty(value = "是否全景")
@TableField("is_ar")
private Integer isAr;
@ApiModelProperty(value = "是否用于智能分析")
@TableField("is_analyze")
private Integer isAnalyze;
@ApiModelProperty(value = "报警视频名称")
@TableField("alarm_video_name")
private String alarmVideoName;
@ApiModelProperty(value = "创建人")
@TableField("create_by")
private String createBy;
@ApiModelProperty(value = "编辑人")
@TableField("update_by")
private String updateBy;
@ApiModelProperty(value = "创建日期")
@TableField("create_at")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createAt;
@ApiModelProperty(value = "编辑日期")
@TableField("update_at")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateAt;
@ApiModelProperty(value = "删除标记")
@TableField("del_flag")
private Integer delFlag;
@ApiModelProperty(value = "备注")
@TableField("remark")
private String remark;
@ApiModelProperty(value = "回访功能0启用1未启用")
@TableField("play_back")
private Integer playBack;
/**
* 摄像头ip
*/
private String videosIp;
/**
* 摄像头端口
*/
private String videosPort;
/**
* 摄像头账户
*/
private String videosAccount;
/**
* 摄像头密码
*/
private String videosPass;
@Override
public Serializable pkVal() {
return this.id;
}
private Integer isSdkControl;
}

View File

@@ -0,0 +1,218 @@
package com.ltgk.smartFishingPort.domain.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 监控识别记录表
* </p>
*
* @author zhou
* @since 2024-12-10
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("haishiju.video_identification")
@ApiModel(value="VideoIdentification对象", description="监控识别记录表")
public class VideoIdentification extends Model<VideoIdentification> {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "识别类型(船体识别、船号识别)")
@TableField("identification_type")
private String identificationType;
@ApiModelProperty(value = "抓拍类型(无人机、卡口)")
@TableField("take_type")
private String takeType;
@ApiModelProperty(value = "违规类型")
@TableField(value = "illegal_type",condition = SqlCondition.LIKE)
private String illegalType;
@ApiModelProperty(value = "有无AIS信号")
@TableField("is_has_ais")
private String isHasAis;
@ApiModelProperty(value = "mmsi")
@TableField("mmsi")
private String mmsi;
@ApiModelProperty(value = "AIS状态")
@TableField("ais_status")
private String aisStatus;
@ApiModelProperty(value = "船舶名称")
@TableField(value = "boat_name",condition = SqlCondition.LIKE)
private String boatName;
@ApiModelProperty(value = "船舶英文名称")
@TableField("boat_name_en")
private String boatNameEn;
@ApiModelProperty(value = "摄像头名称")
@TableField(value = "video_name",condition = SqlCondition.LIKE)
private String videoName;
@TableField(exist = false)
private String videoCode;
@ApiModelProperty(value = "进出港方向(进港、出港)")
@TableField("entry_out")
private String entryOut;
@ApiModelProperty(value = "航向")
@TableField("cog")
private String cog;
@ApiModelProperty(value = "街道")
@TableField("street_name")
private String streetName;
@ApiModelProperty(value = "原始图片保存路径")
@TableField("source_pic_path")
private String sourcePicPath;
@ApiModelProperty(value = "识别图片保存路径")
@TableField("tracker_pic_path")
private String trackerPicPath;
@ApiModelProperty(value = "船牌图片保存路径")
@TableField("boat_code_path")
private String boatCodePath;
@ApiModelProperty(value = "抓拍视频链接")
@TableField("video_url")
private String videoUrl;
@ApiModelProperty(value = "抓拍时间")
@TableField("take_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date takeTime;
@ApiModelProperty(value = "创建人")
@TableField("create_by")
private String createBy;
@ApiModelProperty(value = "创建日期")
@TableField("create_at")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createAt;
@ApiModelProperty(value = "编辑人")
@TableField("update_by")
private String updateBy;
@ApiModelProperty(value = "编辑日期")
@TableField("update_at")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateAt;
@ApiModelProperty(value = "删除标记")
@TableField("del_flag")
@TableLogic(value = "0", delval = "1")
private Integer delFlag;
@ApiModelProperty(value = "海康识别船名")
@TableField("hk_result")
private String hkResult;
@TableField("sys_ship_name")
@ApiModelProperty(value = "系统识别船名")
private String sysShipName;
@TableField("sys_update_name")
@ApiModelProperty(value = "系统更正标注船名")
private String sysUpdateName;
@TableField("system_result")
@ApiModelProperty(value = "系统识别结果正误")
private String systemResult;
@ApiModelProperty(value = "船型")
@TableField("ship_type")
private String shipType;
@Override
public Serializable pkVal() {
return this.id;
}
@ApiModelProperty(value="经度")
@TableField("longitude")
private BigDecimal longitude;
@ApiModelProperty(value = "纬度")
@TableField("latitude")
private BigDecimal latitude;
@ApiModelProperty(value = "救生衣状态")
@TableField("jacket_status")
private String jacketStatus;
@ApiModelProperty("船只长度")
@TableField("length")
private BigDecimal length;
@ApiModelProperty("船只高度")
@TableField("height")
private BigDecimal height;
@TableField("height_range")
@ApiModelProperty("船只高度范围")
private String heightRange;
@ApiModelProperty("船只速度")
@TableField("speed")
private BigDecimal speed;
@ApiModelProperty("船只宽度")
@TableField("width")
private BigDecimal width;
@ApiModelProperty(value = "所属港口")
@TableField("belong_port")
private String belongPort;
@TableField(exist = false)
private BigDecimal distance;
@ApiModelProperty("是否关闭舱门")
@TableField("is_close_door")
private String isCloseDoor;
@ApiModelProperty("越线偏航时间")
@TableField("cross_line_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date crossLineTime;
@ApiModelProperty("吃水刻度")
@TableField("draft_marks")
private BigDecimal draftMarks;
@ApiModelProperty("备注")
@TableField(value = "remark")
private String remark;
}

View File

@@ -0,0 +1,44 @@
package com.ltgk.smartFishingPort.domain.hikvision;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
public class AlarmData implements Serializable {
private static final long serialVersionUID = 1L;
private int lCommand;
private Object result;
private Date alarmTime;
public int getlCommand() {
return lCommand;
}
public void setlCommand(int lCommand) {
this.lCommand = lCommand;
}
public Object getResult() {
return result;
}
public void setResult(Object result) {
this.result = result;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date getAlarmTime() {
return alarmTime;
}
public void setAlarmTime(Date alarmTime) {
this.alarmTime = alarmTime;
}
}

View File

@@ -0,0 +1,23 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class AirportCameraSwitchReq extends DroneDeviceReq{
@NotBlank(message = "机场sn不能为空")
@JsonProperty("sn")
@ApiModelProperty(value = "机场sn")
private String sn;
@JsonProperty("camera_index")
@ApiModelProperty(value = "相机索引")
@NotBlank(message = "相机索引不能为空")
private String camera_index;
@JsonProperty("camera_position")
@ApiModelProperty(value = "相机位置 indoor:舱内摄像头 outdoor:舱外摄像头")
@NotBlank(message = "相机位置不能为空")
private String camera_position;
}

View File

@@ -0,0 +1,75 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 船只检测视图
*/
@Data
public class AlarmDataExcelVo implements Serializable {
/**
* 船只方向
*/
@ApiModelProperty("船只方向")
private String direction;
/**
* 船只检测状态
*/
@ApiModelProperty("船只检测状态")
private String detState;
/**
* 船只长度
*/
@ApiModelProperty("船只长度")
private BigDecimal length;
/**
* 船只高度
*/
@ApiModelProperty("船只高度")
private BigDecimal height;
/**
* 船只宽度
*/
@ApiModelProperty("船只宽度")
private BigDecimal width;
/**
* 船只速度
*/
@ApiModelProperty("船只速度")
private BigDecimal speed;
/**
* 检测线ID
*/
@ApiModelProperty("检测线ID")
private Integer triggerLineId;
/**
* 告警时间
*/
@ApiModelProperty("抓拍时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date alarmTime;
/**
* 监控设备名称
*/
@ApiModelProperty("监控设备名称")
private String videoName;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,219 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 船只检测视图
*/
@Data
public class AlarmDataVo implements Serializable {
/**
* 船只方向
*/
@ApiModelProperty("船只方向")
private String direction;
/**
* 船只检测状态
*/
@ApiModelProperty("船只检测状态")
private String detState;
/**
* 船只长度
*/
@ApiModelProperty("船只长度")
private BigDecimal length;
/**
* 船只高度
*/
@ApiModelProperty("船只高度")
private BigDecimal height;
/**
* 船只宽度
*/
@ApiModelProperty("船只宽度")
private BigDecimal width;
/**
* 船只速度
*/
@ApiModelProperty("船只速度")
private BigDecimal speed;
/**
* 检测线ID
*/
@ApiModelProperty("检测线ID")
private Integer triggerLineId;
/**
* 可见光抓拍图片地址
*/
@ApiModelProperty("可见光抓拍图片地址")
private String dwPicUrl;
/**
* 热成像抓拍图片地址
*/
@ApiModelProperty("热成像抓拍图片地址")
private String dwThermalPicUrl;
/**
* 告警时间
*/
@ApiModelProperty("抓拍时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date alarmTime;
@ApiModelProperty("抓拍时间-开始查询条件")
private String beginTime;
@ApiModelProperty("抓拍时间-结束查询条件")
private String endTime;
/**
* 监控设备名称
*/
@ApiModelProperty("监控设备名称")
private String videoName;
private static final long serialVersionUID = 1L;
@ApiModelProperty("页容量")
private Integer pageSize;
@ApiModelProperty("页码")
private Integer pageNo;
public String getDirection() {
return direction;
}
public void setDirection(String direction) {
this.direction = direction;
}
public String getDetState() {
return detState;
}
public void setDetState(String detState) {
this.detState = detState;
}
public BigDecimal getLength() {
return length;
}
public void setLength(BigDecimal length) {
this.length = length;
}
public BigDecimal getHeight() {
return height;
}
public void setHeight(BigDecimal height) {
this.height = height;
}
public BigDecimal getWidth() {
return width;
}
public void setWidth(BigDecimal width) {
this.width = width;
}
public BigDecimal getSpeed() {
return speed;
}
public void setSpeed(BigDecimal speed) {
this.speed = speed;
}
public Integer getTriggerLineId() {
return triggerLineId;
}
public void setTriggerLineId(Integer triggerLineId) {
this.triggerLineId = triggerLineId;
}
public String getDwPicUrl() {
return dwPicUrl;
}
public void setDwPicUrl(String dwPicUrl) {
this.dwPicUrl = dwPicUrl;
}
public String getDwThermalPicUrl() {
return dwThermalPicUrl;
}
public void setDwThermalPicUrl(String dwThermalPicUrl) {
this.dwThermalPicUrl = dwThermalPicUrl;
}
public Date getAlarmTime() {
return alarmTime;
}
public void setAlarmTime(Date alarmTime) {
this.alarmTime = alarmTime;
}
public String getBeginTime() {
return beginTime;
}
public void setBeginTime(String beginTime) {
this.beginTime = beginTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getVideoName() {
return videoName;
}
public void setVideoName(String videoName) {
this.videoName = videoName;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public Integer getPageNo() {
return pageNo;
}
public void setPageNo(Integer pageNo) {
this.pageNo = pageNo;
}
}

View File

@@ -0,0 +1,24 @@
package com.ltgk.smartFishingPort.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel(value = "App更新的实体")
public class AppVersionVO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "版本号")
private String version;
@ApiModelProperty(value = "是否强制更新")
private String isForce;
@ApiModelProperty(value = "Android下载路径")
private String path;
@ApiModelProperty(value = "ios下载路径")
private String iosPath;
@ApiModelProperty(value = "更新日志")
private String releaseNote;
}

View File

@@ -0,0 +1,79 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.util.List;
@Data
public class CreateDroneTaskReq<T> extends DroneDeviceReq{
@ApiModelProperty("任务名称")
@JsonProperty("name")
@NotBlank(message = "任务名称不能为空")
private String name;
@ApiModelProperty("航线ID")
@JsonProperty("wayline_uuid")
@NotBlank(message = "航线ID不能为空")
private String wayline_uuid;
@ApiModelProperty("机场SN")
@JsonProperty("sn")
@NotBlank(message = "机场SN不能为空")
private String sn;
@ApiModelProperty("降落机场SN非蛙跳任务可不填")
@JsonProperty("landing_dock_sn")
private String landing_dock_sn;
@ApiModelProperty("返航高度")
@JsonProperty("rth_altitude")
@NotBlank(message = "返航高度不能为空")
private Integer rth_altitude;
@ApiModelProperty("返航模式 optimal:智能高度 preset:设定高度")
@JsonProperty("rth_mode")
@NotBlank(message = "返航模式不能为空")
private String rth_mode;
@ApiModelProperty("任务精度 gps:GNSS 任务:飞行器无需等待 RTK 收敛便可以直接开始执行。建议精度要求不高的任务使用该模式。rtk:高精度 RTK 任务:飞行器起飞后会在空中等待 RTK 收敛后再执行任务,等待过程中无法暂停任务。建议高精度航线任务使用该模式。")
@JsonProperty("wayline_precision_type")
@NotBlank(message = "任务精度不能为空")
private String wayline_precision_type;
@ApiModelProperty("丢失信号后无人机动作 return_home:返航 continue_task:继续执行")
@JsonProperty("out_of_control_action_in_flight")
@NotBlank(message = "丢失信号后无人机动作不能为空")
private String out_of_control_action_in_flight;
@ApiModelProperty("自动断点续飞 auto: 自动断点续飞 manual:手动断点续飞")
@JsonProperty("resumable_status")
@NotBlank(message = "自动断点续飞不能为空")
private String resumable_status;
@ApiModelProperty("任务类型 immediate:立即任务 timed:单次定时任务 recurring:重复任务 continuous:连续任务")
@JsonProperty("task_type")
@NotBlank(message = "任务类型不能为空")
private String task_type;
@ApiModelProperty("时区TZ database中的时区名称")
@JsonProperty("time_zone")
@NotBlank(message = "时区不能为空")
private String time_zone;
@ApiModelProperty("任务重复模式 nonrepeating:不重复 默认 daily:每几天 weekly:每几周 absolute_monthly:每几月(按日期) relative_monthly:每几月(按星期)")
@JsonProperty("repeat_type")
@NotBlank(message = "任务重复模式不能为空")
private String repeat_type;
private T repeat_option;
@ApiModelProperty("任务开始时间,秒级时间戳,立即任务不需要填,对于定时任务这个值代表任务执行时间。对于重复任务和连续任务这个值代表任务的开始时间。")
@JsonProperty("begin_at")
private Integer begin_at;
@ApiModelProperty("任务结束时间,秒级时间戳,重复/连续任务必须填写")
@JsonProperty("end_at")
private Integer end_at;
@ApiModelProperty("重复任务的多个开始执行的时间秒级时间戳必须跟“begin_at”时间同一天。")
@JsonProperty("recurring_task_start_time_list")
private List<Integer> recurring_task_start_time_list;
@ApiModelProperty("连续任务的多个执行时间段秒级时间戳必须跟“begin_at”时间同一天。")
@JsonProperty("continuous_task_periods")
private List<Integer> continuous_task_periods;
@ApiModelProperty("连续执行最低执行电量 >= 50 <= 100")
@JsonProperty("min_battery_capacity")
@NotBlank(message = "连续执行最低执行电量")
private Integer min_battery_capacity;
}

View File

@@ -0,0 +1,43 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Author: zhouyaoyao
* @Date 2025/10/12 13:47
* Description:
*/
@Data
@Accessors(chain = true)
public class CurrentAisDynamicVO implements Serializable {
private String shipPlate;
private String boatName;
private String mmsi;
private String aisStatus;
private String sog;
private String cog;
private Double longitude;
private Double latitude;
private String dataSource;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date gpsTime;
}

View File

@@ -0,0 +1,23 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class DroneCameraSwitchReq extends DroneDeviceReq{
@NotBlank(message = "机场sn不能为空")
@JsonProperty("sn")
@ApiModelProperty(value = "机场sn")
private String sn;
@JsonProperty("camera_index")
@ApiModelProperty(value = "相机索引")
@NotBlank(message = "相机索引不能为空")
private String camera_index;
@JsonProperty("lens_type")
@ApiModelProperty(value = "镜头类型 wide:广角镜头 zoom:变焦镜头 ir:红外镜头")
@NotBlank(message = "镜头位置不能为空")
private String lens_type;
}

View File

@@ -0,0 +1,19 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class DroneCommandReq extends DroneDeviceReq{
@NotBlank(message = "机场sn不能为空")
@JsonProperty("deviceSn")
@ApiModelProperty(value = "机场sn")
private String deviceSn;
@JsonProperty("device_command")
@ApiModelProperty(value = "指令类型 return_home:返航 return_specific_home:蛙跳任务指定目标机场返航 return_home_cancel:取消返航 flighttask_pause:飞行任务暂停 flighttask_recovery:飞行任务恢复")
@NotBlank(message = "指令不能为空")
private String device_command;
}

View File

@@ -0,0 +1,21 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
public class DroneControlObtainReq extends DroneDeviceReq {
@NotBlank(message = "无人机sn不能为空")
@JsonProperty("drone_sn")
@ApiModelProperty(value = "无人机sn")
private String drone_sn;
@NotNull(message = "负载索引不能为空")
@JsonProperty("payload_index")
@ApiModelProperty(value = "负载的索引此参数可通过获取设备列表中data.list.drone.camera_list.camera_index传入。")
private List<String> payload_index;
}

View File

@@ -0,0 +1,27 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
public class DroneControlObtainReqV2 extends DroneDeviceReq{
@NotBlank(message = "无人机sn不能为空")
@JsonProperty("drone_sn")
@ApiModelProperty(value = "无人机sn")
private String drone_sn;
@NotNull(message = "负载索引不能为空")
@JsonProperty("control_keys")
@ApiModelProperty(value = "请求的控制权限列表flight-飞行控制权 payload_{产品负载类型key} -产品负载类型key对应负载的控制权例如payload_98-0-0此参数可通过获取设备列表中data.list.drone.camera_list.camera_index传入。")
private List<String> control_keys;
@ApiModelProperty(value = "控制权获取或释放 true 控制 false释放")
@JsonProperty("obtain_or_release")
private Boolean obtainOrRelease = true;
@JsonProperty("gateway_sn")
@ApiModelProperty(value = "网关设备SN (可选用于指定控制的网关设备例如DJI Dock SN)")
private String gateway_sn;
}

View File

@@ -0,0 +1,14 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class DroneControlStatusReq extends DroneDeviceReq{
@JsonProperty("drone_sn_list")
@ApiModelProperty(value = "无人机sn列表")
private List<String> drone_sn_list;
}

View File

@@ -0,0 +1,15 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class DroneDeviceReq {
@JsonProperty("uuid")
@ApiModelProperty(value = "设备uuid 项目列表下的uuid")
@NotBlank(message = "设备uuid不能为空")
private String uuid;
}

View File

@@ -0,0 +1,7 @@
package com.ltgk.smartFishingPort.domain.vo;
import lombok.Data;
@Data
public class DroneDeviceVo {
}

View File

@@ -0,0 +1,60 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data
public class DroneOneTouchTakeoffReq extends DroneDeviceReq{
@ApiModelProperty(value = "指点飞行高度")
@JsonProperty("commander_flight_height")
private Integer commander_flight_height;
@ApiModelProperty(value = "指点飞行模式")
@JsonProperty("commander_flight_mode")
private Integer commander_flight_mode;
@ApiModelProperty(value = "机场设备SN")
@JsonProperty("device_sn")
@NotBlank(message = "设备SN不能为空")
private String device_sn;
@ApiModelProperty(value = "最大速度")
@JsonProperty("max_speed")
@NotNull(message = "最大速度不能为空")
private Integer max_speed;
@ApiModelProperty(value = "媒体文件夹名称")
@JsonProperty("media_folder_name")
@NotBlank(message = "媒体文件夹名称不能为空")
private String media_folder_name;
@ApiModelProperty(value = "失控动作Hover ReturnHome Continue")
@JsonProperty("out_of_control_action")
@NotBlank(message = "失控动作不能为空")
private String out_of_control_action;
@ApiModelProperty(value = "返航高度 >= 15 <= 1500")
@NotNull(message = "返航高度不能为空")
@JsonProperty("rth_altitude")
private Integer rth_altitude;
@ApiModelProperty(value = "返航模式 0:智能高度 1:设定高度")
@JsonProperty("rth_mode")
private Integer rth_mode;
@ApiModelProperty(value = "安全起飞高度 >= 8 <= 1500")
@NotNull(message = "安全起飞高度不能为空")
@JsonProperty("security_takeoff_height")
private Integer security_takeoff_height;
@ApiModelProperty(value = "起飞模式 Takeoff TakeoffWithFlyTo")
@JsonProperty("takeoff_mode")
@NotBlank(message = "起飞模式不能为空")
private String takeoff_mode;
@ApiModelProperty(value = "目标高度 >= 2 <= 10000")
@NotNull(message = "目标高度不能为空")
@JsonProperty("target_height")
private double target_height;
@ApiModelProperty(value = "机场纬度")
@JsonProperty("target_latitude")
private double target_latitude;
@ApiModelProperty(value = "机场经度")
@JsonProperty("target_longitude")
private double target_longitude;
}

View File

@@ -0,0 +1,42 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ltgk.smartFishingPort.domain.drone.ProjectRespDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class DroneProjectVO {
@JsonProperty("name")
@ApiModelProperty(value = "项目名称")
private String name;
@JsonProperty("introduction")
@ApiModelProperty(value = "项目简介")
private String introduction;
@JsonProperty("uuid")
@ApiModelProperty(value = "项目uuid")
private String uuid;
@JsonProperty("org_uuid")
@ApiModelProperty(value = "组织uuid")
private String org_uuid;
@JsonProperty("createdAt")
@ApiModelProperty(value = "创建时间")
private Date createdAt;
@JsonProperty("updatedAt")
@ApiModelProperty(value = "更新时间")
private Date updatedAt;
@JsonProperty("work_center_point")
@ApiModelProperty(value = "项目作业中心点")
private ProjectRespDto.ProjectWorkCenterPoint projectWorkCenterPoint;
@Data
public static class ProjectWorkCenterPoint{
@JsonProperty("latitude")
@ApiModelProperty(value = "项目作业中心点的纬度")
private String latitude;
@JsonProperty("longitude")
@ApiModelProperty(value = "项目作业中心点的经度")
private String longitude;
}
}

View File

@@ -0,0 +1,18 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 无人机系统状态
*/
@Data
public class DroneSystemStatusVO {
@JsonProperty("code")
@ApiModelProperty(value = "非0表示异常")
private Integer code;
@JsonProperty("message")
@ApiModelProperty(value = "消息提示")
private String message;
}

View File

@@ -0,0 +1,61 @@
package com.ltgk.smartFishingPort.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class DsDynamicLkdVO {
@ApiModelProperty("目标来源 1雷达2ais")
public Integer source;
@ApiModelProperty("目标源id 目标在设备端的唯一标识")
public String targetSourceId;
public String mmsi;
@ApiModelProperty("DPL_ID 站点编号0~255")
public Integer stationNumber;
@ApiModelProperty("设备id 设备唯一ID号")
public Integer deviceId;
@ApiModelProperty("当前系统时间格式yyyy-MM-dd hh:mm:ss.ms")
public String time;
@ApiModelProperty("时间 当前系统时间格式yyyy-MM-dd hh:mm:ss.ms")
public Date locationTime;
@ApiModelProperty("存在标识 0目标消失1目标存在 2外推")
public Integer exist;
@ApiModelProperty("目标类型 -1:未知其他,0:大船,1:中型船,2:小船,10:行人,20:无人机,30:汽车")
public Integer type;
@ApiModelProperty("目标名:船名")
public String name;
@ApiModelProperty("长度 目标长度,单位:米(m)")
public Double length;
@ApiModelProperty("宽度 目标宽度,单位:米(m)")
public Double width;
@ApiModelProperty(" 质量等级 默认无1~255质量等级由低到高。")
public Integer level;
@ApiModelProperty("方位 目标所在方位(相对设备),单位:度(°)")
public Double azimuth;
@ApiModelProperty("距离 目标和设备之间的距离,单位:米(m)")
public Double distance;
@ApiModelProperty("纬度 目标所在的纬度,单位:度(°)")
public Double latitude;
@ApiModelProperty("经度 目标所在的经度,单位:度(°)")
public Double longitude;
@ApiModelProperty("径向速度 目标相对设备的径向速度,单位:米/秒(m/s)。")
public Double radialVelocity;
@ApiModelProperty("仰角 目标相对设备的仰角,单位:度(°)")
public Double elevation;
@ApiModelProperty("航向 目标的绝对航向0-360°单位度(°)")
public Double course;
@ApiModelProperty("航速 目标的实际速度m/s")
public Double speed;
@ApiModelProperty(" 高度 目标相对设备的高度,单位:米(m)")
public Double altitude;
@ApiModelProperty(" 幅度目标幅度单位分贝dB")
public Double amplitude;
@ApiModelProperty(" 噪声 目标噪声,单位:分贝(dB)")
public Double noise;
}

View File

@@ -0,0 +1,33 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data
public class GetDroneTaskListReq extends DroneDeviceReq{
@JsonProperty("sn")
@ApiModelProperty("设备SN")
@NotBlank(message = "设备SN不能为空")
private String sn;
@JsonProperty("name")
@ApiModelProperty("任务名称")
private String name;
@JsonProperty("begin_at")
@NotNull(message = "任务开始时间戳不能为空")
@ApiModelProperty("任务开始时间戳")
private Long begin_at;
@JsonProperty("end_at")
@NotNull(message = "任务结束时间戳不能为空")
@ApiModelProperty("任务结束时间戳")
private Long end_at;
@JsonProperty("task_type")
@ApiModelProperty("任务类型immediate:立即任务timed:单次定时任务recurring:重复任务continuous:连续任务,非必填,不填写则为全部类型")
private String task_type;
@JsonProperty("status")
@ApiModelProperty("任务状态数组waiting:待开始,starting_failure启动失败,executing执行中,paused 暂停,terminated终止,success成功,suspended挂起,timeout超时非必填不填写则为全部状态")
private String status;
}

View File

@@ -0,0 +1,12 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class GetDroneWayLineDetailReq extends DroneDeviceReq{
@JsonProperty("wayLineId")
@ApiModelProperty("航线ID")
private String wayLineId;
}

View File

@@ -0,0 +1,31 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class GetVideoStreamReq {
@JsonProperty("sn")
@ApiModelProperty(value = "无人机SN")
@NotBlank(message = "sn不能为空")
private String sn;
@JsonProperty("task_id")
@ApiModelProperty(value = "任务ID")
private String task_id;
@JsonProperty("status")
@ApiModelProperty(value = "算法开关填写start或者stop, 开启算法检测或关闭算法检测")
private String status;
@JsonProperty("class_codes")
@ApiModelProperty(value = "算法类别识别码,支持多个,以逗号分隔,参见识别编码统一说明")
private String class_codes;
@JsonProperty("enable_orc")
@ApiModelProperty(value = "开启算法orc识别")
private Boolean enable_orc = false;
}

View File

@@ -0,0 +1,24 @@
package com.ltgk.smartFishingPort.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 13:23
* Description:
*/
@Data
public class IdentityRateVO implements Serializable {
@ApiModelProperty("全部数量")
private Integer totalCount;
@ApiModelProperty("已识别数量")
private Integer identityCount;
@ApiModelProperty("识别率")
private String rate;
}

View File

@@ -0,0 +1,42 @@
package com.ltgk.smartFishingPort.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 13:48
* Description:
*/
@Data
public class PortIdentityTotalVO implements Serializable {
@ApiModelProperty("船名识别数量")
private Integer boatNameIdentityCount;
@ApiModelProperty("船型识别数量")
private Integer boatTypeIdentityCount;
@ApiModelProperty("未封舱预警数量")
private Integer notCloseDoorCount;
@ApiModelProperty("未穿救生衣数量")
private Integer notWearSafeCount;
@ApiModelProperty("横越/偏航预警数量")
private Integer crossLineCount;
@ApiModelProperty("吃水线预警")
private Integer draftCount;
public PortIdentityTotalVO(Integer boatNameIdentityCount,Integer boatTypeIdentityCount,Integer notCloseDoorCount,Integer notWearSafeCount,Integer crossLineCount,Integer draftCount) {
this.boatNameIdentityCount = boatNameIdentityCount;
this.boatTypeIdentityCount = boatTypeIdentityCount;
this.notCloseDoorCount = notCloseDoorCount;
this.notWearSafeCount = notWearSafeCount;
this.crossLineCount = crossLineCount;
this.draftCount = draftCount;
}
}

View File

@@ -0,0 +1,22 @@
package com.ltgk.smartFishingPort.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author: wss
* @Date 2025/5/6 22:54
* Description:
*/
@Data
public class PortTrendVO implements Serializable {
@ApiModelProperty("日期")
private String timeStr;
@ApiModelProperty("数量")
private long count;
}

View File

@@ -0,0 +1,28 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data
public class StartLiveReq extends DroneDeviceReq {
@JsonProperty("sn")
@ApiModelProperty(value = "设备sn")
@NotBlank(message = "设备sn不能为空")
private String sn;
@JsonProperty("camera_index")
@ApiModelProperty(value = "设备camera_index camera_index 信息可通过获取组织下的设备列表接口下的 data.list.drone.camera_list 中获取。")
@NotBlank(message = "设备camera_index不能为空")
private String camera_index;
@JsonProperty("video_expire")
@ApiModelProperty(value = "直播推流Token有效期超过这个有限期直播将中止。")
@NotNull(message = "直播推流Token有效期不能为空")
private Integer video_expire;
@JsonProperty("quality_type")
@ApiModelProperty(value = "直播清晰度 adaptive:自动 smooth:流畅 ultra_high_definition:超清")
@NotBlank(message = "直播清晰度不能为空")
private String quality_type;
}

View File

@@ -0,0 +1,45 @@
package com.ltgk.smartFishingPort.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 13:57
* Description:
*/
@Data
public class UAVIdentityTotalVO implements Serializable {
@ApiModelProperty("船名识别数量")
private Integer boatNameIdentityCount;
@ApiModelProperty("船型识别数量")
private Integer boatTypeIdentityCount;
@ApiModelProperty("危险品旗帜标识数量")
private Integer dangerSignCount;
@ApiModelProperty("未悬挂国旗数量")
private Integer notCountrySignCount;
@ApiModelProperty("航线偏离预警数量")
private Integer crossLineCount;
@ApiModelProperty("超速预警数量")
private Integer outSpeedCount;
@ApiModelProperty("异常停靠预警数量")
private Integer notNormalBerthCount;
@ApiModelProperty("人员落水协助预警")
private Integer dropCount;
@ApiModelProperty("船舶火灾预警数量")
private Integer fireCount;
@ApiModelProperty("船舶漏油预警数量")
private Integer oilCount;
}

View File

@@ -0,0 +1,21 @@
package com.ltgk.smartFishingPort.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 13:44
* Description:
*/
@Data
public class UAVOperateCountVO implements Serializable {
@ApiModelProperty("手动执行次数")
private Integer operateCount;
@ApiModelProperty("自动执行次数")
private Integer autoCount;
}

View File

@@ -0,0 +1,19 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class UpdateDroneTaskStatusReq extends DroneDeviceReq{
@JsonProperty("task_uuid")
@ApiModelProperty(value = "任务id")
@NotBlank(message = "任务id不能为空")
private String task_uuid;
@JsonProperty("status")
@ApiModelProperty(value = "任务状态")
@NotBlank(message = "任务状态不能为空suspended:任务挂起 restored:任务恢复")
private String status;
}

View File

@@ -0,0 +1,82 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ltgk.smartFishingPort.utils.DateTimeConverter;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class VideoIdentificationVo implements Serializable {
private static final long serialVersionUID=1L;
@ExcelProperty(value = "摄像头名称")
@ApiModelProperty(value = "摄像头名称")
@TableField(value = "video_name",condition = SqlCondition.LIKE)
private String videoName;
@ExcelProperty(value = "抓拍时间", converter = DateTimeConverter.class)
@ApiModelProperty(value = "抓拍时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date takeTime;
@ExcelProperty(value = "所属港口")
@ApiModelProperty(value = "所属港口")
@TableField(value = "belong_port",condition = SqlCondition.LIKE)
private String belongPort;
@ExcelProperty(value = "船舶类型")
@ApiModelProperty(value = "船舶类型")
private String shipType;
@ExcelProperty(value = "船只长度")
@ApiModelProperty("船只长度")
private BigDecimal length;
@ExcelProperty(value = "船只高度")
@ApiModelProperty("船只高度")
private BigDecimal height;
@ExcelProperty(value = "船只速度")
@ApiModelProperty("船只速度")
private BigDecimal speed;
@ExcelProperty(value = "进出港方向")
@ApiModelProperty(value = "进出港方向(进港、出港)")
private String entryOut;
@ExcelProperty(value = "经度")
@ApiModelProperty(value="经度")
private BigDecimal longitude;
@ExcelProperty(value = "纬度")
@ApiModelProperty(value = "纬度")
private BigDecimal latitude;
@ExcelProperty(value = "救生衣状态")
@ApiModelProperty(value = "救生衣状态")
private String jacketStatus;
@ExcelProperty(value = "船舶名称")
@ApiModelProperty(value = "船舶名称")
private String boatName;
@ExcelProperty(value = "识别类型")
@ApiModelProperty(value = "识别类型(船脸识别、船牌识别)")
private String identificationType;
}

View File

@@ -0,0 +1,27 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class VideoStreamDetectSwitchReq {
@JsonProperty("sn")
@ApiModelProperty(value = "无人机SN")
@NotBlank(message = "sn不能为空")
private String sn;
@JsonProperty("task_id")
@ApiModelProperty(value = "任务ID")
private String task_id;
@JsonProperty("status")
@ApiModelProperty(value = "算法开关填写start或者stop, 开启算法检测或关闭算法检测")
private String status;
@JsonProperty("class_codes")
@ApiModelProperty(value = "算法类别识别码,支持多个,以逗号分隔,参见识别编码统一说明")
private String class_codes;
@JsonProperty("enable_orc")
@ApiModelProperty(value = "开启算法orc识别")
private Boolean enable_orc = true;
}

View File

@@ -0,0 +1,15 @@
package com.ltgk.smartFishingPort.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class VideoStreamDetectSwitchResp {
@JsonProperty("httpUrl")
@ApiModelProperty(value = "直播流地址")
private String httpUrl;
@JsonProperty("taskId")
@ApiModelProperty(value = "任务ID")
private String taskId;
}

View File

@@ -0,0 +1,34 @@
package com.ltgk.smartFishingPort.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 14:26
* Description:
*/
@Data
public class WaterwayVelocityVO implements Serializable {
@ApiModelProperty("深度观测站编号")
private Integer deepSiteCode;
@ApiModelProperty("雷达流量")
private Integer radarVelocity;
@ApiModelProperty("雷达水位")
private Integer radarLevel;
@ApiModelProperty("压力式水位")
private Integer pressureLevel;
@ApiModelProperty("温度")
private Integer temperature;
@ApiModelProperty("倾角")
private Integer angle;
}

View File

@@ -0,0 +1,40 @@
package com.ltgk.smartFishingPort.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 14:45
* Description:
*/
@Data
public class WaterwayWeatherVO implements Serializable {
@ApiModelProperty("气象观测站编号")
private Integer deepSiteCode;
@ApiModelProperty("温度")
private Integer temperature;
@ApiModelProperty("湿度")
private Integer humidity;
@ApiModelProperty("风速")
private Integer windSpeed;
@ApiModelProperty("风向")
private Integer windDirect;
@ApiModelProperty("大气压")
private Integer pressure;
@ApiModelProperty("降水量")
private Integer rainFall;
@ApiModelProperty("光照度")
private Integer illuminance;
}

View File

@@ -0,0 +1,14 @@
package com.ltgk.smartFishingPort.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltgk.smartFishingPort.domain.entity.BoatData;
import org.springframework.stereotype.Repository;
/**
* @Author: zhouyaoyao
* @Date 2025/6/10 17:53
* Description:
*/
@Repository
public interface BoatDataMapper extends BaseMapper<BoatData> {
}

View File

@@ -0,0 +1,14 @@
package com.ltgk.smartFishingPort.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltgk.smartFishingPort.domain.entity.BoatDynamic;
import org.springframework.stereotype.Repository;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 15:56
* Description:
*/
@Repository
public interface BoatDynamicMapper extends BaseMapper<BoatDynamic> {
}

View File

@@ -0,0 +1,14 @@
package com.ltgk.smartFishingPort.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltgk.smartFishingPort.domain.entity.BoatPath;
import org.springframework.stereotype.Repository;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 15:59
* Description:
*/
@Repository
public interface BoatPathMapper extends BaseMapper<BoatPath> {
}

View File

@@ -0,0 +1,16 @@
package com.ltgk.smartFishingPort.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltgk.smartFishingPort.domain.entity.DsVideo;
/**
* <p>
* 视频监控管理表 Mapper 接口
* </p>
*
* @author zhouyaoyao
* @since 2025-01-19
*/
public interface DsVideoMapper extends BaseMapper<DsVideo> {
}

View File

@@ -0,0 +1,14 @@
package com.ltgk.smartFishingPort.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltgk.smartFishingPort.domain.entity.EmergencyRescue;
import org.springframework.stereotype.Repository;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 15:55
* Description:
*/
@Repository
public interface EmergencyRescueMapper extends BaseMapper<EmergencyRescue> {
}

View File

@@ -0,0 +1,14 @@
package com.ltgk.smartFishingPort.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltgk.smartFishingPort.domain.entity.EnvEquipment;
import org.springframework.stereotype.Repository;
/**
* @Author: zhouyaoyao
* @Date 2025/9/28 17:31
* Description:
*/
@Repository
public interface EnvEquipmentMapper extends BaseMapper<EnvEquipment> {
}

View File

@@ -0,0 +1,14 @@
package com.ltgk.smartFishingPort.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltgk.smartFishingPort.domain.entity.UavEquipment;
import org.springframework.stereotype.Repository;
/**
* @Author: zhouyaoyao
* @Date 2025/9/28 17:32
* Description:
*/
@Repository
public interface UavEquipmentMapper extends BaseMapper<UavEquipment> {
}

View File

@@ -0,0 +1,16 @@
package com.ltgk.smartFishingPort.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltgk.smartFishingPort.domain.entity.VideoCamera;
/**
* <p>
* 监控设备表 Mapper 接口
* </p>
*
* @author zhou
* @since 2024-12-16
*/
public interface VideoCameraMapper extends BaseMapper<VideoCamera> {
}

View File

@@ -0,0 +1,16 @@
package com.ltgk.smartFishingPort.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltgk.smartFishingPort.domain.entity.VideoIdentification;
/**
* <p>
* 监控识别记录表 Mapper 接口
* </p>
*
* @author zhou
* @since 2024-12-10
*/
public interface VideoIdentificationMapper extends BaseMapper<VideoIdentification> {
}

View File

@@ -0,0 +1,63 @@
package com.ltgk.smartFishingPort.service;
import com.ltgk.smartFishingPort.common.core.domain.Response;
import com.ltgk.smartFishingPort.domain.drone.*;
import com.ltgk.smartFishingPort.domain.vo.*;
import java.util.List;
/**
* @author liutailin
* @description 无人机模块
* @date 2019-06-02 9:06.
*/
public interface DroneService {
Response<DroneSystemStatusVO> getDroneSystemStatus();
Response<List<DroneProjectVO>> getDroneProject();
Response<List<DeviceRespDto>> getDroneDevice(DroneDeviceReq req);
Response<DroneSystemStatusVO> droneCommand(DroneCommandReq req);
Response<DroneSystemStatusVO> airportCameraSwitch(AirportCameraSwitchReq req);
Response<DroneSystemStatusVO> droneCameraSwitch(DroneCameraSwitchReq req);
Response<DroneControlObtainRespDto> droneControlObtain(DroneControlObtainReq req);
Response<DroneControlObtainRespDto> droneControlRelease(DroneControlObtainReq req);
Response<List<DroneWayLineRespDto>> getDroneWayLine(DroneDeviceReq req);
Response<DroneWayLineDetailRespDto> getDroneWayLineDetail(GetDroneWayLineDetailReq req);
Response<DroneSystemStatusVO> createDroneTask(CreateDroneTaskReq req);
Response<StartLiveReqRespDto> startLive(StartLiveReq req);
Response<DroneSystemStatusVO> updateDroneTaskStatus(UpdateDroneTaskStatusReq req);
Response<List<DroneTaskRespDto>> getDroneTaskList(GetDroneTaskListReq req);
Response<DroneOneTouchTakeoffRespDto> droneOneTouchTakeoff(DroneOneTouchTakeoffReq req);
Response<DroneControlObtainRespV2Dto> droneControlObtainV2(DroneControlObtainReqV2 req);
Response<List<DroneControlObtainRespV2Dto>> droneControlStatus(DroneControlStatusReq req);
Response videoStreamDetectSwitch(VideoStreamDetectSwitchReq req);
/**
* 获取视频流地址:
*
* @param req:
* @return ltgk.pm.video.base.Response<ltgk.pm.video.domain.vo.VideoStreamDetectSwitchResp>
* @author Qi ChengBin
* @date 2025/11/27
*/
Response<VideoStreamDetectSwitchResp> getVideoStream(GetVideoStreamReq req);
Response<VideoStreamDetectSwitchResp> doStartOrStopUavAlgorithm(GetVideoStreamReq req);
}

View File

@@ -0,0 +1,25 @@
package com.ltgk.smartFishingPort.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ltgk.smartFishingPort.domain.entity.BoatData;
/**
* @Author: zhouyaoyao
* @Date 2025/6/10 17:54
* Description:
*/
public interface IBoatDataService extends IService<BoatData> {
IPage<BoatData> selectByPage(BoatData boatData);
/**
* 根据经纬度获取AIS数据中距离最近的点位且更新时间为±1分钟之内的数据
*
* @param longitude经度
* @param latitude维度
* @return ltgk.pm.video.base.Response
* @author Qi ChengBin
* @date 2025/12/2
*/
Object getNearestAisData(String longitude, String latitude);
}

View File

@@ -0,0 +1,12 @@
package com.ltgk.smartFishingPort.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ltgk.smartFishingPort.domain.entity.BoatDynamic;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 16:06
* Description:
*/
public interface IBoatDynamicService extends IService<BoatDynamic> {
}

View File

@@ -0,0 +1,12 @@
package com.ltgk.smartFishingPort.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ltgk.smartFishingPort.domain.entity.BoatPath;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 16:00
* Description:
*/
public interface IBoatPathService extends IService<BoatPath> {
}

View File

@@ -0,0 +1,58 @@
package com.ltgk.smartFishingPort.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ltgk.smartFishingPort.common.core.domain.AjaxResult;
import com.ltgk.smartFishingPort.domain.entity.DsVideo;
import java.util.List;
/**
* <p>
* 视频监控管理表 服务类
* </p>
*
* @author zhouyaoyao
* @since 2025-01-19
*/
public interface IDsVideoService extends IService<DsVideo> {
/**
* 分页查询
* @param dsVideo
* @return
*/
IPage<DsVideo> selectByPage(DsVideo dsVideo);
/**
* 根据视频监控设备名称批量添加更新
* @param dsVideos
* @return
*/
boolean saveBatchByName(List<DsVideo> dsVideos);
/**
* 光电随动控制
* @param msg
* @return
*/
boolean servoByRadar(String msg);
/**
* 光电联动反向定位联动控制,根据监控设备和将要联动的定位目标经纬度控制视频监控设备转动对焦
*
* @return
*/
AjaxResult sitMoveByGps(String deviceCode, String gpsX, String gpsY);
DsVideo getVideoInfo(DsVideo dsVideo);
/**
* 更新摄像头可视范围字段状态,并获取所有的开启了可视摄像头范围的相关数据
* @author Qi ChengBin
* @param dsVideo需开启摄像头可视范围的相关摄像头数据
* @return com.yuhuan.common.core.domain.AjaxResult
* @date 2025/9/15
*/
List<DsVideo> updateOneAndFindVideoInfoList(DsVideo dsVideo);
}

View File

@@ -0,0 +1,14 @@
package com.ltgk.smartFishingPort.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ltgk.smartFishingPort.domain.entity.EmergencyRescue;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 16:08
* Description:
*/
public interface IEmergencyRescueService extends IService<EmergencyRescue> {
IPage<EmergencyRescue> selectByPage(EmergencyRescue boatData);
}

View File

@@ -0,0 +1,34 @@
package com.ltgk.smartFishingPort.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ltgk.smartFishingPort.domain.entity.VideoCamera;
/**
* <p>
* 监控设备表 服务类
* </p>
*
* @author zhou
* @since 2024-12-16
*/
public interface IVideoCameraService extends IService<VideoCamera> {
/**
* 分页查询
* @param videoCamera
* @param pageNo
* @param pageSize
* @return
*/
IPage<VideoCamera> findPage(VideoCamera videoCamera, Integer pageNo, Integer pageSize);
Object loginDH(String mStrIp, String mNPort, String mStrUser, String mStrPassword);
Boolean attachTraffic(Long loginHandler, Integer channelId);
Boolean attachAlarmChanDHByAccount(String videoIp, String videoPort, String videoAccount, String videoPass, String channelId);
Boolean attachAlarmChanHKByAccount(String videoIp, String videoPort, String videoAccount, String videoPass);
IPage<VideoCamera> selectByPage(VideoCamera videoCamera);
}

View File

@@ -0,0 +1,19 @@
package com.ltgk.smartFishingPort.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ltgk.smartFishingPort.domain.dto.VideoIdentificationDto;
import com.ltgk.smartFishingPort.domain.entity.VideoIdentification;
/**
* <p>
* 监控识别记录表 服务类
* </p>
*
* @author zhou
* @since 2024-12-10
*/
public interface IVideoIdentificationService extends IService<VideoIdentification> {
IPage<VideoIdentification> findByPage(VideoIdentificationDto videoIdentificationDto);
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,128 @@
package com.ltgk.smartFishingPort.service.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ltgk.smartFishingPort.common.core.redis.RedisCache;
import com.ltgk.smartFishingPort.common.utils.MybatisUtil;
import com.ltgk.smartFishingPort.domain.dto.BoatDynamicDto;
import com.ltgk.smartFishingPort.domain.entity.BoatData;
import com.ltgk.smartFishingPort.domain.vo.CurrentAisDynamicVO;
import com.ltgk.smartFishingPort.mapper.BoatDataMapper;
import com.ltgk.smartFishingPort.service.IBoatDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @Author: zhouyaoyao
* @Date 2025/6/10 17:54
* Description:
*/
@Service
@Slf4j
public class BoatDataServiceImpl extends ServiceImpl<BoatDataMapper, BoatData> implements IBoatDataService {
@Resource
private RedisCache redisUtils;
@Override
public IPage<BoatData> selectByPage(BoatData boatData) {
int pageNum = Objects.isNull(boatData.getPageNum()) ? 1 : boatData.getPageNum();
int pageSize = Objects.isNull(boatData.getPageSize()) ? 15 : boatData.getPageSize();
IPage<BoatData> page = new Page<>(pageNum, pageSize);
LambdaQueryWrapper<BoatData> lambdaQueryWrapper = MybatisUtil.notNullField(boatData).lambda();
lambdaQueryWrapper.orderByDesc(BoatData::getUpdateTime);
return baseMapper.selectPage(page, lambdaQueryWrapper);
}
/**
* 根据经纬度获取AIS数据中距离最近的点位且更新时间为±1分钟之内的数据
*
* @param longitude经度
* @param latitude维度
* @return ltgk.pm.video.base.Response
* @author Qi ChengBin
* @date 2025/12/2
*/
@Override
public Object getNearestAisData(String longitude, String latitude) {
DateTime startTime = DateUtil.date();
List<Object> objList = redisUtils.getMByScript("ais-collect-name:*");
DateTime entTime = DateUtil.date();
log.info("keys * 查询redis 耗时:{} s", (entTime.getTime() - startTime.getTime()) / 1000);
// 不为空的情况下继续执行
if (!Objects.isNull(objList) && CollectionUtils.isNotEmpty(objList)) {
// 2. 计算筛选时间范围:当前时间 ±5 分钟
DateTime now = DateUtil.date(); // 当前时间Hutool封装等价于 new Date(),线程安全)
DateTime fiveMinAgo = DateUtil.offsetMinute(now, -1); // 左边界5分钟前
DateTime fiveMinLater = DateUtil.offsetMinute(now, 1); // 右边界5分钟后
// 获取并且定位时间在 ± 5分钟之内的数据
List<CurrentAisDynamicVO> list = objList.stream().map(m -> {
BoatDynamicDto boatDynamicDto = JSONObject.parseObject(m.toString(), BoatDynamicDto.class);
return new CurrentAisDynamicVO()
.setShipPlate(boatDynamicDto.getBoatName())
.setBoatName(boatDynamicDto.getBoatNameEn())
.setMmsi(boatDynamicDto.getTerminalCode())
.setAisStatus("已开启")
.setSog(boatDynamicDto.getSog())
.setCog(boatDynamicDto.getCog())
.setLatitude(boatDynamicDto.getLatitude())
.setLongitude(boatDynamicDto.getLongitude())
.setDataSource(boatDynamicDto.getDataSource())
.setGpsTime(boatDynamicDto.getGpsTime());
// }).filter(f -> "YingJue".equals(f.getDataSource()) && DateUtil.isIn(f.getGpsTime(), fiveMinAgo, fiveMinLater))
}).filter(f -> DateUtil.isIn(f.getGpsTime(), fiveMinAgo, fiveMinLater))
.collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(list)) {
double targetLon = Double.parseDouble(longitude);
double targetLat = Double.parseDouble(latitude);
// List<CurrentAisDynamicVO> collect = list.stream()
// .filter(vo -> calculateDistance(targetLon, targetLat, vo.getLongitude(), vo.getLatitude()) <= 11.1)
// .collect(Collectors.toList());
return list.stream()
.min((vo1, vo2) -> {
double dist1 = calculateDistance(targetLon, targetLat, vo1.getLongitude(), vo1.getLatitude());
double dist2 = calculateDistance(targetLon, targetLat, vo2.getLongitude(), vo2.getLatitude());
return Double.compare(dist1, dist2);
})
.orElse(null);
}
}
return null;
}
/**
* 使用 Haversine 公式计算两个经纬度坐标之间的距离(单位:米)
*
* @param lon1 经度1
* @param lat1 纬度1
* @param lon2 经度2
* @param lat2 纬度2
* @return 距离(米)
*/
private double calculateDistance(double lon1, double lat1, double lon2, double lat2) {
final int R = 6371; // 地球半径(千米)
double dLat = Math.toRadians(lat2 - lat1);
double dLon = Math.toRadians(lon2 - lon1);
double a = Math.sin(dLat / 2) * Math.sin(dLat / 2)
+ Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2))
* Math.sin(dLon / 2) * Math.sin(dLon / 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
return R * c * 1000; // 返回米
}
}

View File

@@ -0,0 +1,16 @@
package com.ltgk.smartFishingPort.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ltgk.smartFishingPort.domain.entity.BoatDynamic;
import com.ltgk.smartFishingPort.mapper.BoatDynamicMapper;
import com.ltgk.smartFishingPort.service.IBoatDynamicService;
import org.springframework.stereotype.Service;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 16:07
* Description:
*/
@Service
public class BoatDynamicServiceImpl extends ServiceImpl<BoatDynamicMapper, BoatDynamic> implements IBoatDynamicService {
}

View File

@@ -0,0 +1,16 @@
package com.ltgk.smartFishingPort.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ltgk.smartFishingPort.domain.entity.BoatPath;
import com.ltgk.smartFishingPort.mapper.BoatPathMapper;
import com.ltgk.smartFishingPort.service.IBoatPathService;
import org.springframework.stereotype.Service;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 16:01
* Description:
*/
@Service
public class BoatPathServiceImpl extends ServiceImpl<BoatPathMapper, BoatPath> implements IBoatPathService {
}

View File

@@ -0,0 +1,456 @@
package com.ltgk.smartFishingPort.service.impl;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.TypeReference;
import com.ltgk.smartFishingPort.common.DroneClientCommon;
import com.ltgk.smartFishingPort.common.DroneResponseBase;
import com.ltgk.smartFishingPort.common.constant.DroneConstruct;
import com.ltgk.smartFishingPort.common.core.domain.Response;
import com.ltgk.smartFishingPort.common.core.redis.RedisCache;
import com.ltgk.smartFishingPort.common.enums.ClassCodes;
import com.ltgk.smartFishingPort.common.enums.DroneToRtmp;
import com.ltgk.smartFishingPort.common.utils.StringUtils;
import com.ltgk.smartFishingPort.domain.drone.*;
import com.ltgk.smartFishingPort.domain.vo.*;
import com.ltgk.smartFishingPort.service.DroneService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
/**
* @author liutailin
* @description 无人机模块
* @date 2019-06-02 9:06.
*/
@Slf4j
@Service
public class DroneServiceImpl implements DroneService {
@Autowired
private DroneClientCommon droneClientCommon;
@Resource
private RedisCache redisUtils;
private final String UAV_VIDEO_STREAM_TASK_ID = "uav:videoStream:taskId:";
/**
* 获取司空系统状态
*
* @return
*/
@Override
public Response<DroneSystemStatusVO> getDroneSystemStatus() {
DroneResponseBase resp = droneClientCommon.getDroneSystemStatus();
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
DroneSystemStatusVO droneSystemStatusVO = new DroneSystemStatusVO();
droneSystemStatusVO.setCode(resp.getCode());
droneSystemStatusVO.setMessage(resp.getMessage());
return Response.ok(droneSystemStatusVO);
}
/**
* 获取项目列表
*
* @return
*/
@Override
public Response<List<DroneProjectVO>> getDroneProject() {
String respStr = droneClientCommon.sendDroneGetRequest(DroneConstruct.PROJECT, null, null);
DroneResponseBase<DroneResponseListBase<ProjectRespDto>> resp = JSON.parseObject(respStr, new TypeReference<DroneResponseBase<DroneResponseListBase<ProjectRespDto>>>() {
});
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
List<DroneProjectVO> result = new ArrayList<>();
resp.getData().getList().forEach(projectRespDto -> {
DroneProjectVO droneProjectVO = new DroneProjectVO();
BeanUtils.copyProperties(projectRespDto, droneProjectVO);
droneProjectVO.setCreatedAt(new Date(projectRespDto.getCreatedAt()));
droneProjectVO.setUpdatedAt(new Date(projectRespDto.getUpdatedAt()));
result.add(droneProjectVO);
});
return Response.ok(result);
}
/**
* 获取设备列表
*
* @param req
* @return
*/
@Override
public Response<List<DeviceRespDto>> getDroneDevice(DroneDeviceReq req) {
String respStr = droneClientCommon.sendDroneGetRequest(DroneConstruct.DEVICE, null, req.getUuid());
DroneResponseBase<DroneResponseListBase<DeviceRespDto>> resp = JSON.parseObject(respStr, new TypeReference<DroneResponseBase<DroneResponseListBase<DeviceRespDto>>>() {
});
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
return Response.ok(resp.getData().getList());
}
/**
* 给设备发送指令
*
* @param req
* @return
*/
@Override
public Response<DroneSystemStatusVO> droneCommand(DroneCommandReq req) {
String respStr = droneClientCommon.sendDronePostRequest(DroneConstruct.COMMAND.replace("$command", req.getDeviceSn()), JSONUtil.toJsonStr(req), req.getUuid());
DroneResponseBase resp = JSON.parseObject(respStr, new TypeReference<DroneResponseBase>() {
});
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
DroneSystemStatusVO droneSystemStatusVO = new DroneSystemStatusVO();
droneSystemStatusVO.setCode(resp.getCode());
droneSystemStatusVO.setMessage(resp.getMessage());
return Response.ok(droneSystemStatusVO);
}
/**
* 机场相机切换
*
* @param req
* @return
*/
@Override
public Response<DroneSystemStatusVO> airportCameraSwitch(AirportCameraSwitchReq req) {
String respStr = droneClientCommon.sendDronePostRequest(DroneConstruct.AIRPORT_CAMERA_SWITCH, JSONUtil.toJsonStr(req), req.getUuid());
DroneResponseBase resp = JSON.parseObject(respStr, new TypeReference<DroneResponseBase>() {
});
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
DroneSystemStatusVO droneSystemStatusVO = new DroneSystemStatusVO();
droneSystemStatusVO.setCode(resp.getCode());
droneSystemStatusVO.setMessage(resp.getMessage());
return Response.ok(droneSystemStatusVO);
}
/**
* 飞行器相机切换
*
* @param req
* @return
*/
@Override
public Response<DroneSystemStatusVO> droneCameraSwitch(DroneCameraSwitchReq req) {
String respStr = droneClientCommon.sendDronePostRequest(DroneConstruct.DRONE_CAMERA_SWITCH, JSONUtil.toJsonStr(req), req.getUuid());
DroneResponseBase resp = JSON.parseObject(respStr, new TypeReference<DroneResponseBase>() {
});
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
DroneSystemStatusVO droneSystemStatusVO = new DroneSystemStatusVO();
droneSystemStatusVO.setCode(resp.getCode());
droneSystemStatusVO.setMessage(resp.getMessage());
return Response.ok(droneSystemStatusVO);
}
/**
* 获取控制权
*
* @param req
* @return
*/
@Override
public Response<DroneControlObtainRespDto> droneControlObtain(DroneControlObtainReq req) {
String respStr = droneClientCommon.sendDronePostRequest(DroneConstruct.DRONE_CONTROL_OBTAIN, JSONUtil.toJsonStr(req), req.getUuid());
DroneResponseBase<DroneControlObtainRespDto> resp = JSON.parseObject(respStr, new TypeReference<DroneResponseBase<DroneControlObtainRespDto>>() {
});
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
return Response.ok(resp.getData());
}
/**
* 释放控制权
*
* @param req
* @return
*/
@Override
public Response<DroneControlObtainRespDto> droneControlRelease(DroneControlObtainReq req) {
String respStr = droneClientCommon.sendDronePostRequest(DroneConstruct.DRONE_CONTROL_RELEASE, JSONUtil.toJsonStr(req), req.getUuid());
DroneResponseBase<DroneControlObtainRespDto> resp = JSON.parseObject(respStr, new TypeReference<DroneResponseBase<DroneControlObtainRespDto>>() {
});
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
return Response.ok(resp.getData());
}
/**
* 获取航线列表
*
* @param req
* @return
*/
@Override
public Response<List<DroneWayLineRespDto>> getDroneWayLine(DroneDeviceReq req) {
String respStr = droneClientCommon.sendDroneGetRequest(DroneConstruct.DRONE_WAY_LINE, null, req.getUuid());
DroneResponseBase<DroneResponseListBase<DroneWayLineRespDto>> resp = JSON.parseObject(respStr, new TypeReference<DroneResponseBase<DroneResponseListBase<DroneWayLineRespDto>>>() {
});
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
return Response.ok(resp.getData().getList());
}
/**
* 获取航线详情
*
* @param req
* @return
*/
@Override
public Response<DroneWayLineDetailRespDto> getDroneWayLineDetail(GetDroneWayLineDetailReq req) {
String respStr = droneClientCommon.sendDroneGetRequest(DroneConstruct.DRONE_WAY_LINE_DETAIL.replace("$waylineId", req.getWayLineId()), null, req.getUuid());
DroneResponseBase<DroneWayLineDetailRespDto> resp = JSON.parseObject(respStr, new TypeReference<DroneResponseBase<DroneWayLineDetailRespDto>>() {
});
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
return Response.ok(resp.getData());
}
/**
* 创建飞行任务
*
* @param req
* @return
*/
@Override
public Response<DroneSystemStatusVO> createDroneTask(CreateDroneTaskReq req) {
String respStr = droneClientCommon.sendDronePostRequest(DroneConstruct.CREATE_FLIGHT_TASK, JSONUtil.toJsonStr(req), req.getUuid());
DroneResponseBase<DroneSystemStatusVO> resp = JSON.parseObject(respStr, new TypeReference<DroneResponseBase<DroneSystemStatusVO>>() {
});
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
return Response.ok(resp.getData());
}
/**
* 开始直播
*
* @param req
* @return
*/
@Override
public Response<StartLiveReqRespDto> startLive(StartLiveReq req) {
String respStr = droneClientCommon.sendDronePostRequest(DroneConstruct.START_LIVE, JSONUtil.toJsonStr(req), req.getUuid());
DroneResponseBase<StartLiveReqRespDto> resp = JSON.parseObject(respStr, new TypeReference<DroneResponseBase<StartLiveReqRespDto>>() {
});
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
return Response.ok(resp.getData());
}
/**
* 更新飞行任务状态
*
* @param req
* @return
*/
@Override
public Response<DroneSystemStatusVO> updateDroneTaskStatus(UpdateDroneTaskStatusReq req) {
String respStr = droneClientCommon.sendDronePostRequest(DroneConstruct.CREATE_FLIGHT_TASK_STATUS.replace("$taskUuid", req.getTask_uuid()), JSONUtil.toJsonStr(req), req.getUuid());
DroneResponseBase<DroneSystemStatusVO> resp = JSON.parseObject(respStr, new TypeReference<DroneResponseBase<DroneSystemStatusVO>>() {
});
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
return Response.ok(resp.getData());
}
@Override
public Response<List<DroneTaskRespDto>> getDroneTaskList(GetDroneTaskListReq req) {
Map<String, Object> param = new HashMap<>();
param.put("uuid", req.getUuid());
param.put("sn", req.getSn());
param.put("name", req.getName());
param.put("begin_at", req.getBegin_at());
param.put("end_at", req.getEnd_at());
param.put("task_type", req.getTask_type());
param.put("status", req.getStatus());
String respStr = droneClientCommon.sendDroneGetRequest(DroneConstruct.GET_FLIGHT_TASK_LIST, param, req.getUuid());
DroneResponseBase<DroneResponseListBase<DroneTaskRespDto>> resp = JSON.parseObject(respStr, new TypeReference<DroneResponseBase<DroneResponseListBase<DroneTaskRespDto>>>() {
});
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
return Response.ok(resp.getData().getList());
}
@Override
public Response<DroneOneTouchTakeoffRespDto> droneOneTouchTakeoff(DroneOneTouchTakeoffReq req) {
String respStr = droneClientCommon.sendDroneOneTouchTakeoffPostRequest(DroneConstruct.ONE_TOUCH_TAKEOFF.replace("$taskUuid", req.getUuid()), JSONUtil.toJsonStr(req), req.getUuid());
DroneResponseBase<DroneOneTouchTakeoffRespDto> resp = JSON.parseObject(respStr, new TypeReference<DroneResponseBase<DroneOneTouchTakeoffRespDto>>() {
});
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
return Response.ok(resp.getData());
}
@Override
public Response<DroneControlObtainRespV2Dto> droneControlObtainV2(DroneControlObtainReqV2 req) {
String respStr = null;
if (req.getObtainOrRelease()) {
respStr = droneClientCommon.sendDroneOneTouchTakeoffPostRequest(DroneConstruct.DRONE_CONTROL_OBTAIN_V2.replace("$projUuid", req.getUuid()), JSONUtil.toJsonStr(req), req.getUuid());
} else {
respStr = droneClientCommon.sendDroneOneTouchTakeoffDeleteRequest(DroneConstruct.DRONE_CONTROL_OBTAIN_V2.replace("$projUuid", req.getUuid()), JSONUtil.toJsonStr(req), req.getUuid());
}
if (StringUtils.isBlank(respStr)) {
return Response.fail("请求失败");
}
DroneResponseBase<DroneControlObtainRespV2Dto> resp = JSON.parseObject(respStr, new TypeReference<DroneResponseBase<DroneControlObtainRespV2Dto>>() {
});
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
return Response.ok(resp.getData());
}
@Override
public Response<List<DroneControlObtainRespV2Dto>> droneControlStatus(DroneControlStatusReq req) {
Map<String, Object> map = new HashMap<>();
map.put("drone_sn_list", req.getDrone_sn_list());
String respStr = droneClientCommon.sendDroneOneTouchTakeoffGetRequest(DroneConstruct.DRONE_CONTROL_OBTAIN_V2.replace("$projUuid", req.getUuid()), map, req.getUuid());
DroneResponseBase<List<DroneControlObtainRespV2Dto>> resp = JSON.parseObject(respStr, new TypeReference<DroneResponseBase<List<DroneControlObtainRespV2Dto>>>() {
});
if (!resp.getCode().equals(0)) {
return Response.fail(resp.getMessage());
}
return Response.ok(resp.getData());
}
@Override
public Response videoStreamDetectSwitch(VideoStreamDetectSwitchReq req) {
// 检测预警算法添加
if (req.getStatus().equals("start") && ObjectUtils.isNotEmpty(DroneToRtmp.getRtmpByName(req.getSn()))) {
req.setTask_id(UUID.randomUUID().toString());
AddStreamDetectTaskReq addStreamDetectTaskReq = new AddStreamDetectTaskReq();
addStreamDetectTaskReq.setTask_id(req.getTask_id());
addStreamDetectTaskReq.setSrc_url(DroneToRtmp.getRtmpByName(req.getSn()).getSrcUrl());
addStreamDetectTaskReq.setDst_url(DroneToRtmp.getRtmpByName(req.getSn()).getDstUrl());
addStreamDetectTaskReq.setClass_codes(ClassCodes.getAllCode());
addStreamDetectTaskReq.setDevice_sn(req.getSn());
String respStr = droneClientCommon.sendVideoStreamDetectSwitch(DroneConstruct.ADD_STREAM_DETECT_TASK, JSONUtil.toJsonStr(addStreamDetectTaskReq));
VideoStreamResp resp = JSON.parseObject(respStr, new TypeReference<VideoStreamResp>() {
});
if (!resp.getCode().equals(200)) {
return Response.fail(resp.getMsg());
}
req.setClass_codes(ClassCodes.getAllCode());
// 开启算法
respStr = droneClientCommon.sendVideoStreamDetectSwitch(DroneConstruct.CONTROL_DETECTION, JSONUtil.toJsonStr(req));
resp = JSON.parseObject(respStr, new TypeReference<VideoStreamResp>() {
});
if (!resp.getCode().equals(200)) {
return Response.fail(resp.getMsg());
}
VideoStreamDetectSwitchResp videoStreamDetectSwitchResp = new VideoStreamDetectSwitchResp();
videoStreamDetectSwitchResp.setTaskId(req.getTask_id());
videoStreamDetectSwitchResp.setHttpUrl(DroneToRtmp.getRtmpByName(req.getSn()).getHttpUrl());
return Response.ok(videoStreamDetectSwitchResp);
} else {
String respStr = droneClientCommon.sendVideoStreamDetectSwitch(DroneConstruct.CONTROL_DETECTION, JSONUtil.toJsonStr(req));
VideoStreamResp resp = JSON.parseObject(respStr, new TypeReference<VideoStreamResp>() {
});
if (!resp.getCode().equals(200)) {
return Response.fail(resp.getMsg());
}
return Response.ok("关闭算法流成功");
}
}
/**
* 获取无人机视频流
*
* @param req
* @return ltgk.pm.video.base.Response<ltgk.pm.video.domain.vo.VideoStreamDetectSwitchResp>
* @author Qi ChengBin
* @date 2025/11/27
*/
@Override
public Response getVideoStream(GetVideoStreamReq req) {
String taskId = UUID.randomUUID().toString();
redisUtils.setCacheObject(UAV_VIDEO_STREAM_TASK_ID + req.getSn(), taskId);
req.setTask_id(taskId);
// 检测预警算法添加
// if (req.getStatus().equals("start") && ObjectUtils.isNotEmpty(DroneToRtmp.getRtmpByName(req.getSn()))) {
AddStreamDetectTaskReq addStreamDetectTaskReq = new AddStreamDetectTaskReq()
.setTask_id(req.getTask_id())
.setSrc_url(DroneToRtmp.getRtmpByName(req.getSn()).getSrcUrl())
.setDst_url(DroneToRtmp.getRtmpByName(req.getSn()).getDstUrl())
.setClass_codes(ClassCodes.getAllCode())
.setDevice_sn(req.getSn());
String respStr = droneClientCommon.sendVideoStreamDetectSwitch(DroneConstruct.ADD_STREAM_DETECT_TASK, JSONUtil.toJsonStr(addStreamDetectTaskReq));
log.info(">>>>>>>>>>>>>>>获取无人机视频流:{}", respStr);
VideoStreamResp resp = JSON.parseObject(respStr, new TypeReference<VideoStreamResp>() {
});
if (!resp.getCode().equals(200)) {
return Response.fail(resp.getMsg());
}
VideoStreamDetectSwitchResp videoStreamDetectSwitchResp = new VideoStreamDetectSwitchResp();
videoStreamDetectSwitchResp.setTaskId(req.getTask_id());
videoStreamDetectSwitchResp.setHttpUrl(DroneToRtmp.getRtmpByName(req.getSn()).getHttpUrl());
return Response.ok(videoStreamDetectSwitchResp);
// } else {
// String respStr = droneClientCommon.sendVideoStreamDetectSwitch(DroneConstruct.CONTROL_DETECTION, JSONUtil.toJsonStr(req));
// VideoStreamResp resp = JSON.parseObject(respStr, new TypeReference<VideoStreamResp>() {
// });
// if (!resp.getCode().equals(200)) {
// return Response.fail(resp.getMsg());
// }
// return Response.ok("关闭算法流成功");
// }
}
@Override
public Response doStartOrStopUavAlgorithm(GetVideoStreamReq req) {
String taskId = redisUtils.getCacheObject(UAV_VIDEO_STREAM_TASK_ID + req.getSn()).toString();
req.setTask_id(taskId);
// 检测预警算法添加
if (req.getStatus().equals("start") && ObjectUtils.isNotEmpty(DroneToRtmp.getRtmpByName(req.getSn()))) {
// 开启算法
String respStr = droneClientCommon.sendVideoStreamDetectSwitch(DroneConstruct.CONTROL_DETECTION, JSONUtil.toJsonStr(req));
log.info(">>>>>>>>>>>>>>>>开启算法:{}", respStr);
VideoStreamResp resp = JSON.parseObject(respStr, new TypeReference<VideoStreamResp>() {
});
if (!resp.getCode().equals(200)) {
return Response.fail(resp.getMsg());
}
VideoStreamDetectSwitchResp videoStreamDetectSwitchResp = new VideoStreamDetectSwitchResp();
videoStreamDetectSwitchResp.setTaskId(req.getTask_id());
videoStreamDetectSwitchResp.setHttpUrl(DroneToRtmp.getRtmpByName(req.getSn()).getHttpUrl());
return Response.ok(videoStreamDetectSwitchResp);
} else {
log.info(">>>>>>>>>>>>关闭无人机算法:{}", JSONUtil.toJsonStr(req));
req.setClass_codes(ClassCodes.getAllCode());
String respStr = droneClientCommon.sendVideoStreamDetectSwitch(DroneConstruct.CONTROL_DETECTION, JSONUtil.toJsonStr(req));
VideoStreamResp resp = JSON.parseObject(respStr, new TypeReference<VideoStreamResp>() {
});
if (!resp.getCode().equals(200)) {
return Response.fail(resp.getMsg());
}
return Response.ok("关闭算法流成功");
}
}
}

View File

@@ -0,0 +1,84 @@
package com.ltgk.smartFishingPort.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.ltgk.smartFishingPort.common.utils.StringUtils;
import com.ltgk.smartFishingPort.common.utils.http.HttpUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
/**
* @Author: zhouyaoyao
* @Date 2025/2/25 16:45
* Description: 通过 SDK 远程操作监控设备
*/
@Service
public class DsCameraService {
/**
* 获取监控设备 PTZ 配置链接
*/
@Value("${sdk.hk.getPtzCfgUrl}")
private String hkGetPtzCfgUrl;
/**
* 设置监控设备 PTZ 配置链接
*/
@Value("${sdk.hk.setPtzCfgUrl}")
private String hkSetPtzCfgUrl;
/**
* 订阅布防监控摄像头链接
*/
@Value("${sdk.hk.setupAlarmChanUrl}")
private String setupAlarmChanUrl;
/**
* 获取监控设备 PTZ 配置
*/
public Object hkGetPtzCfg(String videoIp, String videoPort, String videoAccount, String videoPass) {
String param = "videoIp="+videoIp+"&videoPort="+videoPort+"&videoAccount="+videoAccount+"&videoPass="+videoPass;
String resultStr = HttpUtils.sendPost(hkGetPtzCfgUrl,param);
if (StringUtils.isEmpty(resultStr)) {
return null;
}
JSONObject resultObj = JSONObject.parseObject(resultStr);
boolean success = resultObj.getBooleanValue("success");
if (success) {
return resultObj.getJSONObject("result");
} else {
return null;
}
}
/**
* 订阅布防监控摄像头
*/
public Object setupAlarmChan(String videoIp, String videoPort, String videoAccount, String videoPass) {
String param = "videoIp="+videoIp+"&videoPort="+videoPort+"&videoAccount="+videoAccount+"&videoPass="+videoPass;
String resultStr = HttpUtils.sendPost(setupAlarmChanUrl,param);
if (StringUtils.isEmpty(resultStr)) {
return null;
}
JSONObject resultObj = JSONObject.parseObject(resultStr);
boolean success = resultObj.getBooleanValue("success");
if (success) {
return resultObj.getJSONObject("result");
} else {
return null;
}
}
/**
* 设置监控设备 PTZ 配置
*/
public boolean hkSetPtzCfg(String videoIp, String videoPort, String videoAccount, String videoPass, Integer pValue, Integer tValue, Integer zValue) {
String param = "videoIp="+videoIp+"&videoPort="+videoPort+"&videoAccount="+videoAccount+"&videoPass="+videoPass+"&pValue="+pValue+"&tValue="+tValue+"&zValue="+zValue;
String resultStr = HttpUtils.sendPost(hkSetPtzCfgUrl,param);
if (StringUtils.isEmpty(resultStr)) {
return false;
}
JSONObject resultObj = JSONObject.parseObject(resultStr);
boolean success = resultObj.getBooleanValue("success");
return success;
}
}

View File

@@ -0,0 +1,401 @@
package com.ltgk.smartFishingPort.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ltgk.smartFishingPort.common.core.domain.AjaxResult;
import com.ltgk.smartFishingPort.common.utils.MybatisUtil;
import com.ltgk.smartFishingPort.common.utils.StringUtils;
import com.ltgk.smartFishingPort.common.utils.http.HttpUtils;
import com.ltgk.smartFishingPort.domain.dto.LinkageParamDto;
import com.ltgk.smartFishingPort.domain.entity.DsVideo;
import com.ltgk.smartFishingPort.mapper.DsVideoMapper;
import com.ltgk.smartFishingPort.service.IDsVideoService;
import com.ltgk.smartFishingPort.utils.CameraDegreesUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;
/**
* <p>
* 视频监控管理表 服务实现类
* </p>
*
* @author zhouyaoyao
* @since 2025-01-19
*/
@Service
@Slf4j
public class DsVideoServiceImpl extends ServiceImpl<DsVideoMapper, DsVideo> implements IDsVideoService {
@Resource
private DsCameraService dsCameraService;
@Resource
RedisTemplate redisTemplate;
@Resource
IDsVideoService dsVideoService;
private static final String HTTPS_TYPE = "https://";
/**
* 能力开放平台的网站路径
* 路径不用修改,就是/artemis
*/
private static final String ARTEMIS_PATH = "/artemis";
/**
* 手动抓图API
*/
private static final String MANUAL_CAPTURE_URL = "/api/video/v1/manualCapture";
/**
* post请求application/json类型参数
*/
private static final String CONTENT_TYPE = "application/json";
/**
* 图片下载API
*/
private static final String GET_IMG_URL = "/api/video/v1/events/picture";
/**
* 获取监控点在线状态
*/
public static final String GET_POINT_ONLINE_STATUS_URL = "/api/nms/v1/online/camera/get";
/**
* 获取监控设备 PTZ 配置链接
*/
@Value("${sdk.hk.getPtzCfgUrl}")
private String hkGetPtzCfgUrl;
/**
* 分页查询
*
* @param dsVideo
* @return
*/
@Override
public IPage<DsVideo> selectByPage(DsVideo dsVideo) {
int pageNum = Objects.isNull(dsVideo.getPageNum()) ? 1 : dsVideo.getPageNum();
int pageSize = Objects.isNull(dsVideo.getPageSize()) ? 10 : dsVideo.getPageSize();
IPage<DsVideo> page = new Page<>(pageNum, pageSize);
LambdaQueryWrapper<DsVideo> queryWrapper = MybatisUtil.notNullField(dsVideo).lambda();
queryWrapper.orderByDesc(DsVideo::getUpdateAt);
return baseMapper.selectPage(page, queryWrapper);
}
// @PostConstruct
@Scheduled(cron = "0 0 */2 * * *")
public void startAlarmChanTask() {
LambdaQueryWrapper<DsVideo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.like(DsVideo::getVideoName, "热成像");
List<DsVideo> list = list(queryWrapper);
list.stream().forEach(video -> {
try {
dsCameraService.setupAlarmChan(video.getVideoIp(), video.getVideoPort(), video.getVideoAccount(), video.getVideoPassword());
Thread.sleep(3000);
} catch (Exception e) {
}
});
}
/**
* 根据视频监控设备名称批量添加更新
*
* @param dsVideos
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveBatchByName(List<DsVideo> dsVideos) {
for (DsVideo dsVideo : dsVideos) {
LambdaUpdateWrapper<DsVideo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(DsVideo::getVideoName, dsVideo.getVideoName());
if (!update(dsVideo, updateWrapper)) {
save(dsVideo);
}
}
return true;
}
/**
* 光电随动控制
*
* @param msg
* @return
*/
public boolean servoByRadar(String msg) {
JSONObject jsonObject = JSONObject.parseObject(msg);
if (Objects.isNull(jsonObject)) {
return false;
}
Double longitude = jsonObject.getDouble("longitude");
Double latitude = jsonObject.getDouble("latitude");
String targetSourceId = jsonObject.getString("targetSourceId");
String mmsi = jsonObject.getString("mmsi");
Integer source = jsonObject.getInteger("source");
if (Objects.isNull(longitude) || Objects.isNull(latitude) || Objects.isNull(source)) {
return false;
}
if (StringUtils.isNotEmpty(targetSourceId) && redisTemplate.hasKey("servo:" + targetSourceId)) {
String deviceCode = redisTemplate.opsForValue().get("servo:" + targetSourceId).toString();
AjaxResult result = sitMoveByGps(deviceCode, longitude.toString(), latitude.toString());
return result.isSuccess();
} else if (StringUtils.isNotEmpty(mmsi) && redisTemplate.hasKey("servo:" + mmsi)) {
String deviceCode = redisTemplate.opsForValue().get("servo:" + mmsi).toString();
AjaxResult result = sitMoveByGps(deviceCode, longitude.toString(), latitude.toString());
return result.isSuccess();
} else {
return false;
}
}
/**
* 光电联动反向定位联动控制,根据监控设备和将要联动的定位目标经纬度控制视频监控设备转动对焦
*
* @return
*/
public AjaxResult sitMoveByGps(String deviceCode, String gpsX, String gpsY) {
LambdaQueryWrapper<DsVideo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DsVideo::getVideoCode, deviceCode);
queryWrapper.isNotNull(DsVideo::getHeight);
queryWrapper.last("limit 1");
DsVideo video = dsVideoService.getOne(queryWrapper);
Double height = video.getHeight().doubleValue();
if (StringUtils.isBlank(deviceCode) || Objects.isNull(video)) {
return AjaxResult.error("暂时没有该编号的监控摄像头,请核实摄像头编号是否正确!");
}
String latitude = video.getLatitude().toString();
String longitude = video.getLongitude().toString();
int rotateT = video.getRotateT();
if (StringUtils.isBlank(latitude) || StringUtils.isBlank(longitude)) {
return AjaxResult.error("该监控摄像头没有经纬度定位信息!");
}
try {
double latitudeVal = Double.parseDouble(latitude);
double longitudeVal = Double.parseDouble(longitude);
double gpsXVal = Double.parseDouble(gpsX);
double gpsYVal = Double.parseDouble(gpsY);
BigDecimal degreeX = CameraDegreesUtil.rotateForNorthByLR(longitudeVal, latitudeVal, gpsXVal, gpsYVal, rotateT);
Integer degreeXVal = (degreeX.multiply(new BigDecimal(10))).intValue();
degreeXVal = degreeXVal < 0 ? 3600 + degreeXVal : degreeXVal;
BigDecimal degreeY = CameraDegreesUtil.rotateByUD(Objects.isNull(height) ? 0.2 : (height / 1000), longitudeVal, latitudeVal, gpsXVal, gpsYVal);
Integer degreeYVal = (degreeY.multiply(new BigDecimal(10))).intValue();
BigDecimal distance = CameraDegreesUtil.getDistance(longitudeVal, latitudeVal, gpsXVal, gpsYVal).setScale(5, RoundingMode.HALF_UP);
double zNumVal = 1d;
double yVal = 0d;
double xVal = 0d;
String xValArr = video.getXValArr();
String yValArr = video.getYValArr();
String zNumValArr = video.getZNumValArr();
if (StringUtils.isNotBlank(xValArr)) {
List<LinkageParamDto> xValArray = JSONObject.parseArray(xValArr, LinkageParamDto.class);
xValArray = xValArray.stream().filter(f -> !Objects.isNull(f.getNumber()) && f.getDistance() >= 0)
.sorted(Comparator.comparing(LinkageParamDto::getDistance).reversed())
.collect(Collectors.toList());
// 根据与联动目标的距离调节水平旋转参数
// if (xValArray.size() == 1) {
// xVal = xValArray.get(0).getNumber();
// } else
// if (xValArray.size() > 1) {
// for (int i=0;i<xValArray.size();i++) {
// LinkageParamDto linkageParamDto = xValArray.get(i);
//// if (i==xValArray.size()-1) {
//// xVal = linkageParamDto.getNumber();
//// } else
// if (distance.doubleValue()>=linkageParamDto.getDistance()) {
// xVal = linkageParamDto.getNumber();
// }
// }
// }
// 根据与联动目标的相对方位角调节水平旋转参数
if (!CollectionUtils.isEmpty(xValArray)) {
int degreeXValTmp = degreeXVal;
Optional<LinkageParamDto> optional = xValArray.stream()
.map(m -> {
m.setDistance(new BigDecimal((degreeXValTmp / 10) - m.getDistance()).abs()
.setScale(6, RoundingMode.HALF_UP).doubleValue());
return m;
}).sorted(Comparator.comparing(LinkageParamDto::getDistance)).findFirst();
if (optional.isPresent()) {
xVal = optional.get().getNumber();
}
}
}
// 根据与联动目标的相对距离调节俯仰角参数
if (StringUtils.isNotBlank(yValArr)) {
List<LinkageParamDto> yValArray = JSONObject.parseArray(yValArr, LinkageParamDto.class);
yValArray = yValArray.stream().filter(f -> !Objects.isNull(f.getNumber()) && f.getDistance() >= 0d)
.sorted(Comparator.comparing(LinkageParamDto::getDistance).reversed())
.collect(Collectors.toList());
// if (yValArray.size() == 1) {
// yVal = yValArray.get(0).getNumber();
// } else
// if (yValArray.size() > 1) {
// for (int i=0;i<yValArray.size();i++) {
// LinkageParamDto linkageParamDto = yValArray.get(i);
// if (i==yValArray.size()-1) {
// yVal = linkageParamDto.getNumber();
// } else
// if (distance.doubleValue()>=linkageParamDto.getDistance()) {
// yVal = linkageParamDto.getNumber();
// }
// }
// }
if (!CollectionUtils.isEmpty(yValArray)) {
BigDecimal distanceTmp = distance;
Optional<LinkageParamDto> optional = yValArray.stream()
.map(m -> {
m.setDistance(new BigDecimal(distanceTmp.doubleValue() - m.getDistance().doubleValue())
.abs().setScale(6, RoundingMode.HALF_UP).doubleValue());
return m;
})
.sorted(Comparator.comparing(LinkageParamDto::getDistance))
.findFirst();
if (optional.isPresent()) {
yVal = optional.get().getNumber();
}
}
}
if (StringUtils.isNotBlank(zNumValArr)) {
List<LinkageParamDto> zValArray = JSONObject.parseArray(zNumValArr, LinkageParamDto.class);
zValArray = zValArray.stream().filter(f -> !Objects.isNull(f.getNumber()) && f.getDistance() >= 0d)
.sorted(Comparator.comparing(LinkageParamDto::getDistance).reversed())
.collect(Collectors.toList());
// if (zValArray.size() == 1) {
// Double number = zValArray.get(0).getNumber();
// number = Objects.isNull(number) || number==0d ? 1:number.doubleValue();
// zNumVal = new BigDecimal(number).doubleValue();
// } else
// if (zValArray.size() > 1) {
// for (int i=0;i<zValArray.size();i++) {
// LinkageParamDto linkageParamDto = zValArray.get(i);
// Double number = linkageParamDto.getNumber();
// number = Objects.isNull(number) || number==0d ? 1:number.doubleValue();
// if (i==zValArray.size()-1) {
// zNumVal = new BigDecimal(number).doubleValue();
// } else
// if (distance.doubleValue()>=linkageParamDto.getDistance()) {
// zNumVal = new BigDecimal(number).doubleValue();
// }
// }
// }
if (!CollectionUtils.isEmpty(zValArray)) {
BigDecimal distanceTmp = distance;
Optional<LinkageParamDto> optional = zValArray.stream()
.map(m -> {
m.setDistance(new BigDecimal(distanceTmp.doubleValue() - m.getDistance().doubleValue())
.abs().setScale(6, RoundingMode.HALF_UP).doubleValue());
return m;
})
.sorted(Comparator.comparing(LinkageParamDto::getDistance))
.findFirst();
if (optional.isPresent()) {
zNumVal = optional.get().getNumber();
}
}
}
degreeYVal = degreeYVal + new BigDecimal(yVal * 10).intValue();
degreeXVal = degreeXVal + new BigDecimal(xVal * 10).intValue();
double zVal = (distance.multiply(new BigDecimal(zNumVal))).doubleValue();
log.debug("degreeXVal:" + degreeXVal);
log.debug("degreeYVal:" + degreeYVal);
log.debug("distance:" + distance);
log.debug("zVal:" + zVal);
double zMaxVal = 60;
if (StringUtils.isNotBlank(video.getVideoIp()) && video.getVideoName().contains("热成像")) {
zMaxVal = Objects.isNull(video.getZRcxVal()) ? 10 : video.getZRcxVal();
} else {
zMaxVal = Objects.isNull(video.getZMaxVal()) ? 60 : video.getZMaxVal();
}
zVal = zVal > zMaxVal ? zMaxVal : zVal;
if (StringUtils.isNotEmpty(video.getVideoIp()) && StringUtils.isNotEmpty(video.getVideoPort())
&& StringUtils.isNotEmpty(video.getVideoAccount()) && StringUtils.isNotEmpty(video.getVideoPassword())) {
boolean ptzResult = dsCameraService.hkSetPtzCfg(video.getVideoIp(), video.getVideoPort()
, video.getVideoAccount(), video.getVideoPassword()
, degreeXVal, degreeYVal, new BigDecimal(zVal * 10).setScale(0, RoundingMode.HALF_UP).intValue());
return ptzResult ? AjaxResult.success() : AjaxResult.error();
}
} catch (Exception e) {
return AjaxResult.error("服务异常:" + e.getMessage());
} finally {
// new Thread(() -> {updateVisualResion();}).start();
}
return AjaxResult.error();
}
@Override
public DsVideo getVideoInfo(DsVideo dsVideo) {
DsVideo dbDsVideo = dsVideoService.getById(dsVideo.getId());
return getDsVideoPTZ(dbDsVideo);
}
/**
* 更新摄像头可视范围字段状态,并获取所有的开启了可视摄像头范围的相关数据
*
* @param dsVideo需开启摄像头可视范围的相关摄像头数据
* @return com.yuhuan.common.core.domain.AjaxResult
* @author Qi ChengBin
* @date 2025/9/15
*/
@Override
public List<DsVideo> updateOneAndFindVideoInfoList(DsVideo dsVideo) {
List<DsVideo> resultDsVideoList = new ArrayList<>();
if (dsVideoService.updateById(dsVideo)) {
// 获取所有的开启了可视摄像头范围相关的数据
List<DsVideo> dsVideoList = dsVideoService.list(new LambdaQueryWrapper<DsVideo>()
.eq(DsVideo::getWhetherToTurnOnTheView, 1)
);
for (DsVideo video : dsVideoList) {
resultDsVideoList.add(getDsVideoPTZ(video));
}
}
return resultDsVideoList;
}
/**
* 通过 监控实体获取相关的监控PTZ数据
*
* @param dbDsVideo监控视频实体
* @return com.yuhuan.video.domain.entity.DsVideo
* @author Qi ChengBin
* @date 2025/9/15
*/
private DsVideo getDsVideoPTZ(DsVideo dbDsVideo) {
String param = "videoIp=" + dbDsVideo.getVideoIp() + "&videoPort=" + dbDsVideo.getVideoPort() + "&videoAccount=" + dbDsVideo.getVideoAccount() + "&videoPass=" + dbDsVideo.getVideoPassword();
String resultStr = HttpUtils.sendPost(hkGetPtzCfgUrl, param);
if (StringUtils.isNotBlank(resultStr)) {
JSONObject resultObj = JSONObject.parseObject(resultStr);
boolean success = resultObj.getBooleanValue("success");
if (success) {
dbDsVideo.setPTZCfg(resultObj.getJSONObject("result"));
}
}
return dbDsVideo;
}
}

View File

@@ -0,0 +1,32 @@
package com.ltgk.smartFishingPort.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ltgk.smartFishingPort.common.utils.MybatisUtil;
import com.ltgk.smartFishingPort.domain.entity.EmergencyRescue;
import com.ltgk.smartFishingPort.mapper.EmergencyRescueMapper;
import com.ltgk.smartFishingPort.service.IEmergencyRescueService;
import org.springframework.stereotype.Service;
import java.util.Objects;
/**
* @Author: zhouyaoyao
* @Date 2025/9/26 16:09
* Description:
*/
@Service
public class EmergencyRescueServiceImpl extends ServiceImpl<EmergencyRescueMapper, EmergencyRescue> implements IEmergencyRescueService {
@Override
public IPage<EmergencyRescue> selectByPage(EmergencyRescue boatData) {
int pageNum = Objects.isNull(boatData.getPageNum()) ? 1 : boatData.getPageNum();
int pageSize = Objects.isNull(boatData.getPageSize()) ? 15 : boatData.getPageSize();
IPage<EmergencyRescue> page = new Page<>(pageNum, pageSize);
LambdaQueryWrapper<EmergencyRescue> lambdaQueryWrapper = MybatisUtil.notNullField(boatData).lambda();
lambdaQueryWrapper.orderByDesc(EmergencyRescue::getUpdateTime);
return baseMapper.selectPage(page, lambdaQueryWrapper);
}
}

View File

@@ -0,0 +1,250 @@
package com.ltgk.smartFishingPort.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ltgk.smartFishingPort.common.constant.GlobalConstant;
import com.ltgk.smartFishingPort.common.core.domain.Response;
import com.ltgk.smartFishingPort.common.utils.MybatisUtil;
import com.ltgk.smartFishingPort.domain.entity.VideoCamera;
import com.ltgk.smartFishingPort.mapper.VideoCameraMapper;
import com.ltgk.smartFishingPort.service.IVideoCameraService;
import okhttp3.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* <p>
* 监控设备表 服务实现类
* </p>
*
* @author zhou
* @since 2024-12-16
*/
@Service
public class VideoCameraServiceImpl extends ServiceImpl<VideoCameraMapper, VideoCamera> implements IVideoCameraService {
@Value("${sdk.loginDHUrl}")
String loginDHUrl;
@Value("${sdk.attachTrafficDHUrl}")
String attachTrafficDHUrl;
@Value("${sdk.attachAlarmChanDHByAccountUrl}")
String attachAlarmChanDHByAccountUrl;
@Value("${sdk.attachAlarmChanHKByAccountUrl}")
String attachAlarmChanHKByAccountUrl;
@Override
public IPage<VideoCamera> findPage(VideoCamera videoCamera, Integer pageNo, Integer pageSize) {
IPage<VideoCamera> page = new Page<>(pageNo, pageSize);
QueryWrapper<VideoCamera> wrapper = MybatisUtil.notNullField(videoCamera);
IPage<VideoCamera> pageList = baseMapper.selectPage(page, wrapper);
return pageList;
}
@Override
public Object loginDH(String mStrIp, String mNPort, String mStrUser, String mStrPassword) {
OkHttpClient client = new OkHttpClient().newBuilder()
.writeTimeout(1, TimeUnit.MINUTES)
.readTimeout(1, TimeUnit.MINUTES)
.connectTimeout(1, TimeUnit.MINUTES)
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("m_nPort", mNPort)
.addFormDataPart("m_strIp", mStrIp)
.addFormDataPart("m_strPassword", mStrPassword)
.addFormDataPart("m_strUser", mStrUser)
.build();
Request request = new Request.Builder()
.url(loginDHUrl)
.method("POST", body)
.build();
try {
okhttp3.Response response = client.newCall(request).execute();
return response.body().string();
} catch (IOException e) {
e.printStackTrace();
return Response.fail(e.getMessage());
}
}
@Override
public Boolean attachTraffic(Long loginHandler, Integer channelId) {
OkHttpClient client = new OkHttpClient().newBuilder()
.writeTimeout(1, TimeUnit.MINUTES)
.readTimeout(1, TimeUnit.MINUTES)
.connectTimeout(1, TimeUnit.MINUTES)
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("loginHandler", loginHandler + "")
.addFormDataPart("channelId", channelId + "")
.build();
Request request = new Request.Builder()
.url(attachTrafficDHUrl)
.method("POST", body)
.build();
boolean result = false;
try {
okhttp3.Response response = client.newCall(request).execute();
String resultBody = response.body().string().toString();
try {
JSONObject bodyObject = JSONObject.parseObject(resultBody);
result = "200".equals(String.valueOf(bodyObject.get("code")));
} catch (Exception e) {
// log.error(e.getMessage());
result = resultBody.contains("true");
}
} catch (IOException e) {
e.printStackTrace();
// return Response.fail(e.getMessage());
}
return result;
}
/**
* 通过大华SDK布防订阅视频监控设备
*
* @param videoIp 视频监控设备IP
* @param videoPort 视频监控设备端口号
* @param videoAccount 视频监控设备登录用户账号
* @param videoPass 视频监控设备登录密码
* @param channelId 视频监控设备通道号
* @return
*/
@Override
public Boolean attachAlarmChanDHByAccount(String videoIp, String videoPort, String videoAccount, String videoPass, String channelId) {
OkHttpClient client = new OkHttpClient().newBuilder()
.writeTimeout(1, TimeUnit.MINUTES)
.readTimeout(1, TimeUnit.MINUTES)
.connectTimeout(1, TimeUnit.MINUTES)
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("videoIp", videoIp)
.addFormDataPart("videoPort", videoPort)
.addFormDataPart("videoAccount", videoAccount)
.addFormDataPart("videoPass", videoPass)
.addFormDataPart("channelId", channelId)
.build();
Request request = new Request.Builder()
.url(attachAlarmChanDHByAccountUrl)
.method("POST", body)
.build();
boolean result = false;
try {
okhttp3.Response response = client.newCall(request).execute();
String resultBody = response.body().string().toString();
try {
JSONObject bodyObject = JSONObject.parseObject(resultBody);
result = "200".equals(String.valueOf(bodyObject.get("code")));
} catch (Exception e) {
// log.error(e.getMessage());
result = resultBody.contains("true");
}
} catch (IOException e) {
e.printStackTrace();
// return Response.fail(e.getMessage());
}
return result;
}
/**
* 通过海康SDK布防订阅视频监控设备
*
* @param videoIp 视频监控设备IP
* @param videoPort 视频监控设备端口号
* @param videoAccount 视频监控设备登录用户账号
* @param videoPass 视频监控设备登录密码
* @return
*/
@Override
public Boolean attachAlarmChanHKByAccount(String videoIp, String videoPort, String videoAccount, String videoPass) {
OkHttpClient client = new OkHttpClient().newBuilder()
.writeTimeout(1, TimeUnit.MINUTES)
.readTimeout(1, TimeUnit.MINUTES)
.connectTimeout(1, TimeUnit.MINUTES)
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("videoIp", videoIp)
.addFormDataPart("videoPort", videoPort)
.addFormDataPart("videoAccount", videoAccount)
.addFormDataPart("videoPass", videoPass)
.build();
Request request = new Request.Builder()
.url(attachAlarmChanHKByAccountUrl)
.method("POST", body)
.build();
boolean result = false;
try {
okhttp3.Response response = client.newCall(request).execute();
String resultBody = response.body().string().toString();
try {
JSONObject bodyObject = JSONObject.parseObject(resultBody);
result = "200".equals(String.valueOf(bodyObject.get("code")));
} catch (Exception e) {
// log.error(e.getMessage());
result = resultBody.contains("true");
}
} catch (IOException e) {
e.printStackTrace();
// return Response.fail(e.getMessage());
}
return result;
}
@Override
public IPage<VideoCamera> selectByPage(VideoCamera videoCamera) {
return null;
}
@Async
// @PostConstruct
// @Scheduled(cron = "0 0 * * * *")
public void setAlarmChanTask() {
LambdaQueryWrapper<VideoCamera> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(VideoCamera::getIsSdkControl, 1);
List<VideoCamera> list = list(lambdaQueryWrapper);
if (CollectionUtils.isEmpty(list)) {
return;
}
List<VideoCamera> dhList = list.stream().filter(f -> GlobalConstant.SOURCE_TYPE_NAME_DH.equals(f.getSourceType())).collect(Collectors.toList());
List<VideoCamera> hkList = list.stream().filter(f -> GlobalConstant.SOURCE_TYPE_NAME_HK.equals(f.getSourceType())).collect(Collectors.toList());
dhList.stream().forEach(f -> {
try {
String videoIp = f.getVideosIp();
String videoPort = f.getVideosPort();
String videoPass = f.getVideosPass();
String videoAccount = f.getVideosAccount();
attachAlarmChanDHByAccount(videoIp, videoPort, videoAccount, videoPass, "0");
Thread.sleep(500);
} catch (Exception e) {
// log.error(e.getMessage());
}
});
hkList.stream().forEach(f -> {
try {
String videoIp = f.getVideosIp();
String videoPort = f.getVideosPort();
String videoPass = f.getVideosPass();
String videoAccount = f.getVideosAccount();
attachAlarmChanHKByAccount(videoIp, videoPort, videoAccount, videoPass);
Thread.sleep(500);
} catch (Exception e) {
// log.error(e.getMessage());
}
});
}
}

View File

@@ -0,0 +1,148 @@
package com.ltgk.smartFishingPort.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ltgk.smartFishingPort.common.utils.MybatisUtil;
import com.ltgk.smartFishingPort.domain.dto.VideoIdentificationDto;
import com.ltgk.smartFishingPort.domain.entity.VideoCamera;
import com.ltgk.smartFishingPort.domain.entity.VideoIdentification;
import com.ltgk.smartFishingPort.mapper.VideoIdentificationMapper;
import com.ltgk.smartFishingPort.service.IVideoCameraService;
import com.ltgk.smartFishingPort.service.IVideoIdentificationService;
import com.ltgk.smartFishingPort.utils.CameraDegreesUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* <p>
* 监控识别记录表 服务实现类
* </p>
*
* @author zhou
* @since 2024-12-10
*/
@Service
public class VideoIdentificationServiceImpl extends ServiceImpl<VideoIdentificationMapper, VideoIdentification> implements IVideoIdentificationService {
@Value("${url.picFile}")
private String picUrl;
@Autowired
IVideoCameraService videoCameraService;
/**
* 分页查询渔船识别
*
* @param videoIdentificationDto
* @return
*/
@Override
public IPage<VideoIdentification> findByPage(VideoIdentificationDto videoIdentificationDto) {
// TODO
Integer pageNo = videoIdentificationDto.getPageNo();
Integer pageSize = videoIdentificationDto.getPageSize();
if (Objects.isNull(pageNo)) {
pageNo = 1;
}
if (Objects.isNull(pageSize)) {
pageSize = 15;
}
IPage<VideoIdentification> pageParam = new Page<>(pageNo, pageSize);
VideoIdentification videoIdentification = new VideoIdentification();
BeanUtils.copyProperties(videoIdentificationDto, videoIdentification);
QueryWrapper<VideoIdentification> queryWrapper = MybatisUtil.notNullField(videoIdentification);
if (!StringUtils.isEmpty(videoIdentificationDto.getBeginTime())) {
queryWrapper.ge("take_time", videoIdentificationDto.getBeginTime());
}
if (!StringUtils.isEmpty(videoIdentificationDto.getEndTime())) {
queryWrapper.le("take_time", videoIdentificationDto.getEndTime());
}
queryWrapper.orderByDesc("take_time");
IPage<VideoIdentification> pageResult = baseMapper.selectPage(pageParam, queryWrapper);
List<VideoIdentification> videoIdentifications = pageResult.getRecords();
videoIdentifications = videoIdentifications.stream().map(m -> {
String sourcePicPath = m.getSourcePicPath();
String trackerPicPath = m.getTrackerPicPath();
String boatCodePicPath = m.getBoatCodePath();
if (!StringUtils.isEmpty(sourcePicPath) && !sourcePicPath.startsWith("output/") && "卡口".equals(m.getTakeType())) {
sourcePicPath = Arrays.asList(sourcePicPath.split(",")).stream()
.map(pic -> picUrl + "/pic/" + pic)
.collect(Collectors.joining(","));
}
if (!StringUtils.isEmpty(sourcePicPath) && sourcePicPath.startsWith("output/")) {
sourcePicPath = Arrays.asList(sourcePicPath.split(",")).stream()
.map(pic -> pic.replaceAll("output/", picUrl + "/pic/"))
.collect(Collectors.joining(","));
}
if (!StringUtils.isEmpty(trackerPicPath) && !trackerPicPath.startsWith("output/") && "卡口".equals(m.getTakeType())) {
trackerPicPath = Arrays.asList(trackerPicPath.split(",")).stream()
.map(pic -> picUrl + "/pic/" + pic)
.collect(Collectors.joining(","));
}
if (!StringUtils.isEmpty(trackerPicPath) && trackerPicPath.startsWith("output/")) {
trackerPicPath = Arrays.asList(trackerPicPath.split(",")).stream()
.map(pic -> pic.replaceAll("output/", picUrl + "/pic/"))
.collect(Collectors.joining(","));
}
if (!StringUtils.isEmpty(boatCodePicPath) && !boatCodePicPath.startsWith("output/") && "卡口".equals(m.getTakeType())) {
boatCodePicPath = Arrays.asList(boatCodePicPath.split(",")).stream()
.map(pic -> picUrl + "/pic/" + pic)
.collect(Collectors.joining(","));
}
if (!StringUtils.isEmpty(boatCodePicPath) && boatCodePicPath.startsWith("output/")) {
boatCodePicPath = Arrays.asList(boatCodePicPath.split(",")).stream()
.map(pic -> pic.replaceAll("output/", picUrl + "/pic/"))
.collect(Collectors.joining(","));
}
m.setSourcePicPath(sourcePicPath);
m.setTrackerPicPath(trackerPicPath);
m.setBoatCodePath(boatCodePicPath);
if (StringUtils.isEmpty(m.getHeight()) && !StringUtils.isEmpty(m.getHeightRange())) {
m.setHeight(new BigDecimal(m.getHeightRange().split("-")[0]));
}
String videoName = m.getVideoName();
VideoCamera videoCamera = null;
if (!StringUtils.isEmpty(videoName)) {
LambdaQueryWrapper<VideoCamera> videoCameraQueryWrapper = new LambdaQueryWrapper<>();
videoCameraQueryWrapper.eq(VideoCamera::getVideoName, videoName);
videoCameraQueryWrapper.last("limit 1");
videoCamera = videoCameraService.getOne(videoCameraQueryWrapper);
if (!Objects.isNull(videoCamera)) {
m.setVideoCode(videoCamera.getVideoCode());
}
}
if (!StringUtils.isEmpty(m.getVideoName())
&& !Objects.isNull(m.getLatitude()) && !Objects.isNull(m.getLongitude())) {
if (Objects.isNull(videoCamera)) {
m.setDistance(BigDecimal.ZERO);
} else if (Objects.isNull(videoCamera.getLatitude()) || Objects.isNull(videoCamera.getLongitude())) {
m.setDistance(BigDecimal.ZERO);
} else {
BigDecimal distance = CameraDegreesUtil.getDistance1(videoCamera.getLongitude().doubleValue()
, videoCamera.getLatitude().doubleValue(), m.getLongitude().doubleValue(), m.getLatitude().doubleValue());
m.setDistance(distance);
}
}
if (!Objects.isNull(videoCamera) && !StringUtils.isEmpty(videoCamera.getVideoName())) {
m.setVideoName(videoCamera.getVideoBelong() + videoCamera.getVideoName());
}
if (!Objects.isNull(m.getSpeed())) {
m.setSpeed(m.getSpeed().divide(new BigDecimal(0.5144444), 2, BigDecimal.ROUND_HALF_UP));
}
return m;
}).collect(Collectors.toList());
pageResult.setRecords(videoIdentifications);
return pageResult;
}
}

Some files were not shown because too many files have changed in this diff Show More