|
@@ -34,9 +34,50 @@ public class ViewController extends Controller {
|
|
|
* 在被连接数据库执行sql语句
|
|
|
*/
|
|
|
public void executeSql() {
|
|
|
+ String url = "http://192.168.2.41/WebQuery.asmx/Query";
|
|
|
+ OkHttpClient okHttpClient = new OkHttpClient();
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ sb.append("input=");
|
|
|
+ sb.append(this.getPara("suid"));
|
|
|
|
|
|
- List<Record> d = Db.use("connected").find(this.getPara("sqlstr"));
|
|
|
- this.renderJson(d);
|
|
|
+ RequestBody body = RequestBody.create(sb.toString(), MediaType.get("application/x-www-form-urlencoded"));
|
|
|
+ Request request = new Request.Builder().url(url).post(body).build();
|
|
|
+ try (Response response = okHttpClient.newCall(request).execute()) {
|
|
|
+ String contentString = response.body().string();
|
|
|
+ XmlHelper xmlHelperStr = XmlHelper.of(contentString);
|
|
|
+ String content = xmlHelperStr.getString("//string");
|
|
|
+ XmlHelper xmlHelper = XmlHelper.of(content);
|
|
|
+ String patientname = xmlHelper.getString("//patientname");
|
|
|
+ if (patientname == null && patientname == null) {
|
|
|
+ this.renderText("nulllll");
|
|
|
+ }
|
|
|
+
|
|
|
+ String department = xmlHelper.getString("//department");
|
|
|
+
|
|
|
+ String clinicaldoctor = xmlHelper.getString("//clinicaldoctor");
|
|
|
+
|
|
|
+ String reportdate = xmlHelper.getString("//reportdate");
|
|
|
+
|
|
|
+ String description = xmlHelper.getString("//description");
|
|
|
+
|
|
|
+ String impression = xmlHelper.getString("//impression");
|
|
|
+
|
|
|
+ String reportdoctor = xmlHelper.getString("//reportdoctor");
|
|
|
+
|
|
|
+ String reviewdoctor = xmlHelper.getString("//reviewdoctor");
|
|
|
+
|
|
|
+ String phone = xmlHelper.getString("//phone ");
|
|
|
+
|
|
|
+ String idcard = xmlHelper.getString("//idcard ");
|
|
|
+
|
|
|
+ String diagnosis = xmlHelper.getString("//diagnosis");
|
|
|
+
|
|
|
+ this.renderText(phone+"11"+idcard);
|
|
|
+ }catch (Exception e) {
|
|
|
+ // TODO: handle exception
|
|
|
+ this.renderText(e.toString());
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|