|
@@ -4,7 +4,6 @@ import java.io.File;
|
|
|
import java.io.FileOutputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
-import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
@@ -49,22 +48,13 @@ public class DownloadTask implements ITask {
|
|
|
// if (flag > max) {
|
|
|
// continue;
|
|
|
// }
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
- String timeString = studyidfind.getStr("createAt");
|
|
|
- try {
|
|
|
- Date creatDate = sdf.parse(timeString);
|
|
|
- Date nowDate = new Date();
|
|
|
- Long due = nowDate.getTime() - creatDate.getTime();
|
|
|
- //延时30min
|
|
|
- if (due < 1800000) {
|
|
|
- return;
|
|
|
- }
|
|
|
- } catch (ParseException e) {
|
|
|
- // TODO Auto-generated catch block
|
|
|
- e.printStackTrace();
|
|
|
+ Date creatDate = studyidfind.getDate("createAt");
|
|
|
+ Date nowDate = new Date();
|
|
|
+ Long due = nowDate.getTime() - creatDate.getTime();
|
|
|
+ //延时30min
|
|
|
+ if (due < 1800000) {
|
|
|
+ return;
|
|
|
}
|
|
|
-// Date creatDate = studyidfind.getDate("createAt");
|
|
|
-
|
|
|
//状态4:下载中
|
|
|
studyidfind.set("status", 4);
|
|
|
Db.use("local").update("study", studyidfind);
|