|
@@ -19,24 +19,24 @@ public class DownloadTask implements ITask {
|
|
|
// 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");
|
|
|
-// JSONArray array = dService.getImage(recordfind.getStr("accessionNumber"));
|
|
|
-// if (array==null) {
|
|
|
-// recordfind.set("status", 2);
|
|
|
-// Db.use("local").update("study",recordfind);
|
|
|
-// return;
|
|
|
-// }
|
|
|
- recordfind.set("status", 5);
|
|
|
-// recordfind.set("imageNum", array.size());
|
|
|
+ JSONArray array = dService.getImage(recordfind.getStr("accessionNumber"));
|
|
|
+ if (array==null) {
|
|
|
+ recordfind.set("status", 2);
|
|
|
+ Db.use("local").update("study",recordfind);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ recordfind.set("status", 4);
|
|
|
+ recordfind.set("imageNum", array.size());
|
|
|
recordfind.set("updateAt", getDateStr());
|
|
|
-// Db.use("local").update("study",recordfind);
|
|
|
-// for (Object object : array) {
|
|
|
-// JSONObject jsonObject = JSON.parseObject(object.toString());
|
|
|
-// String[] strings = jsonObject.getString("Path").split("\\\\");
|
|
|
-// dService.downloadFtpFile(jsonObject.getString("Path"), strings[1]);
|
|
|
-// }
|
|
|
-// recordfind.set("status", 3);
|
|
|
-// recordfind.set("updateAt", getDateStr());
|
|
|
-// Db.use("local").update("study",recordfind);
|
|
|
+ Db.use("local").update("study",recordfind);
|
|
|
+ for (Object object : array) {
|
|
|
+ JSONObject jsonObject = JSON.parseObject(object.toString());
|
|
|
+ String[] strings = jsonObject.getString("Path").split("\\\\");
|
|
|
+ dService.downloadFtpFile(jsonObject.getString("Path"), strings[1]);
|
|
|
+ }
|
|
|
+ recordfind.set("status", 3);
|
|
|
+ recordfind.set("updateAt", getDateStr());
|
|
|
+ Db.use("local").update("study",recordfind);
|
|
|
}
|
|
|
|
|
|
@Override
|