当前位置:   article > 正文

Java项目:医院管理系统(java+SSM+layui+maven+mysql)_layui医院管理系统框架

layui医院管理系统框架

源码获取:博客首页 "资源" 里下载!

功能介绍:

基于ssm+layui框架的小型医院后台管理系统。简单实现了病人管理、病床管理、员工管理、部门管理、药品管理、仪器管理等基础功能。
整个项目通过maven方式搭建用到的jar包通过maven导入,前端使用搭建好的Layui框架,拿来即用。后端使用SSM+MySQL,后台逻辑实现了分页、级联、多表查询。目前项目基本完成,可重构与扩展 

技术栈:

- SSM框架
- Layui框架
- MySQL 5.7 数据库
- Maven搭建
- MD5加密 


实现功能:

- 管理员的登录、退出与切换
- 管理员、仪器、药品、部门、员工、病床、病人各模块增删改查
- 个别模块关联查询
- 各个模块数据导出Excel

 

 

 

 

 

医生管理控制层:

  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 PatientController {
  3. @Autowired
  4. PatientService patientService;
  5. @Autowired
  6. DoctorService doctorService;
  7. @Autowired
  8. AppointmentService appointmentService;
  9. @Autowired
  10. HospitalizationService hospitalizationService;
  11. @Autowired
  12. MedicalhistoryService medicalhistoryService;
  13. @RequestMapping("/admin/patientManage")
  14. public String patientlist(HttpServletRequest request,@RequestParam(value="name",required = false) String name,@RequestParam(value="certId",required = false) String certId){
  15. request.setAttribute("patients",patientService.getAllPatients(name,certId));
  16. return "admin/patientManage";
  17. }
  18. @RequestMapping(value = "/admin/patient/{id}",method = RequestMethod.DELETE)
  19. @ResponseBody
  20. public JSONObject delPatient(@PathVariable Integer id){
  21. JSONObject json=new JSONObject();
  22. json.put("message",patientService.delPatient(id));
  23. return json;
  24. }
  25. @RequestMapping(value = "/admin/patient/{id}",method = RequestMethod.GET)
  26. public String patientInfo(@PathVariable Integer id,HttpServletRequest request){
  27. request.setAttribute("patient",patientService.getPatient(id));
  28. request.setAttribute("appointments",appointmentService.getPatientMessage(id));
  29. request.setAttribute("hospitalizations",hospitalizationService.getPatientMessage(id));
  30. request.setAttribute("doctors",doctorService.getAllDoctor());
  31. return "admin/info/patientinfo";
  32. }
  33. @RequestMapping(value = "/admin/patientAdd",method = RequestMethod.GET)
  34. public String patientAddPage(){
  35. return "admin/add/patientadd";
  36. }
  37. @RequestMapping(value = "/admin/patient",method = RequestMethod.PUT)
  38. @ResponseBody
  39. public JSONObject patientInfo(@RequestBody Patient patient){
  40. JSONObject json=new JSONObject();
  41. json.put("message",patientService.updatePatient(patient));
  42. return json;
  43. }
  44. @RequestMapping(value = "/admin/patient",method = RequestMethod.POST)
  45. @ResponseBody
  46. public JSONObject delPatient(@RequestBody Patient patient){
  47. JSONObject json=new JSONObject();
  48. json.put("message",patientService.addPatient(patient));
  49. return json;
  50. }
  51. @RequestMapping(value = "/patient/medicalhistory")
  52. public String medicalhistory(HttpSession session,HttpServletRequest request){
  53. Login login=(Login)session.getAttribute("login");
  54. Patient patient=patientService.findPatientByLoginId(login.getId());
  55. request.setAttribute("medicalhistorys",medicalhistoryService.getMedicalhistoryByPatientId(patient.getId()));
  56. return "patient/medicalhistory";
  57. }
  58. @RequestMapping(value = "/patient/hospitalization")
  59. public String hospitalization(HttpSession session,HttpServletRequest request){
  60. Login login=(Login)session.getAttribute("login");
  61. Patient patient=patientService.findPatientByLoginId(login.getId());
  62. request.setAttribute("theLast",hospitalizationService.findTheLastHospitalization(patient.getHospitalizationid()));
  63. Hospitalization hospitalization=new Hospitalization();
  64. hospitalization.setPatientid(patient.getId());
  65. hospitalization.setId(patient.getHospitalizationid());
  66. request.setAttribute("others",hospitalizationService.findOtherHospitalization(hospitalization));
  67. return "patient/hospitalization";
  68. }
  69. @RequestMapping(value = "/patient/appointment")
  70. public String appointmentInfo(HttpServletRequest request,HttpSession session){
  71. Login login=(Login)session.getAttribute("login");
  72. Patient patient=patientService.findPatientByLoginId(login.getId());
  73. request.setAttribute("patientid",patient.getId());
  74. request.setAttribute("doctors",doctorService.getAllDoctor());
  75. return "patient/appointment";
  76. }
  77. @RequestMapping(value = "/patient/appointment",method = RequestMethod.POST)
  78. @ResponseBody
  79. public JSONObject appointment(@RequestBody Appointment appointment){
  80. JSONObject json=new JSONObject();
  81. Patient patient=new Patient();
  82. String message=appointmentService.addAppointment(appointment);
  83. patient.setAppointmentid(appointmentService.selectTheLastAppointment(appointment.getPatientid()));
  84. patient.setId(appointment.getPatientid());
  85. patientService.updateAppointMent(patient);
  86. json.put("message",message);
  87. return json;
  88. }
  89. @RequestMapping(value="/patient/search",method=RequestMethod.GET)
  90. public String search(){
  91. return "patient/search";
  92. }
  93. }

药品管理控制层: 

  1. @Controller
  2. public class DrugsController {
  3. @Autowired
  4. DrugsService drugsService;
  5. @RequestMapping("admin/drugsManage")
  6. public String drugsManage(HttpServletRequest request,@RequestParam(value="name",required = false) String name,@RequestParam(value="type",required = false) Integer type){
  7. Drugs drugs=new Drugs();
  8. drugs.setName(name);
  9. drugs.setType(type);
  10. request.setAttribute("drugs",drugsService.getAllDrugs(drugs));
  11. return "/admin/drugsManage";
  12. }
  13. @RequestMapping(value = "/admin/drug/{id}",method = RequestMethod.DELETE)
  14. @ResponseBody
  15. public JSONObject delDrug(@PathVariable Integer id){
  16. JSONObject json=new JSONObject();
  17. json.put("message",drugsService.delDrug(id));
  18. return json;
  19. }
  20. @RequestMapping(value = "/admin/drug",method = RequestMethod.POST)
  21. @ResponseBody
  22. public JSONObject addDrug(@RequestBody Drugs drugs){
  23. JSONObject json=new JSONObject();
  24. json.put("message",drugsService.addDrug(drugs));
  25. return json;
  26. }
  27. @RequestMapping("/admin/drugAdd")
  28. public String drugAddPage(){
  29. return "/admin/add/drugadd";
  30. }
  31. @RequestMapping(value = "/admin/drug/{id}",method = RequestMethod.GET)
  32. public String drugInfo(HttpServletRequest request,@PathVariable Integer id) {
  33. request.setAttribute("drug",drugsService.getDrug(id));
  34. return "/admin/info/drugsinfo";
  35. }
  36. @RequestMapping(value = "/admin/drug",method = RequestMethod.PUT)
  37. @ResponseBody
  38. public JSONObject updateDrug(@RequestBody Drugs drugs) {
  39. JSONObject json=new JSONObject();
  40. json.put("message",drugsService.updateDrug(drugs));
  41. return json;
  42. }
  43. }

 

源码获取:博客首页 "资源" 里下载! 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/734884
推荐阅读
相关标签
  

闽ICP备14008679号