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