mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-21 21:07:49 +08:00
Compare commits
7 Commits
cfbdc4c657
...
78fa42ea74
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78fa42ea74 | ||
|
|
daddb4bfff | ||
|
|
4bc80d4ef8 | ||
|
|
8b5a8de15d | ||
|
|
493131df8b | ||
|
|
ba4620c2d6 | ||
|
|
8dd624ccd4 |
@ -328,11 +328,13 @@ public class DeviceQuery {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 此接口保留仅作为兼容,后续将移除,请迁移至
|
||||
*/
|
||||
@GetMapping("/{deviceId}/sync_status")
|
||||
@Operation(summary = "获取通道同步进度", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@Operation(summary = "获取通道同步进度(此接口保留仅作为兼容,后续将移除,请迁移至 /sync_status?deviceId=)", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
public WVPResult<SyncStatus> getSyncStatus(@PathVariable String deviceId) {
|
||||
public WVPResult<SyncStatus> getSyncStatusInPath(@PathVariable String deviceId) {
|
||||
SyncStatus channelSyncStatus = deviceService.getChannelSyncStatus(deviceId);
|
||||
WVPResult<SyncStatus> wvpResult = new WVPResult<>();
|
||||
if (channelSyncStatus == null) {
|
||||
@ -356,6 +358,36 @@ public class DeviceQuery {
|
||||
return wvpResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 此接口保留仅作为兼容,后续将移除,请迁移至
|
||||
*/
|
||||
@GetMapping("/sync_status")
|
||||
@Operation(summary = "获取通道同步进度", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
public WVPResult<SyncStatus> getSyncStatus(String deviceId) {
|
||||
SyncStatus channelSyncStatus = deviceService.getChannelSyncStatus(deviceId);
|
||||
WVPResult<SyncStatus> wvpResult = new WVPResult<>();
|
||||
if (channelSyncStatus == null) {
|
||||
wvpResult.setCode(ErrorCode.ERROR100.getCode());
|
||||
wvpResult.setMsg("同步不存在");
|
||||
}else if (channelSyncStatus.getErrorMsg() != null) {
|
||||
wvpResult.setCode(ErrorCode.ERROR100.getCode());
|
||||
wvpResult.setMsg(channelSyncStatus.getErrorMsg());
|
||||
}else if (channelSyncStatus.getTotal() == null){
|
||||
wvpResult.setCode(ErrorCode.SUCCESS.getCode());
|
||||
wvpResult.setMsg("等待通道信息...");
|
||||
}else if (channelSyncStatus.getTotal() == 0){
|
||||
wvpResult.setCode(ErrorCode.SUCCESS.getCode());
|
||||
wvpResult.setMsg(ErrorCode.SUCCESS.getMsg());
|
||||
wvpResult.setData(channelSyncStatus);
|
||||
}else {
|
||||
wvpResult.setCode(ErrorCode.SUCCESS.getCode());
|
||||
wvpResult.setMsg(ErrorCode.SUCCESS.getMsg());
|
||||
wvpResult.setData(channelSyncStatus);
|
||||
}
|
||||
return wvpResult;
|
||||
}
|
||||
|
||||
@GetMapping("/snap/{deviceId}/{channelId}")
|
||||
@Operation(summary = "请求截图")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package com.genersoft.iot.vmp.gb28181.service.impl;
|
||||
|
||||
import com.alibaba.excel.support.cglib.beans.BeanMap;
|
||||
import com.alibaba.excel.util.BeanMapUtils;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.genersoft.iot.vmp.common.VideoManagerConstants;
|
||||
import com.genersoft.iot.vmp.common.enums.ChannelDataType;
|
||||
@ -29,9 +27,11 @@ import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.base.CaseFormat;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import no.ecc.vectortile.VectorTileEncoder;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.locationtech.jts.geom.Coordinate;
|
||||
import org.locationtech.jts.geom.GeometryFactory;
|
||||
import org.locationtech.jts.geom.Point;
|
||||
import org.springframework.beans.BeanWrapper;
|
||||
import org.springframework.beans.BeanWrapperImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
@ -41,6 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.time.Duration;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@ -994,14 +995,28 @@ public class GbChannelServiceImpl implements IGbChannelService, CommandLineRunne
|
||||
// 将 lon/lat 转为瓦片内像素坐标(0..256)
|
||||
double[] px = TileUtils.lonLatToTilePixel(lon, lat, z, x, y);
|
||||
Point pointGeom = geometryFactory.createPoint(new Coordinate(px[0], px[1]));
|
||||
|
||||
BeanMap beanMap = BeanMapUtils.create(commonGBChannel);
|
||||
Map<String, Object> beanMap = getStringObjectMap(commonGBChannel);
|
||||
encoder.addFeature("points", beanMap, pointGeom);
|
||||
});
|
||||
}
|
||||
return encoder.encode();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Map<String, Object> getStringObjectMap(CommonGBChannel commonGBChannel) {
|
||||
BeanWrapper wrapper = new BeanWrapperImpl(commonGBChannel);
|
||||
PropertyDescriptor[] pds = wrapper.getPropertyDescriptors();
|
||||
Map<String, Object> beanMap = new HashMap<>();
|
||||
|
||||
for (PropertyDescriptor pd : pds) {
|
||||
if (pd.getReadMethod() != null && !"class".equals(pd.getName())) {
|
||||
Object value = wrapper.getPropertyValue(pd.getName());
|
||||
beanMap.put(pd.getName(), value);
|
||||
}
|
||||
}
|
||||
return beanMap;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String drawThin(Map<Integer, Double> zoomParam, Extent extent, String geoCoordSys) {
|
||||
@ -1154,7 +1169,7 @@ public class GbChannelServiceImpl implements IGbChannelService, CommandLineRunne
|
||||
// 将 lon/lat 转为瓦片内像素坐标(0..256)
|
||||
double[] px = TileUtils.lonLatToTilePixel(lon, lat, z, x, y);
|
||||
Point pointGeom = geometryFactory.createPoint(new Coordinate(px[0], px[1]));
|
||||
BeanMap beanMap = BeanMapUtils.create(commonGBChannel);
|
||||
Map<String, Object> beanMap = getStringObjectMap(commonGBChannel);
|
||||
encoder.addFeature("points", beanMap, pointGeom);
|
||||
});
|
||||
encoderMap.forEach((key, encoder) -> {
|
||||
|
||||
@ -158,8 +158,13 @@ public interface StreamPushMapper {
|
||||
"</script>"})
|
||||
int batchUpdate(List<StreamPush> streamPushItemForUpdate);
|
||||
|
||||
@Delete(" DELETE FROM wvp_stream_push st " +
|
||||
" LEFT join wvp_device_channel wdc on wdc.data_type = 2 and st.id = wdc.data_device_id " +
|
||||
" where wdc.id is null and st.server_id = #{serverId}")
|
||||
@Delete(" DELETE FROM wvp_stream_push" +
|
||||
" WHERE server_id = #{serverId}" +
|
||||
" AND NOT EXISTS (" +
|
||||
" SELECT 1 " +
|
||||
" FROM wvp_device_channel wdc " +
|
||||
" WHERE wdc.data_type = 2 " +
|
||||
" AND wvp_stream_push.id = wdc.data_device_id" +
|
||||
" );")
|
||||
void deleteWithoutGBId(@Param("serverId") String serverId);
|
||||
}
|
||||
|
||||
1
web/public/static/js/ZLMRTCClient.js.map
Normal file
1
web/public/static/js/ZLMRTCClient.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -5,7 +5,10 @@ import request from '@/utils/request'
|
||||
export function queryDeviceSyncStatus(deviceId) {
|
||||
return request({
|
||||
method: 'get',
|
||||
url: `/api/device/query/${deviceId}/sync_status`
|
||||
url: `/api/device/query/sync_status`,
|
||||
params: {
|
||||
deviceId: deviceId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -46,10 +46,7 @@ service.interceptors.response.use(
|
||||
}
|
||||
const res = response.data
|
||||
if (res.code && res.code !== 0) {
|
||||
Message.error({
|
||||
message: res.msg,
|
||||
duration: 5 * 1000
|
||||
})
|
||||
throw res.msg
|
||||
} else {
|
||||
return res
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user