修复相关BUG

This commit is contained in:
lin
2025-11-04 11:22:03 +08:00
parent f8235d5b3f
commit 0eefabd034
10 changed files with 24 additions and 40 deletions

View File

@@ -505,6 +505,7 @@ public interface DeviceChannelMapper {
void changeAudio(@Param("channelId") int channelId, @Param("audio") boolean audio);
@Update("UPDATE wvp_device_channel SET status=#{status} WHERE data_type=#{dataType} and data_device_id=#{dataDeviceId} AND device_id=#{deviceId}")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
void updateStatus(DeviceChannel channel);
@Update({"<script>" +

View File

@@ -863,6 +863,11 @@ public class GbChannelServiceImpl implements IGbChannelService {
@Override
public List<CommonGBChannel> queryListForMap(String query, Boolean online, Boolean hasRecordPlan, Integer channelType) {
if (query != null) {
query = query.replaceAll("/", "//")
.replaceAll("%", "/%")
.replaceAll("_", "/_");
}
return commonGBChannelMapper.queryList(query, online, hasRecordPlan, channelType, null, null);
}
@@ -1033,7 +1038,7 @@ public class GbChannelServiceImpl implements IGbChannelService {
saveTile(id, key, "WGS84", beforeData);
saveTile(id, key, "GCJ02", beforeData);
process.updateAndGet(v -> (v + 0.5 / zoomParam.size()));
saveProcess(id, process.get(), "生成mvt矢量瓦片: " + key);
saveProcess(id, process.get(), "发布矢量瓦片: " + key);
}
// 记录原始数据,未保存做准备
VectorTileUtils.INSTANCE.addSource(id, new ArrayList<>(useCameraMap.values()));

View File

@@ -122,7 +122,9 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
continue;
}
catalogChannelEvent.getChannel().setDataDeviceId(device.getId());
if (catalogChannelEvent.getChannel().getLongitude() > 0
if (catalogChannelEvent.getChannel().getLongitude() != null
&& catalogChannelEvent.getChannel().getLatitude() != null
&& catalogChannelEvent.getChannel().getLongitude() > 0
&& catalogChannelEvent.getChannel().getLatitude() > 0) {
if (device.checkWgs84()) {
catalogChannelEvent.getChannel().setGbLongitude(catalogChannelEvent.getChannel().getLongitude());
@@ -286,7 +288,7 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
switch (notifyCatalogChannel.getType()) {
case STATUS_CHANGED:
deviceChannelService.updateChannelStatusForNotify(notifyCatalogChannel.getChannel());
CommonGBChannel channelForStatus = channelService.queryCommonChannelByDeviceChannel(notifyCatalogChannel.getChannel());
CommonGBChannel channelForStatus = channelService.getOne(notifyCatalogChannel.getChannel().getId());
if ("ON".equals(notifyCatalogChannel.getChannel().getStatus()) ) {
eventPublisher.channelEventPublish(channelForStatus, ChannelEvent.ChannelEventMessageType.ON);
}else {
@@ -299,7 +301,7 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
eventPublisher.channelEventPublish(channelForAdd, ChannelEvent.ChannelEventMessageType.ADD);
break;
case UPDATE:
CommonGBChannel oldCommonChannel = channelService.queryCommonChannelByDeviceChannel(notifyCatalogChannel.getChannel());
CommonGBChannel oldCommonChannel = channelService.getOne(notifyCatalogChannel.getChannel().getId());
deviceChannelService.updateChannelForNotify(notifyCatalogChannel.getChannel());
CommonGBChannel channel = channelService.getOne(oldCommonChannel.getGbId());
eventPublisher.channelEventPublishForUpdate(channel, oldCommonChannel);

View File

@@ -40,7 +40,7 @@ public class RedisPushStreamListMsgListener implements MessageListener {
@Override
public void onMessage(Message message, byte[] bytes) {
log.info("[REDIS: 流设备列表更新] {}", new String(message.getBody()));
log.info("[REDIS: 流设备列表更新] {}", new String(message.getBody()));
taskQueue.offer(message);
}

View File

@@ -168,7 +168,7 @@ public class StreamProxyController {
@GetMapping(value = "/start")
@ResponseBody
@Operation(summary = "启用代理", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Operation(summary = "播放代理", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "id", description = "代理Id", required = true)
public DeferredResult<WVPResult<StreamContent>> start(HttpServletRequest request, int id){
log.info("播放代理: {}", id);
@@ -214,10 +214,10 @@ public class StreamProxyController {
@GetMapping(value = "/stop")
@ResponseBody
@Operation(summary = "用代理", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Operation(summary = "止播放", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "id", description = "代理Id", required = true)
public void stop(int id){
log.info("用代理 {}", id);
log.info("止播放 {}", id);
streamProxyPlayService.stop(id);
}
}

View File

@@ -364,15 +364,6 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
streamProxy.setMediaServerId(mediaServerId);
streamProxy.setUpdateTime(DateUtil.getNow());
streamProxyMapper.updateStream(streamProxy);
streamProxy.setGbStatus(status ? "ON" : "OFF");
if (streamProxy.getGbId() > 0) {
if (status) {
gbChannelService.online(streamProxy.buildCommonGBChannel());
} else {
gbChannelService.offline(streamProxy.buildCommonGBChannel());
}
}
}
@Override

View File

@@ -100,7 +100,7 @@ public class StreamPushController {
@Operation(summary = "删除", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "id", description = "应用名", required = true)
public void delete(int id){
if (streamPushService.delete(id) > 0){
if (streamPushService.delete(id) <= 0){
throw new ControllerException(ErrorCode.ERROR100);
}
}