| | |
| | | String toLonLat = orderPositionWarpper1.getLon() + "," + orderPositionWarpper1.getLat(); |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(fromLonLat, toLonLat); |
| | | Double wgs84 = distance.get("WGS84"); |
| | | if(wgs84 >= 80){ |
| | | if(wgs84 >= 50){ |
| | | OrderPositionWarpper orderPositionWarpper = new OrderPositionWarpper(); |
| | | BeanUtils.copyProperties(driverPositionWarpper, orderPositionWarpper); |
| | | orderPositionWarpper.setInsertTime(new Date()); |
| | |
| | | Order order = orderService.selectById(driverPositionWarpper.getOrderId()); |
| | | Double wgs84 = distance.get("WGS84"); |
| | | Integer num = map.get(order.getId().toString()); |
| | | if(80 < wgs84){ |
| | | if(50 < wgs84){ |
| | | order.setActualMileage(order.getActualMileage() + wgs84.intValue()); |
| | | orderService.updateById(order); |
| | | map.put(order.getId().toString(), 0); |
| | |
| | | } |
| | | } |
| | | } |
| | | if(80 >= wgs84 && 12 <= (null == num ? 0 : num)){//1分钟(5秒上传一次数据) |
| | | if(50 >= wgs84 && 12 <= (null == num ? 0 : num)){//1分钟(5秒上传一次数据) |
| | | Integer integer = map.get(order.getId().toString()); |
| | | map.put(order.getId().toString(), null == integer ? 0 : integer++); |
| | | //进入等待状态 |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | if(80 >= wgs84 && 12 > (null == num ? 0 : num)){ |
| | | if(50 >= wgs84 && 12 > (null == num ? 0 : num)){ |
| | | Integer integer = map.get(order.getId().toString()); |
| | | map.put(order.getId().toString(), null == integer ? 0 : integer++); |
| | | } |