基于javaweb+mysql的ssm医院挂号门诊管理系统(java+ssm+jsp+jquery+layui+mysql)
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM医院挂号门诊管理系统(java+ssm+jsp+jquery+layui+mysql)
项目介绍
基于SSM的医院门诊挂号系统
角色:管理员、用户、医生
用户登录进入系统可以对主页、个人中心、就诊人建档管理、预约挂号管理、用户退号管理、异常提醒管理、我的收藏管理等功能
管理员登录系统后,可以对主页、个人中心、用户管理、就诊人建档管理、医院介绍管理、科室管理、医生管理、预约挂号管理、用户退号管理、异常提醒管理、留言板、系统管理等功能。
医生登录进入系统可以对主页、个人中心、预约挂号管理、用户退号管理、留言板、系统管理等功能
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.是否Maven项目: 否;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 6.数据库:MySql 5.7/8.0等版本均可;
技术栈
后端:SSM(Spring+SpringMVC+Mybatis) 前端:JSP+CSS+JS+JQUERY+Layui
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目; 3. 将项目中db.xml配置文件中的数据库配置改为自己的配置,然后运行;
* @return
*//*
@RequestMapping("/sessionInvalidate")
public String boot(HttpServletRequest request,Model model) {
HttpSession session = request.getSession();
Integer type = (Integer) session.getAttribute("type");
if(type == null){
type=1;
model.addAttribute("type",type);
session.invalidate(); //session销毁
return "behind/login";
* 修改医生信息界面
* @return
*/
@RequestMapping("/doctorUptatePage")
public String doctorUptatePage(Model model,Integer id) {
if(id != null) {
Doctor doctor = doctorService.selectByPrimaryKey(id);
List<Section> sectionlist2 = null;
model.addAttribute("doctor",doctor);
//科室
Section se = new Section();
se.setType(1);
List<Section> sectionlist = sectionService.selectByExample(se);
merchantService.deleteByPrimaryKey(id);
return "redirect:/admin/merchantList";
*//**
*用户列表
* @return
*//*
@RequestMapping("/userList")
public String userList(Model model) {
List<User> userlist = usertService.selectFull(null);
model.addAttribute("userlist",userlist);
return "behind/admin/userList";
*//**
* 删除科室下级
*/
@RequestMapping("/sectionBelowDelect")
public String sectionBelowUptate(Integer id) {
Section section = sectionService.selectByPrimaryKey(id);
Integer pid = section.getPid();
sectionService.deleteByPrimaryKey(section.getId());
return "redirect:/admin/sectionBelowList?id="+pid;
/**
* 删除科室
*/
if(type == null){
type = 1;
model.addAttribute("type",type);
return "behind/login";
*//**
* 登陆验证
* @return
*//*
@RequestMapping("/verificatio")
public String signin(String username, String password, Integer type, HttpServletRequest request,Model model) {
HttpSession session = request.getSession();
@RequestMapping("/verificatio")
public String signin(String username, String password, Integer type, HttpServletRequest request,Model model) {
HttpSession session = request.getSession();
session.setAttribute("type",type);
//类型为1是商户后台 2是管理员
if(type == 1){
Merchant merchant = new Merchant();
merchant.setZhanghao(username);
merchant.setMima(password);
merchant.setState(1);
public String userList(Model model) {
List<User> userlist = usertService.selectFull(null);
model.addAttribute("userlist",userlist);
return "behind/admin/userList";
*//**
*用户删除
* @return
*//*
@RequestMapping("/userDel")
public String userDel(Model model,Integer id) {
if(id != null){
usertService.deleteByPrimaryKey(id);
mess.setDid(dt.getId());
mess.setUsername(pa.getName());
List<Messages> selectMessages = messagesService.selectMessages(mess);
if(selectMessages.size() > 0 )
patient++;
//预约总数
MessagesExample me = new MessagesExample();
MessagesExample.Criteria mecriteria = me.createCriteria();
mecriteria.andDidEqualTo(dt.getId());
int messages = messagesService.countByExample(me);
messages.setType(4); //4退号失败
messagesService.updateByPrimaryKeySelective(messages);
return "redirect:/doctor/messageList?type=3";
后端管理员控制层:
/**
* 后端管理员控制层
*/
@Controller
@RequestMapping("/admin")
public class AdminController {
@Autowired
*/
@RequestMapping("/sectionDelect")
public String sectionDelect(Integer id) {
Section section = new Section();
section.setPid(id);
section.setType(2);
List<Section> list = sectionService.selectByExample(section);
sectionService.deleteByPrimaryKey(id);
for (Section section2 : list) {
sectionService.deleteByPrimaryKey(section2.getId());
return "redirect:/admin/sectionList";
/**
* 修改密码
*/
@RequestMapping("/adminUptatePassword")
public String adminUptatePassword(Model model,Admin admin,HttpServletRequest request) {
HttpSession session = request.getSession();
Admin ad = (Admin) session.getAttribute("ADMIN");
if(ad != null && admin.getPassword() != null){
admin.setId(ad.getId());
adminService.updateByPrimaryKeySelective(admin);
return "redirect:/admin/index";
/**
* 坐诊时间设置界面
*/
admin.setUsername(username);
admin.setPassword(password);
List<Admin> adminlist = adminService.selectAdmin(admin);
if(adminlist.size() <= 0){
model.addAttribute("message","密码错误");
model.addAttribute("type",type);
return "behind/login";
session.setAttribute("ADMIN",adminlist.get(0));
return "redirect:/admin/index";
*//**
* 退出登录
* @param request
* @return
model.addAttribute("sectionList",list2);
model.addAttribute("pageInfo",pageInfo);
model.addAttribute("section",section);
return "admin/sectionList";
/**
* 科室详情下级列表
*/
@RequestMapping("/sectionBelowList")
public String sectionBelowList(Model model, Section section, Integer id) {
if(section == null) {
section = new Section();
return "admin/doctorList";
/**
* 修改医生信息界面
* @return
*/
@RequestMapping("/doctorUptatePage")
public String doctorUptatePage(Model model,Integer id) {
if(id != null) {
Doctor doctor = doctorService.selectByPrimaryKey(id);
List<Section> sectionlist2 = null;
model.addAttribute("doctor",doctor);
//科室
Section se = new Section();
* 跳转修改科室下级界面
*/
@RequestMapping("/sectionBelowUptatePage")
public String sectionBelowUptatePage(Model model,Integer id) {
if(id != null) {
Section se = sectionService.selectByPrimaryKey(id);
Section section = sectionService.selectByPrimaryKey(se.getPid());
model.addAttribute("se",se);
model.addAttribute("sname",section.getName());
return "admin/sectionBelowUptate";
/**
try {
String random = StringRandom.getRandom();
String filename = mufile[i].getOriginalFilename();
//随机字符+原图片名用作新的图片名
filename = random+filename;
//文件保存路径 D:/Java/hospital
File file = new File(filePath+filename);
//判断父级文件是否存在
if (!file.getParentFile().exists()) {
file.getParentFile().mkdir();
path.append("/files/"+filename+",");
e.printStackTrace();
Doctor doctor = new Doctor();
if(id != -1){
doctor.setId(id);
doctor.setImg("/files/"+filename);
doctorService.updateByPrimaryKeySelective(doctor);
}else {
//添加图片路径
doctor.setImg("/files/"+filename);
doctorService.insertSelective(doctor);
System.out.println("id:"+doctor.getId());
map.put("id",doctor.getId());
*/
@RequestMapping(value ="/bannersAdd")
@ResponseBody
public Map<String, Object> bannersAdd(@RequestParam("mf")MultipartFile[] mufile,@RequestParam("id")Integer id) throws IOException{
Map<String, Object> map = new HashMap<String, Object>();
StringBuffer path = new StringBuffer();
//图片上传并保存上传的路径
for (int i = 0; i < mufile.length; i++) {
try {
String random = StringRandom.getRandom();
String filename = mufile[i].getOriginalFilename();
//随机字符+原图片名用作新的图片名