Commit 54285c48 by 黄小葱

增加Google的经纬度

1 parent 036337a8
......@@ -46,7 +46,20 @@ public class StayPointModel {
* */
private String lng;
/**
* 百度纬度
*/
private String blat;
/**
* 百度经度
*/
private String blng;
/**
* google纬度
*/
private String elat;
/**
* google经度
*/
private String elng;
}
......@@ -21,6 +21,7 @@ import cn.com.glsx.devicemonitor.modules.service.GpsBsLocationService;
import cn.com.glsx.devicemonitor.modules.service.MonitorService;
import cn.com.glsx.devicemonitor.modules.utils.DeviceUtils;
import cn.com.glsx.devicemonitor.modules.utils.JsonUtils;
import cn.com.glsx.devicemonitor.modules.utils.LocationUtil;
import com.alibaba.nacos.common.utils.CollectionUtils;
import com.glsx.plat.common.utils.DateUtils;
import lombok.extern.slf4j.Slf4j;
......@@ -165,21 +166,24 @@ public class MonitorServiceImpl implements MonitorService {
String endTime = trackRequest.getEndTime();
StayPointRecord[] recordArr = mileComponent.listStayPointQuery(sn, DateUtils.parse(startTime), DateUtils.parse(endTime));
for (StayPointRecord record: recordArr) {
retList.add(handleStayPointRecord(record));
retList.add(handleStayPointRecord(sn, record));
}
return retList;
}
private StayPointModel handleStayPointRecord(StayPointRecord record) {
private StayPointModel handleStayPointRecord(String sn, StayPointRecord record) {
StayPointModel spm = new StayPointModel();
spm.setSn(sn);
spm.setBegintime(DateUtils.formatNormal(new Date((long) record.bgnTime * 1000)));
spm.setEndtime(DateUtils.formatNormal(new Date((long) record.endTime * 1000)));
spm.setDuration(DateUtils.formatTimeInSec((long) record.duration * 1000));
GpsLoc stayGps = record.stayGps;
spm.setLat(String.valueOf(stayGps.lat));
spm.setLng(String.valueOf(stayGps.lng));
spm.setBlat(String.valueOf(stayGps.blat));
spm.setBlng(String.valueOf(stayGps.blng));
spm.setLat(LocationUtil.latlng(stayGps.lat));
spm.setLng(LocationUtil.latlng(stayGps.lng));
spm.setBlat(LocationUtil.latlng(stayGps.blat));
spm.setBlng(LocationUtil.latlng(stayGps.blng));
spm.setElat(LocationUtil.latlng(stayGps.glat));
spm.setElng(LocationUtil.latlng(stayGps.glng));
return spm;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!