计算机毕业设计 基于SpringBoot的实训管理系统的设计与实现 Java实战项目 附源码+文档+视频讲解

博主介绍:✌从事软件开发10年之余,专注于Java技术领域、Python人工智能及数据挖掘、小程序项目开发和Android项目开发等。CSDN、掘金、华为云、InfoQ、阿里云等平台优质作者✌
🍅文末获取源码联系🍅
👇🏻 精彩专栏推荐订阅👇🏻 不然下次找不到哟
————————————————
计算机毕业设计《1000套》✌

 目录

1、项目介绍及开发技术

1.1 项目介绍

1.2 开发技术

2、系统功能模块设计

3、功能截图

3.1 前台功能

3.2 后台功能

4、数据库表结构设计

5、关键代码

5.1 学生管理Controller模块 

5.2 学生管理Service模块 

5.3 学生管理ServiceImpl模块

5.4 学生管理Dao模块

6、论文目录结构

7、源码获取


1、项目介绍及开发技术

1.1 项目介绍

网络的广泛应用给生活带来了十分的便利。所以把实训管理与现在网络相结合,利用java技术建设实训管理系统,实现实训管理的信息化。则对于进一步提高实训管理发展,对实训管理系统能起到不少的促进作用。本系统能够通过互联网得到广泛的、全面的宣传,让尽可能多的用户了解和熟知实训管理系统的便捷高效,不仅为群众提供了服务,而且也推广了自己,让更多的群众了解自己。

本系统设计的现状和趋势,从需求、结构、数据库等方面的设计到系统的实现,分别为管理员、教师和学生实现。论文的内容从系统的设计、描述、实现、分析、测试方面来表明开发的过程。本系统根据现实情况来选择一种可行的开发方案,借助java编程语言和MySQL数据库等实现系统的全部功能,接下来对系统进行测试,测试系统是否有漏洞和测试用户权限来完善系统最终系统完成达到相关标准。

1.2 开发技术

Java开发语言、SpringBoot、MyBatisPlus、MySQL数据库、Maven、IDEA开发工具、JDK1.8+、Vue、HTML、CSS、JS。

2、系统功能模块设计

学生:注册登录、首页、论坛、公告信息、实训模块、实训实施、个人中心(个人信息、成绩、考勤、请假、实训成果)。

老师:注册登录、个人中心、学生管理、成绩管理、论坛管理、公告信息管理、考勤管理、请假管理、实训模块管理、实训实施管理、实训成果管理、轮播图管理。

管理员:首页、个人中心、管理员管理、老师管理、学生管理、成绩管理、论坛管理、公告信息管理、考勤管理、请假管理、实训模块管理、实训实施管理。

3、功能截图

3.1 前台功能

首页

论坛

公告信息

实训模块

实训实施

个人中心

 

3.2 后台功能

个人中心

学生管理

成绩管理

论坛管理

公告信息管理

考勤管理

请假管理

实训模块管理

实训实施管理

实训成果管理

4、数据库表结构设计

CREATE TABLE `chengji` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `chengji_uuid_number` varchar(200) DEFAULT NULL COMMENT '报名唯一编号 Search111 ',
  `laoshi_id` int(11) DEFAULT NULL COMMENT '老师',
  `yonghu_id` int(11) DEFAULT NULL COMMENT '学生',
  `chengji_kemu` varchar(200) DEFAULT NULL COMMENT '实训模块 ',
  `chengji_pigai` int(11) DEFAULT NULL COMMENT '分数',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '作业提交时间',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='成绩';

/*Data for the table `chengji` */

insert  into `chengji`(`id`,`chengji_uuid_number`,`laoshi_id`,`yonghu_id`,`chengji_kemu`,`chengji_pigai`,`insert_time`,`create_time`) values (1,'1683535083878',3,1,'实训模块1',253,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(2,'1683535083848',3,3,'实训模块2',73,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(3,'1683535083924',1,2,'实训模块3',192,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(4,'1683535083929',2,2,'实训模块4',405,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(5,'1683535083854',1,2,'实训模块5',300,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(6,'1683535083935',2,2,'实训模块6',441,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(7,'1683535083900',3,2,'实训模块7',272,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(8,'1683535083847',1,1,'实训模块8',112,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(9,'1683535083883',1,3,'实训模块9',255,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(10,'1683535083893',1,1,'实训模块10',492,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(11,'1683535083913',1,3,'实训模块11',221,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(12,'1683535083916',1,3,'实训模块12',366,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(13,'1683535083848',1,2,'实训模块13',107,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(14,'1683535083911',3,2,'实训模块14',285,'2023-05-08 16:38:03','2023-05-08 16:38:03');

/*Table structure for table `config` */

DROP TABLE IF EXISTS `config`;

CREATE TABLE `config` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(100) NOT NULL COMMENT '配置参数名称',
  `value` varchar(100) DEFAULT NULL COMMENT '配置参数值',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='配置文件';

/*Data for the table `config` */

insert  into `config`(`id`,`name`,`value`) values (1,'轮播图1','upload/config1.jpg'),(2,'轮播图2','upload/config2.jpg'),(3,'轮播图3','upload/config3.jpg');

/*Table structure for table `dictionary` */

DROP TABLE IF EXISTS `dictionary`;

CREATE TABLE `dictionary` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `dic_code` varchar(200) DEFAULT NULL COMMENT '字段',
  `dic_name` varchar(200) DEFAULT NULL COMMENT '字段名',
  `code_index` int(11) DEFAULT NULL COMMENT '编码',
  `index_name` varchar(200) DEFAULT NULL COMMENT '编码名字  Search111 ',
  `super_id` int(11) DEFAULT NULL COMMENT '父字段id',
  `beizhu` varchar(200) DEFAULT NULL COMMENT '备注',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 COMMENT='字典';

/*Data for the table `dictionary` */

insert  into `dictionary`(`id`,`dic_code`,`dic_name`,`code_index`,`index_name`,`super_id`,`beizhu`,`create_time`) values (1,'sex_types','性别类型',1,'男',NULL,NULL,'2023-05-08 16:37:55'),(2,'sex_types','性别类型',2,'女',NULL,NULL,'2023-05-08 16:37:55'),(3,'gonggao_types','公告类型',1,'公告类型1',NULL,NULL,'2023-05-08 16:37:55'),(4,'gonggao_types','公告类型',2,'公告类型2',NULL,NULL,'2023-05-08 16:37:55'),(5,'qingjia_types','请假类型',1,'生病',NULL,NULL,'2023-05-08 16:37:55'),(6,'qingjia_types','请假类型',2,'有事',NULL,NULL,'2023-05-08 16:37:55'),(7,'qingjia_yesno_types','申请状态',1,'待审核',NULL,NULL,'2023-05-08 16:37:55'),(8,'qingjia_yesno_types','申请状态',2,'同意',NULL,NULL,'2023-05-08 16:37:55'),(9,'qingjia_yesno_types','申请状态',3,'拒绝',NULL,NULL,'2023-05-08 16:37:55'),(10,'qingjia_yesno_types','申请状态',4,'销假',NULL,NULL,'2023-05-08 16:37:55'),(11,'yonghu_kaoqin_types','学生考勤类型',1,'日常考勤',NULL,NULL,'2023-05-08 16:37:55'),(12,'yonghu_kaoqin_types','学生考勤类型',2,'考勤类型2',NULL,NULL,'2023-05-08 16:37:55'),(13,'yonghu_kaoqin_list_types','打卡状态',1,'未打卡',NULL,NULL,'2023-05-08 16:37:55'),(14,'yonghu_kaoqin_list_types','打卡状态',2,'已打卡',NULL,NULL,'2023-05-08 16:37:55'),(15,'zuoye_types','实训模块类型',1,'实训模块类型1',NULL,NULL,'2023-05-08 16:37:55'),(16,'zuoye_types','实训模块类型',2,'实训模块类型2',NULL,NULL,'2023-05-08 16:37:55'),(17,'zuoye_types','实训模块类型',3,'实训模块类型3',NULL,NULL,'2023-05-08 16:37:55'),(18,'zuoye_types','实训模块类型',4,'实训模块类型4',NULL,NULL,'2023-05-08 16:37:55'),(19,'zuoye_tijiao_yesno_types','提交状态',1,'待批改',NULL,NULL,'2023-05-08 16:37:55'),(20,'zuoye_tijiao_yesno_types','提交状态',2,'已批改',NULL,NULL,'2023-05-08 16:37:55'),(21,'zuoye_tijiao_yesno_types','提交状态',3,'未批改',NULL,NULL,'2023-05-08 16:37:55');

/*Table structure for table `gonggao` */

DROP TABLE IF EXISTS `gonggao`;

CREATE TABLE `gonggao` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
  `gonggao_name` varchar(200) DEFAULT NULL COMMENT '公告名称 Search111  ',
  `gonggao_photo` varchar(200) DEFAULT NULL COMMENT '公告图片 ',
  `gonggao_types` int(11) NOT NULL COMMENT '公告类型 Search111 ',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '发布时间',
  `gonggao_content` longtext COMMENT '公告详情 ',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 nameShow',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='公告信息';

/*Data for the table `gonggao` */

insert  into `gonggao`(`id`,`gonggao_name`,`gonggao_photo`,`gonggao_types`,`insert_time`,`gonggao_content`,`create_time`) values (1,'公告名称1','upload/gonggao1.jpg',1,'2023-05-08 16:38:03','公告详情1','2023-05-08 16:38:03'),(2,'公告名称2','upload/gonggao2.jpg',2,'2023-05-08 16:38:03','公告详情2','2023-05-08 16:38:03'),(3,'公告名称3','upload/gonggao3.jpg',1,'2023-05-08 16:38:03','公告详情3','2023-05-08 16:38:03'),(4,'公告名称4','upload/gonggao4.jpg',1,'2023-05-08 16:38:03','公告详情4','2023-05-08 16:38:03'),(5,'公告名称5','upload/gonggao5.jpg',1,'2023-05-08 16:38:03','公告详情5','2023-05-08 16:38:03'),(6,'公告名称6','upload/gonggao6.jpg',2,'2023-05-08 16:38:03','公告详情6','2023-05-08 16:38:03'),(7,'公告名称7','upload/gonggao7.jpg',1,'2023-05-08 16:38:03','公告详情7','2023-05-08 16:38:03'),(8,'公告名称8','upload/gonggao8.jpg',2,'2023-05-08 16:38:03','公告详情8','2023-05-08 16:38:03'),(9,'公告名称9','upload/gonggao9.jpg',2,'2023-05-08 16:38:03','公告详情9','2023-05-08 16:38:03'),(10,'公告名称10','upload/gonggao10.jpg',2,'2023-05-08 16:38:03','公告详情10','2023-05-08 16:38:03'),(11,'公告名称11','upload/gonggao11.jpg',2,'2023-05-08 16:38:03','公告详情11','2023-05-08 16:38:03'),(12,'公告名称12','upload/gonggao12.jpg',2,'2023-05-08 16:38:03','公告详情12','2023-05-08 16:38:03'),(13,'公告名称13','upload/gonggao13.jpg',1,'2023-05-08 16:38:03','公告详情13','2023-05-08 16:38:03'),(14,'公告名称14','upload/gonggao14.jpg',1,'2023-05-08 16:38:03','公告详情14','2023-05-08 16:38:03');

/*Table structure for table `laoshi` */

DROP TABLE IF EXISTS `laoshi`;

CREATE TABLE `laoshi` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `username` varchar(200) DEFAULT NULL COMMENT '账户',
  `password` varchar(200) DEFAULT NULL COMMENT '密码',
  `laoshi_uuid_number` varchar(200) DEFAULT NULL COMMENT '老师编号 Search111 ',
  `laoshi_name` varchar(200) DEFAULT NULL COMMENT '老师姓名 Search111 ',
  `laoshi_phone` varchar(200) DEFAULT NULL COMMENT '老师手机号',
  `laoshi_id_number` varchar(200) DEFAULT NULL COMMENT '老师身份证号',
  `laoshi_photo` varchar(200) DEFAULT NULL COMMENT '老师头像',
  `sex_types` int(11) DEFAULT NULL COMMENT '性别',
  `laoshi_email` varchar(200) DEFAULT NULL COMMENT '老师邮箱',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='老师';

/*Data for the table `laoshi` */

insert  into `laoshi`(`id`,`username`,`password`,`laoshi_uuid_number`,`laoshi_name`,`laoshi_phone`,`laoshi_id_number`,`laoshi_photo`,`sex_types`,`laoshi_email`,`create_time`) values (1,'a1','123456','1683535083859','老师姓名1','17703786901','410224199010102001','upload/laoshi1.jpg',2,'1@qq.com','2023-05-08 16:38:03'),(2,'a2','123456','1683535083949','老师姓名2','17703786902','410224199010102002','upload/laoshi2.jpg',2,'2@qq.com','2023-05-08 16:38:03'),(3,'a3','123456','1683535083901','老师姓名3','17703786903','410224199010102003','upload/laoshi3.jpg',2,'3@qq.com','2023-05-08 16:38:03');

/*Table structure for table `qingjia` */

DROP TABLE IF EXISTS `qingjia`;

CREATE TABLE `qingjia` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `yonghu_id` int(11) DEFAULT NULL COMMENT '学生',
  `laoshi_id` int(11) DEFAULT NULL COMMENT '老师',
  `qingjia_name` varchar(200) DEFAULT NULL COMMENT '请假标题 Search111 ',
  `qingjia_text` longtext COMMENT '请假缘由',
  `qingjia_types` int(11) DEFAULT NULL COMMENT '请假类型 Search111',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '申请时间',
  `qingjia_time` timestamp NULL DEFAULT NULL COMMENT '请假时间',
  `qingjia_number` int(200) DEFAULT NULL COMMENT '请假天数',
  `qingjia_yesno_types` int(11) DEFAULT NULL COMMENT '申请状态 Search111 ',
  `qingjia_yesno_text` longtext COMMENT '处理意见',
  `qingjia_shenhe_time` timestamp NULL DEFAULT NULL COMMENT '审核时间',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='请假';

/*Data for the table `qingjia` */

insert  into `qingjia`(`id`,`yonghu_id`,`laoshi_id`,`qingjia_name`,`qingjia_text`,`qingjia_types`,`insert_time`,`qingjia_time`,`qingjia_number`,`qingjia_yesno_types`,`qingjia_yesno_text`,`qingjia_shenhe_time`,`create_time`) values (1,3,1,'请假标题1','请假缘由1',1,'2023-05-08 16:38:03','2023-05-08 16:38:03',166,1,NULL,NULL,'2023-05-08 16:38:03'),(2,2,2,'请假标题2','请假缘由2',2,'2023-05-08 16:38:03','2023-05-08 16:38:03',214,1,NULL,NULL,'2023-05-08 16:38:03'),(3,3,2,'请假标题3','请假缘由3',2,'2023-05-08 16:38:03','2023-05-08 16:38:03',49,1,NULL,NULL,'2023-05-08 16:38:03'),(4,1,3,'请假标题4','请假缘由4',2,'2023-05-08 16:38:03','2023-05-08 16:38:03',360,1,NULL,NULL,'2023-05-08 16:38:03'),(5,3,3,'请假标题5','请假缘由5',2,'2023-05-08 16:38:03','2023-05-08 16:38:03',261,1,NULL,NULL,'2023-05-08 16:38:03'),(6,1,3,'请假标题6','请假缘由6',2,'2023-05-08 16:38:03','2023-05-08 16:38:03',492,1,NULL,NULL,'2023-05-08 16:38:03'),(7,3,1,'请假标题7','请假缘由7',1,'2023-05-08 16:38:03','2023-05-08 16:38:03',127,1,NULL,NULL,'2023-05-08 16:38:03'),(8,3,1,'请假标题8','请假缘由8',1,'2023-05-08 16:38:03','2023-05-08 16:38:03',35,1,NULL,NULL,'2023-05-08 16:38:03'),(9,3,2,'请假标题9','请假缘由9',2,'2023-05-08 16:38:03','2023-05-08 16:38:03',408,1,NULL,NULL,'2023-05-08 16:38:03'),(10,2,1,'请假标题10','请假缘由10',1,'2023-05-08 16:38:03','2023-05-08 16:38:03',73,1,NULL,NULL,'2023-05-08 16:38:03'),(11,1,2,'请假标题11','请假缘由11',1,'2023-05-08 16:38:03','2023-05-08 16:38:03',372,1,NULL,NULL,'2023-05-08 16:38:03'),(12,2,2,'请假标题12','请假缘由12',1,'2023-05-08 16:38:03','2023-05-08 16:38:03',149,1,NULL,NULL,'2023-05-08 16:38:03'),(13,1,1,'请假标题13','请假缘由13',1,'2023-05-08 16:38:03','2023-05-08 16:38:03',66,2,'大','2023-05-08 17:22:18','2023-05-08 16:38:03'),(14,2,2,'请假标题14','请假缘由14',2,'2023-05-08 16:38:03','2023-05-08 16:38:03',235,1,NULL,NULL,'2023-05-08 16:38:03');

/*Table structure for table `token` */

DROP TABLE IF EXISTS `token`;

CREATE TABLE `token` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `userid` bigint(20) NOT NULL COMMENT '儿童id',
  `username` varchar(100) NOT NULL COMMENT '儿童名',
  `tablename` varchar(100) DEFAULT NULL COMMENT '表名',
  `role` varchar(100) DEFAULT NULL COMMENT '角色',
  `token` varchar(200) NOT NULL COMMENT '密码',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
  `expiratedtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '过期时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='token表';

/*Data for the table `token` */

insert  into `token`(`id`,`userid`,`username`,`tablename`,`role`,`token`,`addtime`,`expiratedtime`) values (1,1,'a1','yonghu','学生','41ipbb99auhifklf4023gxvjv96d072f','2023-05-08 16:41:52','2023-05-08 18:18:26'),(2,1,'admin','users','管理员','rn18jhbym351xlc2e1wl8ytogwmhk4fc','2023-05-08 16:44:36','2023-05-08 18:23:30'),(3,1,'a1','laoshi','老师','ocv4r1q63c4h33nmuqjhz4iaf7om20s0','2023-05-08 16:55:31','2023-05-08 18:21:53');

/*Table structure for table `users` */

DROP TABLE IF EXISTS `users`;

CREATE TABLE `users` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `username` varchar(100) NOT NULL COMMENT '儿童名',
  `password` varchar(100) NOT NULL COMMENT '密码',
  `role` varchar(100) DEFAULT '管理员' COMMENT '角色',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='管理员';

/*Data for the table `users` */

insert  into `users`(`id`,`username`,`password`,`role`,`addtime`) values (1,'admin','admin','管理员','2023-05-08 16:37:55');

/*Table structure for table `yonghu` */

DROP TABLE IF EXISTS `yonghu`;

CREATE TABLE `yonghu` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `username` varchar(200) DEFAULT NULL COMMENT '账户',
  `password` varchar(200) DEFAULT NULL COMMENT '密码',
  `yonghu_uuid_number` varchar(200) DEFAULT NULL COMMENT '学生编号 Search111 ',
  `yonghu_name` varchar(200) DEFAULT NULL COMMENT '学生姓名 Search111 ',
  `yonghu_phone` varchar(200) DEFAULT NULL COMMENT '学生手机号',
  `yonghu_id_number` varchar(200) DEFAULT NULL COMMENT '学生身份证号',
  `yonghu_photo` varchar(200) DEFAULT NULL COMMENT '学生头像',
  `sex_types` int(11) DEFAULT NULL COMMENT '性别',
  `yonghu_email` varchar(200) DEFAULT NULL COMMENT '学生邮箱',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='学生';

/*Data for the table `yonghu` */

insert  into `yonghu`(`id`,`username`,`password`,`yonghu_uuid_number`,`yonghu_name`,`yonghu_phone`,`yonghu_id_number`,`yonghu_photo`,`sex_types`,`yonghu_email`,`create_time`) values (1,'a1','123456','1683535083894','学生姓名1','17703786901','410224199010102001','upload/yonghu1.jpg',1,'1@qq.com','2023-05-08 16:38:03'),(2,'a2','123456','1683535083865','学生姓名2','17703786902','410224199010102002','upload/yonghu2.jpg',2,'2@qq.com','2023-05-08 16:38:03'),(3,'a3','123456','1683535083934','学生姓名3','17703786903','410224199010102003','upload/yonghu3.jpg',2,'3@qq.com','2023-05-08 16:38:03');

/*Table structure for table `yonghu_kaoqin` */

DROP TABLE IF EXISTS `yonghu_kaoqin`;

CREATE TABLE `yonghu_kaoqin` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `laoshi_id` int(11) DEFAULT NULL COMMENT '老师',
  `yonghu_kaoqin_uuid_number` varchar(200) DEFAULT NULL COMMENT '考勤唯一编号 Search111 ',
  `yonghu_kaoqin_name` varchar(200) DEFAULT NULL COMMENT '考勤标题 Search111 ',
  `yonghu_kaoqin_types` int(11) DEFAULT NULL COMMENT '学生考勤类型 Search111',
  `yonghu_kaoqin_content` longtext COMMENT '考勤详情',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '考勤发起时间',
  `jiezhi_time` timestamp NULL DEFAULT NULL COMMENT '考勤截止时间',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='学生考勤';

/*Data for the table `yonghu_kaoqin` */

insert  into `yonghu_kaoqin`(`id`,`laoshi_id`,`yonghu_kaoqin_uuid_number`,`yonghu_kaoqin_name`,`yonghu_kaoqin_types`,`yonghu_kaoqin_content`,`insert_time`,`jiezhi_time`,`create_time`) values (1,3,'1683535083885','考勤标题1',1,'考勤详情1','2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(2,1,'1683535083949','考勤标题2',1,'考勤详情2','2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(3,3,'1683535083948','考勤标题3',1,'考勤详情3','2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(4,3,'1683535083878','考勤标题4',1,'考勤详情4','2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(5,2,'1683535083908','考勤标题5',1,'考勤详情5','2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(6,2,'1683535083856','考勤标题6',1,'考勤详情6','2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(7,3,'1683535083881','考勤标题7',1,'考勤详情7','2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(8,3,'1683535083929','考勤标题8',1,'考勤详情8','2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(9,2,'1683535083909','考勤标题9',2,'考勤详情9','2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(10,1,'1683535083953','考勤标题10',2,'考勤详情10','2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(11,3,'1683535083942','考勤标题11',1,'考勤详情11','2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(12,1,'1683535083875','考勤标题12',1,'考勤详情12','2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(13,2,'1683535083933','考勤标题13',2,'考勤详情13','2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(14,3,'1683535083921','考勤标题14',1,'考勤详情14','2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03');

/*Table structure for table `yonghu_kaoqin_list` */

DROP TABLE IF EXISTS `yonghu_kaoqin_list`;

CREATE TABLE `yonghu_kaoqin_list` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `yonghu_id` int(11) DEFAULT NULL COMMENT '学生',
  `yonghu_kaoqin_id` int(11) DEFAULT NULL COMMENT '考勤',
  `yonghu_kaoqin_list_types` int(11) DEFAULT NULL COMMENT '打卡状态',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '添加时间',
  `update_time` timestamp NULL DEFAULT NULL COMMENT '打卡时间',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='学生考勤详情';

/*Data for the table `yonghu_kaoqin_list` */

insert  into `yonghu_kaoqin_list`(`id`,`yonghu_id`,`yonghu_kaoqin_id`,`yonghu_kaoqin_list_types`,`insert_time`,`update_time`,`create_time`) values (1,3,1,1,'2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(2,1,2,1,'2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(3,2,3,1,'2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(4,1,4,1,'2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(5,1,5,1,'2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(6,3,6,1,'2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(7,1,7,1,'2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(8,2,8,1,'2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(9,1,9,1,'2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(10,2,10,1,'2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(11,2,11,1,'2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(12,3,12,1,'2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(13,3,13,1,'2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(14,3,14,1,'2023-05-08 16:38:03','2023-05-08 16:38:03','2023-05-08 16:38:03'),(15,1,13,2,'2023-05-08 17:21:05',NULL,'2023-05-08 17:21:05'),(16,1,12,2,'2023-05-08 17:22:50',NULL,'2023-05-08 17:22:50');

/*Table structure for table `zuoye` */

DROP TABLE IF EXISTS `zuoye`;

CREATE TABLE `zuoye` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
  `laoshi_id` int(11) DEFAULT NULL COMMENT '老师',
  `zuoye_name` varchar(200) DEFAULT NULL COMMENT '实训模块名称  Search111 ',
  `zuoye_uuid_number` varchar(200) DEFAULT NULL COMMENT '实训模块编号',
  `zuoye_address` varchar(200) DEFAULT NULL COMMENT '实训模块地点',
  `zuoye_photo` varchar(200) DEFAULT NULL COMMENT '实训模块照片',
  `zuoye_types` int(11) DEFAULT NULL COMMENT '实训模块类型 Search111',
  `zuoye_video` varchar(200) DEFAULT NULL COMMENT '视频',
  `zuoye_file` varchar(200) DEFAULT NULL COMMENT '文件',
  `zuoye_content` longtext COMMENT '实训模块介绍 ',
  `zuoye_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间  show1 show2 photoShow',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='实训模块';

/*Data for the table `zuoye` */

insert  into `zuoye`(`id`,`laoshi_id`,`zuoye_name`,`zuoye_uuid_number`,`zuoye_address`,`zuoye_photo`,`zuoye_types`,`zuoye_video`,`zuoye_file`,`zuoye_content`,`zuoye_delete`,`insert_time`,`create_time`) values (1,2,'实训模块名称1','1683535083911','实训模块地点1','upload/zuoye1.jpg',3,'upload/video.mp4','upload/file.rar','实训模块介绍1',1,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(2,3,'实训模块名称2','1683535083950','实训模块地点2','upload/zuoye2.jpg',3,'upload/video.mp4','upload/file.rar','实训模块介绍2',1,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(3,1,'实训模块名称3','1683535083858','实训模块地点3','upload/zuoye3.jpg',2,'upload/video.mp4','upload/file.rar','实训模块介绍3',1,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(4,3,'实训模块名称4','1683535083900','实训模块地点4','upload/zuoye4.jpg',2,'upload/video.mp4','upload/file.rar','实训模块介绍4',1,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(5,1,'实训模块名称5','1683535083890','实训模块地点5','upload/zuoye5.jpg',1,'upload/video.mp4','upload/file.rar','实训模块介绍5',1,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(6,3,'实训模块名称6','1683535083939','实训模块地点6','upload/zuoye6.jpg',4,'upload/video.mp4','upload/file.rar','实训模块介绍6',1,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(7,2,'实训模块名称7','1683535083861','实训模块地点7','upload/zuoye7.jpg',4,'upload/video.mp4','upload/file.rar','实训模块介绍7',1,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(8,2,'实训模块名称8','1683535083886','实训模块地点8','upload/zuoye8.jpg',3,'upload/video.mp4','upload/file.rar','实训模块介绍8',1,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(9,3,'实训模块名称9','1683535083869','实训模块地点9','upload/zuoye9.jpg',2,'upload/video.mp4','upload/file.rar','实训模块介绍9',1,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(10,3,'实训模块名称10','1683535083886','实训模块地点10','upload/zuoye10.jpg',4,'upload/video.mp4','upload/file.rar','实训模块介绍10',1,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(11,1,'实训模块名称11','1683535083930','实训模块地点11','upload/zuoye11.jpg',1,'upload/video.mp4','upload/file.rar','实训模块介绍11',1,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(12,1,'实训模块名称12','1683535083861','实训模块地点12','upload/zuoye12.jpg',3,'upload/video.mp4','upload/file.rar','实训模块介绍12',1,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(13,1,'实训模块名称13','1683535083930','实训模块地点13','upload/zuoye13.jpg',3,'upload/video.mp4','upload/file.rar','实训模块介绍13',1,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(14,3,'实训模块名称14','1683535083941','实训模块地点14','upload/zuoye14.jpg',1,'upload/video.mp4','upload/file.rar','实训模块介绍14',1,'2023-05-08 16:38:03','2023-05-08 16:38:03');

/*Table structure for table `zuoye_tijiao` */

DROP TABLE IF EXISTS `zuoye_tijiao`;

CREATE TABLE `zuoye_tijiao` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `zuoye_tijiao_uuid_number` varchar(200) DEFAULT NULL COMMENT '报名唯一编号 Search111 ',
  `zuoye_id` int(11) DEFAULT NULL COMMENT '实训模块',
  `laoshi_id` int(11) DEFAULT NULL COMMENT '老师',
  `yonghu_id` int(11) DEFAULT NULL COMMENT '学生',
  `zuoye_tijiao_text` text COMMENT '内容',
  `zuoye_shangchuan_file` varchar(200) DEFAULT NULL COMMENT '作业上传',
  `zuoye_tijiao_yesno_types` int(11) DEFAULT NULL COMMENT '提交状态 Search111 ',
  `zuoye_tijiao_pigai` int(11) DEFAULT NULL COMMENT '批改分数',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '作业提交时间',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='实训成果';

/*Data for the table `zuoye_tijiao` */

insert  into `zuoye_tijiao`(`id`,`zuoye_tijiao_uuid_number`,`zuoye_id`,`laoshi_id`,`yonghu_id`,`zuoye_tijiao_text`,`zuoye_shangchuan_file`,`zuoye_tijiao_yesno_types`,`zuoye_tijiao_pigai`,`insert_time`,`create_time`) values (1,'1683535083916',1,2,3,'内容1','upload/file.rar',1,206,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(2,'1683535083891',2,2,3,'内容2','upload/file.rar',1,377,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(3,'1683535083863',3,1,3,'内容3','upload/file.rar',1,232,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(4,'1683535083891',4,1,2,'内容4','upload/file.rar',1,239,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(5,'1683535083887',5,3,1,'内容5','upload/file.rar',1,352,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(6,'1683535083910',6,3,1,'内容6','upload/file.rar',1,177,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(7,'1683535083921',7,2,3,'内容7','upload/file.rar',1,143,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(8,'1683535083879',8,1,3,'内容8','upload/file.rar',1,78,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(9,'1683535083876',9,1,2,'内容9','upload/file.rar',1,306,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(10,'1683535083877',10,1,3,'内容10','upload/file.rar',1,146,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(11,'1683535083942',11,3,1,'内容11','upload/file.rar',1,250,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(12,'1683535083914',12,1,2,'内容12','upload/file.rar',1,439,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(13,'1683535083953',13,3,3,'内容13','upload/file.rar',1,184,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(14,'1683535083959',14,2,2,'内容14','upload/file.rar',1,56,'2023-05-08 16:38:03','2023-05-08 16:38:03'),(15,'1683537627977',13,1,1,'测试','upload/1683537634369.jpg',2,50,'2023-05-08 17:20:36','2023-05-08 17:20:36');

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

5、关键代码

5.1 学生管理Controller模块 

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("/yonghu")
public class YonghuController {
    private static final Logger logger = LoggerFactory.getLogger(YonghuController.class);

    private static final String TABLE_NAME = "yonghu";

    @Autowired
    private YonghuService yonghuService;

    @Autowired
    private TokenService tokenService;

    @Autowired
    private ChengjiService chengjiService;//成绩
    @Autowired
    private DictionaryService dictionaryService;//字典
    @Autowired
    private GonggaoService gonggaoService;//公告信息
    @Autowired
    private LaoshiService laoshiService;//老师
    @Autowired
    private QingjiaService qingjiaService;//请假
    @Autowired
    private YonghuKaoqinService yonghuKaoqinService;//学生考勤
    @Autowired
    private YonghuKaoqinListService yonghuKaoqinListService;//学生考勤详情
    @Autowired
    private ZuoyeService zuoyeService;//实训模块
    @Autowired
    private ZuoyeTijiaoService zuoyeTijiaoService;//实训成果
    @Autowired
    private UsersService usersService;//管理员


    /**
    * 后端列表
    */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, 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("laoshiId",request.getSession().getAttribute("userId"));
        CommonUtil.checkMap(params);
        PageUtils page = yonghuService.queryPage(params);

        //字典表数据转换
        List<YonghuView> list =(List<YonghuView>)page.getList();
        for(YonghuView 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);
        YonghuEntity yonghu = yonghuService.selectById(id);
        if(yonghu !=null){
            //entity转view
            YonghuView view = new YonghuView();
            BeanUtils.copyProperties( yonghu , view );//把实体数据重构到view中
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("/save")
    public R save(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永远不会进入");

        Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
            .eq("username", yonghu.getUsername())
            .or()
            .eq("yonghu_phone", yonghu.getYonghuPhone())
            .or()
            .eq("yonghu_id_number", yonghu.getYonghuIdNumber())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
        if(yonghuEntity==null){
            yonghu.setCreateTime(new Date());
            yonghu.setPassword("123456");
            yonghuService.insert(yonghu);
            return R.ok();
        }else {
            return R.error(511,"账户或者学生手机号或者学生身份证号已经被使用");
        }
    }

    /**
    * 后端修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody YonghuEntity yonghu, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
        logger.debug("update方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());
        YonghuEntity oldYonghuEntity = yonghuService.selectById(yonghu.getId());//查询原先数据

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
        if("".equals(yonghu.getYonghuPhoto()) || "null".equals(yonghu.getYonghuPhoto())){
                yonghu.setYonghuPhoto(null);
        }

            yonghuService.updateById(yonghu);//根据id更新
            return R.ok();
    }

    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        List<YonghuEntity> oldYonghuList =yonghuService.selectBatchIds(Arrays.asList(ids));//要删除的数据
        yonghuService.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 {
            List<YonghuEntity> yonghuList = new ArrayList<>();//上传的东西
            Map<String, List<String>> 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{
                        List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
                        dataList.remove(0);//删除第一行,因为第一行是提示
                        for(List<String> data:dataList){
                            //循环
                            YonghuEntity yonghuEntity = new YonghuEntity();
//                            yonghuEntity.setUsername(data.get(0));                    //账户 要改的
//                            yonghuEntity.setPassword("123456");//密码
//                            yonghuEntity.setYonghuUuidNumber(data.get(0));                    //学生编号 要改的
//                            yonghuEntity.setYonghuName(data.get(0));                    //学生姓名 要改的
//                            yonghuEntity.setYonghuPhone(data.get(0));                    //学生手机号 要改的
//                            yonghuEntity.setYonghuIdNumber(data.get(0));                    //学生身份证号 要改的
//                            yonghuEntity.setYonghuPhoto("");//详情和图片
//                            yonghuEntity.setSexTypes(Integer.valueOf(data.get(0)));   //性别 要改的
//                            yonghuEntity.setYonghuEmail(data.get(0));                    //学生邮箱 要改的
//                            yonghuEntity.setCreateTime(date);//时间
                            yonghuList.add(yonghuEntity);


                            //把要查询是否重复的字段放入map中
                                //账户
                                if(seachFields.containsKey("username")){
                                    List<String> username = seachFields.get("username");
                                    username.add(data.get(0));//要改的
                                }else{
                                    List<String> username = new ArrayList<>();
                                    username.add(data.get(0));//要改的
                                    seachFields.put("username",username);
                                }
                                //学生编号
                                if(seachFields.containsKey("yonghuUuidNumber")){
                                    List<String> yonghuUuidNumber = seachFields.get("yonghuUuidNumber");
                                    yonghuUuidNumber.add(data.get(0));//要改的
                                }else{
                                    List<String> yonghuUuidNumber = new ArrayList<>();
                                    yonghuUuidNumber.add(data.get(0));//要改的
                                    seachFields.put("yonghuUuidNumber",yonghuUuidNumber);
                                }
                                //学生手机号
                                if(seachFields.containsKey("yonghuPhone")){
                                    List<String> yonghuPhone = seachFields.get("yonghuPhone");
                                    yonghuPhone.add(data.get(0));//要改的
                                }else{
                                    List<String> yonghuPhone = new ArrayList<>();
                                    yonghuPhone.add(data.get(0));//要改的
                                    seachFields.put("yonghuPhone",yonghuPhone);
                                }
                                //学生身份证号
                                if(seachFields.containsKey("yonghuIdNumber")){
                                    List<String> yonghuIdNumber = seachFields.get("yonghuIdNumber");
                                    yonghuIdNumber.add(data.get(0));//要改的
                                }else{
                                    List<String> yonghuIdNumber = new ArrayList<>();
                                    yonghuIdNumber.add(data.get(0));//要改的
                                    seachFields.put("yonghuIdNumber",yonghuIdNumber);
                                }
                        }

                        //查询是否重复
                         //账户
                        List<YonghuEntity> yonghuEntities_username = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("username", seachFields.get("username")));
                        if(yonghuEntities_username.size() >0 ){
                            ArrayList<String> repeatFields = new ArrayList<>();
                            for(YonghuEntity s:yonghuEntities_username){
                                repeatFields.add(s.getUsername());
                            }
                            return R.error(511,"数据库的该表中的 [账户] 字段已经存在 存在数据为:"+repeatFields.toString());
                        }
                         //学生编号
                        List<YonghuEntity> yonghuEntities_yonghuUuidNumber = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("yonghu_uuid_number", seachFields.get("yonghuUuidNumber")));
                        if(yonghuEntities_yonghuUuidNumber.size() >0 ){
                            ArrayList<String> repeatFields = new ArrayList<>();
                            for(YonghuEntity s:yonghuEntities_yonghuUuidNumber){
                                repeatFields.add(s.getYonghuUuidNumber());
                            }
                            return R.error(511,"数据库的该表中的 [学生编号] 字段已经存在 存在数据为:"+repeatFields.toString());
                        }
                         //学生手机号
                        List<YonghuEntity> yonghuEntities_yonghuPhone = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("yonghu_phone", seachFields.get("yonghuPhone")));
                        if(yonghuEntities_yonghuPhone.size() >0 ){
                            ArrayList<String> repeatFields = new ArrayList<>();
                            for(YonghuEntity s:yonghuEntities_yonghuPhone){
                                repeatFields.add(s.getYonghuPhone());
                            }
                            return R.error(511,"数据库的该表中的 [学生手机号] 字段已经存在 存在数据为:"+repeatFields.toString());
                        }
                         //学生身份证号
                        List<YonghuEntity> yonghuEntities_yonghuIdNumber = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("yonghu_id_number", seachFields.get("yonghuIdNumber")));
                        if(yonghuEntities_yonghuIdNumber.size() >0 ){
                            ArrayList<String> repeatFields = new ArrayList<>();
                            for(YonghuEntity s:yonghuEntities_yonghuIdNumber){
                                repeatFields.add(s.getYonghuIdNumber());
                            }
                            return R.error(511,"数据库的该表中的 [学生身份证号] 字段已经存在 存在数据为:"+repeatFields.toString());
                        }
                        yonghuService.insertBatch(yonghuList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }

    /**
    * 登录
    */
    @IgnoreAuth
    @RequestMapping(value = "/login")
    public R login(String username, String password, String captcha, HttpServletRequest request) {
        YonghuEntity yonghu = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", username));
        if(yonghu==null || !yonghu.getPassword().equals(password))
            return R.error("账号或密码不正确");
        String token = tokenService.generateToken(yonghu.getId(),username, "yonghu", "学生");
        R r = R.ok();
        r.put("token", token);
        r.put("role","学生");
        r.put("username",yonghu.getYonghuName());
        r.put("tableName","yonghu");
        r.put("userId",yonghu.getId());
        return r;
    }

    /**
    * 注册
    */
    @IgnoreAuth
    @PostMapping(value = "/register")
    public R register(@RequestBody YonghuEntity yonghu, HttpServletRequest request) {
//    	ValidatorUtils.validateEntity(user);
        Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
            .eq("username", yonghu.getUsername())
            .or()
            .eq("yonghu_phone", yonghu.getYonghuPhone())
            .or()
            .eq("yonghu_id_number", yonghu.getYonghuIdNumber())
            ;
        YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
        if(yonghuEntity != null)
            return R.error("账户或者学生手机号或者学生身份证号已经被使用");
        yonghu.setYonghuUuidNumber(String.valueOf(new Date().getTime()));
        yonghu.setCreateTime(new Date());
        yonghuService.insert(yonghu);

        return R.ok();
    }

    /**
     * 重置密码
     */
    @GetMapping(value = "/resetPassword")
    public R resetPassword(Integer  id, HttpServletRequest request) {
        YonghuEntity yonghu = yonghuService.selectById(id);
        yonghu.setPassword("123456");
        yonghuService.updateById(yonghu);
        return R.ok();
    }

	/**
	 * 修改密码
	 */
	@GetMapping(value = "/updatePassword")
	public R updatePassword(String  oldPassword, String  newPassword, HttpServletRequest request) {
        YonghuEntity yonghu = yonghuService.selectById((Integer)request.getSession().getAttribute("userId"));
		if(newPassword == null){
			return R.error("新密码不能为空") ;
		}
		if(!oldPassword.equals(yonghu.getPassword())){
			return R.error("原密码输入错误");
		}
		if(newPassword.equals(yonghu.getPassword())){
			return R.error("新密码不能和原密码一致") ;
		}
        yonghu.setPassword(newPassword);
		yonghuService.updateById(yonghu);
		return R.ok();
	}

    /**
     * 忘记密码
     */
    @IgnoreAuth
    @RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request) {
        YonghuEntity yonghu = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", username));
        if(yonghu!=null){
            yonghu.setPassword("123456");
            yonghuService.updateById(yonghu);
            return R.ok();
        }else{
           return R.error("账号不存在");
        }
    }

    /**
    * 获取用户的session用户信息
    */
    @RequestMapping("/session")
    public R getCurrYonghu(HttpServletRequest request){
        Integer id = (Integer)request.getSession().getAttribute("userId");
        YonghuEntity yonghu = yonghuService.selectById(id);
        if(yonghu !=null){
            //entity转view
            YonghuView view = new YonghuView();
            BeanUtils.copyProperties( yonghu , view );//把实体数据重构到view中

            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }
    }

    /**
    * 退出
    */
    @GetMapping(value = "logout")
    public R logout(HttpServletRequest request) {
        request.getSession().invalidate();
        return R.ok("退出成功");
    }

    /**
    * 前端列表
    */
    @IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
        logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));

        CommonUtil.checkMap(params);
        PageUtils page = yonghuService.queryPage(params);

        //字典表数据转换
        List<YonghuView> list =(List<YonghuView>)page.getList();
        for(YonghuView c:list)
            dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段

        return R.ok().put("data", page);
    }

    /**
    * 前端详情
    */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Integer id, HttpServletRequest request){
        logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        YonghuEntity yonghu = yonghuService.selectById(id);
            if(yonghu !=null){

                //entity转view
                YonghuView view = new YonghuView();
                BeanUtils.copyProperties( yonghu , view );//把实体数据重构到view中

                //修改对应字典表字段
                dictionaryService.dictionaryConvert(view, request);
                return R.ok().put("data", view);
            }else {
                return R.error(511,"查不到数据");
            }
    }

    /**
    * 前端保存
    */
    @RequestMapping("/add")
    public R add(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
        logger.debug("add方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());
        Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
            .eq("username", yonghu.getUsername())
            .or()
            .eq("yonghu_phone", yonghu.getYonghuPhone())
            .or()
            .eq("yonghu_id_number", yonghu.getYonghuIdNumber())
//            .notIn("yonghu_types", new Integer[]{102})
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
        if(yonghuEntity==null){
            yonghu.setCreateTime(new Date());
            yonghu.setPassword("123456");
        yonghuService.insert(yonghu);

            return R.ok();
        }else {
            return R.error(511,"账户或者学生手机号或者学生身份证号已经被使用");
        }
    }

}

5.2 学生管理Service模块 

package com.service;

import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.YonghuEntity;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.lang.Nullable;
import java.util.List;

/**
 * 学生 服务类
 */
public interface YonghuService extends IService<YonghuEntity> {

    /**
    * @param params 查询参数
    * @return 带分页的查询出来的数据
    */
     PageUtils queryPage(Map<String, Object> params);

}

5.3 学生管理ServiceImpl模块

package com.service.impl;

import com.utils.StringUtil;
import com.service.DictionaryService;
import com.utils.ClazzDiff;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.*;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import com.dao.YonghuDao;
import com.entity.YonghuEntity;
import com.service.YonghuService;
import com.entity.view.YonghuView;

/**
 * 学生 服务实现类
 */
@Service("yonghuService")
@Transactional
public class YonghuServiceImpl extends ServiceImpl<YonghuDao, YonghuEntity> implements YonghuService {

    @Override
    public PageUtils queryPage(Map<String,Object> params) {
        Page<YonghuView> page =new Query<YonghuView>(params).getPage();
        page.setRecords(baseMapper.selectListView(page,params));
        return new PageUtils(page);
    }

}

5.4 学生管理Dao模块

package com.dao;

import com.entity.YonghuEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;

import org.apache.ibatis.annotations.Param;
import com.entity.view.YonghuView;

/**
 * 学生 Dao 接口
 *
 * @author 
 */
public interface YonghuDao extends BaseMapper<YonghuEntity> {

   List<YonghuView> selectListView(Pagination page,@Param("params")Map<String,Object> params);

}

6、论文目录结构

7、源码获取

感谢大家的阅读,如有不懂的问题可以评论区交流或私聊!

喜欢文章可以点赞、收藏、关注、评论

获取源码请私信

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/137231.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【零基础小白也能轻松学会】3DMAX编织建模教程

有没有想过这些木质材料是如何在椅子上相互交织的&#xff1f;复杂吗&#xff1f;也许是也许不是……本教程将指导您一步一步地以任何形式提出自己的复杂编织图案。本教程将重点关注建模部分&#xff0c;并让您从那里开始发挥想象力。 1.首先创建一个新平面&#xff08;长度55&…

C++: 内存管理 (new / delete)

文章目录 一. C/C 内存分布二. C 语言中动态内存管理方式: malloc/calloc/realloc/free三. C内存管理方式1. new / delete 操作内置类型2. new / delete 操作自定义类型 四. operator new 与 operator delete 函数五. new 和 delete 的实现原理1. 内置类型2. 自定义类型 六. 定…

【 第八章】软件设计师 之 计算机软件法律法规

文章底部有个人公众号&#xff1a;热爱技术的小郑。主要分享开发知识、学习资料、毕业设计指导等。有兴趣的可以关注一下。为何分享&#xff1f; 踩过的坑没必要让别人在再踩&#xff0c;自己复盘也能加深记忆。利己利人、所谓双赢。 备考资料导航 软考好处&#xff1a;软考的…

程序员的护城河:职业发展的关键元素

目录 1. 技术深度与广度 2. 项目经验与实际操作 3. 沟通与团队协作 4. 持续学习与自我更新 5. 社区参与与开源贡献 6. 创新思维与解决问题的能力 7. 职业规划与自我管理 结语 在科技日新月异的今天&#xff0c;程序员的竞争已经不再仅仅依赖于技术水平&#xff0c;而是…

路径总和[简单]

优质博文&#xff1a;IT-BLOG-CN 一、题目 给你二叉树的根节点root和一个表示目标和的整数targetSum。判断该树中是否存在 根节点到叶子节点的路径&#xff0c;这条路径上所有节点值相加等于目标和targetSum。如果存在&#xff0c;返回true&#xff1b;否则&#xff0c;返回fa…

基于SpringMVC模式的电器网上订购系统的设计

大家好我是玥沐春风&#xff0c;今天分享一个基于SpringMVC模式的电器网上订购系统的设计&#xff0c;项目源码以及部署相关请联系我&#xff0c;文末附上联系信息 。 项目简介&#xff1a; 本系统利用现在比较广泛的JSP结合后台SpringMybatisAjax编写程序的方式实现的。 在…

【C++入门】构造函数析构函数

目录 前言 1. 类的默认成员函数 2. 构造函数 2.1 什么是构造函数 2.2 构造函数的特性 3. 析构函数 3.1 什么是析构函数 3.2 析构函数的特性 前言 前边我们已经了解了类和对像的基本概念&#xff0c;今天我们将继续深入了解类。类有6个默认成员函数&#xff0c;即使类中什么都…

Golang 字符串处理汇总

1. 统计字符串长度&#xff1a;len(str) len(str) 函数用于统计字符串的长度&#xff0c;按字节进行统计&#xff0c;且该函数属于内置函数也不用导包&#xff0c;直接用就行&#xff0c;示例如下&#xff1a; //统计字符串的长度,按字节进行统计: str : "golang你好&qu…

【数据库开发】DataX开发环境的安装部署(Python、Java)

文章目录 1、简介1.1 DataX简介1.2 DataX功能1.3 支持的数据通道 2、DataX安装配置2.1 DataX2.2 Java2.3 Python 3、DataX Web安装配置3.1 mysql3.2 DataX Web3.2.1 简介3.2.2 架构图3.2.3 依赖环境3.2.4 安装 4、入门使用4.1 DataX自带打印示例测试4.2 DataX生成任务模板文件4…

Leetcode—234.回文链表【简单】

2023每日刷题&#xff08;二十七&#xff09; Leetcode—234.回文链表 直接法实现代码 /*** Definition for singly-linked list.* struct ListNode {* int val;* struct ListNode *next;* };*/ bool isPalindrome(struct ListNode* head) {if(head NULL) {return t…

ablation study

文章目录 ablation study1、消融实验思想是什么&#xff1f;2、消融实验意义3、消融实验应用场景举例 ablation study 1、消融实验思想是什么&#xff1f; “消融实验”&#xff08;ablation study&#xff09;通常指的是通过逐步移除系统的一部分来评估该系统的贡献。这种方法…

相机突然断电,保存的DAT视频文件如何打开

3-6 本文主要解决因相机突然断电导致拍摄的视频文件打不开的问题。 在平常使用相机拍摄视频&#xff0c;比如使用佳能相机拍摄视频的时候&#xff0c;如果电池突然断电&#xff0c;就非常有可能会导致视频没来得及保存而损坏的情况&#xff0c;比如会产生下图中的这种DAT文件…

【Bug】当用opencv库的imread()函数读取图像,用matplotlib库的plt.imshow()函数显示图像时,图像色彩出现偏差问题的解决方法

一&#xff0c;问题描述 我们在利用opencv的imread读取本地图像&#xff0c;进行一系列处理&#xff0c;但是发现用matplotlib库的imshow&#xff08;&#xff09;函数显示的时候出现色彩改变&#xff0c;比如图像偏黄&#xff0c;偏红&#xff0c;偏蓝等等&#xff0c;但是对…

lesson05-C++模板

个人主页&#xff1a;Lei宝啊 愿所有美好如期而遇 目录 泛型编程 函数模板 类模板 泛型编程 我们先看一个代码&#xff1a; 看着是不是有点麻烦&#xff0c;我们有没有一种通用的办法&#xff0c;让编译器能够根据不同的类型自动生成不同的函数呢&#xff1f;有&#xff…

【JUC】二、线程间的通信(虚假唤醒)

文章目录 0、多线程编程的步骤1、wait和notify2、synchronized下实现线程的通信&#xff08;唤醒&#xff09;3、虚假唤醒4、Lock下实现线程的通信&#xff08;唤醒&#xff09;5、线程间的定制化通信 0、多线程编程的步骤 步骤一&#xff1a;创建&#xff08;将来被共享的&am…

c primer plus_chapter_four——字符串和格式化输入/输出

1、strlen&#xff08;&#xff09;&#xff1b;const&#xff1b;字符串&#xff1b;用c预处理指令#define和ANSIC的const修饰符创建符号常量&#xff1b; 2、c语言没有专门储存字符串的变量类型&#xff0c;字符串被储存在char类型的数组中&#xff1b;\0标记字符串的结束&a…

低价寄快递寄件微信小程序 实际商用版 寄快递 低价寄快递小程序(源代码+截图)前后台源码

盈利模式 快递代下CPS就是用户通过线上的渠道&#xff08;快递小程序&#xff09;&#xff0c;线上下单寄快递来赚取差价&#xff0c;例如你的成本价是5元&#xff0c;你在后台比例设置里面设置 首重利润是1元&#xff0c;续重0.5元&#xff0c;用户下1kg的单页面显示的就是6元…

LiteVNA 能做什么?

最近入手了一台 LiteVNA 设备&#xff0c;性价比非常高。因为之前没有接触过 VNA 这种测试仪器&#xff0c;所以准备好好研究一下。和它类似的一个项目是 NanoVNA6000&#xff0c;价格要高些&#xff0c;但可能性能要好点&#xff0c;另外&#xff0c;文档也要全一些。 VNA …

C++跨DLL内存所有权问题探幽(一)DLL提供的全局单例模式

最近在开发的时候&#xff0c;特别是遇到关于跨DLL申请对象、指针、内存等问题的时候遇到了这么一个问题。 问题 跨DLL能不能调用到DLL中提供的单例&#xff1f; 问题比较简单&#xff0c;就是我现在有一个进程A&#xff0c;有DLL B DLL C&#xff0c;这两个DLL都依赖DLL D的…

Linux系统编程——修改配置文件(应用)

该应用主要调用到strstr函数&#xff0c;我们只需调用该函数并传入相关文件和修改数值即可&#xff0c;下面就是对strstr函数的定义解读以及实现案例 1.调用strstr函数需要包含以下头文件 #include<string.h>2.函数定义格式 char *strstr(char *str1, const char *str…