Pu Zhibing
2024-09-20 3682f8f0a9ce3e5d5f55bbafb4455c0dda3c3ae2
DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
@@ -402,20 +402,22 @@
                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();
                    Map<String, String> distance = gdMapElectricFenceUtil.getDistance(origins, destination, 1);
                    String distance1 = distance.get("distance");
                    orderPrivateCar.setMileage(Double.valueOf(distance1));
                    orderPrivateCar.setIsAbnormal(1);
                }
                orderPrivateCar.setMileage(sum);
                orderPrivateCar.setIsAbnormal(0);
                //获取预估里程,使用预估里程作为行驶里程计算金额
//                String origins = orderPrivateCar.getStartLon() + "," + orderPrivateCar.getStartLat();
//                String destination = orderPrivateCar.getGetoffLon() + "," + orderPrivateCar.getGetoffLat();
//                Map<String, String> distance = gdMapElectricFenceUtil.getDistance(origins, destination, 1);
//                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;
        }
        this.updateById(orderPrivateCar);