[6.0.0] 1、轨迹预加载逻辑调整
This commit is contained in:
@@ -295,7 +295,8 @@ class TaxiFragment : BaseTaxiTabFragment<TaxiFragment, TaxiPresenter>(),
|
||||
orderInfo.text = "订单信息: 开始: " + order?.orderStartSite?.siteName + ", 结束: "+
|
||||
order?.orderEndSite?.siteName + ", orderStatus: "+ order?.orderStatus
|
||||
|
||||
orderToStartLines.text = "接驾任务的lineId集合: " + GsonUtil.jsonFromObject(order?.planningLines)
|
||||
orderToStartLines.text = "接驾任务的lineId集合: " + GsonUtil.jsonFromObject(order?.planningLines) +
|
||||
", 送驾任务lineId: " + order?.orderLine
|
||||
|
||||
val curContrail = TaxiModel.getCurTaskContrail()
|
||||
testCurTrajMd5!!.text = "TMd5:" + curContrail?.csvFileMd5
|
||||
|
||||
@@ -133,9 +133,6 @@ public class TaxiTrajectoryManager {
|
||||
if (curTaskContrail == null) return;
|
||||
|
||||
long curLineId = taskAndOrder.getLineId();
|
||||
final List<ContrailListRespBean.Result> orderContrails = TaxiModel.INSTANCE.getCurOrderContrails();
|
||||
final OrderDetail orderDetail = taskAndOrder.getOrder();
|
||||
ContrailListRespBean.Result preloadContrail = null; //预加载的轨迹
|
||||
|
||||
if (mAutoPilotLine == null) {
|
||||
mAutoPilotLine = new AutopilotControlParameters.AutoPilotLine(curTaskContrail.getLineId(), curTaskContrail.getLineName(),
|
||||
@@ -144,7 +141,7 @@ public class TaxiTrajectoryManager {
|
||||
curTaskContrail.getCsvFileUrlDPQP(), curTaskContrail.getCsvFileMd5DPQP(), curTaskContrail.getTxtFileUrlDPQP(),
|
||||
curTaskContrail.getTxtFileMd5DPQP(), curTaskContrail.getContrailSaveTimeDPQP());
|
||||
} else {
|
||||
mAutoPilotLine.setLineId(taskAndOrder.getLineId());
|
||||
mAutoPilotLine.setLineId(curTaskContrail.getLineId());
|
||||
mAutoPilotLine.setLineName(curTaskContrail.getLineName());
|
||||
mAutoPilotLine.setTrajUrl(curTaskContrail.getCsvFileUrl());
|
||||
mAutoPilotLine.setTrajMd5(curTaskContrail.getCsvFileMd5());
|
||||
@@ -159,13 +156,21 @@ public class TaxiTrajectoryManager {
|
||||
mAutoPilotLine.setTimestamp_dpqp(curTaskContrail.getContrailSaveTimeDPQP());
|
||||
}
|
||||
|
||||
final OrderDetail orderDetail = taskAndOrder.getOrder();
|
||||
ContrailListRespBean.Result preloadContrail = null; //预加载的轨迹
|
||||
final List<ContrailListRespBean.Result> orderContrails = TaxiModel.INSTANCE.getCurOrderContrails();
|
||||
|
||||
if (orderDetail != null && orderContrails != null && orderContrails.size() != 0 ){
|
||||
if (orderContrails.contains(curLineId)){ //预加载轨迹是curLineId索引的下一个
|
||||
int index = orderContrails.indexOf(curLineId);
|
||||
if (orderContrails.size()-1 >= index){
|
||||
preloadContrail = orderContrails.get(index);
|
||||
for (int i = 0; i< orderContrails.size() ; i++){
|
||||
if (orderContrails.get(i).getLineId() == curLineId){ //预加载轨迹是curLineId索引的下一个
|
||||
int index = i + 1;
|
||||
if (orderContrails.size()-1 >= index){
|
||||
preloadContrail = orderContrails.get(index);
|
||||
}
|
||||
}
|
||||
}else {//预加载轨迹直接是集合第一个
|
||||
}
|
||||
if (preloadContrail == null){
|
||||
//不包含预加载轨迹直接是集合第一个
|
||||
preloadContrail = orderContrails.get(0);
|
||||
}
|
||||
}
|
||||
@@ -179,7 +184,7 @@ public class TaxiTrajectoryManager {
|
||||
preloadContrail.getCsvFileUrlDPQP(), preloadContrail.getCsvFileMd5DPQP(), preloadContrail.getTxtFileUrlDPQP(),
|
||||
preloadContrail.getTxtFileMd5DPQP(), preloadContrail.getContrailSaveTimeDPQP());
|
||||
} else {
|
||||
mPreAutoPilotLine.setLineId(taskAndOrder.getLineId());
|
||||
mPreAutoPilotLine.setLineId(preloadContrail.getLineId());
|
||||
mPreAutoPilotLine.setLineName(preloadContrail.getLineName());
|
||||
mPreAutoPilotLine.setTrajUrl(preloadContrail.getCsvFileUrl());
|
||||
mPreAutoPilotLine.setTrajMd5(preloadContrail.getCsvFileMd5());
|
||||
@@ -275,6 +280,6 @@ public class TaxiTrajectoryManager {
|
||||
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "sendTrajectoryReq(): common_load = "
|
||||
+ GsonUtils.toJson(mAutoPilotLine) + "pre_load" + GsonUtils.toJson(mPreAutoPilotLine));
|
||||
+ GsonUtils.toJson(mAutoPilotLine) + ", pre_load" + GsonUtils.toJson(mPreAutoPilotLine));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user