diff --git a/WebContent/WEB-INF/pages/parking.html b/WebContent/WEB-INF/pages/parking.html index 7046369..0681ffa 100644 --- a/WebContent/WEB-INF/pages/parking.html +++ b/WebContent/WEB-INF/pages/parking.html @@ -36,7 +36,7 @@ function searchSuggest() { - searchReq.open("POST", 'jqueryEZParkingStatus', true); + searchReq.open("POST", 'jqueryEZParkingStatus?location=dongyuan', true); searchReq.onreadystatechange = handleEZParkingStatus; searchReq.send(null); } @@ -49,7 +49,6 @@ for (var i = 0; i <= str.length - 1; i++) { - alert(str[i]) var parkingIdStatus = str[i].split("_"); if(parkingIdStatus[1] == "1") diff --git a/WebContent/WEB-INF/pages/update.html b/WebContent/WEB-INF/pages/update.html index 9a2298b..4a585fb 100644 --- a/WebContent/WEB-INF/pages/update.html +++ b/WebContent/WEB-INF/pages/update.html @@ -81,6 +81,8 @@

+

+ diff --git a/WebContent/WEB-INF/pages/zhangjiang.html b/WebContent/WEB-INF/pages/zhangjiang.html new file mode 100644 index 0000000..3ce1f83 --- /dev/null +++ b/WebContent/WEB-INF/pages/zhangjiang.html @@ -0,0 +1,97 @@ + + + + EZParking + + + + +

张江大厦停车位地图

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ Parking + +
+ + \ No newline at end of file diff --git a/WebContent/car.png b/WebContent/car.png new file mode 100644 index 0000000..516a400 Binary files /dev/null and b/WebContent/car.png differ diff --git a/WebContent/zhangjiang.png b/WebContent/zhangjiang.png new file mode 100644 index 0000000..f1d7d37 Binary files /dev/null and b/WebContent/zhangjiang.png differ diff --git a/src/com/ezparking/gprs/EZParkingMap.java b/src/com/ezparking/gprs/EZParkingMap.java index c47e5bb..a34a2f0 100644 --- a/src/com/ezparking/gprs/EZParkingMap.java +++ b/src/com/ezparking/gprs/EZParkingMap.java @@ -40,7 +40,14 @@ public class EZParkingMap extends HttpServlet protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - String path=req.getContextPath(); - req.getRequestDispatcher("WEB-INF/pages/parking.html").forward(req, resp); + String location=req.getParameter("location"); + if(("dongyuan").equals(location)) + { + req.getRequestDispatcher("WEB-INF/pages/parking.html").forward(req, resp); + } + if(("zhangjiang").equals(location)) + { + req.getRequestDispatcher("WEB-INF/pages/zhangjiang.html").forward(req, resp); + } } } diff --git a/src/com/ezparking/gprs/EZParkingStatusServlet.java b/src/com/ezparking/gprs/EZParkingStatusServlet.java index cd7ed96..16bd5aa 100644 --- a/src/com/ezparking/gprs/EZParkingStatusServlet.java +++ b/src/com/ezparking/gprs/EZParkingStatusServlet.java @@ -32,11 +32,13 @@ public class EZParkingStatusServlet extends HttpServlet protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + String location = req.getParameter("location"); + GPRSService service = new GPRSService(); List tblList = new ArrayList(); StringBuffer tblIds = new StringBuffer(); - tblList = service.listTblModule(); + tblList = service.listTblModule(location); for(TblModule tbl : tblList) { tblIds.append(tbl.getId()+"_"+tbl.getStatus()+","); diff --git a/src/com/ezparking/gprs/GPRSDBUtil.java b/src/com/ezparking/gprs/GPRSDBUtil.java index 35cf2f9..fcbf74c 100644 --- a/src/com/ezparking/gprs/GPRSDBUtil.java +++ b/src/com/ezparking/gprs/GPRSDBUtil.java @@ -26,8 +26,8 @@ public class GPRSDBUtil { Class.forName("org.postgresql.Driver"); - String url = "jdbc:postgresql://121.41.88.171:5432/ParkDevice"; - conn = DriverManager.getConnection(url, "postgres", "Abcd1234"); + String url = "jdbc:postgresql://139.196.106.197:5432/ParkDevice"; + conn = DriverManager.getConnection(url, "postgres", "root"); } } diff --git a/src/com/ezparking/gprs/GPRSService.java b/src/com/ezparking/gprs/GPRSService.java index 7cd4fec..c0ee092 100644 --- a/src/com/ezparking/gprs/GPRSService.java +++ b/src/com/ezparking/gprs/GPRSService.java @@ -134,12 +134,19 @@ public class GPRSService return modelList; } - public List listTblModule() - { + public List listTblModule(String location) + { Connection conn = GPRSDBUtil.getConn(); - StringBuffer sqlBuffer = new StringBuffer( - "SELECT * FROM \"tbl_Module\" ORDER BY \"UDT\" desc"); + StringBuffer sqlBuffer = new StringBuffer(); + if(("dongyuan").equals(location)) + { + sqlBuffer.append("SELECT * FROM \"tbl_Module\" WHERE \"ID\" < 506900 ORDER BY \"UDT\" desc"); + } + if(("zhangjiang").equals(location)) + { + sqlBuffer.append("SELECT * FROM \"tbl_Module\" WHERE \"ID\" >= 506900 ORDER BY \"UDT\" desc"); + } List moduleList = new ArrayList(); PreparedStatement pstmt = GPRSDBUtil.getPreparedStatement(conn, sqlBuffer.toString());