|
@@ -83,6 +83,23 @@ public class DataService {
|
|
|
postWithJson(FEE_URL, jsonObject);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取未出报告的检查列表
|
|
|
+ * @param instutionId
|
|
|
+ * @param number
|
|
|
+ */
|
|
|
+ public JSONArray getImage(String accnumber) {
|
|
|
+ String urlString = "http://172.18.0.9:8085/api/image/path?para={\"AccessionNumber\":\""+accnumber+"\"}";
|
|
|
+ String content = getWithUrl(urlString);
|
|
|
+ JSONObject jsonObject = JSON.parseObject(content);
|
|
|
+ if (!jsonObject.getString("Code").equals("1")) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ JSONArray jsonArray = JSON.parseArray(jsonObject.getString("ImagePath"));
|
|
|
+ return jsonArray;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
public static String postWithParameters(String url, Map<String, String> map) {
|
|
|
|
|
|
FormBody.Builder formbody = new FormBody.Builder();
|
|
@@ -127,6 +144,23 @@ public class DataService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public String getWithUrl(String url) {
|
|
|
+
|
|
|
+ Request request = new Request.Builder()
|
|
|
+ .url(url)
|
|
|
+ .build();
|
|
|
+
|
|
|
+ String contentString = "";
|
|
|
+ try (Response response = OKHTTP_CLIENT.newCall(request).execute()) {
|
|
|
+ if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
|
|
|
+ contentString = response.body().string();
|
|
|
+ } catch (IOException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return contentString;
|
|
|
+ }
|
|
|
+
|
|
|
public static void downloadFtpFile(String remoteFileName, String fileName) {
|
|
|
FTPClient ftpClient = new FTPClient();
|
|
|
int reply;
|