648540858
2023-03-14 943f95ba8ce02f8088f2dfcfd83a60391a8a65a6
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");