|
@@ -454,6 +454,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};
|
|
@@ -461,6 +462,7 @@ public class AsyncPictureUpload {
|
|
|
// .equalTo("notifyKey",fileKey)
|
|
|
// .equalTo("uploadType",uploadType)
|
|
|
;
|
|
|
+ isAllRe = false;
|
|
|
}else{
|
|
|
queryRealm.equalTo("pushStatus",0)
|
|
|
// .equalTo("notifyKey",fileKey)
|
|
@@ -489,26 +491,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);
|
|
|
}
|
|
@@ -518,6 +522,8 @@ public class AsyncPictureUpload {
|
|
|
}
|
|
|
if (status == 1){
|
|
|
myObject.setOssUrl(photoPath);
|
|
|
+ }else{
|
|
|
+ myObject.setRePush(myObject.getRePush()+1);
|
|
|
}
|
|
|
mRealm.commitTransaction();
|
|
|
|