/* * 通过病区id查询相应的病区病人列表 */ public String listBingqBingrByBingqId() throws IOException { List<VwBqbrZy> vwBqbrZys = vwBqbrZyService.listBingqBingrByBingqId(bqid); session.put("dangqianbingqu_id", bqid); String bqmc = vwRybqService.getBingQuMingCheng(bqid); session.put("dangqianbingqu_name", bqmc); JSONArray jsonArray = JSONArray.fromObject(vwBqbrZys); // JSONObject json = JSONObject.fromObject(vwBqbrZys); System.out.println(jsonArray); HttpServletResponse response = ServletActionContext.getResponse(); response.setContentType("text/html;charset=UTF-8"); response.getWriter().write(jsonArray.toString()); return null; }
/* * 根据人员代码(登录的操作员代码) 获取对应人员id, 病人列表,当前操作病区id */ public String getRenYuanIdByRenYuanDaiMa() { vwRybq = vwRybqService.getRenYuanIdByRenYuanDaiMa(yonghu_name); session.put("caozuoyuan", vwRybq); String bqid = vwRybqService.getCaoZuoBingQuIdByCaozyId(vwRybq.getId()); session.put("dangqianbingqu_id", bqid); System.out.println(vwRybq.getId()); request.put("bqry", vwRybqService.listBingrByBingQuId(bqid)); List<VwRybq> vwRybqs = vwRybqService.listBingQuByCaozyId(vwRybq.getId()); System.out.println("变量病区id:" + bqid); for (int i = 0; i < vwRybqs.size(); i++) { // VwRybq vwRybq_i = vwRybqs.get(i); System.out.println("循环病区:" + vwRybqs.get(i).getBqmc()); System.out.println("循环病区id:" + vwRybqs.get(i).getBq()); // if(vwRybqs.get(i).getBq() == bqid){ if (vwRybqs.get(i).getBq().contains(bqid)) { session.put("dangqianbingqu_name", vwRybqs.get(i).getBqmc()); System.out.println("当前病区:" + vwRybqs.get(i).getBqmc()); } } request.put("caozuoyuan_bingqu", vwRybqs); return SUCCESS; }
/* * 返回病人列表,通过session获取病区id,caozuoyuan, 再查询相应的病区病人列表,病区列表 */ public String getListBingqBingrBySessionBingqId() throws IOException { VwRybq vwRybq = (VwRybq) session.get("caozuoyuan"); System.out.println(vwRybq.getId()); String dangqianbqid = ""; dangqianbqid = session.get("dangqianbingqu_id").toString(); if (dangqianbqid != "") { List<VwRybq> vwRybqs = vwRybqService.listBingQuByCaozyId(vwRybq.getId()); request.put("caozuoyuan_bingqu", vwRybqs); List<VwBqbrZy> vwBqbrZys = vwBqbrZyService.listBingqBingrByBingqId(dangqianbqid); request.put("bqry", vwBqbrZys); return SUCCESS; } else { return ERROR; } }