刘韬 3 rokov pred
rodič
commit
5db6b85326

+ 12 - 0
DataFusion/src/com/zskk/control/ViewController.java

@@ -8,6 +8,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.jfinal.core.Controller;
 import com.jfinal.kit.PropKit;
 import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
@@ -72,6 +73,17 @@ public class ViewController extends Controller {
 		}
 	}
 	
+	public void testDown2() {
+		try {
+			DataService dService = ServiceFactory.getService(DataService.class);
+			JSONArray array= dService.getImage("CT00043360");
+			this.renderJson(array);
+
+		} catch (Exception e) {
+			// TODO: handle exception
+			this.renderText(e.toString());
+		}
+	}
 	public static DruidPlugin createConnectedDruidPlugin() {
 
 		return new DruidPlugin(PropKit.get("jdbcUrl_connected"), PropKit.get("user_connected"),PropKit.get("password_connected").trim());

+ 34 - 0
DataFusion/src/com/zskk/service/DataService.java

@@ -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;

+ 2 - 0
DataFusion/src/com/zskk/task/DownloadTask.java

@@ -20,7 +20,9 @@ public class DownloadTask implements ITask {
 	@Override
 	public void run() {
 		// TODO Auto-generated method stub
+		Record recordfind = Db.use("local").findFirst("select * from study order by createAt desc");
 		
+
 	}
 
 	@Override