|
|
@ -39,19 +39,23 @@ final class ResumeAllCmd<T extends AbsTaskEntity> extends AbsNormalCmd<T> { |
|
|
|
private void resumeDownload() { |
|
|
|
private void resumeDownload() { |
|
|
|
List<DownloadTaskEntity> dTaskEntity = |
|
|
|
List<DownloadTaskEntity> dTaskEntity = |
|
|
|
DbEntity.findDatas(DownloadTaskEntity.class, "isGroupTask=?", "false"); |
|
|
|
DbEntity.findDatas(DownloadTaskEntity.class, "isGroupTask=?", "false"); |
|
|
|
|
|
|
|
if (dTaskEntity != null && !dTaskEntity.isEmpty()) { |
|
|
|
for (DownloadTaskEntity te : dTaskEntity) { |
|
|
|
for (DownloadTaskEntity te : dTaskEntity) { |
|
|
|
int state = te.getState(); |
|
|
|
int state = te.getState(); |
|
|
|
if (state == IEntity.STATE_COMPLETE || state == IEntity.STATE_FAIL) continue; |
|
|
|
if (state == IEntity.STATE_COMPLETE || state == IEntity.STATE_FAIL) continue; |
|
|
|
resumeEntity(te); |
|
|
|
resumeEntity(te); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<DownloadGroupTaskEntity> groupTask = DbEntity.findAllData(DownloadGroupTaskEntity.class); |
|
|
|
List<DownloadGroupTaskEntity> groupTask = DbEntity.findAllData(DownloadGroupTaskEntity.class); |
|
|
|
|
|
|
|
if (groupTask != null && !groupTask.isEmpty()) { |
|
|
|
for (DownloadGroupTaskEntity te : groupTask) { |
|
|
|
for (DownloadGroupTaskEntity te : groupTask) { |
|
|
|
int state = te.getState(); |
|
|
|
int state = te.getState(); |
|
|
|
if (state == IEntity.STATE_COMPLETE || state == IEntity.STATE_FAIL) continue; |
|
|
|
if (state == IEntity.STATE_COMPLETE || state == IEntity.STATE_FAIL) continue; |
|
|
|
resumeEntity(te); |
|
|
|
resumeEntity(te); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 恢复上传,包括普通任务和任务组 |
|
|
|
* 恢复上传,包括普通任务和任务组 |
|
|
@ -59,12 +63,14 @@ final class ResumeAllCmd<T extends AbsTaskEntity> extends AbsNormalCmd<T> { |
|
|
|
private void resumeUpload() { |
|
|
|
private void resumeUpload() { |
|
|
|
List<UploadTaskEntity> dTaskEntity = |
|
|
|
List<UploadTaskEntity> dTaskEntity = |
|
|
|
DbEntity.findDatas(UploadTaskEntity.class, "isGroupTask=?", "false"); |
|
|
|
DbEntity.findDatas(UploadTaskEntity.class, "isGroupTask=?", "false"); |
|
|
|
|
|
|
|
if (dTaskEntity != null && !dTaskEntity.isEmpty()) { |
|
|
|
for (UploadTaskEntity te : dTaskEntity) { |
|
|
|
for (UploadTaskEntity te : dTaskEntity) { |
|
|
|
int state = te.getState(); |
|
|
|
int state = te.getState(); |
|
|
|
if (state == IEntity.STATE_COMPLETE || state == IEntity.STATE_FAIL) continue; |
|
|
|
if (state == IEntity.STATE_COMPLETE || state == IEntity.STATE_FAIL) continue; |
|
|
|
resumeEntity(te); |
|
|
|
resumeEntity(te); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 恢复实体任务 |
|
|
|
* 恢复实体任务 |
|
|
|