Compare commits

...

7 Commits

Author SHA1 Message Date
阿斌
fb631fd871
Pre Merge pull request !36 from 阿斌/N/A 2025-11-20 09:29:20 +00:00
lin
daddb4bfff 修复删除过期推流数据的SQL兼容性 2025-11-20 17:29:06 +08:00
lin
4bc80d4ef8 修复前端错误提示 2025-11-20 15:44:23 +08:00
lin
8b5a8de15d 补充缺少的js.map 2025-11-20 15:25:58 +08:00
lin
493131df8b 调整获取通道同步进度取参方式 2025-11-20 14:03:06 +08:00
lin
ba4620c2d6 调整转Map实现方式 2025-11-20 12:59:33 +08:00
阿斌
da98101aac
update src/main/resources/civilCode.csv.
行政规划错误。江苏南通海门市,修改为海门区,浙江杭州删除下城区、江干区,新增钱塘区,临平区

Signed-off-by: 阿斌 <38912748@qq.com>
2024-12-15 08:58:42 +00:00
7 changed files with 72 additions and 19 deletions

View File

@ -328,11 +328,13 @@ public class DeviceQuery {
return result; return result;
} }
/**
* 此接口保留仅作为兼容后续将移除请迁移至
*/
@GetMapping("/{deviceId}/sync_status") @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) @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); SyncStatus channelSyncStatus = deviceService.getChannelSyncStatus(deviceId);
WVPResult<SyncStatus> wvpResult = new WVPResult<>(); WVPResult<SyncStatus> wvpResult = new WVPResult<>();
if (channelSyncStatus == null) { if (channelSyncStatus == null) {
@ -356,6 +358,36 @@ public class DeviceQuery {
return wvpResult; 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}") @GetMapping("/snap/{deviceId}/{channelId}")
@Operation(summary = "请求截图") @Operation(summary = "请求截图")
@Parameter(name = "deviceId", description = "设备国标编号", required = true) @Parameter(name = "deviceId", description = "设备国标编号", required = true)

View File

@ -1,7 +1,5 @@
package com.genersoft.iot.vmp.gb28181.service.impl; 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.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.common.VideoManagerConstants; import com.genersoft.iot.vmp.common.VideoManagerConstants;
import com.genersoft.iot.vmp.common.enums.ChannelDataType; import com.genersoft.iot.vmp.common.enums.ChannelDataType;
@ -29,9 +27,11 @@ import com.github.pagehelper.PageInfo;
import com.google.common.base.CaseFormat; import com.google.common.base.CaseFormat;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import no.ecc.vectortile.VectorTileEncoder; import no.ecc.vectortile.VectorTileEncoder;
import org.jetbrains.annotations.NotNull;
import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.Point; import org.locationtech.jts.geom.Point;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl; import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner; import org.springframework.boot.CommandLineRunner;
@ -41,6 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.beans.PropertyDescriptor;
import java.time.Duration; import java.time.Duration;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@ -994,14 +995,28 @@ public class GbChannelServiceImpl implements IGbChannelService, CommandLineRunne
// lon/lat 转为瓦片内像素坐标0..256 // lon/lat 转为瓦片内像素坐标0..256
double[] px = TileUtils.lonLatToTilePixel(lon, lat, z, x, y); double[] px = TileUtils.lonLatToTilePixel(lon, lat, z, x, y);
Point pointGeom = geometryFactory.createPoint(new Coordinate(px[0], px[1])); Point pointGeom = geometryFactory.createPoint(new Coordinate(px[0], px[1]));
Map<String, Object> beanMap = getStringObjectMap(commonGBChannel);
BeanMap beanMap = BeanMapUtils.create(commonGBChannel);
encoder.addFeature("points", beanMap, pointGeom); encoder.addFeature("points", beanMap, pointGeom);
}); });
} }
return encoder.encode(); 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 @Override
public String drawThin(Map<Integer, Double> zoomParam, Extent extent, String geoCoordSys) { 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 // lon/lat 转为瓦片内像素坐标0..256
double[] px = TileUtils.lonLatToTilePixel(lon, lat, z, x, y); double[] px = TileUtils.lonLatToTilePixel(lon, lat, z, x, y);
Point pointGeom = geometryFactory.createPoint(new Coordinate(px[0], px[1])); 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); encoder.addFeature("points", beanMap, pointGeom);
}); });
encoderMap.forEach((key, encoder) -> { encoderMap.forEach((key, encoder) -> {

View File

@ -158,8 +158,13 @@ public interface StreamPushMapper {
"</script>"}) "</script>"})
int batchUpdate(List<StreamPush> streamPushItemForUpdate); int batchUpdate(List<StreamPush> streamPushItemForUpdate);
@Delete(" DELETE FROM wvp_stream_push st " + @Delete(" DELETE FROM wvp_stream_push" +
" LEFT join wvp_device_channel wdc on wdc.data_type = 2 and st.id = wdc.data_device_id " + " WHERE server_id = #{serverId}" +
" where wdc.id is null and st.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); void deleteWithoutGBId(@Param("serverId") String serverId);
} }

View File

@ -861,7 +861,7 @@
320623,如东县,3206 320623,如东县,3206
320681,启东市,3206 320681,启东市,3206
320682,如皋市,3206 320682,如皋市,3206
320684,海门,3206 320684,海门,3206
320685,海安市,3206 320685,海安市,3206
3207,连云港市,32 3207,连云港市,32
320703,连云区,3207 320703,连云区,3207
@ -918,8 +918,6 @@
33,浙江省, 33,浙江省,
3301,杭州市,33 3301,杭州市,33
330102,上城区,3301 330102,上城区,3301
330103,下城区,3301
330104,江干区,3301
330105,拱墅区,3301 330105,拱墅区,3301
330106,西湖区,3301 330106,西湖区,3301
330108,滨江区,3301 330108,滨江区,3301
@ -927,6 +925,8 @@
330110,余杭区,3301 330110,余杭区,3301
330111,富阳区,3301 330111,富阳区,3301
330112,临安区,3301 330112,临安区,3301
330113,临平区,3301
330114,钱塘区,3301
330122,桐庐县,3301 330122,桐庐县,3301
330127,淳安县,3301 330127,淳安县,3301
330182,建德市,3301 330182,建德市,3301

1 编号 名称 上级
861 320623 如东县 3206
862 320681 启东市 3206
863 320682 如皋市 3206
864 320684 海门市 海门区 3206
865 320685 海安市 3206
866 3207 连云港市 32
867 320703 连云区 3207
918 33 浙江省
919 3301 杭州市 33
920 330102 上城区 3301
330103 下城区 3301
330104 江干区 3301
921 330105 拱墅区 3301
922 330106 西湖区 3301
923 330108 滨江区 3301
925 330110 余杭区 3301
926 330111 富阳区 3301
927 330112 临安区 3301
928 330113 临平区 3301
929 330114 钱塘区 3301
930 330122 桐庐县 3301
931 330127 淳安县 3301
932 330182 建德市 3301

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,10 @@ import request from '@/utils/request'
export function queryDeviceSyncStatus(deviceId) { export function queryDeviceSyncStatus(deviceId) {
return request({ return request({
method: 'get', method: 'get',
url: `/api/device/query/${deviceId}/sync_status` url: `/api/device/query/sync_status`,
params: {
deviceId: deviceId
}
}) })
} }

View File

@ -46,10 +46,7 @@ service.interceptors.response.use(
} }
const res = response.data const res = response.data
if (res.code && res.code !== 0) { if (res.code && res.code !== 0) {
Message.error({ throw res.msg
message: res.msg,
duration: 5 * 1000
})
} else { } else {
return res return res
} }