LAPTOP-5NTQJPUS\LT há 5 dias atrás
pai
commit
891275fcc5
1 ficheiros alterados com 15 adições e 2 exclusões
  1. 15 2
      DataFusion/src/com/zskk/task/ReDownloadTask.java

+ 15 - 2
DataFusion/src/com/zskk/task/ReDownloadTask.java

@@ -20,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' and createAt < ? order by createAt asc", getDateStr());
+		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", getDateStrPass());
 		try {
 			JSONArray array = dService.getImage(recordfind.getStr("accessionNumber"));
 			if (array==null) {
@@ -55,13 +55,26 @@ public class ReDownloadTask implements ITask {
 		// TODO Auto-generated method stub
 
 	}
-
+	
 	/**
 	 * 日期字符串格式转换
 	 * @param dateStr
 	 * @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;
+	}
+
+	/**
+	 * 日期字符串格式转换
+	 * @param dateStr
+	 * @return
+	 */
+	private String getDateStrPass() {
 		//返回半天前的时间
 		return DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
 	            .format(LocalDateTime.now().minusHours(12));