文章目录
- 仓库管理系统
- 一、项目演示
- 二、项目介绍
- 三、万字项目文档
- 四、部分功能截图
- 五、部分代码展示
- 六、底部获取项目源码带万字文档(9.9¥带走)
仓库管理系统
一、项目演示
医院管理系统
二、项目介绍
基于springboot+vue的前后端分离医院管理系统
语言: Java 数据库:MySQL 前后端分离
前端技术 : Vue2 + ElementUl
后端技术 : SpringBoot2 + MyBatisPlus + Redis
系统角色:管理员、医生、患者
管理员:登录、医生信息管理、患者信息管理、挂号信息管理、药物信息管理、检查项目管理、病床信息管理、排班信息管理、数据统计分析
医生:登录、首页、今日挂号列表、历史挂号列表、住院申请管理、个人信息查询
患者:注册登录、首页、预约挂号、我的挂号、住院信息、个人信息
三、万字项目文档
四、部分功能截图
五、部分代码展示
package com.bear.hospital.controller;
import com.bear.hospital.pojo.Admin;
import com.bear.hospital.pojo.Doctor;
import com.bear.hospital.service.AdminService;
import com.bear.hospital.service.DoctorService;
import com.bear.hospital.service.OrderService;
import com.bear.hospital.service.PatientService;
import com.bear.hospital.utils.JwtUtil;
import com.bear.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<String,String> map = new HashMap<>();
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("删除挂号信息失败");
}
}
package com.bear.hospital.controller;
import com.bear.hospital.pojo.Bed;
import com.bear.hospital.service.BedService;
import com.bear.hospital.utils.ResponseData;
import com.bear.hospital.utils.TodayUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("bed")
public class BedController {
@Autowired
private BedService bedService;
/**
* 查找所有空床位
*/
@RequestMapping("findNullBed")
public ResponseData findNullBed(){
return ResponseData.success("查找所有空床位成功", this.bedService.findNullBed());
}
/**
* 增加床位信息
*/
@RequestMapping("updateBed")
public ResponseData updateBed(Bed bed) {
if (this.bedService.updateBed(bed))
return ResponseData.success("增加床位成功!");
return ResponseData.fail("增加床位失败!");
}
/**
* 根据pId查询住院
*/
@RequestMapping("findBedByPid")
public ResponseData findBedByPid(@RequestParam(value = "pId") int pId){
return ResponseData.success("根据pId查询住院成功", this.bedService.findBedByPid(pId)) ;
}
/**
* 分页模糊查询所有床位信息
*/
@RequestMapping("findAllBeds")
public ResponseData findAllBeds(int pageNumber, int size, String query){
return ResponseData.success("返回所有床位信息成功", this.bedService.findAllBeds(pageNumber, size, query));
}
/**
* 根据id查找床位
*/
@RequestMapping("findBed")
public ResponseData findBed(int bId){
return ResponseData.success("根据id查找床位成功", this.bedService.findBed(bId));
}
/**
* 增加床位信息
*/
@RequestMapping("addBed")
@ResponseBody
public ResponseData addBed(Bed bed) {
Boolean bo = this.bedService.addBed(bed);
if (bo) {
return ResponseData.success("增加床位信息成功");
}
return ResponseData.fail("增加床位信息失败!床号或已被占用");
}
/**
* 删除药物信息
*/
@RequestMapping("deleteBed")
public ResponseData deleteBed(@RequestParam(value = "bId") int bId) {
Boolean bo = this.bedService.deleteBed(bId);
if (bo){
return ResponseData.success("删除床位信息成功");
}
return ResponseData.fail("删除床位信息失败");
}
/**
* 清空床位信息
*/
@RequestMapping("emptyBed")
public ResponseData emptyBed(int bId){
if(this.bedService.emptyBed(bId))
return ResponseData.success("清空床位信息成功");
return ResponseData.fail("清空床位信息失败");
}
/**
* 统计今天挂号人数
*/
@RequestMapping("bedPeople")
public ResponseData bedPeople(){
String bStart = TodayUtil.getTodayYmd();
return ResponseData.success("统计今天住院人数成功", this.bedService.bedPeople(bStart));
}
}
package com.bear.hospital.controller;
import com.bear.hospital.pojo.Doctor;
import com.bear.hospital.service.DoctorService;
import com.bear.hospital.service.OrderService;
import com.bear.hospital.service.PatientService;
import com.bear.hospital.utils.JwtUtil;
import com.bear.hospital.utils.ResponseData;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("doctor")
public class DoctorController {
@Autowired
private DoctorService doctorService;
@Autowired
private OrderService orderService;
@Autowired
private PatientService patientService;
/**
* 登录数据验证
*/
@RequestMapping(value = "login", method = RequestMethod.POST)
@ResponseBody
public ResponseData login(@RequestParam(value = "dId") int dId, @RequestParam(value = "dPassword") String dPassword) {
Doctor doctor = this.doctorService.login(dId, dPassword);
if (doctor != null) {
Map<String,String> map = new HashMap<>();
map.put("dName", doctor.getdName());
map.put("dId", String.valueOf(doctor.getdId()));
String token = JwtUtil.getToken(map);
map.put("token", token);
//response.setHeader("token", token);
return ResponseData.success("登录成功", map);
} else {
return ResponseData.fail("登录失败,密码或账号错误");
}
}
/**
* 查看当天挂号列表
*/
@RequestMapping("findOrderByNull")
public ResponseData findOrderByNull(@Param(value = "dId") int dId, @RequestParam(value = "oStart") String oStart){
System.out.println("账号时间为"+dId+oStart);
return ResponseData.success("返回当天挂号信息成功", this.orderService.findOrderByNull(dId,oStart));
}
/**
* 根据患者id查询患者信息
*/
@RequestMapping("findPatientById")
public ResponseData findPatientById(int pId){
return ResponseData.success("返回患者信息成功!", this.patientService.findPatientById(pId));
}
/**
* 分页根据科室查询所有医生信息
*/
@RequestMapping("findDoctorBySectionPage")
public ResponseData findDoctorBySectionPage(int pageNumber, int size, String query, String arrangeDate, String dSection){
return ResponseData.success("分页根据科室查询所有医生信息成功", this.doctorService.findDoctorBySectionPage(pageNumber, size, query, arrangeDate, dSection));
}
/**
* 用户评价
*/
@RequestMapping("updateStar")
public ResponseData updateStar(int dId, Double dStar){
if(this.doctorService.updateStar(dId, dStar))
return ResponseData.success("评价成功");
return ResponseData.fail("评价失败");
}
/**
* 上传Excel导入数据
*/
@RequestMapping(value = "uploadExcel", method = RequestMethod.POST)
@ResponseBody
public ResponseData uploadExcel(@RequestParam("file") MultipartFile multipartFile) throws Exception {
if (this.doctorService.uploadExcel(multipartFile))
return ResponseData.success("上传Excel导入数据成功");
return ResponseData.fail("上传Excel导入数据失败");
}
/**
* Excel导出数据
*/
@RequestMapping("downloadExcel")
public ResponseData downloadExcel(HttpServletResponse response) throws IOException {
if (this.doctorService.downloadExcel(response))
return ResponseData.success("Excel导出数据成功");
return ResponseData.fail("Excel导出数据失败");
}
}
package com.bear.hospital.controller;
import com.bear.hospital.pojo.Orders;
import com.bear.hospital.service.OrderService;
import com.bear.hospital.utils.ResponseData;
import com.bear.hospital.utils.TodayUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
@RestController
@RequestMapping("order")
public class OrderController {
@Autowired
private OrderService orderService;
/**
* 根据id更新挂号信息
*/
@PostMapping("updateOrder")
@ResponseBody
public ResponseData updateOrder(@RequestBody Orders orders) {
if (this.orderService.updateOrder(orders))
return ResponseData.success("更新挂号信息成功");
return ResponseData.fail("更新挂号信息失败!");
}
/**
* 根据id设置缴费状态
*/
@RequestMapping("updatePrice")
public ResponseData updatePrice(int oId){
if (this.orderService.updatePrice(oId))
return ResponseData.success("根据id设置缴费状态成功");
return ResponseData.success("根据id设置缴费状态失败");
}
/**
* 查找医生已完成的挂号单
*/
@RequestMapping("findOrderFinish")
public ResponseData findOrderFinish(int pageNumber, int size, String query, int dId){
return ResponseData.success("查找医生已完成的挂号单完成!", this.orderService.findOrderFinish(pageNumber, size, query, dId));
}
/**
* 根据dId查询挂号
*/
@RequestMapping("findOrderByDid")
public ResponseData findOrderByDid(int pageNumber, int size, String query, int dId){
return ResponseData.success("返回挂号信息成功", this.orderService.findOrderByDid(pageNumber, size, query, dId)) ;
}
/**
* 统计今天挂号人数
*/
@RequestMapping("orderPeople")
public ResponseData oderPeople(){
String oStart = TodayUtil.getTodayYmd();
return ResponseData.success("统计今天挂号人数成功", this.orderService.orderPeople(oStart));
}
/**
* 统计今天某个医生挂号人数
*/
@RequestMapping("orderPeopleByDid")
public ResponseData orderPeopleByDid(int dId){
String oStart = TodayUtil.getTodayYmd();
return ResponseData.success("统计今天挂号人数成功", this.orderService.orderPeopleByDid(oStart, dId));
}
/**
* 获取过去七天的挂号人数
*/
@RequestMapping("orderSeven")
public ResponseData orderSeven(){
ArrayList<Integer> list = new ArrayList<>();
String oStart = null;
for(int i = 20; i > 0;i--){
oStart = TodayUtil.getPastDate(i);
int people = this.orderService.orderPeople(oStart);
list.add(people);
}
return ResponseData.success("获取过去20天的挂号人数成功", list);
}
/**
* 统计挂号男女人数
*/
@RequestMapping("orderGender")
public ResponseData orderGender(){
return ResponseData.success("统计挂号男女人数", this.orderService.orderGender());
}
/**
* 增加诊断及医生意见
*/
@PostMapping("updateOrderByAdd")
@ResponseBody
public ResponseData updateOrderByAdd(@RequestBody Orders order){
if (this.orderService.updateOrderByAdd(order))
return ResponseData.success("增加诊断及医生意见成功");
return ResponseData.fail("增加诊断及医生意见失败");
}
/**
* 判断诊断之后再次购买药物是否已缴费
*/
@RequestMapping("findTotalPrice")
public ResponseData findTotalPrice(int oId){
if(this.orderService.findTotalPrice(oId))
return ResponseData.success("未缴费");
return ResponseData.fail("无需缴费");
}
/**
* 请求挂号时间段
*/
@RequestMapping("findOrderTime")
public ResponseData findOrderTime(String arId){
return ResponseData.success("请求挂号时间段成功", this.orderService.findOrderTime(arId));
}
/**
* 统计过去20天挂号科室人数
*/
@RequestMapping("orderSection")
public ResponseData orderSection(){
return ResponseData.success("统计过去20天挂号科室人数成功", this.orderService.orderSection());
}
}
六、底部获取项目源码带万字文档(9.9¥带走)
有问题,或者需要协助调试运行项目的也可以