|
@@ -21,22 +21,27 @@ public class DownloadTask implements ITask {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
// TODO Auto-generated method stub
|
|
|
- DataService dService = ServiceFactory.getService(DataService.class);
|
|
|
- Record recordfind = Db.use("local").findFirst("select * from study where status=1 order by createAt asc");
|
|
|
-// recordfind.set("status", 2);
|
|
|
-// Db.use("local").update("study", recordfind);
|
|
|
- Date nowDate = new Date();
|
|
|
-
|
|
|
- recordfind.set("status", 4);
|
|
|
- recordfind.set("updateAt", getDateStr());
|
|
|
- Db.use("local").update("study", recordfind);
|
|
|
-// JSONObject jsonObject = JSON.parseObject(object.toString());
|
|
|
-// String[] strings = jsonObject.getString("Path").split("\\\\");
|
|
|
- dService.downloadFtpFile(recordfind.getStr("path"));
|
|
|
-// }
|
|
|
- recordfind.set("status", 3);
|
|
|
- recordfind.set("updateAt", getDateStr());
|
|
|
- Db.use("local").update("study", recordfind);
|
|
|
+ String[] strNow = new SimpleDateFormat("HH:mm:ss").format(new Date()).toString().split(":");
|
|
|
+ //获取时(24小时制)
|
|
|
+ Integer hInt = Integer.parseInt(strNow[0]);
|
|
|
+ if ((hInt <= 6 && hInt >=0) || (hInt <= 24 && hInt >=20)) {
|
|
|
+ DataService dService = ServiceFactory.getService(DataService.class);
|
|
|
+ Record recordfind = Db.use("local").findFirst("select * from study where status=1 order by createAt asc");
|
|
|
+// recordfind.set("status", 2);
|
|
|
+// Db.use("local").update("study", recordfind);
|
|
|
+ Date nowDate = new Date();
|
|
|
+
|
|
|
+ recordfind.set("status", 4);
|
|
|
+ recordfind.set("updateAt", getDateStr());
|
|
|
+ Db.use("local").update("study", recordfind);
|
|
|
+// JSONObject jsonObject = JSON.parseObject(object.toString());
|
|
|
+// String[] strings = jsonObject.getString("Path").split("\\\\");
|
|
|
+ dService.downloadFtpFile(recordfind.getStr("path"));
|
|
|
+// }
|
|
|
+ recordfind.set("status", 3);
|
|
|
+ recordfind.set("updateAt", getDateStr());
|
|
|
+ Db.use("local").update("study", recordfind);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|