diff --git a/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java b/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java index 8311745c..42ff5bad 100644 --- a/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java +++ b/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java @@ -520,7 +520,7 @@ public class StreamInfo implements Serializable, Cloneable{ try{ instance = (StreamInfo)super.clone(); }catch(CloneNotSupportedException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } return instance; } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java index ecd23202..8a55ccea 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java @@ -937,8 +937,6 @@ public class SIPCommander implements ISIPCommander { catalogXml.append("" + device.getDeviceId() + "\r\n"); catalogXml.append("\r\n"); - - Request request = headerProvider.createMessageRequest(device, catalogXml.toString(), null, SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java index 96859353..dc5c31ad 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java @@ -16,6 +16,7 @@ import com.genersoft.iot.vmp.service.bean.GPSMsgInfo; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.dao.dto.PlatformRegisterInfo; import com.genersoft.iot.vmp.utils.DateUtil; +import com.genersoft.iot.vmp.utils.GitUtil; import gov.nist.javax.sip.message.MessageFactoryImpl; import gov.nist.javax.sip.message.SIPRequest; import org.slf4j.Logger; @@ -65,6 +66,9 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { @Autowired private DynamicTask dynamicTask; + @Autowired + private GitUtil gitUtil; + @Override public void register(ParentPlatform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException { register(parentPlatform, null, null, errorEvent, okEvent, false, true); @@ -266,6 +270,9 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { String callId = request.getCallIdHeader().getCallId(); + logger.info("[命令发送] 国标级联{} 目录查询回复: 共{}条,已发送{}条", parentPlatform.getServerGBId(), + channels.size(), Math.min(index + parentPlatform.getCatalogGroup(), channels.size())); + logger.debug(catalogXml); if (sendAfterResponse) { // 默认按照收到200回复后发送下一条, 如果超时收不到回复,就以30毫秒的间隔直接发送。 dynamicTask.startDelay(timeoutTaskKey, ()->{ @@ -317,17 +324,22 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { if (parentPlatform == null) { return; } + String deviceId = device == null ? parentPlatform.getDeviceGBId() : device.getDeviceId(); + String deviceName = device == null ? parentPlatform.getName() : device.getName(); + String manufacturer = device == null ? "WVP-28181-PRO" : device.getManufacturer(); + String model = device == null ? "platform" : device.getModel(); + String firmware = device == null ? gitUtil.getBuildVersion() : device.getFirmware(); String characterSet = parentPlatform.getCharacterSet(); StringBuffer deviceInfoXml = new StringBuffer(600); deviceInfoXml.append("\r\n"); deviceInfoXml.append("\r\n"); deviceInfoXml.append("DeviceInfo\r\n"); deviceInfoXml.append("" +sn + "\r\n"); - deviceInfoXml.append("" + device.getDeviceId() + "\r\n"); - deviceInfoXml.append("" + device.getName() + "\r\n"); - deviceInfoXml.append("" + device.getManufacturer() + "\r\n"); - deviceInfoXml.append("" + device.getModel() + "\r\n"); - deviceInfoXml.append("" + device.getFirmware() + "\r\n"); + deviceInfoXml.append("" + deviceId + "\r\n"); + deviceInfoXml.append("" + deviceName + "\r\n"); + deviceInfoXml.append("" + manufacturer + "\r\n"); + deviceInfoXml.append("" + model + "\r\n"); + deviceInfoXml.append("" + firmware + "\r\n"); deviceInfoXml.append("OK\r\n"); deviceInfoXml.append("\r\n"); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java index 55c98feb..0a7eb2c9 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java @@ -45,7 +45,7 @@ public abstract class SIPRequestProcessorParent { try { return SipFactory.getInstance().createHeaderFactory(); } catch (PeerUnavailableException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } return null; } @@ -54,7 +54,7 @@ public abstract class SIPRequestProcessorParent { try { return SipFactory.getInstance().createMessageFactory(); } catch (PeerUnavailableException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } return null; } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java index fd9e0c60..1a6358b0 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java @@ -406,12 +406,8 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements }, 60 * 1000); responseSdpAck(request, content.toString(), platform); - } catch (SipException e) { - e.printStackTrace(); - } catch (InvalidArgumentException e) { - e.printStackTrace(); - } catch (ParseException e) { - e.printStackTrace(); + } catch (SipException | InvalidArgumentException | ParseException e) { + logger.error("[命令发送失败] 国标级联 回复SdpAck", e); } }; SipSubscribe.Event errorEvent = ((event) -> { @@ -420,7 +416,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements Response response = getMessageFactory().createResponse(event.statusCode, evt.getRequest()); sipSender.transmitRequest(request.getLocalAddress().getHostAddress(), response); } catch (ParseException | SipException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } }); sendRtpItem.setApp("rtp"); @@ -531,7 +527,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements } catch (SdpParseException e) { logger.error("sdp解析错误", e); } catch (SdpException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } } @@ -686,11 +682,11 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements mediaListManager.removedChannelOnlineEventLister(gbStream.getApp(), gbStream.getStream()); responseAck(request, Response.REQUEST_TIMEOUT); // 超时 } catch (SipException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } catch (InvalidArgumentException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } catch (ParseException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } }, userSetting.getPlatformPlayTimeout()); // 添加监听 @@ -709,11 +705,11 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements try { responseAck(request, Response.BUSY_HERE); } catch (SipException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } catch (InvalidArgumentException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } catch (ParseException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } return; } @@ -771,11 +767,11 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements try { responseAck(request, Response.BUSY_HERE); } catch (SipException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } catch (InvalidArgumentException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } catch (ParseException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } return; } @@ -851,11 +847,11 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements try { return responseSdpAck(request, content.toString(), platform); } catch (SipException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } catch (InvalidArgumentException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } catch (ParseException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } return null; } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java index b79b8002..7366f300 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java @@ -93,7 +93,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements try { responseAck((SIPRequest) evt.getRequest(), Response.OK, null, null); }catch (SipException | InvalidArgumentException | ParseException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } boolean runed = !taskQueue.isEmpty(); taskQueue.offer(new HandlerCatchData(evt, null, null)); @@ -225,7 +225,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements jsonObject.put("speed", mobilePosition.getSpeed()); redisCatchStorage.sendMobilePositionMsg(jsonObject); } catch (DocumentException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } } @@ -335,7 +335,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements publisher.deviceAlarmEventPublish(deviceAlarm); } } catch (DocumentException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } } @@ -428,7 +428,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements } } } catch (DocumentException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java index 80744c0b..d307941f 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java @@ -185,7 +185,7 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen deviceService.offline(deviceId, "主动注销"); } } catch (SipException | NoSuchAlgorithmException | ParseException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java index d32d194f..52a0f5d5 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java @@ -96,7 +96,7 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme sipSender.transmitRequest(request.getLocalAddress().getHostAddress(), response); } } catch (ParseException | SipException | InvalidArgumentException | DocumentException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } } @@ -149,7 +149,7 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme } } catch (SipException | InvalidArgumentException | ParseException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } } @@ -195,7 +195,7 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme subscribeHolder.putCatalogSubscribe(platformId, subscribeInfo); } } catch (SipException | InvalidArgumentException | ParseException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java index e89e88ab..ddbad1da 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java @@ -186,9 +186,13 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme // 发送给平台的报警信息。 发送redis通知 logger.info("[发送给平台的报警信息]内容:{}", JSONObject.toJSONString(deviceAlarm)); AlarmChannelMessage alarmChannelMessage = new AlarmChannelMessage(); - alarmChannelMessage.setAlarmSn(Integer.parseInt(deviceAlarm.getAlarmMethod())); + if (deviceAlarm.getAlarmMethod() != null) { + alarmChannelMessage.setAlarmSn(Integer.parseInt(deviceAlarm.getAlarmMethod())); + } alarmChannelMessage.setAlarmDescription(deviceAlarm.getAlarmDescription()); - alarmChannelMessage.setAlarmType(Integer.parseInt(deviceAlarm.getAlarmType())); + if (deviceAlarm.getAlarmType() != null) { + alarmChannelMessage.setAlarmType(Integer.parseInt(deviceAlarm.getAlarmType())); + } alarmChannelMessage.setGbId(channelId); redisCatchStorage.sendAlarmMsg(alarmChannelMessage); continue; @@ -204,6 +208,7 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme publisher.deviceAlarmEventPublish(deviceAlarm); } }catch (Exception e) { + logger.error("未处理的异常 ", e); logger.warn("[收到报警通知] 发现未处理的异常, {}\r\n{}",e.getMessage(), evt.getRequest()); } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java index 40d1dcc9..1f0bdf14 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java @@ -149,9 +149,10 @@ public class MobilePositionNotifyMessageHandler extends SIPRequestProcessorParen redisCatchStorage.sendMobilePositionMsg(jsonObject); } catch (DocumentException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } catch (Exception e) { - logger.warn("[移动位置通知] 发现未处理的异常, {}\r\n{}",e.getMessage(), evt.getRequest()); + logger.warn("[移动位置通知] 发现未处理的异常, \r\n{}", evt.getRequest()); + logger.error("[移动位置通知] 异常内容: ", e); } } }); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java index 0faf2945..8b774e10 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java @@ -60,17 +60,24 @@ public class DeviceInfoQueryMessageHandler extends SIPRequestProcessorParent imp return; } String sn = rootElement.element("SN").getText(); + /*根据WVP原有的数据结构,设备和通道是分开放置,设备信息都是存放在设备表里,通道表里的设备信息不可作为真实信息处理 大部分NVR/IPC设备对他的通道信息实现都是返回默认的值没有什么参考价值。NVR/IPC通道我们统一使用设备表的设备信息来作为返回。 我们这里使用查询数据库的方式来实现这个设备信息查询的功能,在其他地方对设备信息更新达到正确的目的。*/ + String channelId = getText(rootElement, "DeviceID"); - Device device = storager.queryDeviceInfoByPlatformIdAndChannelId(parentPlatform.getServerGBId(), channelId); - if (device ==null){ - logger.error("[平台没有该通道的使用权限]:platformId"+parentPlatform.getServerGBId()+" deviceID:"+channelId); - return; + // 查询这是通道id还是设备id + Device device = null; + // 如果id指向平台的国标编号,那么就是查询平台的信息 + if (!parentPlatform.getDeviceGBId().equals(channelId)) { + device = storager.queryDeviceInfoByPlatformIdAndChannelId(parentPlatform.getServerGBId(), channelId); + if (device ==null){ + logger.error("[平台没有该通道的使用权限]:platformId"+parentPlatform.getServerGBId()+" deviceID:"+channelId); + return; + } } try { - cmderFroPlatform.deviceInfoResponse(parentPlatform,device, sn, fromHeader.getTag()); + cmderFroPlatform.deviceInfoResponse(parentPlatform, device, sn, fromHeader.getTag()); } catch (SipException | InvalidArgumentException | ParseException e) { logger.error("[命令发送失败] 国标级联 DeviceInfo查询回复: {}", e.getMessage()); } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java index a9079991..eb8555a4 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java @@ -131,7 +131,8 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp } }catch (Exception e) { - logger.warn("[收到通道] 发现未处理的异常, {}\r\n{}",e.getMessage(), evt.getRequest()); + logger.warn("[收到通道] 发现未处理的异常, \r\n{}", evt.getRequest()); + logger.error("[收到通道] 异常内容: ", e); } } }); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java index 226799a4..332f3635 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java @@ -142,7 +142,7 @@ public class MobilePositionResponseMessageHandler extends SIPRequestProcessorPar } } catch (DocumentException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java index 93c9d2f7..a667c67d 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java @@ -150,7 +150,8 @@ public class RecordInfoResponseMessageHandler extends SIPRequestProcessorParent } } } catch (Exception e) { - logger.error("[国标录像] 发现未处理的异常, "+e.getMessage(), e); + logger.error("[国标录像] 发现未处理的异常, \r\n{}", evt.getRequest()); + logger.error("[国标录像] 异常内容: ", e); } }); } diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java index c627215e..9bf1a3ad 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java @@ -221,7 +221,7 @@ public class ZLMRTPServerFactory { if (localPort == 0) { return null; } - }alarm + } SendRtpItem sendRtpItem = new SendRtpItem(); sendRtpItem.setIp(ip); sendRtpItem.setPort(port); diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java index ea0fd501..02f4f914 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java @@ -207,7 +207,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService { dataSourceTransactionManager.commit(transactionStatus); //手动提交 result = true; }catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); dataSourceTransactionManager.rollback(transactionStatus); } return result; diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java index 6eacd394..194e90fb 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java @@ -55,7 +55,7 @@ public class RedisAlarmMsgListener implements MessageListener { boolean isEmpty = taskQueue.isEmpty(); taskQueue.offer(message); if (isEmpty) { - logger.info("[线程池信息]活动线程数:{}, 最大线程数: {}", taskExecutor.getActiveCount(), taskExecutor.getMaxPoolSize()); +// logger.info("[线程池信息]活动线程数:{}, 最大线程数: {}", taskExecutor.getActiveCount(), taskExecutor.getMaxPoolSize()); taskExecutor.execute(() -> { while (!taskQueue.isEmpty()) { Message msg = taskQueue.poll(); @@ -140,6 +140,7 @@ public class RedisAlarmMsgListener implements MessageListener { } } }catch (Exception e) { + logger.error("未处理的异常 ", e); logger.warn("[REDIS的ALARM通知] 发现未处理的异常, {}",e.getMessage()); } } diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGbPlayMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGbPlayMsgListener.java index 35ed99e4..c3726478 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGbPlayMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGbPlayMsgListener.java @@ -202,7 +202,8 @@ public class RedisGbPlayMsgListener implements MessageListener { } }catch (Exception e) { - logger.warn("[RedisGbPlayMsg] 发现未处理的异常, {}",e.getMessage()); + logger.warn("[RedisGbPlayMsg] 发现未处理的异常, \r\n{}", JSON.toJSONString(message)); + logger.error("[RedisGbPlayMsg] 异常内容: ", e); } } }); diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGpsMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGpsMsgListener.java index 0c99707e..4e81a591 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGpsMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGpsMsgListener.java @@ -53,7 +53,8 @@ public class RedisGpsMsgListener implements MessageListener { // 只是放入redis缓存起来 redisCatchStorage.updateGpsMsgInfo(gpsMsgInfo); }catch (Exception e) { - logger.warn("[REDIS的ALARM通知] 发现未处理的异常, {}",e.getMessage()); + logger.warn("[REDIS的ALARM通知] 发现未处理的异常, \r\n{}", JSON.toJSONString(message)); + logger.error("[REDIS的ALARM通知] 异常内容: ", e); } } }); diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamResponseListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamResponseListener.java index 33eae1eb..c90771be 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamResponseListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamResponseListener.java @@ -58,7 +58,8 @@ public class RedisPushStreamResponseListener implements MessageListener { responseEvents.get(response.getApp() + response.getStream()).run(response); } }catch (Exception e) { - logger.warn("[REDIS的ALARM通知] 发现未处理的异常, {}",e.getMessage()); + logger.warn("[REDIS消息-请求推流结果] 发现未处理的异常, \r\n{}", JSON.toJSONString(message)); + logger.error("[REDIS消息-请求推流结果] 异常内容: ", e); } } }); diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusListMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusListMsgListener.java index d8ed1a01..cb34ff59 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusListMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusListMsgListener.java @@ -95,7 +95,8 @@ public class RedisPushStreamStatusListMsgListener implements MessageListener { gbStreamService.updateGbIdOrName(streamPushItemForUpdate); } }catch (Exception e) { - logger.warn("[REDIS的ALARM通知] 发现未处理的异常, {}",e.getMessage()); + logger.warn("[REDIS消息-推流设备列表更新] 发现未处理的异常, \r\n{}", JSON.toJSONString(message)); + logger.error("[REDIS消息-推流设备列表更新] 异常内容: ", e); } } }); diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusMsgListener.java index 96ff8e83..d7e02f59 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusMsgListener.java @@ -79,7 +79,8 @@ public class RedisPushStreamStatusMsgListener implements MessageListener, Applic streamPushService.online(statusChangeFromPushStream.getOnlineStreams()); } }catch (Exception e) { - logger.warn("[REDIS的ALARM通知] 发现未处理的异常, {}",e.getMessage()); + logger.warn("[REDIS消息-推流设备状态变化] 发现未处理的异常, \r\n{}", JSON.toJSONString(message)); + logger.error("[REDIS消息-推流设备状态变化] 异常内容: ", e); } } }); diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisStreamMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisStreamMsgListener.java index 1cdc527a..f5f29487 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisStreamMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisStreamMsgListener.java @@ -82,7 +82,8 @@ public class RedisStreamMsgListener implements MessageListener { zlmMediaListManager.removeMedia(app, stream); } }catch (Exception e) { - logger.warn("[REDIS的ALARM通知] 发现未处理的异常, {}",e.getMessage()); + logger.warn("[REDIS消息-流变化] 发现未处理的异常, \r\n{}", JSON.toJSONString(message)); + logger.error("[REDIS消息-流变化] 异常内容: ", e); } } }); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java index 3920fc7e..1ce01df3 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java @@ -197,7 +197,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { dataSourceTransactionManager.commit(transactionStatus); //手动提交 return true; }catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); dataSourceTransactionManager.rollback(transactionStatus); return false; } @@ -313,7 +313,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { } return true; }catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); dataSourceTransactionManager.rollback(transactionStatus); return false; } diff --git a/src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java b/src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java index e54ed539..d8270f18 100644 --- a/src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java +++ b/src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java @@ -38,7 +38,7 @@ public class RedisUtil { } return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return false; } } @@ -66,7 +66,7 @@ public class RedisUtil { try { return redisTemplate.hasKey(key); } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return false; } } @@ -91,7 +91,7 @@ public class RedisUtil { } return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return false; } } @@ -124,7 +124,7 @@ public class RedisUtil { redisTemplate.opsForValue().set(key, value); return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return false; } } @@ -148,7 +148,7 @@ public class RedisUtil { } return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return false; } } @@ -226,7 +226,7 @@ public class RedisUtil { redisTemplate.opsForHash().putAll(key, map); return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return false; } } @@ -249,7 +249,7 @@ public class RedisUtil { } return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return false; } } @@ -269,7 +269,7 @@ public class RedisUtil { redisTemplate.opsForHash().put(key, item, value); return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return false; } } @@ -293,7 +293,7 @@ public class RedisUtil { } return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return false; } } @@ -365,7 +365,7 @@ public class RedisUtil { try { return redisTemplate.opsForSet().members(key); } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return null; } } @@ -383,7 +383,7 @@ public class RedisUtil { try { return redisTemplate.opsForSet().isMember(key, value); } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return false; } } @@ -401,7 +401,7 @@ public class RedisUtil { try { return redisTemplate.opsForSet().add(key, values); } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return 0; } } @@ -424,7 +424,7 @@ public class RedisUtil { } return count; } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return 0; } } @@ -441,7 +441,7 @@ public class RedisUtil { try { return redisTemplate.opsForSet().size(key); } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return 0; } } @@ -459,7 +459,7 @@ public class RedisUtil { try { return redisTemplate.opsForSet().remove(key, values); } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return 0; } } @@ -625,7 +625,7 @@ public class RedisUtil { try { return redisTemplate.opsForList().range(key, start, end); } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return null; } } @@ -642,7 +642,7 @@ public class RedisUtil { try { return redisTemplate.opsForList().size(key); } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return 0; } } @@ -662,7 +662,7 @@ public class RedisUtil { try { return redisTemplate.opsForList().index(key, index); } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return null; } } @@ -681,7 +681,7 @@ public class RedisUtil { redisTemplate.opsForList().rightPush(key, value); return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return false; } } @@ -704,7 +704,7 @@ public class RedisUtil { } return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return false; } } @@ -723,7 +723,7 @@ public class RedisUtil { redisTemplate.opsForList().rightPushAll(key, values); return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return false; } } @@ -746,7 +746,7 @@ public class RedisUtil { } return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return false; } } @@ -766,7 +766,7 @@ public class RedisUtil { redisTemplate.opsForList().set(key, index, value); return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return false; } } @@ -787,7 +787,7 @@ public class RedisUtil { try { return redisTemplate.opsForList().remove(key, count, value); } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return 0; } } @@ -829,7 +829,7 @@ public class RedisUtil { Set set = redisTemplate.keys(key); return new ArrayList<>(set); } catch (Exception e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); return null; } } @@ -854,7 +854,7 @@ public class RedisUtil { // //关闭cursor // cursor.close(); // } catch (Exception e) { -// e.printStackTrace(); +// logger.error("未处理的异常 ", e); // } // return result; // } diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java index 66225688..5c8bf367 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java @@ -181,7 +181,7 @@ public class StreamPushController { String name = file.getName(); inputStream = file.getInputStream(); } catch (IOException e) { - e.printStackTrace(); + logger.error("未处理的异常 ", e); } try { //传入参数 diff --git a/web_src/src/components/dialog/platformEdit.vue b/web_src/src/components/dialog/platformEdit.vue index 2844fccb..0298ee73 100644 --- a/web_src/src/components/dialog/platformEdit.vue +++ b/web_src/src/components/dialog/platformEdit.vue @@ -215,7 +215,7 @@ export default { this.platform.enable = platform.enable; this.platform.ptz = platform.ptz; this.platform.rtcp = platform.rtcp; - this.platform.rtcpasMessageChannel = platform.asMessageChannel; + this.platform.asMessageChannel = platform.asMessageChannel; this.platform.name = platform.name; this.platform.serverGBId = platform.serverGBId; this.platform.serverGBDomain = platform.serverGBDomain;