fix: 修改部分情况下照片文件损坏的问题
This commit is contained in:
parent
36a65da786
commit
d565f299ad
@ -1309,7 +1309,9 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
|||||||
/**
|
/**
|
||||||
* 结束采集,对照片归档
|
* 结束采集,对照片归档
|
||||||
* */
|
* */
|
||||||
|
private boolean hasFinishTask = false; // 当前是否包含已完成任务未处理完
|
||||||
private void finishRoadTask(Map<Integer, RoadMatchEntity> finishEntityMap) {
|
private void finishRoadTask(Map<Integer, RoadMatchEntity> finishEntityMap) {
|
||||||
|
hasFinishTask = true;
|
||||||
Observable.fromIterable(finishEntityMap.values())
|
Observable.fromIterable(finishEntityMap.values())
|
||||||
.subscribeOn(Schedulers.io()).observeOn(Schedulers.computation())
|
.subscribeOn(Schedulers.io()).observeOn(Schedulers.computation())
|
||||||
.filter(roadMatchEntity -> roadMatchEntity!=null)
|
.filter(roadMatchEntity -> roadMatchEntity!=null)
|
||||||
@ -1352,23 +1354,36 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.onErrorResumeNext(new Function<Throwable, ObservableSource<? extends PoiEntity>>() {
|
||||||
|
@Override
|
||||||
|
public ObservableSource<? extends PoiEntity> apply(Throwable throwable) throws Exception {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
})
|
||||||
.subscribe(new Consumer<PoiEntity>() {
|
.subscribe(new Consumer<PoiEntity>() {
|
||||||
@Override
|
@Override
|
||||||
public void accept(PoiEntity poiEntity) {
|
public void accept(PoiEntity poiEntity) {
|
||||||
|
// 已经处理过该任务,将其从finish列表中移除
|
||||||
|
if (poiEntity!=null) {
|
||||||
|
finishEntityMap.remove(poiEntity.getTaskId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, new Consumer<Throwable>() {
|
}, new Consumer<Throwable>() {
|
||||||
@Override
|
@Override
|
||||||
public void accept(Throwable throwable) {
|
public void accept(Throwable throwable) {
|
||||||
// 此处异常可能是服务返回的数据无法解析,但http正常返回了,因此可能为程序问题,不再重复尝试上报
|
// 此处异常可能是服务返回的数据无法解析,但http正常返回了,因此可能为程序问题,不再重复尝试上报
|
||||||
systemTTS.playText("注意,领取任务失败!");
|
systemTTS.playText("注意,领取任务失败!");
|
||||||
|
XLog.e("完成失败:"+throwable.getMessage());
|
||||||
ToastUtils.Message(AutoTakePictureActivity.this, throwable.getMessage());
|
ToastUtils.Message(AutoTakePictureActivity.this, throwable.getMessage());
|
||||||
|
hasFinishTask = false;
|
||||||
}
|
}
|
||||||
}, new Action() {
|
}, new Action() {
|
||||||
@Override
|
@Override
|
||||||
public void run() throws Exception {
|
public void run() throws Exception {
|
||||||
// 重新绘制网络任务和本地任务
|
// 重新绘制网络任务和本地任务
|
||||||
initRoadLine2Map();
|
initRoadLine2Map();
|
||||||
|
finishEntityMap.clear();
|
||||||
|
hasFinishTask = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1677,6 +1692,10 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
|||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||||
|
if (hasFinishTask) {
|
||||||
|
MessageDialog.show(this, "提示", "后台正在处理已拍摄完成的任务,请稍后再退出当前界面");
|
||||||
|
return;
|
||||||
|
}
|
||||||
MessageDialog.show(this, "提示", "退出自动采集模式?", "是", "否").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
MessageDialog.show(this, "提示", "退出自动采集模式?", "是", "否").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
@ -3,8 +3,8 @@ package com.navinfo.outdoor.http;
|
|||||||
public class HttpInterface {
|
public class HttpInterface {
|
||||||
// public static final String IP = "http://172.23.138.133:9999/m4";//测试接口-IP
|
// public static final String IP = "http://172.23.138.133:9999/m4";//测试接口-IP
|
||||||
public static final String IPm = "http://dtxbmaps.navinfo.com/dtxb/dev/m4";//开发接口-外网
|
public static final String IPm = "http://dtxbmaps.navinfo.com/dtxb/dev/m4";//开发接口-外网
|
||||||
public static final String IP1 = "http://dtxbmaps.navinfo.com/dtxb/test/m4";//测试接口-外网
|
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/test/m4";//测试接口-外网
|
||||||
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
|
public static final String IP1 = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
|
||||||
public static final String USER_PATH = "/user/";//我的
|
public static final String USER_PATH = "/user/";//我的
|
||||||
public static final String MSG_LIST_PATH = "/msgList/";//发现
|
public static final String MSG_LIST_PATH = "/msgList/";//发现
|
||||||
public static final String USER_LOGIN_PATH = "/userlogin/";//登录
|
public static final String USER_LOGIN_PATH = "/userlogin/";//登录
|
||||||
|
Loading…
x
Reference in New Issue
Block a user