|
@@ -452,6 +452,7 @@ public class AsyncPictureUpload {
|
|
|
Integer[] isFinish = {0,1,2};
|
|
|
RealmResults<AsyncUploadRealm> realmResults ;
|
|
|
RealmQuery<AsyncUploadRealm> queryRealm = mRealm.where(AsyncUploadRealm.class)
|
|
|
+ .in("isFinish",isFinish)
|
|
|
.equalTo("isDelete",0);
|
|
|
if (isAllRe){
|
|
|
Integer[] pushStatus = {0,1};
|
|
@@ -459,6 +460,7 @@ public class AsyncPictureUpload {
|
|
|
// .equalTo("notifyKey",fileKey)
|
|
|
// .equalTo("uploadType",uploadType)
|
|
|
;
|
|
|
+ isAllRe = false;
|
|
|
}else{
|
|
|
queryRealm.equalTo("pushStatus",0)
|
|
|
// .equalTo("notifyKey",fileKey)
|
|
@@ -487,26 +489,28 @@ public class AsyncPictureUpload {
|
|
|
*/
|
|
|
private void resultUpload(String tmpRealmId,Integer status,String photoPath){
|
|
|
if (tmpRealmId!=null && !tmpRealmId.isEmpty()){
|
|
|
- int rePush = 0;
|
|
|
+
|
|
|
//遍历删除
|
|
|
if (awaitUploadList.size()>0){
|
|
|
for (int i=0;i<awaitUploadList.size();i++){
|
|
|
if (awaitUploadList.get(i).getId().equals(tmpRealmId)){
|
|
|
- rePush = awaitUploadList.get(i).getRePush();
|
|
|
awaitUploadList.remove(i);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- int pushStatus = 2;
|
|
|
- if (status==0){
|
|
|
- pushStatus = rePush>4 ? 1 : 0;
|
|
|
- }
|
|
|
+
|
|
|
//更新值
|
|
|
mRealm.beginTransaction();
|
|
|
AsyncUploadRealm myObject = mRealm.where(AsyncUploadRealm.class).equalTo("id",tmpRealmId).findFirst();
|
|
|
assert myObject != null;
|
|
|
+ int rePush = myObject.getRePush();
|
|
|
+ int pushStatus = 2;
|
|
|
+ if (status==0){
|
|
|
+ pushStatus = rePush>4 ? 1 : 0;
|
|
|
+ }
|
|
|
+
|
|
|
if (myObject.getPushStatus()!=3){
|
|
|
myObject.setPushStatus(pushStatus);
|
|
|
}
|
|
@@ -516,6 +520,8 @@ public class AsyncPictureUpload {
|
|
|
}
|
|
|
if (status == 1){
|
|
|
myObject.setOssUrl(photoPath);
|
|
|
+ }else{
|
|
|
+ myObject.setRePush(myObject.getRePush()+1);
|
|
|
}
|
|
|
mRealm.commitTransaction();
|
|
|
|