From 606c896c1b7c9d986cfb13d8464f3482160a1389 Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Tue, 08 May 2018 09:47:40 +0800
Subject: [PATCH] 手机 设备 保存 api

---
 src/main/java/com/moral/controller/ScreenController.java |   31 ++++++++++++++++++++++++++-----
 1 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/moral/controller/ScreenController.java b/src/main/java/com/moral/controller/ScreenController.java
index 472d30c..4da099f 100644
--- a/src/main/java/com/moral/controller/ScreenController.java
+++ b/src/main/java/com/moral/controller/ScreenController.java
@@ -55,7 +55,7 @@
 import com.moral.entity.alarm.AlarmSensorLevel;
 import com.moral.service.AccountService;
 import com.moral.service.AlarmConfigService;
-import com.moral.service.AlarmService;
+import com.moral.service.AlarmDailyService;
 import com.moral.service.AreaService;
 import com.moral.service.DeviceService;
 import com.moral.service.HistoryMinutelyService;
@@ -113,7 +113,7 @@
 	private String levelKey = "alarm_";
 
 	@Resource
-	private AlarmService alarmService;
+	private AlarmDailyService alarmDailyService;
 	/**
 	 * Screen login. ������������
 	 * 
@@ -276,8 +276,9 @@
 			ftpClient.connect(ip, port);
 			ftpClient.login(userName, userPwd);
 			ftpClient.changeWorkingDirectory(path);
-			ftpClient.enterRemotePassiveMode();
-			//ftpClient.enterLocalPassiveMode();
+			ftpClient.enterLocalPassiveMode();
+			//ftpClient.enterLocalActiveMode();
+
 			InputStream ins = ftpClient.retrieveFileStream(fileName);
 			BufferedReader reader = new BufferedReader(new InputStreamReader(ins,"utf-8"));
 			String line;
@@ -295,6 +296,19 @@
 				ftpClient.logout();
 				ftpClient.disconnect();
 			}
+
+//			String urlStr = "http://www.7drlb.com/apps/Version.xml";
+//			URL realUrl = new URL(urlStr);
+//			URLConnection connection = realUrl.openConnection();
+//			connection.connect();
+//			StringBuffer result = new StringBuffer();
+//			BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8"));
+//			String line;
+//			while ((line = in.readLine()) != null) {
+//				result.append(line);
+//			}
+//			String content = result.toString();
+
 			SAXReader saxReader = new SAXReader();
 			Document document = saxReader.read(new InputSource(new ByteArrayInputStream(content.getBytes("utf-8"))));
 			Element root = document.getRootElement();
@@ -306,6 +320,13 @@
 		}
 		return version;
 	}
+
+	public static void main(String[] args) {
+		ScreenController sc = new ScreenController();
+		Version a = sc.index();
+		System.out.println(a.getVer());
+	}
+
 	/**
 	 * ������������
 	 * ������
@@ -469,7 +490,7 @@
 				parameters.remove("organizationId");
 			}
 		}
-		Map pieData = alarmService.getPieData(parameters);
+		Map pieData = alarmDailyService.getPieData(parameters);
 		List<Map<String, Object>> list = (List<Map<String, Object>>) pieData.get(sensorKey);
 		return new ResultBean<List<Map<String, Object>>>(list);
 	}

--
Gitblit v1.8.0