From 943f95ba8ce02f8088f2dfcfd83a60391a8a65a6 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期二, 14 三月 2023 14:02:33 +0800 Subject: [PATCH] 增加消息通道配置,可以通道redis在wvp上下级之间发送消息 --- src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java | 36 +++++++++++++++--------------------- 1 files changed, 15 insertions(+), 21 deletions(-) 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 6937641..740e837 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 @@ -29,7 +29,6 @@ import org.springframework.context.annotation.DependsOn; import org.springframework.stereotype.Component; import org.springframework.util.ObjectUtils; -import org.springframework.util.StringUtils; import javax.sip.InvalidArgumentException; import javax.sip.ResponseEvent; @@ -808,7 +807,7 @@ * @param presetIndex 璋冪敤棰勭疆浣嶇紪鍙凤紝寮�鍚湅瀹堜綅鏃朵娇鐢紝鍙栧�艰寖鍥�0~255 */ @Override - public void homePositionCmd(Device device, String channelId,String frontCmd, String enabled, String resetTime, String presetIndex, SipSubscribe.Event errorEvent,SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException { + public void homePositionCmd(Device device, String channelId, String enabled, String resetTime, String presetIndex, SipSubscribe.Event errorEvent,SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException { StringBuffer cmdXml = new StringBuffer(200); String charset = device.getCharset(); @@ -822,26 +821,21 @@ cmdXml.append("<DeviceID>" + channelId + "</DeviceID>\r\n"); } cmdXml.append("<HomePosition>\r\n"); - if (StringUtils.hasText(frontCmd)){ - cmdXml.append(frontCmd); - }else{ - if (NumericUtil.isInteger(enabled) && (!enabled.equals("0"))) { - cmdXml.append("<Enabled>1</Enabled>\r\n"); - if (NumericUtil.isInteger(resetTime)) { - cmdXml.append("<ResetTime>" + resetTime + "</ResetTime>\r\n"); - } else { - cmdXml.append("<ResetTime>0</ResetTime>\r\n"); - } - if (NumericUtil.isInteger(presetIndex)) { - cmdXml.append("<PresetIndex>" + presetIndex + "</PresetIndex>\r\n"); - } else { - cmdXml.append("<PresetIndex>0</PresetIndex>\r\n"); - } + if (NumericUtil.isInteger(enabled) && (!enabled.equals("0"))) { + cmdXml.append("<Enabled>1</Enabled>\r\n"); + if (NumericUtil.isInteger(resetTime)) { + cmdXml.append("<ResetTime>" + resetTime + "</ResetTime>\r\n"); } else { - cmdXml.append("<Enabled>0</Enabled>\r\n"); + cmdXml.append("<ResetTime>0</ResetTime>\r\n"); } + if (NumericUtil.isInteger(presetIndex)) { + cmdXml.append("<PresetIndex>" + presetIndex + "</PresetIndex>\r\n"); + } else { + cmdXml.append("<PresetIndex>0</PresetIndex>\r\n"); + } + } else { + cmdXml.append("<Enabled>0</Enabled>\r\n"); } - cmdXml.append("</HomePosition>\r\n"); cmdXml.append("</Control>\r\n"); @@ -1382,7 +1376,7 @@ if (device == null) { return; } - logger.info("[鍙戦�� 鎶ヨ閫氱煡] {}/{}->{},{}", device.getDeviceId(), deviceAlarm.getChannelId(), + logger.info("[鍙戦�佹姤璀﹂�氱煡]璁惧锛� {}/{}->{},{}", device.getDeviceId(), deviceAlarm.getChannelId(), deviceAlarm.getLongitude(), deviceAlarm.getLatitude()); String characterSet = device.getCharset(); @@ -1394,7 +1388,7 @@ deviceStatusXml.append("<DeviceID>" + deviceAlarm.getChannelId() + "</DeviceID>\r\n"); deviceStatusXml.append("<AlarmPriority>" + deviceAlarm.getAlarmPriority() + "</AlarmPriority>\r\n"); deviceStatusXml.append("<AlarmMethod>" + deviceAlarm.getAlarmMethod() + "</AlarmMethod>\r\n"); - deviceStatusXml.append("<AlarmTime>" + deviceAlarm.getAlarmTime() + "</AlarmTime>\r\n"); + deviceStatusXml.append("<AlarmTime>" + DateUtil.yyyy_MM_dd_HH_mm_ssToISO8601(deviceAlarm.getAlarmTime()) + "</AlarmTime>\r\n"); deviceStatusXml.append("<AlarmDescription>" + deviceAlarm.getAlarmDescription() + "</AlarmDescription>\r\n"); deviceStatusXml.append("<Longitude>" + deviceAlarm.getLongitude() + "</Longitude>\r\n"); deviceStatusXml.append("<Latitude>" + deviceAlarm.getLatitude() + "</Latitude>\r\n"); -- Gitblit v1.8.0