基于javaweb+mysql的ssm医院分诊管理系统(java+ssm+jsp+html+javascript+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM医院分诊管理系统(java+ssm+jsp+html+javascript+mysql)
项目介绍
管理员角色包含以下功能: 管理员登录,用户管理,患者管理,挂号管理,科室管理,分诊叫号管理等功能。
环境需要
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.数据库:MySql 5.7版本;
技术栈
- 后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+jsp
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录
@RequestMapping(value = "/admin/patient",method = RequestMethod.PUT)
@ResponseBody
public JSONObject patientInfo(@RequestBody Patient patient){
JSONObject json=new JSONObject();
json.put("message",patientService.updatePatient(patient));
return json;
@RequestMapping(value = "/admin/patient",method = RequestMethod.POST)
@ResponseBody
public JSONObject delPatient(@RequestBody Patient patient){
JSONObject json=new JSONObject();
json.put("message",patientService.addPatient(patient));
return json;
@RequestMapping(value = "/patient/medicalhistory")
public String patientlist(HttpServletRequest request,@RequestParam(value="name",required = false) String name,@RequestParam(value="certId",required = false) String certId){
request.setAttribute("patients",patientService.getAllPatients(name,certId));
return "admin/patientManage";
@RequestMapping(value = "/admin/patient/{id}",method = RequestMethod.DELETE)
@ResponseBody
public JSONObject delPatient(@PathVariable Integer id){
JSONObject json=new JSONObject();
json.put("message",patientService.delPatient(id));
return json;
@RequestMapping(value = "/admin/patient/{id}",method = RequestMethod.GET)
public String patientInfo(@PathVariable Integer id,HttpServletRequest request){
json.put("message",patientService.delPatient(id));
return json;
@RequestMapping(value = "/admin/patient/{id}",method = RequestMethod.GET)
public String patientInfo(@PathVariable Integer id,HttpServletRequest request){
request.setAttribute("patient",patientService.getPatient(id));
request.setAttribute("appointments",appointmentService.getPatientMessage(id));
request.setAttribute("hospitalizations",hospitalizationService.getPatientMessage(id));
request.setAttribute("doctors",doctorService.getAllDoctor());
return "admin/info/patientinfo";
@RequestMapping(value = "/admin/patientAdd",method = RequestMethod.GET)
public String patientAddPage(){
return "admin/add/patientadd";
return json;
@RequestMapping(value = "/loginout",method = RequestMethod.GET)
public String loginout(HttpSession session){
session.removeAttribute("login");
return "login®ist";
@RequestMapping(value = "/login",method = RequestMethod.POST)
@ResponseBody
public JSONObject login(@RequestBody Login login,HttpSession session){
// 生成登录验证用到的token对象
UsernamePasswordToken token = new UsernamePasswordToken(login.getUsername(), login.getPassword());
Subject subject = SecurityUtils.getSubject();
//登录验证
subject.login(token);
@RequestMapping(value = "/patient/hospitalization")
public String hospitalization(HttpSession session,HttpServletRequest request){
Login login=(Login)session.getAttribute("login");
Patient patient=patientService.findPatientByLoginId(login.getId());
request.setAttribute("theLast",hospitalizationService.findTheLastHospitalization(patient.getHospitalizationid()));
Hospitalization hospitalization=new Hospitalization();
hospitalization.setPatientid(patient.getId());
hospitalization.setId(patient.getHospitalizationid());
request.setAttribute("others",hospitalizationService.findOtherHospitalization(hospitalization));
return "patient/hospitalization";
@RequestMapping(value = "/patient/appointment")
public String appointmentInfo(HttpServletRequest request,HttpSession session){
request.setAttribute("patientid",patient.getId());
request.setAttribute("doctors",doctorService.getAllDoctor());
return "patient/appointment";
@RequestMapping(value = "/patient/appointment",method = RequestMethod.POST)
@ResponseBody
public JSONObject appointment(@RequestBody Appointment appointment){
JSONObject json=new JSONObject();
Patient patient=new Patient();
String message=appointmentService.addAppointment(appointment);
patient.setAppointmentid(appointmentService.selectTheLastAppointment(appointment.getPatientid()));
patient.setId(appointment.getPatientid());
hospitalization.setPatientid(patient.getId());
hospitalization.setId(patient.getHospitalizationid());
request.setAttribute("others",hospitalizationService.findOtherHospitalization(hospitalization));
return "patient/hospitalization";
@RequestMapping(value = "/patient/appointment")
public String appointmentInfo(HttpServletRequest request,HttpSession session){
Login login=(Login)session.getAttribute("login");
Patient patient=patientService.findPatientByLoginId(login.getId());
request.setAttribute("patientid",patient.getId());
request.setAttribute("doctors",doctorService.getAllDoctor());
return "patient/appointment";
DoctorService doctorService;
@Autowired
AppointmentService appointmentService;
@Autowired
HospitalizationService hospitalizationService;
@Autowired
MedicalhistoryService medicalhistoryService;
@RequestMapping("/admin/patientManage")
public String patientlist(HttpServletRequest request,@RequestParam(value="name",required = false) String name,@RequestParam(value="certId",required = false) String certId){
request.setAttribute("patients",patientService.getAllPatients(name,certId));
return "admin/patientManage";
@RequestMapping("/admin/adminManage")
public String adminManage(HttpServletRequest request,@RequestParam(value = "username",required = false)String username){
request.setAttribute("admins",loginService.findAllAdmin(username));
return "/admin/adminManage";
@RequestMapping("/admin/admin/{id}")
public String adminInfo(HttpServletRequest request,@PathVariable Integer id){
request.setAttribute("admin",loginService.getAdmin(id));
return "/admin/info/admininfo";
@RequestMapping("/admin/adminAdd")
public String adminAddPage(){
return"admin/add/adminadd";
@RequestMapping(value = "/admin/admin",method = RequestMethod.POST)
return "admin/add/patientadd";
@RequestMapping(value = "/admin/patient",method = RequestMethod.PUT)
@ResponseBody
public JSONObject patientInfo(@RequestBody Patient patient){
JSONObject json=new JSONObject();
json.put("message",patientService.updatePatient(patient));
return json;
@RequestMapping(value = "/admin/patient",method = RequestMethod.POST)
@ResponseBody
public JSONObject delPatient(@RequestBody Patient patient){
@RequestMapping(value = "/admin/patient/{id}",method = RequestMethod.DELETE)
@ResponseBody
public JSONObject delPatient(@PathVariable Integer id){
JSONObject json=new JSONObject();
json.put("message",patientService.delPatient(id));
return json;
@RequestMapping(value = "/admin/patient/{id}",method = RequestMethod.GET)
public String patientInfo(@PathVariable Integer id,HttpServletRequest request){
request.setAttribute("patient",patientService.getPatient(id));
request.setAttribute("appointments",appointmentService.getPatientMessage(id));
@RequestMapping(value="/patient/search",method=RequestMethod.GET)
public String search(){
return "patient/search";
登录管理控制层:
@Controller
public class LoginController {
@Autowired
LoginService loginService;
@RequestMapping(value = "/hospital/login")
public String loginAndregist(){
return "login®ist";
@RequestMapping("/admin/adminManage")
JSONObject json=new JSONObject();
json.put("message",patientService.updatePatient(patient));
return json;
@RequestMapping(value = "/admin/patient",method = RequestMethod.POST)
@ResponseBody
public JSONObject delPatient(@RequestBody Patient patient){
JSONObject json=new JSONObject();
json.put("message",patientService.addPatient(patient));
return json;
@RequestMapping(value = "/patient/medicalhistory")
public String medicalhistory(HttpSession session,HttpServletRequest request){
Login login=(Login)session.getAttribute("login");
session.removeAttribute("login");
return "login®ist";
@RequestMapping(value = "/login",method = RequestMethod.POST)
@ResponseBody
public JSONObject login(@RequestBody Login login,HttpSession session){
// 生成登录验证用到的token对象
UsernamePasswordToken token = new UsernamePasswordToken(login.getUsername(), login.getPassword());
Subject subject = SecurityUtils.getSubject();
//登录验证
subject.login(token);
String login1 = loginService.login(login);
JSONObject json=new JSONObject();
json.put("message",login1);
JSONObject json=new JSONObject();
json.put("message",patientService.addPatient(patient));
return json;
@RequestMapping(value = "/patient/medicalhistory")
public String medicalhistory(HttpSession session,HttpServletRequest request){
Login login=(Login)session.getAttribute("login");
Patient patient=patientService.findPatientByLoginId(login.getId());
request.setAttribute("medicalhistorys",medicalhistoryService.getMedicalhistoryByPatientId(patient.getId()));
return "patient/medicalhistory";
@RequestMapping(value = "/patient/hospitalization")
public String adminManage(HttpServletRequest request,@RequestParam(value = "username",required = false)String username){
request.setAttribute("admins",loginService.findAllAdmin(username));
return "/admin/adminManage";
@RequestMapping("/admin/admin/{id}")
public String adminInfo(HttpServletRequest request,@PathVariable Integer id){
request.setAttribute("admin",loginService.getAdmin(id));
return "/admin/info/admininfo";
@RequestMapping("/admin/adminAdd")
public String adminAddPage(){
return"admin/add/adminadd";
@RequestMapping(value = "/admin/admin",method = RequestMethod.POST)
@ResponseBody
public JSONObject adminAdd(@RequestBody Login login){
session.removeAttribute("login");
return "login®ist";
@RequestMapping(value = "/login",method = RequestMethod.POST)
@ResponseBody
public JSONObject login(@RequestBody Login login,HttpSession session){
// 生成登录验证用到的token对象
UsernamePasswordToken token = new UsernamePasswordToken(login.getUsername(), login.getPassword());
Subject subject = SecurityUtils.getSubject();
//登录验证
subject.login(token);
String login1 = loginService.login(login);
JSONObject json=new JSONObject();
json.put("message",login1);
patient.setId(appointment.getPatientid());
patientService.updateAppointMent(patient);
json.put("message",message);
return json;
@RequestMapping(value="/patient/search",method=RequestMethod.GET)
public String search(){
return "patient/search";
登录管理控制层:
@Controller
public class LoginController {
@Autowired