基于javaweb+mysql的ssm医院挂号门诊管理系统(java+ssm+jsp+jquery+layui+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM医院挂号门诊管理系统(java+ssm+jsp+jquery+layui+mysql)
项目介绍
基于SSM的医院门诊挂号系统
角色:管理员、用户、医生
用户登录进入系统可以对主页、个人中心、就诊人建档管理、预约挂号管理、用户退号管理、异常提醒管理、我的收藏管理等功能
管理员登录系统后,可以对主页、个人中心、用户管理、就诊人建档管理、医院介绍管理、科室管理、医生管理、预约挂号管理、用户退号管理、异常提醒管理、留言板、系统管理等功能。
医生登录进入系统可以对主页、个人中心、预约挂号管理、用户退号管理、留言板、系统管理等功能
环境需要
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/8.0等版本均可;
技术栈
后端:SSM(Spring+SpringMVC+Mybatis) 前端:JSP+CSS+JS+JQUERY+Layui
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目; 3. 将项目中db.xml配置文件中的数据库配置改为自己的配置,然后运行;
@RequestMapping(value ="/bannersAdd")
@ResponseBody
public Map<String, Object> bannersAdd(@RequestParam("mf")MultipartFile[] mufile,@RequestParam("id")Integer id) throws IOException{
Map<String, Object> map = new HashMap<String, Object>();
StringBuffer path = new StringBuffer();
//图片上传并保存上传的路径
for (int i = 0; i < mufile.length; i++) {
try {
String random = StringRandom.getRandom();
String filename = mufile[i].getOriginalFilename();
//随机字符+原图片名用作新的图片名
model.addAttribute("sectionList",list);
model.addAttribute("section",section);
model.addAttribute("se",se);
return "admin/sectionBelow";
/**
* 跳转添加科室界面
*/
@RequestMapping("/sectionAddPage")
public String zuopinList() {
return "admin/sectionAdd";
*//**
* 登陆验证
* @return
*//*
@RequestMapping("/verificatio")
public String signin(String username, String password, Integer type, HttpServletRequest request,Model model) {
HttpSession session = request.getSession();
session.setAttribute("type",type);
//类型为1是商户后台 2是管理员
if(type == 1){
private Integer size = 6;//每页显示数量
@Value("${fileUrl}") //在配置文件中获取文件的保存路径
private String filePath;
/**
* 导入
* @param file
* @param response
* @throws IOException
*/
@RequestMapping("/excelInput")
/**
* 修改医生信息
*/
@RequestMapping("/admindoctorUptate")
public String adminUptatePassword(Doctor doctor,Model model) {
if(doctor != null && doctor.getId() != null) {
if(doctor.getSid() != null) {
Section section = sectionService.selectByPrimaryKey(doctor.getSid());
doctor.setSid(section.getId());
doctor.setSname(section.getName());
doctorService.updateByPrimaryKeySelective(doctor);
*//*
@RequestMapping("/verificatio")
public String signin(String username, String password, Integer type, HttpServletRequest request,Model model) {
HttpSession session = request.getSession();
session.setAttribute("type",type);
//类型为1是商户后台 2是管理员
if(type == 1){
Merchant merchant = new Merchant();
merchant.setZhanghao(username);
merchant.setMima(password);
merchant.setState(1);
List<Merchant> merchants = merchantService.selectMerchant(merchant);
*/
@RequestMapping(value ="/bannersAdd")
@ResponseBody
public Map<String, Object> bannersAdd(@RequestParam("mf")MultipartFile[] mufile,@RequestParam("id")Integer id) throws IOException{
Map<String, Object> map = new HashMap<String, Object>();
StringBuffer path = new StringBuffer();
//图片上传并保存上传的路径
for (int i = 0; i < mufile.length; i++) {
try {
String random = StringRandom.getRandom();
String filename = mufile[i].getOriginalFilename();
//随机字符+原图片名用作新的图片名
filename = random+filename;
model.addAttribute("zixun",zixun);
return "behind/admin/zixunList";
*//**
* 资讯下架
* @param model
* @return
*//*
@RequestMapping("/zixunUptate")
public String zixunUptate(Model model,Integer id) {
if(id != null){
* 人物删除
* @param model
* @return
*//*
@RequestMapping("/personDelete")
public String personDelete(Model model,Integer id) {
if(id != null){
Person person = personService.selectByPrimaryKey(id);
//删除人物的图片
//String fp= filePath.substring(filePath.indexOf("/")+1);//文件的真实路径
String name = person.getImg().substring(person.getImg().indexOf("s") + 2); //获取文件名
File file = new File(filePath +name);
if(file.exists()){
* @param model
* @return
*/
@RequestMapping("/doctorUptatePage")
public String doctorUptatePage(Model model,HttpServletRequest request) {
HttpSession session = request.getSession();
Doctor dt = (Doctor) session.getAttribute("DOCTOR");
if(dt != null) {
Doctor doctor = doctorService.selectByPrimaryKey(dt.getId());
List<Section> sectionlist2 = null;
model.addAttribute("doctor",doctor);
//科室
Section se = new Section();
se.setType(1);
public String afterLogin(Integer type,Model model) {
if(type == null){
type = 1;
model.addAttribute("type",type);
return "behind/login";
*//**
* 登陆验证
* @return
*//*
@RequestMapping("/verificatio")
public String signin(String username, String password, Integer type, HttpServletRequest request,Model model) {
type=1;
if(type == 3){
model.addAttribute("type",type);
session.invalidate(); //session销毁
return "loginByPatient";
model.addAttribute("type",type);
session.invalidate(); //session销毁
return "login";
/*
*//**
* 跳转忘记密码界面
*//*
*/
登录控制层:
/**
* 登录控制层
*/
@Controller
@RequestMapping("/login")
public class LoginController {
@Autowired
private AdminService adminService;
@Autowired
if(id != null){
//修改图片路径
Banners sh = bannersService.selectByPrimaryKey(id);
banners.setId(id);
if(sh.getImg() != null ){
banners.setImg(sh.getImg()+path.toString());
}else{
banners.setImg(path.toString());
bannersService.updateByPrimaryKeySelective(banners);
return map;
/*
*//**
* 管理员-非遗讲堂
Section section = new Section();
section.setPid(id);
section.setType(2);
List<Section> list = sectionService.selectByExample(section);
sectionService.deleteByPrimaryKey(id);
for (Section section2 : list) {
sectionService.deleteByPrimaryKey(section2.getId());
return "redirect:/admin/sectionList";
@RequestMapping("/bannersPageUpdate")
public String bannersAdd(Model model,Integer id) {
Banners banners = null;
PageInfo<Doctor> pageInfo = doctorService.selectDoctorList(null,1,4);
if(pageInfo.getList() != null && pageInfo.getList().size() >0 ) {
List<Doctor> list = pageInfo.getList();
StringBuffer sb = new StringBuffer();
StringBuffer shu = new StringBuffer();
int v = list.size()-1;
for(int i=0;i<list.size();i++) {
if(v==i) {
sb.append(list.get(i).getName());
shu.append(list.get(i).getYipeoples());
}else {
sb.append(list.get(i).getName()+",");
Section section = new Section();
section.setPid(id);
section.setType(2);
List<Section> list = sectionService.selectByExample(section);
sectionService.deleteByPrimaryKey(id);
for (Section section2 : list) {
sectionService.deleteByPrimaryKey(section2.getId());
return "redirect:/admin/sectionList";
@RequestMapping("/bannersPageUpdate")
public String bannersAdd(Model model,Integer id) {
filename = random+filename;
//文件保存路径 D:/Java/hospital
File file = new File(filePath+filename);
//判断父级文件是否存在
if (!file.getParentFile().exists()) {
file.getParentFile().mkdir();
path.append("/files/"+filename+",");
mufile[i].transferTo(file);
} catch (IllegalStateException | IOException e) {
e.printStackTrace();
Banners banners = new Banners();
if(id != null){
//修改图片路径