计算机毕业设计 基于SpringBoot的线上心理咨询室系统的设计与实现 Java实战项目 附源码+文档+视频讲解

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

目录

1、项目介绍及开发技术

1.1 项目介绍

1.2 开发技术

2、系统功能设计结构图

3、功能截图

4、数据库表结构设计

5、关键代码

5.1 心理医生咨询Controller模块 

5.2 心理医生咨询Service模块 

5.3 心理医生咨询ServiceImpl模块

5.4 心理医生咨询Dao模块

6、论文目录结构

7、源码获取


1、项目介绍及开发技术

1.1 项目介绍

传统办法管理信息首先需要花费的时间比较多,其次数据出错率比较高,而且对错误的数据进行更改也比较困难,最后,检索数据费事费力。因此,在计算机上安装高校线上心理咨询室软件来发挥其高效地信息处理的作用,可以规范信息管理流程,让管理工作可以系统化和程序化,同时,高校线上心理咨询室的有效运用可以帮助管理人员准确快速地处理信息。

高校线上心理咨询室在对开发工具的选择上也很慎重,为了便于开发实现,选择的开发工具为Eclipse,选择的数据库工具为Mysql。以此搭建开发环境实现高校线上心理咨询室的功能。其中管理员管理用户,新闻公告。

高校线上心理咨询室是一款运用软件开发技术设计实现的应用系统,在信息处理上可以达到快速的目的,不管是针对数据添加,数据维护和统计,以及数据查询等处理要求,高校线上心理咨询室都可以轻松应对。

1.2 开发技术

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

2、系统功能设计结构图

3、功能截图

用户信息管理:用户信息的查询管理,可以删除用户信息、修改用户信息、新增用户信息,还进行了对用户名称的模糊查询的条件。

心理医生管理:查看已发布的心理医生数据,修改心理医生,心理医生作废,即可删除,还进行了对心理医生名称的模糊查询 心理医生信息的类型查询等等一些条件。

讲座信息管理:根据讲座信息进行条件查询,还可以对讲座信息进行新增、修改、查询操作等等。

公告信息管理:根据公告信息进行新增、修改、查询操作等等。

4、数据库表结构设计

CREATE DATABASE /*!32312 IF NOT EXISTS*/`gaoxiaoxianshangxinlizhixun` /*!40100 DEFAULT CHARACTER SET utf8 */;

USE `gaoxiaoxianshangxinlizhixun`;

/*Table structure for table `config` */

DROP TABLE IF EXISTS `config`;

CREATE TABLE `config` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(100) DEFAULT 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,'jiangzhuo_types','讲座类型',1,'讲座类型1',NULL,NULL,'2023-02-27 09:28:34'),(2,'jiangzhuo_types','讲座类型',2,'讲座类型2',NULL,NULL,'2023-02-27 09:28:34'),(3,'jiangzhuo_types','讲座类型',3,'讲座类型3',NULL,NULL,'2023-02-27 09:28:34'),(4,'xinliyisheng_types','心理医生类型',1,'心理医生类型1',NULL,NULL,'2023-02-27 09:28:34'),(5,'xinliyisheng_types','心理医生类型',2,'心理医生类型2',NULL,NULL,'2023-02-27 09:28:34'),(6,'xinliyisheng_types','心理医生类型',3,'心理医生类型3',NULL,NULL,'2023-02-27 09:28:34'),(7,'xinliyisheng_collection_types','收藏表类型',1,'收藏',NULL,NULL,'2023-02-27 09:28:34'),(8,'xinliyisheng_chat_types','数据类型',1,'问题',NULL,NULL,'2023-02-27 09:28:34'),(9,'xinliyisheng_chat_types','数据类型',2,'回复',NULL,NULL,'2023-02-27 09:28:34'),(10,'zhuangtai_types','状态',1,'未回复',NULL,NULL,'2023-02-27 09:28:34'),(11,'zhuangtai_types','状态',2,'已回复',NULL,NULL,'2023-02-27 09:28:34'),(12,'xinliyisheng_yuyue_yesno_types','预约状态',1,'待审核',NULL,NULL,'2023-02-27 09:28:34'),(13,'xinliyisheng_yuyue_yesno_types','预约状态',2,'同意',NULL,NULL,'2023-02-27 09:28:34'),(14,'xinliyisheng_yuyue_yesno_types','预约状态',3,'拒绝',NULL,NULL,'2023-02-27 09:28:34'),(15,'news_types','公告类型',1,'公告类型1',NULL,NULL,'2023-02-27 09:28:34'),(16,'news_types','公告类型',2,'公告类型2',NULL,NULL,'2023-02-27 09:28:34'),(17,'news_types','公告类型',3,'公告类型3',NULL,NULL,'2023-02-27 09:28:34'),(18,'sex_types','性别',1,'男',NULL,NULL,'2023-02-27 09:28:34'),(19,'sex_types','性别',2,'女',NULL,NULL,'2023-02-27 09:28:34'),(20,'forum_state_types','帖子状态',1,'发帖',NULL,NULL,'2023-02-27 09:28:34'),(21,'forum_state_types','帖子状态',2,'回帖',NULL,NULL,'2023-02-27 09:28:34');

/*Table structure for table `forum` */

DROP TABLE IF EXISTS `forum`;

CREATE TABLE `forum` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `forum_name` varchar(200) DEFAULT NULL COMMENT '帖子标题  Search111 ',
  `xinliyisheng_id` int(11) DEFAULT NULL COMMENT '心理医生',
  `yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
  `forum_photo` varchar(200) DEFAULT NULL COMMENT '头像',
  `users_id` int(11) DEFAULT NULL COMMENT '管理员',
  `forum_content` text COMMENT '发布内容',
  `super_ids` int(11) DEFAULT NULL COMMENT '父id',
  `forum_state_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 '创建时间 show2',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8 COMMENT='情感树洞';

/*Data for the table `forum` */

insert  into `forum`(`id`,`forum_name`,`xinliyisheng_id`,`yonghu_id`,`forum_photo`,`users_id`,`forum_content`,`super_ids`,`forum_state_types`,`insert_time`,`update_time`,`create_time`) values (1,'帖子标题1',NULL,2,'upload/forum1.jpg',NULL,'发布内容1',402,1,'2023-02-27 09:28:54','2023-02-27 09:28:54','2023-02-27 09:28:54'),(2,'帖子标题2',NULL,2,'upload/forum2.jpg',NULL,'发布内容2',315,1,'2023-02-27 09:28:54','2023-02-27 09:28:54','2023-02-27 09:28:54'),(3,'帖子标题3',NULL,2,'upload/forum3.jpg',NULL,'发布内容3',444,1,'2023-02-27 09:28:54','2023-02-27 09:28:54','2023-02-27 09:28:54'),(4,'帖子标题4',NULL,2,'upload/forum4.jpg',NULL,'发布内容4',431,1,'2023-02-27 09:28:54','2023-02-27 09:28:54','2023-02-27 09:28:54'),(5,'帖子标题5',NULL,1,'upload/forum5.jpg',NULL,'发布内容5',235,1,'2023-02-27 09:28:54','2023-02-27 09:28:54','2023-02-27 09:28:54'),(6,'帖子标题6',NULL,2,'upload/forum6.jpg',NULL,'发布内容6',247,1,'2023-02-27 09:28:54','2023-02-27 09:28:54','2023-02-27 09:28:54'),(7,'帖子标题7',NULL,2,'upload/forum7.jpg',NULL,'发布内容7',253,1,'2023-02-27 09:28:54','2023-02-27 09:28:54','2023-02-27 09:28:54'),(8,'帖子标题8',NULL,2,'upload/forum8.jpg',NULL,'发布内容8',334,1,'2023-02-27 09:28:54','2023-02-27 09:28:54','2023-02-27 09:28:54'),(9,'帖子标题9',NULL,3,'upload/forum9.jpg',NULL,'发布内容9',448,1,'2023-02-27 09:28:54','2023-02-27 09:28:54','2023-02-27 09:28:54'),(10,'帖子标题10',NULL,1,'upload/forum10.jpg',NULL,'发布内容10',148,1,'2023-02-27 09:28:54','2023-02-27 09:28:54','2023-02-27 09:28:54'),(11,'帖子标题11',NULL,1,'upload/forum11.jpg',NULL,'发布内容11',406,1,'2023-02-27 09:28:54','2023-02-27 09:28:54','2023-02-27 09:28:54'),(12,'帖子标题12',NULL,3,'upload/forum12.jpg',NULL,'发布内容12',129,1,'2023-02-27 09:28:54','2023-02-27 09:28:54','2023-02-27 09:28:54'),(13,'帖子标题13',NULL,2,'upload/forum13.jpg',NULL,'发布内容13',272,1,'2023-02-27 09:28:54','2023-02-27 09:28:54','2023-02-27 09:28:54'),(14,'帖子标题14',NULL,2,'upload/forum14.jpg',NULL,'发布内容14',228,1,'2023-02-27 09:28:54','2023-02-27 09:28:54','2023-02-27 09:28:54'),(15,NULL,NULL,1,'',NULL,'312312312',14,2,'2023-02-27 10:46:11',NULL,'2023-02-27 10:46:11'),(16,NULL,NULL,1,'http://localhost:8080/gaoxiaoxianshangxinlizhixun/upload/1677465977337.jpeg',NULL,'312312312',14,2,'2023-02-27 10:46:19',NULL,'2023-02-27 10:46:19'),(17,NULL,1,NULL,NULL,NULL,'123',14,2,'2023-02-27 10:47:41',NULL,'2023-02-27 10:47:41'),(19,NULL,NULL,NULL,'/upload/1677466196697.jpeg',1,'123123',14,2,'2023-02-27 10:49:58',NULL,'2023-02-27 10:49:58'),(20,NULL,NULL,1,'http://localhost:8080/gaoxiaoxianshangxinlizhixun/upload/1677466271950.jpeg',NULL,'123213',14,2,'2023-02-27 10:51:15',NULL,'2023-02-27 10:51:15');

/*Table structure for table `jiangzhuo` */

DROP TABLE IF EXISTS `jiangzhuo`;

CREATE TABLE `jiangzhuo` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
  `jiangzhuo_name` varchar(200) DEFAULT NULL COMMENT '讲座标题 Search111 ',
  `jiangzhuo_types` int(11) DEFAULT NULL COMMENT '讲座类型 Search111',
  `jiangzhuo_photo` varchar(200) DEFAULT NULL COMMENT '封面',
  `jiangzhuo_shichang` varchar(200) DEFAULT NULL COMMENT '讲座时长',
  `jiangzhuo_time` timestamp NULL DEFAULT NULL COMMENT '开始时间',
  `jiangzhuo_address` varchar(200) DEFAULT NULL COMMENT '讲座地址',
  `jiangzhuo_content` text COMMENT '讲座简介',
  `jiangzhuo_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 `jiangzhuo` */

insert  into `jiangzhuo`(`id`,`jiangzhuo_name`,`jiangzhuo_types`,`jiangzhuo_photo`,`jiangzhuo_shichang`,`jiangzhuo_time`,`jiangzhuo_address`,`jiangzhuo_content`,`jiangzhuo_delete`,`insert_time`,`create_time`) values (1,'讲座标题1',1,'upload/jiangzhuo1.jpg','讲座时长1','2023-02-27 09:28:54','讲座地址1','讲座简介1',1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(2,'讲座标题2',2,'upload/jiangzhuo2.jpg','讲座时长2','2023-02-27 09:28:54','讲座地址2','讲座简介2',1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(3,'讲座标题3',2,'upload/jiangzhuo3.jpg','讲座时长3','2023-02-27 09:28:54','讲座地址3','讲座简介3',1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(4,'讲座标题4',1,'upload/jiangzhuo4.jpg','讲座时长4','2023-02-27 09:28:54','讲座地址4','讲座简介4',1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(5,'讲座标题5',2,'upload/jiangzhuo5.jpg','讲座时长5','2023-02-27 09:28:54','讲座地址5','讲座简介5',1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(6,'讲座标题6',3,'upload/jiangzhuo6.jpg','讲座时长6','2023-02-27 09:28:54','讲座地址6','讲座简介6',1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(7,'讲座标题7',3,'upload/jiangzhuo7.jpg','讲座时长7','2023-02-27 09:28:54','讲座地址7','讲座简介7',1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(8,'讲座标题8',3,'upload/jiangzhuo8.jpg','讲座时长8','2023-02-27 09:28:54','讲座地址8','讲座简介8',1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(9,'讲座标题9',1,'upload/jiangzhuo9.jpg','讲座时长9','2023-02-27 09:28:54','讲座地址9','讲座简介9',1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(10,'讲座标题10',2,'upload/jiangzhuo10.jpg','讲座时长10','2023-02-27 09:28:54','讲座地址10','讲座简介10',1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(11,'讲座标题11',1,'upload/jiangzhuo11.jpg','讲座时长11','2023-02-27 09:28:54','讲座地址11','讲座简介11',1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(12,'讲座标题12',1,'upload/jiangzhuo12.jpg','讲座时长12','2023-02-27 09:28:54','讲座地址12','讲座简介12',1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(13,'讲座标题13',2,'upload/jiangzhuo13.jpg','讲座时长13','2023-02-27 09:28:54','讲座地址13','讲座简介13',1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(14,'讲座标题14',1,'upload/jiangzhuo14.jpg','讲座时长14','2023-02-27 09:28:54','讲座地址14','讲座简介14',1,'2023-02-27 09:28:54','2023-02-27 09:28:54');

/*Table structure for table `news` */

DROP TABLE IF EXISTS `news`;

CREATE TABLE `news` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `news_name` varchar(200) DEFAULT NULL COMMENT '公告标题  Search111 ',
  `news_types` int(11) DEFAULT NULL COMMENT '公告类型  Search111 ',
  `news_photo` varchar(200) DEFAULT NULL COMMENT '公告图片',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '添加时间',
  `news_content` text 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 `news` */

insert  into `news`(`id`,`news_name`,`news_types`,`news_photo`,`insert_time`,`news_content`,`create_time`) values (1,'公告标题1',1,'upload/news1.jpg','2023-02-27 09:28:54','公告详情1','2023-02-27 09:28:54'),(2,'公告标题2',2,'upload/news2.jpg','2023-02-27 09:28:54','公告详情2','2023-02-27 09:28:54'),(3,'公告标题3',1,'upload/news3.jpg','2023-02-27 09:28:54','公告详情3','2023-02-27 09:28:54'),(4,'公告标题4',3,'upload/news4.jpg','2023-02-27 09:28:54','公告详情4','2023-02-27 09:28:54'),(5,'公告标题5',1,'upload/news5.jpg','2023-02-27 09:28:54','公告详情5','2023-02-27 09:28:54'),(6,'公告标题6',1,'upload/news6.jpg','2023-02-27 09:28:54','公告详情6','2023-02-27 09:28:54'),(7,'公告标题7',1,'upload/news7.jpg','2023-02-27 09:28:54','公告详情7','2023-02-27 09:28:54'),(8,'公告标题8',1,'upload/news8.jpg','2023-02-27 09:28:54','公告详情8','2023-02-27 09:28:54'),(9,'公告标题9',3,'upload/news9.jpg','2023-02-27 09:28:54','公告详情9','2023-02-27 09:28:54'),(10,'公告标题10',3,'upload/news10.jpg','2023-02-27 09:28:54','公告详情10','2023-02-27 09:28:54'),(11,'公告标题11',3,'upload/news11.jpg','2023-02-27 09:28:54','公告详情11','2023-02-27 09:28:54'),(12,'公告标题12',3,'upload/news12.jpg','2023-02-27 09:28:54','公告详情12','2023-02-27 09:28:54'),(13,'公告标题13',1,'upload/news13.jpg','2023-02-27 09:28:54','公告详情13','2023-02-27 09:28:54'),(14,'公告标题14',3,'upload/news14.jpg','2023-02-27 09:28:54','公告详情14','2023-02-27 09:28:54');

/*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,'admin','users','管理员','ros2qshgbzalfji8y2kd8wnrmi3y4mbf','2023-02-27 09:35:56','2023-02-27 11:53:55'),(2,1,'a1','yonghu','用户','xokxpp00cczp5k47vsowy5i0wstkcmev','2023-02-27 10:01:05','2023-02-27 11:45:16'),(3,1,'a1','xinliyisheng','心理医生','7ukukz4y8fibvb1b3nzspshes5h6w3j4','2023-02-27 10:24:30','2023-02-27 11:46:42');

/*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-02-27 09:28:34');

/*Table structure for table `xinliyisheng` */

DROP TABLE IF EXISTS `xinliyisheng`;

CREATE TABLE `xinliyisheng` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
  `username` varchar(200) DEFAULT NULL COMMENT '账户',
  `password` varchar(200) DEFAULT NULL COMMENT '密码',
  `xinliyisheng_name` varchar(200) DEFAULT NULL COMMENT '心理医生名称 Search111 ',
  `xinliyisheng_types` int(11) DEFAULT NULL COMMENT '心理医生类型 Search111',
  `xinliyisheng_photo` varchar(200) DEFAULT NULL COMMENT '头像',
  `xinliyisheng_jiuzhi` varchar(200) DEFAULT NULL COMMENT '就职点',
  `xinliyisheng_zhugong` varchar(200) DEFAULT NULL COMMENT '主攻方向',
  `xinliyisheng_zhiwei` varchar(200) DEFAULT NULL COMMENT '职位',
  `xinliyisheng_content` text COMMENT '心理医生简介',
  `xinliyisheng_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间  show1 show2 photoShow homeMain',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='心理医生';

/*Data for the table `xinliyisheng` */

insert  into `xinliyisheng`(`id`,`username`,`password`,`xinliyisheng_name`,`xinliyisheng_types`,`xinliyisheng_photo`,`xinliyisheng_jiuzhi`,`xinliyisheng_zhugong`,`xinliyisheng_zhiwei`,`xinliyisheng_content`,`xinliyisheng_delete`,`insert_time`,`create_time`) values (1,'a1','123456','心理医生名称1',3,'upload/xinliyisheng1.jpg','就职点1','主攻方向1','职位1','<p>心理医生简介1</p>',1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(2,'a2','123456','心理医生名称2',1,'upload/xinliyisheng2.jpg','就职点2','主攻方向2','职位2','心理医生简介2',1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(3,'a3','123456','心理医生名称3',3,'upload/xinliyisheng3.jpg','就职点3','主攻方向3','职位3','心理医生简介3',1,'2023-02-27 09:28:54','2023-02-27 09:28:54');

/*Table structure for table `xinliyisheng_chat` */

DROP TABLE IF EXISTS `xinliyisheng_chat`;

CREATE TABLE `xinliyisheng_chat` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `yonghu_id` int(11) DEFAULT NULL COMMENT '提问人',
  `xinliyisheng_id` int(11) DEFAULT NULL COMMENT '回答人',
  `xinliyisheng_chat_issue_text` text COMMENT '问题',
  `issue_time` timestamp NULL DEFAULT NULL COMMENT '问题时间',
  `xinliyisheng_chat_reply_text` text COMMENT '回复',
  `reply_time` timestamp NULL DEFAULT NULL COMMENT '回复时间',
  `zhuangtai_types` int(255) DEFAULT NULL COMMENT '状态',
  `xinliyisheng_chat_types` int(11) DEFAULT NULL COMMENT '数据类型',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '提问时间',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8 COMMENT='心理医生咨询';

/*Data for the table `xinliyisheng_chat` */

insert  into `xinliyisheng_chat`(`id`,`yonghu_id`,`xinliyisheng_id`,`xinliyisheng_chat_issue_text`,`issue_time`,`xinliyisheng_chat_reply_text`,`reply_time`,`zhuangtai_types`,`xinliyisheng_chat_types`,`insert_time`,`create_time`) values (1,1,2,'问题1','2023-02-27 09:28:54','回复1','2023-02-27 09:28:54',2,1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(2,1,1,'问题2','2023-02-27 09:28:54','回复2','2023-02-27 09:28:54',2,1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(3,3,2,'问题3','2023-02-27 09:28:54','回复3','2023-02-27 09:28:54',1,2,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(4,3,2,'问题4','2023-02-27 09:28:54','回复4','2023-02-27 09:28:54',1,2,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(5,3,1,'问题5','2023-02-27 09:28:54','回复5','2023-02-27 09:28:54',2,2,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(6,3,3,'问题6','2023-02-27 09:28:54','回复6','2023-02-27 09:28:54',2,1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(7,1,1,'问题7','2023-02-27 09:28:54','回复7','2023-02-27 09:28:54',1,1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(8,3,1,'问题8','2023-02-27 09:28:54','回复8','2023-02-27 09:28:54',2,2,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(9,3,1,'问题9','2023-02-27 09:28:54','回复9','2023-02-27 09:28:54',1,1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(10,2,2,'问题10','2023-02-27 09:28:54','回复10','2023-02-27 09:28:54',2,2,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(11,1,3,'问题11','2023-02-27 09:28:54','回复11','2023-02-27 09:28:54',1,2,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(12,2,1,'问题12','2023-02-27 09:28:54','回复12','2023-02-27 09:28:54',1,1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(13,3,1,'问题13','2023-02-27 09:28:54','回复13','2023-02-27 09:28:54',1,1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(14,3,1,'问题14','2023-02-27 09:28:54','回复14','2023-02-27 09:28:54',2,2,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(15,1,3,'123','2023-02-27 10:08:55',NULL,NULL,1,1,'2023-02-27 10:08:56','2023-02-27 10:08:56'),(16,1,1,'1','2023-02-27 10:09:07',NULL,NULL,1,1,'2023-02-27 10:09:08','2023-02-27 10:09:08'),(17,1,1,'321','2023-02-27 10:46:01',NULL,NULL,1,1,'2023-02-27 10:46:02','2023-02-27 10:46:02'),(18,1,1,NULL,NULL,'12333','2023-02-27 10:47:12',NULL,2,'2023-02-27 10:47:12','2023-02-27 10:47:12'),(19,1,1,NULL,NULL,'333','2023-02-27 10:47:17',NULL,2,'2023-02-27 10:47:17','2023-02-27 10:47:17');

/*Table structure for table `xinliyisheng_collection` */

DROP TABLE IF EXISTS `xinliyisheng_collection`;

CREATE TABLE `xinliyisheng_collection` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `xinliyisheng_id` int(11) DEFAULT NULL COMMENT '心理医生',
  `yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
  `xinliyisheng_collection_types` int(11) DEFAULT NULL COMMENT '类型',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '收藏时间',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 photoShow',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='心理医生收藏';

/*Data for the table `xinliyisheng_collection` */

insert  into `xinliyisheng_collection`(`id`,`xinliyisheng_id`,`yonghu_id`,`xinliyisheng_collection_types`,`insert_time`,`create_time`) values (2,3,3,1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(4,1,3,1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(6,3,3,1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(7,3,2,1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(8,1,3,1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(10,3,2,1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(13,1,1,1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(14,3,3,1,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(15,2,1,1,'2023-02-27 10:45:30','2023-02-27 10:45:30'),(16,3,1,1,'2023-02-27 10:45:34','2023-02-27 10:45:34');

/*Table structure for table `xinliyisheng_liuyan` */

DROP TABLE IF EXISTS `xinliyisheng_liuyan`;

CREATE TABLE `xinliyisheng_liuyan` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `xinliyisheng_id` int(11) DEFAULT NULL COMMENT '心理医生',
  `yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
  `xinliyisheng_liuyan_text` text COMMENT '留言内容',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '留言时间',
  `reply_text` text COMMENT '回复内容',
  `update_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 `xinliyisheng_liuyan` */

insert  into `xinliyisheng_liuyan`(`id`,`xinliyisheng_id`,`yonghu_id`,`xinliyisheng_liuyan_text`,`insert_time`,`reply_text`,`update_time`,`create_time`) values (1,3,1,'留言内容1','2023-02-27 09:28:54','回复信息1','2023-02-27 09:28:54','2023-02-27 09:28:54'),(2,3,3,'留言内容2','2023-02-27 09:28:54','回复信息2','2023-02-27 09:28:54','2023-02-27 09:28:54'),(3,3,3,'留言内容3','2023-02-27 09:28:54','回复信息3','2023-02-27 09:28:54','2023-02-27 09:28:54'),(4,1,1,'留言内容4','2023-02-27 09:28:54','回复信息4','2023-02-27 09:28:54','2023-02-27 09:28:54'),(5,3,2,'留言内容5','2023-02-27 09:28:54','回复信息5','2023-02-27 09:28:54','2023-02-27 09:28:54'),(6,1,1,'留言内容6','2023-02-27 09:28:54','回复信息6','2023-02-27 09:28:54','2023-02-27 09:28:54'),(7,3,3,'留言内容7','2023-02-27 09:28:54','回复信息7','2023-02-27 09:28:54','2023-02-27 09:28:54'),(8,1,1,'留言内容8','2023-02-27 09:28:54','回复信息8','2023-02-27 09:28:54','2023-02-27 09:28:54'),(9,1,3,'留言内容9','2023-02-27 09:28:54','回复信息9','2023-02-27 09:28:54','2023-02-27 09:28:54'),(10,3,3,'留言内容10','2023-02-27 09:28:54','回复信息10','2023-02-27 09:28:54','2023-02-27 09:28:54'),(11,1,1,'留言内容11','2023-02-27 09:28:54','回复信息11','2023-02-27 09:28:54','2023-02-27 09:28:54'),(12,2,1,'留言内容12','2023-02-27 09:28:54','回复信息12','2023-02-27 09:28:54','2023-02-27 09:28:54'),(13,1,3,'留言内容13','2023-02-27 09:28:54','回复信息13333333','2023-02-27 10:46:54','2023-02-27 09:28:54'),(14,2,1,'留言内容14','2023-02-27 09:28:54','回复信息14','2023-02-27 09:28:54','2023-02-27 09:28:54');

/*Table structure for table `xinliyisheng_yuyue` */

DROP TABLE IF EXISTS `xinliyisheng_yuyue`;

CREATE TABLE `xinliyisheng_yuyue` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `xinliyisheng_id` int(11) DEFAULT NULL COMMENT '心理医生',
  `yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
  `xinliyisheng_yuyue_text` text COMMENT '预约原因',
  `xinliyisheng_yuyue_time` timestamp NULL DEFAULT NULL COMMENT '预约时间',
  `xinliyisheng_yuyue_yesno_types` int(11) DEFAULT NULL COMMENT '预约状态 Search111 ',
  `xinliyisheng_yuyue_yesno_text` text COMMENT '审核回复',
  `insert_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 `xinliyisheng_yuyue` */

insert  into `xinliyisheng_yuyue`(`id`,`xinliyisheng_id`,`yonghu_id`,`xinliyisheng_yuyue_text`,`xinliyisheng_yuyue_time`,`xinliyisheng_yuyue_yesno_types`,`xinliyisheng_yuyue_yesno_text`,`insert_time`,`create_time`) values (1,3,1,'预约原因1','2023-02-27 09:28:54',1,NULL,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(2,3,1,'预约原因2','2023-02-27 09:28:54',1,NULL,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(3,1,1,'预约原因3','2023-02-27 09:28:54',1,NULL,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(4,1,2,'预约原因4','2023-02-27 09:28:54',1,NULL,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(5,2,1,'预约原因5','2023-02-27 09:28:54',1,NULL,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(6,1,3,'预约原因6','2023-02-27 09:28:54',1,NULL,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(7,1,3,'预约原因7','2023-02-27 09:28:54',1,NULL,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(12,3,3,'预约原因12','2023-02-27 09:28:54',1,NULL,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(13,1,3,'预约原因13','2023-02-27 09:28:54',1,NULL,'2023-02-27 09:28:54','2023-02-27 09:28:54'),(16,1,1,'123123123','2023-02-27 10:45:37',2,'123132','2023-02-27 10:45:42','2023-02-27 10:45:42');

/*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_name` varchar(200) DEFAULT NULL COMMENT '用户姓名 Search111 ',
  `sex_types` int(11) DEFAULT NULL COMMENT '性别 Search111',
  `yonghu_photo` varchar(200) DEFAULT NULL COMMENT '头像',
  `yonghu_id_number` varchar(200) DEFAULT NULL COMMENT '身份证号',
  `yonghu_phone` varchar(200) DEFAULT NULL COMMENT '联系方式',
  `yonghu_email` varchar(200) DEFAULT NULL COMMENT '电子邮箱',
  `yonghu_delete` int(11) 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_name`,`sex_types`,`yonghu_photo`,`yonghu_id_number`,`yonghu_phone`,`yonghu_email`,`yonghu_delete`,`create_time`) values (1,'a1','123456','用户姓名1',2,'upload/yonghu1.jpg','410224199010102001','17703786901','1@qq.com',1,'2023-02-27 09:28:54'),(2,'a2','123456','用户姓名2',1,'upload/yonghu2.jpg','410224199010102002','17703786902','2@qq.com',1,'2023-02-27 09:28:54'),(3,'a3','123456','用户姓名3',2,'upload/yonghu3.jpg','410224199010102003','17703786903','3@qq.com',1,'2023-02-27 09:28:54');

/*!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模块 

/**
 * 心理医生咨询
 * 后端接口
 * @author 学长编程
 * @email
 * WeChat  jsjbysj88
*/
@RestController
@Controller
@RequestMapping("/xinliyishengChat")
public class XinliyishengChatController {
    private static final Logger logger = LoggerFactory.getLogger(XinliyishengChatController.class);

    private static final String TABLE_NAME = "xinliyishengChat";

    @Autowired
    private XinliyishengChatService xinliyishengChatService;


    @Autowired
    private TokenService tokenService;
    @Autowired
    private DictionaryService dictionaryService;

    //级联表非注册的service
    //注册表service
    @Autowired
    private YonghuService yonghuService;
    @Autowired
    private XinliyishengService xinliyishengService;


    /**
    * 后端列表
    */
    @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("xinliyishengId",request.getSession().getAttribute("userId"));
        CommonUtil.checkMap(params);
        PageUtils page = xinliyishengChatService.queryPage(params);

        //字典表数据转换
        List<XinliyishengChatView> list =(List<XinliyishengChatView>)page.getList();
        for(XinliyishengChatView 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);
        XinliyishengChatEntity xinliyishengChat = xinliyishengChatService.selectById(id);
        if(xinliyishengChat !=null){
            //entity转view
            XinliyishengChatView view = new XinliyishengChatView();
            BeanUtils.copyProperties( xinliyishengChat , view );//把实体数据重构到view中
            //级联表 心理医生
            //级联表
            XinliyishengEntity xinliyisheng = xinliyishengService.selectById(xinliyishengChat.getXinliyishengId());
            if(xinliyisheng != null){
            BeanUtils.copyProperties( xinliyisheng , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "xinliyishengId"
, "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
            view.setXinliyishengId(xinliyisheng.getId());
            }
            //级联表 用户
            //级联表
            YonghuEntity yonghu = yonghuService.selectById(xinliyishengChat.getYonghuId());
            if(yonghu != null){
            BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "xinliyishengId"
, "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 XinliyishengChatEntity xinliyishengChat, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,xinliyishengChat:{}",this.getClass().getName(),xinliyishengChat.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永远不会进入");
        else if("心理医生".equals(role))
            xinliyishengChat.setXinliyishengId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
        else if("用户".equals(role))
            xinliyishengChat.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));

        Wrapper<XinliyishengChatEntity> queryWrapper = new EntityWrapper<XinliyishengChatEntity>()
            .eq("yonghu_id", xinliyishengChat.getYonghuId())
            .eq("xinliyisheng_id", xinliyishengChat.getXinliyishengId())
            .eq("zhuangtai_types", xinliyishengChat.getZhuangtaiTypes())
            .eq("xinliyisheng_chat_types", xinliyishengChat.getXinliyishengChatTypes())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        XinliyishengChatEntity xinliyishengChatEntity = xinliyishengChatService.selectOne(queryWrapper);
        if(xinliyishengChatEntity==null){
            xinliyishengChat.setInsertTime(new Date());
            xinliyishengChat.setCreateTime(new Date());
            xinliyishengChatService.insert(xinliyishengChat);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

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

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
//        else if("心理医生".equals(role))
//            xinliyishengChat.setXinliyishengId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
//        else if("用户".equals(role))
//            xinliyishengChat.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
        //根据字段查询是否有相同数据
        Wrapper<XinliyishengChatEntity> queryWrapper = new EntityWrapper<XinliyishengChatEntity>()
            .notIn("id",xinliyishengChat.getId())
            .andNew()
            .eq("yonghu_id", xinliyishengChat.getYonghuId())
            .eq("xinliyisheng_id", xinliyishengChat.getXinliyishengId())
            .eq("zhuangtai_types", xinliyishengChat.getZhuangtaiTypes())
            .eq("xinliyisheng_chat_types", xinliyishengChat.getXinliyishengChatTypes())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        XinliyishengChatEntity xinliyishengChatEntity = xinliyishengChatService.selectOne(queryWrapper);
        if(xinliyishengChatEntity==null){
            xinliyishengChatService.updateById(xinliyishengChat);//根据id更新
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }


    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        List<XinliyishengChatEntity> oldXinliyishengChatList =xinliyishengChatService.selectBatchIds(Arrays.asList(ids));//要删除的数据
        xinliyishengChatService.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");
        try {
            List<XinliyishengChatEntity> xinliyishengChatList = 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){
                            //循环
                            XinliyishengChatEntity xinliyishengChatEntity = new XinliyishengChatEntity();
//                            xinliyishengChatEntity.setYonghuId(Integer.valueOf(data.get(0)));   //提问人 要改的
//                            xinliyishengChatEntity.setXinliyishengId(Integer.valueOf(data.get(0)));   //回答人 要改的
//                            xinliyishengChatEntity.setXinliyishengChatIssueText(data.get(0));                    //问题 要改的
//                            xinliyishengChatEntity.setIssueTime(sdf.parse(data.get(0)));          //问题时间 要改的
//                            xinliyishengChatEntity.setXinliyishengChatReplyText(data.get(0));                    //回复 要改的
//                            xinliyishengChatEntity.setReplyTime(sdf.parse(data.get(0)));          //回复时间 要改的
//                            xinliyishengChatEntity.setZhuangtaiTypes(Integer.valueOf(data.get(0)));   //状态 要改的
//                            xinliyishengChatEntity.setXinliyishengChatTypes(Integer.valueOf(data.get(0)));   //数据类型 要改的
//                            xinliyishengChatEntity.setInsertTime(date);//时间
//                            xinliyishengChatEntity.setCreateTime(date);//时间
                            xinliyishengChatList.add(xinliyishengChatEntity);


                            //把要查询是否重复的字段放入map中
                        }

                        //查询是否重复
                        xinliyishengChatService.insertBatch(xinliyishengChatList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }


    /**
    * 前端列表
    */
    @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 = xinliyishengChatService.queryPage(params);

        //字典表数据转换
        List<XinliyishengChatView> list =(List<XinliyishengChatView>)page.getList();
        for(XinliyishengChatView 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);
        XinliyishengChatEntity xinliyishengChat = xinliyishengChatService.selectById(id);
            if(xinliyishengChat !=null){


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

                //级联表
                    XinliyishengEntity xinliyisheng = xinliyishengService.selectById(xinliyishengChat.getXinliyishengId());
                if(xinliyisheng != null){
                    BeanUtils.copyProperties( xinliyisheng , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setXinliyishengId(xinliyisheng.getId());
                }
                //级联表
                    YonghuEntity yonghu = yonghuService.selectById(xinliyishengChat.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 XinliyishengChatEntity xinliyishengChat, HttpServletRequest request){
        logger.debug("add方法:,,Controller:{},,xinliyishengChat:{}",this.getClass().getName(),xinliyishengChat.toString());
        Wrapper<XinliyishengChatEntity> queryWrapper = new EntityWrapper<XinliyishengChatEntity>()
            .eq("yonghu_id", xinliyishengChat.getYonghuId())
            .eq("xinliyisheng_id", xinliyishengChat.getXinliyishengId())
            .eq("xinliyisheng_chat_issue_text", xinliyishengChat.getXinliyishengChatIssueText())
            .eq("xinliyisheng_chat_reply_text", xinliyishengChat.getXinliyishengChatReplyText())
            .eq("zhuangtai_types", xinliyishengChat.getZhuangtaiTypes())
            .eq("xinliyisheng_chat_types", xinliyishengChat.getXinliyishengChatTypes())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        XinliyishengChatEntity xinliyishengChatEntity = xinliyishengChatService.selectOne(queryWrapper);
        if(xinliyishengChatEntity==null){
            xinliyishengChat.setInsertTime(new Date());
            xinliyishengChat.setCreateTime(new Date());
        xinliyishengChatService.insert(xinliyishengChat);

            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.XinliyishengChatEntity;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.lang.Nullable;
import java.util.List;

/**
 * 心理医生咨询 服务类
 */
public interface XinliyishengChatService extends IService<XinliyishengChatEntity> {

    /**
    * @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.XinliyishengChatDao;
import com.entity.XinliyishengChatEntity;
import com.service.XinliyishengChatService;
import com.entity.view.XinliyishengChatView;

/**
 * 心理医生咨询 服务实现类
 */
@Service("xinliyishengChatService")
@Transactional
public class XinliyishengChatServiceImpl extends ServiceImpl<XinliyishengChatDao, XinliyishengChatEntity> implements XinliyishengChatService {

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

}

5.4 心理医生咨询Dao模块

package com.dao;

import com.entity.XinliyishengChatEntity;
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.XinliyishengChatView;

/**
 * 心理医生咨询 Dao 接口
 *
 * @author 
 */
public interface XinliyishengChatDao extends BaseMapper<XinliyishengChatEntity> {

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

}

6、论文目录结构

7、源码获取

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

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

获取源码请私信

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

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

相关文章

Ceph分布式存储自动化运维平台开发实践

文章目录 1. 背景介绍1.1 什么是Ceph&#xff1f;1.1.1 Ceph的核心组件1.1.2 Ceph的优势 1.2 自动化运维的需求目标 2. 平台架构设计和组件版本2.1 平台架构设计2.2 组件版本2.3 模块划分&#xff08;已经脱敏处理&#xff09;2.3.1 当前版本V1.0支持功能2.3.2 前后端代码结构t…

勤学苦练“prompts“,如沐春风“CodeArts Snap“

前言 CodeArts Snap 上手一段时间了&#xff0c;对编程很有帮助。但是&#xff0c;感觉代码编写的不尽人意。 我因此也感到困惑&#xff0c;想要一份完整的 CodeArts Snap 手册看看。 就在我感觉仿佛"独自彷徨在这条悠长、悠长又寂寥的雨巷"时&#xff0c;我听了大…

Transformers Tutorial教程3-7

Introduction Transformers库的一个使用&#xff0c;用这个库就可以很轻松地去使用和训练自己的一个预训练语言模型。 outline 介绍什么是Transformers&#xff0c;为什么要用它 介绍一些比较常用的接口 最后会给出一个demo&#xff0c;帮助你们快速地入门 what is Transf…

重装Windows系统出现Windows无法安装到这个磁盘,选中的磁盘采用GPT分区

文章目录 1.问题描述2.问题解决 1.问题描述 重装Windows系统时&#xff0c;出现Windows无法安装到这个磁盘&#xff0c;选中的磁盘采用GPT分区这个提示 2.问题解决 1.shiftF10&#xff0c;打开命令行 2.输入&#xff1a;diskpart (打开分区工具) 3.输入&#xff1a;list di…

分享5款专注于实用功能的小众软件

​ 电脑上的各类软件有很多&#xff0c;除了那些常见的大众化软件&#xff0c;还有很多不为人知的小众软件&#xff0c;专注于实用功能&#xff0c;简洁干净、功能强悍。 1.视频播放——Potplayer ​ Potplayer是一款功能强大的视频播放软件&#xff0c;支持各种格式的视频文…

14:00面试,14:06就出来了,问的问题过于变态了。。。

从小厂出来&#xff0c;没想到在另一家公司又寄了。 到这家公司开始上班&#xff0c;加班是每天必不可少的&#xff0c;看在钱给的比较多的份上&#xff0c;就不太计较了。没想到5月一纸通知&#xff0c;所有人不准加班&#xff0c;加班费不仅没有了&#xff0c;薪资还要降40%…

Web10--jQuery进阶

1、DOM操作 1.1 操作内容 方法 描述 text() 获取/设置元素的标签体纯文本内容 html() 获取/设置元素的标签体超文本内容 <!DOCTYPE html> <html><head><meta charset"utf-8"><title>操作内容</title><style>div{w…

easypoi导出Word中,表格分页时上边框丢失

问题具体描述: 使用easypoi导出的Word中包含一个表格&#xff0c;表格行数较多&#xff0c;需要分页显示&#xff0c;在分页后第一行的上边框部分丢失&#xff0c;显示不美观&#xff0c;具体如下: 解决: 对表格中每行都添加一个上边框&#xff0c;具体如下: XWPFDocument do…

【蓝桥杯冲冲冲】贪心算法进阶之删数问题

蓝桥杯备赛 | 洛谷做题打卡day17 文章目录 蓝桥杯备赛 | 洛谷做题打卡day17删数问题题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1我们的思路是这样的&#xff1a; 题解代码我的一些话 删数问题 题目描述 键盘输入一个高精度的正整数 N N N&#xff08;不超过 25…

掌握可视化大屏:提升数据分析和决策能力的关键(下)

&#x1f90d; 前端开发工程师、技术日更博主、已过CET6 &#x1f368; 阿珊和她的猫_CSDN博客专家、23年度博客之星前端领域TOP1 &#x1f560; 牛客高级专题作者、打造专栏《前端面试必备》 、《2024面试高频手撕题》 &#x1f35a; 蓝桥云课签约作者、上架课程《Vue.js 和 E…

Tosei 自助网络店铺管理系统network_test.php_RCE漏洞复现

简介 Tosei 自助洗衣机是日本一家公司的产品,在 network_test.php 文件存在命令执行 漏洞复现 FOFA语法: body="tosei_login_check.php" 主要是日本 访问界面如下所示: 验证POC: /cgi-bin/network_test.php 拼接访问url: https://ip:port/cgi-bin/network_tes…

Redis6基础知识梳理~

初识NOSQL&#xff1a; NOSQL是为了解决性能问题而产生的技术&#xff0c;在最初&#xff0c;我们都是使用单体服务器架构&#xff0c;如下所示&#xff1a; 随着用户访问量大幅度提升&#xff0c;同时产生了大量的用户数据&#xff0c;单体服务器架构面对着巨大的压力 NOSQL解…

WebAssembly与JavaScript交互

一、概述 WebAssembly可以视为一种采用精简的”二进制格式”的“低等级”、“类汇编”语言。目前主流的浏览器均提供了对WebAssembly的支持&#xff0c;虽然WebAssembly的执行性能&#xff08;它能够提供near-native的执行性能&#xff09;是JavaScript无法比拟的&#xff0c;…

xxl-job之API的方式接入

文章目录 1 xxl-job1.1 简介1.2 分析1.3 学习xxl-job源码1.4 改造项目1.4.1 接口调用1.4.1.1 对接登录接口1.4.1.2 对接执行器接口1.4.1.3 对接任务接口 1.4.2 创建新注解1.4.3 自动注册核心1.4.4 自动装配 1 xxl-job 1.1 简介 xxl-job是一款非常优秀的任务调度中间件&#x…

《安富莱嵌入式周报》第331期:单片机实现全功能软件无线电,开源电源EEZ升级主控,ARM 汇编用户指南,UDS统一诊断服务解析,半导体可靠性设计手册

周报汇总地址&#xff1a;嵌入式周报 - uCOS & uCGUI & emWin & embOS & TouchGFX & ThreadX - 硬汉嵌入式论坛 - Powered by Discuz! 目录&#xff1a; 1、单片机实现低配版全功能软件无线电&#xff0c;范围0.5-30 MHz&#xff0c;支持SSB、AM、FM和CW …

Ubuntu20.4 Mono C# gtk 编程习练笔记(四)

连续实时绘图 图看上去不是很清晰&#xff0c;KAZAM录屏AVI尺寸80MB&#xff0c; 转换成gif后10MB, 按CSDN对GIF要求&#xff0c;把它剪裁缩小压缩成了上面的GIF&#xff0c;图像质量大不如原屏AVI&#xff0c;但应该能说明原意&#xff1a;随机数据随时间绘制在 gtk 的 drawin…

jQuery之ajax发送请求(table数据)

一般后端给我们的数据是这样的 比如下面是所有学员信息 访问网址&#xff1a;http://localhost:8080/student/all 前端&#xff0c;我们需要通过点击查询所有学员信息即可显示到下面列表中&#xff0c; 给查询全部学员按钮设置点击事件&#xff0c;点击就发送请求 $("…

基于LLaMA-Factory的微调记录

文章目录 数据模型准备基于网页的简单微调基于网页的简单评测基于网页的简单聊天 LLaMA-Factory是一个非常好用的无代码微调框架&#xff0c;不管是在模型、微调方式还是参数设置上都提供了非常完备的支持&#xff0c;下面是对微调全过程的一个记录。 数据模型准备 微调时一般…

【网络安全】2024年暗网威胁分析及发展预测

暗网因其非法活动而臭名昭著&#xff0c;现已发展成为一个用于各种非法目的的地下网络市场。 它是网络犯罪分子的中心&#xff0c;为被盗数据交易、黑客服务和邪恶活动合作提供了机会。为了帮助企业组织更好地了解暗网发展形势&#xff0c;近日&#xff0c;卡巴斯基的安全研究…

css3表格练习

1.效果图 2.html <div class"line"></div><h3>获奖名单</h3><!-- 表格 cellspacing内边距 cellpadding外边距--><table cellspacing"0" cellpadding"0" ><!-- thead表头 --><thead><tr>…