From 01cd5e4848adef3533b51d4128613f5844a80dfc Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Wed, 29 Mar 2023 20:35:15 +0800 Subject: [PATCH] =?UTF-8?q?[3.0.0]=20=E5=8F=B8=E6=9C=BA=E7=AB=AF=E9=9F=A9?= =?UTF-8?q?=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/och/bus/bean/BusStationBean.java | 5 ++++ .../com/mogo/och/bus/model/OrderModel.java | 24 ++++++++++++------- .../com/mogo/och/bus/bean/BusStationBean.java | 5 ++++ .../com/mogo/och/bus/model/OrderModel.java | 24 ++++++++++++------- 4 files changed, 42 insertions(+), 16 deletions(-) diff --git a/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/bean/BusStationBean.java b/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/bean/BusStationBean.java index 33afb10366..43cfd8c9d9 100644 --- a/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/bean/BusStationBean.java +++ b/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/bean/BusStationBean.java @@ -8,6 +8,7 @@ package com.mogo.och.bus.bean; public class BusStationBean { private int siteId; private String name; + private String nameKr; private int seq; private double gcjLon; //高德 private double gcjLat; //高德 @@ -21,6 +22,10 @@ public class BusStationBean { private int status; private int ifStop = 1; // 是否需要停靠、1需要、0不需要 // TODO: 2021/10/19 原来站点里有设计是否需要停靠字段,现设计暂无,默认都需要停靠 + public String getNameKr() { + return nameKr; + } + public double getGcjLon() { return gcjLon; } diff --git a/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/model/OrderModel.java b/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/model/OrderModel.java index fedea9b825..dba8586d78 100644 --- a/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/model/OrderModel.java +++ b/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/model/OrderModel.java @@ -581,11 +581,12 @@ public class OrderModel { * 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站, * 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染 */ - private void leaveStationSuccess(int leaveIndex, String leaveStation, String nextStation) { + private void leaveStationSuccess(int leaveIndex, String leaveStation, + String nextStation, String nextStationKr) { onStartAutopilot(leaveIndex); - leaveTTSTips(nextStation); + leaveTTSTips(nextStation,nextStationKr); if (busRoutesResult != null) { boolean isLastStop = false; @@ -657,6 +658,7 @@ public class OrderModel { } int arrivedStationIndex = backgroundCurrentStationIndex + 1; String arriveStation = stationList.get(arrivedStationIndex).getName(); + String arriveStationKr = stationList.get(arrivedStationIndex).getNameKr(); String departureStopName = stationList.get(backgroundCurrentStationIndex).getName(); CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation-currentStationIndex = " + arrivedStationIndex); @@ -672,7 +674,8 @@ public class OrderModel { queryBusRoutes(); isArrivedStation = true; isGoingToNextStation = false; - arriveStationSuccess(arrivedStationIndex, departureStopName, arriveStation); + arriveStationSuccess(arrivedStationIndex, departureStopName, + arriveStation,arriveStationKr); } //5s轮询核销乘客 // startOrStopQueryPassengerWriteOff(true); @@ -701,7 +704,8 @@ public class OrderModel { }); } - private void arriveStationSuccess(int arrivedStationIndex, String departureStopName, String arriveStation) { + private void arriveStationSuccess(int arrivedStationIndex, String departureStopName, + String arriveStation, String arriveStationKr) { if (busRoutesResult != null) { boolean isLastStop = false; if (arrivedStationIndex == busRoutesResult.getSites().size() - 1) { @@ -714,7 +718,7 @@ public class OrderModel { , arriveStation , isLastStop); } - VoiceManager.INSTANCE.arrivedStation(arriveStation); + VoiceManager.INSTANCE.arrivedStation(arriveStation,arriveStationKr); } /** @@ -723,11 +727,14 @@ public class OrderModel { public void leaveStation() { CallerLogger.INSTANCE.d(M_BUS + TAG, "leaveStation-backgroundCurrentStationIndex = " + backgroundCurrentStationIndex); String nextStationName = ""; + String nextStationNameKr = ""; if (backgroundCurrentStationIndex < stationList.size() - 1) { nextStationName = stationList.get(backgroundCurrentStationIndex + 1).getName(); + nextStationNameKr = stationList.get(backgroundCurrentStationIndex + 1).getNameKr(); } final String currentStationName = stationList.get(backgroundCurrentStationIndex).getName(); String finalNextStationName = nextStationName; + String finalNextStationNameKr = nextStationNameKr; OrderServiceManager.leaveStation(mContext, stationList.get(backgroundCurrentStationIndex).getSeq(), stationList.get(backgroundCurrentStationIndex).getSiteId(), @@ -740,7 +747,8 @@ public class OrderModel { //需要更改当前站和下一站的状态 然后渲染 //startOrStopQueryPassengerWriteOff(false); queryBusRoutes(); - leaveStationSuccess(backgroundCurrentStationIndex, currentStationName, finalNextStationName); + leaveStationSuccess(backgroundCurrentStationIndex, currentStationName, + finalNextStationName,finalNextStationNameKr); } @@ -765,12 +773,12 @@ public class OrderModel { } //车站10s后播报 - private void leaveTTSTips(String nextStation) { + private void leaveTTSTips(String nextStation,String nextStationKr) { UiThreadHandler.postDelayed(new Runnable() { @Override public void run() { - VoiceManager.INSTANCE.leaveStation(nextStation); + VoiceManager.INSTANCE.leaveStation(nextStation,nextStationKr); } },DELAY_10S); } diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/bean/BusStationBean.java b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/bean/BusStationBean.java index 304e99b5c3..02087308ad 100644 --- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/bean/BusStationBean.java +++ b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/bean/BusStationBean.java @@ -8,6 +8,7 @@ package com.mogo.och.bus.bean; public class BusStationBean { private int siteId; private String name; + private String nameKr; private int seq; private double gcjLon; //高德 private double gcjLat; //高德 @@ -16,6 +17,10 @@ public class BusStationBean { private int drivingStatus;//行驶信息,0初始值;1已经过;2当前站;3未到站 private boolean leaving; + public String getNameKr() { + return nameKr; + } + public int getSiteId() { return siteId; } diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java index bc2f8186b1..6cede59cae 100644 --- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java +++ b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java @@ -568,11 +568,12 @@ public class OrderModel { * 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站, * 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染 */ - private void leaveStationSuccess(int leaveIndex, String leaveStation, String nextStation) { + private void leaveStationSuccess(int leaveIndex, String leaveStation, + String nextStation,String nextStationKr) { onStartAutopilot(leaveIndex); - leaveTTSTips(nextStation); + leaveTTSTips(nextStation,nextStationKr); sendStartStationToClient(nextStation); @@ -646,6 +647,7 @@ public class OrderModel { } int arrivedStationIndex = backgroundCurrentStationIndex + 1; String arriveStation = stationList.get(arrivedStationIndex).getName(); + String arriveStationKr = stationList.get(arrivedStationIndex).getNameKr(); String departureStopName = stationList.get(backgroundCurrentStationIndex).getName(); CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation-currentStationIndex = " + arrivedStationIndex); @@ -661,7 +663,8 @@ public class OrderModel { queryBusRoutes(); isArrivedStation = true; isGoingToNextStation = false; - arriveStationSuccess(arrivedStationIndex, departureStopName, arriveStation); + arriveStationSuccess(arrivedStationIndex, departureStopName, + arriveStation,arriveStationKr); } //5s轮询核销乘客 // startOrStopQueryPassengerWriteOff(true); @@ -690,7 +693,8 @@ public class OrderModel { }); } - private void arriveStationSuccess(int arrivedStationIndex, String departureStopName, String arriveStation) { + private void arriveStationSuccess(int arrivedStationIndex, String departureStopName, + String arriveStation,String arriveStationKr) { if (busRoutesResult != null) { boolean isLastStop = false; if (arrivedStationIndex == busRoutesResult.getSites().size() - 1) { @@ -704,7 +708,7 @@ public class OrderModel { , isLastStop); } - VoiceManager.INSTANCE.arrivedStation(arriveStation); + VoiceManager.INSTANCE.arrivedStation(arriveStation,arriveStationKr); sendArrivedStationToClient(arriveStation); } @@ -748,11 +752,14 @@ public class OrderModel { public void leaveStation() { CallerLogger.INSTANCE.d(M_BUS + TAG, "leaveStation-backgroundCurrentStationIndex = " + backgroundCurrentStationIndex); String nextStationName = ""; + String nextStationNameKr = ""; if (backgroundCurrentStationIndex < stationList.size() - 1) { nextStationName = stationList.get(backgroundCurrentStationIndex + 1).getName(); + nextStationNameKr = stationList.get(backgroundCurrentStationIndex + 1).getNameKr(); } final String currentStationName = stationList.get(backgroundCurrentStationIndex).getName(); String finalNextStationName = nextStationName; + String finalNextStationNameKr = nextStationNameKr; OrderServiceManager.leaveStation(mContext, stationList.get(backgroundCurrentStationIndex).getSeq(), stationList.get(backgroundCurrentStationIndex).getSiteId(), @@ -765,7 +772,8 @@ public class OrderModel { //需要更改当前站和下一站的状态 然后渲染 //startOrStopQueryPassengerWriteOff(false); queryBusRoutes(); - leaveStationSuccess(backgroundCurrentStationIndex, currentStationName, finalNextStationName); + leaveStationSuccess(backgroundCurrentStationIndex, currentStationName, + finalNextStationName,finalNextStationNameKr); } @@ -790,11 +798,11 @@ public class OrderModel { } //车站10s后播报 - private void leaveTTSTips(String nextStation) { + private void leaveTTSTips(String nextStation,String nextStationKr) { UiThreadHandler.postDelayed(new Runnable() { @Override public void run() {//延迟10s播报 - VoiceManager.INSTANCE.leaveStation(nextStation); + VoiceManager.INSTANCE.leaveStation(nextStation,nextStationKr); } },DELAY_10S);