[6.7.0]
[fea] [lineManger]
This commit is contained in:
@@ -16,7 +16,10 @@ public class LoginInfo {
|
||||
private String vin;//车辆唯一识别码
|
||||
private String cityCode;//城市编码
|
||||
private String brand;//东风
|
||||
private String carModel;//E70 型号
|
||||
//
|
||||
// E70 东风 H9 红旗
|
||||
// B2 B1 M1
|
||||
private String carModel;
|
||||
private String photos;//车身照片:
|
||||
private long tenantId;//租户id:
|
||||
private long driverId;
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
package com.mogo.och.common.module.manager.autopilot.line
|
||||
|
||||
import com.mogo.commons.env.ProjectUtils
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLine
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLonLat
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapGlobalTrajectoryDrawManager
|
||||
import com.mogo.eagle.core.function.call.order.CallerOrderListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.utils.CallerBase
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
@@ -13,6 +21,7 @@ import com.mogo.och.data.bean.LineInfo
|
||||
* 订单中
|
||||
*/
|
||||
object LineManager : CallerBase<ILineCallback>() {
|
||||
const val TAG = "LineManager"
|
||||
/**
|
||||
* 线路信息
|
||||
*/
|
||||
@@ -24,6 +33,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
*/
|
||||
@JvmStatic
|
||||
var contraiInfo: ContraiInfo? = null
|
||||
private set
|
||||
|
||||
/**
|
||||
* 起始站点
|
||||
@@ -38,70 +48,32 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
/**
|
||||
* 设置站点信息
|
||||
*/
|
||||
fun setStartAndEndStation(startStation: BusStationBean?,endStation: BusStationBean?){
|
||||
fun setStartAndEndStation(startStation: BusStationBean?, endStation: BusStationBean?) {
|
||||
this.startStation = startStation
|
||||
this.endStation = endStation
|
||||
OchChainLogManager.writeChainLogAutopilot("自驾参数","${startStation}---${endStation}")
|
||||
if(startStation==null||endStation==null){
|
||||
clearAutopilotControlParameters()
|
||||
}else {
|
||||
setAutopilotControlParameters()
|
||||
}
|
||||
OchChainLogManager.writeChainLogAutopilot("自驾参数", "${startStation}---${endStation}")
|
||||
}
|
||||
|
||||
fun getStations(function: (start:BusStationBean,end:BusStationBean) -> Unit){
|
||||
startStation?.let { start->
|
||||
endStation?.let { end ->
|
||||
function.invoke(start,end)
|
||||
}
|
||||
}
|
||||
OchChainLogManager.writeChainLog("异常情况","startStation:${startStation}__endStation:${endStation}")
|
||||
}
|
||||
fun getStationsWithContrai(function: (start:BusStationBean,end:BusStationBean,contrai: ContraiInfo) -> Unit){
|
||||
startStation?.let { start->
|
||||
endStation?.let { end ->
|
||||
contraiInfo?.let {contrai->
|
||||
function.invoke(start,end,contrai)
|
||||
}
|
||||
}
|
||||
}
|
||||
OchChainLogManager.writeChainLog("异常情况","startStation:${startStation}__endStation:${endStation}__contraiInfo:${contraiInfo}")
|
||||
}
|
||||
|
||||
fun getStationsWithLine(function: (start:BusStationBean,end:BusStationBean,lineInfo: LineInfo) -> Unit){
|
||||
startStation?.let { start->
|
||||
endStation?.let { end ->
|
||||
lineInfos?.let {line->
|
||||
function.invoke(start,end, line)
|
||||
}
|
||||
}
|
||||
}
|
||||
OchChainLogManager.writeChainLog("异常情况","startStation:${startStation}__endStation:${endStation}__lineInfos:${lineInfos}")
|
||||
}
|
||||
fun getStationsWithLineAndContrai(function: (start:BusStationBean,end:BusStationBean,lineInfo: LineInfo,contrai: ContraiInfo) -> Unit){
|
||||
startStation?.let { start->
|
||||
endStation?.let { end ->
|
||||
lineInfos?.let {line->
|
||||
contraiInfo?.let { contrai ->
|
||||
function.invoke(start,end, line,contrai)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
OchChainLogManager.writeChainLog("异常情况","startStation:${startStation}__endStation:${endStation}__lineInfos:${lineInfos}__contraiInfo:${contraiInfo}")
|
||||
}
|
||||
|
||||
fun getStartStation(function: (start:BusStationBean) -> Unit){
|
||||
startStation?.let { start ->
|
||||
function.invoke(start)
|
||||
}
|
||||
OchChainLogManager.writeChainLog("异常情况","startStation:${startStation}")
|
||||
fun setContraiInfo(contraiInfo: ContraiInfo?){
|
||||
this.contraiInfo = contraiInfo
|
||||
setAutopilotControlParameters()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun setLineInfo(lineInfo: LineInfo?){
|
||||
if(lineInfo==null){
|
||||
fun setLineInfo(lineInfo: LineInfo?) {
|
||||
if (lineInfo == null) {
|
||||
clearGlobalTrajectory(true)
|
||||
CallerOrderListenerManager.invokeOrderLineUpdate("")
|
||||
}
|
||||
this.lineInfos = lineInfo
|
||||
setAutopilotControlParameters()
|
||||
this.lineInfos?.let { line ->
|
||||
if(ProjectUtils.isSaas()) {
|
||||
if (ProjectUtils.isSaas()) {
|
||||
val sb = StringBuilder()
|
||||
sb.append(line.lineName)
|
||||
line.multiMap?.forEach {
|
||||
@@ -112,23 +84,102 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
}
|
||||
}
|
||||
|
||||
fun getStations(function: (start: BusStationBean, end: BusStationBean) -> Unit) {
|
||||
startStation?.let { start ->
|
||||
endStation?.let { end ->
|
||||
function.invoke(start, end)
|
||||
return
|
||||
}
|
||||
}
|
||||
OchChainLogManager.writeChainLog("异常情况","startStation:${startStation}__endStation:${endStation}")
|
||||
}
|
||||
|
||||
fun getStationsWithContrai(function: (start: BusStationBean, end: BusStationBean, contrai: ContraiInfo) -> Unit) {
|
||||
startStation?.let { start ->
|
||||
endStation?.let { end ->
|
||||
contraiInfo?.let { contrai ->
|
||||
function.invoke(start, end, contrai)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
OchChainLogManager.writeChainLog(
|
||||
"异常情况",
|
||||
"startStation:${startStation}__endStation:${endStation}__contraiInfo:${contraiInfo}"
|
||||
)
|
||||
}
|
||||
|
||||
fun getStationsWithLine(function: (start: BusStationBean, end: BusStationBean, lineInfo: LineInfo) -> Unit) {
|
||||
startStation?.let { start ->
|
||||
endStation?.let { end ->
|
||||
lineInfos?.let { line ->
|
||||
function.invoke(start, end, line)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
OchChainLogManager.writeChainLog(
|
||||
"异常情况",
|
||||
"startStation:${startStation}__endStation:${endStation}__lineInfos:${lineInfos}"
|
||||
)
|
||||
}
|
||||
|
||||
fun getStationsWithLineAndContrai(function: (start: BusStationBean, end: BusStationBean, lineInfo: LineInfo, contrai: ContraiInfo) -> Unit) {
|
||||
startStation?.let { start ->
|
||||
endStation?.let { end ->
|
||||
lineInfos?.let { line ->
|
||||
contraiInfo?.let { contrai ->
|
||||
function.invoke(start, end, line, contrai)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
OchChainLogManager.writeChainLog(
|
||||
"异常情况",
|
||||
"startStation:${startStation}__endStation:${endStation}__lineInfos:${lineInfos}__contraiInfo:${contraiInfo}"
|
||||
)
|
||||
}
|
||||
|
||||
fun getStartStation(function: (start: BusStationBean) -> Unit) {
|
||||
startStation?.let { start ->
|
||||
function.invoke(start)
|
||||
}
|
||||
OchChainLogManager.writeChainLog("异常情况", "startStation:${startStation}")
|
||||
}
|
||||
|
||||
|
||||
override fun doSomeAfterAddListener(tag: String, listener: ILineCallback) {
|
||||
super.doSomeAfterAddListener(tag, listener)
|
||||
if (hasDrawnGlobalTrajectory()) {
|
||||
listener.drawLineSuccess()
|
||||
}else{
|
||||
} else {
|
||||
listener.drawLineFail()
|
||||
}
|
||||
}
|
||||
|
||||
private fun setAutopilotControlParameters(){
|
||||
getStationsWithLineAndContrai { start, end, lineInfo, contrai ->
|
||||
val parameters = LineManager.initAutopilotControlParameters()
|
||||
if (null == parameters) {
|
||||
e(M_BUS + TAG, "AutopilotControlParameters is empty.")
|
||||
return@getStationsWithLineAndContrai
|
||||
}
|
||||
d(M_BUS + TAG, "AutopilotControlParameters is update.")
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(parameters)
|
||||
}
|
||||
}
|
||||
private fun clearAutopilotControlParameters(){
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(null)
|
||||
}
|
||||
|
||||
fun hasDrawnGlobalTrajectory(): Boolean {
|
||||
return CallerMapGlobalTrajectoryDrawManager.hasDrawnGlobalTrajectory()
|
||||
}
|
||||
|
||||
fun clearGlobalTrajectory(isClearData: Boolean) {
|
||||
CallerMapGlobalTrajectoryDrawManager.clearGlobalTrajectory(isClearData)
|
||||
if (!hasDrawnGlobalTrajectory()){
|
||||
if (!hasDrawnGlobalTrajectory()) {
|
||||
M_LISTENERS.forEach {
|
||||
it.value.clearLineSuccess()
|
||||
}
|
||||
@@ -137,14 +188,14 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
|
||||
fun drawGlobalTrajectory(): Pair<Boolean, String> {
|
||||
if (lineInfos == null) {
|
||||
return Pair(false,"请设置正确线路或订单")
|
||||
return Pair(false, "请设置正确线路或订单")
|
||||
}
|
||||
return CallerMapGlobalTrajectoryDrawManager.drawGlobalTrajectory().apply {
|
||||
if(first){
|
||||
if (first) {
|
||||
M_LISTENERS.forEach {
|
||||
it.value.drawLineSuccess()
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
M_LISTENERS.forEach {
|
||||
it.value.drawLineFail()
|
||||
}
|
||||
@@ -152,5 +203,41 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
}
|
||||
}
|
||||
|
||||
fun initAutopilotControlParameters(): AutopilotControlParameters? {
|
||||
var parameters: AutopilotControlParameters? = null
|
||||
getStationsWithLineAndContrai { start, end, lineInfo, contrai ->
|
||||
parameters = AutopilotControlParameters()
|
||||
parameters?.routeID = lineInfo.lineId.toInt()
|
||||
parameters?.routeName = lineInfo.lineName
|
||||
parameters?.startName = start.name
|
||||
parameters?.endName = end.name
|
||||
parameters?.startLatLon = AutoPilotLonLat(start.lat, start.lon)
|
||||
parameters?.endLatLon = AutoPilotLonLat(end.lat, end.lon)
|
||||
parameters?.vehicleType = 10
|
||||
|
||||
if (parameters?.autoPilotLine == null) {
|
||||
parameters?.autoPilotLine = AutoPilotLine(
|
||||
lineInfo.lineId,
|
||||
lineInfo.lineName,
|
||||
contrai.csvFileUrl,
|
||||
contrai.csvFileMd5,
|
||||
contrai.txtFileUrl,
|
||||
contrai.txtFileMd5,
|
||||
contrai.contrailSaveTime,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
0L
|
||||
)
|
||||
}
|
||||
}
|
||||
if (parameters == null) {
|
||||
ToastUtils.showShort("未设置起始或终点站点")
|
||||
}
|
||||
return parameters
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -16,18 +16,6 @@ import java.util.List;
|
||||
public class BusQueryLinesResponse extends BaseData {
|
||||
public List<Result> data;
|
||||
|
||||
public static void save2Db(@NotNull BusQueryLinesResponse data) {
|
||||
List<LineDataBean> save2Db = new ArrayList<>();
|
||||
LineDataBean temp = null;
|
||||
for (Result datum : data.data) {
|
||||
temp = new LineDataBean();
|
||||
temp.setLineId((long)datum.lineId);
|
||||
temp.setLineName(datum.name);
|
||||
save2Db.add(temp);
|
||||
}
|
||||
LineRepository.INSTANCE.checkAndUpdate(save2Db);
|
||||
}
|
||||
|
||||
public static class Result {
|
||||
|
||||
public long lineId;//线路id
|
||||
@@ -36,10 +24,6 @@ public class BusQueryLinesResponse extends BaseData {
|
||||
public String startSiteName;//始发站名称
|
||||
public String endSiteName;//终点名称
|
||||
|
||||
public boolean haveTask;
|
||||
|
||||
public List<BusQueryLineTaskResponse.Result> taskList;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
|
||||
@@ -30,7 +30,6 @@ class BusRoutesResponse : BaseData() {
|
||||
fun db2Beans(runnintTaskAndSites: List<TaskSiteDataBean>?): Pair<MutableList<BusStationBean>,Int> {
|
||||
val result = mutableListOf<BusStationBean>()
|
||||
var temp: BusStationBean? = null
|
||||
var currentStation: BusStationBean? = null
|
||||
var currentStationIndex = -1
|
||||
var lineInfo:LineInfo?=null
|
||||
if (runnintTaskAndSites.isNullOrEmpty()) {
|
||||
@@ -54,7 +53,6 @@ class BusRoutesResponse : BaseData() {
|
||||
result.add(temp!!)
|
||||
// 正在进行中的任务
|
||||
if (temp!!.drivingStatus == TaskSiteDataBean.drivingStatusCurrent) {
|
||||
currentStation = temp
|
||||
currentStationIndex = index
|
||||
}
|
||||
// 线路信息
|
||||
|
||||
@@ -70,7 +70,7 @@ data class ContrailDataBean(
|
||||
OchChainLogManager.writeChainLogAutopilot("轨迹错误",this.toString())
|
||||
return
|
||||
}
|
||||
LineManager.contraiInfo = ContraiInfo(lineId!!,csvFileUrl!!,csvFileMd5!!,txtFileUrl!!,txtFileMd5!!,contrailSaveTime!!)
|
||||
LineManager.setContraiInfo(ContraiInfo(lineId!!,csvFileUrl!!,csvFileMd5!!,txtFileUrl!!,txtFileMd5!!,contrailSaveTime!!))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,8 +70,6 @@ object BusLineModel {
|
||||
// 展示上一次刷新时间
|
||||
const val executableChangeTime = "executablechangetime"
|
||||
|
||||
const val LASTCOMMITLINEID = "lastcommitlineid"
|
||||
|
||||
var currentTask: TaskDataBean?=null
|
||||
|
||||
// 当前任务的站点列表
|
||||
@@ -260,9 +258,8 @@ object BusLineModel {
|
||||
line.name,
|
||||
object : TaskRepository.TaskStatusCallback {
|
||||
override fun startSuccess() {
|
||||
SharedPrefsMgr.getInstance()
|
||||
.putLong(LASTCOMMITLINEID, line.lineId)
|
||||
EventRepository.saveEventTaskStart(task.id,line.lineId,task.taskStartTime,line.name)
|
||||
OrderModel.queryBusRoutes()
|
||||
mBusLinesCallbackMap.forEach {
|
||||
it.value.onChangeLineIdSuccess()
|
||||
}
|
||||
@@ -393,6 +390,10 @@ object BusLineModel {
|
||||
it.taskId.toLong()
|
||||
)
|
||||
OrderModel.queryBusRoutes()
|
||||
}else{
|
||||
mBusLinesCallbackMap.forEach { callback->
|
||||
callback.value.onNoRunningTask()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,6 @@ object OrderModel {
|
||||
d(M_BUS + TAG, "获取到小巴路线数据:空 ")
|
||||
LineManager.setLineInfo(null);
|
||||
updateBusStatus()
|
||||
clearAutopilotControlParameters()
|
||||
closeBeautificationMode()
|
||||
clearStartAutopilotTag()
|
||||
removeTipRunnables()
|
||||
@@ -266,13 +265,11 @@ object OrderModel {
|
||||
lineInfo.lineName, lineTime,
|
||||
it, arrivingOrArrivedStationIndex, true
|
||||
)
|
||||
clearAutopilotControlParameters()
|
||||
} else {
|
||||
mADASStatusCallback?.updateBusTaskStatus(
|
||||
lineInfo.lineName, lineTime,
|
||||
it, arrivingOrArrivedStationIndex, false
|
||||
)
|
||||
updateAutopilotControlParameters()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -372,7 +369,7 @@ object OrderModel {
|
||||
|
||||
triggerStartServiceEvent(isRestart, false,0)
|
||||
|
||||
val parameters = initAutopilotControlParameters()
|
||||
val parameters = LineManager.initAutopilotControlParameters()
|
||||
if (null == parameters) {
|
||||
e(SceneConstant.M_BUS + TAG, "行程日志-AutopilotControlParameters is empty.")
|
||||
return
|
||||
@@ -630,59 +627,12 @@ object OrderModel {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将业务订单信息保存,鹰眼可取用
|
||||
*/
|
||||
private fun updateAutopilotControlParameters() {
|
||||
val parameters = initAutopilotControlParameters()
|
||||
if (null == parameters) {
|
||||
e(M_BUS + TAG, "AutopilotControlParameters is empty.")
|
||||
return
|
||||
}
|
||||
d(M_BUS + TAG, "AutopilotControlParameters is update.")
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(parameters)
|
||||
}
|
||||
|
||||
private fun clearAutopilotControlParameters() {
|
||||
d(M_BUS + TAG, "AutopilotControlParameters is clear.")
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(null)
|
||||
}
|
||||
|
||||
private fun initAutopilotControlParameters(): AutopilotControlParameters? {
|
||||
var parameters:AutopilotControlParameters? = null
|
||||
LineManager.getStationsWithLineAndContrai { start, end, lineInfo, contrai ->
|
||||
parameters = AutopilotControlParameters()
|
||||
parameters?.routeID = lineInfo.lineId.toInt()
|
||||
parameters?.routeName = lineInfo.lineName
|
||||
parameters?.startName = start.name
|
||||
parameters?.endName = end.name
|
||||
parameters?.startLatLon = AutoPilotLonLat(start.lat, start.lon)
|
||||
parameters?.endLatLon = AutoPilotLonLat(end.lat, end.lon)
|
||||
parameters?.vehicleType = VEHICLE_TYPE
|
||||
|
||||
if (parameters?.autoPilotLine == null) {
|
||||
parameters?.autoPilotLine = AutoPilotLine(
|
||||
lineInfo.lineId,
|
||||
lineInfo.lineName,
|
||||
contrai.csvFileUrl,
|
||||
contrai.csvFileMd5,
|
||||
contrai.txtFileUrl,
|
||||
contrai.txtFileMd5,
|
||||
contrai.contrailSaveTime,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
0L
|
||||
)
|
||||
}
|
||||
}
|
||||
if(parameters==null){
|
||||
ToastUtils.showShort("未设置起始或终点站点")
|
||||
}
|
||||
return parameters
|
||||
}
|
||||
|
||||
fun setTrajectoryStation(isClean:Boolean) {
|
||||
if(isClean){
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatus
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
import com.mogo.och.weaknet.callback.IBusADASStatusCallback
|
||||
import com.mogo.och.weaknet.fragment.ShuttleFragment
|
||||
import com.mogo.och.weaknet.model.BusLineModel
|
||||
import com.mogo.och.weaknet.model.OrderModel
|
||||
import com.mogo.och.weaknet.util.BusTrajectoryManager
|
||||
import mogo_msg.MogoReportMsg.MogoReportMessage
|
||||
@@ -33,7 +34,6 @@ import mogo_msg.MogoReportMsg.MogoReportMessage
|
||||
*/
|
||||
class BusPresenter(view: ShuttleFragment?) : Presenter<ShuttleFragment?>(view),
|
||||
IOchAutopilotStatusListener, ILoginCallback, IBusADASStatusCallback {
|
||||
private val mStationList: MutableList<BusStationBean> = ArrayList()
|
||||
private var mCurrentStation = 0
|
||||
|
||||
init {
|
||||
@@ -66,20 +66,6 @@ class BusPresenter(view: ShuttleFragment?) : Presenter<ShuttleFragment?>(view),
|
||||
LoginStatusManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
fun abortTask() {
|
||||
OrderModel.abortTask()
|
||||
}
|
||||
|
||||
fun autoDriveToNextStation() {
|
||||
OrderModel.autoDriveToNextStation()
|
||||
}
|
||||
|
||||
fun restartAutopilot() {
|
||||
if (OrderModel.isGoingToNextStation) {
|
||||
OrderModel.restartAutopilot()
|
||||
}
|
||||
}
|
||||
|
||||
// 登出
|
||||
fun logout() {
|
||||
OrderModel.logout()
|
||||
@@ -91,8 +77,6 @@ class BusPresenter(view: ShuttleFragment?) : Presenter<ShuttleFragment?>(view),
|
||||
arrivingOrArrivedIndex: Int,
|
||||
isArrived: Boolean
|
||||
) {
|
||||
mStationList.clear()
|
||||
mStationList.addAll(stationList)
|
||||
mCurrentStation = if (arrivingOrArrivedIndex == 0 || isArrived) {
|
||||
arrivingOrArrivedIndex
|
||||
} else {
|
||||
@@ -113,18 +97,14 @@ class BusPresenter(view: ShuttleFragment?) : Presenter<ShuttleFragment?>(view),
|
||||
|
||||
override fun onAutopilotArriveAtStation(arrivedStation: ArrivedStation?) {
|
||||
e(SceneConstant.M_BUS + TAG, "行程日志-onAutopilotArriveAtStation arrive")
|
||||
arriveStation(arrivedStation, "底盘触发进站")
|
||||
}
|
||||
|
||||
fun arriveStation(arrivedStation: ArrivedStation?, type: String?) {
|
||||
OrderModel.onArriveAt(arrivedStation, type!!)
|
||||
OrderModel.onArriveAt(arrivedStation, "底盘触发进站")
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
when (state) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE, IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING, IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {
|
||||
if (FunctionBuildConfig.isDemoMode
|
||||
&& ((mCurrentStation >= 0 && mCurrentStation <= mStationList.size - 1) && OrderModel.isGoingToNextStation)
|
||||
&& ((mCurrentStation >= 0 && mCurrentStation <= BusLineModel.stationList!!.size - 1) && OrderModel.isGoingToNextStation)
|
||||
) {
|
||||
d(SceneConstant.M_BUS + "BusOrderModel=", "有美化功能")
|
||||
return
|
||||
@@ -197,7 +177,6 @@ class BusPresenter(view: ShuttleFragment?) : Presenter<ShuttleFragment?>(view),
|
||||
if (isLogin()) {
|
||||
//OrderModel.queryBusRoutes()
|
||||
} else {
|
||||
BusTrajectoryManager.getInstance().stopTrajReqLoop()
|
||||
BusTrajectoryManager.getInstance().stopTrajReqLoop()
|
||||
clearBusStationsMarkers()
|
||||
OrderModel.closeBeautificationMode()
|
||||
|
||||
@@ -64,17 +64,7 @@ class SwitchLineAdapter(
|
||||
|
||||
//设置item点击事件
|
||||
holder.itemView.setOnClickListener {
|
||||
mData.forEachIndexed { index, result ->
|
||||
notifyItemChanged(index)
|
||||
if(result.taskList!=null) {
|
||||
result.taskList.clear()
|
||||
}
|
||||
if(index==currentPosition){// 点击当前已经打开的item 去关闭定时网络请求
|
||||
mItemClickListener?.onItemClick(currentPosition,true)
|
||||
return@setOnClickListener
|
||||
}
|
||||
}
|
||||
mItemClickListener?.onItemClick(currentPosition,false)
|
||||
mItemClickListener?.onItemClick(line)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +82,7 @@ class SwitchLineAdapter(
|
||||
}
|
||||
|
||||
interface LineItemClickListener {
|
||||
fun onItemClick(position: Int,close:Boolean)
|
||||
fun onItemClick(data: BusQueryLinesResponse.Result)
|
||||
}
|
||||
|
||||
inner class MyDiffCallback(private val oldData:List<BusQueryLinesResponse.Result>, private val newData:List<BusQueryLinesResponse.Result>):
|
||||
|
||||
@@ -74,9 +74,8 @@ class SwitchLineView: WindowRelativeLayout, SwtichLineModel.SwtichLineViewCallba
|
||||
switch_line_rv.setAdapter(mAdapter)
|
||||
//设置item 点击事件
|
||||
mAdapter.setOnLineItemClickListener(object : SwitchLineAdapter.LineItemClickListener{
|
||||
override fun onItemClick(position: Int, close: Boolean) {
|
||||
viewbizModel?.loadingSwitchTask(mAdapter.mData[position])
|
||||
//viewModel?.queryBusLineTasks(mAdapter.mData[position].lineId, position, close)
|
||||
override fun onItemClick(data: BusQueryLinesResponse.Result) {
|
||||
viewbizModel?.loadingSwitchTask(data)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -143,12 +142,6 @@ class SwitchLineView: WindowRelativeLayout, SwtichLineModel.SwtichLineViewCallba
|
||||
}
|
||||
}
|
||||
|
||||
override fun onChangeLineIdSuccess() {
|
||||
ToastUtils.showLong(resources.getString(R.string.bus_change_line_commit_tip_s))
|
||||
viewModel?.queryBusRoutes()
|
||||
mAdapter.setOnLineItemClickListener(null)
|
||||
}
|
||||
|
||||
override fun refreshDate(formatLongToString: String?) {
|
||||
val endTime = System.currentTimeMillis()
|
||||
val dex = (1000-(endTime - animatorStart)).takeIf { it>=0 }?:0
|
||||
|
||||
@@ -47,14 +47,9 @@ class SwtichLineModel : ViewModel(), IBusLinesCallback {
|
||||
BusLineModel.refreshTask()
|
||||
}
|
||||
|
||||
fun queryBusRoutes() {
|
||||
OrderModel.queryBusRoutes()
|
||||
}
|
||||
|
||||
interface SwtichLineViewCallback{
|
||||
fun startTaskState(success: Boolean)
|
||||
fun onBusLinesChange(data: MutableList<BusQueryLinesResponse.Result>?)
|
||||
fun onChangeLineIdSuccess()
|
||||
fun refreshDate(formatLongToString: String?)
|
||||
}
|
||||
|
||||
@@ -62,12 +57,6 @@ class SwtichLineModel : ViewModel(), IBusLinesCallback {
|
||||
viewCallback?.onBusLinesChange(data)
|
||||
}
|
||||
|
||||
override fun onChangeLineIdSuccess() {
|
||||
ThreadUtils.runOnUiThread( {
|
||||
viewCallback?.onChangeLineIdSuccess()
|
||||
},ThreadUtils.MODE.QUEUE)
|
||||
}
|
||||
|
||||
override fun onRefreshSuccess(currentTimeStamp: Long) {
|
||||
viewCallback?.refreshDate(
|
||||
DateTimeUtil.formatLongToString(currentTimeStamp, DateTimeUtil.HH_mm_ss)
|
||||
|
||||
@@ -66,7 +66,7 @@ class SwitchTaskView: WindowRelativeLayout, SwtichTaskModel.SwtichLineViewCallba
|
||||
|
||||
}
|
||||
})
|
||||
//rv_switch_task.setRecycledViewPool(null);
|
||||
|
||||
rv_switch_task.addItemDecoration(
|
||||
TaskBottomDecoration(
|
||||
AutoSizeUtils.dp2px(context, 174f)
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.och.weaknet.ui.switchtask
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.weaknet.bean.BusQueryLineTaskResponse
|
||||
import com.mogo.och.weaknet.bean.BusQueryLinesResponse
|
||||
@@ -57,16 +58,10 @@ class SwtichTaskModel : ViewModel(), IBusLinesCallback {
|
||||
|
||||
// 选择线路成功
|
||||
override fun onChangeLineIdSuccess() {
|
||||
if (ThreadUtils.isMainThread()) {
|
||||
BizLoopManager.runInMainThread{
|
||||
viewCallback?.hideLoading()
|
||||
viewCallback?.startTaskSuccess()
|
||||
}else{
|
||||
ThreadUtils.runOnUiThread({
|
||||
viewCallback?.hideLoading()
|
||||
viewCallback?.startTaskSuccess()
|
||||
},ThreadUtils.MODE.QUEUE)
|
||||
}
|
||||
|
||||
}
|
||||
// 选择线路失败
|
||||
override fun onChangeLineIdFail() {
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
<com.mogo.och.weaknet.ui.writeoff.WriteOffView
|
||||
android:id="@+id/actv_write_off_count"
|
||||
android:text="核销66人"
|
||||
tools:text="核销66人"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
Reference in New Issue
Block a user