|
@@ -61,6 +61,12 @@ public class BatchDonloadServiceImpl implements IBatchDonloadService {
|
|
|
@Override
|
|
|
public ResultData getDownloadDetail(String uuid) throws Exception {
|
|
|
|
|
|
+ //查询任务是否正在进行中
|
|
|
+ List<String> taskList = FileUtil.readUtf8Lines(taskLogPath);
|
|
|
+ if(CollUtil.isNotEmpty(taskList) && taskList.contains(uuid)){
|
|
|
+ return ResultData.ok("下载中");
|
|
|
+ }
|
|
|
+
|
|
|
String dir = parentPath.concat(uuid).concat(File.separator);
|
|
|
String origFilePath = dir.concat(uuid + ".txt");
|
|
|
List<String> numList = FileUtil.readUtf8Lines(origFilePath);
|
|
@@ -83,7 +89,7 @@ public class BatchDonloadServiceImpl implements IBatchDonloadService {
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
- return ResultData.error(0, "成功", collect);
|
|
|
+ return ResultData.ok(collect);
|
|
|
}
|
|
|
|
|
|
public ResultData bacthDownload(@RequestParam(value = "file") MultipartFile file) throws Exception {
|
|
@@ -179,7 +185,7 @@ public class BatchDonloadServiceImpl implements IBatchDonloadService {
|
|
|
}
|
|
|
Thread.sleep(2000L);
|
|
|
long endTime = Calendar.getInstance().getTimeInMillis();
|
|
|
- if ((endTime - startTime) > 2 * 60 * 60 * 1000) {
|
|
|
+ if ((endTime - startTime) > 4 * 60 * 60 * 1000) {
|
|
|
log.info("下载超时,num:{}", num);
|
|
|
reason = "下载超时";
|
|
|
go = true;
|