高德地址转换
This commit is contained in:
+14
-2
@@ -288,8 +288,9 @@ public class WatchMonitorDataServiceImpl extends ServiceImpl<WatchMonitorDataMap
|
||||
if (Stream.of(data.getLon(), data.getLat()).allMatch(value -> ObjUtil.isNotEmpty(value) && value != 0)) {
|
||||
Gps gps = GPS84ToGCJ02(data.getLon(), data.getLat());
|
||||
if (null != gps) {
|
||||
monitorDataEntity.setLon(gps.getLongitude());
|
||||
monitorDataEntity.setLat(gps.getLatitude());
|
||||
//原始值不要改动
|
||||
// monitorDataEntity.setLon(gps.getLongitude());
|
||||
// monitorDataEntity.setLat(gps.getLatitude());
|
||||
monitorDataEntity.setLonGd(BigDecimal.valueOf(gps.getLongitude()));
|
||||
monitorDataEntity.setLatGd(BigDecimal.valueOf(gps.getLatitude()));
|
||||
//获取高德地址信息
|
||||
@@ -340,6 +341,17 @@ public class WatchMonitorDataServiceImpl extends ServiceImpl<WatchMonitorDataMap
|
||||
socketVo.setWorkNo(userNew.getWorkNo());
|
||||
socketVo.setSex(userNew.getSex());
|
||||
socketVo.setAge(userNew.getAge());
|
||||
// 先赋值处理一下,socket数据全部改为高德坐标
|
||||
if(monitorDataEntity.getLonGd() != null){
|
||||
socketVo.setLon(monitorDataEntity.getLonGd().doubleValue());
|
||||
}
|
||||
if(monitorDataEntity.getLatGd() != null){
|
||||
socketVo.setLat(monitorDataEntity.getLatGd().doubleValue());
|
||||
}
|
||||
if(StrUtil.isNotBlank(monitorDataEntity.getAddressGd())){
|
||||
socketVo.setAddress(monitorDataEntity.getAddressGd());
|
||||
}
|
||||
|
||||
if (null != userNew.getDepart()) {
|
||||
socketVo.setOrgName(userNew.getDepart().getDepartName());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user