|
|
@@ -64,7 +64,8 @@ public class WebSocketServer {
|
|
|
String userId = jsonObject.getString("userId");
|
|
|
String longitude = jsonObject.getString("longitude");
|
|
|
String latitude = jsonObject.getString("latitude");
|
|
|
- saveLocationData(userId, latitude, longitude);
|
|
|
+ String address = jsonObject.getString("address");
|
|
|
+ saveLocationData(userId, latitude, longitude,address);
|
|
|
log.info("服务端收到消息:{} ,主体:{}", message, userId);
|
|
|
session.getAsyncRemote().sendText("服务端已收到信息:" + message);
|
|
|
}
|
|
|
@@ -84,7 +85,7 @@ public class WebSocketServer {
|
|
|
this.session.getAsyncRemote().sendText(message);
|
|
|
}
|
|
|
|
|
|
- public void saveLocationData(String userId, String latitude, String longitude) {
|
|
|
+ public void saveLocationData(String userId, String latitude, String longitude,String address) {
|
|
|
SysGeographyPositionRecordService sysGeographyPositionRecordService = SpringContextUtils.getBean(SysGeographyPositionRecordService.class);
|
|
|
|
|
|
SysGeographyPositionService sysGeographyPositionService= SpringContextUtils.getBean(SysGeographyPositionService.class);
|
|
|
@@ -98,6 +99,7 @@ public class WebSocketServer {
|
|
|
sysGeographyPosition.setUserName(sysUser.getName());
|
|
|
sysGeographyPosition.setLatitude(latitude);
|
|
|
sysGeographyPosition.setLongitude(longitude);
|
|
|
+ sysGeographyPosition.setAddress(address);
|
|
|
sysGeographyPosition.setCreateTime(new Date());
|
|
|
sysGeographyPosition.setCreateBy(sysUser.getName());
|
|
|
sysGeographyPositionService.save(sysGeographyPosition);
|
|
|
@@ -109,6 +111,7 @@ public class WebSocketServer {
|
|
|
//存在更新
|
|
|
sysGeographyPosition1.setLongitude(longitude);
|
|
|
sysGeographyPosition1.setLatitude(latitude);
|
|
|
+ sysGeographyPosition1.setAddress(address);
|
|
|
sysGeographyPosition1.setCreateTime(new Date());
|
|
|
sysGeographyPositionService.updateById(sysGeographyPosition1);
|
|
|
SysGeographyPositionRecord sysGeographyPositionRecord = BeanUtil.copyProperties(sysGeographyPosition1, SysGeographyPositionRecord.class);
|