使用SSM为学校医务室开发一套管理系统(一)https://developer.aliyun.com/article/1423189
package com.controller; import java.io.File; import java.io.IOException; import java.sql.Timestamp; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.io.PrintWriter; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.multipart.MultipartFile; import com.entity.Bingli; import com.server.BingliServer; import com.util.PageBean; import net.sf.json.JSONObject; import com.util.db; import java.sql.SQLException; import java.sql.*; @Controller public class BingliController { @Resource private BingliServer bingliService; @RequestMapping("addBingli.do") public String addBingli(HttpServletRequest request,Bingli bingli,HttpSession session) throws SQLException{ Timestamp time=new Timestamp(System.currentTimeMillis()); bingli.setAddtime(time.toString().substring(0, 19)); bingliService.add(bingli); session.setAttribute("backxx", "添加成功"); session.setAttribute("backurl", request.getHeader("Referer")); //session.setAttribute("backurl", "bingliList.do"); return "redirect:postback.jsp"; //return "redirect:bingliList.do"; } // 处理编辑 @RequestMapping("doUpdateBingli.do") public String doUpdateBingli(int id,ModelMap map,Bingli bingli){ bingli=bingliService.getById(id); map.put("bingli", bingli); return "bingli_updt"; } // 后台详细 @RequestMapping("bingliDetail.do") public String bingliDetail(int id,ModelMap map,Bingli bingli){ bingli=bingliService.getById(id); map.put("bingli", bingli); return "bingli_detail"; } // 前台详细 @RequestMapping("blDetail.do") public String blDetail(int id,ModelMap map,Bingli bingli){ bingli=bingliService.getById(id); map.put("bingli", bingli); return "binglidetail"; } // @RequestMapping("updateBingli.do") public String updateBingli(int id,ModelMap map,Bingli bingli,HttpServletRequest request,HttpSession session){ bingliService.update(bingli); session.setAttribute("backxx", "修改成功"); session.setAttribute("backurl", request.getHeader("Referer")); return "redirect:postback.jsp"; //String url = request.getHeader("Referer"); //return "redirect:"+url; //return "redirect:bingliList.do"; } // 分页查询 @RequestMapping("bingliList.do") public String bingliList(@RequestParam(value="page",required=false)String page, ModelMap map,HttpSession session,Bingli bingli, String binglihao, String yonghuming, String xingming, String xingbie, String chushengnianyue, String dianhua, String shenfenzheng, String keshi, String zhuzhiyisheng, String youwuyichuanbing, String bingqingmiaoshu){ if(page==null||page.equals("")){ page="1"; } PageBean pageBean=new PageBean(Integer.parseInt(page), 15); Map<String, Object> pmap=new HashMap<String,Object>(); pmap.put("pageno", pageBean.getStart()); pmap.put("pageSize", 15); if(binglihao==null||binglihao.equals("")){pmap.put("binglihao", null);}else{pmap.put("binglihao", binglihao);} if(yonghuming==null||yonghuming.equals("")){pmap.put("yonghuming", null);}else{pmap.put("yonghuming", yonghuming);} if(xingming==null||xingming.equals("")){pmap.put("xingming", null);}else{pmap.put("xingming", xingming);} if(xingbie==null||xingbie.equals("")){pmap.put("xingbie", null);}else{pmap.put("xingbie", xingbie);} if(chushengnianyue==null||chushengnianyue.equals("")){pmap.put("chushengnianyue", null);}else{pmap.put("chushengnianyue", chushengnianyue);} if(dianhua==null||dianhua.equals("")){pmap.put("dianhua", null);}else{pmap.put("dianhua", dianhua);} if(shenfenzheng==null||shenfenzheng.equals("")){pmap.put("shenfenzheng", null);}else{pmap.put("shenfenzheng", shenfenzheng);} if(keshi==null||keshi.equals("")){pmap.put("keshi", null);}else{pmap.put("keshi", keshi);} if(zhuzhiyisheng==null||zhuzhiyisheng.equals("")){pmap.put("zhuzhiyisheng", null);}else{pmap.put("zhuzhiyisheng", zhuzhiyisheng);} if(youwuyichuanbing==null||youwuyichuanbing.equals("")){pmap.put("youwuyichuanbing", null);}else{pmap.put("youwuyichuanbing", youwuyichuanbing);} if(bingqingmiaoshu==null||bingqingmiaoshu.equals("")){pmap.put("bingqingmiaoshu", null);}else{pmap.put("bingqingmiaoshu", bingqingmiaoshu);} int total=bingliService.getCount(pmap); pageBean.setTotal(total); List<Bingli> list=bingliService.getByPage(pmap); map.put("page", pageBean); map.put("list", list); session.setAttribute("p", 1); return "bingli_list"; } @RequestMapping("bingliList2.do") public String bingliList2(@RequestParam(value="page",required=false)String page, ModelMap map,HttpSession session,Bingli bingli, String binglihao, String yonghuming, String xingming, String xingbie, String chushengnianyue, String dianhua, String shenfenzheng, String keshi, String zhuzhiyisheng, String youwuyichuanbing, String bingqingmiaoshu,HttpServletRequest request){ /*if(session.getAttribute("user")==null){ return "login"; }*/ if(page==null||page.equals("")){ page="1"; } PageBean pageBean=new PageBean(Integer.parseInt(page), 15); Map<String, Object> pmap=new HashMap<String,Object>(); pmap.put("pageno", pageBean.getStart()); pmap.put("pageSize", 15); pmap.put("yonghuming", (String)request.getSession().getAttribute("username")); if(binglihao==null||binglihao.equals("")){pmap.put("binglihao", null);}else{pmap.put("binglihao", binglihao);} if(xingming==null||xingming.equals("")){pmap.put("xingming", null);}else{pmap.put("xingming", xingming);} if(xingbie==null||xingbie.equals("")){pmap.put("xingbie", null);}else{pmap.put("xingbie", xingbie);} if(chushengnianyue==null||chushengnianyue.equals("")){pmap.put("chushengnianyue", null);}else{pmap.put("chushengnianyue", chushengnianyue);} if(dianhua==null||dianhua.equals("")){pmap.put("dianhua", null);}else{pmap.put("dianhua", dianhua);} if(shenfenzheng==null||shenfenzheng.equals("")){pmap.put("shenfenzheng", null);}else{pmap.put("shenfenzheng", shenfenzheng);} if(keshi==null||keshi.equals("")){pmap.put("keshi", null);}else{pmap.put("keshi", keshi);} if(youwuyichuanbing==null||youwuyichuanbing.equals("")){pmap.put("youwuyichuanbing", null);}else{pmap.put("youwuyichuanbing", youwuyichuanbing);} if(bingqingmiaoshu==null||bingqingmiaoshu.equals("")){pmap.put("bingqingmiaoshu", null);}else{pmap.put("bingqingmiaoshu", bingqingmiaoshu);} int total=bingliService.getCount(pmap); pageBean.setTotal(total); List<Bingli> list=bingliService.getByPage(pmap); map.put("page", pageBean); map.put("list", list); session.setAttribute("p", 1); return "bingli_list2"; } @RequestMapping("bingliList3.do") public String bingliList3(@RequestParam(value="page",required=false)String page, ModelMap map,HttpSession session,Bingli bingli, String binglihao, String yonghuming, String xingming, String xingbie, String chushengnianyue, String dianhua, String shenfenzheng, String keshi, String zhuzhiyisheng, String youwuyichuanbing, String bingqingmiaoshu,HttpServletRequest request){ /*if(session.getAttribute("user")==null){ return "login"; }*/ if(page==null||page.equals("")){ page="1"; } PageBean pageBean=new PageBean(Integer.parseInt(page), 15); Map<String, Object> pmap=new HashMap<String,Object>(); pmap.put("pageno", pageBean.getStart()); pmap.put("pageSize", 15); pmap.put("zhuzhiyisheng", (String)request.getSession().getAttribute("username")); if(binglihao==null||binglihao.equals("")){pmap.put("binglihao", null);}else{pmap.put("binglihao", binglihao);} if(xingming==null||xingming.equals("")){pmap.put("xingming", null);}else{pmap.put("xingming", xingming);} if(xingbie==null||xingbie.equals("")){pmap.put("xingbie", null);}else{pmap.put("xingbie", xingbie);} if(chushengnianyue==null||chushengnianyue.equals("")){pmap.put("chushengnianyue", null);}else{pmap.put("chushengnianyue", chushengnianyue);} if(dianhua==null||dianhua.equals("")){pmap.put("dianhua", null);}else{pmap.put("dianhua", dianhua);} if(shenfenzheng==null||shenfenzheng.equals("")){pmap.put("shenfenzheng", null);}else{pmap.put("shenfenzheng", shenfenzheng);} if(keshi==null||keshi.equals("")){pmap.put("keshi", null);}else{pmap.put("keshi", keshi);} if(youwuyichuanbing==null||youwuyichuanbing.equals("")){pmap.put("youwuyichuanbing", null);}else{pmap.put("youwuyichuanbing", youwuyichuanbing);} if(bingqingmiaoshu==null||bingqingmiaoshu.equals("")){pmap.put("bingqingmiaoshu", null);}else{pmap.put("bingqingmiaoshu", bingqingmiaoshu);} int total=bingliService.getCount(pmap); pageBean.setTotal(total); List<Bingli> list=bingliService.getByPage(pmap); map.put("page", pageBean); map.put("list", list); session.setAttribute("p", 1); return "bingli_list3"; } @RequestMapping("blList.do") public String blList(@RequestParam(value="page",required=false)String page, ModelMap map,HttpSession session,Bingli bingli, String binglihao, String yonghuming, String xingming, String xingbie, String chushengnianyue, String dianhua, String shenfenzheng, String keshi, String zhuzhiyisheng, String youwuyichuanbing, String bingqingmiaoshu){ if(page==null||page.equals("")){ page="1"; } PageBean pageBean=new PageBean(Integer.parseInt(page), 15); Map<String, Object> pmap=new HashMap<String,Object>(); pmap.put("pageno", pageBean.getStart()); pmap.put("pageSize", 15); if(binglihao==null||binglihao.equals("")){pmap.put("binglihao", null);}else{pmap.put("binglihao", binglihao);} if(yonghuming==null||yonghuming.equals("")){pmap.put("yonghuming", null);}else{pmap.put("yonghuming", yonghuming);} if(xingming==null||xingming.equals("")){pmap.put("xingming", null);}else{pmap.put("xingming", xingming);} if(xingbie==null||xingbie.equals("")){pmap.put("xingbie", null);}else{pmap.put("xingbie", xingbie);} if(chushengnianyue==null||chushengnianyue.equals("")){pmap.put("chushengnianyue", null);}else{pmap.put("chushengnianyue", chushengnianyue);} if(dianhua==null||dianhua.equals("")){pmap.put("dianhua", null);}else{pmap.put("dianhua", dianhua);} if(shenfenzheng==null||shenfenzheng.equals("")){pmap.put("shenfenzheng", null);}else{pmap.put("shenfenzheng", shenfenzheng);} if(keshi==null||keshi.equals("")){pmap.put("keshi", null);}else{pmap.put("keshi", keshi);} if(zhuzhiyisheng==null||zhuzhiyisheng.equals("")){pmap.put("zhuzhiyisheng", null);}else{pmap.put("zhuzhiyisheng", zhuzhiyisheng);} if(youwuyichuanbing==null||youwuyichuanbing.equals("")){pmap.put("youwuyichuanbing", null);}else{pmap.put("youwuyichuanbing", youwuyichuanbing);} if(bingqingmiaoshu==null||bingqingmiaoshu.equals("")){pmap.put("bingqingmiaoshu", null);}else{pmap.put("bingqingmiaoshu", bingqingmiaoshu);} int total=bingliService.getCount(pmap); pageBean.setTotal(total); List<Bingli> list=bingliService.getByPage(pmap); map.put("page", pageBean); map.put("list", list); session.setAttribute("p", 1); return "binglilist"; } @RequestMapping("deleteBingli.do") public String deleteBingli(int id,HttpServletRequest request){ bingliService.delete(id); String url = request.getHeader("Referer"); return "redirect:"+url; //return "redirect:bingliList.do"; } }
五,项目总结
功能较多,就不在一一列举,如有兴趣可私聊获取。另配套毕业论文,不查重可直接使用
在通常情况下,开发人员在设计E-R图时,使用矩形表示实体,在矩形内框中写明实体名(实体名是每个实体的唯一标识)使用椭圆表示属性,并且使用无向边将其与实体连接起来。
管理员名称、密码和权限三个属性。
管理员体ER图如下图所示。
图4-4管理员ER图
科室信息ER图如下图所示。
图4-5科室信息ER图
医生信息ER图如下图所示。
图4-6医生信息ER图
挂号信息ER图如下图所示。
图4-7挂号信息ER图
根据系统各个实体的关系,得出系统的总体ER图。
系统总体ER图如下图所示。
图4-8系统总体ER图
使用SSM为学校医务室开发一套管理系统(三)https://developer.aliyun.com/article/1423192