Merge branch 'dev_robobus-d_241202_6.8.4' into dev_robotaxi-d_241210_6.9.0
# Conflicts: # OCH/offline/driver/src/main/java/com/mogo/och/offline/model/OrderModel.java
This commit is contained in:
@@ -750,7 +750,10 @@ class DriverM1Model {
|
||||
if (it == null || it < 0) {
|
||||
LineManager.setLineInfo(null)
|
||||
} else {
|
||||
LineManager.setLineInfo(LineInfo(it.toLong(),mCurrentOrder?.lineName?:"", orderId = data.data.orderNo))
|
||||
LineManager.setLineInfo(
|
||||
LineInfo(it.toLong(),
|
||||
mCurrentOrder?.lineName?:"",
|
||||
orderId = data.data.orderNo))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -234,6 +234,10 @@ object OchAutoPilotStatusListenerManager : CallerBase<IOchAutopilotStatusListene
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 距离终点10m 向地盘查询是否到站地盘的返回值
|
||||
* [LineManager.mMapLocationListener]
|
||||
*/
|
||||
override fun onAutoPilotStation(
|
||||
token: Long,
|
||||
timestamp: Long,
|
||||
|
||||
@@ -54,7 +54,7 @@ public interface ILineCallback {
|
||||
default void startAutopilotSuccess(int source, String autopilotId){}
|
||||
|
||||
/**
|
||||
* 距离站点小于15m后向底盘查询是否到站底盘反馈 已到站
|
||||
* 距离站点小于10m后向底盘查询是否到站底盘反馈 已到站
|
||||
*/
|
||||
default void arrivedStationSuccessBySearch(){}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,11 @@ import kotlin.properties.Delegates
|
||||
*/
|
||||
object LineManager : CallerBase<ILineCallback>() {
|
||||
const val TAG = "LineManager"
|
||||
|
||||
const val firstStationFirstStartAutopilotFlag = 1
|
||||
const val middleStationFirstStartAutopilotFlag = 2
|
||||
const val norFirstStartAutopilotFlag = 3
|
||||
|
||||
/**
|
||||
* 线路信息
|
||||
*/
|
||||
@@ -73,10 +78,35 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
*/
|
||||
private var endStation: BusStationBean? = null
|
||||
|
||||
|
||||
/**
|
||||
* 和[autopilotId]相关 默认为true
|
||||
* 一个autopilotId范围内第一次启动自驾成功后 为false
|
||||
*/
|
||||
var isFirstStartAutopilot = true
|
||||
|
||||
/**
|
||||
* 线路、轨迹、站点 三者确定的id
|
||||
* 和[teleOrderId] 相关的 默认为true
|
||||
* 一个teleOrderId范围内第一次启动自驾成功后 为false
|
||||
*/
|
||||
var teleIsFirstStartAutopilot = true
|
||||
|
||||
/**
|
||||
* 1 首站点触发
|
||||
* 2 中间站点触发
|
||||
* 3 新的站点第一次启动自驾成功后
|
||||
*/
|
||||
var autopilotFlag : Int by Delegates.observable(firstStationFirstStartAutopilotFlag) { _, oldValue, newValue ->
|
||||
if(oldValue!=newValue){
|
||||
d(TAG,"autopilotFlag old=$oldValue new=$newValue")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* bizId 小巴、接驳、班车 时任务id
|
||||
* taxi 目前是orderNo 6.9.0改为任务id
|
||||
* ochCommon 抽象的自驾id
|
||||
* 生成规则 lineId_startsiteId_endsiteId_bizId
|
||||
*/
|
||||
private var autopilotId: String by Delegates.observable("") { _, oldValue, newValue ->
|
||||
if (oldValue != newValue) {
|
||||
@@ -103,8 +133,21 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* bizId 小巴、接驳、班车 时任务id
|
||||
* taxi 目前是orderNo 6.9.0改为任务id
|
||||
* 向地盘传递的orderId
|
||||
* 生成规则 lineId_siteId1_siteId2_siteId3...siteIdn_bizId
|
||||
*/
|
||||
private var teleOrderId: String by Delegates.observable("") { _, oldValue, newValue ->
|
||||
if (oldValue != newValue) {
|
||||
teleIsFirstStartAutopilot = true
|
||||
}
|
||||
}
|
||||
|
||||
// 自车定位
|
||||
/**
|
||||
* 当前车辆经纬度
|
||||
*/
|
||||
private val mMapLocationListener = object : IMoGoChassisLocationGCJ02Listener {
|
||||
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
|
||||
if (null == mogoLocation) return
|
||||
@@ -116,28 +159,43 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
mogoLocation.longitude, mogoLocation.latitude
|
||||
)
|
||||
if (distance <= OchCommonConst.ARRIVE_AT_END_STATION_DISTANCE) {
|
||||
val token = CallerAutoPilotControlManager.sendSsmFuncQueryAutoPilotStation(autopilotId)
|
||||
/**
|
||||
* 在终点10m 范围内向地盘查询是否到站
|
||||
* [com.mogo.och.bridge.autopilot.autopilot.OchAutoPilotStatusListenerManager.onAutoPilotStation]
|
||||
*/
|
||||
val token = CallerAutoPilotControlManager.sendSsmFuncQueryAutoPilotStation(teleOrderId)
|
||||
OchChainLogManager.writeChainLogAutopilot("到站逻辑","距离站点:$distance 请求token:$token")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [mMapLocationListener] 距离终点小于[OchCommonConst.ARRIVE_AT_END_STATION_DISTANCE]后向底盘请求的返回值调用
|
||||
* @param orderId 和线路相关的值
|
||||
* @param arrivedStationFlag 是否到站 true 到站 false 没有到站
|
||||
*/
|
||||
fun invokeArrivedStation(orderId: String, arrivedStationFlag: Boolean) {
|
||||
if (this.autopilotId==orderId&&arrivedStationFlag){
|
||||
if (this.teleOrderId == orderId && arrivedStationFlag) {
|
||||
M_LISTENERS.forEach {
|
||||
it.value.arrivedStationSuccessBySearch()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun searchAutopilotState(){
|
||||
CallerAutoPilotControlManager.sendSsmFuncQueryAutoPilotInfo()
|
||||
}
|
||||
|
||||
/**
|
||||
* [searchAutopilotState] 方法请求的返回值
|
||||
*/
|
||||
fun invokeSetIsFirstAutopilot(orderId: String?, firstAutopilotFlag: Boolean, count: Int) {
|
||||
if (this.autopilotId==orderId){
|
||||
if (this.teleOrderId==orderId){
|
||||
if(count>=1){
|
||||
isFirstStartAutopilot = false
|
||||
teleIsFirstStartAutopilot = false
|
||||
}else{
|
||||
isFirstStartAutopilot = true
|
||||
teleIsFirstStartAutopilot = true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -146,9 +204,6 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
* 设置站点信息
|
||||
*/
|
||||
fun setStartAndEndStation(startStation: BusStationBean?, endStation: BusStationBean?) {
|
||||
if(this.startStation!=startStation||this.endStation!=endStation){
|
||||
isFirstStartAutopilot = true
|
||||
}
|
||||
this.startStation = startStation
|
||||
this.endStation = endStation
|
||||
if(startStation==null||endStation==null){
|
||||
@@ -168,6 +223,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
@JvmStatic
|
||||
fun setLineInfo(lineInfo: LineInfo?) {
|
||||
if (lineInfo == null) {
|
||||
teleOrderId = ""
|
||||
clearGlobalTrajectory(true)
|
||||
CallerEagleBaseFunctionCall4OchManager.updateOrderLine("")
|
||||
}
|
||||
@@ -180,10 +236,11 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
line.multiMap?.forEach {
|
||||
sb.append(it.value)
|
||||
}
|
||||
OchChainLogManager.writeChainLogAutopilot("设置线路", "$sb")
|
||||
CallerEagleBaseFunctionCall4OchManager.updateOrderLine(sb.toString())
|
||||
}
|
||||
}
|
||||
OchChainLogManager.writeChainLogAutopilot("自驾参数", "线路信息:$contraiInfo")
|
||||
OchChainLogManager.writeChainLogAutopilot("设置线路", "线路信息:$_lineInfos")
|
||||
}
|
||||
|
||||
fun getStations(): Pair<BusStationBean?, BusStationBean?> {
|
||||
@@ -266,6 +323,11 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
return@getStationsWithLine
|
||||
}
|
||||
d(M_BUS + TAG, "AutopilotControlParameters is update.")
|
||||
if (lineInfo.isFirstStation(start)) {
|
||||
autopilotFlag = firstStationFirstStartAutopilotFlag
|
||||
}else{
|
||||
autopilotFlag = middleStationFirstStartAutopilotFlag
|
||||
}
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(parameters)
|
||||
val startStationLocation = MogoLocation()
|
||||
startStationLocation.latitude = start.gcjLat
|
||||
@@ -280,13 +342,12 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
searchAutopilotState()
|
||||
}
|
||||
}
|
||||
fun searchAutopilotState(){
|
||||
CallerAutoPilotControlManager.sendSsmFuncQueryAutoPilotInfo()
|
||||
}
|
||||
|
||||
private fun clearAutopilotControlParameters(){
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(null)
|
||||
TrajectoryAndDistanceManager.setStationPoint(null, null, null)
|
||||
autopilotId = ""
|
||||
autopilotFlag = firstStationFirstStartAutopilotFlag
|
||||
OchLocationManager.removeGCJ02Listener(TAG)
|
||||
}
|
||||
|
||||
@@ -324,6 +385,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
var parameters: AutopilotControlParameters? = null
|
||||
getStationsWithLine { start, end, lineInfo ->
|
||||
this.autopilotId = "${lineInfo.lineId}_${start.siteId}_${end.siteId}_${lineInfo.orderId}"
|
||||
this.teleOrderId = lineInfo.genAutopilotId()
|
||||
}
|
||||
getStationsWithLineAndContrai { start, end, lineInfo, contrai ->
|
||||
parameters = AutopilotControlParameters()
|
||||
@@ -334,8 +396,8 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
parameters?.startLatLon = AutoPilotLonLat(start.lat, start.lon)
|
||||
parameters?.endLatLon = AutoPilotLonLat(end.lat, end.lon)
|
||||
parameters?.vehicleType = 10
|
||||
parameters?.orderId = this.autopilotId
|
||||
parameters?.firstAutopilotFlag = isFirstStartAutopilot
|
||||
parameters?.orderId = this.teleOrderId
|
||||
parameters?.firstAutopilotFlag = teleIsFirstStartAutopilot
|
||||
|
||||
if (parameters?.autoPilotLine == null) {
|
||||
parameters?.autoPilotLine = AutoPilotLine(
|
||||
@@ -355,7 +417,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
)
|
||||
}
|
||||
|
||||
val (wayLatLons, blackLatLons) = getWayBlackLatLons(contrai.passPoints, contrai.blackPoints)
|
||||
val (wayLatLons, blackLatLons) = contrai.getWayBlackLatLons()
|
||||
|
||||
parameters?.wayLatLons = wayLatLons
|
||||
parameters?.blackLatLons = blackLatLons
|
||||
@@ -545,7 +607,10 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
type,
|
||||
source
|
||||
)
|
||||
if(send){
|
||||
if(send){// 启动自驾成功回调
|
||||
teleIsFirstStartAutopilot = false
|
||||
isFirstStartAutopilot = false
|
||||
autopilotFlag = norFirstStartAutopilotFlag
|
||||
M_LISTENERS.forEach {
|
||||
it.value.startAutopilotSuccess(source,autopilotId)
|
||||
}
|
||||
@@ -575,7 +640,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
}
|
||||
|
||||
fun compareFSMAndOchOrderId(autopilotIdFromFsm: String?) {
|
||||
if(autopilotIdFromFsm == autopilotId){
|
||||
if(autopilotIdFromFsm == teleOrderId){
|
||||
// 地盘有和上层一样 不用操作
|
||||
}else{
|
||||
if(autopilotIdFromFsm.isNullOrEmpty()){
|
||||
@@ -583,8 +648,8 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
}else{
|
||||
// 地盘有但是和och出不一样
|
||||
// todo 需要och 重新出发轨迹下载操作
|
||||
ToastUtils.showShort("${autopilotIdFromFsm}_${autopilotId}_自动驾驶id不同请排查")
|
||||
OchChainLogManager.writeChainLogAutopilot("自驾Id","${autopilotIdFromFsm}_${autopilotId}_自动驾驶id不同请排查")
|
||||
ToastUtils.showShort("${autopilotIdFromFsm}_${teleOrderId}_自动驾驶id不同请排查")
|
||||
OchChainLogManager.writeChainLogAutopilot("自驾Id","${autopilotIdFromFsm}_${teleOrderId}_自动驾驶id不同请排查")
|
||||
// val initAutopilotControlParameters = initAutopilotControlParameters()
|
||||
// if (initAutopilotControlParameters!==null&&initAutopilotControlParameters.autoPilotLine!=null
|
||||
// && contraiInfo!=null
|
||||
|
||||
@@ -549,7 +549,7 @@ object CoordinateCalculateRouteUtil {
|
||||
}
|
||||
|
||||
fun getHeadingAngle(location: MogoLocation, nextPoint: MogoLocation): Double {
|
||||
return getHeadingAngle(
|
||||
return getHeadingAngleTemp(
|
||||
location.longitude,
|
||||
location.latitude,
|
||||
nextPoint.longitude,
|
||||
|
||||
@@ -33,6 +33,8 @@ import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.och.common.module.debug.location.MogoLocationExit
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.scnner.ScannerManager
|
||||
//import com.mogo.och.bridge.distance.TrajectoryAndDistanceManager
|
||||
//import com.mogo.och.bridge.utils.CoordinateCalculateRouteUtil
|
||||
//import com.mogo.och.bridge.utils.CoordinateCalculateRouteUtil
|
||||
@@ -63,6 +65,7 @@ object DebugDataDispatch {
|
||||
const val v2N = "xiaozhiV2N"
|
||||
const val romal = "romal"
|
||||
const val visualView = "visual"
|
||||
const val scanner = "scanner"
|
||||
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "location" --es path "1111/11111"
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "globalPath" --es path "sy73.json"
|
||||
@@ -77,6 +80,7 @@ object DebugDataDispatch {
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "romal" --ei show 0
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "visual" --ei show 0
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "showDebugView"
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "scanner" --es qrInfo ""
|
||||
|
||||
|
||||
val ROOT_PATH =
|
||||
@@ -89,6 +93,12 @@ object DebugDataDispatch {
|
||||
|
||||
}
|
||||
when (type) {
|
||||
scanner -> {
|
||||
val qrInfo = intent.getStringExtra("qrInfo")
|
||||
BizLoopManager.runInIoThread{
|
||||
ScannerManager.parseParams("orderNo=1871744897569038336&uid=828aa91f-49a1-f9b3-4526-f58acda9df60&pipe=mogogosafety&phone=houyanli&lineId=134&expiryTime=1735094149070&bookingTime=1735056000000&tenantId=337197925358633123&availableTimes=1&ticketSize=1&ticketName=%E9%80%9A%E5%8B%A4%E7%A5%A8%E3%81%AE&type=14&shiftsId=4249")
|
||||
}
|
||||
}
|
||||
globalPathMock -> {
|
||||
sourceFilePath?.let {
|
||||
loadRawPoints(ROOT_PATH+it)
|
||||
|
||||
@@ -235,7 +235,7 @@ object ScannerManager : IOchLanPassengerStatusListener {
|
||||
}
|
||||
}
|
||||
|
||||
private fun parseParams(payload: String?) {
|
||||
fun parseParams(payload: String?) {
|
||||
val parse = Uri.parse("${OchCommonConst.getShuttleUrl()}?${payload}")
|
||||
val queryParameterNames = parse.queryParameterNames
|
||||
val mutableMapOf = mutableMapOf<String, String>()
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
package com.mogo.och.common.module.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoBaseManager;
|
||||
import com.shuyu.gsyvideoplayer.player.IPlayerManager;
|
||||
import com.shuyu.gsyvideoplayer.player.IjkPlayerManager;
|
||||
import com.shuyu.gsyvideoplayer.utils.CommonUtil;
|
||||
import com.shuyu.gsyvideoplayer.video.base.GSYVideoPlayer;
|
||||
import com.mogo.och.common.module.R;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.shuyu.gsyvideoplayer.utils.CommonUtil.hideNavKey;
|
||||
|
||||
/**
|
||||
* 多个播放的管理器
|
||||
* Created by guoshuyu on 2018/1/31.
|
||||
*/
|
||||
|
||||
public class CustomManager extends GSYVideoBaseManager {
|
||||
|
||||
public static final int SMALL_ID = R.id.custom_small_id;
|
||||
|
||||
public static final int FULLSCREEN_ID = R.id.custom_full_id;
|
||||
|
||||
public static String TAG = "GSYVideoManager";
|
||||
|
||||
private static Map<String, CustomManager> sMap = new HashMap<>();
|
||||
|
||||
|
||||
public CustomManager() {
|
||||
init();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IPlayerManager getPlayManager() {
|
||||
return new IjkPlayerManager();
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出全屏,主要用于返回键
|
||||
*
|
||||
* @return 返回是否全屏
|
||||
*/
|
||||
@SuppressWarnings("ResourceType")
|
||||
public static boolean backFromWindowFull(Context context, String key) {
|
||||
boolean backFrom = false;
|
||||
ViewGroup vp = (ViewGroup) (CommonUtil.scanForActivity(context)).findViewById(Window.ID_ANDROID_CONTENT);
|
||||
View oldF = vp.findViewById(FULLSCREEN_ID);
|
||||
if (oldF != null) {
|
||||
backFrom = true;
|
||||
hideNavKey(context);
|
||||
if (getCustomManager(key).lastListener() != null) {
|
||||
getCustomManager(key).lastListener().onBackFullscreen();
|
||||
}
|
||||
}
|
||||
return backFrom;
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面销毁了记得调用是否所有的video
|
||||
*/
|
||||
public static void releaseAllVideos(String key) {
|
||||
if (getCustomManager(key).listener() != null) {
|
||||
getCustomManager(key).listener().onCompletion();
|
||||
}
|
||||
getCustomManager(key).releaseMediaPlayer();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 暂停播放
|
||||
*/
|
||||
public void onPause(String key) {
|
||||
if (getCustomManager(key).listener() != null) {
|
||||
getCustomManager(key).listener().onVideoPause();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复播放
|
||||
*/
|
||||
public void onResume(String key) {
|
||||
if (getCustomManager(key).listener() != null) {
|
||||
getCustomManager(key).listener().onVideoResume();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 恢复暂停状态
|
||||
*
|
||||
* @param seek 是否产生seek动作,直播设置为false
|
||||
*/
|
||||
public void onResume(String key, boolean seek) {
|
||||
if (getCustomManager(key).listener() != null) {
|
||||
getCustomManager(key).listener().onVideoResume(seek);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 单例管理器
|
||||
*/
|
||||
public static synchronized Map<String, CustomManager> instance() {
|
||||
return sMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 单例管理器
|
||||
*/
|
||||
public static synchronized CustomManager getCustomManager(String key) {
|
||||
if (TextUtils.isEmpty(key)) {
|
||||
throw new IllegalStateException("key not be empty");
|
||||
}
|
||||
CustomManager customManager = sMap.get(key);
|
||||
if (customManager == null) {
|
||||
customManager = new CustomManager();
|
||||
sMap.put(key, customManager);
|
||||
}
|
||||
return customManager;
|
||||
}
|
||||
|
||||
public static void onPauseAll() {
|
||||
if (sMap.size() > 0) {
|
||||
for (Map.Entry<String, CustomManager> header : sMap.entrySet()) {
|
||||
header.getValue().onPause(header.getKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void onResumeAll() {
|
||||
if (sMap.size() > 0) {
|
||||
for (Map.Entry<String, CustomManager> header : sMap.entrySet()) {
|
||||
header.getValue().onResume(header.getKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复暂停状态
|
||||
*
|
||||
* @param seek 是否产生seek动作
|
||||
*/
|
||||
public static void onResumeAll(boolean seek) {
|
||||
if (sMap.size() > 0) {
|
||||
for (Map.Entry<String, CustomManager> header : sMap.entrySet()) {
|
||||
header.getValue().onResume(header.getKey(), seek);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void clearAllVideo() {
|
||||
if (sMap.size() > 0) {
|
||||
for (Map.Entry<String, CustomManager> header : sMap.entrySet()) {
|
||||
CustomManager.releaseAllVideos(header.getKey());
|
||||
}
|
||||
}
|
||||
sMap.clear();
|
||||
}
|
||||
|
||||
public static void removeManager(String key) {
|
||||
sMap.remove(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前是否全屏状态
|
||||
*
|
||||
* @return 当前是否全屏状态, true代表是。
|
||||
*/
|
||||
@SuppressWarnings("ResourceType")
|
||||
public static boolean isFullState(Activity activity) {
|
||||
ViewGroup vp = (ViewGroup) (CommonUtil.scanForActivity(activity)).findViewById(Window.ID_ANDROID_CONTENT);
|
||||
final View full = vp.findViewById(FULLSCREEN_ID);
|
||||
GSYVideoPlayer gsyVideoPlayer = null;
|
||||
if (full != null) {
|
||||
gsyVideoPlayer = (GSYVideoPlayer) full;
|
||||
}
|
||||
return gsyVideoPlayer != null;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import android.content.Context
|
||||
import android.media.AudioManager
|
||||
import android.net.Uri
|
||||
import android.text.TextUtils
|
||||
import android.util.AttributeSet
|
||||
import android.widget.ImageView
|
||||
import android.widget.RelativeLayout
|
||||
@@ -13,6 +14,7 @@ import com.mogo.eagle.core.utilcode.util.FileUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
|
||||
import com.mogo.och.common.module.utils.CustomManager
|
||||
import com.mogo.och.common.module.R
|
||||
import com.mogo.och.common.module.wigets.media.MediaFileCacheManager
|
||||
import com.mogo.och.common.module.wigets.media.MediaItem
|
||||
@@ -22,8 +24,10 @@ import com.mogo.skin.utils.SkinResources
|
||||
import com.mogo.skin.widget.SkinImageView
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
|
||||
import com.shuyu.gsyvideoplayer.utils.Debuger
|
||||
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
|
||||
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
|
||||
import com.shuyu.gsyvideoplayer.video.base.GSYVideoViewBridge
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
import java.io.File
|
||||
|
||||
@@ -250,6 +254,49 @@ class AdvanceGSYVideoPlayer : StandardGSYVideoPlayer {
|
||||
GSYVideoType.setRenderType(GSYVideoType.GLSURFACE)
|
||||
}
|
||||
|
||||
override fun init(context: Context) {
|
||||
super.init(context)
|
||||
onAudioFocusChangeListener =
|
||||
AudioManager.OnAudioFocusChangeListener { focusChange ->
|
||||
when (focusChange) {
|
||||
AudioManager.AUDIOFOCUS_GAIN -> {}
|
||||
AudioManager.AUDIOFOCUS_LOSS -> {
|
||||
//todo 判断如果不是外界造成的就不处理
|
||||
}
|
||||
|
||||
AudioManager.AUDIOFOCUS_LOSS_TRANSIENT -> {
|
||||
//todo 判断如果不是外界造成的就不处理
|
||||
}
|
||||
|
||||
AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getGSYVideoManager(): GSYVideoViewBridge {
|
||||
CustomManager.getCustomManager(getKey()).initContext(getContext().getApplicationContext());
|
||||
return CustomManager.getCustomManager(getKey());
|
||||
}
|
||||
|
||||
override fun releaseVideos() {
|
||||
CustomManager.releaseAllVideos(getKey())
|
||||
}
|
||||
|
||||
override fun backFromFull(context: Context?): Boolean {
|
||||
return CustomManager.backFromWindowFull(context, getKey())
|
||||
}
|
||||
|
||||
fun getKey(): String {
|
||||
if (mPlayPosition == -22) {
|
||||
Debuger.printfError(javaClass.simpleName + " used getKey() " + "******* PlayPosition never set. ********")
|
||||
}
|
||||
if (TextUtils.isEmpty(mPlayTag)) {
|
||||
Debuger.printfError(javaClass.simpleName + " used getKey() " + "******* PlayTag never set. ********")
|
||||
}
|
||||
Logger.d("MediaLoopPlayView", "key ${(MediaLoopPlayView.TAG + mPlayPosition).toString() + mPlayTag}")
|
||||
return (MediaLoopPlayView.TAG + mPlayPosition).toString() + mPlayTag
|
||||
}
|
||||
|
||||
override fun hideAllWidget() {
|
||||
Logger.d(MediaLoopPlayView.TAG, "AdvanceGSYVideoPlayer,hideAllWidget")
|
||||
}
|
||||
|
||||
5
OCH/common/common/src/main/res/values/ids.xml
Normal file
5
OCH/common/common/src/main/res/values/ids.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<item name="custom_full_id" type="id" />
|
||||
<item name="custom_small_id" type="id" />
|
||||
</resources>
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.och.data.bean
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLonLat
|
||||
|
||||
data class ContraiInfo(
|
||||
/**
|
||||
* 线路id
|
||||
@@ -34,4 +36,67 @@ data class ContraiInfo(
|
||||
var passPoints: MutableList<BusStationBean>?=null, // 用于算路的经停点
|
||||
var blackPoints: MutableList<BusStationBean>?=null, // 用于算路的黑名單點
|
||||
val source:Int = 1, //轨迹来源:1 录制;2 自主计算
|
||||
)
|
||||
){
|
||||
fun getWayBlackLatLons(
|
||||
): Pair<MutableList<AutoPilotLonLat>, MutableList<AutoPilotLonLat>> {
|
||||
val wayLatLons = mutableListOf<AutoPilotLonLat>()
|
||||
// 途经点
|
||||
if (!passPoints.isNullOrEmpty()) {
|
||||
for (mogoLatLng in passPoints!!) {
|
||||
wayLatLons.add(
|
||||
AutoPilotLonLat(
|
||||
mogoLatLng.lat,
|
||||
mogoLatLng.lon,
|
||||
when (mogoLatLng.pointType) {
|
||||
1 -> {//途径点
|
||||
false
|
||||
}
|
||||
|
||||
2 -> {//禁行点
|
||||
false
|
||||
}
|
||||
|
||||
3 -> {//站点
|
||||
true
|
||||
}
|
||||
|
||||
else -> {
|
||||
false
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
val blackLatLons = mutableListOf<AutoPilotLonLat>()
|
||||
// 黑名单点
|
||||
if (!blackPoints.isNullOrEmpty()) {
|
||||
for (mogoLatLng in blackPoints!!) {
|
||||
blackLatLons.add(
|
||||
AutoPilotLonLat(
|
||||
mogoLatLng.lat,
|
||||
mogoLatLng.lat,
|
||||
when (mogoLatLng.pointType) {
|
||||
1 -> {//途径点
|
||||
false
|
||||
}
|
||||
|
||||
2 -> {//禁行点
|
||||
false
|
||||
}
|
||||
|
||||
3 -> {//站点
|
||||
true
|
||||
}
|
||||
|
||||
else -> {
|
||||
false
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
return Pair(wayLatLons,blackLatLons)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,42 @@ data class LineInfo(
|
||||
*/
|
||||
var multiMap: MutableMap<String,String>? = mutableMapOf(),
|
||||
|
||||
val orderId:String?=null
|
||||
val orderId:String?=null,
|
||||
|
||||
)
|
||||
/**
|
||||
* 站点包含的线路
|
||||
*/
|
||||
var siteInfos:MutableList<BusStationBean> = mutableListOf(),
|
||||
|
||||
) {
|
||||
fun genAutopilotId(): String {
|
||||
val tempAutopilotId = StringBuilder()
|
||||
tempAutopilotId.append(lineId)
|
||||
siteInfos.forEach {
|
||||
tempAutopilotId.append("_")
|
||||
tempAutopilotId.append(it.siteId)
|
||||
}
|
||||
tempAutopilotId.append("_")
|
||||
tempAutopilotId.append(orderId)
|
||||
return tempAutopilotId.toString()
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
|
||||
other as LineInfo
|
||||
|
||||
return lineId == other.lineId
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return lineId.hashCode()
|
||||
}
|
||||
|
||||
fun isFirstStation(start: BusStationBean):Boolean {
|
||||
return siteInfos.first()==start
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
package com.mogo.och.data.db.exception
|
||||
|
||||
class DbException: RuntimeException {
|
||||
var code:Int = 0
|
||||
var msg:String = ""
|
||||
constructor() : super()
|
||||
constructor(message: String?) : super(message)
|
||||
constructor(code:Int, message: String) : super("${code}_${message}"){
|
||||
this.code = code
|
||||
this.msg = message
|
||||
}
|
||||
|
||||
companion object{
|
||||
const val NEEDSYNDATA = 10001
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"formatVersion": 1,
|
||||
"database": {
|
||||
"version": 6,
|
||||
"identityHash": "1d1af100293dd1557307b49359621a5f",
|
||||
"identityHash": "a2451ba8fe1fb6312258d93e3c2c2c8c",
|
||||
"entities": [
|
||||
{
|
||||
"tableName": "contrail_data_table",
|
||||
@@ -258,7 +258,7 @@
|
||||
},
|
||||
{
|
||||
"tableName": "task_data_table",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `task_id` INTEGER, `line_id` INTEGER, `task_data` INTEGER, `task_start_time` INTEGER, `start_time` INTEGER, `end_time` INTEGER, `task_get_time` INTEGER NOT NULL, `status` INTEGER)",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `shifts_id` INTEGER, `task_id` INTEGER, `line_id` INTEGER, `task_data` INTEGER, `task_start_time` INTEGER, `start_time` INTEGER, `end_time` INTEGER, `task_get_time` INTEGER NOT NULL, `status` INTEGER)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
@@ -266,6 +266,12 @@
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "shiftsId",
|
||||
"columnName": "shifts_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "taskId",
|
||||
"columnName": "task_id",
|
||||
@@ -345,7 +351,7 @@
|
||||
},
|
||||
{
|
||||
"tableName": "used_task_data_table",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `task_id` INTEGER, `line_id` INTEGER, `site_id` INTEGER, `line_name` TEXT, `name` TEXT, `name_kr` TEXT, `seq` INTEGER, `gcj_lon` REAL, `gcj_lat` REAL, `lon` REAL, `lat` REAL, `driving_status` INTEGER, `leaving` INTEGER, `arrived_time` INTEGER, `leave_time` INTEGER, `introduction` TEXT, `is_play_tts` INTEGER, `event_save_time` INTEGER NOT NULL, `videoList` TEXT)",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `task_id` INTEGER, `shifts_id` INTEGER, `line_id` INTEGER, `site_id` INTEGER, `line_name` TEXT, `name` TEXT, `name_kr` TEXT, `seq` INTEGER, `gcj_lon` REAL, `gcj_lat` REAL, `lon` REAL, `lat` REAL, `driving_status` INTEGER, `leaving` INTEGER, `arrived_time` INTEGER, `leave_time` INTEGER, `introduction` TEXT, `is_play_tts` INTEGER, `event_save_time` INTEGER NOT NULL, `videoList` TEXT)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
@@ -359,6 +365,12 @@
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "shiftsId",
|
||||
"columnName": "shifts_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "lineId",
|
||||
"columnName": "line_id",
|
||||
@@ -479,7 +491,7 @@
|
||||
},
|
||||
{
|
||||
"tableName": "event_data_table",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `event_type` TEXT, `lineId` INTEGER, `task_date` INTEGER, `lineName` TEXT, `task_id` INTEGER, `task_start_time` INTEGER, `business_time` INTEGER, `write_version` INTEGER, `site_id` INTEGER, `seq` INTEGER, `driver_id` INTEGER, `event_save_time` INTEGER NOT NULL, `update_status` INTEGER NOT NULL, `msg_id` TEXT, `update_time` INTEGER)",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `event_type` TEXT, `shifts_id` INTEGER, `lineId` INTEGER, `task_date` INTEGER, `lineName` TEXT, `task_id` INTEGER, `task_start_time` INTEGER, `business_time` INTEGER, `write_version` INTEGER, `site_id` INTEGER, `seq` INTEGER, `driver_id` INTEGER, `event_save_time` INTEGER NOT NULL, `update_status` INTEGER NOT NULL, `msg_id` TEXT, `update_time` INTEGER)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
@@ -493,6 +505,12 @@
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "shiftsId",
|
||||
"columnName": "shifts_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "lineId",
|
||||
"columnName": "lineId",
|
||||
@@ -599,7 +617,7 @@
|
||||
},
|
||||
{
|
||||
"tableName": "writeoff_data_table",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `msg_id` TEXT, `expiry_time` INTEGER, `booking_time` INTEGER, `type` INTEGER, `task_id` INTEGER, `task_date` INTEGER, `line_id` INTEGER, `site_id` INTEGER, `driver_id` INTEGER, `available_times` INTEGER, `order_no` TEXT, `uid` TEXT, `seq` TEXT, `business_time` INTEGER, `tick_size` INTEGER, `tick_name` TEXT, `event_save_time` INTEGER NOT NULL, `update_status` INTEGER NOT NULL, `update_time` INTEGER)",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `msg_id` TEXT, `expiry_time` INTEGER, `booking_time` INTEGER, `type` INTEGER, `shifts_id` INTEGER, `task_id` INTEGER, `task_date` INTEGER, `line_id` INTEGER, `site_id` INTEGER, `driver_id` INTEGER, `available_times` INTEGER, `order_no` TEXT, `uid` TEXT, `seq` TEXT, `business_time` INTEGER, `tick_size` INTEGER, `tick_name` TEXT, `event_save_time` INTEGER NOT NULL, `update_status` INTEGER NOT NULL, `update_time` INTEGER)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
@@ -631,6 +649,12 @@
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "shiftsId",
|
||||
"columnName": "shifts_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "taskId",
|
||||
"columnName": "task_id",
|
||||
@@ -745,7 +769,7 @@
|
||||
"views": [],
|
||||
"setupQueries": [
|
||||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '1d1af100293dd1557307b49359621a5f')"
|
||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'a2451ba8fe1fb6312258d93e3c2c2c8c')"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -74,8 +74,9 @@ class BusRoutesResponse : BaseData() {
|
||||
if (lineInfo == null && taskAndsite.lineId != null && taskAndsite.lineName != null) {
|
||||
lineInfo = LineInfo(taskAndsite.lineId!!, taskAndsite.lineName!!, orderId = taskAndsite.taskId.toString())
|
||||
}
|
||||
lineInfo?.multiMap?.put("taskInfo",LineModel.getTaskTime())
|
||||
}
|
||||
lineInfo?.multiMap?.put("taskInfo",LineModel.getTaskTime())
|
||||
lineInfo?.siteInfos = result
|
||||
LineManager.setLineInfo(lineInfo)
|
||||
|
||||
return Pair(result,currentStationIndex)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.mogo.och.weaknet.bean.response
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.och.data.bean.SiteIntroduce
|
||||
import com.mogo.och.data.db.bean.ContrailDataBean
|
||||
@@ -82,6 +84,10 @@ data class CarExecutableTaskResponse(val data: List<Result>?) : BaseData(){
|
||||
dataInfo.taskList?.let { taskInfs ->
|
||||
taskInfs.forEach {
|
||||
it.lineId = lineId
|
||||
if(AppIdentityModeUtils.isScheduled(FunctionBuildConfig.appIdentityMode)) {
|
||||
// 班车需要前台生产任务Id 前台规则 任务id 等同模板id
|
||||
it.taskId = it.shiftsId
|
||||
}
|
||||
}
|
||||
TaskDb.addOrUpdate(taskInfs,lineId)
|
||||
}
|
||||
|
||||
@@ -98,11 +98,7 @@ object EventModel {
|
||||
}
|
||||
|
||||
waitUpdateWriteOffEvent?.let {writeOffEvents->
|
||||
writeOffEvents.forEach {
|
||||
it.updateStatus = EventDataBean.updated
|
||||
it.upDateTime = System.currentTimeMillis()
|
||||
}
|
||||
WriteOffDb.saveUpdateSuccess(writeOffEvents)
|
||||
WriteOffDb.saveUpdateSuccess(writeOffEvents,EventDataBean.updated,System.currentTimeMillis())
|
||||
}
|
||||
|
||||
isUpdating.set(false)
|
||||
|
||||
@@ -211,8 +211,8 @@ object LineModel {
|
||||
fun commitSwitchLineId(task: TaskDataBean, line: LineDataBean) {
|
||||
RxUtils.disposeSubscribe(startTaskDisposable)
|
||||
line.getLineIdAndName { lineId, lineName ->
|
||||
task.getLineIdAndName { taskId, taskTime,taskDate ->
|
||||
RepositoryManager.startTask(taskId, lineId, taskTime, lineName)
|
||||
task.getLineIdAndName { shiftsId,taskId, taskTime,taskDate ->
|
||||
RepositoryManager.startTask(shiftsId,taskId, lineId, taskTime, lineName)
|
||||
?.subscribeOn(Schedulers.io())
|
||||
?.observeOn(AndroidSchedulers.mainThread())
|
||||
?.subscribe(object : Observer<Boolean> {
|
||||
@@ -247,7 +247,7 @@ object LineModel {
|
||||
override fun onNext(data: Boolean) {
|
||||
d(TAG, "commitSwitchLineId onNext ${data}")
|
||||
if (data) {
|
||||
EventDb.saveEventTaskStart(taskId, lineId, taskTime, lineName,taskDate)
|
||||
EventDb.saveEventTaskStart(shiftsId,taskId, lineId, taskTime, lineName,taskDate)
|
||||
OrderModel.queryBusRoutes()
|
||||
BizLoopManager.runInIoThread{
|
||||
val querySiteByLineId = SiteDb.querySiteByLineId(lineId)
|
||||
@@ -311,8 +311,8 @@ object LineModel {
|
||||
}
|
||||
|
||||
fun endTask() {
|
||||
currentTask?.taskId?.let { taskId ->
|
||||
RepositoryManager.endTask(taskId)
|
||||
currentTask?.getLineIdAndName { shiftsId, taskId, taskTime, taskDate ->
|
||||
RepositoryManager.endTask(shiftsId,taskId)
|
||||
?.subscribeOn(Schedulers.io())
|
||||
?.observeOn(AndroidSchedulers.mainThread())
|
||||
?.subscribe(object : Observer<Boolean> {
|
||||
|
||||
@@ -265,6 +265,7 @@ object OrderModel {
|
||||
RepositoryManager.leaveStation(
|
||||
startStation.seq,
|
||||
startStation.siteId.toLong(),
|
||||
task.shiftsId?:0L,
|
||||
task.taskId?:0L,
|
||||
task.lineId?:0L,
|
||||
task.taskStartTime?:System.currentTimeMillis(),
|
||||
|
||||
@@ -118,22 +118,22 @@ object RepositoryManager {
|
||||
return lineRepository?.queryCanUserTask(lineId)
|
||||
}
|
||||
|
||||
fun startTask(taskId:Long,lineId:Long,taskTime:Long,lineName:String): Observable<Boolean>? {
|
||||
return lineRepository?.startTask(taskId,lineId,taskTime,lineName)
|
||||
fun startTask(shiftsId:Long,taskId:Long,lineId:Long,taskTime:Long,lineName:String): Observable<Boolean>? {
|
||||
return lineRepository?.startTask(shiftsId,taskId,lineId,taskTime,lineName)
|
||||
}
|
||||
|
||||
fun leaveStation(
|
||||
seq: Int, siteId: Long, taskId: Long, lineId: Long, taskStartTime: Long, taskDate: Long
|
||||
seq: Int, siteId: Long,shiftsId:Long ,taskId: Long, lineId: Long, taskStartTime: Long, taskDate: Long
|
||||
): Observable<Boolean>?{
|
||||
return lineRepository?.leaveStation(seq,siteId,taskId,lineId,taskStartTime,taskDate)
|
||||
return lineRepository?.leaveStation(seq,siteId,shiftsId,taskId,lineId,taskStartTime,taskDate)
|
||||
}
|
||||
|
||||
fun arriveStation(seq: Int, siteId: Long, taskId: Long): Observable<Boolean>?{
|
||||
return lineRepository?.arriveStation(seq,siteId,taskId)
|
||||
}
|
||||
|
||||
fun endTask(taskId: Long): Observable<Boolean>?{
|
||||
return lineRepository?.endTask(taskId)
|
||||
fun endTask(shiftsId:Long,taskId: Long): Observable<Boolean>?{
|
||||
return lineRepository?.endTask(shiftsId,taskId)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -91,7 +91,11 @@ abstract class MyDataBase : RoomDatabase() {
|
||||
private val MIGRATION_5_6 = object : Migration(5, 6) {
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("ALTER TABLE ${EventDataBean.tableName} ADD COLUMN task_date INTEGER")
|
||||
database.execSQL("ALTER TABLE ${EventDataBean.tableName} ADD COLUMN shifts_id INTEGER")
|
||||
database.execSQL("ALTER TABLE ${WriteOffDataBean.tableName} ADD COLUMN task_date INTEGER")
|
||||
database.execSQL("ALTER TABLE ${WriteOffDataBean.tableName} ADD COLUMN shifts_id INTEGER")
|
||||
database.execSQL("ALTER TABLE ${TaskDataBean.tableName} ADD COLUMN shifts_id INTEGER")
|
||||
database.execSQL("ALTER TABLE ${TaskSiteDataBean.tableName} ADD COLUMN shifts_id INTEGER")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,12 @@ data class EventDataBean(
|
||||
@ColumnInfo(name = "event_type", typeAffinity = ColumnInfo.TEXT)
|
||||
var eventType: String? = null,
|
||||
|
||||
/**
|
||||
* 生成任务的模板id
|
||||
*/
|
||||
@ColumnInfo(name = "shifts_id", typeAffinity = ColumnInfo.INTEGER)
|
||||
var shiftsId: Long? = null,
|
||||
|
||||
/**
|
||||
* 任务id、模板id
|
||||
*/
|
||||
|
||||
@@ -12,11 +12,17 @@ data class TaskDataBean(
|
||||
@SerializedName("idtemp")
|
||||
var id: Int = 0,
|
||||
|
||||
/**
|
||||
* 生成任务的模板id
|
||||
*/
|
||||
@ColumnInfo(name = "shifts_id", typeAffinity = ColumnInfo.INTEGER)
|
||||
var shiftsId: Long? = null,
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@ColumnInfo(name = "task_id", typeAffinity = ColumnInfo.INTEGER, index = true)
|
||||
@SerializedName("id", alternate = ["shiftsId"])
|
||||
@SerializedName("id")
|
||||
var taskId: Long? = null,
|
||||
|
||||
/**
|
||||
@@ -87,11 +93,13 @@ data class TaskDataBean(
|
||||
return result
|
||||
}
|
||||
|
||||
fun getLineIdAndName(function: (taskId: Long, taskTime: Long , taskDate:Long) -> Unit) {
|
||||
fun getLineIdAndName(function: (shiftsId:Long,taskId: Long, taskTime: Long , taskDate:Long) -> Unit) {
|
||||
taskId?.let { id ->
|
||||
taskStartTime?.let { time ->
|
||||
taskDate?.let { date ->
|
||||
function(id, time, date)
|
||||
shiftsId?.let {shiftsId->
|
||||
function(shiftsId,id, time, date)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,12 @@ data class TaskSiteDataBean(
|
||||
@ColumnInfo(name = "task_id", typeAffinity = ColumnInfo.INTEGER)
|
||||
var taskId: Long? = null,
|
||||
|
||||
/**
|
||||
* 生成任务的模板id
|
||||
*/
|
||||
@ColumnInfo(name = "shifts_id", typeAffinity = ColumnInfo.INTEGER)
|
||||
var shiftsId: Long? = null,
|
||||
|
||||
/**
|
||||
* 线路id
|
||||
*/
|
||||
@@ -130,12 +136,13 @@ data class TaskSiteDataBean(
|
||||
/**
|
||||
* 开始任务 并把第一站置为 2 当前站
|
||||
*/
|
||||
fun toTaskSiteDatas(querySites: List<SiteDataBean>, taskId:Long, lineName: String): MutableList<TaskSiteDataBean> {
|
||||
fun toTaskSiteDatas(querySites: List<SiteDataBean>,shiftsId:Long, taskId:Long, lineName: String): MutableList<TaskSiteDataBean> {
|
||||
val result = mutableListOf<TaskSiteDataBean>()
|
||||
var temp: TaskSiteDataBean?=null
|
||||
querySites.forEach {
|
||||
temp = TaskSiteDataBean()
|
||||
temp?.taskId = taskId
|
||||
temp?.shiftsId = shiftsId
|
||||
temp?.lineId = it.lineId
|
||||
temp?.lineName = lineName
|
||||
temp?.siteId = it.siteId
|
||||
|
||||
@@ -36,6 +36,13 @@ data class WriteOffDataBean(
|
||||
@ColumnInfo(name = "type", typeAffinity = ColumnInfo.INTEGER)
|
||||
var type: Int? = null,
|
||||
|
||||
|
||||
/**
|
||||
* 生成任务的模板id
|
||||
*/
|
||||
@ColumnInfo(name = "shifts_id", typeAffinity = ColumnInfo.INTEGER)
|
||||
var shiftsId: Long? = null,
|
||||
|
||||
/**
|
||||
* 当前的任务id、模板id
|
||||
*/
|
||||
|
||||
@@ -20,8 +20,8 @@ interface EventDataDao {
|
||||
@Delete
|
||||
fun delete(vararg eventDataBean: EventDataBean)
|
||||
|
||||
@Query("UPDATE ${EventDataBean.tableName} SET update_status = :status WHERE id = :id")
|
||||
fun updateUpdateSatus(id:Int,status:Int):Int
|
||||
@Query("UPDATE ${EventDataBean.tableName} SET update_status = :status,update_time = :currentTimeMillis WHERE id = :id")
|
||||
fun updateUpdateSatus(id: Int, status: Int, currentTimeMillis: Long):Int
|
||||
|
||||
|
||||
// 删除过时数据
|
||||
|
||||
@@ -39,5 +39,8 @@ interface WriteOffDataDao {
|
||||
@Query("SELECT count(1) FROM ${WriteOffDataBean.tableName} WHERE update_status = ${WriteOffDataBean.notUpdate}")
|
||||
fun queryWriteOffByStatusWithPageCount(): Int
|
||||
|
||||
@Query("UPDATE ${WriteOffDataBean.tableName} SET update_status = :updated ,update_time = :currentTimeMillis WHERE id = :id")
|
||||
fun updateStatusAndTime(updated: Int, currentTimeMillis: Long, id: Int)
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -30,11 +30,12 @@ object EventDb: IDbRepository {
|
||||
eventDataDao = null
|
||||
}
|
||||
|
||||
fun saveEventTaskStart(taskId: Long, lineId: Long, taskStartTime: Long, name: String,taskDate:Long) {
|
||||
fun saveEventTaskStart(shiftsId:Long,taskId: Long, lineId: Long, taskStartTime: Long, name: String,taskDate:Long) {
|
||||
val event = EventDataBean()
|
||||
event.eventType = EventDataBean.TaskStart
|
||||
event.lineId = lineId
|
||||
event.taskId = taskId
|
||||
event.shiftsId = shiftsId
|
||||
event.taskDate = taskDate
|
||||
event.lineName = name
|
||||
event.taskStartTime = taskStartTime
|
||||
@@ -51,6 +52,7 @@ object EventDb: IDbRepository {
|
||||
}
|
||||
|
||||
fun saveEventTaskArriveSite(
|
||||
shiftsId:Long,
|
||||
taskId: Long,
|
||||
lineId: Long,
|
||||
siteId: Long,
|
||||
@@ -62,6 +64,7 @@ object EventDb: IDbRepository {
|
||||
val event = EventDataBean()
|
||||
event.eventType = EventDataBean.TaskArriveSite
|
||||
event.lineId = lineId
|
||||
event.shiftsId = shiftsId
|
||||
event.taskStartTime = taskStartTime
|
||||
event.lineName = lineName
|
||||
event.taskId = taskId
|
||||
@@ -79,6 +82,7 @@ object EventDb: IDbRepository {
|
||||
}
|
||||
|
||||
fun saveEventTaskLeaveSite(
|
||||
shiftsId:Long,
|
||||
taskId: Long,
|
||||
lineId: Long,
|
||||
siteId: Long,
|
||||
@@ -90,6 +94,7 @@ object EventDb: IDbRepository {
|
||||
val event = EventDataBean()
|
||||
event.eventType = EventDataBean.TaskLeaveSite
|
||||
event.lineId = lineId
|
||||
event.shiftsId = shiftsId
|
||||
event.taskId = taskId
|
||||
event.taskDate = taskDate
|
||||
event.taskStartTime = taskStartTime
|
||||
@@ -107,6 +112,7 @@ object EventDb: IDbRepository {
|
||||
}
|
||||
|
||||
fun saveEventTaskEnd(
|
||||
shiftsId: Long,
|
||||
taskId: Long,
|
||||
lineId: Long,
|
||||
taskStartTime: Long?,
|
||||
@@ -116,6 +122,7 @@ object EventDb: IDbRepository {
|
||||
val event = EventDataBean()
|
||||
event.eventType = EventDataBean.TaskEnd
|
||||
event.lineId = lineId
|
||||
event.shiftsId = shiftsId
|
||||
event.taskId = taskId
|
||||
event.taskDate = taskDate
|
||||
event.lineName = lineName
|
||||
@@ -151,7 +158,7 @@ object EventDb: IDbRepository {
|
||||
@Transaction
|
||||
fun saveUpdateSuccess(waitUpdateEvent: List<EventDataBean>) {
|
||||
waitUpdateEvent.forEach {
|
||||
eventDataDao?.updateUpdateSatus(it.id,it.updateStatus)
|
||||
eventDataDao?.updateUpdateSatus(it.id,it.updateStatus,System.currentTimeMillis())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.weaknet.model.LineModel
|
||||
import com.mogo.och.weaknet.repository.db.IDbRepository
|
||||
import com.mogo.och.weaknet.repository.db.MyDataBase
|
||||
import com.mogo.och.weaknet.repository.db.bean.TaskDataBean
|
||||
@@ -88,7 +89,7 @@ object TaskDb : IDbRepository {
|
||||
return null
|
||||
}
|
||||
|
||||
fun startTask(taskId: Long, lineId: Long,lineName:String): Observable<Boolean>? {
|
||||
fun startTask(shiftsId:Long,taskId: Long, lineId: Long,lineName:String): Observable<Boolean>? {
|
||||
return Observable.just(taskId)
|
||||
.flatMap {
|
||||
var updateCount:Int? = 0
|
||||
@@ -104,19 +105,30 @@ object TaskDb : IDbRepository {
|
||||
}
|
||||
CallerLogger.d(TAG,"更新任务状态用时:${System.currentTimeMillis()-startTime}")
|
||||
startTime = System.currentTimeMillis()
|
||||
updateCount = TaskSiteDb.startTask(taskId, lineId, lineName)
|
||||
updateCount = TaskSiteDb.startTask(shiftsId,taskId, lineId, lineName)
|
||||
OchChainLogManager.writeChainLogDb("开始任务", "把正在使用的数据更新到RunningTask表格一共${updateCount}行数据")
|
||||
CallerLogger.d(TAG,"插入正在运行的线路用时:${System.currentTimeMillis()-startTime}")
|
||||
} catch (e: Exception) {
|
||||
if (e is DbException) {
|
||||
println("数据不全")
|
||||
// 恢复数据
|
||||
taskDataDao?.queryTaskByTaskIdOne(taskId)?.let {
|
||||
it.startTime = null
|
||||
it.status = TaskDataBean.unUse
|
||||
// 更新任务状态
|
||||
taskDataDao?.updateStatus(System.currentTimeMillis(),TaskDataBean.unUse,it.id)
|
||||
OchChainLogManager.writeChainLogDb("开始任务", "异常情况${lineId}_${lineName}_task:${taskId} 为未使用的状态 原因:${e.message}")
|
||||
if(e.code==DbException.NEEDSYNDATA) {
|
||||
// 重新同步 信息
|
||||
LineModel.refreshTask()
|
||||
println("数据不全")
|
||||
// 恢复数据
|
||||
taskDataDao?.queryTaskByTaskIdOne(taskId)?.let {
|
||||
it.startTime = null
|
||||
it.status = TaskDataBean.unUse
|
||||
// 更新任务状态
|
||||
taskDataDao?.updateStatus(
|
||||
System.currentTimeMillis(),
|
||||
TaskDataBean.unUse,
|
||||
it.id
|
||||
)
|
||||
OchChainLogManager.writeChainLogDb(
|
||||
"开始任务",
|
||||
"异常情况${lineId}_${lineName}_task:${taskId} 为未使用的状态 原因:${e.message}"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
return@flatMap Observable.error(DataException(DataException.startTaskErrorCode,e.message?:""))
|
||||
|
||||
@@ -34,28 +34,28 @@ object TaskSiteDb : IDbRepository {
|
||||
}
|
||||
|
||||
// 开始线路
|
||||
fun startTask(taskId: Long, linId: Long, lineName: String): Int? {
|
||||
fun startTask(shiftsId:Long,taskId: Long, linId: Long, lineName: String): Int? {
|
||||
// 获取线路的站点
|
||||
var startTime = System.currentTimeMillis()
|
||||
val querySites = SiteDb.querySiteByLineId(linId)?.distinctBy { it.siteId }
|
||||
val querySites = SiteDb.querySiteByLineId(linId)?.distinctBy { it.siteId }?.sortedBy { it.seq }
|
||||
if (querySites.isNullOrEmpty()) {
|
||||
throw DbException("没有站点数据")
|
||||
throw DbException(DbException.NEEDSYNDATA,"没有站点数据")
|
||||
}
|
||||
querySites.forEachIndexed { index, siteDataBean ->
|
||||
if(index+1!=siteDataBean.seq){
|
||||
throw DbException(DbException.NEEDSYNDATA,"站点数据排序不对")
|
||||
}
|
||||
}
|
||||
CallerLogger.d(TAG, "查询站点用时:${System.currentTimeMillis() - startTime}")
|
||||
startTime = System.currentTimeMillis()
|
||||
val toTaskSiteDatas = TaskSiteDataBean.toTaskSiteDatas(
|
||||
querySites,
|
||||
shiftsId,
|
||||
taskId,
|
||||
lineName
|
||||
)
|
||||
CallerLogger.d(TAG, "数据转换用时:${System.currentTimeMillis() - startTime}")
|
||||
if (toTaskSiteDatas.size < 2) {
|
||||
throw DbException("站点数据不全请稍后再试")
|
||||
throw DbException(DbException.NEEDSYNDATA,"站点数据不全请稍后再试")
|
||||
}
|
||||
// 把线路所有的站点搬迁到运行中表格中
|
||||
startTime = System.currentTimeMillis()
|
||||
val result = taskSiteDataDao?.insert(*toTaskSiteDatas.toTypedArray())
|
||||
CallerLogger.d(TAG, "数据插入用时:${System.currentTimeMillis() - startTime}")
|
||||
return if (result.isNullOrEmpty()) {
|
||||
null
|
||||
} else {
|
||||
@@ -110,6 +110,7 @@ object TaskSiteDb : IDbRepository {
|
||||
* 从后台恢复正在执行的任务
|
||||
*/
|
||||
fun restoreRunningTask(
|
||||
shiftsId:Long,
|
||||
taskId: Long,
|
||||
currentSiteId: Long,
|
||||
leaving: Boolean,
|
||||
@@ -123,10 +124,11 @@ object TaskSiteDb : IDbRepository {
|
||||
// 获取线路的站点
|
||||
val querySites = SiteDb.querySiteByLineId(lineInfo.lineId!!)?.distinctBy { it.siteId }
|
||||
if (querySites.isNullOrEmpty()) {
|
||||
throw DbException("没有站点数据")
|
||||
throw DbException(DbException.NEEDSYNDATA,"没有站点数据")
|
||||
}
|
||||
val toTaskSiteDatas = TaskSiteDataBean.toTaskSiteDatas(
|
||||
querySites,
|
||||
shiftsId,
|
||||
taskId,
|
||||
lineInfo.lineName!!
|
||||
)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.och.weaknet.repository.db.repository
|
||||
|
||||
import androidx.room.Transaction
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.weaknet.model.EventModel
|
||||
import com.mogo.och.weaknet.repository.db.IDbRepository
|
||||
@@ -37,8 +38,15 @@ object WriteOffDb: IDbRepository {
|
||||
return writeOffDataDao?.queryWriteOffEventByStatusWithPage()
|
||||
}
|
||||
|
||||
fun saveUpdateSuccess(writeOffEvents: List<WriteOffDataBean>) {
|
||||
writeOffDataDao?.insert(*writeOffEvents.toTypedArray())
|
||||
@Transaction
|
||||
fun saveUpdateSuccess(
|
||||
writeOffEvents: List<WriteOffDataBean>,
|
||||
updated: Int,
|
||||
currentTimeMillis: Long
|
||||
) {
|
||||
writeOffEvents.forEach {
|
||||
writeOffDataDao?.updateStatusAndTime(updated,currentTimeMillis,it.id)
|
||||
}
|
||||
}
|
||||
|
||||
fun queryWaitUpdateEventByTaskId(taskId: Long): List<WriteOffDataBean>? {
|
||||
|
||||
@@ -17,11 +17,12 @@ interface ILineRepository {
|
||||
|
||||
fun queryCanUserTask(lineId:Long): Observable<List<TaskDataBean>?>?
|
||||
|
||||
fun startTask(taskId:Long,lineId:Long,taskTime:Long,lineName:String): Observable<Boolean>?
|
||||
fun startTask(shiftsId:Long,taskId:Long,lineId:Long,taskTime:Long,lineName:String): Observable<Boolean>?
|
||||
|
||||
fun leaveStation(
|
||||
seq: Int,
|
||||
siteId: Long,
|
||||
shiftsId:Long,
|
||||
taskId: Long,
|
||||
lineId: Long,
|
||||
taskStartTime: Long,
|
||||
@@ -30,7 +31,7 @@ interface ILineRepository {
|
||||
|
||||
fun arriveStation( seq: Int, siteId: Long, taskId: Long): Observable<Boolean>?
|
||||
|
||||
fun endTask( taskId: Long): Observable<Boolean>?
|
||||
fun endTask(shiftsId:Long, taskId: Long): Observable<Boolean>?
|
||||
|
||||
fun queryCarExecutableTaskList(ochCommonServiceCallback: OchCommonServiceCallback<CarExecutableTaskResponse>)
|
||||
|
||||
|
||||
@@ -101,8 +101,10 @@ class NormalRepository: ILineRepository {
|
||||
if (lineInfo == null && busRoutesResult.name != null) {
|
||||
lineInfo = LineInfo(busRoutesResult.lineId.toLong(), busRoutesResult.name, orderId = busRoutesResult.taskId.toString() )
|
||||
}
|
||||
lineInfo?.multiMap?.put("taskInfo", LineModel.getTaskTime())
|
||||
|
||||
}
|
||||
lineInfo?.multiMap?.put("taskInfo", LineModel.getTaskTime())
|
||||
lineInfo?.siteInfos = result
|
||||
LineManager.setLineInfo(lineInfo)
|
||||
|
||||
LineManager.setContraiInfo(
|
||||
@@ -144,6 +146,7 @@ class NormalRepository: ILineRepository {
|
||||
}
|
||||
|
||||
override fun startTask(
|
||||
shiftsId:Long,
|
||||
taskId: Long,
|
||||
lineId: Long,
|
||||
taskTime: Long,
|
||||
@@ -155,6 +158,7 @@ class NormalRepository: ILineRepository {
|
||||
override fun leaveStation(
|
||||
seq: Int,
|
||||
siteId: Long,
|
||||
shiftsId:Long,
|
||||
taskId: Long,
|
||||
lineId: Long,
|
||||
taskStartTime: Long,
|
||||
@@ -172,7 +176,7 @@ class NormalRepository: ILineRepository {
|
||||
)
|
||||
}
|
||||
|
||||
override fun endTask(taskId: Long): Observable<Boolean>? {
|
||||
override fun endTask(shiftsId:Long,taskId: Long): Observable<Boolean>? {
|
||||
return normalLineInterface?.endTask(taskId)
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ class WeaknetRepository : ILineRepository {
|
||||
// 恢复站点信息
|
||||
currentTask?.taskId?.let {
|
||||
// 获取正在进行中的具体信息
|
||||
val runnintTaskAndSites = TaskSiteDb.queryRunningTask(it)
|
||||
val runnintTaskAndSites = TaskSiteDb.queryRunningTask(it)?.distinctBy { it.siteId }
|
||||
if(runnintTaskAndSites.isNullOrEmpty()||runnintTaskAndSites.size<2){
|
||||
CallerLogger.d(TAG, "异常情况:有任务:${runningTaskInfo} runningTask 表格没有对应的数据:${runnintTaskAndSites}")
|
||||
OchChainLogManager.writeChainLogDb("加载任务", "异常情况:有任务:${runningTaskInfo} runningTask 表格没有对应的数据:${runnintTaskAndSites}")
|
||||
@@ -191,12 +191,14 @@ class WeaknetRepository : ILineRepository {
|
||||
if(lineId<=0){
|
||||
return@flatMap Observable.just(false)
|
||||
}
|
||||
if(taskId<=0||currentSiteId<=0||taskDate<=0){
|
||||
if(taskId<=0||currentSiteId<=0){
|
||||
return@flatMap Observable.just(false)
|
||||
}
|
||||
// 日期是否正确
|
||||
if (!DateTimeUtil.isSameDay(System.currentTimeMillis(),taskDate)) {
|
||||
return@flatMap Observable.just(false)
|
||||
if (AppIdentityModeUtils.isScheduled(FunctionBuildConfig.appIdentityMode)) {
|
||||
if (!DateTimeUtil.isSameDay(System.currentTimeMillis(),taskDate)) {
|
||||
return@flatMap Observable.just(false)
|
||||
}
|
||||
}
|
||||
|
||||
// region 任务本地是否存在
|
||||
@@ -277,7 +279,7 @@ class WeaknetRepository : ILineRepository {
|
||||
TaskDb.restoreTask(taskId)
|
||||
|
||||
// 恢复正在执行任务表
|
||||
TaskSiteDb.restoreRunningTask(taskId,currentSiteId,leaving,lineInfo!!)
|
||||
TaskSiteDb.restoreRunningTask(it.shiftsId,taskId,currentSiteId,leaving,lineInfo!!)
|
||||
|
||||
return@flatMap loadCurrentTaskInfo()
|
||||
}
|
||||
@@ -335,17 +337,19 @@ class WeaknetRepository : ILineRepository {
|
||||
}
|
||||
|
||||
override fun startTask(
|
||||
shiftsId:Long,
|
||||
taskId: Long,
|
||||
lineId: Long,
|
||||
taskTime: Long,
|
||||
lineName: String
|
||||
): Observable<Boolean>? {
|
||||
return TaskDb.startTask(taskId, lineId, lineName)
|
||||
return TaskDb.startTask(shiftsId,taskId, lineId, lineName)
|
||||
}
|
||||
|
||||
override fun leaveStation(
|
||||
seq: Int,
|
||||
siteId: Long,
|
||||
shiftsId:Long,
|
||||
taskId: Long,
|
||||
lineId: Long,
|
||||
taskStartTime: Long,
|
||||
@@ -364,6 +368,7 @@ class WeaknetRepository : ILineRepository {
|
||||
// 设置滑动出发任务
|
||||
LineManager.getLineInfo { lineInfo ->
|
||||
EventDb.saveEventTaskLeaveSite(
|
||||
shiftsId,
|
||||
taskId,
|
||||
lineId,
|
||||
it.siteId.toLong(),
|
||||
@@ -404,6 +409,7 @@ class WeaknetRepository : ILineRepository {
|
||||
// 设置到站任务
|
||||
LineManager.getLineInfo { lineInfo ->
|
||||
EventDb.saveEventTaskArriveSite(
|
||||
task.shiftsId!!,
|
||||
task.taskId!!,
|
||||
task.lineId!!,
|
||||
end.siteId.toLong(),
|
||||
@@ -449,13 +455,13 @@ class WeaknetRepository : ILineRepository {
|
||||
|
||||
}
|
||||
|
||||
override fun endTask(taskId: Long): Observable<Boolean>? {
|
||||
override fun endTask(shiftsId:Long,taskId: Long): Observable<Boolean>? {
|
||||
return Observable.just(taskId).flatMap {
|
||||
currentTask?.let {task->
|
||||
if (task.taskId!=null&&task.lineId!=null) {
|
||||
TaskDb.endTask(task.taskId!!)
|
||||
LineManager.getLineInfo { lineInfo ->
|
||||
EventDb.saveEventTaskEnd(task.taskId!!,task.lineId!!,task.taskStartTime,lineInfo.lineName,task.taskDate?:0L)
|
||||
EventDb.saveEventTaskEnd(shiftsId,task.taskId!!,task.lineId!!,task.taskStartTime,lineInfo.lineName,task.taskDate?:0L)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,6 +189,7 @@ class WriteOffCacheRepository : IWriteOffRepository {
|
||||
addWrite.expiryTime = it.expiryTime
|
||||
addWrite.bookingTime = it.bookingTime
|
||||
addWrite.type = it.type
|
||||
addWrite.shiftsId = it.shiftsId
|
||||
addWrite.taskId = LineModel.currentTask?.taskId
|
||||
addWrite.taskDate = LineModel.currentTask?.taskDate
|
||||
addWrite.lineId = lineId
|
||||
@@ -246,6 +247,7 @@ class WriteOffCacheRepository : IWriteOffRepository {
|
||||
//addWrite.bookingTime = it.bookingTime
|
||||
//addWrite.type = it.type
|
||||
addWrite.taskId = LineModel.currentTask?.taskId
|
||||
addWrite.shiftsId = LineModel.currentTask?.shiftsId
|
||||
LineManager.getStationsWithLine { start, end, lineInfo ->
|
||||
addWrite.siteId = start.siteId.toLong()
|
||||
addWrite.lineId = lineInfo.lineId
|
||||
|
||||
@@ -12,7 +12,9 @@ import com.mogo.och.bridge.autopilot.trajectory.ITrajectoryListListener
|
||||
import com.mogo.och.bridge.autopilot.trajectory.TrajectoryManager
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.weaknet.constant.BusConst
|
||||
import com.mogo.och.weaknet.model.LineModel
|
||||
import com.mogo.och.weaknet.model.LineModel.currentTask
|
||||
import com.mogo.och.weaknet.model.LineModel.startStationIndex
|
||||
import com.mogo.och.weaknet.model.OrderModel.isGoingToNextStation
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
@@ -54,10 +56,11 @@ object BusTrajectoryManager : ITrajectoryListListener {
|
||||
} else {
|
||||
OchChainLogManager.writeChainLogTrajectory(
|
||||
"轨迹监控",
|
||||
"开始或者结束下发轨迹 轨迹id:${mAutopilotControlParameters!!.autoPilotLine!!.lineId}"
|
||||
"开始或者结束下发轨迹 轨迹id:${mAutopilotControlParameters!!.autoPilotLine!!.lineId}____${startStationIndex}"
|
||||
)
|
||||
}
|
||||
if (isLogin() && currentTask != null && !isGoingToNextStation) {
|
||||
|
||||
if (isLogin() && currentTask != null && !isGoingToNextStation && startStationIndex == 0) {
|
||||
d(TAG, "syncTrajectoryInfo() start.")
|
||||
startTrajReqLoop()
|
||||
} else {
|
||||
|
||||
@@ -103,6 +103,24 @@ object TicketModel : StateChangeListener {
|
||||
}
|
||||
}
|
||||
try {
|
||||
var tempType = 0
|
||||
if (type is String) {
|
||||
when (type) {
|
||||
"shuttle" -> {
|
||||
tempType = 11
|
||||
}
|
||||
|
||||
"bus" -> {
|
||||
tempType = 10
|
||||
}
|
||||
|
||||
else -> {
|
||||
tempType = type.toInt()?:0
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tempType = type?.toInt() ?: 0
|
||||
}
|
||||
val writeOffDetail = WriteOffDetialMsg(0,"",
|
||||
expiryTime?.toLong()?:0,
|
||||
bookingTime?.toLong()?:0,
|
||||
@@ -113,7 +131,7 @@ object TicketModel : StateChangeListener {
|
||||
phoneNum,
|
||||
ticketSize?.toInt()?:0,
|
||||
URLDecoder.decode(ticketName?:"","UTF-8"),
|
||||
type?.toInt()?:0,
|
||||
tempType,
|
||||
shiftsId?.toLong()?:0,
|
||||
pipe,
|
||||
startStationId?.toLong()?:0,
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.bridge.autopilot.line.LineManager
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
import com.mogo.och.data.bean.LineInfo
|
||||
import com.mogo.och.unmanned.taxi.bean.GrayLineBean
|
||||
import com.mogo.och.unmanned.taxi.bean.QueryGrayContrailListRsp
|
||||
@@ -153,9 +154,25 @@ class RoutingSelectModel : ViewModel() {
|
||||
}
|
||||
DebugView.printInfoMsg("[启自驾] 准备启动自驾")
|
||||
|
||||
LineManager.setLineInfo(LineInfo(grayLineBean.lineId?:0L,grayLineBean.lineName?:"", orderId = "${data.taskId}"))
|
||||
val startStation = grayLineBean.startSite?.toBusStationBean()
|
||||
val endStation = grayLineBean.endSite?.toBusStationBean()
|
||||
val temp = mutableListOf<BusStationBean>()
|
||||
if(startStation!=null){
|
||||
temp.add(startStation)
|
||||
}
|
||||
if(endStation!=null){
|
||||
temp.add(endStation)
|
||||
}
|
||||
LineManager.setLineInfo(
|
||||
LineInfo(
|
||||
grayLineBean.lineId?:0L,
|
||||
grayLineBean.lineName?:"",
|
||||
orderId = "${data.taskId}",
|
||||
siteInfos = temp
|
||||
)
|
||||
)
|
||||
LineManager.setContraiInfo(contrailBean.toContraiInfo())
|
||||
LineManager.setStartAndEndStation(grayLineBean.startSite?.toBusStationBean(),grayLineBean.endSite?.toBusStationBean())
|
||||
LineManager.setStartAndEndStation(startStation,endStation)
|
||||
CallerEagleBaseFunctionCall4OchManager.updateOrderStatus(true)
|
||||
|
||||
viewCallback?.onStartGrayTaskAndQueryContrailSuccess(data)
|
||||
|
||||
@@ -54,6 +54,7 @@ import com.mogo.och.bridge.utils.CoordinateCalculateRouteUtil.coordinateConverte
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.common.module.voice.VoiceNotice
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
import com.mogo.och.data.bean.LineInfo
|
||||
import com.mogo.och.data.taxi.QueryCarOrderByNoRespBean
|
||||
import com.mogo.och.unmanned.taxi.bean.PrepareTaskRespBean
|
||||
@@ -1060,7 +1061,23 @@ object TaxiTaskModel {
|
||||
mTaskTrajectoryList.addAll(it)
|
||||
mCurrentTaskTrajectory = it.first { currentTaskLineId == it.lineId }
|
||||
mCurrentTaskTrajectory?.let {traj->
|
||||
LineManager.setLineInfo(LineInfo(traj.lineId,traj.lineName, orderId = mCurrentTaskWithOrder?.order?.orderNo?:""))
|
||||
val startStaion = mCurrentTaskWithOrder?.startSite?.toCommonStation()
|
||||
val endStaion = mCurrentTaskWithOrder?.endSite?.toCommonStation()
|
||||
val temp = mutableListOf<BusStationBean>()
|
||||
if(startStaion!=null){
|
||||
temp.add(startStaion)
|
||||
}
|
||||
if(endStaion!=null){
|
||||
temp.add(endStaion)
|
||||
}
|
||||
LineManager.setLineInfo(
|
||||
LineInfo(
|
||||
traj.lineId,
|
||||
traj.lineName,
|
||||
orderId = mCurrentTaskWithOrder?.order?.orderNo?:"",
|
||||
siteInfos = temp
|
||||
)
|
||||
)
|
||||
traj.blackPoints?.clear()
|
||||
traj.passPoints?.clear()
|
||||
LineManager.setContraiInfo(traj.toCommonContraiInfo())
|
||||
|
||||
@@ -176,10 +176,7 @@ object TaxiTrajectoryManager : ITrajectoryListListener {
|
||||
preloadContrail.contrailSaveTimeDPQP
|
||||
|
||||
val toCommonContraiInfo = preloadContrail.toCommonContraiInfo()
|
||||
val (wayLatLons, blackLatLons) = LineManager.getWayBlackLatLons(
|
||||
toCommonContraiInfo.passPoints,
|
||||
toCommonContraiInfo.blackPoints
|
||||
)
|
||||
val (wayLatLons, blackLatLons) = toCommonContraiInfo.getWayBlackLatLons()
|
||||
mPreAutopilotControlParameters?.wayLatLons = wayLatLons
|
||||
mPreAutopilotControlParameters?.blackLatLons = blackLatLons
|
||||
}
|
||||
|
||||
@@ -49,10 +49,6 @@ class DataCenterBizProvider:IDataCenterBizProvider {
|
||||
CallerDataCenterBizListener.invokeLoginStatus(isLogin)
|
||||
}
|
||||
|
||||
override fun notifyOrderID(orderID: String) {
|
||||
CallerDataCenterBizListener.invokeOrderID(orderID)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
}
|
||||
|
||||
@@ -39,5 +39,15 @@ class MogoLogCatchConst {
|
||||
* 下发关闭链路的类型
|
||||
*/
|
||||
const val LOCAL_CONFIG_CLOSE_SINGLE_FW = 7
|
||||
|
||||
/**
|
||||
* 打开高精地图每个瓦片数据文件下载、删除的日志
|
||||
*/
|
||||
const val OPEN_HD_MAP_TILE_FILE_LOG = 8
|
||||
|
||||
/**
|
||||
* 关闭高精地图每个瓦片数据文件下载、删除的日志
|
||||
*/
|
||||
const val CLOSE_HD_MAP_TILE_FILE_LOG = 9
|
||||
}
|
||||
}
|
||||
@@ -26,16 +26,19 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainLogParam
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.map.MogoData.Companion.mogoMapData
|
||||
import com.zhidao.loglib.bean.RemoteLogPushContent
|
||||
import com.zhidao.loglib.call.LogInfoManagerFactory
|
||||
import com.zhidao.loglib.core.ILogListener
|
||||
import com.zhidao.loglib.core.LogInfoManager
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.CACHE_MAP_UPLOAD
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.CACHE_TRACE_UPLOAD
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.CLOSE_HD_MAP_TILE_FILE_LOG
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.LOCAL_CONFIG_CLOSE_LOG
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.LOCAL_CONFIG_CLOSE_SINGLE_FW
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.LOCAL_CONFIG_OPEN_LOG
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.LOG_PUSH_TYPE
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.OPEN_HD_MAP_TILE_FILE_LOG
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.START_CATCH_LOG
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.STOP_CATCH_LOG
|
||||
import com.zhjt.mogo_core_function_devatools.trace.TraceManager
|
||||
@@ -140,6 +143,22 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
|
||||
}
|
||||
}
|
||||
}
|
||||
OPEN_HD_MAP_TILE_FILE_LOG -> {
|
||||
mogoMapData.get()?.let { map ->
|
||||
if (!map.isTileFileLogOpen()) {
|
||||
map.openTileFileLog(true)
|
||||
map.listenTileFileLog()
|
||||
}
|
||||
}
|
||||
}
|
||||
CLOSE_HD_MAP_TILE_FILE_LOG -> {
|
||||
mogoMapData.get()?.let { map ->
|
||||
if (map.isTileFileLogOpen()) {
|
||||
map.openTileFileLog(false)
|
||||
map.stopListenTileFileLog()
|
||||
}
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,6 +338,7 @@ import kotlin.collections.set
|
||||
import kotlin.math.abs
|
||||
import kotlin.system.exitProcess
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.ShowDevicesManagerStateDialog
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbTileFileLog
|
||||
|
||||
|
||||
/**
|
||||
@@ -1188,6 +1189,24 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(isChecked)
|
||||
CallerSopSettingManager.invokePointCloudListener(isChecked)
|
||||
}
|
||||
tbTileFileLog.setOnCheckedChangeListener { compoundButton, isChecked ->
|
||||
if (!compoundButton.isPressed) {
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
mogoMapData.get()?.let { map ->
|
||||
if (isChecked) {
|
||||
if (!map.isTileFileLogOpen()) {
|
||||
map.openTileFileLog(true)
|
||||
map.listenTileFileLog()
|
||||
}
|
||||
} else {
|
||||
if (map.isTileFileLogOpen()) {
|
||||
map.openTileFileLog(false)
|
||||
map.stopListenTileFileLog()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//设置点云大小
|
||||
btnPointCloudSize.setOnClickListener {
|
||||
|
||||
@@ -1904,6 +1904,22 @@
|
||||
app:layout_constraintRight_toRightOf="@id/tbChangeAutoPilotStatus"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbChangeAutoPilotStatus"
|
||||
/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbTileFileLog"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启地图瓦片日志"
|
||||
android:textOn="关闭地图瓦片日志"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintLeft_toRightOf="@id/tbDrawPointCloudData"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbCarAperture"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnPointCloudSize"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_61"
|
||||
android:format12Hour="HH:mm"
|
||||
android:format24Hour="HH:mm"
|
||||
android:format12Hour="HH:mm:ss"
|
||||
android:format24Hour="HH:mm:ss"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/dp_45"
|
||||
android:textStyle="bold" />
|
||||
|
||||
@@ -25,7 +25,6 @@ interface IDataCenterBizListener {
|
||||
return false
|
||||
}
|
||||
|
||||
fun invokeAutopilotOrderId(orderID:String){}
|
||||
|
||||
fun invokeOchInfo(ochInfo: OchInfo) {}
|
||||
}
|
||||
@@ -35,5 +35,4 @@ interface IOchFunctionCallNotify {
|
||||
// 登录状态变化
|
||||
fun notifyLoginStatus(isLogin: Boolean)
|
||||
|
||||
fun notifyOrderID(orderID:String)
|
||||
}
|
||||
@@ -24,9 +24,6 @@ object CallerDataCenterBizListener : CallerBase<IDataCenterBizListener>() {
|
||||
@Volatile
|
||||
private var inOrder: Boolean = false
|
||||
|
||||
@Volatile
|
||||
private var orderId: String = ""
|
||||
|
||||
private val isLoginStatus by lazy { AtomicBoolean(false) }
|
||||
|
||||
override fun doSomeAfterAddListener(tag: String, listener: IDataCenterBizListener) {
|
||||
@@ -35,7 +32,6 @@ object CallerDataCenterBizListener : CallerBase<IDataCenterBizListener>() {
|
||||
listener.invokeLoginNo(loginNo)
|
||||
listener.invokeCarNo(no)
|
||||
listener.invokeOrderStatus(inOrder)
|
||||
listener.invokeAutopilotOrderId(orderId)
|
||||
}
|
||||
|
||||
fun invokeLoginNo(loginNo: String?) {
|
||||
@@ -96,23 +92,12 @@ object CallerDataCenterBizListener : CallerBase<IDataCenterBizListener>() {
|
||||
return isLoginStatus.get()
|
||||
}
|
||||
|
||||
fun invokeOrderID(orderId: String) {
|
||||
this.orderId = orderId
|
||||
M_LISTENERS.forEach {
|
||||
it.value.invokeAutopilotOrderId(orderId)
|
||||
}
|
||||
}
|
||||
|
||||
fun invokeOchInfo(ochInfo: OchInfo) {
|
||||
M_LISTENERS.forEach {
|
||||
it.value.invokeOchInfo(ochInfo)
|
||||
}
|
||||
}
|
||||
|
||||
fun getOrderId(): String {
|
||||
return orderId
|
||||
}
|
||||
|
||||
fun getCarModel(): Carmodel? {
|
||||
return carModel
|
||||
}
|
||||
|
||||
@@ -48,8 +48,4 @@ object CallerDataCenterBizManager: IOchFunctionCallNotify {
|
||||
dataCenterBizProviderApi?.notifyLoginStatus(isLogin)
|
||||
}
|
||||
|
||||
override fun notifyOrderID(orderID: String) {
|
||||
dataCenterBizProviderApi?.notifyOrderID(orderID)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -130,8 +130,4 @@ object CallerEagleBaseFunctionCall4OchManager : IEagleBaseFunctionCall4Och {
|
||||
override fun onOrderRemoval() {
|
||||
CallerDataCenterBizManager.notifyOrderRemoval()
|
||||
}
|
||||
|
||||
override fun setOchAutopilotOrderId(orderId: String) {
|
||||
CallerDataCenterBizManager.notifyOrderID(orderId)
|
||||
}
|
||||
}
|
||||
@@ -80,10 +80,11 @@ MOGO_LOCATION_VERSION=1.4.7.59
|
||||
# 远程通讯模块
|
||||
MOGO_TELEMATIC_VERSION=1.4.7.59
|
||||
# 动态换肤SDK
|
||||
MOGO_SKIN_VERSION=1.4.7.49.19
|
||||
MOGO_SKIN_VERSION=1.4.7.50
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=3.5.0.0
|
||||
MAP_SDK_VERSION=3.5.0.3
|
||||
MAP_SDK_CORE_VERSION=3.5.0.4
|
||||
MAP_SDK_DATA_VERSION=1.0.0.9
|
||||
MAP_SDK_OPERATION_VERSION=1.1.4.1
|
||||
# websocket
|
||||
|
||||
@@ -65,7 +65,7 @@ dependencies {
|
||||
|
||||
|
||||
implementation 'com.zhidaoauto.map:net:1.0.1'
|
||||
implementation "com.zhidaoauto.machine:mapcore:${MAP_SDK_VERSION}"
|
||||
implementation "com.zhidaoauto.machine:mapcore:${MAP_SDK_CORE_VERSION}"
|
||||
implementation "com.zhidaoauto.machine:mapdata:${MAP_SDK_DATA_VERSION}"
|
||||
|
||||
}
|
||||
|
||||
@@ -129,4 +129,12 @@ interface IMogoData {
|
||||
* 获取路口数据
|
||||
*/
|
||||
fun getCrossRoad(lon: Double, lat: Double, angle: Double): CrossRoad?
|
||||
|
||||
fun listenTileFileLog()
|
||||
|
||||
fun stopListenTileFileLog()
|
||||
|
||||
fun openTileFileLog(isOpen: Boolean)
|
||||
|
||||
fun isTileFileLogOpen(): Boolean
|
||||
}
|
||||
|
||||
@@ -39,6 +39,8 @@ object MapDataWrapper : IMogoData {
|
||||
mogoMapData.init(this)
|
||||
}
|
||||
|
||||
private var isTileFileLogOpen = false
|
||||
|
||||
/**
|
||||
* 设置debug模式
|
||||
*/
|
||||
@@ -376,4 +378,21 @@ object MapDataWrapper : IMogoData {
|
||||
}
|
||||
return temp.get()
|
||||
}
|
||||
|
||||
override fun listenTileFileLog() {
|
||||
MapAutoApi.setTileFileCallback(TileFileLogCallback())
|
||||
}
|
||||
|
||||
override fun stopListenTileFileLog() {
|
||||
MapAutoApi.clearTileFileCallback()
|
||||
}
|
||||
|
||||
override fun openTileFileLog(isOpen: Boolean) {
|
||||
MapAutoApi.openTileLog(isOpen)
|
||||
isTileFileLogOpen = isOpen
|
||||
}
|
||||
|
||||
override fun isTileFileLogOpen(): Boolean {
|
||||
return isTileFileLogOpen
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.mogo.map
|
||||
|
||||
import com.autonavi.nge.hdmap.ITileCallback
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
|
||||
class TileFileLogCallback: ITileCallback {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "TileFileLogCallback"
|
||||
}
|
||||
|
||||
override fun onLogCallback(msg: String) {
|
||||
invokeNettyConnResult(msg)
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_WEAK_NETWORK,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_WEAK_NETWORK,
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_RECORD_WEAK_NETWORK,
|
||||
paramIndexes = [0]
|
||||
)
|
||||
private fun invokeNettyConnResult(msg: String) {
|
||||
d(M_MAP + TAG, " TileFileLogCallback : $msg")
|
||||
}
|
||||
}
|
||||
@@ -306,9 +306,9 @@ class IFlyTekTts : IMogoTTS, InitListener {
|
||||
curTtsLevel = -1
|
||||
if (curTtsEntity != null) {
|
||||
speakVoiceMap.remove(curTtsEntity.toString())
|
||||
?.onSpeakError(curTtsEntity.toString(), error.message)
|
||||
?.onSpeakError(curTtsEntity.toString(), "errorCode is:${error.errorCode},errorDes is:${error.toString()}")
|
||||
} else {
|
||||
speakVoiceMap.remove(curTtsContent)?.onSpeakError(curTtsContent, error.message)
|
||||
speakVoiceMap.remove(curTtsContent)?.onSpeakError(curTtsContent, "errorCode is:${error.errorCode},errorDes is:${error.toString()}")
|
||||
}
|
||||
curTtsEntity = null
|
||||
curTtsContent = ""
|
||||
|
||||
Reference in New Issue
Block a user