|
@@ -22,8 +22,8 @@ public class ReCMoveTask implements ITask {
|
|
if (flag >= 8) {
|
|
if (flag >= 8) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- //延迟10分钟获取影像,并且查找状态为待CMOVE和错误状态的检查
|
|
|
|
- List<Record> studyidfinds = Db.use("local").find("select * from study where status =3 and modalities='CT' and modalities='MR' and createAt<? order by createAt asc",parseStringToDate());
|
|
|
|
|
|
+ //2小时到2天内的检查重新获取
|
|
|
|
+ List<Record> studyidfinds = Db.use("local").find("select * from study where status =3 and modalities='CT' and modalities='MR' and createAt between ? and ? order by createAt asc", parseStringToDateTo(), parseStringToDateFrom());
|
|
if (studyidfinds == null) {
|
|
if (studyidfinds == null) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -36,20 +36,20 @@ public class ReCMoveTask implements ITask {
|
|
studyidfind.set("status", 4);
|
|
studyidfind.set("status", 4);
|
|
Db.use("local").update("study", studyidfind);
|
|
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);
|
|
|
|
- Db.use("local").update("study", studyidfind);
|
|
|
|
- }else {
|
|
|
|
- //状态5:重新下载完成
|
|
|
|
- studyidfind.set("status", 5);
|
|
|
|
- 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);
|
|
|
|
+ Db.use("local").update("study", studyidfind);
|
|
|
|
+ } else {
|
|
|
|
+ // 状态5:重新下载完成
|
|
|
|
+ studyidfind.set("status", 5);
|
|
|
|
+ Db.use("local").update("study", studyidfind);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+// });
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -67,7 +67,7 @@ public class ReCMoveTask implements ITask {
|
|
* @param dateStr
|
|
* @param dateStr
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- private String parseStringToDate() {
|
|
|
|
|
|
+ private String parseStringToDateFrom() {
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
long dInteger = date.getTime() - 7200000;
|
|
long dInteger = date.getTime() - 7200000;
|
|
@@ -75,5 +75,20 @@ public class ReCMoveTask implements ITask {
|
|
return daString;
|
|
return daString;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 日期字符串格式转换
|
|
|
|
+ *
|
|
|
|
+ * @param dateStr
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private String parseStringToDateTo() {
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ Date date = new Date();
|
|
|
|
+ long dInteger = date.getTime() - 172800000;
|
|
|
|
+ String daString = sdf.format(new Date(dInteger));
|
|
|
|
+ return daString;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|