|
@@ -75,27 +75,12 @@ public class DeviceService extends ServiceImpl<DeviceMapper, Device> {
|
|
|
|
|
|
device.setDeviceid(jsonObject.getString("deviceid"));
|
|
|
|
|
|
- if(jsonObject.getDouble("lat")!=null)
|
|
|
- {device.setLat(jsonObject.getDouble("lat"));
|
|
|
- System.out.println("dsadasd");}
|
|
|
-
|
|
|
- else
|
|
|
- System.out.println("asdadas");
|
|
|
-
|
|
|
- if(jsonObject.getDouble("lon")!=null)
|
|
|
- device.setLon(jsonObject.getDouble("lon"));
|
|
|
-
|
|
|
- if(jsonObject.getDouble("x")!=null)
|
|
|
- device.setX(jsonObject.getDouble("x"));
|
|
|
-
|
|
|
- if(jsonObject.getDouble("y")!=null)
|
|
|
- device.setX(jsonObject.getDouble("y"));
|
|
|
-
|
|
|
- if(jsonObject.getDouble("z")!=null)
|
|
|
- device.setX(jsonObject.getDouble("z"));
|
|
|
-
|
|
|
- if(jsonObject.getInteger("f")!=null)
|
|
|
- device.setX(jsonObject.getInteger("f"));
|
|
|
+ device.setLat(jsonObject.containsKey("lat") ? jsonObject.getDouble("lat") : null);
|
|
|
+ device.setLon(jsonObject.containsKey("lon") ? jsonObject.getDouble("lon") : null);
|
|
|
+ device.setX(jsonObject.containsKey("x") ? jsonObject.getDouble("x") : null);
|
|
|
+ device.setY(jsonObject.containsKey("y") ? jsonObject.getDouble("y") : null);
|
|
|
+ device.setZ(jsonObject.containsKey("z") ? jsonObject.getDouble("z") : null);
|
|
|
+ device.setF(jsonObject.containsKey("f") ? jsonObject.getInteger("f") : null);
|
|
|
|
|
|
|
|
|
// 获取原始经纬度
|