Merge pull request #876 from criver31/wvp-28181-2.0

移动设备实时位置兼容ISO8601格式
pull/893/head
648540858 2023-06-14 20:14:31 +08:00 committed by GitHub
commit 138216c395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -89,7 +89,10 @@ public class MobilePositionResponseMessageHandler extends SIPRequestProcessorPar
}
mobilePosition.setDeviceId(device.getDeviceId());
mobilePosition.setChannelId(getText(rootElement, "DeviceID"));
mobilePosition.setTime(getText(rootElement, "Time"));
//兼容ISO 8601格式时间
String time = getText(rootElement, "Time");
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
mobilePosition.setTime(LocalDateTime.parse(time).format(formatter));
mobilePosition.setLongitude(Double.parseDouble(getText(rootElement, "Longitude")));
mobilePosition.setLatitude(Double.parseDouble(getText(rootElement, "Latitude")));
if (NumericUtil.isDouble(getText(rootElement, "Speed"))) {