LAPTOP-5NTQJPUS\LT 7 месяцев назад
Родитель
Сommit
3441543e73

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

@@ -92,6 +92,23 @@ public class ViewController extends Controller {
 			this.renderText(e.toString());
 		}
 	}
+	
+	public void sdxz2() {
+		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("\\\\172.103.32.8\\datacenterf\\20241118\\100434012.img", "100434012.img");
+//			}
+			this.renderJson("succ");
+
+		} 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());

+ 2 - 2
DataFusion/src/com/zskk/service/DataService.java

@@ -166,7 +166,7 @@ public class DataService {
         int reply;
         try {
             ftpClient.connect(PropKit.get("ftp_host"), PropKit.getInt("ftp_port"));
-            ftpClient.login(PropKit.get("ftp_user"), PropKit.get("ftp_password"));
+//            ftpClient.login(PropKit.get("ftp_user"), PropKit.get("ftp_password"));
             reply = ftpClient.getReplyCode();
             if (!FTPReply.isPositiveCompletion(reply)) {
                 ftpClient.disconnect();
@@ -176,7 +176,7 @@ public class DataService {
             ftpClient.setFileType(FTPClient.BINARY_FILE_TYPE);
             ftpClient.enterLocalPassiveMode();
 
-            File localFile = new File("/home/zskk/FTP_FILE" + File.separatorChar + fileName);
+            File localFile = new File("/home/tmszyy/FTP_FILE" + File.separatorChar + fileName);
             OutputStream os = new FileOutputStream(localFile);
             //ftp中文名需要iso-8859-1字符
             boolean flag2 = ftpClient.retrieveFile(new String(remoteFileName.getBytes("GBK"), "iso-8859-1"), os);