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