——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明 用户管理(管理员、医生、用户)、宠物管理、预约就诊、预约审核、日常健康管理、医院管理、统计分析等……
技术框架 SpringBoot SpringMVC MyBatis Shiro Thymeleaf HTML JavaScript Layui……
基于javaweb的SpringBoot+MyBatis宠物医院预约管理系统(管理员、医生、用户)(java+springboot+ssm+thymeleaf+html+layui+maven)
——————————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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 * Description: 跳转到页面设置页面 <BR > * * @param model * @return String<BR > */ @RequestMapping("/page") public String page(Model model) { List<Page > pageList = pageService.getAllPage(); model.addAttribute("pageList", pageList); return "sa/page"; } /** * Method name: role <BR > * Description: 跳转到角色设置页面 <BR > * * @param model * @return String<BR > */ @RequestMapping("/role") public String role(Model model) { return "sa/role"; } /** * Method name: getAllRole <BR > * Description: 获取所有权限 <BR > * * @return List<Role > <BR > */ @RequestMapping("/getAllRole") @ResponseBody public List<Role > getAllRole() { return roleService.getAllRole(); } /** * Method name: getAllPage <BR > * Description: 获取所有页面 <BR > * * @return List<Page > <BR > */ @RequestMapping("/getAllPage") @ResponseBody public List<Page > getAllPage() { return pageService.getAllPage(); } /** * Method name: getPageByRole <BR > * Description: 获取某个角色的权限页面 <BR >
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 @RequestMapping("/listDoctor") public String listDoctor () { return "/user/wordListDoctor" ; } @RequestMapping("/publish") public String publish () { return "/user/word" ; } @ResponseBody @RequestMapping("/addWord") public String addWord (Notice notice) { try { notice.setCreateTime(new Date()); notice.setViewCount(0L ); noticeService.add(notice); return "SUCCESS" ; } catch (Exception e) { e.printStackTrace(); return "ERR" ; } } @RequestMapping("/getAllWordByLimit") @ResponseBody public Object getAllWordByLimit (Notice word) { return noticeService.getAllByLimit(word); } @ResponseBody @RequestMapping("/delWord") public String delWord (String[] ids) {
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 } @RequestMapping(value = "/doAdd") @ResponseBody @Transactional public String doAdd (Diagnosis diagnosis) { Subject subject = SecurityUtils.getSubject(); User user = (User) subject.getPrincipal(); try { diagnosis.setDoctorId(user.getId()); diagnosis.setCreateTime(new Date()); diagnosis.setStatus(1 ); diagnosisService.add(diagnosis); return "SUCCESS" ; } catch (Exception e) { logger.error("添加异常" , e); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return "ERROR" ; } } @RequestMapping(value = "/chStatus") @ResponseBody @Transactional public String chStatus (Diagnosis diagnosis) { Subject subject = SecurityUtils.getSubject(); User user = (User) subject.getPrincipal(); try { diagnosis.setDoctorId(user.getId()); diagnosisService.update(diagnosis); return "SUCCESS" ; } catch (Exception e) { logger.error("添加异常" , e);
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 = "/freeTime") public String freeTime (Model model) { List<User> doctors = userService.listDoctor(); model.addAttribute("doctors" , doctors); Long docId = doctors.get(0 ).getId(); model.addAttribute("docName" , doctors.get(0 ).getName()); String nowDateYMD = MyUtils.getNowDateYMD(); List<Map<String, Object>> map = appointmentService.getFreeTimeById(docId, nowDateYMD+MyUtils.START_HOUR); List<String> time = new ArrayList<>(); List<Long> value = new ArrayList<>(); for (Map<String, Object> m : map){ String df = (String) m.get("df" ); time.add(df); Long v = (Long) m.get("c" ); if (v == null ) { value.add(0L ); }else { value.add(v); } } model.addAttribute("time" , time); model.addAttribute("value" , value); return "tj/freeTime" ; } @RequestMapping(value = "/getFreeTime") @ResponseBody public Object getFreeTime (Long id, String date) { User doctors = userService.selectByPrimaryKey(id); Map<String, Object> result = new HashMap<>(); result.put("n" , doctors.getName()); List<Map<String, Object>> map = appointmentService.getFreeTimeById(id, date+MyUtils.START_HOUR); List<String> time = new ArrayList<>(); List<Long> value = new ArrayList<>();
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 FileResponse fileResponse = new FileResponse(); File dest = new File(filePath + fileName); if (!dest.getParentFile().exists()) { dest.getParentFile().mkdirs(); } try { file.transferTo(dest); out = response.getWriter(); String filename = "/file/" + fileName; String s = fileResponse.success(1 , fileName, filename, null ); out.println(s); } catch (IOException e) { String s = fileResponse.error(0 , "上传失败!" ); out.println(s); } } @RequestMapping(value = "/layuiUpload", method = RequestMethod.POST) @ResponseBody public void layuiUpload (MultipartFile file, HttpServletRequest request, HttpServletResponse response) { if (file.isEmpty()) { System.out.println("文件为空空" ); } PrintWriter out=null ; String callback = request.getParameter("CKEditorFuncNum" ); String fileName = file.getOriginalFilename(); String suffixName = fileName.substring(fileName.lastIndexOf("." )); String filePath = "D://upload//" ; fileName = UUID.randomUUID() + suffixName; FileResponse fileResponse = new FileResponse(); File dest = new File(filePath + fileName); if (!dest.getParentFile().exists()) { dest.getParentFile().mkdirs(); } try { file.transferTo(dest); out = response.getWriter(); String filename = "/file/" + fileName; String s = fileResponse.success(1 , fileName, filename, null ); out.println(s);
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 * Description: 批量删除用户 <BR> * * @param ids * @return String<BR> */ @RequestMapping(value = "delUser") @ResponseBody @Transactional public String delUser (Long[] ids) { Subject subject = SecurityUtils.getSubject(); User user = (User) subject.getPrincipal(); try { for (Long id : ids) { if (id.equals(user.getId())) { return "DontOP" ; } userService.delUserById(id); } return "SUCCESS" ; } catch (Exception e) { logger.error("根据用户id更新用户异常" , e); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return "ERROR" ; } } @RequestMapping(value = "/addUserPage") public String addUserPage (Long userId, Model model) { model.addAttribute("manageUser" , userId); if (null != userId) { User user = userService.selectByPrimaryKey(userId); model.addAttribute("manageUser" , user); } return "sa/userAdd" ; }
——————————PayStart——————————
项目链接: https://javayms.github.io?id=021822510504106ae https://javayms.pages.dev?id=021822510504106ae