|
@@ -1,6 +1,8 @@
|
|
|
package com.zskk.task;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.Date;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
@@ -18,7 +20,7 @@ public class ReDownloadTask implements ITask {
|
|
|
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=2 and modalities <>'US' and updateAt >'2025-04-20 00:00:00' order by createAt asc");
|
|
|
+ Record recordfind = Db.use("local").findFirst("select * from study where status=2 and modalities <>'US' and updateAt >'2025-04-20 00:00:00' and createAt < ? order by createAt asc", getDateStr());
|
|
|
try {
|
|
|
JSONArray array = dService.getImage(recordfind.getStr("accessionNumber"));
|
|
|
if (array==null) {
|
|
@@ -60,10 +62,8 @@ public class ReDownloadTask implements ITask {
|
|
|
* @return
|
|
|
*/
|
|
|
private String getDateStr() {
|
|
|
- SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
- Date date = new Date();
|
|
|
- String timeString = null;
|
|
|
- timeString = sdf.format(date);
|
|
|
- return timeString;
|
|
|
+ //返回半天前的时间
|
|
|
+ return DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
|
|
|
+ .format(LocalDateTime.now().minusHours(12));
|
|
|
}
|
|
|
}
|