|
@@ -1,7 +1,8 @@
|
|
|
package com.zskk.task;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
-
|
|
|
import com.jfinal.plugin.activerecord.Db;
|
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
|
import com.jfinal.plugin.cron4j.ITask;
|
|
@@ -11,7 +12,7 @@ public class UpdateTask implements ITask {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
// TODO Auto-generated method stub
|
|
|
- List<Record> record = Db.use("local").findFirst("select StudyInstanceUID,PatientStudyDate from reportinfo_image where PatientStudyDate>? group by PatientStudyDate,StudyInstanceUID order by PatientStudyDate desc", jsonObject.getString("accession_num"));
|
|
|
+ List<Record> record = Db.use("local").find("select StudyInstanceUID,PatientStudyDate from reportinfo_image where PatientStudyDate>? group by PatientStudyDate,StudyInstanceUID order by PatientStudyDate desc", parseStringToDate());
|
|
|
|
|
|
|
|
|
}
|
|
@@ -21,5 +22,20 @@ public class UpdateTask implements ITask {
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 日期字符串格式转换
|
|
|
+ *
|
|
|
+ * @param dateStr
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private String parseStringToDate() {
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ Date date = new Date();
|
|
|
+ long dInteger = date.getTime() - 600000;
|
|
|
+ String daString = sdf.format(new Date(dInteger));
|
|
|
+ return daString;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|