当前位置:   article > 正文

Java项目:医院管理系统(java+SSM+JSP+bootstrap+jQuery+mysql)_hospital-admin-system.sql java

hospital-admin-system.sql 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. 后端:Spring SpringMVC MyBatis
2. 前端:JSP+bootstrap+jQuery


使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行;
3. 将项目中applicationContext.xml配置文件中的数据库配置改为自己的配置;
4. 运行项目,输入localhost:8080/yygl 登录 注:tomcat中配置的路径必须为/yygl,否则会引起错误;

 

 

 

 

 

 

医生管理控制层:

  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 HospitalizationController {
  3. @Autowired
  4. HospitalizationService hospitalizationService;
  5. @Autowired
  6. PatientService patientService;
  7. @RequestMapping("/admin/hospitalizationManage")
  8. public String hospitalizationManage(HttpServletRequest request,@RequestParam(value = "patientname",required = false)String patientname,@RequestParam(value = "intime",required = false)String intime){
  9. request.setAttribute("hospitalizations",hospitalizationService.getAllHospitalizations(patientname,intime));
  10. return "admin/hospitalizationManage";
  11. }
  12. @RequestMapping("/admin/hospitalizationAdd")
  13. public String hospitalizationAddPage(HttpServletRequest request){
  14. request.setAttribute("patients",patientService.getAllPatients());
  15. return"admin/add/hospitalizationadd";
  16. }
  17. @RequestMapping(value = "/admin/hospitalization",method = RequestMethod.POST)
  18. @ResponseBody
  19. public JSONObject hospitalizationAdd(@RequestBody Hospitalization hospitalization){
  20. JSONObject json=new JSONObject();
  21. json.put("message",hospitalizationService.AddHospitalization(hospitalization));
  22. return json;
  23. }
  24. @RequestMapping(value = "/admin/hospitalization/{id}",method = RequestMethod.DELETE)
  25. @ResponseBody
  26. public JSONObject delHospitalization(@PathVariable Integer id){
  27. JSONObject json=new JSONObject();
  28. json.put("message",hospitalizationService.deleteHospitalization(id));
  29. return json;
  30. }
  31. @RequestMapping(value = "/admin/hospitalization/{id}",method = RequestMethod.GET)
  32. public String hospitalizationInfo(HttpServletRequest request,@PathVariable Integer id){
  33. request.setAttribute("h",hospitalizationService.getHospitalization(id));
  34. request.setAttribute("patients",patientService.getAllPatients());
  35. return"admin/info/hospitalizationinfo";
  36. }
  37. @RequestMapping(value = "/admin/hospitalization",method = RequestMethod.PUT)
  38. @ResponseBody
  39. public JSONObject delHospitalization(@RequestBody Hospitalization hospitalization){
  40. JSONObject json=new JSONObject();
  41. json.put("message",hospitalizationService.updateHospitalization(hospitalization));
  42. return json;
  43. }
  44. //生成user表excel
  45. @GetMapping(value = "/admin/getHospitalization")
  46. public String getUser(HttpServletResponse response) throws Exception{
  47. HSSFWorkbook workbook = new HSSFWorkbook();
  48. HSSFSheet sheet = workbook.createSheet("统计表");
  49. ExcelUtils.createTitle(workbook,sheet);
  50. List<Hospitalization> rows = hospitalizationService.getAllHospitalizations();
  51. //设置日期格式
  52. HSSFCellStyle style = workbook.createCellStyle();
  53. style.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy h:mm"));
  54. //新增数据行,并且设置单元格数据
  55. int rowNum=1;
  56. for(Hospitalization hospitalization:rows){
  57. HSSFRow row = sheet.createRow(rowNum);
  58. row.createCell(0).setCellValue(rowNum);
  59. row.createCell(1).setCellValue(hospitalization.getFloor());
  60. row.createCell(2).setCellValue(hospitalization.getBed());
  61. row.createCell(3).setCellValue(hospitalization.getDoor());
  62. row.createCell(4).setCellValue(hospitalization.getMedicalname());
  63. row.createCell(5).setCellValue(hospitalization.getPatientname());
  64. HSSFCell cell1 = row.createCell(6);
  65. HSSFCell cell2 = row.createCell(7);
  66. cell1.setCellValue(hospitalization.getIntime());
  67. cell2.setCellValue(hospitalization.getOuttime());
  68. cell1.setCellStyle(style);
  69. cell2.setCellStyle(style);
  70. rowNum++;
  71. }
  72. String fileName = "住院信息.xls";
  73. //生成excel文件
  74. //ExcelUtils.buildExcelFile(fileName, workbook);
  75. //浏览器下载excel
  76. ExcelUtils.buildExcelDocument(fileName,workbook,response);
  77. return "download excel";
  78. }
  79. }

药品管理控制层:

  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】
推荐阅读
相关标签
  

闽ICP备14008679号