|
@@ -86,13 +86,27 @@ public class ViewController extends Controller {
|
|
|
public void sdxz() {
|
|
|
try {
|
|
|
DataService dService = ServiceFactory.getService(DataService.class);
|
|
|
- JSONArray array= dService.getImage(this.getPara("accnum"));
|
|
|
- for (Object object : array) {
|
|
|
- JSONObject jsonObject = JSON.parseObject(object.toString());
|
|
|
- String[] strings = jsonObject.getString("Path").split("\\\\");
|
|
|
- dService.downloadFtpFile(jsonObject.getString("Path"), strings[1]);
|
|
|
+// Record recordfind = Db.use("local").findFirst("select * from study where status=1 and modalities <>'US' order by createAt asc");
|
|
|
+ List<Record> imagerecords = Db.use("connected").find("select * from ImageInfo where STUDYINSUID=?","1.2.840.40823.1.1.1.12.1732582467.865.28.195");
|
|
|
+// if (imagerecords==null) {
|
|
|
+// recordfind.set("status", 2);
|
|
|
+// Db.use("local").update("study",recordfind);
|
|
|
+// return;
|
|
|
+// }
|
|
|
+// recordfind.set("status", 4);
|
|
|
+// recordfind.set("imageNum", imagerecords.size());
|
|
|
+// recordfind.set("updateAt", getDateStr());
|
|
|
+// Db.use("local").update("study",recordfind);
|
|
|
+ for (Record object : imagerecords) {
|
|
|
+ String[] strings = object.getStr("FILEPATH").split("\\\\");
|
|
|
+ renderText(strings[strings.length-1]);
|
|
|
+// return;
|
|
|
+ dService.downloadFtpFile(strings[strings.length-3]+"/"+strings[strings.length-2]+"/"+strings[strings.length-1], strings[strings.length-1]);
|
|
|
}
|
|
|
- this.renderJson(array);
|
|
|
+// recordfind.set("status", 3);
|
|
|
+// recordfind.set("updateAt", getDateStr());
|
|
|
+// Db.use("local").update("study",recordfind);
|
|
|
+ this.renderJson(imagerecords);
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
// TODO: handle exception
|
|
@@ -101,7 +115,7 @@ public class ViewController extends Controller {
|
|
|
}
|
|
|
|
|
|
public void sdxz2() {
|
|
|
- try {
|
|
|
+// try {
|
|
|
DataService dService = ServiceFactory.getService(DataService.class);
|
|
|
FTPClient ftpClient = new FTPClient();
|
|
|
ftpClient.setConnectTimeout(1000*30);
|
|
@@ -111,13 +125,13 @@ public class ViewController extends Controller {
|
|
|
ftpClient.connect(PropKit.get("ftp_host"), PropKit.getInt("ftp_port"));
|
|
|
ftpClient.login(PropKit.get("ftp_user"), PropKit.get("ftp_password"));
|
|
|
reply = ftpClient.getReplyCode();
|
|
|
-// if (!FTPReply.isPositiveCompletion(reply)) {
|
|
|
-// ftpClient.disconnect();
|
|
|
-// this.renderText("disconnect");
|
|
|
-// }
|
|
|
+ if (!FTPReply.isPositiveCompletion(reply)) {
|
|
|
+ ftpClient.disconnect();
|
|
|
+ this.renderText(String.valueOf(reply));
|
|
|
+ }
|
|
|
// ftpClient.setControlEncoding("UTF-8");
|
|
|
// ftpClient.setFileType(FTPClient.BINARY_FILE_TYPE);
|
|
|
-// ftpClient.enterLocalPassiveMode();
|
|
|
+ ftpClient.enterLocalActiveMode();
|
|
|
//
|
|
|
// File localFile = new File("/home/tmszyy/FTP_FILE" + File.separatorChar + "test.img");
|
|
|
// OutputStream os = new FileOutputStream(localFile);
|
|
@@ -136,7 +150,7 @@ public class ViewController extends Controller {
|
|
|
// os.close();
|
|
|
// ftpClient.logout();
|
|
|
// ftpClient.disconnect();
|
|
|
- this.renderText(String.valueOf(reply));
|
|
|
+ this.renderText("succ");
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
@@ -145,10 +159,10 @@ public class ViewController extends Controller {
|
|
|
}
|
|
|
|
|
|
|
|
|
- } catch (Exception e) {
|
|
|
- // TODO: handle exception
|
|
|
- this.renderText(e.toString());
|
|
|
- }
|
|
|
+// } catch (Exception e) {
|
|
|
+// // TODO: handle exception
|
|
|
+// this.renderText(e.toString());
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
public static DruidPlugin createConnectedDruidPlugin() {
|