fix: 处理异常上传问题
This commit is contained in:
@@ -12,8 +12,8 @@ android {
|
|||||||
applicationId "com.navinfo.outdoor"
|
applicationId "com.navinfo.outdoor"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 38
|
versionCode 39
|
||||||
versionName "8.221214"
|
versionName "8.221216"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
lintOptions {
|
lintOptions {
|
||||||
|
|||||||
@@ -1301,7 +1301,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
httpParams.put("auditId", chargingPileEntity.getBodyId());
|
httpParams.put("auditId", chargingPileEntity.getBodyId());
|
||||||
Response execute = OkGoBuilder.getInstance()
|
Response execute = OkGoBuilder.getInstance()
|
||||||
.time(0)
|
.time(600)
|
||||||
.url(HttpInterface.CS_TASK_UP_LOAD_PIC)
|
.url(HttpInterface.CS_TASK_UP_LOAD_PIC)
|
||||||
.params(httpParams)
|
.params(httpParams)
|
||||||
.token(Constant.ACCESS_TOKEN)
|
.token(Constant.ACCESS_TOKEN)
|
||||||
@@ -1345,7 +1345,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
httpParams.put("auditId", poiEntity.getBodyId());
|
httpParams.put("auditId", poiEntity.getBodyId());
|
||||||
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
|
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
|
||||||
.time(0)
|
.time(600)
|
||||||
.Builder(getActivity())
|
.Builder(getActivity())
|
||||||
.url(HttpInterface.C_TASK_UP_LOAD_PIC)
|
.url(HttpInterface.C_TASK_UP_LOAD_PIC)
|
||||||
.cls(PoiUploadBean.class)
|
.cls(PoiUploadBean.class)
|
||||||
|
|||||||
@@ -1001,7 +1001,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
httpParams.put("auditId", body);
|
httpParams.put("auditId", body);
|
||||||
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
|
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
|
||||||
.time(0)
|
.time(600)
|
||||||
.Builder(getActivity())
|
.Builder(getActivity())
|
||||||
.url(HttpInterface.POI_TASK_UPLOAD_PIC)
|
.url(HttpInterface.POI_TASK_UPLOAD_PIC)
|
||||||
.cls(OtherUploadPicBean.class)
|
.cls(OtherUploadPicBean.class)
|
||||||
|
|||||||
@@ -110,14 +110,12 @@ public class PoiSaveUtils {
|
|||||||
poiEntity.setChecked(false);
|
poiEntity.setChecked(false);
|
||||||
poiEntity.setWork_type(0);
|
poiEntity.setWork_type(0);
|
||||||
PoiDatabase.getInstance(mContext).getPoiDao().updatePoiEntity(poiEntity);
|
PoiDatabase.getInstance(mContext).getPoiDao().updatePoiEntity(poiEntity);
|
||||||
sendUploadMessage(poiEntityList.size(), anInt, bInt);
|
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
bInt++;
|
bInt++;
|
||||||
poiEntity.setChecked(false);
|
poiEntity.setChecked(false);
|
||||||
poiEntity.setWork_type(0);
|
poiEntity.setWork_type(0);
|
||||||
PoiDatabase.getInstance(mContext).getPoiDao().updatePoiEntity(poiEntity);
|
PoiDatabase.getInstance(mContext).getPoiDao().updatePoiEntity(poiEntity);
|
||||||
sendUploadMessage(poiEntityList.size(), anInt, bInt);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bInt++;
|
bInt++;
|
||||||
@@ -125,10 +123,10 @@ public class PoiSaveUtils {
|
|||||||
poiEntity.setWork_type(0);
|
poiEntity.setWork_type(0);
|
||||||
PoiDatabase.getInstance(mContext).getPoiDao().updatePoiEntity(poiEntity);
|
PoiDatabase.getInstance(mContext).getPoiDao().updatePoiEntity(poiEntity);
|
||||||
Constant.submitIdSet.remove(poiEntity.getId());
|
Constant.submitIdSet.remove(poiEntity.getId());
|
||||||
sendUploadMessage(poiEntityList.size(), anInt, bInt);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.onErrorResumeNext(Observable.empty());
|
||||||
// 处理普通数据
|
// 处理普通数据
|
||||||
Observable otherObserable = Observable.fromIterable(otherPoiEntityList)
|
Observable otherObserable = Observable.fromIterable(otherPoiEntityList)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
@@ -143,10 +141,10 @@ public class PoiSaveUtils {
|
|||||||
poiEntity.setChecked(false);
|
poiEntity.setChecked(false);
|
||||||
poiEntity.setWork_type(0);
|
poiEntity.setWork_type(0);
|
||||||
PoiDatabase.getInstance(mContext).getPoiDao().updatePoiEntity(poiEntity);
|
PoiDatabase.getInstance(mContext).getPoiDao().updatePoiEntity(poiEntity);
|
||||||
sendUploadMessage(poiEntityList.size(), anInt, bInt);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.onErrorResumeNext(Observable.empty());
|
||||||
// 处理需要分包上传数据的POI录像和道路数据
|
// 处理需要分包上传数据的POI录像和道路数据
|
||||||
Observable spliteFileObserable = Observable.fromIterable(spliteFilePoiEntityList)
|
Observable spliteFileObserable = Observable.fromIterable(spliteFilePoiEntityList)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
@@ -169,7 +167,6 @@ public class PoiSaveUtils {
|
|||||||
poiEntity.setChecked(false);
|
poiEntity.setChecked(false);
|
||||||
poiEntity.setWork_type(0);
|
poiEntity.setWork_type(0);
|
||||||
PoiDatabase.getInstance(mContext).getPoiDao().updatePoiEntity(poiEntity);
|
PoiDatabase.getInstance(mContext).getPoiDao().updatePoiEntity(poiEntity);
|
||||||
sendUploadMessage(poiEntityList.size(), anInt, bInt);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -177,6 +174,10 @@ public class PoiSaveUtils {
|
|||||||
@Override
|
@Override
|
||||||
public ObservableSource<?> apply(PoiEntity poiEntity) throws Exception {
|
public ObservableSource<?> apply(PoiEntity poiEntity) throws Exception {
|
||||||
List<File> photoFileList = AWMp4ParserHelper.getInstance().getFileListByUUID(poiEntity.getId());
|
List<File> photoFileList = AWMp4ParserHelper.getInstance().getFileListByUUID(poiEntity.getId());
|
||||||
|
if (photoFileList == null||photoFileList.isEmpty()) {
|
||||||
|
bInt++;
|
||||||
|
return Observable.empty();
|
||||||
|
}
|
||||||
return DataSaveUtils.getInstance().getUploadSpliteFilesObservble(mContext, poiEntity, photoFileList)
|
return DataSaveUtils.getInstance().getUploadSpliteFilesObservble(mContext, poiEntity, photoFileList)
|
||||||
.toObservable();
|
.toObservable();
|
||||||
}
|
}
|
||||||
@@ -192,11 +193,13 @@ public class PoiSaveUtils {
|
|||||||
public void accept(Throwable throwable) throws Exception {
|
public void accept(Throwable throwable) throws Exception {
|
||||||
bInt++;
|
bInt++;
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.onErrorResumeNext(Observable.empty());
|
||||||
Observable.concat(
|
Observable.concat(
|
||||||
otherObserable, spliteFileObserable, chargePoiObserable
|
otherObserable, spliteFileObserable, chargePoiObserable
|
||||||
).subscribeOn(Schedulers.io())
|
).subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.onErrorResumeNext(Observable.empty())
|
||||||
.subscribe(new Observer() {
|
.subscribe(new Observer() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
@@ -530,7 +533,7 @@ public class PoiSaveUtils {
|
|||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
httpParams.put("auditId", poiEntity.getBodyId());
|
httpParams.put("auditId", poiEntity.getBodyId());
|
||||||
Response execute = OkGoBuilder.getInstance()
|
Response execute = OkGoBuilder.getInstance()
|
||||||
.time(0)
|
.time(600)
|
||||||
.Builder(mContext)
|
.Builder(mContext)
|
||||||
.url(url)
|
.url(url)
|
||||||
.params(httpParams)
|
.params(httpParams)
|
||||||
@@ -718,7 +721,7 @@ public class PoiSaveUtils {
|
|||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
httpParams.put("auditId", chargingPileEntity.getBodyId());
|
httpParams.put("auditId", chargingPileEntity.getBodyId());
|
||||||
Response execute = OkGoBuilder.getInstance()
|
Response execute = OkGoBuilder.getInstance()
|
||||||
.time(0)
|
.time(600)
|
||||||
.Builder(mContext)
|
.Builder(mContext)
|
||||||
.url(HttpInterface.CS_TASK_UP_LOAD_PIC)
|
.url(HttpInterface.CS_TASK_UP_LOAD_PIC)
|
||||||
.token(Constant.ACCESS_TOKEN)
|
.token(Constant.ACCESS_TOKEN)
|
||||||
|
|||||||
@@ -525,7 +525,7 @@ public class UploadUtils {
|
|||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
httpParams.put("auditId", chargingPileEntity.getBodyId());
|
httpParams.put("auditId", chargingPileEntity.getBodyId());
|
||||||
Response execute = OkGoBuilder.getInstance()
|
Response execute = OkGoBuilder.getInstance()
|
||||||
.time(0)
|
.time(600)
|
||||||
.url(HttpInterface.CS_TASK_UP_LOAD_PIC)
|
.url(HttpInterface.CS_TASK_UP_LOAD_PIC)
|
||||||
.params(httpParams)
|
.params(httpParams)
|
||||||
.token(Constant.ACCESS_TOKEN)
|
.token(Constant.ACCESS_TOKEN)
|
||||||
|
|||||||
Reference in New Issue
Block a user