项目介绍 :
Spring Boot + SpringMVC + MyBatis+ Mysql + druid + Vue 开发的前后端分离的学生成绩管理系统
项目演示: 项目演示地址:https://www.bilibili.com/video/BV1ZK421x7Kk/?vd_source=11ac782881cbade0d1444685d3b0d4df
环境需要:
运行环境: 最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。IDE环境:Eclipse,Myeclipse,IDEA或者Spring Tool Suite都可以数据库:MySql 5.7Maven:3.3以上
技术栈
前端
Vue、Axios、ElementPlus、Vue-Router、Vuex、ECharts
后端
Spring Boot、JWT、MyBatis-Plus、MySQL、Hutool、Redis
功能结构
管理员角色:
首页医生信息管理患者信息管理挂号信息管理药物信息管理检查项目管理病床信息管理排班信息管理数据统计分析
医生角色
首页 今日挂号列表 历史挂号列表 住院申请管理 个人信息查询
患者角色
预约挂号 我的挂号 住院信息
项目预览
登录页
系统展示
部分代码
package com.rabbiter.hospital.controller;
import com.rabbiter.hospital.pojo.Admin;
import com.rabbiter.hospital.pojo.Doctor;
import com.rabbiter.hospital.service.AdminService;
import com.rabbiter.hospital.service.DoctorService;
import com.rabbiter.hospital.service.OrderService;
import com.rabbiter.hospital.service.PatientService;
import com.rabbiter.hospital.utils.JwtUtil;
import com.rabbiter.hospital.utils.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("admin")
public class AdminController {
@Autowired
private AdminService adminService;
@Autowired
private DoctorService doctorService;
@Autowired
private PatientService patientService;
@Autowired
private OrderService orderService;
/**
* 登录数据验证
*/
@PostMapping("/login")
@ResponseBody
public ResponseData login(@RequestParam("aId") int aId, @RequestParam("aPassword") String aPassword) {
Admin admin = this.adminService.login(aId, aPassword);
if (admin != null) {
Map
map.put("aName", admin.getAName());
map.put("aId", String.valueOf(admin.getAId()));
String token = JwtUtil.getToken(map);
map.put("token", token);
return ResponseData.success("登录成功", map);
} else {
return ResponseData.fail("登录失败,密码或账号错误");
}
}
/**
* 分页模糊查询所有医护人员信息
*/
@RequestMapping("findAllDoctors")
public ResponseData findAllDoctors(@RequestParam(value = "pageNumber") int pageNumber, @RequestParam(value = "size") int size, @RequestParam(value = "query") String query){
return ResponseData.success("返回医护人员信息成功", this.doctorService.findAllDoctors(pageNumber, size, query));
}
/**
* 根据id查找医生
*/
@RequestMapping("findDoctor")
public ResponseData findDoctor(@RequestParam(value = "dId") int dId) {
return ResponseData.success("查询医生成功", this.doctorService.findDoctor(dId));
}
/**
* 增加医生信息
*/
@RequestMapping("addDoctor")
@ResponseBody
public ResponseData addDoctor(Doctor doctor) {
Boolean bo = this.doctorService.addDoctor(doctor);
if (bo) {
return ResponseData.success("增加医生信息成功");
}
return ResponseData.fail("增加医生信息失败!账号或已被占用");
}
/**
* 删除医生信息
*/
@RequestMapping("deleteDoctor")
public ResponseData deleteDoctor(@RequestParam(value = "dId") int dId) {
Boolean bo = this.doctorService.deleteDoctor(dId);
if (bo){
return ResponseData.success("删除医生信息成功");
}
return ResponseData.fail("删除医生信息失败");
}
/**
* 修改医生信息
* bug: dState会自动更新为0
*/
@RequestMapping("modifyDoctor")
@ResponseBody
public ResponseData modifyDoctor(Doctor doctor) {
this.doctorService.modifyDoctor(doctor);
return ResponseData.success("修改医生信息成功");
}
/**
* 分页模糊查询所有患者信息
*/
@RequestMapping("findAllPatients")
public ResponseData findAllPatients(@RequestParam(value = "pageNumber") int pageNumber, @RequestParam(value = "size") int size, @RequestParam(value = "query") String query){
return ResponseData.success("返回患者信息成功", this.patientService.findAllPatients(pageNumber, size, query));
}
/**
* 删除患者信息
*/
@RequestMapping("deletePatient")
public ResponseData deletePatient(@RequestParam(value = "pId") int pId) {
Boolean bo = this.patientService.deletePatient(pId);
if (bo){
return ResponseData.success("删除患者信息成功");
}
return ResponseData.fail("删除患者信息失败");
}
/**
* 分页模糊查询所有挂号信息
*/
@RequestMapping("findAllOrders")
public ResponseData findAllOrders(@RequestParam(value = "pageNumber") int pageNumber, @RequestParam(value = "size") int size, @RequestParam(value = "query") String query){
return ResponseData.success("返回挂号信息成功", this.orderService.findAllOrders(pageNumber, size, query));
}
/**
* 删除挂号信息
*/
@RequestMapping("deleteOrder")
public ResponseData deleteOrder(@RequestParam(value = "oId") int oId) {
Boolean bo = this.orderService.deleteOrder(oId);
if (bo){
return ResponseData.success("删除挂号信息成功");
}
return ResponseData.fail("删除挂号信息失败");
}
}
@click="menuClick('patientLayout')" style="font-size: 22px" > 医院管理系统 >
>欢迎您,{{ userName }} >
>
> >退出 >
>
background-color="white" text-color="grey" active-text-color="black" :default-active="activePath" style="font-size: 22px" > index="patientLayout" @click="menuClick('patientLayout')" style="font-size: 20px" > 首页 index="orderOperate" @click="menuClick('orderOperate')" style="font-size: 20px" > 预约挂号 index="myOrder" @click="menuClick('myOrder')" style="font-size: 20px" > 我的挂号 index="myBed" @click="menuClick('myBed')" style="font-size: 20px" > 住院信息 index="patientCard" style="font-size: 20px" @click="menuClick('patientCard')" > class="iconfont icon-r-user2" style="font-size: 22px" > 个人信息
import jwtDecode from "jwt-decode";
import { toLoad } from "@/utils/initialize.js";
import {
getToken,
clearToken,
getActivePath,
setActivePath,
} from "@/utils/storage.js";
export default {
name: "Patient",
data() {
return {
userName: "",
activePath: "",
};
},
methods: {
//token解码
tokenDecode(token) {
if (token !== null) return jwtDecode(token);
},
//导航栏点击事件
menuClick(path) {
this.activePath = path;
setActivePath(path);
if (this.$route.path !== "/" + path) this.$router.push(path);
console.log(path);
},
//退出登录
logout() {
this.$confirm("此操作将退出登录, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
clearToken();
this.$message({
type: "success",
message: "退出登录成功!",
});
this.$router.push("login");
})
.catch(() => {
this.$message({
type: "info",
message: "已取消",
});
});
},
},
mounted() {
toLoad();
},
created() {
// 获取激活路径
this.activePath = getActivePath();
// 解码token
this.userName = this.tokenDecode(getToken()).pName;
},
};
.title {
cursor: pointer;
}
.el-header {
background-color: white;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid lightgrey;
.words {
text-align: center;
span {
color: black;
}
}
}
.el-container {
height: 100%;
}
.el-aside {
background-color: white;
border-right: 1px solid lightgrey;
}
.el-menu {
border: 0;
}
创作不易,源码非无偿提供,需要获取源码的私信博主
文章来源
发表评论