Commit fffca064 by fudahua

feat: 正在处理的

parent 17503f3d
...@@ -69,4 +69,6 @@ public interface IDownloadTaskService { ...@@ -69,4 +69,6 @@ public interface IDownloadTaskService {
DownloadProcessDTO getDownloadProcess(); DownloadProcessDTO getDownloadProcess();
void checkTaskStatus(String param); void checkTaskStatus(String param);
public List<DownloadTask> getDownloadTaskOfBuilding(String queryDataSource);
} }
...@@ -609,12 +609,12 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService { ...@@ -609,12 +609,12 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
// } // }
// } // }
//之前正在处理的队列需要重新处理 //之前正在处理的队列需要重新处理
List<DownloadRecord> list = this.downloadTaskService.listUnDownloadTask(QueryDataSource.FLAT_QUERY); // List<DownloadRecord> list = this.downloadTaskService.listUnDownloadTask(QueryDataSource.FLAT_QUERY);
// List<DownloadTask> tasks = DownloadTaskServiceImpl.getInstance().getDownloadTaskOfBuilding(QueryDataSource.FLAT_QUERY); List<DownloadTask> tasks = DownloadTaskServiceImpl.getInstance().getDownloadTaskOfBuilding(QueryDataSource.FLAT_QUERY);
logger.info("初始化任务:{}",JSONObject.toJSONString(list)); logger.info("初始化任务:{}",JSONObject.toJSONString(tasks));
for (DownloadRecord task : list) { for (DownloadTask task : tasks) {
FlatQueryTaskCondition condition = JSON.parseObject(task.getDownloadCondition(), FlatQueryTaskCondition.class); // FlatQueryTaskCondition condition = JSON.parseObject(task.getDownloadCondition(), FlatQueryTaskCondition.class);
DownloadTask downloadTask = DownloadTaskServiceImpl.getInstance().getDownloadTaskById(condition.getTaskId()); // DownloadTask downloadTask = DownloadTaskServiceImpl.getInstance().getDownloadTaskById(condition.getTaskId());
String key=LOCK_KEY+":"+task.getId(); String key=LOCK_KEY+":"+task.getId();
Object cache = RedisUtil.getCache(key); Object cache = RedisUtil.getCache(key);
if (cache!=null) { if (cache!=null) {
...@@ -622,9 +622,9 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService { ...@@ -622,9 +622,9 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
} }
delFileOrDirByTaskId(task.getId()); delFileOrDirByTaskId(task.getId());
//重新处理 //重新处理
downloadTask.setStatus(DownloadTaskStatus.WAITING); task.setStatus(DownloadTaskStatus.WAITING);
downloadTask.setDownloadTime(new Date()); task.setDownloadTime(new Date());
DownloadTaskServiceImpl.getInstance().updateDownloadTask(downloadTask); DownloadTaskServiceImpl.getInstance().updateDownloadTask(task);
} }
}catch (Exception e){ }catch (Exception e){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment