1 绪论
1.1 课题背景
在信息技术高速发展的今天,新知识、新技术层出不穷,计算机技术早已广泛的应用于各行各业之中,利用计算机的强大数据处理能力和辅助决策能力叫,实现行业管理的规范化、标准化、效率化。
管理信息系统(Management Information System,简称MIS〉是一个以人为主导,利用计算机软硬件技术以及网络通信技术,实现对信息的收集、传输、储存、更新。
目前,管理信息系统广泛采用WEB技术作为开发的主要技术。在经过多年的技术积累与更新,WEB技术已经从一种简单的信息浏览和信息交互平台发展为复杂的企业级应用。
目前宠物宠物医院一直以来都是使用传统的人工方式管理各种文件档案,对宠物诊疗等重要信息进行人工手写记录,工作效率低,且时间一长,将产生大量文件,这对于文件的查找、信息查询造成很多困难,存在着许多缺点。随着社区越来越多的家庭开始饲养宠物,宠物宠物医院管理方法落后的问题越来越明显,管理上面临的问题越来越突出。
为了能够方便宠物医院的管理,一套完善的管理机制是必不可少的,也是宠物医院提供良好服务质量的一个前提,而应用信息技术的现代化宠物宠物医院管理系统已成为宠物宠物医院运营必不可少的基础设施与技术支撑。
宠物宠物医院管理系统的应用,不仅可以实现将宠物宠物医院工作中的挂号业务、诊疗业务、收费业务、宠物住院业务、宠物美容业务等有机的结合起来;还可以通过建立宠物档案,帮助医生更好更及时的了解宠物病情,制定宠物治疗计划,满足宠物主人的治疗需求,同时宠物档案的建立也有利于宠物的防疫工作。除此之外,管理系统对用户权限划分,帮助宠物医院规范化工作流程,提高工作效率,全面提高宠物宠物医院的管理水平。
因此如何利用计算机技术实现宠物宠物医院信息化管理*是一个值得研究的问题。基于这个背景,本组决定开发一套适合宠物宠物医院的信息管理系统。
1.2 课题研究的现状
随着经济的发展,人们生活水平不断地进步和提高,越来越多的家庭开始饲养宠物,与此同时,宠物的卫生、防疫、诊疗也得到了人们越来越多的关注,由此派生出的宠物宠物医院在发展上也越来越迅猛l5。
宠物宠物医院在欧美发达国家作为产业早已经形成了国民经济的一部分,由于欧美发达国家的信息化程度高,信息技术、各种研究成果较早的应用于各行各业,宠物宠物医院在管理上早已实现了信息化建设。
当前,信息化已成为全球发展的主题,世界各国对信息的需求快速增长,信息产品和信息服务广泛的应用于各个国家、地区、企业、单位、家庭、个人。
早在20世纪8O年代,发达国家就已经开始信息化建设的工作。目前,欧美发达国家早已为宠物建立了宠物电子档案,这对于宠物的防疫、卫生、安全等起到了重要的管理作用,同时各种新技术不断应用于宠物宠物医院的日常管理工作中,宠物宠物医院在管理上早己实现了规范化、标准化。
相对于欧美发达国家,我国信息化建设从20世纪90年代初开始,信息化程度还处于较低水平,且发展很不平衡,大部分宠物宠物医院的信息化建设还处于以划价收费为中心的信息管理系统,缺少其他业务的信息化管理,造成很多工作还停留在人工操作上,这
就对当前宠物宠物医院的信息化管理造成了很多问题。
随着我国信息技术在宠物宠物医院行业应用程度的不断提高,东南沿海较发达城市已经实现了宠物宠物医院管理的信息化,但是并没有完全普遍,大部分欠发达地区,尤其是小型的社区宠物宠物医院,还是处于传统的管理方式。
虽然目前仍与欧美发达国家存在较大差距,但“十二五”规划,我国提出了信息化建设的“3521工程”,我国宠物宠物医院的信息化建设迎来了发展的好时机。
宠物宠物医院信息化建设的不断进行对宠物医疗卫生行业的发展具有重要的意义,既能提高宠物医院的服务质量,又能方便宠物医院的管理,更为重要的是对于保障宠物防疫、·卫生、安全具有重要意义。
1.3 课题研究的意义
该宠物宠物医院管理系统可以满足宠物宠物医院在信息管理方面的需要,提高宠物宠物医院管理的效率,达到信息管理科学化和规范化的目标。
宠物宠物医院管理系统主要研究的范围是:
1、根据宠物宠物医院管理工作的流程,对用户的功能以及权限进行合理的划分,规范
化工作流程。
- 系统在设计时,需要考虑系统的可扩展性和可维护性,满足以后对系统的升级
- 本课题的研究成果能够较好地解决宠物宠物医院的管理难题,同时该系统整合了挂号、收费、诊疗、医生绩效考察等功能,既可以帮助宠物医院更好的管理,也可以帮助医生更好的为宠物诊疗。除此之外,该系统对加强城市宠物的管理,确保对宠物审查、监管、防疫检疫等措施的实施,起到很好的辅助作用,保障社区居民安全和公共卫生,促进社区生活和谐。
2 需求分析
2.1 需求描述
项目的使用者可以避免排队挂号,比较方便,也方便于宠物医院的管理。现在的宠物本系统根据华阳社区宠物医院管理工作流程将系统使用者划分为三类,分别为、宠物医生、宠物主人以及系统管理人员,以下是对该三类类用户的具体功能需求分析。
2.2 需求功能描述
1.身份管理
宠物医生登录
宠物主人登录
系统管理员登录
2.系统管理
用户管理
页面管理
角色管理
3.宠物管理
宠物列表
宠物状态
宠物健康史
4.预约管理
预约列表
预约状态
医生时间
5.日常健康
健康指南
健康标准
宠物日志
2.3 用例模型
2.3.1 业务用例模型
宠物医院管理系统主要包括以下几个用例:登录、系统管理、宠物管理、预约管理、日常健康。
登录:不同身份的角色可以登录不同的界面,得到所对应的需求。
系统管理:可以根据自己的需求进行页面管理,并对不同的用户进行权限的管理。
宠物管理:管理员可以从中看到宠物的状态,健康史等等。
预约管理:当业务繁忙的时候,用户可以发起预约。
日常健康:医生可以从中看到健康只能,标准与宠物每天的情况。
具体业务用例模型如图2-1所示。
图2-1系统用例模型
(1)参与者
用户:可以看到宠物的状况,预约的安排,每天的日常安排。
医生:具体的工作安排。
系统管理员:拥有所有的权限。
(2)业务用例
登录:不同身份的角色可以登录不同的界面,得到所对应的需求。
系统管理:可以根据自己的需求进行页面管理,并对不同的用户进行权限的管理。
宠物管理:管理员可以从中看到宠物的状态,健康史等等。
预约管理:当业务繁忙的时候,用户可以发起预约。
日常健康:医生可以从中看到健康只能,标准与宠物每天的情况。
2.3.2 系统用例模型
(1)登录业务的系统用例模型
登录业务的用例规约见表2-1
表2-1 登录业务用例规约
标题
|
内容
|
用例名称
|
用户登录
|
用例描述
|
用户想要更多权限必须登录
|
执行者
|
用户
|
前置条件
|
用户具有操作条件
|
后置条件
|
|
正常流
|
1.用户登录
1.1 用户输入账号
1.2 用户输入密码
|
替代流以及异常处理
|
1.密码不正确时用户无法登录
|
业务规则
|
全局规则
Rule00001:用户登录后操作软件
|
涉及实体
|
用户
|
用户登录是用户通过登录账户获得更多权限,登录系统用例图如图2-1所示
图2-1 登录系统用例图
- 系统管理业务的系统用例模型。
系统管理业务的用例规约见表2-2
表2-2 系统管理业务用例规约
标题
|
内容
|
用例名称
|
系统管理
|
用例描述
|
管理员对系统进行管理
|
执行者
|
管理人员
|
前置条件
|
系统已经存在
|
后置条件
|
无
|
正常流
|
1.管理员进行菜单管理
1.1管理员进行增加菜单
1.2管理员进行查询菜单
1.3管理员进行编辑菜单
1.4管理员进行删除菜单
2.管理员进行角色权限管理
2.1管理员进行增加角色权限
2.2管理员进行查询角色权限
2.3管理员进行编辑角色权限
2.4管理员进行删除角色权限
3.管理员进行用户管理
3.1管理员进行增加用户
3.2管理员进行查询用户
3.3管理员进行编辑用户
3.4管理员进行删除用户
|
替代流以及异常处理
|
- 当各个列表为空时,无法进行删除编辑操作
|
业务规则
|
- 全局规则
Rule0001:管理员需要登录后才能操作软件功能
- 交互规则
|
涉及实体
|
管理员
|
系统用例图是由软件需求分析到最终实现的第一步,它描述人们如何使用一个系统。该系统用例图的参与者是管理员,管理员可以进行菜单管理,角色管理以及用户管理。菜单管理:增加系统菜单,可以管理系统左边菜单。角色管理:包括添加角色,修改角色,删除角色,编辑角色,系统中有不同的角色,每个角色分配的菜单不同,只有给角色分配菜单后,角色才有相应的菜单。用户管理:添加用户,添加的用户是登陆系统的账户及用户信息,用户的密码为默认密码(可以进行修该),添加用户后需要给用户分配角色,每个角色拥有的菜单不同。系统管理系统用例图如图2-2所示
图2-2 系统管理系统用例图
(3)预约业务的系统用例模型
预约管理问题业务的用例规约见表2-3
表2-3 预约管理业务用例规约
标题
|
内容
|
用例名称
|
宠物预约管理
|
用例描述
|
对宠物预约治疗的情况进行查看,修改,删除等等
|
执行者
|
宠物医院管理员
|
前置条件
|
宠物的档案生成
|
后置条件
|
无
|
正常流
|
1.查看宠物预约治疗列表信息
1.1 查看宠物治疗的病情
1.2 查看宠物主人的电话
1.3 查看宠物主人的地址
1.4 查看宠物预约的申请时间
1.5 查看宠物预约的状态
2. 管理员对于宠物预约治疗申请的操作
2.1 查看宠物预约的状态操作
2.2 处理宠物预约状态
3. 查看预约治疗医生的时间
3.1 查询医生
3.2 查询医生的时间
|
替代流以及异常处理
|
- 提交申请新增后,列表没有该宠物
- 提交删除申请后,档案列表没有档案
|
业务规则
|
- 全局规则
Rule0001:管理员需要登录后进行操作功能
- 交互规则
Rule0002:管理员提交相对应的宠物预约信息
|
涉及实体
|
宠物实体类
|
使用预约管理业务用例规约进行系统用例建模,预约管理系统用例图如图2-4所示
图2-3 预约管理系统用例图
- 健康指南管理业务的系统用例模型
管理员在该平台上发布宠物健康指南,可对其进行修改删除添加。健康指南管理业务的用例规约见表2-4
表2-4 健康指南管理业务用例规约
标题
|
内容
|
用例名称
|
健康指南管理
|
用例描述
|
健康指南管理员管理健康指南药物
|
执行者
|
健康指南管理人员
|
前置条件
|
管理员已经登录并实时查询健康指南选项
|
后置条件
|
完成查询问题后,进行处理
|
正常流
|
1.库存药品查询
1.1 库存药品汇总
1.2 库存不足
2. 库房采购问题
2.1 缺货报警
2.2 健康指南紧急补给
2.3 过期药品报警
2.4 健康指南药品回收
3. 药物入库
3.1 入库单
4. 药物出库
4.1 出库单
|
替代流以及异常处理
|
1.药物是否过期
|
业务规则
|
全局规则
Rule0001:客服管理员需要登录后操作软件功能
交互规则
Rule0002:用户提交相对应的信息
|
涉及实体
|
管理员实体,药物实体
|
使用健康指南管理用例规约进行系统用例建模,健康指南管理系统用例图如图2-4所示
图2-4健康指南管理系统用例图
- 宠物管理业务的系统用例模型
宠物管理业务的用例规约见表2-5
表2-5 宠物管理业务用例规约
标题
|
内容
|
用例名称
|
宠物档案管理
|
用例描述
|
对宠物的情况进行查看,修改,删除等等
|
执行者
|
宠物医院管理员
|
前置条件
|
宠物档案生成
|
后置条件
|
无
|
正常流
|
1. 申请查看宠物信息
1.1 查看宠物身高
1.2 查看宠物体重
1.3 查看宠物出生日期
1.4 查看宠物的类型
1.5 查看宠物病例
1.6 给宠物预约就诊
2. 查询宠物健康史
2.1 查看该宠物主人用户
2.2 查看宠物医生
2.3 查看宠物状态
2.4 宠物诊疗建议
3. 删除宠物健康史信息
3.1 查询诊疗建议
3.2 删除宠物档案信息
|
替代流以及异常处理
|
- 提交申请查看后,列表没有该宠物
- 提交删除申请后,档案列表没有档案
|
业务规则
|
- 全局规则
Rule0001:用户需要登录后操作软件功能
- 交互规则
Rule0002:用户提交相对应的工单服务地址信息
|
涉及实体
|
宠物实体类
|
使用宠物管理业务用例规约进行系统用例建模,宠物管理系统用例图如图2-1所示
图2-5宠物管理系统用例图
2.4 动态模型
2.4.1 项目泳道图
泳道图,一种UML活动图,能够清晰体现出某个动作发生在哪个部门。绘图元素与传统流程图类似,但在业务流程主体上,通过泳道(纵向条)区分出执行主体,即部门和岗位 来。将模型中的活动按照职责组织起来。这种分配可以通过将活动组织成用线分开的不同 区域来表示。由于它们的外观的缘故,这些区域被称作泳道。它可以方便的描述企业的各 种业务流程,能够直观地描述系统的各活动之间的逻辑关系,利于用户理解业务逻辑。下 图中的课题泳道图头部体现了执行操作的各类角色信息,主体部分体现了该系统主要的操 作流程。泳道图的整体体现了这个系统所要完成的主要功能。按照程序在保证正确性的条件下 执行的顺序,可以看出,系统主要业务:登录、系统管理、宠物管理、预约管理、日常健康等。在此基础上进行相应的延申与判断。
2.4.2 业务泳道图
(1)登录管理业务的泳道图
登录业务用例图如图2-6所示:
用户登录业务的泳道图,见图2-6 用户登录业务泳道图。
图2-6 用户登录业务泳道图
(2)系统管理业务的泳道图
系统管理的业务泳道图如图2-7所示
图2-7 系统管理业务的泳道图
- 预约管理业务的泳道图
宠物的主人,宠物店的医生,系统后台管理员分别进行身份验证,宠物主人去宠物店医生那边查看自家宠物的预约情况,预约治疗的措施或预约医生等,宠物店医生可以处理该宠物的预约状态。系统管理的业务泳道图如图2-8所示
图2-8 预约管理业务的泳道图
- 健康指南管理业务的泳道图
系统管理的业务泳道图如图2-9所示
图2-9 健康指南管理业务的泳道图
(5)宠物管理业务的泳道图
宠物主人,宠物医生,系统后台分别进行身份验证,宠物主人去宠物医生那边查看自家宠物的一些基本情况,可预约治疗的措施或预约医生等,可以删除该宠物档案,可查询医生对宠物的诊疗建议。
宠物管理系统泳道图如图2-10所示:
图2-10 宠物管理系统泳道图
2.5 静态类模型
2.5.1 分析类图
(1)登录管理系统用例的分析类图
登录管理用例的分析类图如图2-11所示:
图2-11 登录管理用例的分析类图
(2)系统管理系统用例的分析类图
系统管理系统用例的分析类图如图2-12所示
图2-12 系统管理系统用例的分析类图
(3)预约管理系统用例的分析类图
预约管理系统用例的分析类图如图2-13所示
图2-13 预约管理系统用例的分析类图
(4)健康指南管理系统用例的分析类图
健康指南管理用例的分析类图如图2-14所示
图2-14 健康指南管理系统用例的分析类图
(5)宠物管理系统用例的分析类图
宠物管理系统用例的分析类图如图2-15所示:
图2-15 宠物管理系统用例的分析类图
2.5.2 实体类图
实体类图主要展示的实在建模过程中,所用到的各个实体与实体之间的联系。实体间的关系也是按照分析类图进行设计的,其中有的联系为:一对多、一对一、多对一、多对多的关联关系。
登录管理实体类图如图2-16所示:
图2-16 登录管理实体类图
系统管理实体类图如图2-17所示:
图2-17 系统管理实体类图
预约管理实体类图如图2-18所示:
图2-18 预约管理实体类图
健康指南管理实体类图如图2-19所示:
图2-19 健康指南管理实体类图
宠物管理实体类图如图2-20所示:
图2-20宠物管理实体类图
3 子系统设计
3.1 软件体系结构设计
SSM(Spring+SpringMVC+MyBatis)框架集由Spring、MyBatis两个开源框架整合而成(SpringMVC是Spring中的部分内容)。常作为数据源较简单的web项目的框架。
Spring就像是整个项目中装配bean的大工厂,在配置文件中可以指定使用特定的参数去调用实体类的构造方法来实例化对象。也可以称之为项目中的粘合剂。Spring的核心思想是IoC(控制反转),即不再需要程序员去显式地new一个对象,而是让Spring框架帮你来完成这一切。
SpringMVC在项目中拦截用户请求,它的核心Servlet即DispatcherServlet承担中介或是前台这样的职责,将用户请求通过HandlerMapping去匹配Controller,Controller就是具体对应请求所执行的操作。SpringMVC相当于SSH框架中struts。
mybatis是对jdbc的封装,它让数据库底层操作变的透明。mybatis的操作都是围绕一个sqlSessionFactory实例展开的。mybatis通过配置文件关联到各实体类的Mapper文件,Mapper文件中配置了每个类对数据库所需进行的sql语句映射。在每次与数据库交互时,通过sqlSessionFactory拿到一个sqlSession,再执行sql命令。
页面发送请求给控制器,控制器调用业务层处理逻辑,逻辑层向持久层发送请求,持久层与数据库交互,后将结果返回给业务层,业务层将处理逻辑发送给控制器,控制器再调用视图展现数据。
体系结构图如图3-1所示。
图3-1体系结构设计图
体系结构包图如图3-2所示。
图3-2体系结构包图
3.2 软件功能总体设计
图3-3层次方框图
3.3 软件功能详细设计
3.3.1 登录管理功能
登录管理设计类图如图3-4所示
图3-4 登录管理设计类图
- 表示层设计
采用的是 MVC 设计模式,get()方法,可以获得用户的操作选项,或者将用户的需要用的数值接收,init()将用户申请的数据展示在客户端,post()时更新操作,用户更新信息的操作传入数据库,alert()将警告信息展示在客户端,提示用户操作有错误。
(2)业务逻辑层设计
业务逻辑层是专门处理软件业务需求的一层,处于数据库之上,服务层之下,完成一些列对Domain Object的CRUD,作为一组微服务提供给服务层来组织在暴露给表现层。如图3-5 用户登录业务逻辑层设计图。
活动图如图3-5所示
图3-5 活动图
(3)数据访问层设计
数据访问层设计提供了各种数据库操作的接口,通过MyBatis的动态映射在XML,有多个方法。登录管理顺序图如图3-6所示
图3-6登录管理顺序图
3.3.2 系统管理功能
系统管理设计类图如图3-7所示
图3-7 系统管理设计类图
- 表示层设计
采用的是 MVC 设计模式,View层的get()方法,可以获得客服人员的操作选项,或者将客服人员的需要用的数值接收,init()将登录申请的数据展示在客户端,post()时更新操作,登录更新信息的操作传入数据库,
- 业务逻辑层设计
将数据访问层查询出的数据进行封装,通过getinformation ()得到所有的已经完成的病例信息,将处理的结算结果封装成对应的数据,并且在业务逻辑层实现内容的判断是否符合要求。如果不符合则需要提示客服内容不合法,否则提示结算成功。
- 数据访问层设计
数据访问层设计提供了各种数据库操作的接口,通过MyBatis的动态映射在XML,有多个方法。
系统管理顺序图如图3-8所示
3-8系统管理顺序图
3.3.3 预约管理功能
对系统所涉及到的预约管理的功能都要进行设定,需要严格判断宠物档案列表是否有该宠物,并且预约该宠物的情况。存储时还要对当前数据库中存储的系统开放时间进行判断,具体判断如下:
1. 首先用户查询的宠物列表必须有该宠物。若满足可以进行下一步判断,若不满足则提示宠物列表为空,不可进行操作;
2. 其次在满足入宠物列表有该宠物前提下,在判断该宠物档案表是否有该宠物,若是有则可进行预约该宠物,若没有无法进行操作;
预约管理设计类图如图3-4所示
图3-9 预约管理设计类图
(3)数据访问层设计
数据访问层设计提供了各种数据库操作的接口,通过MyBatis的动态映射在XML,有多个方法。办理预约管理顺序图如图3-10所示
图3-10预约管理顺序图
3.3.4 健康指南管理功能
发布指南功能
管理员可自行对指南框进行增加删除修改查询清空等操作,在修改完毕后,用户可以查看其内容。
表示层设计
采用的是 MVC 设计模式,xzx2_Orders.Generate.Controller.Web 控制器对外提供访问接口, getOrderGenerateDetail()获取指南类的列表详情,submitOrder()提交指南界面。健康指南设计类图如图3-11所示
图3-11 健康指南管理设计类图
(3)数据访问层设计
数据访问层设计提供了各种数据库操作的接口,通过MyBatis的动态映射在XML,有多个方法。健康指南管理顺序图如图3-12所示
图3-12健康指南管理顺序图
3.3.5 宠物管理功能
对系统所涉及到的宠物管理的功能都要进行设定,需要严格判断宠物档案列表是否有该宠物,并且严格查询该宠物的健康史。存储时还要对当前数据库中存储的系统开放时间进行判断,具体判断如下:
1. 首先用户查询的宠物列表列表必须有该宠物。若满足可以进行下一步判断,若不满足则提示宠物列表为空,不可进行操作;
2. 其次在满足入宠物列表有该宠物前提下,在判断该宠物档案表是否有该宠物,若是有则可进行删除档案,若没有无法进行操作;
宠物管理设计类图如图3-13所示
图3-13 宠物管理设计类图
(3)数据访问层设计
数据访问层设计提供了各种数据库操作的接口,通过MyBatis的动态映射在XML,有多个方法。宠物管理顺序图如图3-14所示
图3-14宠物管理顺序图
3.4 数据库设计
3.4.1 系统概念模型
系统的E-R图如图3-13所示
图3-13系统E-R图
3.4.2 数据表设计
- 用户(role)数据表,角色的身份权限,见表3-1
表3-1 role表
序号
|
名称
|
类型
|
长度
|
是否主键
|
说明
|
1
|
Id
|
varchar
|
10
|
是
|
用户编号
|
2
|
Desc
|
Varchar
|
10
|
|
用户身份
|
3
|
Name
|
varchar
|
30
|
|
用户姓名
|
- 角色页数(role_page)数据表,用于存储角色事务的页数,见表3-2
表3-2 role_page表
序号
|
名称
|
类型
|
长度
|
是否主键
|
说明
|
1
|
Rp_Id
|
Number
|
10
|
是
|
业务编号
|
2
|
Role_id
|
Number
|
10
|
|
角色编号
|
3
|
Page_id
|
Number
|
30
|
|
页数
|
- 标准(standard)数据表,用于存储宠物的标准情况,见表3-3
表3-3 standard表
序号
|
名称
|
类型
|
长度
|
是否主键
|
说明
|
1
|
Id
|
int
|
30
|
是
|
编号
|
2
|
Age_min
|
Varchar
|
25
|
|
年龄最小
|
3
|
Age_max
|
Number
|
20
|
|
年龄最大
|
4
|
Temp_min
|
Number
|
20
|
|
温度最小
|
5
|
Temp_max
|
Number
|
20
|
|
温度最大
|
6
|
Weight_min
|
Number
|
20
|
|
体重最小
|
7
|
Weight_max
|
Number
|
20
|
|
体重最大
|
8
|
Height_min
|
Number
|
20
|
|
高度最小
|
9
|
Height_max
|
Number
|
20
|
|
高度最高
|
10
|
Appetite_min
|
Number
|
20
|
|
进食量最小
|
11
|
Appetite_max
|
Number
|
20
|
|
进食量最大
|
12
|
Type
|
Number
|
20
|
|
种类
|
13
|
Status
|
Number
|
20
|
|
状态
|
- 用户信息(user)数据表,用于存储用户信息,见表3-4
表3-4 user表
序号
|
名称
|
类型
|
长度
|
是否主键
|
说明
|
1
|
Id
|
int
|
30
|
是
|
编号
|
2
|
Age
|
Number
|
20
|
|
年龄
|
3
|
Name
|
varchar
|
30
|
|
姓名
|
4
|
Password
|
varchar
|
30
|
|
密码
|
5
|
Phone
|
Number
|
20
|
|
电话
|
6
|
Adress
|
varchar
|
30
|
|
地址
|
- 用户角色(user_role)数据表,用于存储用户信息,见表3-5
表3-5 user_role表
序号
|
名称
|
类型
|
长度
|
是否主键
|
说明
|
1
|
Ur_Id
|
Number
|
10
|
是
|
业务编号
|
2
|
User_id
|
Number
|
10
|
|
用户编号
|
3
|
Role_id
|
Number
|
30
|
|
角色编号
|
- 业务(appointment)数据表,用于业务订单信息,见表3-6
表3-6 appointment表
1
|
Id
|
varchar
|
30
|
是
|
订单编号
|
2
3
4
5
6
7
8
|
pet_id
user_id
doctor_id
app_time
info
create_time
status
|
bigint
bigint
bigint
datetime
varchar
datetime
int
|
20
20
20
20
255
20
20
|
|
商品名称
宠物编号
医生编号
App时间
信息
创建时间
状态
|
9
10
|
phone
address
|
varchar
varchar
|
255
255
|
|
电话
地址
|
- 诊断(diagnosi)数据表,用于存储宠物诊断接种信息,见表3-7
表3-7 diagnosi表
序号
|
名称
|
类型
|
长度
|
是否主键
|
说明
|
1
|
Id
|
bigint
|
20
|
是
|
编号
|
2
3
4
5
6
7
8
|
pet_id
user_id
doctor_id
info
type
status
create_time
|
bigint
bigint
bigint
varchar
int
int
datetime
|
20
20
20
255
20
20
20
|
|
宠物编号
用户编号
医生编号
信息
类型
状态
创建时间
|
(8)指南(notice)数据表,用于记录科室信息,见表3-8
表3-8 notice表
序号
|
名称
|
类型
|
长度
|
是否主键
|
说明
|
1
|
Id
|
bigint
|
20
|
是
|
编号
|
2
|
content
|
Varchar
|
255
|
|
内容
|
3
|
view_count
|
bigint
|
20
|
|
计数
|
4
5
|
create_time
title
|
datetime
varchar
|
20
255
|
|
创建时间
标题
|
(9)页数(page)数据表,用于网页系统url的信息,见表3-9
表3-12 page表
序号
|
名称
|
类型
|
长度
|
是否主键
|
说明
|
1
|
page_id
|
int
|
20
|
是
|
分页编号
|
2
3
4
5
6
7
8
|
parent_id
name
url
level_type
level_index
delete_flag
desc
|
int
varchar
Varchar
Int
int
int
Varchar
|
20
255
255
20
20
1
255
|
|
父母编号
姓名
链接
水平类型
水平指数
删除
描述
|
(10)宠物(pet)数据表,用于存储用户宠物信息,见表3-10
表3-10 pet表
序号
|
名称
|
类型
|
长度
|
是否主键
|
说明
|
1
2
3
4
5
6
|
Id
Name
Weight
Height
Type
Birthday
|
Varchar
Varchar
Number
Number
Number
Date
|
110
50
11
20
20
100
|
是
|
编号
姓名
体重
身高
种类
生日
|
(12)宠物信息(pet_daily)数据表,用于存储宠物身体信息,见表3-12
表3-15 workorder表
序号
|
名称
|
类型
|
长度
|
是否主键
|
说明
|
1
|
Id
|
int
|
30
|
是
|
编号
|
2
|
Pet_id
|
Varchar
|
25
|
|
宠物编号
|
3
|
User_id
|
Number
|
20
|
|
用户编号
|
4
|
Temp
|
Number
|
20
|
|
温度
|
5
|
Weight
|
Number
|
20
|
|
体重
|
6
|
Height
|
Number
|
20
|
|
身高
|
7
|
Appetite
|
Number
|
20
|
|
进食情况
|
8
|
Status
|
Number
|
20
|
|
状态
|
9
|
Time
|
Data
|
20
|
|
创建时间
|
4 子系统实现
功能介绍
用于查询宠物店预约列表情况,可以管理员进行删除和查询。
(1)控制层编码实现
package com.phms.controller.user;
import com.phms.pojo.Appointment;
import com.phms.pojo.User;
import com.phms.service.AppointmentService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Date;
/**
* 用户预约
*/
@Controller("UserApplyController")
@RequestMapping("/user/apply")
public class UserApplyController {
@Autowired
private AppointmentService appointmentService;
private final Logger logger = LoggerFactory.getLogger(this.getClass());
/**
* 医生管理预约页面
* user/applyListDoctor.html
*/
@RequestMapping("/applyListDoctor")
public String applyListDoctor(Long petId, Model model) {
if (petId!=null){
model.addAttribute("petId", petId);
}
return "user/applyListDoctor";
}
/**
* 普通用户预约页面
* user/applyList.html
*/
@RequestMapping("/applyList")
public String applyList(Long petId, Model model) {
if (petId!=null){
model.addAttribute("petId", petId);
}
return "user/applyList";
}
/**
* 普通用户返回查询数据渲染表格
*/
@RequestMapping("/getAllByLimit")
@ResponseBody
public Object getAllByLimit(Appointment appointment) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
appointment.setUserId(user.getId());
return appointmentService.getAllByLimit(appointment);
}
/**
* 医生角色返回查询数据渲染表格
*/
@RequestMapping("/getAllByLimitDoctor")
@ResponseBody
public Object getAllByLimitBaoJie(Appointment appointment) {
return appointmentService.getAllByLimit(appointment);
}
/**
* 根据id删除预约
*/
@RequestMapping(value = "/del")
@ResponseBody
@Transactional
public String delUser(Long id) {
try {
appointmentService.deleteById(id);
return "SUCCESS";
} catch (Exception e) {
logger.error("删除异常", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return "ERROR";
}
}
/**
* 添加预约页面 user/applyAdd.html
*/
@RequestMapping(value = "/add")
public String addUserPage(Long id, Model model) {
model.addAttribute("petId", id);
return "user/applyAdd";
}
/**
* 预约信息插入数据库
*/
@RequestMapping(value = "/doAdd")
@ResponseBody
@Transactional
public String doAdd(Appointment appointment) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
if (appointment.getPetId() == null){
return "noPetId";
}
try {
// 当前预约人的id
appointment.setUserId(user.getId());
appointment.setCreateTime(new Date());
// 状态:1申请中,2申请通过,3不通过,4已完成
appointment.setStatus(1);
appointmentService.add(appointment);
return "SUCCESS";
} catch (Exception e) {
logger.error("添加异常", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return "ERROR";
}
}
/**
* 改变预约状态
*/
@RequestMapping(value = "/chStatus")
@ResponseBody
@Transactional
public String chStatus(Appointment appointment) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
try {
appointment.setDoctorId(user.getId());
appointmentService.update(appointment);
// 就诊
if (appointment.getStatus() == 4){
return "jz";
}
return "SUCCESS";
} catch (Exception e) {
logger.error("添加异常", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return "ERROR";
}
}
}
|
(2)Service层编码实现
package com.phms.service;
import com.phms.pojo.Appointment;
import java.util.List;
import java.util.Map;
public interface AppointmentService {
Object getAllByLimit(Appointment appointment);
void deleteById(Long id);
void add(Appointment appointment);
void update(Appointment appointment);
Appointment getById(Long id);
List<Map<String, Object>> getFreeTimeById(Long docId, String s);
}
|
(3)Mapper层编码实现
package com.phms.mapper;
import com.phms.pojo.Appointment;
import com.phms.pojo.AppointmentExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface AppointmentMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table appointment
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
long countByExample(AppointmentExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table appointment
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int deleteByExample(AppointmentExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table appointment
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table appointment
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int insert(Appointment record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table appointment
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int insertSelective(Appointment record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table appointment
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
List<Appointment> selectByExample(AppointmentExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table appointment
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
Appointment selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table appointment
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int updateByExampleSelective(@Param("record") Appointment record, @Param("example") AppointmentExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table appointment
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int updateByExample(@Param("record") Appointment record, @Param("example") AppointmentExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table appointment
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int updateByPrimaryKeySelective(Appointment record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table appointment
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int updateByPrimaryKey(Appointment record);
List<Appointment> getAllByLimit(Appointment appointment);
int countAllByLimit(Appointment appointment);
List<Map<String, Object>> getFreeTimeById(@Param("id") Long id, @Param("s") String s);
}
|
4.2 用户管理功能实现
功能介绍
用于查询宠物店用户列表情况,可以管理员进行删除和查询、增加。
(1)控制层编码实现
package com.phms.controller.user;
import com.phms.model.ResultMap;
import com.phms.pojo.User;
import com.phms.service.UserRoleService;
import com.phms.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* 用户控制
*/
@Controller("User")
@RequestMapping("/user")
public class UserController {
private final Logger logger = LoggerFactory.getLogger(UserController.class);
private final ResultMap resultMap;
@Autowired
private UserService userService;
@Autowired
private UserRoleService userRoleService;
@Autowired
public UserController(ResultMap resultMap) {
this.resultMap = resultMap;
}
/**
* 返回有权限信息
*/
@RequestMapping(value = "/getMessage", method = RequestMethod.GET)
public ResultMap getMessage() {
return resultMap.success().message("您拥有用户权限,可以获得该接口的信息!");
}
/**
* 修改用户信息页面user/userEdit.html
*/
@RequestMapping(value = "/editUserPage")
public String editUserPage(Long userId, Model model) {
model.addAttribute("manageUser", userId);
if (null != userId) {
User user = userService.selectByPrimaryKey(userId);
model.addAttribute("manageUser", user);
}
return "user/userEdit";
}
/**
* 更新数据库
*/
@ResponseBody
@RequestMapping("/updateUser")
public String updateUser(User user) {
return userService.updateUser(user);
}
}
|
(2)Service层编码实现
package com.phms.service;
import com.phms.model.ResultMap;
import com.phms.pojo.User;
import com.phms.pojo.UserParameter;
import java.util.List;
public interface UserService {
User selectUserByUserId(Long userId);
public ResultMap login(String username, String password);
public boolean checkUserPassword(String password);
public String updatePassword(String password);
Object getAllUserByRoleId(Integer roleId, Integer page, Integer limit);
Object getAllUserByNotRoleId(Integer roleId, Integer page, Integer limit);
User selectByPrimaryKey(Long userId);
List<User> getAdmins();
Object getAllUserByLimit(UserParameter userParameter);
void delUserById(Long id);
void addUser(User user) throws Exception;
String updateUser(Long oldId, User user);
String updateUser(User user);
List<User> getAllUser();
User getAdminById(Long userId);
Object getAllDelUserByLimit(UserParameter userParameter);
List<User> selectAllUser();
User getUserByPhoneAndName(String phone, String name);
void save(User user);
User getByIdCard(String idCard);
List<User> listDoctor();
}
|
(3)Mapper层编码实现
package com.phms.mapper;
import com.phms.pojo.User;
import com.phms.pojo.UserExample;
import com.phms.pojo.UserParameter;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface UserMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
long countByExample(UserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int deleteByExample(UserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int insert(User record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int insertSelective(User record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
List<User> selectByExample(UserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
User selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int updateByExample(@Param("record") User record, @Param("example") UserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int updateByPrimaryKeySelective(User record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int updateByPrimaryKey(User record);
int countAllUserByRoleId(Integer roleId);
List<User> getAllUserByRoleId(@Param("roleId") Integer roleId,
@Param("begin") Integer begin, @Param("count") Integer count);
int countAllUserByNotRoleId(Integer roleId);
List<User> getAllUserByNotRoleId(@Param("roleId") Integer roleId,
@Param("begin") Integer begin, @Param("count") Integer count);
List<User> getAllUserByLimit(UserParameter userParameter);
int countAllUserByLimit(UserParameter userParameter);
List<User> getAllDelUserByLimit(UserParameter userParameter);
int countAllDelUserByLimit(UserParameter userParameter);
List<User> selectAllUser();
User getByName(@Param("username") String username);
User getUserByPhoneAndName(@Param("phone") String phone, @Param("name")String name);
User selectByIdCard(@Param("idCard") String idCard);
}
|
用于查询宠物店宠物列表情况,可以管理员进行删除和查询、增加。
(1)控制层编码实现
package com.phms.controller.user;
import com.phms.pojo.Appointment;
import com.phms.pojo.Diagnosis;
import com.phms.pojo.User;
import com.phms.service.AppointmentService;
import com.phms.service.DiagnosisService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Date;
/**
* 宠物健康史
*/
@Controller("UserDiagnosisController")
@RequestMapping("/user/diagnosis")
public class UserDiagnosisController {
@Autowired
private DiagnosisService diagnosisService;
@Autowired
private AppointmentService appointmentService;
private final Logger logger = LoggerFactory.getLogger(this.getClass());
/**
* 医生宠物健康史页面user/diagnosisListDoctor.html
*/
@RequestMapping("/diagnosisListDoctor")
public String diagnosisListDoctor(Long petId, Model model) {
if (petId!=null){
model.addAttribute("petId", petId);
}else {
model.addAttribute("petId", "petId");
}
return "user/diagnosisListDoctor";
}
/**
* 普通用户宠物健康史页面user/diagnosisList.html
*/
@RequestMapping("/diagnosisList")
public String diagnosisList(Long petId, Model model) {
if (petId!=null){
model.addAttribute("petId", petId);
}else {
model.addAttribute("petId", "petId");
}
return "user/diagnosisList";
}
/**
* 普通用户返回查询数据
*/
@RequestMapping("/getAllByLimit")
@ResponseBody
public Object getAllByLimit(Diagnosis diagnosis) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
diagnosis.setUserId(user.getId());
return diagnosisService.getAllByLimit(diagnosis);
}
/**
* 医生返回查询数据
*/
@RequestMapping("/getAllByLimitDoctor")
@ResponseBody
public Object getAllByLimitBaoJie(Diagnosis diagnosis) {
return diagnosisService.getAllByLimit(diagnosis);
}
/**
* 删除记录
*/
@RequestMapping(value = "/del")
@ResponseBody
@Transactional
public String del(Long id) {
try {
diagnosisService.deleteById(id);
return "SUCCESS";
} catch (Exception e) {
logger.error("删除异常", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return "ERROR";
}
}
/**
* 增加页面user/diagnosisAdd.html
*/
@RequestMapping(value = "/add")
public String add(Long id, Model model) {
Appointment byId = appointmentService.getById(id);
model.addAttribute("userId", byId.getUserId());
model.addAttribute("petId", byId.getPetId());
return "user/diagnosisAdd";
}
/**
* 插入数据库
*/
@RequestMapping(value = "/doAdd")
@ResponseBody
@Transactional
public String doAdd(Diagnosis diagnosis) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
try {
// 医生登录id
diagnosis.setDoctorId(user.getId());
diagnosis.setCreateTime(new Date());
// 状态:1申请中,2申请通过,3不通过,4已完成
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 {
// 医生登录id
diagnosis.setDoctorId(user.getId());
diagnosisService.update(diagnosis);
return "SUCCESS";
} catch (Exception e) {
logger.error("添加异常", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return "ERROR";
}
}
}
|
(2)Service层编码实现
package com.phms.service;
import com.phms.pojo.Diagnosis;
public interface DiagnosisService {
void update(Diagnosis diagnosis);
void add(Diagnosis diagnosis);
void deleteById(Long id);
Object getAllByLimit(Diagnosis diagnosis);
}
|
(3)Mapper层编码实现
package com.phms.mapper;
import com.phms.pojo.Diagnosis;
import com.phms.pojo.DiagnosisExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface DiagnosisMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table diagnosis
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
long countByExample(DiagnosisExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table diagnosis
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int deleteByExample(DiagnosisExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table diagnosis
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table diagnosis
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int insert(Diagnosis record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table diagnosis
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int insertSelective(Diagnosis record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table diagnosis
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
List<Diagnosis> selectByExample(DiagnosisExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table diagnosis
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
Diagnosis selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table diagnosis
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int updateByExampleSelective(@Param("record") Diagnosis record, @Param("example") DiagnosisExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table diagnosis
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int updateByExample(@Param("record") Diagnosis record, @Param("example") DiagnosisExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table diagnosis
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int updateByPrimaryKeySelective(Diagnosis record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table diagnosis
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int updateByPrimaryKey(Diagnosis record);
List<Diagnosis> getAllByLimit(Diagnosis diagnosis);
int countAllByLimit(Diagnosis diagnosis);
}
|
4.4 医院管理功能实现
功能介绍
用于查询宠物店医院指南情况,可以管理员进行编辑和查询、增加。
(1)控制层编码实现
package com.phms.controller.user;
import com.phms.pojo.Notice;
import com.phms.service.NoticeService;
import com.phms.utils.MyUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.ui.Model;
import java.util.Date;
/**
* 健康指南
*/
@Controller("UserNoticeController")
@RequestMapping("/user/notice")
public class UserNoticeController {
@Autowired
private NoticeService noticeService;
private final Logger logger = LoggerFactory.getLogger(this.getClass());
/**
* 查看详情页面/user/xqWord.html
*/
@RequestMapping("/xq")
public String xq(Long id, Model model) {
noticeService.view(id);
Notice word = noticeService.getById(id);
System.out.println(word.getContent());
model.addAttribute("c", word.getContent());
model.addAttribute("title", word.getTitle());
model.addAttribute("view", word.getViewCount());
model.addAttribute("time", MyUtils.getDate2String(word.getCreateTime()));
return "/user/xqWord";
}
/**
* 普通用户查看列表/user/wordList.html
*/
@RequestMapping("/list")
public String list() {
return "/user/wordList";
}
/**
* 医生查看列表/user/wordListDoctor.html
*/
@RequestMapping("/listDoctor")
public String listDoctor() {
return "/user/wordListDoctor";
}
/**
* 医生发布指南页面/user/word.html
*/
@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) {
try {
for (String id : ids){
noticeService.deleteById(Long.parseLong(id));
}
return "SUCCESS";
} catch (Exception e) {
e.printStackTrace();
return "ERR";
}
}
}
|
(2)Service层编码实现
package com.phms.service;
import com.phms.pojo.Notice;
public interface NoticeService {
void update(Notice notice);
void add(Notice notice);
void deleteById(Long id);
Object getAllByLimit(Notice notice);
Notice getById(Long id);
void view(Long id);
}
|
(3)Mapper层编码实现
package com.phms.mapper;
import com.phms.pojo.Notice;
import com.phms.pojo.NoticeExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface NoticeMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
long countByExample(NoticeExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int deleteByExample(NoticeExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int insert(Notice record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int insertSelective(Notice record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
List<Notice> selectByExample(NoticeExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
Notice selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int updateByExampleSelective(@Param("record") Notice record, @Param("example") NoticeExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int updateByExample(@Param("record") Notice record, @Param("example") NoticeExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int updateByPrimaryKeySelective(Notice record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table notice
*
* @mbg.generated Mon Apr 06 17:03:33 CST 2020
*/
int updateByPrimaryKey(Notice record);
List<Notice> getAllByLimit(Notice po);
int countAllByLimit(Notice po);
}
|
基于Springboot的宠物医院管理系统-JAVA【毕业设计、论文、源码、开题报告】相关推荐
- 基于Springboot的宠物医院管理系统-JAVA【数据库设计、论文、源码、开题报告】
1 绪论 1.1 课题背景 在信息技术高速发展的今天,新知识.新技术层出不穷,计算机技术早已广泛的应用于各行各业之中,利用计算机的强大数据处理能力和辅助决策能力叫,实现行业管理的规范化.标准化.效率化 ...
- 基于微信奶茶外卖小程序商城毕业设计 毕设源码 开题报告参考
- 基于springboot的宠物医院管理系统的设计与实现
1,项目介绍 基于 SpringBoot 的宠物医院管理系统拥有 5 种角色,分别为管理员.用户.医生.美容师.业务管理员. 已注册用户 个人信息和宠物信息管理,发布预约单(预约医生和美容师),在医院 ...
- 基于jsp+ssm+springboot的小区物业管理系统【设计+论文+源码】
摘 要 随着科学技术的飞速发展,各行各业都在努力与现代先进技术接轨,通过科技手段提高自身的优势:对于小区物业管理系统当然也不能排除在外,随着网络技术的不断成熟,带动了小区物业管理系统,它彻底改变了过去 ...
- 基于springboot实现宠物医院管理系统,linux系统与网络服务管理技术大全光盘
下面展示一下系统的基本功能: 管理员登陆: 帐户管理 帐户添加 医生列表 留言板 前台柜员登陆 宠物列表 ![](https://img-blog.csdnimg.cn/202108171847244 ...
- 基于springboot的手办定制销售系统 毕业设计-附源码031800
Springboot手办定制销售系统 摘要 随着人们生活水平的提高和互联网的发展,人们消费思想和消费方式的逐渐改变,使得消费者开始追求自身品味和个性.手办定制就是在这种条件下应运而生.手办定制是基于客 ...
- JAVA宠物医院管理系统计算机毕业设计Mybatis+系统+数据库+调试部署
JAVA宠物医院管理系统计算机毕业设计Mybatis+系统+数据库+调试部署 JAVA宠物医院管理系统计算机毕业设计Mybatis+系统+数据库+调试部署 本源码技术栈: 项目架构:B/S架构 开发语 ...
- SpringBoot的宠物医院管理系统(有文档)
SpringBoot的宠物医院管理系统 本项目适合用来学习,以及二次开发,分享下 简介 1.访问地址 http://localhost:8080/ 超级管理员账户 账户名:admin 密码:admin ...
- java计算机毕业设计ssm基于web的教学资源管理系统01jkz(附源码、数据库)
java计算机毕业设计ssm基于web的教学资源管理系统01jkz(附源码.数据库) 项目运行 环境配置: Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX(Webstor ...
最新文章
- 北信源IPO,拟筹资开发企业级云安全管理平台
- SQL*Plus 说明
- php空格是什么,php删除空格函数是什么
- java导出生成word
- html百度地图标记图标,百度地图开发之点击地图给该位置添加标注(图标)并弹出对应的位置...
- TEE_ObjectHandle在Crypto中的使用
- Flask的csrf_token校验
- RxJS mergeMap 学习笔记
- 电路板上的插头怎么拔下来_空调插头一直不拔费电吗?实测一周竟然发现了真相!...
- .NET Core 3 WPF MVVM框架 Prism系列之事件聚合器
- linux保存编辑信息,linux系统编辑神器 -vim用法大全
- ggplot2分面柱状图柱子比例一致_R语言柱状图
- 打造狂拽炫酷的主流自定义侧滑控件(仿酷狗和QQ5.0)
- js中运算符的优先级
- office插件开发_OneKeyTools:强大PPT插件
- 若干个数据首尾相连,构成一个圆环,找到连续的4个数之和最大的一段。 C++
- 阿拉伯数字转人民币大写
- go、JS AES(CBC模式)加密解密兼容
- unity3d培训_007
- 美术加艺考美术班:速写怎么练习效率最高?
热门文章
- 360压缩for linux
- mysql安装了libaio还是报错_ubuntu安装mysql遇到的坑----解决Mysql报错缺少libaio.so.1
- NYOJ 非洲小孩
- 11月VR AR投资现状,游戏开发和行业应用受资本青睐
- ddr老化测试_【鼎阳硬件智库原创︱DDR 】 DDR硬件调试篇:DDR硬件设计调试测试 之二...
- 【樽海鞘算法】基于疯狂自适应的樽海鞘算法求解单目标优化问题附matlab代码
- 网络地址转换--静态NAT
- 内存泄漏查找工具VLD的使用
- linux网络引导安装windows,pxe启动网络安装CentOS(win平台)
- 分析《 yolov7人脸+手机检测模型训练》