使用SSM为学校医务室开发一套管理系统(二)

简介: 使用SSM为学校医务室开发一套管理系统

使用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

相关文章
|
4月前
|
Java 数据库连接 Maven
手把手教你如何搭建SSM框架、图书商城系统案例
这篇文章是关于如何搭建SSM框架以及实现一个图书商城系统的详细教程,包括了项目的配置文件整合、依赖管理、项目结构和运行效果展示,并提供了GitHub源码链接。
手把手教你如何搭建SSM框架、图书商城系统案例
|
1月前
|
前端开发 Oracle 关系型数据库
关于使用SSM+JSP开发时setter、getter隐式调用问题的小结
本文主要分享了在使用SSM+JSP进行网站开发时,因忽视setter、getter的隐式调用问题而导致的常见bug及其解决方法。详细介绍了setter和getter的隐式调用时机,并给出了具体示例,帮助开发者避免类似问题。
42 11
|
3月前
|
Java 应用服务中间件 数据库连接
ssm项目整合,简单的用户管理系统
文章介绍了一个使用SSM框架(Spring、SpringMVC、MyBatis)构建的简单用户管理系统的整合过程,包括项目搭建、数据库配置、各层代码实现以及视图展示。
ssm项目整合,简单的用户管理系统
|
3月前
|
XML Java 数据库连接
如何搭建SSM框架、图书商城系统
这是一份详尽的《Spring + SpringMVC + Mybatis 整合指南》,作者耗时良久整理出约五万字的内容,现已经全部笔记公开。此文档详细地介绍了如何搭建与整合SSM框架,具体步骤包括创建Maven项目、添加web骨架、配置pom文件以及整合Spring、SpringMVC和Mybatis等。无论是对初学者还是有一定基础的开发者来说,都是很好的学习资源。此外,作者还提供了项目源码的GitHub链接,方便读者实践。虽然当前主流推荐学习SpringBoot,但了解SSM框架仍然是不可或缺的基础。
46 0
|
4月前
|
SQL Java 应用服务中间件
使用SSM搭建图书商城管理系统(完整过程介绍、售后服务哈哈哈)
这篇文章是关于如何使用SSM框架搭建图书商城管理系统的教程,包括完整过程介绍、常见问题解答和售后服务,提供了项目地址、运行环境配置、效果图展示以及运行代码的步骤。
使用SSM搭建图书商城管理系统(完整过程介绍、售后服务哈哈哈)
|
5月前
|
存储 关系型数据库 测试技术
基于ssm+vue的校园驿站管理系统+(源码+部署说明+演示视频+源码介绍)(2)
基于ssm+vue的校园驿站管理系统+(源码+部署说明+演示视频+源码介绍)
78 1
|
5月前
|
安全 数据挖掘 测试技术
基于SSM+Vue的家居商城系统(源码+部署说明+演示视频)(2)
基于SSM+Vue的家居商城系统(源码+部署说明+演示视频)
80 0
|
5月前
|
Java 关系型数据库 MySQL
基于SSM+Vue的家居商城系统(源码+部署说明+演示视频)(1)
基于SSM+Vue的家居商城系统(源码+部署说明+演示视频)
76 0
|
6月前
|
搜索推荐 JavaScript Java
计算机Java项目|基于SSM的个性化商铺系统
计算机Java项目|基于SSM的个性化商铺系统
|
6月前
|
前端开发 JavaScript Java
计算机Java项目|SSM智能仓储系统
计算机Java项目|SSM智能仓储系统