• Java项目:springboot医院管理系统


    作者主页:夜未央5788

     简介:Java领域优质创作者、Java项目、学习资料、技术互助

    文末获取源码

    项目介绍

    医院管理系统,分为管理员、医生、病人三种角色;

    管理员主要功能包括:
    首页、系统管理:医生管理、患者管理、药品管理;预约管理;病史管理;住院信息管理;管理员用户管理;
    医生主要功能包括:首页、就医/查看病史;

    病人主要功能包括:首页、病史、住院信息、挂号;

    环境需要

    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版本;

    技术栈

    1. 后端:SpringBoot

    2. 前端:Layui+Freemaker

    使用说明

    1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;

    2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;

    若为maven项目,导入成功后请执行maven clean;maven install命令

    3. 将项目中application.yml配置文件中的数据库配置改为自己的配置,配置tomcat,然后运行;

    4. 运行项目,输入http://localhost:8088 登录

    运行截图

     

     

     

     

     

     

     

     代码相关

    预约管理控制器

    1. @Controller
    2. public class AppointmentController {
    3. @Autowired
    4. AppointmentService appointmentService;
    5. @Autowired
    6. DoctorService doctorService;
    7. @Autowired
    8. PatientService patientService;
    9. @RequestMapping("/admin/appointmentManage")
    10. public String appointmentManage(HttpServletRequest request,@RequestParam(value = "doctorname",required = false)String doctorname,@RequestParam(value = "patientname",required = false)String patientname){
    11. List appointmentList=appointmentService.getAllAppointments(doctorname,patientname);
    12. request.setAttribute("appointments" ,appointmentList);
    13. return"admin/appointmentManage";
    14. }
    15. @RequestMapping("/admin/appointmentAdd")
    16. public String appointmentAddPage(HttpServletRequest request){
    17. request.setAttribute("patients",patientService.getAllPatients());
    18. //request.setAttribute("doctors",doctorService.getAllDoctor());
    19. return"admin/add/appointmentadd";
    20. }
    21. @RequestMapping(value = "/admin/appointment/{id}",method = RequestMethod.DELETE)
    22. @ResponseBody
    23. public JSONObject delAppointment(@PathVariable Integer id){
    24. JSONObject json=new JSONObject();
    25. json.put("message",appointmentService.delAppointment(id));
    26. return json;
    27. }
    28. @RequestMapping(value = "/admin/appointment/{id}",method = RequestMethod.GET)
    29. public String AppointmentInfo(@PathVariable Integer id,HttpServletRequest request){
    30. request.setAttribute("patients",patientService.getAllPatients());
    31. request.setAttribute("doctors",doctorService.getAllDoctor());
    32. request.setAttribute("appointment",appointmentService.getAppointment(id));
    33. return "admin/info/appointmentInfo";
    34. }
    35. @RequestMapping(value = "/admin/appointment",method = RequestMethod.PUT)
    36. @ResponseBody
    37. public JSONObject AppointmentUpdate(@RequestBody Appointment appointment){
    38. JSONObject json=new JSONObject();
    39. json.put("message",appointmentService.UpdateAppointment(appointment));
    40. return json;
    41. }
    42. @RequestMapping(value = "/admin/appointment",method = RequestMethod.POST)
    43. @ResponseBody
    44. public JSONObject AppointmentAdd(@RequestBody Appointment appointment){
    45. System.out.println(appointment);
    46. JSONObject json=new JSONObject();
    47. json.put("message",appointmentService.addAppointment(appointment));
    48. return json;
    49. }
    50. }

    医生管理控制器

    1. @Controller
    2. public class DoctorController {
    3. @Autowired
    4. DoctorService doctorService;
    5. @Autowired
    6. AppointmentService appointmentService;
    7. @Autowired
    8. PatientService patientService;
    9. @Autowired
    10. DrugsService drugsService;
    11. @Autowired
    12. HospitalizationService hospitalizationService;
    13. @Autowired
    14. MedicalhistoryService medicalhistoryService;
    15. @RequestMapping("/admin/doctorManage")
    16. public String doctorManage(HttpServletRequest request,@RequestParam(value="name",required = false) String name,@RequestParam(value="certId",required = false) String certId){
    17. request.setAttribute("doctors",doctorService.getAllDoctor(name,certId));
    18. return "admin/doctorManage";
    19. }
    20. @RequestMapping(value = "/admin/doctor/{id}",method = RequestMethod.DELETE)
    21. @ResponseBody
    22. public JSONObject delDoctor(@PathVariable Integer id){
    23. JSONObject json=new JSONObject();
    24. json.put("message",doctorService.delDoctor(id));
    25. return json;
    26. }
    27. @RequestMapping(value = "/admin/doctor/{id}",method = RequestMethod.GET)
    28. public String doctorInfo(@PathVariable Integer id,HttpServletRequest request){
    29. request.setAttribute("doctor",doctorService.getDoctor(id));
    30. return "admin/info/doctorinfo";
    31. }
    32. @RequestMapping(value = "/admin/doctor",method = RequestMethod.POST)
    33. @ResponseBody
    34. public JSONObject AddDoctor(@RequestBody Doctor doctor){
    35. JSONObject json=new JSONObject();
    36. json.put("message",doctorService.addDoctor(doctor));
    37. return json;
    38. }
    39. @RequestMapping(value = "/admin/doctor",method = RequestMethod.PUT)
    40. @ResponseBody
    41. public JSONObject updateDoctor(@RequestBody Doctor doctor){
    42. JSONObject json=new JSONObject();
    43. json.put("message",doctorService.upDoctor(doctor));
    44. return json;
    45. }
    46. @RequestMapping("/admin/doctorAdd")
    47. public String doctorAddPage(){
    48. return "admin/add/doctoradd";
    49. }
    50. @RequestMapping("/doctor/seekMedicalAdvice")
    51. public String seekMedicalAdvice(HttpServletRequest request, HttpSession session,@RequestParam(value = "patientname",required = false)String patientname,@RequestParam(value = "time",required = false)String time){
    52. Login login=(Login)session.getAttribute("login");
    53. Doctor doctor=doctorService.getDoctorByLoginId(login.getId());
    54. request.setAttribute("appointments" ,appointmentService.selectByDoctorId(doctor.getId(),patientname,time));
    55. return "doctor/seekMedicalAdvice";
    56. }
    57. @RequestMapping("/doctor/seek/{id}")
    58. public String seek(@PathVariable Integer id,HttpServletRequest request){
    59. request.setAttribute("patient",patientService.getPatient(id));
    60. request.setAttribute("drugs",drugsService.getAllDrugs());
    61. return "doctor/seek";
    62. }
    63. @RequestMapping(value = "/doctor/drug",method = RequestMethod.PUT)
    64. @ResponseBody
    65. public JSONObject drug(@RequestBody Map map){
    66. JSONObject json=new JSONObject();
    67. Patient patient=new Patient();
    68. System.out.println(map);
    69. patient.setDrugsids(DrugsUtils.vaild(map));
    70. patient.setId(Integer.parseInt((String)map.get("patientid")));
    71. json.put("message",patientService.seek(patient));
    72. return json;
    73. }
    74. @RequestMapping(value = "/doctor/zation",method = RequestMethod.POST)
    75. @ResponseBody
    76. public JSONObject zation(@RequestBody Hospitalization hospitalization){
    77. JSONObject json=new JSONObject();
    78. json.put("message",hospitalizationService.AddHospitalization(hospitalization));
    79. return json;
    80. }
    81. @RequestMapping(value = "/doctor/medicalhistory/{id}")
    82. public String medicalhistory(@PathVariable Integer id,HttpServletRequest request){
    83. request.setAttribute("medicalhistorys",medicalhistoryService.getMedicalhistoryByPatientId(id));
    84. return "doctor/medicalhistory";
    85. }
    86. @RequestMapping( value = "/doctor/{department}",method = RequestMethod.GET)
    87. @ResponseBody
    88. public JSONObject getDoctorByDepartment(@PathVariable String department){
    89. JSONObject json=new JSONObject();
    90. json.put("doctors",doctorService.getDoctorByDepartment(department));
    91. return json;
    92. }
    93. }

    药品管理控制器

    1. @Controller
    2. public class MedicalhistoryController {
    3. @Autowired
    4. PatientService patientService;
    5. @Autowired
    6. MedicalhistoryService medicalhistoryService;
    7. @RequestMapping("/admin/medicalhistoryManage")
    8. public String medicalhistoryManage(HttpServletRequest request,@RequestParam(value = "doctorname",required = false)String doctorname,@RequestParam(value = "patientname",required = false)String patientname){
    9. request.setAttribute("medicalhistorys",medicalhistoryService.getAllMedicalhistorys(doctorname,patientname));
    10. return "admin/medicalhistoryManage";
    11. }
    12. @RequestMapping("/admin/medicalhistoryAdd")
    13. public String medicalhistoryAddPage(HttpServletRequest request){
    14. request.setAttribute("patients",patientService.getAllPatients());
    15. return"admin/add/medicalhistoryadd";
    16. }
    17. @RequestMapping(value = "/admin/medicalhistory/{id}",method = RequestMethod.DELETE)
    18. @ResponseBody
    19. public JSONObject delmedicalhistory(@PathVariable Integer id){
    20. JSONObject json=new JSONObject();
    21. json.put("message",medicalhistoryService.delMedicalhistory(id));
    22. return json;
    23. }
    24. @RequestMapping(value = "/admin/medicalhistory/{id}",method = RequestMethod.GET)
    25. public String medicalhistoryInfo(@PathVariable Integer id,HttpServletRequest request){
    26. request.setAttribute("patients",patientService.getAllPatients());
    27. request.setAttribute("medicalhistory",medicalhistoryService.getMedicalhistory(id));
    28. return "admin/info/medicalhistoryInfo";
    29. }
    30. @RequestMapping(value = "/admin/medicalhistory",method = RequestMethod.PUT)
    31. @ResponseBody
    32. public JSONObject medicalhistoryUpdate(@RequestBody Medicalhistory medicalhistory){
    33. JSONObject json=new JSONObject();
    34. json.put("message",medicalhistoryService.UpdateMedicalhistory(medicalhistory));
    35. return json;
    36. }
    37. @RequestMapping(value = "/admin/medicalhistory",method = RequestMethod.POST)
    38. @ResponseBody
    39. public JSONObject medicalhistoryAdd(@RequestBody Medicalhistory medicalhistory){
    40. System.out.println(medicalhistory);
    41. JSONObject json=new JSONObject();
    42. json.put("message",medicalhistoryService.addMedicalhistory(medicalhistory));
    43. return json;
    44. }
    45. }

    如果也想学习本系统,下面领取。回复:052springboot

  • 相关阅读:
    MyBatis面试题(总结最全面的面试题)
    时序预测 | MATLAB实现LSSVM最小二乘支持向量机时间序列预测未来
    Java虚拟机二三事:虚拟机类加载机制
    对于Oracle,MySQL,SQL Server重复数据删除
    车用尿素交易暴增丨化工出口ERP让业务管理更高效
    老年人怎么办理美国旅游签证?
    助力服装智造!这家企业携手美创实现全流程数据安全保障
    Linux学习笔记6 - 系统启动流程
    可自由搭建的能源管理平台,轻松实现高效节能
    Flask 使用 JWT(二)
  • 原文地址:https://blog.csdn.net/hanyunlong1989/article/details/125823314