作者主页:夜未央5788

简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

本系统共分为三个角色:系统管理员、医生、用户

管理员角色包含以下功能:

管理员登录,用户信息管理,页面菜单管理,角色管理,宠物信息管理,宠物治疗记录管理,预约管理,查看健康指南,查看医生预约时间,查看宠物健康分析表,查看预约数量统计,宠物日志管理,查看宠物日志图表,发布指南,标准制定管理,指南列表管理等功能。

医生角色包含以下功能:

医生登录,宠物治疗记录管理,预约信息管理,查看医生预约时间,发布指南,制定标准,查看指南列表等功能。

用户角色包含以下功能:

用户登录,宠物信息管理,查看医生预约时间,查看健康指南,查看宠物健康分析,查看宠物健康标准,查看宠物日志,查看预约数量统计,查看宠物日志图表等功能。

使用人群:
正在做毕设的学生,或者需要项目实战练习的Java学习者

环境需要

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.数据库:MySql 8.0/5.7版本;
6.是否Maven项目:是;

技术栈

springboot、mybatis、jsp

运行说明

1. 使用Navicat或者其它工具,在mysql中创建数据库并执行phms.sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中application.properties配置文件中的数据库配置改为自己的配置,包括数据库名称、用户名、密码等;
4. 此为springboot项目,无需将项目添加到tomcat中,直接在main方法中运行。

5. 运行成功后,在浏览器中访问http://localhost:8086/

运行截图

相关代码

管理员权限控制类

/*** 管理员权限控制类*/
@Controller("Admin")
@RequestMapping("/admin")
public class Adminontroller {@Autowiredprivate PageService pageService;@Autowiredprivate RoleService roleService;@Autowiredprivate PageRoleService pageRoleService;@Autowiredprivate UserRoleService userRoleService;@Autowiredprivate UserService userService;private final Logger logger = LoggerFactory.getLogger(Adminontroller.class);/*** Method name: page <BR>* 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")@ResponseBodypublic List<Role> getAllRole() {return roleService.getAllRole();}/*** Method name: getAllPage <BR>* Description: 获取所有页面 <BR>* * @return List<Page><BR>*/@RequestMapping("/getAllPage")@ResponseBodypublic List<Page> getAllPage() {return pageService.getAllPage();}/*** Method name: getPageByRole <BR>* Description: 获取某个角色的权限页面 <BR>*/@RequestMapping("/getPageByRole")@ResponseBodypublic Object getPageByRole(Integer roleId) {return pageService.getAllPageByRoleId(roleId);}/*** Method name: updatePageById <BR>* Description: 根据页面id更新页面 <BR>* * @param page* @return ResultMap<BR>*/@RequestMapping("/updatePageById")@ResponseBodypublic ResultMap updatePageById(Page page) {return pageService.updatePageById(page);}/*** Method name: addPage <BR>* Description: 添加页面 <BR>* * @param page* @return Page<BR>*/@RequestMapping("/addPage")@ResponseBodypublic Page addPage(Page page) {return pageService.addPage(page);}/*** Method name: delPageById <BR>* Description: 根据页面id删除页面 <BR>* * @param id* @return ResultMap<BR>*/@RequestMapping("/delPageById")@ResponseBodypublic ResultMap delPageById(Integer id) {if (null == id) {return new ResultMap().fail().message("参数错误");}return pageService.delPageById(id);}/*** Method name: addRole <BR>* Description: 增加角色 <BR>* * @param name* @return String<BR>*/@RequestMapping("/addRole")@ResponseBodypublic String addRole(String name) {return roleService.addRole(name);}/*** Method name: delManageRole <BR>* Description: 根据角色id删除角色 <BR>* * @param id* @return String<BR>*/@RequestMapping("/delRole")@ResponseBodypublic String delRole(int id) {// 删除角色boolean flag1 = roleService.delRoleById(id);// 删除角色_权限表boolean flag2 = pageRoleService.delPageRoleByRoleId(id);// 删除某个角色的所有用户boolean flag3 = userRoleService.delUserRoleByRoleId(id);if (flag1 && flag2 && flag3) {return "SUCCESS";}return "ERROR";}/*** Method name: updateRole <BR>* Description: 根据权限id修改权限信息 <BR>* * @param id* @param name* @return String<BR>*/@RequestMapping("/updateRole")@ResponseBodypublic String updateRole(Integer id, String name) {int n = roleService.updateRoleById(id, name);if (n != 0) {return "SUCCESS";}return "ERROR";}/*** Method name: addPageRoleByRoleId <BR>* Description: 增加某个角色的权限页面 <BR>* * @param roleId* @param pageIds* @return String<BR>*/@RequestMapping("/addPageRoleByRoleId")@ResponseBodypublic String addPageRoleByRoleId(Integer roleId, Integer[] pageIds) {if (null == roleId) {return "ERROR";}// 先删除老的权限boolean flag1 = pageRoleService.delPageRoleByRoleId(roleId);boolean flag2 = pageRoleService.addPageRoles(roleId, pageIds);if (flag1 && flag2) {return "SUCCESS";}return "ERROR";}/*** Method name: getAllUserByMap <BR>* Description: 根据角色查询下面所有的人员/非角色下所有人员 <BR>*/@RequestMapping("/getAllUserByRoleId")@ResponseBodypublic Object getAllUserByRoleId(Integer roleId, String roleNot, Integer page, Integer limit) {if (null == roleNot) {return userService.getAllUserByRoleId(roleId, page, limit);}return userService.getAllUserByNotRoleId(roleId, page, limit);}/*** Method name: delUserRoleByUserIdAndRoleId <BR>* Description: 根据用户id权限id删除用户权限表 <BR>* * @param userId* @param roleId* @return ResultMap<BR>*/@RequestMapping("/delUserRoleByUserIdAndRoleId")@ResponseBodypublic ResultMap delUserRoleByUserIdAndRoleId(String userId, Integer roleId) {return userRoleService.delUserRoleByUserIdAndRoleId(userId, roleId);}/*** Method name: selectUserRole <BR>* Description: 跳转到选择用户角色页面 <BR>* * @return String<BR>*/@RequestMapping("/selectUserRole")public String selectUserRole() {return "sa/selectUserRole";}/*** Method name: addUserRole <BR>* Description: 增加用户的角色 <BR>* * @param roleId* @param userIds* @return String<BR>*/@RequestMapping("/addUserRole")@ResponseBodypublic String addUserRole(Integer roleId, String[] userIds) {return userRoleService.addUserRole(roleId, userIds);}/*** Method name: userAddPage <BR>* Description: 用户添加页面 <BR>* * @return String<BR>*/@RequestMapping(value = "/userAddPage")public String userAddPage() {return "sa/userAdd";}/*** Method name: userPage <BR>* Description: 用户管理页面 <BR>* * @return String<BR>*/@RequestMapping(value = "/userPage")public String userPage() {return "sa/userList";}/*** Method name: getAllUserByLimit <BR>* Description: 根据条件获取所有用户 <BR>* * @param userParameter* @return Object<BR>*/@RequestMapping("/getAllUserByLimit")@ResponseBodypublic Object getAllUserByLimit(UserParameter userParameter) {return userService.getAllUserByLimit(userParameter);}/*** Method name: getAllDelUserByLimit <BR>* Description: 获取所有删除用户 <BR>* * @param userParameter* @return Object<BR>*/@RequestMapping("/getAllDelUserByLimit")@ResponseBodypublic Object getAllDelUserByLimit(UserParameter userParameter) {return userService.getAllDelUserByLimit(userParameter);}/*** Method name: delUser <BR>* Description: 批量删除用户 <BR>* * @param ids* @return String<BR>*/@RequestMapping(value = "delUser")@ResponseBody@Transactionalpublic 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";}}/*** Method name: addUserPage <BR>* Description: 增加用户界面 <BR>* * @return String<BR>*/@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";}/*** Method name: checkUserId <BR>* Description: 检测用户账号是否存在 <BR>* * @param userId* @return User<BR>*/@ResponseBody@RequestMapping("/checkUserId")public User checkUserId(Long userId) {return userService.selectByPrimaryKey(userId);}/*** Method name: addUser <BR>* Description: 用户添加 <BR>* * @param user* @return String<BR>*/@ResponseBody@RequestMapping("/addUser")public String addUser(User user) {try {user.setPassword(MD5.md5(user.getPassword()));user.setCreateTime(new Date());userService.addUser(user);User u = userService.getUserByPhoneAndName(user.getPhone(), user.getName());String[] ids = new String[1];ids[0] = u.getId()+"";// 医生角色userRoleService.addUserRole(3, ids);return "SUCCESS";} catch (Exception e) {return "ERR";}}/*** Method name: updateUser <BR>* Description: 更新用户 <BR>* * @param user* @return String<BR>*/@ResponseBody@RequestMapping("/updateUser")public String updateUser(User user, Long oldId) {return userService.updateUser(oldId, user);}/*** Method name: delUserPage <BR>* Description: 已删除用户列表 <BR>* * @return String<BR>*/@RequestMapping("/delUserPage")public String delUserPage() {return "sa/userDelPage";}
}

登录控制类

/*** 登录控制类*/
@Controller("OpenLogin")
@RequestMapping()
public class LoginController {@Autowiredprivate ResultMap resultMap;@Autowiredprivate UserService userService;@Autowiredprivate PageService pageService;@Autowiredprivate UserRoleService userRoleService;private final Logger logger = LoggerFactory.getLogger(LoginController.class);/*** 返回 尚未登陆信息*/@RequestMapping(value = "/notLogin", method = RequestMethod.GET)@ResponseBodypublic ResultMap notLogin() {logger.warn("尚未登陆!");return resultMap.success().message("您尚未登陆!");}/*** 返回 没有权限*/@RequestMapping(value = "/notRole", method = RequestMethod.GET)@ResponseBodypublic ResultMap notRole() {Subject subject = SecurityUtils.getSubject();User user = (User) subject.getPrincipal();if (user != null) {logger.info("{}---没有权限!", user.getName());}return resultMap.success().message("您没有权限!");}
/**演示页面**/@RequestMapping(value = "/demo/table", method = RequestMethod.GET)public String demoTable() {return "table";}@RequestMapping(value = "/demo/tu", method = RequestMethod.GET)public String demoTu() {return "tu";}@RequestMapping(value = "/demo/tu1", method = RequestMethod.GET)public String tu1() {return "tu1";}@RequestMapping(value = "/demo/tu2", method = RequestMethod.GET)public String tu2() {return "tu2";}@RequestMapping(value = "/demo/tu3", method = RequestMethod.GET)public String tu3() {return "tu3";}
/**演示页面**//*** Method name: logout <BR>* Description: 退出登录 <BR>* @return String<BR>*/@RequestMapping(value = "/logout", method = RequestMethod.GET)public String logout() {Subject subject = SecurityUtils.getSubject();User user = (User) subject.getPrincipal();if (null != user) {logger.info("{}---退出登录!", user.getName());}subject.logout();return "login";}/*** Method name: login <BR>* Description: 登录验证 <BR>* Remark: <BR>* * @param username 用户名* @param password 密码* @return ResultMap<BR>*/@RequestMapping(value = "/login")@ResponseBodypublic ResultMap login(String username, String password) {return userService.login(username, password);}/*** Method name: login <BR>* Description: 登录页面 <BR>* * @return String login.html<BR>*/@RequestMapping(value = "/index")public String login() {return "login";}/*** 注册页面 regist.html*/@RequestMapping(value = "/regist")public String regist() {return "regist";}/*** 注册*/@RequestMapping(value = "/doRegist")@ResponseBodypublic ResultMap doRegist(User user) {System.out.println(user);User u = userService.getUserByPhoneAndName(user.getPhone(), null);if (u != null){return resultMap.success().message("该手机号已注册!");}try {user.setPassword(MD5.md5(user.getPassword()));user.setCreateTime(new Date());userService.save(user);String[] ids = new String[1];ids[0] = user.getId()+"";// 普通用户userRoleService.addUserRole(2, ids);return resultMap.success().message("注册成功");}catch (Exception e){e.printStackTrace();return resultMap.fail().message("注册失败");}}/*** Method name: index <BR>* Description: 登录页面 <BR>* * @return String login.html<BR>*/@RequestMapping(value = "/")public String index(Model model) {Subject subject = SecurityUtils.getSubject();User user = (User) subject.getPrincipal();if (null != user) {model.addAttribute("user", user);List<Page> pageList = pageService.getAllRolePageByUserId(user.getId()+"");model.addAttribute("pageList", pageList);return "index";} else {return "login";}}/*** Method name: main <BR>* Description: 进入主页面 <BR>* index.html*/@RequestMapping(value = "/main")public String main(Model model) {Subject subject = SecurityUtils.getSubject();User user = (User) subject.getPrincipal();if (null != user) {model.addAttribute("user", user);} else {return "login";}List<Page> pageList = pageService.getAllRolePageByUserId(user.getId()+"");model.addAttribute("pageList", pageList);return "index";}/*** Method name: checkUserPassword <BR>* Description: 检测旧密码是否正确 <BR>* * @param password 旧密码* @return boolean 是否正确<BR>*/@RequestMapping(value = "/user/checkUserPassword")@ResponseBodypublic boolean checkUserPassword(String password) {return userService.checkUserPassword(password);}/*** Method name: updatePassword <BR>* Description: 更新密码 <BR>* * @param password 旧密码* @return String 是否成功<BR>*/@RequestMapping(value = "/user/updatePassword")@ResponseBodypublic String updatePassword(String password) {return userService.updatePassword(password);}
}

健康评估控制类

/*** 健康评估*/
@Controller("HealthController")
@RequestMapping("/health")
public class HealthController {@Autowiredprivate DiagnosisService diagnosisService;@Autowiredprivate AppointmentService appointmentService;@Autowiredprivate PetService petService;@Autowiredprivate PetDailyService petDailyService;@Autowiredprivate UserService userService;@Autowiredprivate StandardService standardService;/*** 分析页面*/@RequestMapping("/assess")public String applyListDoctor(Model model) {Subject subject = SecurityUtils.getSubject();User user = (User) subject.getPrincipal();Pet pet = new Pet();pet.setUserId(user.getId());pet.setPage(1);pet.setLimit(100);MMGridPageVoBean<Pet> voBean = (MMGridPageVoBean<Pet>) petService.getAllByLimit(pet);List<Pet> rows = voBean.getRows();// 获取到该用户下所有的宠物model.addAttribute("pets", rows);List<Long> applyCount = new ArrayList<>();List<String> dsCount = new ArrayList<>();List<String> tsCount = new ArrayList<>();List<String> wsCount = new ArrayList<>();List<String> hsCount = new ArrayList<>();List<String> asCount = new ArrayList<>();List<Double> pt = new ArrayList<>();List<Double> pw = new ArrayList<>();List<Double> ph = new ArrayList<>();List<Double> pa = new ArrayList<>();List<Double> mt = new ArrayList<>();List<Double> mw = new ArrayList<>();List<Double> mh = new ArrayList<>();List<Double> ma = new ArrayList<>();for(Pet p: rows){// 获取预约次数Appointment appointment = new Appointment();appointment.setPetId(p.getId());appointment.setPage(1);appointment.setLimit(1000);MMGridPageVoBean<Appointment>  as = (MMGridPageVoBean<Appointment>) appointmentService.getAllByLimit(appointment);applyCount.add(as==null? 0L : as.getTotal());// 获取就诊记录Diagnosis diagnosis = new Diagnosis();diagnosis.setPetId(p.getId());diagnosis.setPage(1);diagnosis.setLimit(10);MMGridPageVoBean<Diagnosis>  ds = (MMGridPageVoBean<Diagnosis>) diagnosisService.getAllByLimit(diagnosis);List<Diagnosis> dsRows = ds.getRows();int diagnosisStatus = 0;for (Diagnosis d: dsRows){diagnosisStatus += d.getStatus();}int sw = diagnosisStatus / dsRows.size();switch (sw){case 1:dsCount.add(p.getName() + "  宠物健康,请继续保持");break;case 2:dsCount.add(p.getName() + "  宠物异常请及时就诊!");break;case 3:dsCount.add(p.getName() + "  宠物病情比较严重,请及时就医!");break;case 4:dsCount.add(p.getName() + "  很抱歉宠物已无法治疗!");break;default:dsCount.add(p.getName() + "  宠物基本健康,请继续保持");break;}// 获取宠物日志PetDaily petDaily = new PetDaily();petDaily.setPetId(p.getId());petDaily.setPage(1);petDaily.setLimit(10);MMGridPageVoBean<PetDaily>  ps = (MMGridPageVoBean<PetDaily>) petDailyService.getAllByLimit(petDaily);List<PetDaily> psRows = ps.getRows();double t = 0;double w = 0;double h = 0;double a = 0;for (PetDaily petDaily1 : psRows){t+=petDaily1.getTemperature();w+=petDaily1.getWeight();h+=petDaily1.getHeight();a+=petDaily1.getAppetite();}t = t/psRows.size();w = w/psRows.size();h = h/psRows.size();a = a/psRows.size();pt.add(t);pw.add(w);ph.add(h);pa.add(a);// 获取标准Standard standard = new Standard();// 对应宠物类型standard.setType(p.getType());// 健康标准standard.setStatus(1);int petAge = MyUtils.get2DateDay(MyUtils.getDate2String(p.getBirthday(), "yyyy-MM-dd"), MyUtils.getDate2String(new Date(), "yyyy-MM-dd"));petAge = (petAge<0? -petAge : petAge)/365;// 年龄standard.setAgeMax(petAge);standard.setPage(1);standard.setLimit(100);MMGridPageVoBean<Standard>  ss = (MMGridPageVoBean<Standard>) standardService.getAllByLimit(standard);List<Standard> ssRows = ss.getRows();double tsMin = 0;double tsMax = 0;double wsMin = 0;double wsMax = 0;double hsMin = 0;double hsMax = 0;double asMin = 0;double asMax = 0;for (Standard s : ssRows){tsMin+=s.getTempMin();tsMax+=s.getTempMax();wsMin+=s.getWeightMin();wsMax+=s.getWeightMax();hsMin+=s.getHeightMin();hsMax+=s.getHeightMax();asMin+=s.getAppetiteMin();asMax+=s.getAppetiteMax();}tsMin = tsMin / ssRows.size();tsMax = tsMax / ssRows.size();wsMin = wsMin / ssRows.size();wsMax = wsMax / ssRows.size();hsMin = hsMin / ssRows.size();hsMax = hsMax / ssRows.size();asMin = asMin / ssRows.size();asMax = asMax / ssRows.size();mt.add(tsMax);mw.add(wsMax);mh.add(hsMax);ma.add(asMax);if (t>=tsMin && t<=tsMax){tsCount.add("  体温正常");}else if (t<tsMin){tsCount.add( "  体温偏低");}else if (t>tsMax){tsCount.add( "  体温偏高");}if (w>=wsMin && w<=wsMax){wsCount.add( "  体重正常");}else if (w<wsMin){wsCount.add("  体重偏低");}else if (w>wsMax){wsCount.add("  体重偏高");}if (h>=hsMin && h<=hsMax){hsCount.add("  身高正常");}else if (h<hsMin){hsCount.add( "  身高偏低");}else if (h>hsMax){hsCount.add("  身高偏高");}if (a>=asMin && a<=asMax){asCount.add( "  饭量正常");}else if (a<asMin){asCount.add("  饭量偏低");}else if (a>asMax){asCount.add("  饭量偏高");}}model.addAttribute("pets", rows);model.addAttribute("tsCount", tsCount);model.addAttribute("wsCount", wsCount);model.addAttribute("hsCount", hsCount);model.addAttribute("asCount", asCount);model.addAttribute("dsCount", dsCount);System.out.println(pt);model.addAttribute("pt", pt);model.addAttribute("ph", ph);model.addAttribute("pw", pw);model.addAttribute("pa", pa);model.addAttribute("mt", mt);model.addAttribute("mh", mh);model.addAttribute("mw", mw);model.addAttribute("ma", ma);return "tj/assess";}/*** 普通用户预约统计*/@RequestMapping("/tjApply")public String tjApply(Model model) {Subject subject = SecurityUtils.getSubject();User user = (User) subject.getPrincipal();Appointment appointment = new Appointment();appointment.setUserId(user.getId());appointment.setPage(1);appointment.setLimit(99999);MMGridPageVoBean<Appointment> voBean = (MMGridPageVoBean<Appointment>)  appointmentService.getAllByLimit(appointment);List<Appointment> rows = voBean.getRows();Integer a1 = 0;Integer a2 = 0;Integer a3 = 0;Integer a4 = 0;for (Appointment a: rows){switch (a.getStatus()){case 1: a1++;break;case 2: a2++;break;case 3: a3++;break;case 4: a4++;break;}}model.addAttribute("a1", a1);model.addAttribute("a2", a2);model.addAttribute("a3", a3);model.addAttribute("a4", a4);return "tj/tjApply";}/*** 医生预约统计*/@RequestMapping("/tjApplyDoctor")public String tjApplyDoctor(Model model) {Appointment appointment = new Appointment();appointment.setPage(1);appointment.setLimit(99999);MMGridPageVoBean<Appointment> voBean = (MMGridPageVoBean<Appointment>)  appointmentService.getAllByLimit(appointment);List<Appointment> rows = voBean.getRows();Integer a1 = 0;Integer a2 = 0;Integer a3 = 0;Integer a4 = 0;for (Appointment a: rows){switch (a.getStatus()){case 1: a1++;break;case 2: a2++;break;case 3: a3++;break;case 4: a4++;break;}}model.addAttribute("a1", a1);model.addAttribute("a2", a2);model.addAttribute("a3", a3);model.addAttribute("a4", a4);return "tj/tjApplyDoctor";}/*** 普通用户宠物日志统计*/@RequestMapping("/tjDaily")public String tjDaily(Model model) {Subject subject = SecurityUtils.getSubject();User user = (User) subject.getPrincipal();Pet pet = new Pet();pet.setUserId(user.getId());pet.setPage(1);pet.setLimit(99999);MMGridPageVoBean<Pet> voBean = (MMGridPageVoBean<Pet>)  petService.getAllByLimit(pet);List<Pet> rows = voBean.getRows();model.addAttribute("pets", rows);if (rows.size()>0){pet = rows.get(0);PetDaily daily = new PetDaily();daily.setPetId(pet.getId());daily.setPage(1);daily.setLimit(99999);MMGridPageVoBean<PetDaily> ppp = (MMGridPageVoBean<PetDaily>)  petDailyService.getAllByLimit(daily);List<PetDaily> list = ppp.getRows();for (PetDaily p : list){p.setDateTime(MyUtils.getDate2String(p.getCreateTime(), "yyyy-MM-dd"));}model.addAttribute("dailys", list);}return "tj/tjDaily";}/*** 医生宠物日志统计*/@RequestMapping("/tjDailyDoctor")public String tjDailyDoctor(Model model) {Pet pet = new Pet();pet.setPage(1);pet.setLimit(99999);MMGridPageVoBean<Pet> voBean = (MMGridPageVoBean<Pet>)  petService.getAllByLimit(pet);List<Pet> rows = voBean.getRows();model.addAttribute("pets", rows);if (rows.size()>0){pet = rows.get(0);PetDaily daily = new PetDaily();daily.setPetId(pet.getId());daily.setPage(1);daily.setLimit(99999);MMGridPageVoBean<PetDaily> ppp = (MMGridPageVoBean<PetDaily>)  petDailyService.getAllByLimit(daily);List<PetDaily> list = ppp.getRows();for (PetDaily p : list){p.setDateTime(MyUtils.getDate2String(p.getCreateTime(), "yyyy-MM-dd"));}model.addAttribute("dailys", list);}return "tj/tjDailyDoctor";}/*** 普通用户查询条件数据返回宠物日志*/@RequestMapping("/tjDailyData")@ResponseBodypublic Object tjDailyData(Long id){PetDaily daily = new PetDaily();daily.setPetId(id);daily.setPage(1);daily.setLimit(99999);MMGridPageVoBean<PetDaily> ppp = (MMGridPageVoBean<PetDaily>)  petDailyService.getAllByLimit(daily);List<PetDaily> list = ppp.getRows();for (PetDaily p : list){p.setDateTime(MyUtils.getDate2String(p.getCreateTime(), "yyyy-MM-dd"));}return list;}/*** 医生查询条件数据返回宠物日志*/@RequestMapping("/tjDailyDataDoctor")@ResponseBodypublic Object tjDailyDataDoctor(Long id){PetDaily daily = new PetDaily();daily.setPetId(id);daily.setPage(1);daily.setLimit(99999);MMGridPageVoBean<PetDaily> ppp = (MMGridPageVoBean<PetDaily>)  petDailyService.getAllByLimit(daily);List<PetDaily> list = ppp.getRows();for (PetDaily p : list){p.setDateTime(MyUtils.getDate2String(p.getCreateTime(), "yyyy-MM-dd"));}return list;}/*** 用户查看医生空闲时间*/@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")@ResponseBodypublic 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<>();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);}}result.put("t", time);result.put("v", value);return result;}
}

如果也想学习本系统,下面领取。回复:012springboot

Java项目:springboot宠物医院管理系统相关推荐

  1. java基于springboot宠物医院管理系统

    宠物医院管理系统220是基于java编程语言,mysql管理器,springboot框架的设计,本系统主要分为用户,管理员,医生三个角色,其中用户的主要功能是注册和登陆系统,查看新闻资讯,预约宠物医生 ...

  2. springboot宠物医院管理系统

    项目介绍 本系统共分为三个角色:系统管理员.医生.用户 框架:springboot.mybatis.jsp 数据库:mysql 5.7(注意版本不能为8) 功能模块:系统管理-用户管理.页面管理.角色 ...

  3. Java项目:ssm医院管理系统

    作者主页:夜未央5788 简介:Java领域优质创作者.Java项目.学习资料.技术互助 文末获取源码 项目介绍 医院管理系统,主要分为管理员与普通员工两种角色: 管理员主要功能包括: 通知管理.员工 ...

  4. (附源码)spring boot宠物医院管理系统 毕业设计180923

    Springboot宠物医院管理系统 摘 要 现如今生活质量提高,人们追求精神健康,与家中宠物朝夕相处,感情深厚,宠物渐渐成了我们身边的朋友.因而宠物生病了,需要去看病,自古医院救死扶伤,生命无贵贱, ...

  5. 基于Springboot的宠物医院管理系统-JAVA【数据库设计、论文、源码、开题报告】

    1 绪论 1.1 课题背景 在信息技术高速发展的今天,新知识.新技术层出不穷,计算机技术早已广泛的应用于各行各业之中,利用计算机的强大数据处理能力和辅助决策能力叫,实现行业管理的规范化.标准化.效率化 ...

  6. 基于Springboot的宠物医院管理系统-JAVA【毕业设计、论文、源码、开题报告】

    1 绪论 1.1 课题背景 在信息技术高速发展的今天,新知识.新技术层出不穷,计算机技术早已广泛的应用于各行各业之中,利用计算机的强大数据处理能力和辅助决策能力叫,实现行业管理的规范化.标准化.效率化 ...

  7. JAVA宠物医院管理系统计算机毕业设计Mybatis+系统+数据库+调试部署

    JAVA宠物医院管理系统计算机毕业设计Mybatis+系统+数据库+调试部署 JAVA宠物医院管理系统计算机毕业设计Mybatis+系统+数据库+调试部署 本源码技术栈: 项目架构:B/S架构 开发语 ...

  8. 基于Java毕业设计宠物医院管理系统源码+系统+mysql+lw文档+部署软件

    基于Java毕业设计宠物医院管理系统源码+系统+mysql+lw文档+部署软件 基于Java毕业设计宠物医院管理系统源码+系统+mysql+lw文档+部署软件 本源码技术栈: 项目架构:B/S架构 开 ...

  9. 计算机毕业设计Java宠物医院管理系统(源码+系统+mysql数据库+lw文档

    计算机毕业设计Java宠物医院管理系统(源码+系统+mysql数据库+lw文档 计算机毕业设计Java宠物医院管理系统(源码+系统+mysql数据库+lw文档) 本源码技术栈: 项目架构:B/S架构 ...

  10. 基于springboot的宠物医院管理系统的设计与实现

    1,项目介绍 基于 SpringBoot 的宠物医院管理系统拥有 5 种角色,分别为管理员.用户.医生.美容师.业务管理员. 已注册用户 个人信息和宠物信息管理,发布预约单(预约医生和美容师),在医院 ...

最新文章

  1. Ubuntu使用PBIS认证
  2. 超强平衡机器人,走钢丝、玩忍者步伐,还可以做瑜伽动作,不受干扰的那种 | IEEE 2020...
  3. python——装饰器
  4. ServiceMix中部署:OSGi Bundle和Feature
  5. java 运行 .jar 文件乱码
  6. 电脑上面玩Android 游戏(.apk文件)
  7. [CLR via C#]4. 类型基础及类型、对象、栈和堆运行时的相互联系
  8. 小特效【较完善的滑动下拉菜单】【购物车加减器】
  9. 设计模式学习之外观模式
  10. 2017公共DNS服务器评估报告——公共DNS推荐(摘录)
  11. T83723 数人wjh --题解
  12. 户外广告的创新思考,媒体运用上的创新
  13. 手机话费充值和手机流量充值 API
  14. HTML常用标签详解
  15. 同城小程序需要的服务器配置,微同城小程序-设置教程-一站云
  16. 万国数据表现不佳的风险很高
  17. CUDA----.cpp文件和.cu文件应用区别
  18. Ubuntu操作系统输入法键位错乱解法记录(输入法无法正确打出~、等字符)
  19. 学校考的计算机证怎么查询系统,软考证书查询网址是什么?怎么查询?
  20. 怎么开发一个完整的对外接口API

热门文章

  1. 收藏一些web应用,留作DzzOffice日后添加web应用时使用。
  2. 计算机视觉教程7-3:Openpose配置与实践
  3. 一家中国公司把城市变成了AI版《清明上河图》
  4. 浅谈扩展欧几里得算法
  5. itextpdf 数字签名
  6. 百度itextpdf工具类,快速生成PDF打印模板,itextpdf5加公章
  7. html 随机抽奖,随机抽奖页面js
  8. opc 接口计算机,OPC接口使用技巧
  9. 山东大学计算机学院实验室,计算机学院平稳推进实验室各项工作
  10. IDEA2021.03 Tomcat热部署的实现