——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明







基于javaweb的SpringBoot医院分诊挂号住院管理系统(java+springboot+freemarker+mysql+maven)
主要实现了从挂号预约到分诊住院出诊等一些列医院基本操作流程的全部功能,系统分医生、患者、管理员三个角色,除基础脚手架外,实现的功能有:
管理员:医生管理、病人管理、科室管理、病房类型管理、病房管理、床位自动生成、统计管理(病人统计、医生出诊统计、总收入统计)等。
患者/病人:登录、修改个人信息、挂号、查看就医信息(挂号、支付记录、住院记录)等。
医生:登录、修改个人信息、出诊叫号、开具药方、安排住院、查看自己出诊记录、查看自己科室医生、设置自己是否可出诊。
运行环境:windows/Linux均可、jdk1.8、mysql5.7、idea/eclipse均可。
——————————CodeStart——————————
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
| } package com.yuanlrc.base.controller.admin;
@Controller @RequestMapping("/statistical") public class StatisticalController { @Autowired private PayServiceService payServices; @Autowired private DoctorService doctorService;
@Autowired private OrderRegistrationService orderRegistrationService;
@Autowired private PatientService patientService;
@Autowired private StatisticalService statisticalService;
@RequestMapping(value = "/list") public String list(Model model) { List<PayService> countMoney = payServices.findAll(); BigDecimal money = new BigDecimal(0.00);
|
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 45 46 47 48 49 50
| } if(Objects.isNull(doctor.getUser().getEmail())){ return Result.error(CodeMsg.ADMIN_PUBLIC_NO_ISEXIST_EMAIL); } if(Objects.isNull(doctor.getUser().getMobile())){ return Result.error(CodeMsg.ADMIN_PUBLIC_NO_ISEXIST_MOBILE); }
if (!StringUtil.emailFormat(doctor.getUser().getEmail())) { return Result.error(CodeMsg.ADMIN_PUBLIC_EMAIL); } if (!StringUtil.isMobile(doctor.getUser().getMobile())) { return Result.error(CodeMsg.ADMIN_PUBLIC_MOBILE); }
Role role = roleService.find(Doctor.DOCTOR_ROLE_ID); String dNo = StringUtil.generateSn(Doctor.PATIENT_ROLE_DNO);
int age = DateUtil.getAge(doctor.getUser().getBirthDay()); if (age < 0) { return Result.error(CodeMsg.ADMIN_PUBLIC_AGE); }
doctor.setDoctorDno(dNo); doctor.getUser().setPassword(dNo); doctor.getUser().setUsername(dNo); doctor.getUser().setRole(role);
User user = doctor.getUser(); user.setAge(age);
User save = userService.save(user); if (userService.save(user) == null) { return Result.error(CodeMsg.ADMIN_USE_ADD_ERROR); } operaterLogService.add("添加用户,用户名:" + user.getUsername()); doctor.setUser(save);
if (doctorService.save(doctor) == null) { return Result.error(CodeMsg.ADMIN_DOCTOR_ADD_EXIST); } return Result.success(true); }
|
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
| return Result.success(true); }
@RequestMapping(value="/editSelf",method=RequestMethod.GET) public String editSelf(Model model,@RequestParam(name="id")Long id){ model.addAttribute("patient", patientService.find(id)); return "admin/patient/editSelf"; }
@RequestMapping(value = "/editSelf", method = RequestMethod.POST) @ResponseBody public Result<Boolean> editSelf(Patient patient){ Patient findPatient = patientService.find(patient.getId()); List<Patient> patients = patientService.findByPatientPno(findPatient.getPatientPno());
if (patients.size() > 1 || patients.size() <= 0) { return Result.error(CodeMsg.ADMIN_PATIENT_PNO_ERROR); }
if (patients.get(0).getId() != patient.getId()) { return Result.error(CodeMsg.ADMIN_PATIENT_PNO_ERROR); } if(Objects.isNull(patient.getUser().getEmail())){ return Result.error(CodeMsg.ADMIN_PUBLIC_NO_ISEXIST_EMAIL); } if(Objects.isNull(patient.getUser().getMobile())){ return Result.error(CodeMsg.ADMIN_PUBLIC_NO_ISEXIST_MOBILE); } if (!StringUtil.emailFormat(patient.getUser().getEmail())){
|
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 45 46 47 48 49
| * 跳转出诊页面 * @param model * @param registrationId * @return */ @RequestMapping(value = "/edit", method = RequestMethod.GET) public String edit(Model model, @RequestParam(name = "id", required = true) Long registrationId) { OrderRegistration orderRegistration = orderRegistrationService.find(registrationId); Department department = orderRegistration.getDepartment(); model.addAttribute("patient", orderRegistration.getPatient()); model.addAttribute("doctors", doctorService.findFreeDoctorByDepartmentId(department.getId())); model.addAttribute("registration", orderRegistration); model.addAttribute("roomTypes", roomTypeService.findList());
return "admin/receiving/edit"; }
@RequestMapping(value = "/edit", method = RequestMethod.POST) @ResponseBody public Result<Boolean> edit(@RequestBody ReceivingDTO dto) {
OrderReceiving orderReceive = dto.getOrderReceive();
CodeMsg validate = ValidateEntityUtil.validate(orderReceive); if (validate.getCode() != CodeMsg.SUCCESS.getCode()) { return Result.error(validate); }
if (Objects.isNull(orderReceive.getDoctor()) || Objects.isNull(orderReceive.getDoctor().getId())) { return Result.error(CodeMsg.ADMIN_ORDER_RECEIVING_DOCTOR_ERROR); }
if (orderReceivingService.findByOrderRegistrationId(orderReceive.getOrderRegistration().getId()) != null) { return Result.error(CodeMsg.ADMIN_ORDER_RECEIVING_EXIST); } List<String> serviceNames = dto.getServiceNames(); List<BigDecimal> money = dto.getMoney();
if (CollectionUtils.isEmpty(money) || CollectionUtils.isEmpty(serviceNames)) { return Result.error(CodeMsg.ADMIN_ORDER_RECEIVING_PAY_EMPTY); }
|
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 45 46 47 48 49 50 51 52 53 54
| return Result.error(CodeMsg.ADMIN_PUBLIC_NO_ISEXIST_MOBILE); } if (!StringUtil.emailFormat(doctor.getUser().getEmail())) { return Result.error(CodeMsg.ADMIN_PUBLIC_EMAIL); } if (!StringUtil.isMobile(doctor.getUser().getMobile())) { return Result.error(CodeMsg.ADMIN_PUBLIC_MOBILE); }
int age = DateUtil.getAge(doctor.getUser().getBirthDay()); if (age < 0) { return Result.error(CodeMsg.ADMIN_PUBLIC_AGE); }
findDoctor.setDepartment(doctor.getDepartment()); findDoctor.setDescription(doctor.getDescription()); findDoctor.setExperience(doctor.getExperience());
User user = doctor.getUser(); user.setAge(age);
BeanUtils.copyProperties(user, findDoctor.getUser(), "id", "createTime", "updateTime", "password", "username", "role");
userService.save(findDoctor.getUser()); doctorService.save(findDoctor);
return Result.success(true); }
@RequestMapping(value = "/delete", method = RequestMethod.POST) @ResponseBody public Result<Boolean> delete(@RequestParam(name = "id", required = true) Long id) { try { Doctor doctor = doctorService.find(id); doctorService.deleteById(id); userService.delete(doctor.getUser().getId()); } catch (Exception e) { return Result.error(CodeMsg.ADMIN_DOCTOR_DELETE_ERROR); } operaterLogService.add("添加用户,用户ID:" + id); return Result.success(true); }
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=231422272105200au
https://javayms.pages.dev?id=231422272105200au