基于javaweb+springboot的医院预约挂号系统(java+Springboot+jsp+maven+layui+mysql)

这是一个基于Java Web和SpringBoot的医院预约挂号系统项目,涵盖了患者、医生和管理员的不同角色功能。患者可以注册、选择医生、日期和号源进行挂号,医生能够接诊,管理员则能维护用户和医生信息。项目使用了JSP、Spring、MyBatis、layui、Maven等技术,并可在JDK1.8+Tomcat8.5+MySQL环境下运行。代码示例展示了医生添加、登陆验证和信息修改等功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

基于javaweb+springboot的医院预约挂号系统(java+Springboot+jsp+maven+layui+mysql)

一、项目简述

功能包括:
用户分为患者,医生,管理员,患者可进行注册选择医生挂号,选择日期,选择号源,医生可进行接诊,管理员可对用户,医生信息的维护等等功能。
二、项目运行

环境配置:

Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)

项目技术:

JSP +Spring + SpringBoot + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

	
	   /**
	      * 医生添加
	    * @param model
	    * @param zixun
	    * @return
	    */
	   @RequestMapping("/zixunInsert")
	   public String zixunInsert(Model model,Doctor doctor){
	       if(doctor.getId() !=  null){
	    	   if(doctor.getSid() != null) {
	    		   Section selectByPrimaryKey = sectionService.selectByPrimaryKey(doctor.getSid());
	    		   doctor.setSname(selectByPrimaryKey.getName());
	    	   }
	           doctorService.updateByPrimaryKeySelective(doctor);
	       }
	        model.addAttribute("type",1);
	   }
		
	   
	   
	   
	   
	   
	   /**
	     * 登陆验证
	     * @return
	     */
	    @RequestMapping("/verificatio")
	    public String verificatio(String username, String password, Integer type, HttpServletRequest request,Model model) {
	        	DoctorExample se  = new  DoctorExample();
	    		DoctorExample.Criteria criteria = se.createCriteria();
	    		criteria.andUsernameEqualTo(zhanghao);
	            List<Doctor> selectByExample = doctorService.selectByExample(se);
	            if(selectByExample.size() > 0){
	                map.put("pan","err");
	            }else{
	                map.put("pan","ok");
	            }
	           return    map;
	    }
	    
	   
	
	   /**
	      * 医生添加
	    * @param model
	    * @param zixun
	    * @return
	    */
	   @RequestMapping("/zixunInsert")
	   public String zixunInsert(Model model,Doctor doctor){
	       if(doctor.getId() !=  null){
	    	   if(doctor.getSid() != null) {
	    		   Section selectByPrimaryKey = sectionService.selectByPrimaryKey(doctor.getSid());
	    		   doctor.setSname(selectByPrimaryKey.getName());
	    	   }
	        			 sb.append(list.get(i).getName()+",");
		        		 shu.append(list.get(i).getYipeoples()+",");
	        		}
	        	 }
	        	   model.addAttribute("name",sb.toString());
	               model.addAttribute("nu",shu.toString());
          }
         return  "doctor/index";
     }
     
	    
     /**
  	  * 修改信息
      * @param model
      * @return
      */
     @RequestMapping("/doctorUptatePage")
     public String doctorUptatePage(Model model,HttpServletRequest request) {
	     public String messagesQuXiao(Integer id) {
	        if(id != null) {
	        	Messages messages = new Messages();
	        	messages.setId(id);
	        	messages.setType(2); //2取消预约
	        	messagesService.updateByPrimaryKeySelective(messages);
	        }
	         return  "redirect:/doctor/messageList?type=1";
	     }
	     
	     
	     /**
	      *  退号
	      */
	     @RequestMapping("/messagesTui")
	     public String messagesTui(Integer id) {
	        if(id != null) {
	        	Messages messages = new Messages();
	        	messages.setId(id);
	        	messages.setType(4); //4退号失败
	        	messagesService.updateByPrimaryKeySelective(messages);
	        }
	     
	    /**
		   *预约信息列表
	     * @throws ParseException 
		 */
	    @RequestMapping(value = "/tiaozhuanList")
	    @ResponseBody
	    public  String  messagesList(@RequestParam("xiao")Integer xiao,@RequestParam("da")Integer da)  {
	    	Messages message = new Messages();
	    	if(xiao != null & da != null) {
	    		Messages mexiao = messagesService.selectByPrimaryKey(xiao);
	    		Integer px = mexiao.getPai();
	    		Messages meda = messagesService.selectByPrimaryKey(da);
	    		mexiao.setPai(meda.getPai());
	    		meda.setPai(px);
	    @RequestMapping("/sessionInvalidate")
	    public String boot(HttpServletRequest request,Model model) {
	        HttpSession session = request.getSession();
	        Integer type = (Integer) session.getAttribute("type");
	        if(type == null){
	            type=1;
	        }
	        
	        if(type == 3){
	        	model.addAttribute("type",type);
		        session.invalidate();   //session销毁
	        	 return "loginByPatient";
	        }
	        
	        model.addAttribute("type",type);
		 */
	    @RequestMapping(value = "/passwordSave")
	    @ResponseBody
	    public  String  passwordSave(@RequestBody Patient patient ) throws ParseException {
	    	if(patient != null && patient.getUsername() != null && patient.getPassword() != null) {
	    		Patient  pa = new Patient();
	    	    pa.setUsername(patient.getUsername());
		    	List<Patient>  list = patientService.selectPatient(pa);
	    		if(list.size() > 0) {
	  	    	    return  "err";
	  	    	}
	    		patientService.insertSelective(patient);
	    	    return  "ok";
	    	}
  	    	
	      return  "err";
	    } 
	  
    
    
  	    
       /**
   		 *登录验证
         * @throws ParseException 
   		 */
   	    @RequestMapping(value = "/userLoginView")
	    @ResponseBody
	    public  List<Patient>   patientList(Integer pid,HttpServletRequest request) {
	    	Patient pa = new Patient();
	    	pa.setPid(pid);
	    	List<Patient> selectPatient = patientService.selectPatient(pa);
	    	
	        return  selectPatient;
	    }
	    /**
         *患者信息列表
      */
     @RequestMapping("/patientList2")
     public String messageList2(Model model, Patient patient, @RequestParam(value="page",defaultValue="1")Integer page,HttpServletRequest request) {
     	if(patient == null) {
     		patient = new Patient();
     	}
        HttpSession session = request.getSession();
        Patient       patient1   =  (Patient) session.getAttribute("PATIENT");
         if(patient1 == null){
        	  return  "redirect:/login/font/index";
         }
			/*
			 * PageInfo<Patient> pageInfo =
			 * patientService.selectPatientList(patient,1,size); List<Patient> list =
             if(merchants.size() <= 0){
                 model.addAttribute("message","密码错误");
                 model.addAttribute("type",type);
                 return "behind/login";
             }
             session.setAttribute("MERCHANT",merchants.get(0));
             return "redirect:/merchant/index";
         }
        Admin admin = new Admin();
        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
     *//*

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值