赞
踩
源码获取:俺的博客首页 "资源" 里下载!
项目介绍
基于SpringBoot Vue的医院信管系统
角色:管理员、用户、医生
管理员:首页、个人中心、用户管理、医生管理、科室管理、医生信息管理、挂号信息管理、取消挂号管理、问诊记录管理、病房管理、药房管理、管理员管理等
用户:首页、医生信息、医院情况、个人中心、后台管理、在线容服、预约挂号等
医生:个人中心首页、挂号信息管理、取消挂号管理、问诊记录管理等
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
4.数据库:MySql 5.7/8.0版本均可;
5.是否Maven项目:是;
技术栈
后端:SpringBoot+Mybaits
前端:layui+Vue+ELementUI
使用说明
项目运行:
1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
4. 运行项目,控制台提示运行成功后再去运行前端项目;
5. 管理员用户名密码:admin/admin
普通用户名密码:user/123456
- @Controller
- @RequestMapping("/")
- public class DoctorController {
- @Autowired
- private IDoctorService doctorService;
- private IDepartmentService departmentService;
-
- public IDoctorService getDoctorService() {
- return doctorService;
- }
-
- public void setDoctorService(IDoctorService doctorService) {
- this.doctorService = doctorService;
- }
-
- public void setDepartmentService(IDepartmentService departmentService) {
- this.departmentService = departmentService;
- }
-
- public IDepartmentService getDepartmentService() {
- return departmentService;
- }
-
- @RequestMapping(value = "Djson", produces = "application/json")
- public @ResponseBody List<DoctorInfo> getJson() {
- List<DoctorInfo> list = doctorService.selectAll(1,4);
- System.out.println("DoctorController" + list);
- return list;
- }
-
-
- @RequestMapping(value = "getAllDoctor")
- public String selectAll(@RequestParam("pageNum") int pageNum,@RequestParam("pageSize") int pageSize,Model model) {
- List<DoctorInfo> alldoctor = doctorService.selectAll(pageNum,pageSize);
- PageInfo<DoctorInfo> list = new PageInfo<DoctorInfo>(alldoctor);
- model.addAttribute("PageInfo",list);
- System.out.println("分页显示"+list);
- return "allDoctor";
- }
-
- @RequestMapping(value="getById")
- public String getById(String dNumber,Model model){
- List<Doctor> doctors = doctorService.getById(dNumber);
- model.addAttribute("doctor", doctors);
- System.out.println("doctor的信息"+doctors);
- return "updateDoctor";
- }
- @RequestMapping(value="getByDoctor")
- public String getByDoctor(String dNumber,Model model){
- List<Doctor> doctors = doctorService.getById(dNumber);
- model.addAttribute("doctor", doctors);
- System.out.println("doctor的信息"+doctors);
- return "getByDoctorInfo";
- }
- //, method = RequestMethod.POST
- @RequestMapping(value = "Ddelete")
- public String delete( String dNumber) {
- doctorService.deleteById(dNumber);
- return "redirect:/getAllDoctor?pageNum=1&pageSize=2";
- }
-
- //, method = RequestMethod.POST
- @RequestMapping(value = "addDoctor",method = RequestMethod.POST)
- public String register(@RequestParam("image") MultipartFile image,
- HttpServletRequest request,
- @RequestParam("dNumber") String dNumber,
- @RequestParam("name") String name,
- @RequestParam("dPwd") String dPwd,
- @RequestParam("cNumber") String cNumber,
- @RequestParam("dInfo") String dInfo,
- @RequestParam("dResume") String dResume,
- @RequestParam("dTel") String dTel,
- @RequestParam("dEmail") String dEmail,
- Model model) {
- // 获取项目的根路径,将上传图片的路径与我们的资源路径在一起,才能显示
- HttpSession session = request.getSession();
- String path = session.getServletContext().getRealPath("/");
- System.out.println("getRealPath('/'):" + path);
- int end = path.indexOf("t", 19);
- // String prePath = path.substring(0, end);
- // String realPath = "d:\\temp";
- String prePath = System.getProperty("user.dir");
- String realPath = prePath+"\\WebContent\\images";
- System.out.println("当前的项目的路劲"+realPath);
- String picName = new Date().getTime() + ".jpg";
- if (!image.isEmpty()) {
- try {
- FileUtils.copyInputStreamToFile(image.getInputStream(),
- new File(realPath, picName));
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- Doctor doctor = new Doctor(dNumber, name, dPwd, cNumber, dInfo,
- dResume, dTel, dEmail, "\\" + picName);
- System.out.println(doctor);
- int a = doctorService.insert(doctor);
- System.out.println("" + a);
- if (a == 1) {
- return "redirect:/getAllDoctor?pageNum=1&pageSize=2";
- }
- return "404";
- }
- @RequestMapping(value = "updateDoctor",method = RequestMethod.POST)
- public String update(@RequestParam("dNumber") String dNumber,
- @RequestParam("name") String name,
- @RequestParam("cNumber") String cNumber,
- @RequestParam("dInfo") String dInfo,
- @RequestParam("dResume") String dResume,
- @RequestParam("dTel") String dTel,
- @RequestParam("dEmail") String dEmail) {
- Doctor doctor = new Doctor(dNumber, name, cNumber, dInfo, dResume, dTel, dEmail);
- System.out.println("修改的医生信息:"+doctor);
- doctorService.update(doctor);
- return "redirect:/getAllDoctor?pageNum=1&pageSize=3";
- }
-
- @RequestMapping(value = "findDoctor")
- public String findDoctor(@RequestParam("pageNum") int pageNum,@RequestParam("pageSize") int pageSize,Model model, String info, String chose) {
- // chose=1,按照科室搜索
- // 2姓名搜索
- System.out.println(info + chose);
- if (chose.equals("1")) {
- List<DoctorInfo> dInfos = doctorService.findId(info,pageNum,pageSize);
- PageInfo<DoctorInfo> list = new PageInfo<DoctorInfo>(dInfos);
- model.addAttribute("PageInfo",list);
- return "allDoctor";
- }
- if (chose.equals("2")) {
- List<DoctorInfo> dInfos = doctorService.findName(info,pageNum,pageSize);
- PageInfo<DoctorInfo> list = new PageInfo<DoctorInfo>(dInfos);
- model.addAttribute("PageInfo",list);
- return "allDoctor";
- }
- if(chose.equals("3")){
- List<DoctorInfo> dInfos = doctorService.findDepartName(info,pageNum,pageSize);
- PageInfo<DoctorInfo> list = new PageInfo<DoctorInfo>(dInfos);
- model.addAttribute("PageInfo",list);
- return "allDoctor";
- }
- return "404";
- }
- @RequestMapping(value = "getD")
- public String getDe(@RequestParam("doctorname") String dNumber,Model model){
- System.out.println(dNumber);
- List<DepartmentInfo> departmentInfos = doctorService.getD(dNumber);
- System.out.println("获取"+departmentInfos);
- model.addAttribute("department", departmentInfos);
-
- return "total";
- }
-
- @RequestMapping(value="addSch")
- public String addSch(@RequestParam("dNumber") String dNumber,@RequestParam("cNumber") String cNumber,
- @RequestParam("total") int total,@RequestParam("price") String price,@RequestParam("sTime") String sTime,
- @RequestParam("eTime") String eTime){
- String sNumber = dNumber;
- Sch sch = new Sch(sNumber, dNumber, cNumber, total, price, sTime, eTime);
- doctorService.insertSch(sch);
- return "redirect:/getS?sNumber="+sNumber;
- }
- @RequestMapping(value="getS")
- public String getSInfo(@RequestParam("sNumber") String sNumber,Model model){
- List<Sch> list = doctorService.getSInfo(sNumber);
- System.out.println(list);
- model.addAttribute("sch", list);
- return "success";
- }
-
- @RequestMapping("getOrederByDoctor")
- public String getOrederByDoctor(@RequestParam("pageNum") int pageNum,@RequestParam("pageSize") int pageSize,@RequestParam("sNumber") String sNumber,Model model){
- List<OrderInfo> orderinfo = doctorService.getOrderByDoctor(sNumber, pageNum, pageSize);
- PageInfo<OrderInfo> list = new PageInfo<OrderInfo>(orderinfo);
- model.addAttribute("PageInfo",list);
- return "orderByDoctor";
- }
- }
- @Controller
- @RequestMapping("/")
- public class DepartmentController {
- @Autowired
- private IDepartmentService departmentService;
-
- public IDepartmentService getDepartmentService() {
- return departmentService;
- }
-
- public void setDepartmentService(IDepartmentService departmentService) {
- this.departmentService = departmentService;
- }
-
- @RequestMapping(value = "getDepart")
- public String getAll(@RequestParam("pageNum") int pageNum,@RequestParam("pageSize") int pageSize,Model model) {
- List<Department> departments = departmentService.getAll(pageNum,pageSize);
- PageInfo<Department> list = new PageInfo<Department>(departments);
- model.addAttribute("PageInfo",list);
- return "adv";
- }
-
- @RequestMapping(value = "getName")
- public String getName(Model model) {
- List<Department> departments = departmentService.getAll();
- model.addAttribute("department", departments);
- System.out.println("Controller" + departments);
- return "info";
- }
- //获取所有科室
- // @RequestMapping(value = "getName1")
- // public String getName1(String dNumber,RedirectAttributes attr,Model model) {
- // List<Department> departments = departmentService.getAll();
- model.addAttribute("department", departments);
- // attr.addFlashAttribute("department", departments);
- // System.out.println("Controller" + departments);
- // System.out.println("dNumber"+dNumber);
- // return "redirect:/getById?dNumber="+dNumber;
- // }
-
- @RequestMapping(value = "delByid")
- public String delById(String cNumber) {
- System.out.println(cNumber);
- departmentService.delById(cNumber);
- return "redirect:/getDepart?pageNum=1&pageSize=2";
- }
-
- @RequestMapping(value = "find")
- public String findName(@RequestParam("pageNum") int pageNum,@RequestParam("pageSize") int pageSize,Model model, String info, String chose) {
- // chose=1,按照科室搜索
- // 2姓名搜索
- System.out.println(info + chose);
- if (chose.equals("1")) {
- List<Department> departments = departmentService.findId(info,pageNum,pageSize);
- PageInfo<Department> list = new PageInfo<Department>(departments);
- model.addAttribute("PageInfo",list);
- return "adv";
- }
- if (chose.equals("2")) {
- List<Department> department = departmentService.findName(info,pageNum,pageSize);
- PageInfo<Department> list = new PageInfo<Department>(department);
- model.addAttribute("PageInfo",list);
- return "adv";
- }
- return "404";
- }
-
- @RequestMapping("updateByid")
- public String updateByid(Model model, String cNumber) {
- List<Department> department = departmentService.findId(cNumber);
- model.addAttribute("department", department);
- return "updateDepartment";
- }
-
- @RequestMapping("update")
- public String update(@RequestParam("cNumber") String cNumber,
- @RequestParam("dName") String dName,
- @RequestParam("dDec") String dDec) {
- Department department = new Department(cNumber, dName, dDec);
- departmentService.update(department);
- return "redirect:/getDepart?pageNum=1&pageSize=2";
- }
- }
- @Controller
- @RequestMapping("/")
- public class UserController {
- @Autowired
- private IUserService userService;
- @Autowired
- private IDoctorService doctorService;
- // private IRegisterService registerService;
-
- // public IRegisterService getRegisterService() {
- // return registerService;
- // }
- //
- // @Resource
- // public void setRegisterService(IRegisterService registerService) {
- // this.registerService = registerService;
- // }
-
- public IUserService getUserService() {
- return userService;
- }
-
- @Resource
- public void setUserService(IUserService userService) {
- this.userService = userService;
- }
-
- @RequestMapping(value = "findAllUser", method = RequestMethod.GET)
- public String home(Model model) {
- List<User> users = userService.selectAll();
- model.addAttribute("users", users);
- System.out.println("Controller" + users);
- return "home";
- }
-
- @RequestMapping(value = "json1", produces = "application/json")
- public @ResponseBody
- List<User> getJson() {
- List<User> list = userService.selectAll();
- System.out.println(list);
- return list;
- }
- @RequestMapping(value="delete" ,method=RequestMethod.POST)
- public String delete(@RequestParam("id") int id){
- userService.deleteById(id);
- System.out.println(id);
- return "success";
- }
-
- @RequestMapping(value = "register", method = RequestMethod.POST)
- public String register(@RequestParam("name") String name,
- @RequestParam("pwd") String pwd,
- @RequestParam("tel") String tel,
- @RequestParam("info") String info, Model model) {
- User user = new User(name, pwd, tel, info);
- System.out.println(info);
- int a = userService.register(user);
- System.out.println(""+a);
- if(a==1){
- return "success";
- }
- return "register";
- }
-
- @RequestMapping(value = "login.action", method = RequestMethod.POST)
- public String login(@RequestParam("username") String username,
- @RequestParam("pwd") String pwd, Model model,HttpSession session) {
- List<User> list = userService.checkLogin(username,pwd);
- try {
- list.get(0);
- model.addAttribute("name", username);
- model.addAttribute("pwd", pwd);
- session.setAttribute("user", list);
- return "uindex";
-
- } catch (Exception e) {
- return "second";
- }
- }
-
- @RequestMapping(value = "updateUser", method = RequestMethod.POST)
- public void updateUser(@RequestParam("username") String username,
- @RequestParam("password") String pwd,
- @RequestParam("tel") String tel,
- @RequestParam("info") String info,
- @RequestParam("id") Integer id,
- Model model,HttpSession session,HttpServletResponse response,HttpServletRequest request) {
-
- User user = new User(username, pwd, id, tel, info);
-
- try {
- userService.updateUser(user);
- List<User> list = userService.checkLogin(user.getUname(),user.getPwd());
- model.addAttribute("name", username);
- model.addAttribute("pwd", pwd);
- session.setAttribute("user", list);
- response.sendRedirect(request.getContextPath() + "/changeruser.jsp");
-
- } catch (Exception e) {
- try {
- response.sendRedirect(request.getContextPath() + "/second.jsp");
- } catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- }
- }
-
- }
- @Controller
- @RequestMapping("/")
- public class AdministorController {
- @Autowired
-
- private IAdministorService administorService;
- private IDoctorService doctorService;
- public IAdministorService getAdministorService() {
- return administorService;
- }
- @Resource
- public void setAdministorService(IAdministorService administorService) {
- this.administorService = administorService;
- }
- @Resource
- public void setDoctorService(IDoctorService doctorService) {
- this.doctorService = doctorService;
- }
- public IDoctorService getDoctorService() {
- return doctorService;
- }
- //method = RequestMethod.POST)
- @RequestMapping(value = "index")
- public String login(@RequestParam("name") String name,
- @RequestParam("pwd") String pwd,@RequestParam("status") String status, Model model) {
- System.out.println(name+pwd);
- if(status.equals("1")){
- boolean result = administorService.checkLogin(name, pwd);
- if (result) {
- model.addAttribute("name", name);
- model.addAttribute("pwd", pwd);
- return "index";
- }
- }
- if(status.equals("2")){
- boolean result = doctorService.checklogin(name, pwd);
- if (result) {
- model.addAttribute("name", name);
- model.addAttribute("pwd", pwd);
- return "dindex";
- }
- }
- return "login";
- }
-
- @RequestMapping(value="addDepart", method = RequestMethod.POST)
- public String adDepart(@RequestParam(value="cNumber") String cNumber,@RequestParam(value="dName") String dName,@RequestParam(value="dDec") String dDec){
- Department department = new Department(cNumber,dName,dDec);
- System.out.println(department);
- int result = administorService.addDepart(department);
- System.out.println(result);
- return "redirect:/getDepart?pageNum=1&pageSize=2";
- }
- /*@RequestMapping(value="addDoctor", method = RequestMethod.POST)
- public String adDoctor(@RequestParam(value="cNumber") String cNumber,@RequestParam(value="dName") String dName,@RequestParam(value="dDec") String dDec){
- Department department = new Department(cNumber,dName,dDec);
- System.out.println(department);
- int result = administorService.addDepart(department);
- System.out.println(result);
- // if(result==1){
- return "redirect:/getDepart";
- // }
- // return "404";
- }*/
- @RequestMapping(value="updatePwd")
- public String updatePwd(@RequestParam(value="Pwd") String Pwd,@RequestParam(value="aNumber") String aNumber,@RequestParam(value="Name") String name){
- Administor administor = new Administor(aNumber, name, Pwd);
- administorService.updatePwd(administor);
- return "login";
- }
- /**
- *
- */
- @RequestMapping("getAllOreder")
- public String getAllOrder(@RequestParam("pageNum") int pageNum,@RequestParam("pageSize") int pageSize,Model model){
- List<OrderInfo> orderinfo = administorService.getAll(pageNum,pageSize);
- PageInfo<OrderInfo> list = new PageInfo<OrderInfo>(orderinfo);
- model.addAttribute("PageInfo",list);
- return "allOreder";
- }
- @RequestMapping("getCount")
- public String getCount(@RequestParam("pageNum") int pageNum,@RequestParam("pageSize") int pageSize,Model model){
- List<Count> count = administorService.getCount(pageNum,pageSize);
- PageInfo<Count> list = new PageInfo<Count>(count);
- model.addAttribute("PageInfo",list);
- return "count";
- }
- @RequestMapping("getFeedBack")
- public String getFeedback(@RequestParam("pageNum") int pageNum,@RequestParam("pageSize") int pageSize,Model model){
- List<Feedback> feddback = administorService.getFeedBack(pageNum,pageSize);
- PageInfo<Feedback> list = new PageInfo<Feedback>(feddback);
- model.addAttribute("PageInfo",list);
- return "feedback";
- }
- @RequestMapping("addNew")
- public String addNew(@RequestParam(value="title") String title,@RequestParam(value="content") String content,@RequestParam("time") String time){
- New news = new New( title, content, time);
- administorService.addNew(news);
- return "redirect:/getAllNew?pageNum=1&pageSize=3";
- }
-
- @RequestMapping("getAllNew")
- public String getAllNew(@RequestParam("pageNum") int pageNum,@RequestParam("pageSize") int pageSize,Model model){
- List<New> news = administorService.getAllNew(pageNum,pageSize);
- PageInfo<New> list = new PageInfo<New>(news);
- model.addAttribute("PageInfo",list);
- return "welcome";
- }
- }
源码获取:俺的博客首页 "资源" 里下载!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。