| | |
| | | out.write(JSON.toJSONString(orderPositions)); |
| | | out.flush(); |
| | | out.close(); |
| | | //计算里程 |
| | | //5分钟 |
| | | if(counts > 60){ |
| | | orderPrivateCar.setMileage(sum); |
| | | orderPrivateCar.setIsAbnormal(0); |
| | | }else{ |
| | | |
| | | |
| | | //获取预估里程,使用预估里程作为行驶里程计算金额 |
| | | String origins = orderPrivateCar.getStartLon() + "," + orderPrivateCar.getStartLat(); |
| | | String destination = orderPrivateCar.getEndLon() + "," + orderPrivateCar.getEndLat(); |
| | | String destination = orderPrivateCar.getGetoffLon() + "," + orderPrivateCar.getGetoffLat(); |
| | | Map<String, String> distance = gdMapElectricFenceUtil.getDistance(origins, destination, 1); |
| | | String distance1 = distance.get("distance"); |
| | | orderPrivateCar.setMileage(Double.valueOf(distance1)); |
| | | Double distance1 = Double.valueOf(distance.get("distance")); |
| | | if(distance1 - sum > 1000){ |
| | | orderPrivateCar.setMileage(distance1); |
| | | orderPrivateCar.setIsAbnormal(1); |
| | | }else{ |
| | | orderPrivateCar.setMileage(sum); |
| | | orderPrivateCar.setIsAbnormal(0); |
| | | } |
| | | break; |
| | | } |