|
@@ -71,6 +71,28 @@ public class ViewController extends Controller {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void sdinsert() {
|
|
|
+ try {
|
|
|
+ List<Record> records = Db.use("connected").find("select * from examinfo where ReqDate >? and ReqDate <",this.getPara("times"), this.getPara("timee"));
|
|
|
+ for (Record record : records) {
|
|
|
+ String studyuidString = record.getStr("AccessionNumber");
|
|
|
+ String modalitiesString = record.getStr("Modality");
|
|
|
+ String examdateString = record.getStr("ReqDate");
|
|
|
+ Record studyidfind = Db.use("local").findFirst("select * from study where studyuid = ?",
|
|
|
+ studyuidString);
|
|
|
+ if (studyidfind == null) {
|
|
|
+ Record studyinfo = new Record().set("studyuid", studyuidString).set("modalities", modalitiesString).set("examdate", examdateString)
|
|
|
+ .set("status", 1).set("createAt", parseStringToDateTime()).set("updateAt", parseStringToDateTime());
|
|
|
+ Db.use("local").save("study", studyinfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ // TODO: handle exception
|
|
|
+ this.renderText(e.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public void testtime() {
|
|
|
SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
Date date = new Date();
|