|
@@ -23,7 +23,7 @@ public class CMoveTask implements ITask {
|
|
|
return;
|
|
|
}
|
|
|
//延迟10分钟获取影像,并且查找状态为待CMOVE和错误状态的检查
|
|
|
- List<Record> studyidfinds = Db.use("local").find("select * from study where status =1 or status =2 and createAt<? order by createAt asc limit 4",parseStringToDate());
|
|
|
+ List<Record> studyidfinds = Db.use("local").find("select * from study where status =1 or status =2 and createAt<? order by createAt asc limit 1",parseStringToDate());
|
|
|
if (studyidfinds == null) {
|
|
|
return;
|
|
|
}
|
|
@@ -56,6 +56,40 @@ public class CMoveTask implements ITask {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ //延迟10分钟获取影像,并且查找状态为待CMOVE和错误状态的检查
|
|
|
+ List<Record> studyidfindsde = Db.use("local").find("select * from study where status =1 or status =2 and createAt<? order by createAt desc limit 1",parseStringToDate());
|
|
|
+ if (studyidfindsde == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (Record studyidfind : studyidfindsde) {
|
|
|
+ flag++;
|
|
|
+ if (flag <= 5) {
|
|
|
+ //状态4:下载中
|
|
|
+ studyidfind.set("status", 4);
|
|
|
+ studyidfind.set("updateAt", parseStringToDateTime());
|
|
|
+ Db.use("local").update("study", studyidfind);
|
|
|
+
|
|
|
+// ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
|
|
|
+// tService.execute(() -> {
|
|
|
+ String execCmd = ExecUtil.execCmd("/zskk_system/other/cmove.sh " + studyidfind.getStr("studyuid"));
|
|
|
+ if (execCmd.contains("Connection refused")) {
|
|
|
+ //状态2:错误
|
|
|
+ studyidfind.set("status", 2);
|
|
|
+ studyidfind.set("updateAt", parseStringToDateTime());
|
|
|
+ Db.use("local").update("study", studyidfind);
|
|
|
+ }else {
|
|
|
+ //状态2:完成
|
|
|
+ studyidfind.set("status", 3);
|
|
|
+ studyidfind.set("updateAt", parseStringToDateTime());
|
|
|
+ Db.use("local").update("study", studyidfind);
|
|
|
+ }
|
|
|
+
|
|
|
+// });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|