Commit 0ab195d6 authored by wujiang's avatar wujiang

提交

parent 733e11e1
...@@ -80,14 +80,19 @@ public class JxiopCarIotListerServiceImpl { ...@@ -80,14 +80,19 @@ public class JxiopCarIotListerServiceImpl {
JSONObject jsonObject = JSONObject.parseObject(message.toString()); JSONObject jsonObject = JSONObject.parseObject(message.toString());
//判断是否有效坐标 //判断是否有效坐标
if (!ObjectUtils.isEmpty(jsonObject.get("FireCar_Longitude")) && !ObjectUtils.isEmpty(jsonObject.get("FireCar_Latitude"))) { if (!ObjectUtils.isEmpty(jsonObject.get("FireCar_Longitude")) && !ObjectUtils.isEmpty(jsonObject.get("FireCar_Latitude"))) {
// 获取开始坐标
double startLongitude = jsonObject.getDoubleValue("FireCar_Longitude");
double startLatitude = jsonObject.getDoubleValue("FireCar_Latitude");
if(startLongitude==0||startLatitude==0)
{
logger.info("新增数据无效坐标::" + JSONObject.toJSONString(jsonObject));
return;
}
//判断是否存在未结束进程,如果不存在,则进入判断插入开始节点 //判断是否存在未结束进程,如果不存在,则进入判断插入开始节点
if (iWlCarMileageService.getUncompleteMileagByIotCode(iotCode)) { if (iWlCarMileageService.getUncompleteMileagByIotCode(iotCode)) {
WlCarMileage wlCarMileage = new WlCarMileage(); WlCarMileage wlCarMileage = new WlCarMileage();
wlCarMileage.setIotCode(iotCode); wlCarMileage.setIotCode(iotCode);
wlCarMileage.setDate(new Date()); wlCarMileage.setDate(new Date());
// 获取开始坐标
double startLongitude = jsonObject.getDoubleValue("FireCar_Longitude");
double startLatitude = jsonObject.getDoubleValue("FireCar_Latitude");
// String currentTime = "20"+jsonObject.getString("currentTime"); // String currentTime = "20"+jsonObject.getString("currentTime");
wlCarMileage.setStartLongitude(startLongitude); wlCarMileage.setStartLongitude(startLongitude);
wlCarMileage.setStartLatitude(startLatitude); wlCarMileage.setStartLatitude(startLatitude);
......
...@@ -463,7 +463,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC ...@@ -463,7 +463,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
double startLongitude = lastObj.getDoubleValue("FireCar_Longitude"); double startLongitude = lastObj.getDoubleValue("FireCar_Longitude");
double startLatitude = lastObj.getDoubleValue("FireCar_Latitude"); double startLatitude = lastObj.getDoubleValue("FireCar_Latitude");
// 当前速度 // 当前速度
Double v = lastObj.getDoubleValue("FireCar_Speed"); Double v = lastObj.getDoubleValue(" ");
item.setStartSpeed(v.intValue()); item.setStartSpeed(v.intValue());
double travel = 0.0; double travel = 0.0;
// 获取里程 // 获取里程
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment