|
@@ -115,16 +115,20 @@ public class ViewController extends Controller {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ String deviceString = "";
|
|
|
Record dRecord = Db.use("connected").findFirst("select * from reportinfo where STUDYUID = ?",
|
|
|
studyuidString);
|
|
|
+ if (dRecord!=null && dRecord.getStr("DEVICE")!=null) {
|
|
|
+ deviceString= dRecord.getStr("DEVICE");
|
|
|
+ }
|
|
|
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("status", 1).set("createAt", parseStringToDateTime()).set("updateAt", parseStringToDateTime()).set("device", dRecord.getStr("DEVICE"));
|
|
|
+ .set("status", 1).set("createAt", parseStringToDateTime()).set("updateAt", parseStringToDateTime()).set("device", deviceString);
|
|
|
Db.use("local").save("study", studyinfo);
|
|
|
}else {
|
|
|
- studyidfind.set("device", dRecord.getStr("DEVICE"));
|
|
|
+ studyidfind.set("device", deviceString);
|
|
|
studyidfind.set("updateAt", parseStringToDateTime());
|
|
|
Db.use("local").update("study", studyidfind);
|
|
|
}
|
|
@@ -133,6 +137,7 @@ public class ViewController extends Controller {
|
|
|
} catch (IOException e) {
|
|
|
// TODO Auto-generated catch block
|
|
|
e.printStackTrace();
|
|
|
+ renderText(e.toString());
|
|
|
}
|
|
|
|
|
|
|