From 2aac791fe69fb10034091945422161ca02393519 Mon Sep 17 00:00:00 2001
From: zhibing.pu <393733352@qq.com>
Date: 星期三, 11 九月 2024 09:37:49 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java b/DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
index 9dfa4bb..a1abc83 100644
--- a/DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
+++ b/DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
@@ -390,19 +390,21 @@
                     }
                 }
                 System.err.println("======服务里程======"+sum);
-                orderPrivateCar.setMileage(sum);
-                // 将数据存储到文件中
-                File file = new File(filePath + orderId + "_" + 1 + ".txt");
-                if(!file.exists()){
-                    file.getParentFile().mkdirs();
-                    file.createNewFile();
+                if(counts < 5){
+                    orderPrivateCar.setMileage(sum);
+                    orderPrivateCar.setIsAbnormal(1);
+                    // 将数据存储到文件中
+                    File file = new File(filePath + orderId + "_" + 1 + ".txt");
+                    if(!file.exists()){
+                        file.getParentFile().mkdirs();
+                        file.createNewFile();
+                    }
+                    //写入相应的文件
+                    PrintWriter out = new PrintWriter(new FileWriter(file));
+                    out.write(JSON.toJSONString(orderPositions));
+                    out.flush();
+                    out.close();
                 }
-                //写入相应的文件
-                PrintWriter out = new PrintWriter(new FileWriter(file));
-                out.write(JSON.toJSONString(orderPositions));
-                out.flush();
-                out.close();
-
                 break;
         }
         this.updateById(orderPrivateCar);
@@ -589,10 +591,10 @@
             this.updateById(orderPrivateCar);
             return true;//第一条数据不作处理,直接存储
         }
-        Map<String, String> distance = gdMapElectricFenceUtil.getDistance(now, old, 0);//直线距离
+        Map<String, Double> distance = GeodesyUtil.getDistance(now, old);//直线距离
         if(null != distance){
-            String distance1 = distance.get("distance");
-            if(Double.valueOf(distance1) > 50 && orderPrivateCar.getState()==5/* && orderPosition.getInsertTime().getTime()>=orderPrivateCar.getBoardingTime().getTime()*/){//大于50米表示在移动
+            Double distance1 = distance.get("WGS84");
+            if(distance1 > 50 && orderPrivateCar.getState()==5){//大于50米表示在移动
                 orderPrivateCar.setMileage(new BigDecimal(orderPrivateCar.getMileage()).add(new BigDecimal(distance1)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                 this.updateById(orderPrivateCar);
                 return true;

--
Gitblit v1.7.1