——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明





基于javaweb的SSM养老院管理系统(java+ssm+jsp+easyui+mysql)
运行环境:
JDK1.8、tomcat8、eclipse、mysql5.6、Navicat
功能实现:
用户: 用户名,登录密码,姓名,性别,出生日期,用户照片,联系电话,邮箱,家庭地址,注册时间 老人: 老人编号,姓名,性别,年龄,老人照片,老人介绍,登记用户,登记时间 房间类型: 房间类型id,房间类型名称 房间: 房间编号,房间类型,房间名称,房间主图,房间价格,房间详情,房间状态 订单: 订单编号,入住房间,入住老人,入住日期,入住时间,订单总金额,订单状态,订单费用明细,订单时间 老人看护: 记录id,信息类别,信息标题,信息内容,发布时间 接待: 接待记录id,接待类别,接待主题,接待内容,接待日期 部门: 部门编号,部门名称,成立日期,负责人 员工: 用户名,登录密码,所在部门,姓名,性别,出生日期,员工照片,联系电话,家庭地址 工资: 工资id,员工,工资年份,工资月份,工资金额,发放日期,工资备注
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
@RequestMapping(value="/{salaryId}/update",method=RequestMethod.GET) public void update(@PathVariable Integer salaryId,Model model,HttpServletRequest request,HttpServletResponse response) throws Exception { Salary salary = salaryService.getSalary(salaryId);
response.setContentType("text/json;charset=UTF-8"); PrintWriter out = response.getWriter(); JSONObject jsonSalary = salary.getJsonObject(); out.println(jsonSalary.toString()); out.flush(); out.close(); }
@RequestMapping(value = "/{salaryId}/update", method = RequestMethod.POST) public void update(@Validated Salary salary, BindingResult br, Model model, HttpServletRequest request,HttpServletResponse response) throws Exception { String message = ""; boolean success = false; if (br.hasErrors()) { message = "输入的信息有错误!"; writeJsonResponse(response, success, message); return; } try { salaryService.updateSalary(salary); message = "工资更新成功!"; success = true; writeJsonResponse(response, success, message); } catch (Exception e) { e.printStackTrace(); message = "工资更新失败!"; writeJsonResponse(response, success, message); } } @RequestMapping(value="/{salaryId}/delete",method=RequestMethod.GET) public String delete(@PathVariable Integer salaryId,HttpServletRequest request) throws UnsupportedEncodingException { try { salaryService.deleteSalary(salaryId); request.setAttribute("message", "工资删除成功!"); return "message"; } catch (Exception e) { e.printStackTrace(); request.setAttribute("error", "工资删除失败!"); return "error";
}
}
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| if (orderState == null) orderState = ""; if (orderTime == null) orderTime = ""; if(rows != 0)roomOrderService.setRows(rows); List<RoomOrder> roomOrderList = roomOrderService.queryRoomOrder(roomObj, oldManObj, liveDate, orderState, orderTime, page); roomOrderService.queryTotalPageAndRecordNumber(roomObj, oldManObj, liveDate, orderState, orderTime); int totalPage = roomOrderService.getTotalPage(); int recordNumber = roomOrderService.getRecordNumber(); response.setContentType("text/json;charset=UTF-8"); PrintWriter out = response.getWriter(); JSONObject jsonObj=new JSONObject(); jsonObj.accumulate("total", recordNumber); JSONArray jsonArray = new JSONArray(); for(RoomOrder roomOrder:roomOrderList) { JSONObject jsonRoomOrder = roomOrder.getJsonObject(); jsonArray.put(jsonRoomOrder); } jsonObj.accumulate("rows", jsonArray); out.println(jsonObj.toString()); out.flush(); out.close(); }
@RequestMapping(value = { "/listAll" }, method = {RequestMethod.GET,RequestMethod.POST}) public void listAll(HttpServletResponse response) throws Exception { List<RoomOrder> roomOrderList = roomOrderService.queryAllRoomOrder(); response.setContentType("text/json;charset=UTF-8"); PrintWriter out = response.getWriter(); JSONArray jsonArray = new JSONArray(); for(RoomOrder roomOrder:roomOrderList) { JSONObject jsonRoomOrder = new JSONObject(); jsonRoomOrder.accumulate("orderId", roomOrder.getOrderId()); jsonArray.put(jsonRoomOrder); } out.println(jsonArray.toString()); out.flush(); out.close(); }
@RequestMapping(value = { "/frontlist" }, method = {RequestMethod.GET,RequestMethod.POST}) public String frontlist(@ModelAttribute("roomObj") Room roomObj,@ModelAttribute("oldManObj") OldMan oldManObj,String liveDate,String orderState,String orderTime,Integer currentPage, Model model, HttpServletRequest request) throws Exception { if (currentPage==null || currentPage == 0) currentPage = 1;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| try { out = response.getOutputStream(); response.setHeader("Content-disposition","attachment; filename="+"RoomType.xls"); response.setContentType("application/msexcel;charset=UTF-8"); response.setHeader("Pragma","No-cache"); response.setHeader("Cache-Control","no-cache"); response.setDateHeader("Expires", 0); String rootPath = request.getSession().getServletContext().getRealPath("/"); ex.exportExcel(rootPath,_title,headers, dataset, out); out.flush(); } catch (IOException e) { e.printStackTrace(); }finally{ try{ if(out!=null){ out.close(); } }catch(IOException e){ e.printStackTrace(); } } } } package com.chengxusheji.controller;
public class BaseController {
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| response.setHeader("Content-disposition","attachment; filename="+"Department.xls"); response.setContentType("application/msexcel;charset=UTF-8"); response.setHeader("Pragma","No-cache"); response.setHeader("Cache-Control","no-cache"); response.setDateHeader("Expires", 0); String rootPath = request.getSession().getServletContext().getRealPath("/"); ex.exportExcel(rootPath,_title,headers, dataset, out); out.flush(); } catch (IOException e) { e.printStackTrace(); }finally{ try{ if(out!=null){ out.close(); } }catch(IOException e){ e.printStackTrace(); } } } } package com.chengxusheji.controller;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| @RequestMapping(value="/{nurseId}/update",method=RequestMethod.GET) public void update(@PathVariable Integer nurseId,Model model,HttpServletRequest request,HttpServletResponse response) throws Exception { Nurse nurse = nurseService.getNurse(nurseId);
response.setContentType("text/json;charset=UTF-8"); PrintWriter out = response.getWriter(); JSONObject jsonNurse = nurse.getJsonObject(); out.println(jsonNurse.toString()); out.flush(); out.close(); }
@RequestMapping(value = "/{nurseId}/update", method = RequestMethod.POST) public void update(@Validated Nurse nurse, BindingResult br, Model model, HttpServletRequest request,HttpServletResponse response) throws Exception { String message = ""; boolean success = false; if (br.hasErrors()) { message = "输入的信息有错误!"; writeJsonResponse(response, success, message); return; } try { nurseService.updateNurse(nurse); message = "老人看护更新成功!"; success = true; writeJsonResponse(response, success, message); } catch (Exception e) { e.printStackTrace(); message = "老人看护更新失败!"; writeJsonResponse(response, success, message); } } @RequestMapping(value="/{nurseId}/delete",method=RequestMethod.GET) public String delete(@PathVariable Integer nurseId,HttpServletRequest request) throws UnsupportedEncodingException { try { nurseService.deleteNurse(nurseId); request.setAttribute("message", "老人看护删除成功!"); return "message";
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=131422272105200al
https://javayms.pages.dev?id=131422272105200al