基于javaweb的SSM医院挂号预约管理系统(java+ssm+html+javascript+jsp+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

210023132402

230023132402

240023132402

250023132402

260023132402

270023132402

280023132402

290023132402

基于javaweb的SSM医院挂号预约管理系统(java+ssm+html+javascript+jsp+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版本;

技术栈

  1. 后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+jsp

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26



@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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
		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();
}
}
}

}
package com.starry.web;




@Controller
@RequestMapping("/")
public class DepartmentController {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
	// 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);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
}

@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) {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
	}

@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";
}
}
/*package com.starry.springvc;





@Controller
public class HelloWorld {
@RequestMapping("/helloworld")
public String hello(@RequestParam("name") String username,
@RequestParam("pwd") String password,Model model){
System.out.println("hello world");

if(username.equals("qin")&&password.equals("123")){
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

@Controller
@RequestMapping("/json")
public class UserJsonController {
@Autowired
private IDoctorService doctorService;
@Autowired
private IUserService userService;
@Autowired
private IDepartmentService departmentService;

public IDepartmentService getDepartmentService() {
return departmentService;
}

public void setDepartmentService(IDepartmentService departmentService) {
this.departmentService = departmentService;
}

public void setUserService(IUserService userService) {
this.userService = userService;
}
public IUserService getUserService() {
return userService;
}

public IDoctorService getDoctorService() {
return doctorService;
}

public void setDoctorService(IDoctorService doctorService) {
this.doctorService = doctorService;
}




项目链接:
https://javayms.github.io?id=241422272105200av
https://javayms.pages.dev?id=241422272105200av