百度网站建设需要钱,电子商务网站名字,wordpress 角色权限,数字资产交易网站建设TOC
springboot503基于SringbootVue个人驾校预约管理系统--论文pf
第1章 绪论
1.1选题动因
当前的网络技术#xff0c;软件技术等都具备成熟的理论基础#xff0c;市场上也出现各种技术开发的软件#xff0c;这些软件都被用于各个领域#xff0c;包括生活和工作的领域。…TOC
springboot503基于SringbootVue个人驾校预约管理系统--论文pf
第1章 绪论
1.1选题动因
当前的网络技术软件技术等都具备成熟的理论基础市场上也出现各种技术开发的软件这些软件都被用于各个领域包括生活和工作的领域。随着电脑和笔记本的广泛运用以及各种计算机硬件的完善和升级市面上的电脑和笔记本的性能都得到提升可以支持的软件也逐渐增多因此在计算机上安装软件来发挥其高效地信息处理的作用则很受人们的青睐。对于个人驾校预约管理系统信息来讲通过手工形式处理在面对庞大的信息数量时就显得不适宜了首先需要花费的时间比较多其次数据出错率比较高而且对错误的数据进行更改也比较困难最后检索数据费事费力。因此为了解决上述问题有必要建立个人驾校预约管理系统来规范个人驾校预约管理系统信息管理流程让管理工作可以系统化和程序化同时个人驾校预约管理系统的有效运用可以帮助管理人员准确快速地处理信息。
1.2目的和意义
个人驾校预约管理系统可以对个人驾校预约管理系统信息进行集中管理可以真正避免传统管理的缺陷。个人驾校预约管理系统是一款运用软件开发技术设计实现的应用系统在信息处理上可以达到快速的目的不管是针对数据添加数据维护和统计以及数据查询等处理要求个人驾校预约管理系统都可以轻松应对。所以个人驾校预约管理系统的运用是让个人驾校预约管理系统信息管理升级的最好方式。它可以实现信息处理的便利化要求还可以规范信息处理的流程让事务处理成为管理人员手中的一件简单事而不是之前手工处理时的困难事。尽管个人驾校预约管理系统具备较完善的功能但是也需要管理人员利用闲暇时间提升自身素质以及个人能力在操作个人驾校预约管理系统时可以最大化运用个人驾校预约管理系统提供的功能让系统在满足高效率处理数据的同时也能始终稳定运行还可以确保数据的可靠性与数据处理的质量。
1.3论文结构安排
本文总共分为6个章节每个章节都对本系统描述了不同的内容。接下来就对本文的研究内容进行阐述。
第1章这个章节是论文的绪论部分。从选题的背景和意义的角度阐述即将开发的系统。
第2章这个章节是技术介绍部分。从本系统需要运用的技术知识的角度阐述系统。
第3章这个章节是系统分析部分。从分析系统可行性分析系统功能和性能等角度阐述系统。
第4章这个章节是系统设计部分。从系统功能结构的角度和数据库设计的角度阐述系统。
第5章这个章节是系统实现部分。从系统功能模块运行效果的角度阐述系统。
第6章这个章节是系统测试部分。从测试系统功能系统测试方法的角度阐述系统。
第2章 开发环境与技术
开发个人驾校预约管理系统需要搭建编程的环境也需要通过调查对各个相关技术进行分析选取适合本系统开发的技术与工具。
2.1 MySQL数据库
题目确定了是一个应用程序之后就开始按部就班的进行设计与分析。本课题是需要数据库作为数据管理工具以及数据载体从程序功能分析到数据分析选择合适的关系型数据库是当下所选择的重要环节。关系型数据库可选择余地不多本身甲骨文公司的两个微软的两个IBM的一个也就是这五个了功能和差异都不影响数据库的选择因为这些数据库都能实现应用程序功能所需的那么只能从其他的方面来综合考虑哪种数据库更合适。作为开发使用的电脑硬件上来讲还是大一的时候买的当初并没有太多的钱买好一点的电脑只是作为学习用的所以经过这么几年的使用电脑老化了性能下降也比较厉害还有好多需要用的学习资料本身面临毕业选择学校机房也不是一个长久的打算选择一个数据库适合自己的老旧笔记本电脑作为学习开发当前的应用是最重要的。综合考虑的结果就是选用MySQL数据库作为应用数据库因为MySQL数据库体积小占用内存小不影响电脑上其他用的软件运行并且不需要因为安装维护MySQL数据库而重装系统最终选择的数据库就是MySQL数据库。
2.2 Tomcat 介绍
刚开始学习Java语言的时候是不知道还有Tomcat这些东西的各种语法各种输出在控制台进行输出结果当Java网站开发的时候就不可避免的学习到了Tomcat服务器。Tomcat准确的来讲不算是服务器可以说是vue引擎或者一个容器这些都是学术上或者原理上都比较贴切的但是实际工作中Tomcat就是作为一个web服务器来用的因为可以实现网站的发布和运行。因为工作原理的原因Tomcat一般作为中小型企业和并发量并不突出的一种轻量级的服务器存在的比如某些行业的应用系统本身客户端就不多需要的连接也不多一般都用Tomcat的。Tomcat里面可以配置多个网站配置文件后缀是config的文档类似于XML的结构比较清晰明了。每当Java发布新的版本的时候Tomcat也会为了匹配Java的版本进行升级目前Tomcat版本已经到版本10了。Tomcat标识是一只有点发黄的小猫咪当Tomcat配置成功一般测试的时候能看到这个小猫咪就算是成功的才能进行下一步的配置。Tomcat服务器在Java网站开发中还是挺合适的。
2.3 vue技术
vue技术可以让初学者尽快上手进行编写动态网站不需要变成高级的Java编程人员才可以书写代码从学习的效率还有编写的效率上都有很大的提升。让着重于网页开发者与着重于后台逻辑开发进行分离合作开发变成了一种可能降低了学习成本不需要考虑程序运行解释编译阶段的话vue网页本身就可以理解成一个普通的Servlet。vue结构上面主要分为两个方面一个是专属的vue引擎通俗的讲就是可以实现vue编译后运行解释的一个东西另一个就是web服务器。vue运行编译需要vue引擎和web服务器进行配合以及相互协作当然他们的分工也是很明确的这样才可以真正的运行起来。
2.4 SpringBoot框架
从取名上能够得知这一框架设计初心快速开启Spring运用。因而Spring。 实质上Boot应用程序是一个根据Spring框架的应用程序。这是Spring“协议书先于配置”理论的良好实践物质。可以帮助开发者迅速、更有效地搭建根据Spring生态系统中的应用程序。
Spring Boot实现自动配置、发展依靠、Actuator、命令行界面(CLI) 是Spring Boot最主要的四个核心特点在其中CLI是Spring Boot的能选特点尽管功能齐全却也引入了一套非传统的开发模型因此本系列文章只注重别的三个特点。如标题本问题是本系列的第一部分将为您开启Spring Boot大门关键为您进一步分析启动过程及全自动配置完成基本原理。把握这一部分主要内容了解一些Spring框架的基本知识也会让你游刃有余。
第3章 系统分析
用户的需求以及与本系统相似的在市场上存在的其它系统可以作为系统分析中参考的资料分析人员可以根据这些信息确定出本系统具备的功能分析出本系统具备的性能等内容。
3.1可行性分析
尽管系统是根据用户的要求进行制作但是在确定制作前有必要分析其可行性。
3.1.1操作可行性分析
开发本系统需要用到的工具本人都比较熟悉因此可以使用这些工具完整开发个人驾校预约管理系统。此外个人驾校预约管理系统在功能上基本都是完成信息的处理涵盖了添加修改删除等而且操作者面对的都是各个功能操作界面并不是编码后台所以一般的使用者都可以通过操作界面轻松完成信息的加工处理。因此本系统操作可行。
3.1.2经济可行性分析
开发本系统并没有投入资金购买开发工具。因为使用的开发工具都是事先在百度上下载安装在本人电脑上的随着软件开发技术的成熟系统功能实现的编码也都模块化很容易通过各大软件开发类网站获取并通过小部分代码改动运用到本系统中这些都不需要资金投入同时本系统开发的结构选用B/S成本可以忽略不计。
3.1.3技术可行性分析
本系统需要的软件包括IdeaTomcatMySQL等这些工具都接触并使用过至于JAVAB/SvueHtml等技术图书馆都有对应的书籍可以参考学习加上平时课堂上学习的编程小项目对这些技术都有讲解另外本人也从课程设计作业中锻炼了编程能力。所以在技术上可以完成个人驾校预约管理系统的编程开发。
通过上面的分析已经确定了本系统在经济上的可行本系统在技术上的可行本系统在操作上的可行。由此可以得出在目前的条件下对于个人驾校预约管理系统的设计与实现是可以进行下去的。
3.2系统流程分析
本系统在处理数据时其内部的操作逻辑也需要使用相应的工具进行展示。
在本系统的数据录入页面对于操作者提供的每条数据都有相应的检验规则比如数据信息不能有非法字符或者本来应该是汉字的数据不能用字母代替还有对数据内容的长度等进行规范这样的可以确保数据准确性的检验规则在编码时就提前编写好了。数据添加的流程见下图。如果数据已经保存进入数据库则说明操作者提供的数据内容和格式都是符合要求的。 图3.1 添加信息流程图
很多时候面对系统中的大量数据难免会发现一些错误因此需要及时纠正错误本系统也提供数据后期的修改功能其流程见下图。但是更新的数据也需要通过数据有效性检验。能够最终写入数据库则说明修改的数据是符合要求的。 图3.2 修改信息流程图
面对数据库里面大量数据在系统的前台要想快速获取需要的信息就需要使用查询功能。其流程见下图。该功能需要操作者提前输入关键词当系统的后台数据库保存了与关键词匹配的数据时就会及时显示出来整个过程耗时很短。 图3.3 查询信息流程图
3.3系统性能分析
分析个人驾校预约管理系统对于性能的需求主要还是从下面的5个角度来分析它们分别是系统的实用性系统的适应性系统的易操作性系统的安全性和系统的易维护性。
性能需求一系统的实用性本系统主要是让管理人员集中处理相关信息可以提供方便快捷的信息添加信息编辑等操作。在提高信息管理人员的工作效率的同时也可以降低管理成本并大大减少管理人员日常繁琐的工作量。
性能需求二系统的适应性本系统对于运行环境的要求并不高可以被广泛运用在生活中。因为使用者只要在日常使用的计算机或者是随身携带的笔记本上搭建运行环境都能运行本系统另外系统提供的基础功能包括添加修改等都能随时操作。
性能需求三系统的易操作性本系统提供的功能跟同类型系统一样也具备简单的增删改操作操作流程的逻辑也符合广大使用者的使用需求使用者使用本系统管理数据会非常顺手。
性能需求四系统的安全性本系统在数据保存与管理上安全系数要达标在设计与编码阶段通过对用户进行权限分配把系统的功能依照不同用户的角色进行分配在首次进入系统时通过编写安全验证的代码模块引导不同用户进入不同的操作界面。还可以对用户基础信息包括登录的账号密码等进行加密保存可以利用当下常用的技术成熟的MD5加密技术实现。
性能需求五系统的易维护性本系统在后期运行中会根据使用者的操作产生许多数据信息为了便于维护就要求这些数据可以通过工具从数据库中导出来对于一些阶段性数据可以进行批量删除以此达到轻负荷处理数据的目标让本系统可以变得更加轻盈。
第4章 系统设计
市面上设计比较好的系统都有一个共同特征就是主题鲜明突出。通过对页面简洁清晰的布局让页面的内容包括文字语言或者视频图片等元素可以清晰表达出系统的主题。让来访用户无需花费过多精力和时间找寻需要的内容。
4.1界面设计原则
一般来说大部分用户使用系统有些是想从系统中获取需要的信息有些则是使用系统提供的服务。所以为了改善用户体验提高系统的使用率在对系统界面设计时需要按照下面的原则进行。
第一点对用户进行分析了解用户使用系统的目的以及使用系统的方式考虑大部分用户的阅读习惯设计Z字形或F型结构可以方便用户获取信息。
第二点设计有效的导航这个包括每个页面上都有导航条的显示有时也可以在页面的底部设计导航条当用户进入具体页面时要设计相应的位置提示在页面中比较特殊的位置需要设计返回链接可以返回上个页面也可以返回首页等。
第三点对整个系统要运用统一的设计方案包括色彩方案的一致性页面模板的相似性等对相同操作和专业术语的描述在整个系统中也应该保持一致。
第四点设计的界面要保证传达的内容清晰准确。要避免在同一个页面设计非常多的内容另外可以准确对系统内容进行分类把页面中用户视觉集中的位置用来显示重要信息。
作为初学者并没有那么多的设计经验但是可以运用上面提到的界面设计原则设计出比较好的系统可以让用户产生良好的使用体验。
4.2功能结构设计
为了让系统的编码可以顺利进行特意对本系统功能进行细分设计设计的系统功能结构见下图。 图4.1 系统功能结构图
4.3数据库设计
一般来说对用户进行调查了解其需求主要还是完成功能上的分析设计殊不知设计功能时也要展示对数据库的设计。数据库服务于程序它可以按照设定的规则对程序的数据进行保存因此也可以说数据库就是程序相关数据的集合。所以设计出合理的数据库是多么的重要。
4.3.1 数据库逻辑设计
1下图是用户实体和其具备的属性。 用户实体属性图
2下图是教练实体和其具备的属性。 教练实体属性图
3下图是教练预约实体和其具备的属性。 教练预约实体属性图
4下图是教练留言实体和其具备的属性。 教练留言实体属性图
5下图是车辆收藏实体和其具备的属性。 车辆收藏实体属性图
6下图是论坛实体和其具备的属性。 论坛实体属性图
7下图是车辆实体和其具备的属性。 车辆实体属性图
8下图是公告资讯实体和其具备的属性。 公告资讯实体属性图
9下图是教练收藏实体和其具备的属性。 教练收藏实体属性图
10下图是车辆留言实体和其具备的属性。 车辆留言实体属性图
11下图是车辆预约实体和其具备的属性。 车辆预约实体属性图
4.3.2 数据库物理设计
作为程序后台的支持本数据库也需要设计数据存储的结构。而数据存储结构的设计就包括了数据表结构的设计和创建。数据表结构包括了字段数据类型还有字段的取值范围等信息。而E-R模型中的实体就是一张表实体的特征就可以作为该表中的字段根据本程序信息存储要求设计每个字段需要的类型还有该字段的取值范围等。每当设计完成一张数据表就需要及时保存在数据库里面并对该设计的数据表准确命名要求设置的数据表的名称尽量不要是中文而且要方便记忆。因为在程序编码阶段通过SQL语句可以把程序里面的数据写入在各个数据表里面而这个环节需要使用到数据表的名称。如果数据表名称是中文的话可能会乱码并影响程序运行。下面就以表格形式展示设计的结果。
表4.1车辆表
序号列名数据类型说明允许空1IdIntid否2cheliang_uuid_numberString车辆编号是3cheliang_nameString车辆牌号是4cheliang_photoString车辆图片是5cheliang_typesInteger车辆类型是6cheliang_clicknumInteger车辆热度是7cheliang_contentString车辆介绍是8cheliang_deleteInteger逻辑删除是9insert_timeDate录入时间是10create_timeDate创建时间是
表4.2车辆收藏表
序号列名数据类型说明允许空1IdIntid否2cheliang_idInteger车辆是3yonghu_idInteger用户是4cheliang_collection_typesInteger类型是5insert_timeDate收藏时间是6create_timeDate创建时间是
表4.3车辆留言表
序号列名数据类型说明允许空1IdIntid否2cheliang_idInteger车辆是3yonghu_idInteger用户是4cheliang_liuyan_textString留言内容是5insert_timeDate留言时间是6reply_textString回复内容是7update_timeDate回复时间是8create_timeDate创建时间是
表4.4车辆预约表
序号列名数据类型说明允许空1IdIntid否2cheliang_yuyue_uuid_numberString预约编号是3cheliang_idInteger车辆是4yonghu_idInteger用户是5cheliang_yuyue_textString备注是6cheliang_yuyue_timeDate预约时间是7cheliang_yuyue_yesno_typesInteger预约状态是8cheliang_yuyue_yesno_textString审核回复是9insert_timeDate添加时间是10create_timeDate创建时间是
表4.5字典表
序号列名数据类型说明允许空1IdIntid否2dic_codeString字段是3dic_nameString字段名是4code_indexInteger编码是5index_nameString编码名字是6super_idInteger父字段id是7beizhuString备注是8create_timeDate创建时间是
表4.6论坛表
序号列名数据类型说明允许空1IdIntid否2forum_nameString帖子标题是3yonghu_idInteger用户是4jiaolian_idInteger教练是5users_idInteger管理员是6forum_contentString发布内容是7super_idsInteger父id是8forum_state_typesInteger帖子状态是9insert_timeDate发帖时间是10update_timeDate修改时间是11create_timeDate创建时间是
表4.7教练表
序号列名数据类型说明允许空1IdIntid否2jiaolian_uuid_numberString教练编号是3jiaolian_nameString教练名称是4jiaolian_photoString头像是5jiaolian_phoneString联系方式是6zan_numberInteger赞是7cai_numberInteger踩是8jiaolian_typesInteger教练类型是9jiaolian_clicknumInteger教练热度是10jiaolian_contentString教练介绍是11jiaolian_deleteInteger逻辑删除是12insert_timeDate录入时间是13create_timeDate创建时间是
表4.8教练收藏表
序号列名数据类型说明允许空1IdIntid否2jiaolian_idInteger教练是3yonghu_idInteger用户是4jiaolian_collection_typesInteger类型是5insert_timeDate收藏时间是6create_timeDate创建时间是
表4.9教练留言表
序号列名数据类型说明允许空1IdIntid否2jiaolian_idInteger教练是3yonghu_idInteger用户是4jiaolian_liuyan_textString留言内容是5insert_timeDate留言时间是6reply_textString回复内容是7update_timeDate回复时间是8create_timeDate创建时间是
表4.10教练预约表
序号列名数据类型说明允许空1IdIntid否2jiaolian_yuyue_uuid_numberString预约编号是3jiaolian_idInteger教练是4yonghu_idInteger用户是5jiaolian_yuyue_textString备注是6jiaolian_yuyue_timeDate预约时间是7jiaolian_yuyue_yesno_typesInteger预约状态是8jiaolian_yuyue_yesno_textString审核回复是9insert_timeDate添加时间是10create_timeDate创建时间是
表4.11公告资讯表
序号列名数据类型说明允许空1IdIntid否2news_nameString公告标题是3news_typesInteger车辆信息是4news_photoString公告图片是5insert_timeDate添加时间是6news_contentString公告详情是7create_timeDate创建时间是
表4.12用户表
序号列名数据类型说明允许空1IdIntid否2yonghu_nameString用户名称是3yonghu_phoneString用户手机号是4yonghu_id_numberString用户身份证号是5yonghu_photoString用户头像是6yonghu_emailString用户邮箱是7yonghu_deleteInteger逻辑删除是8insert_timeDate添加时间是9create_timeDate创建时间是
表4.13管理员表
序号列名数据类型说明允许空1IdIntid否2usernameString医院名是3passwordString密码是4roleString角色是5addtimeDate新增时间是
第5章 系统实现
这个环节需要使用前面的设计方案包括对系统模块的设计还有对程序后台的数据支持的数据库的设计等。不过这部分内容还是强调系统编码人员的开发能力要把前面设计的内容通过编码的形式以一个完整的可以运行的系统呈现出来。
功能模块的实现
5.1用户信息管理
如图5.1显示的就是用户信息管理页面此页面提供给管理员的功能有用户信息的查询管理可以删除用户信息、修改用户信息、新增用户信息
还进行了对用户名称的模糊查询的条件 图5.1 用户信息管理页面
5.2 教练信息管理
如图5.2显示的就是教练信息管理页面此页面提供给管理员的功能有查看已发布的教练信息数据修改教练信息教练信息作废即可删除还进行了对教练信息名称的模糊查询 教练信息信息的类型查询等等一些条件。 图5.2 教练信息管理页面
5.3车辆信息管理
如图5.3显示的就是车辆信息管理页面此页面提供给管理员的功能有根据车辆信息进行条件查询还可以对车辆信息进行新增、修改、查询操作等等。 图5.3 车辆信息管理页面
5.1公告信息管理
如图5.4显示的就是公告信息管理页面此页面提供给管理员的功能有根据公告信息进行新增、修改、查询操作等等。 图5.4 公告信息管理页面 ConfigController.java package com.controller;import java.util.Arrays;
import java.util.Map;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.service.ConfigService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;/*** 登录相关*/
RequestMapping(config)
RestController
public class ConfigController{Autowiredprivate ConfigService configService;/*** 列表*/RequestMapping(/page)public R page(RequestParam MapString, Object params,ConfigEntity config){EntityWrapperConfigEntity ew new EntityWrapperConfigEntity();PageUtils page configService.queryPage(params);return R.ok().put(data, page);}/*** 列表*/IgnoreAuthRequestMapping(/list)public R list(RequestParam MapString, Object params,ConfigEntity config){EntityWrapperConfigEntity ew new EntityWrapperConfigEntity();PageUtils page configService.queryPage(params);return R.ok().put(data, page);}/*** 信息*/RequestMapping(/info/{id})public R info(PathVariable(id) String id){ConfigEntity config configService.selectById(id);return R.ok().put(data, config);}/*** 详情*/IgnoreAuthRequestMapping(/detail/{id})public R detail(PathVariable(id) String id){ConfigEntity config configService.selectById(id);return R.ok().put(data, config);}/*** 根据name获取信息*/RequestMapping(/info)public R infoByName(RequestParam String name){ConfigEntity config configService.selectOne(new EntityWrapperConfigEntity().eq(name, faceFile));return R.ok().put(data, config);}/*** 保存*/PostMapping(/save)public R save(RequestBody ConfigEntity config){
// ValidatorUtils.validateEntity(config);configService.insert(config);return R.ok();}/*** 修改*/RequestMapping(/update)public R update(RequestBody ConfigEntity config){
// ValidatorUtils.validateEntity(config);configService.updateById(config);//全部更新return R.ok();}/*** 删除*/RequestMapping(/delete)public R delete(RequestBody Long[] ids){configService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}
JiaolianLiuyanController.java package com.controller;import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
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.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;/*** 教练留言* 后端接口* author* email
*/
RestController
Controller
RequestMapping(/jiaolianLiuyan)
public class JiaolianLiuyanController {private static final Logger logger LoggerFactory.getLogger(JiaolianLiuyanController.class);private static final String TABLE_NAME jiaolianLiuyan;Autowiredprivate JiaolianLiuyanService jiaolianLiuyanService;Autowiredprivate TokenService tokenService;Autowiredprivate CheliangService cheliangService;//车辆Autowiredprivate CheliangCollectionService cheliangCollectionService;//车辆收藏Autowiredprivate CheliangLiuyanService cheliangLiuyanService;//车辆留言Autowiredprivate CheliangYuyueService cheliangYuyueService;//车辆预约Autowiredprivate DictionaryService dictionaryService;//字典Autowiredprivate ForumService forumService;//论坛Autowiredprivate JiaolianService jiaolianService;//教练Autowiredprivate JiaolianCollectionService jiaolianCollectionService;//教练收藏Autowiredprivate JiaolianYuyueService jiaolianYuyueService;//教练预约Autowiredprivate NewsService newsService;//公告资讯Autowiredprivate YonghuService yonghuService;//用户Autowiredprivate UsersService usersService;//管理员/*** 后端列表*/RequestMapping(/page)public R page(RequestParam MapString, Object params, HttpServletRequest request){logger.debug(page方法:,,Controller:{},,params:{},this.getClass().getName(),JSONObject.toJSONString(params));String role String.valueOf(request.getSession().getAttribute(role));if(false)return R.error(511,永不会进入);else if(用户.equals(role))params.put(yonghuId,request.getSession().getAttribute(userId));else if(教练.equals(role))params.put(jiaolianId,request.getSession().getAttribute(userId));CommonUtil.checkMap(params);PageUtils page jiaolianLiuyanService.queryPage(params);//字典表数据转换ListJiaolianLiuyanView list (ListJiaolianLiuyanView)page.getList();for(JiaolianLiuyanView c:list){//修改对应字典表字段dictionaryService.dictionaryConvert(c, request);}return R.ok().put(data, page);}/*** 后端详情*/RequestMapping(/info/{id})public R info(PathVariable(id) Long id, HttpServletRequest request){logger.debug(info方法:,,Controller:{},,id:{},this.getClass().getName(),id);JiaolianLiuyanEntity jiaolianLiuyan jiaolianLiuyanService.selectById(id);if(jiaolianLiuyan !null){//entity转viewJiaolianLiuyanView view new JiaolianLiuyanView();BeanUtils.copyProperties( jiaolianLiuyan , view );//把实体数据重构到view中//级联表 教练//级联表JiaolianEntity jiaolian jiaolianService.selectById(jiaolianLiuyan.getJiaolianId());if(jiaolian ! null){BeanUtils.copyProperties( jiaolian , view ,new String[]{ id, createTime, insertTime, updateTime, yonghuId
, jiaolianId});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表view.setJiaolianId(jiaolian.getId());}//级联表 用户//级联表YonghuEntity yonghu yonghuService.selectById(jiaolianLiuyan.getYonghuId());if(yonghu ! null){BeanUtils.copyProperties( yonghu , view ,new String[]{ id, createTime, insertTime, updateTime, yonghuId
, jiaolianId});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表view.setYonghuId(yonghu.getId());}//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put(data, view);}else {return R.error(511,查不到数据);}}/*** 后端保存*/RequestMapping(/save)public R save(RequestBody JiaolianLiuyanEntity jiaolianLiuyan, HttpServletRequest request){logger.debug(save方法:,,Controller:{},,jiaolianLiuyan:{},this.getClass().getName(),jiaolianLiuyan.toString());String role String.valueOf(request.getSession().getAttribute(role));if(false)return R.error(511,永远不会进入);else if(用户.equals(role))jiaolianLiuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute(userId))));else if(教练.equals(role))jiaolianLiuyan.setJiaolianId(Integer.valueOf(String.valueOf(request.getSession().getAttribute(userId))));jiaolianLiuyan.setCreateTime(new Date());jiaolianLiuyan.setInsertTime(new Date());jiaolianLiuyanService.insert(jiaolianLiuyan);return R.ok();}/*** 后端修改*/RequestMapping(/update)public R update(RequestBody JiaolianLiuyanEntity jiaolianLiuyan, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {logger.debug(update方法:,,Controller:{},,jiaolianLiuyan:{},this.getClass().getName(),jiaolianLiuyan.toString());JiaolianLiuyanEntity oldJiaolianLiuyanEntity jiaolianLiuyanService.selectById(jiaolianLiuyan.getId());//查询原先数据String role String.valueOf(request.getSession().getAttribute(role));
// if(false)
// return R.error(511,永远不会进入);
// else if(用户.equals(role))
// jiaolianLiuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute(userId))));
// else if(教练.equals(role))
// jiaolianLiuyan.setJiaolianId(Integer.valueOf(String.valueOf(request.getSession().getAttribute(userId))));jiaolianLiuyan.setUpdateTime(new Date());jiaolianLiuyanService.updateById(jiaolianLiuyan);//根据id更新return R.ok();}/*** 删除*/RequestMapping(/delete)public R delete(RequestBody Integer[] ids, HttpServletRequest request){logger.debug(delete:,,Controller:{},,ids:{},this.getClass().getName(),ids.toString());ListJiaolianLiuyanEntity oldJiaolianLiuyanList jiaolianLiuyanService.selectBatchIds(Arrays.asList(ids));//要删除的数据jiaolianLiuyanService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 批量上传*/RequestMapping(/batchInsert)public R save( String fileName, HttpServletRequest request){logger.debug(batchInsert方法:,,Controller:{},,fileName:{},this.getClass().getName(),fileName);Integer yonghuId Integer.valueOf(String.valueOf(request.getSession().getAttribute(userId)));SimpleDateFormat sdf new SimpleDateFormat(yyyy-MM-dd HH:mm:ss);//.eq(time, new SimpleDateFormat(yyyy-MM-dd).format(new Date()))try {ListJiaolianLiuyanEntity jiaolianLiuyanList new ArrayList();//上传的东西MapString, ListString seachFields new HashMap();//要查询的字段Date date new Date();int lastIndexOf fileName.lastIndexOf(.);if(lastIndexOf -1){return R.error(511,该文件没有后缀);}else{String suffix fileName.substring(lastIndexOf);if(!.xls.equals(suffix)){return R.error(511,只支持后缀为xls的excel文件);}else{URL resource this.getClass().getClassLoader().getResource(static/upload/ fileName);//获取文件路径File file new File(resource.getFile());if(!file.exists()){return R.error(511,找不到上传文件请联系管理员);}else{ListListString dataList PoiUtil.poiImport(file.getPath());//读取xls文件dataList.remove(0);//删除第一行因为第一行是提示for(ListString data:dataList){//循环JiaolianLiuyanEntity jiaolianLiuyanEntity new JiaolianLiuyanEntity();
// jiaolianLiuyanEntity.setJiaolianId(Integer.valueOf(data.get(0))); //教练 要改的
// jiaolianLiuyanEntity.setYonghuId(Integer.valueOf(data.get(0))); //用户 要改的
// jiaolianLiuyanEntity.setJiaolianLiuyanText(data.get(0)); //留言内容 要改的
// jiaolianLiuyanEntity.setInsertTime(date);//时间
// jiaolianLiuyanEntity.setReplyText(data.get(0)); //回复内容 要改的
// jiaolianLiuyanEntity.setUpdateTime(sdf.parse(data.get(0))); //回复时间 要改的
// jiaolianLiuyanEntity.setCreateTime(date);//时间jiaolianLiuyanList.add(jiaolianLiuyanEntity);//把要查询是否重复的字段放入map中}//查询是否重复jiaolianLiuyanService.insertBatch(jiaolianLiuyanList);return R.ok();}}}}catch (Exception e){e.printStackTrace();return R.error(511,批量插入数据异常请联系管理员);}}/*** 前端列表*/IgnoreAuthRequestMapping(/list)public R list(RequestParam MapString, Object params, HttpServletRequest request){logger.debug(list方法:,,Controller:{},,params:{},this.getClass().getName(),JSONObject.toJSONString(params));CommonUtil.checkMap(params);PageUtils page jiaolianLiuyanService.queryPage(params);//字典表数据转换ListJiaolianLiuyanView list (ListJiaolianLiuyanView)page.getList();for(JiaolianLiuyanView c:list)dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段return R.ok().put(data, page);}/*** 前端详情*/RequestMapping(/detail/{id})public R detail(PathVariable(id) Long id, HttpServletRequest request){logger.debug(detail方法:,,Controller:{},,id:{},this.getClass().getName(),id);JiaolianLiuyanEntity jiaolianLiuyan jiaolianLiuyanService.selectById(id);if(jiaolianLiuyan !null){//entity转viewJiaolianLiuyanView view new JiaolianLiuyanView();BeanUtils.copyProperties( jiaolianLiuyan , view );//把实体数据重构到view中//级联表JiaolianEntity jiaolian jiaolianService.selectById(jiaolianLiuyan.getJiaolianId());if(jiaolian ! null){BeanUtils.copyProperties( jiaolian , view ,new String[]{ id, createDate});//把级联的数据添加到view中,并排除id和创建时间字段view.setJiaolianId(jiaolian.getId());}//级联表YonghuEntity yonghu yonghuService.selectById(jiaolianLiuyan.getYonghuId());if(yonghu ! null){BeanUtils.copyProperties( yonghu , view ,new String[]{ id, createDate});//把级联的数据添加到view中,并排除id和创建时间字段view.setYonghuId(yonghu.getId());}//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put(data, view);}else {return R.error(511,查不到数据);}}/*** 前端保存*/RequestMapping(/add)public R add(RequestBody JiaolianLiuyanEntity jiaolianLiuyan, HttpServletRequest request){logger.debug(add方法:,,Controller:{},,jiaolianLiuyan:{},this.getClass().getName(),jiaolianLiuyan.toString());jiaolianLiuyan.setCreateTime(new Date());jiaolianLiuyan.setInsertTime(new Date());jiaolianLiuyanService.insert(jiaolianLiuyan);return R.ok();}}
CheliangLiuyanController.java package com.controller;import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
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.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;/*** 车辆留言* 后端接口* author* email
*/
RestController
Controller
RequestMapping(/cheliangLiuyan)
public class CheliangLiuyanController {private static final Logger logger LoggerFactory.getLogger(CheliangLiuyanController.class);private static final String TABLE_NAME cheliangLiuyan;Autowiredprivate CheliangLiuyanService cheliangLiuyanService;Autowiredprivate TokenService tokenService;Autowiredprivate CheliangService cheliangService;//车辆Autowiredprivate CheliangCollectionService cheliangCollectionService;//车辆收藏Autowiredprivate CheliangYuyueService cheliangYuyueService;//车辆预约Autowiredprivate DictionaryService dictionaryService;//字典Autowiredprivate ForumService forumService;//论坛Autowiredprivate JiaolianService jiaolianService;//教练Autowiredprivate JiaolianCollectionService jiaolianCollectionService;//教练收藏Autowiredprivate JiaolianLiuyanService jiaolianLiuyanService;//教练留言Autowiredprivate JiaolianYuyueService jiaolianYuyueService;//教练预约Autowiredprivate NewsService newsService;//公告资讯Autowiredprivate YonghuService yonghuService;//用户Autowiredprivate UsersService usersService;//管理员/*** 后端列表*/RequestMapping(/page)public R page(RequestParam MapString, Object params, HttpServletRequest request){logger.debug(page方法:,,Controller:{},,params:{},this.getClass().getName(),JSONObject.toJSONString(params));String role String.valueOf(request.getSession().getAttribute(role));if(false)return R.error(511,永不会进入);else if(用户.equals(role))params.put(yonghuId,request.getSession().getAttribute(userId));else if(教练.equals(role))params.put(jiaolianId,request.getSession().getAttribute(userId));CommonUtil.checkMap(params);PageUtils page cheliangLiuyanService.queryPage(params);//字典表数据转换ListCheliangLiuyanView list (ListCheliangLiuyanView)page.getList();for(CheliangLiuyanView c:list){//修改对应字典表字段dictionaryService.dictionaryConvert(c, request);}return R.ok().put(data, page);}/*** 后端详情*/RequestMapping(/info/{id})public R info(PathVariable(id) Long id, HttpServletRequest request){logger.debug(info方法:,,Controller:{},,id:{},this.getClass().getName(),id);CheliangLiuyanEntity cheliangLiuyan cheliangLiuyanService.selectById(id);if(cheliangLiuyan !null){//entity转viewCheliangLiuyanView view new CheliangLiuyanView();BeanUtils.copyProperties( cheliangLiuyan , view );//把实体数据重构到view中//级联表 车辆//级联表CheliangEntity cheliang cheliangService.selectById(cheliangLiuyan.getCheliangId());if(cheliang ! null){BeanUtils.copyProperties( cheliang , view ,new String[]{ id, createTime, insertTime, updateTime, yonghuId});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表view.setCheliangId(cheliang.getId());}//级联表 用户//级联表YonghuEntity yonghu yonghuService.selectById(cheliangLiuyan.getYonghuId());if(yonghu ! null){BeanUtils.copyProperties( yonghu , view ,new String[]{ id, createTime, insertTime, updateTime, yonghuId});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表view.setYonghuId(yonghu.getId());}//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put(data, view);}else {return R.error(511,查不到数据);}}/*** 后端保存*/RequestMapping(/save)public R save(RequestBody CheliangLiuyanEntity cheliangLiuyan, HttpServletRequest request){logger.debug(save方法:,,Controller:{},,cheliangLiuyan:{},this.getClass().getName(),cheliangLiuyan.toString());String role String.valueOf(request.getSession().getAttribute(role));if(false)return R.error(511,永远不会进入);else if(用户.equals(role))cheliangLiuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute(userId))));cheliangLiuyan.setCreateTime(new Date());cheliangLiuyan.setInsertTime(new Date());cheliangLiuyanService.insert(cheliangLiuyan);return R.ok();}/*** 后端修改*/RequestMapping(/update)public R update(RequestBody CheliangLiuyanEntity cheliangLiuyan, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {logger.debug(update方法:,,Controller:{},,cheliangLiuyan:{},this.getClass().getName(),cheliangLiuyan.toString());CheliangLiuyanEntity oldCheliangLiuyanEntity cheliangLiuyanService.selectById(cheliangLiuyan.getId());//查询原先数据String role String.valueOf(request.getSession().getAttribute(role));
// if(false)
// return R.error(511,永远不会进入);
// else if(用户.equals(role))
// cheliangLiuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute(userId))));cheliangLiuyan.setUpdateTime(new Date());cheliangLiuyanService.updateById(cheliangLiuyan);//根据id更新return R.ok();}/*** 删除*/RequestMapping(/delete)public R delete(RequestBody Integer[] ids, HttpServletRequest request){logger.debug(delete:,,Controller:{},,ids:{},this.getClass().getName(),ids.toString());ListCheliangLiuyanEntity oldCheliangLiuyanList cheliangLiuyanService.selectBatchIds(Arrays.asList(ids));//要删除的数据cheliangLiuyanService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 批量上传*/RequestMapping(/batchInsert)public R save( String fileName, HttpServletRequest request){logger.debug(batchInsert方法:,,Controller:{},,fileName:{},this.getClass().getName(),fileName);Integer yonghuId Integer.valueOf(String.valueOf(request.getSession().getAttribute(userId)));SimpleDateFormat sdf new SimpleDateFormat(yyyy-MM-dd HH:mm:ss);//.eq(time, new SimpleDateFormat(yyyy-MM-dd).format(new Date()))try {ListCheliangLiuyanEntity cheliangLiuyanList new ArrayList();//上传的东西MapString, ListString seachFields new HashMap();//要查询的字段Date date new Date();int lastIndexOf fileName.lastIndexOf(.);if(lastIndexOf -1){return R.error(511,该文件没有后缀);}else{String suffix fileName.substring(lastIndexOf);if(!.xls.equals(suffix)){return R.error(511,只支持后缀为xls的excel文件);}else{URL resource this.getClass().getClassLoader().getResource(static/upload/ fileName);//获取文件路径File file new File(resource.getFile());if(!file.exists()){return R.error(511,找不到上传文件请联系管理员);}else{ListListString dataList PoiUtil.poiImport(file.getPath());//读取xls文件dataList.remove(0);//删除第一行因为第一行是提示for(ListString data:dataList){//循环CheliangLiuyanEntity cheliangLiuyanEntity new CheliangLiuyanEntity();
// cheliangLiuyanEntity.setCheliangId(Integer.valueOf(data.get(0))); //车辆 要改的
// cheliangLiuyanEntity.setYonghuId(Integer.valueOf(data.get(0))); //用户 要改的
// cheliangLiuyanEntity.setCheliangLiuyanText(data.get(0)); //留言内容 要改的
// cheliangLiuyanEntity.setInsertTime(date);//时间
// cheliangLiuyanEntity.setReplyText(data.get(0)); //回复内容 要改的
// cheliangLiuyanEntity.setUpdateTime(sdf.parse(data.get(0))); //回复时间 要改的
// cheliangLiuyanEntity.setCreateTime(date);//时间cheliangLiuyanList.add(cheliangLiuyanEntity);//把要查询是否重复的字段放入map中}//查询是否重复cheliangLiuyanService.insertBatch(cheliangLiuyanList);return R.ok();}}}}catch (Exception e){e.printStackTrace();return R.error(511,批量插入数据异常请联系管理员);}}/*** 前端列表*/IgnoreAuthRequestMapping(/list)public R list(RequestParam MapString, Object params, HttpServletRequest request){logger.debug(list方法:,,Controller:{},,params:{},this.getClass().getName(),JSONObject.toJSONString(params));CommonUtil.checkMap(params);PageUtils page cheliangLiuyanService.queryPage(params);//字典表数据转换ListCheliangLiuyanView list (ListCheliangLiuyanView)page.getList();for(CheliangLiuyanView c:list)dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段return R.ok().put(data, page);}/*** 前端详情*/RequestMapping(/detail/{id})public R detail(PathVariable(id) Long id, HttpServletRequest request){logger.debug(detail方法:,,Controller:{},,id:{},this.getClass().getName(),id);CheliangLiuyanEntity cheliangLiuyan cheliangLiuyanService.selectById(id);if(cheliangLiuyan !null){//entity转viewCheliangLiuyanView view new CheliangLiuyanView();BeanUtils.copyProperties( cheliangLiuyan , view );//把实体数据重构到view中//级联表CheliangEntity cheliang cheliangService.selectById(cheliangLiuyan.getCheliangId());if(cheliang ! null){BeanUtils.copyProperties( cheliang , view ,new String[]{ id, createDate});//把级联的数据添加到view中,并排除id和创建时间字段view.setCheliangId(cheliang.getId());}//级联表YonghuEntity yonghu yonghuService.selectById(cheliangLiuyan.getYonghuId());if(yonghu ! null){BeanUtils.copyProperties( yonghu , view ,new String[]{ id, createDate});//把级联的数据添加到view中,并排除id和创建时间字段view.setYonghuId(yonghu.getId());}//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put(data, view);}else {return R.error(511,查不到数据);}}/*** 前端保存*/RequestMapping(/add)public R add(RequestBody CheliangLiuyanEntity cheliangLiuyan, HttpServletRequest request){logger.debug(add方法:,,Controller:{},,cheliangLiuyan:{},this.getClass().getName(),cheliangLiuyan.toString());cheliangLiuyan.setCreateTime(new Date());cheliangLiuyan.setInsertTime(new Date());cheliangLiuyanService.insert(cheliangLiuyan);return R.ok();}}
声明 本博客适用于广泛的学术和教育用途包括但不限于个人学习、开发设计产品设计。仅供学习参考旨在为读者提供深入理解和学术研究的材料。