use of com.zyf.dao.BloodPressureDao in project HeartWatchdogJsp by Viczyf.
the class BloodpressureServlet method select_time_bloodpressure.
private void select_time_bloodpressure(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
BloodPressureDao bloodPressureDao = new BloodPressureDao();
String startdate = request.getParameter("startdate");
String enddate = request.getParameter("enddate");
HttpSession session = request.getSession();
User user = (User) session.getAttribute("user");
int uid = user.getUid();
System.out.println("uid" + uid);
List bpList = bloodPressureDao.queryTimeBloodPressure(uid, startdate, enddate);
System.out.println(bpList.size());
JsonArray array = new JsonArray();
for (int i = 0; i < bpList.size(); i++) {
BloodPressure bp = (BloodPressure) bpList.get(i);
JsonObject ob = new JsonObject();
ob.addProperty("id", i + 1);
ob.addProperty("date", bp.getDate());
ob.addProperty("highPressure", bp.getHighpressure());
ob.addProperty("lowPressure", bp.getLowpressure());
ob.addProperty("xinlv", bp.getXinlv());
array.add(ob);
}
System.out.println(array);
PrintWriter out = response.getWriter();
out.print(array);
}
use of com.zyf.dao.BloodPressureDao in project HeartWatchdogJsp by Viczyf.
the class BloodpressureServlet method tendBloodpressure.
public void tendBloodpressure(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
BloodPressureDao bloodPressureDao = new BloodPressureDao();
HttpSession session = request.getSession();
// 获取用户对象
User user = (User) session.getAttribute("user");
int id = user.getUid();
List bpList = bloodPressureDao.queryBloodPressure(id);
request.setAttribute("bpList", bpList);
RequestDispatcher rd = request.getRequestDispatcher("bloodpressuretend.jsp");
rd.forward(request, response);
}
use of com.zyf.dao.BloodPressureDao in project HeartWatchdogJsp by Viczyf.
the class BloodpressureServlet method selectBloodpressure.
private void selectBloodpressure(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
BloodPressureDao bloodPressureDao = new BloodPressureDao();
HttpSession session = request.getSession();
User user = (User) session.getAttribute("user");
int uid = user.getUid();
List bpList = bloodPressureDao.queryBloodPressure(uid);
JsonArray array = new JsonArray();
for (int i = 0; i < bpList.size(); i++) {
BloodPressure bp = (BloodPressure) bpList.get(i);
JsonObject ob = new JsonObject();
ob.addProperty("id", i + 1);
ob.addProperty("date", bp.getDate());
ob.addProperty("highPressure", bp.getHighpressure());
ob.addProperty("lowPressure", bp.getLowpressure());
ob.addProperty("xinlv", bp.getXinlv());
array.add(ob);
}
System.out.println(array);
PrintWriter out = response.getWriter();
out.print(array);
}
Aggregations