zhangrui 8 months ago
parent e03b0276ac
commit e0f02550eb

@ -0,0 +1,10 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Zeppelin ignored files
/ZeppelinRemoteNotebooks/

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChatGPTCopilotChannelManager">
<dynamicCommends>
<option value="解释" />
<option value="翻译为中文" />
<option value="翻译为英文" />
<option value="检查代码问题" />
<option value="优化代码" />
</dynamicCommends>
<chatChannels>
<chatChannel>
<option name="messages" />
</chatChannel>
</chatChannels>
</component>
</project>

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="xinliyalizixunpingpan" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="xinliyalizixunpingpan" options="-parameters" />
</option>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://maven.aliyun.com/repository/public" />
</remote-repository>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JpaBuddyIdeaProjectConfig">
<option name="renamerInitialized" value="true" />
</component>
</project>

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
<component name="ProjectType">
<option name="id" value="jpab" />
</component>
</project>

@ -0,0 +1,358 @@
/*
SQLyog Ultimate v11.3 (64 bit)
MySQL - 5.7.32-log : Database - xinliyalizixunpingpan
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`xinliyalizixunpingpan` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `xinliyalizixunpingpan`;
/*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` int(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=47 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 (24,'xinlijiankang_types','心理健康类型',1,'心理健康类型1',NULL,NULL,'2023-03-11 14:18:22'),(25,'xinlijiankang_types','心理健康类型',2,'心理健康类型2',NULL,NULL,'2023-03-11 14:18:22'),(26,'xinlijiankang_types','心理健康类型',3,'心理健康类型3',NULL,NULL,'2023-03-11 14:18:22'),(27,'xinlijiankang_collection_types','收藏表类型',1,'收藏',NULL,NULL,'2023-03-11 14:18:22'),(28,'xinlijiankang_collection_types','收藏表类型',2,'',NULL,NULL,'2023-03-11 14:18:22'),(29,'xinlijiankang_collection_types','收藏表类型',3,'',NULL,NULL,'2023-03-11 14:18:22'),(30,'zhixunshi_chat_types','数据类型',1,'问题',NULL,NULL,'2023-03-11 14:18:22'),(31,'zhixunshi_chat_types','数据类型',2,'回复',NULL,NULL,'2023-03-11 14:18:22'),(32,'zhuangtai_types','状态',1,'未回复',NULL,NULL,'2023-03-11 14:18:22'),(33,'zhuangtai_types','状态',2,'已回复',NULL,NULL,'2023-03-11 14:18:22'),(34,'zujuan_types','组卷方式',1,'自动组题',NULL,NULL,'2023-03-11 14:18:22'),(35,'zujuan_types','组卷方式',2,'手动组题',NULL,NULL,'2023-03-11 14:18:22'),(36,'exampaper_types','试卷状态',1,'启用',NULL,NULL,'2023-03-11 14:18:22'),(37,'exampaper_types','试卷状态',2,'禁用',NULL,NULL,'2023-03-11 14:18:22'),(38,'examquestion_types','试题类型',1,'单选题',NULL,NULL,'2023-03-11 14:18:22'),(39,'examquestion_types','试题类型',2,'多选题',NULL,NULL,'2023-03-11 14:18:22'),(40,'examquestion_types','试题类型',3,'判断题',NULL,NULL,'2023-03-11 14:18:22'),(41,'examquestion_types','试题类型',4,'填空题',NULL,NULL,'2023-03-11 14:18:22'),(42,'news_types','公告类型',1,'公告类型1',NULL,NULL,'2023-03-11 14:18:22'),(43,'news_types','公告类型',2,'公告类型2',NULL,NULL,'2023-03-11 14:18:22'),(44,'news_types','公告类型',3,'公告类型3',NULL,NULL,'2023-03-11 14:18:22'),(45,'sex_types','性别',1,'',NULL,NULL,'2023-03-11 14:18:22'),(46,'sex_types','性别',2,'',NULL,NULL,'2023-03-11 14:18:22');
/*Table structure for table `exampaper` */
DROP TABLE IF EXISTS `exampaper`;
CREATE TABLE `exampaper` (
`id` int(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`exampaper_name` varchar(200) NOT NULL COMMENT '试卷名称 Search111',
`exampaper_date` int(11) DEFAULT NULL COMMENT '考试时长(分钟)',
`exampaper_myscore` int(20) NOT NULL DEFAULT '0' COMMENT '试卷总分数',
`exampaper_types` int(11) NOT NULL DEFAULT '0' COMMENT '试卷状态 Search111',
`zujuan_types` int(11) DEFAULT NULL COMMENT '组卷方式',
`exampaper_delete` int(255) DEFAULT '0' COMMENT '逻辑删除1代表未删除 2代表已删除',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间 show2 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COMMENT='试卷表';
/*Data for the table `exampaper` */
insert into `exampaper`(`id`,`exampaper_name`,`exampaper_date`,`exampaper_myscore`,`exampaper_types`,`zujuan_types`,`exampaper_delete`,`create_time`) values (6,'123',123,100,1,1,1,'2023-03-11 14:33:49'),(7,'123',123,100,1,2,1,'2023-03-11 14:56:11');
/*Table structure for table `exampapertopic` */
DROP TABLE IF EXISTS `exampapertopic`;
CREATE TABLE `exampapertopic` (
`id` int(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`exampaper_id` int(20) NOT NULL COMMENT '试卷',
`examquestion_id` int(20) NOT NULL COMMENT '试题',
`exampapertopic_number` int(20) NOT NULL COMMENT '试题分数',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8 COMMENT='试卷选题';
/*Data for the table `exampapertopic` */
insert into `exampapertopic`(`id`,`exampaper_id`,`examquestion_id`,`exampapertopic_number`,`create_time`) values (47,6,16,25,'2023-03-11 14:34:08'),(48,6,15,25,'2023-03-11 14:34:08'),(49,6,14,25,'2023-03-11 14:34:08'),(50,6,13,25,'2023-03-11 14:34:08'),(51,7,16,50,'2023-03-11 14:56:17'),(52,7,15,50,'2023-03-11 14:56:18');
/*Table structure for table `examquestion` */
DROP TABLE IF EXISTS `examquestion`;
CREATE TABLE `examquestion` (
`id` int(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`examquestion_name` varchar(200) NOT NULL COMMENT '试题名称 Search111',
`examquestion_options` longtext COMMENT '选项json字符串',
`examquestion_answer` varchar(200) DEFAULT NULL COMMENT '正确答案',
`examquestion_analysis` longtext COMMENT '答案解析',
`examquestion_types` int(20) DEFAULT '0' COMMENT '试题类型',
`examquestion_sequence` int(20) DEFAULT '100' COMMENT '试题排序,值越大排越前面',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='试题表';
/*Data for the table `examquestion` */
insert into `examquestion`(`id`,`examquestion_name`,`examquestion_options`,`examquestion_answer`,`examquestion_analysis`,`examquestion_types`,`examquestion_sequence`,`create_time`) values (13,'题目名称1','[]','题目名称1','答案解析1',4,100,'2023-02-21 20:38:20'),(14,'题目名称2','[{\"text\":\"对\",\"code\":\"A\"},{\"text\":\"错\",\"code\":\"B\"}]','A','答案解析2',3,100,'2023-02-21 20:38:31'),(15,'题目名称3','[{\"text\":\"选项1\",\"code\":\"A\"},{\"text\":\"选项2\",\"code\":\"B\"},{\"text\":\"选项3\",\"code\":\"C\"},{\"text\":\"选项4\",\"code\":\"D\"}]','A,B','答案解析3',2,100,'2023-02-21 20:39:22'),(16,'题目名称4','[{\"text\":\"选项1\",\"code\":\"A\"},{\"text\":\"选项2\",\"code\":\"B\"},{\"text\":\"选项3\",\"code\":\"C\"},{\"text\":\"选项4\",\"code\":\"D\"}]','A','选a的代表xxxxxx\n选b的代表aaaaaa\n选、、、、、、、、',1,100,'2023-02-21 20:39:53');
/*Table structure for table `examrecord` */
DROP TABLE IF EXISTS `examrecord`;
CREATE TABLE `examrecord` (
`id` int(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`examrecord_uuid_number` varchar(200) DEFAULT NULL COMMENT '考试编号',
`yonghu_id` int(20) NOT NULL COMMENT '考试学生',
`exampaper_id` int(20) NOT NULL COMMENT '所属试卷id外键',
`total_score` int(200) DEFAULT NULL COMMENT '所得总分',
`insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '考试时间',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='考试记录表';
/*Data for the table `examrecord` */
insert into `examrecord`(`id`,`examrecord_uuid_number`,`yonghu_id`,`exampaper_id`,`total_score`,`insert_time`,`create_time`) values (3,'1678516486368',1,6,0,'2023-03-11 14:34:46','2023-03-11 14:34:46'),(4,'1678516686481',1,6,50,'2023-03-11 14:38:06','2023-03-11 14:38:06');
/*Table structure for table `examredetails` */
DROP TABLE IF EXISTS `examredetails`;
CREATE TABLE `examredetails` (
`id` int(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`examredetails_uuid_number` varchar(200) DEFAULT NULL COMMENT '试卷编号',
`yonghu_id` int(20) NOT NULL COMMENT '学生id',
`examquestion_id` int(20) NOT NULL COMMENT '试题id外键',
`examredetails_myanswer` varchar(200) DEFAULT NULL COMMENT '考生答案',
`examredetails_myscore` int(20) NOT NULL DEFAULT '0' COMMENT '试题得分',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='答题详情表';
/*Data for the table `examredetails` */
insert into `examredetails`(`id`,`examredetails_uuid_number`,`yonghu_id`,`examquestion_id`,`examredetails_myanswer`,`examredetails_myscore`,`create_time`) values (9,'1678516486368',1,13,'123',0,'2023-03-11 14:34:46'),(10,'1678516486368',1,14,'B',0,'2023-03-11 14:34:46'),(11,'1678516486368',1,15,'B,D',0,'2023-03-11 14:34:46'),(12,'1678516486368',1,16,'未作答',0,'2023-03-11 14:34:46'),(13,'1678516686481',1,13,'213',0,'2023-03-11 14:38:06'),(14,'1678516686481',1,14,'A',25,'2023-03-11 14:38:06'),(15,'1678516686481',1,15,'D',0,'2023-03-11 14:38:06'),(16,'1678516686481',1,16,'A',25,'2023-03-11 14:38:06');
/*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',3,'upload/news1.jpg','2023-03-11 14:18:32','公告详情1','2023-03-11 14:18:32'),(2,'公告标题2',3,'upload/news2.jpg','2023-03-11 14:18:32','公告详情2','2023-03-11 14:18:32'),(3,'公告标题3',3,'upload/news3.jpg','2023-03-11 14:18:32','公告详情3','2023-03-11 14:18:32'),(4,'公告标题4',1,'upload/news4.jpg','2023-03-11 14:18:32','公告详情4','2023-03-11 14:18:32'),(5,'公告标题5',3,'upload/news5.jpg','2023-03-11 14:18:32','公告详情5','2023-03-11 14:18:32'),(6,'公告标题6',3,'upload/news1.jpg','2023-03-11 14:18:32','公告详情6','2023-03-11 14:18:32'),(7,'公告标题7',1,'upload/news2.jpg','2023-03-11 14:18:32','公告详情7','2023-03-11 14:18:32'),(8,'公告标题8',3,'upload/news1.jpg','2023-03-11 14:18:32','公告详情8','2023-03-11 14:18:32'),(9,'公告标题9',3,'upload/news2.jpg','2023-03-11 14:18:32','公告详情9','2023-03-11 14:18:32'),(10,'公告标题10',3,'upload/news3.jpg','2023-03-11 14:18:32','公告详情10','2023-03-11 14:18:32'),(11,'公告标题11',3,'upload/news4.jpg','2023-03-11 14:18:32','公告详情11','2023-03-11 14:18:32'),(12,'公告标题12',3,'upload/news1.jpg','2023-03-11 14:18:32','公告详情12','2023-03-11 14:18:32'),(13,'公告标题13',3,'upload/news2.jpg','2023-03-11 14:18:32','公告详情13','2023-03-11 14:18:32'),(14,'公告标题14',3,'upload/news3.jpg','2023-03-11 14:18:32','公告详情14','2023-03-11 14:18:32');
/*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=7 DEFAULT CHARSET=utf8 COMMENT='token表';
/*Data for the table `token` */
insert into `token`(`id`,`userid`,`username`,`tablename`,`role`,`token`,`addtime`,`expiratedtime`) values (4,1,'a1','yonghu','用户','fcxh9ce99be63nimi1wg6xamrlpjhh3v','2023-03-11 14:29:16','2023-03-11 15:37:31'),(5,1,'admin','users','管理员','u9q09xehd5vd6wxlanpejqnc8n2ybw5q','2023-03-11 14:33:24','2023-03-11 15:56:46'),(6,1,'a1','zhixunshi','咨询师','qxuaykish54iocoluwz42ntuebwt84oo','2023-03-11 14:55:32','2023-03-11 15:55:32');
/*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','管理员','2022-05-01 00:00:00');
/*Table structure for table `xinlijiankang` */
DROP TABLE IF EXISTS `xinlijiankang`;
CREATE TABLE `xinlijiankang` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`xinlijiankang_name` varchar(200) DEFAULT NULL COMMENT '心理健康标题 Search111',
`xinlijiankang_photo` varchar(200) DEFAULT NULL COMMENT '心理健康照片',
`xinlijiankang_video` varchar(200) DEFAULT NULL COMMENT '心理健康视频',
`xinlijiankang_types` int(11) DEFAULT NULL COMMENT '心理健康类型 Search111',
`zan_number` int(11) DEFAULT NULL COMMENT '',
`cai_number` int(11) DEFAULT NULL COMMENT '',
`xinlijiankang_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',
`xinlijiankang_content` text 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 `xinlijiankang` */
insert into `xinlijiankang`(`id`,`xinlijiankang_name`,`xinlijiankang_photo`,`xinlijiankang_video`,`xinlijiankang_types`,`zan_number`,`cai_number`,`xinlijiankang_delete`,`xinlijiankang_content`,`create_time`) values (1,'心理健康标题1','upload/xinlijiankang1.jpg','upload/video.mp4',2,70,97,1,'心理健康详情1','2023-03-11 14:18:32'),(2,'心理健康标题2','upload/xinlijiankang2.jpg','upload/video.mp4',3,259,389,1,'心理健康详情2','2023-03-11 14:18:32'),(3,'心理健康标题3','upload/xinlijiankang3.jpg','upload/video.mp4',3,94,309,1,'心理健康详情3','2023-03-11 14:18:32'),(4,'心理健康标题4','upload/xinlijiankang4.jpg','upload/video.mp4',3,258,368,1,'心理健康详情4','2023-03-11 14:18:32'),(5,'心理健康标题5','upload/xinlijiankang5.jpg','upload/video.mp4',2,259,6,1,'心理健康详情5','2023-03-11 14:18:32'),(6,'心理健康标题6','upload/xinlijiankang3.jpg','upload/video.mp4',3,95,342,1,'心理健康详情6','2023-03-11 14:18:32'),(7,'心理健康标题7','upload/xinlijiankang4.jpg','upload/video.mp4',2,94,151,1,'心理健康详情7','2023-03-11 14:18:32'),(8,'心理健康标题8','upload/xinlijiankang1.jpg','upload/video.mp4',2,146,471,1,'心理健康详情8','2023-03-11 14:18:32'),(9,'心理健康标题9','upload/xinlijiankang2.jpg','upload/video.mp4',2,493,154,1,'心理健康详情9','2023-03-11 14:18:32'),(10,'心理健康标题10','upload/xinlijiankang3.jpg','upload/video.mp4',2,377,126,1,'心理健康详情10','2023-03-11 14:18:32'),(11,'心理健康标题11','upload/xinlijiankang4.jpg','upload/video.mp4',2,10,28,1,'心理健康详情11','2023-03-11 14:18:32'),(12,'心理健康标题12','upload/xinlijiankang3.jpg','upload/video.mp4',1,224,364,1,'心理健康详情12','2023-03-11 14:18:32'),(13,'心理健康标题13','upload/xinlijiankang4.jpg','upload/video.mp4',2,209,236,1,'心理健康详情13','2023-03-11 14:18:32'),(14,'心理健康标题14','upload/xinlijiankang5.jpg','upload/video.mp4',3,375,55,1,'心理健康详情14','2023-03-11 14:18:32');
/*Table structure for table `xinlijiankang_collection` */
DROP TABLE IF EXISTS `xinlijiankang_collection`;
CREATE TABLE `xinlijiankang_collection` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`xinlijiankang_id` int(11) DEFAULT NULL COMMENT '心理健康',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
`xinlijiankang_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=18 DEFAULT CHARSET=utf8 COMMENT='心理健康收藏';
/*Data for the table `xinlijiankang_collection` */
insert into `xinlijiankang_collection`(`id`,`xinlijiankang_id`,`yonghu_id`,`xinlijiankang_collection_types`,`insert_time`,`create_time`) values (1,1,2,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(2,2,3,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(3,3,2,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(5,5,1,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(6,6,1,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(7,7,2,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(8,8,3,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(10,10,1,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(11,11,1,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(12,12,3,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(13,13,2,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(14,14,3,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(16,13,1,3,'2023-03-11 14:37:38','2023-03-11 14:37:38');
/*Table structure for table `xinlijiankang_liuyan` */
DROP TABLE IF EXISTS `xinlijiankang_liuyan`;
CREATE TABLE `xinlijiankang_liuyan` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`xinlijiankang_id` int(11) DEFAULT NULL COMMENT '心理健康',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
`xinlijiankang_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=16 DEFAULT CHARSET=utf8 COMMENT='心理健康留言';
/*Data for the table `xinlijiankang_liuyan` */
insert into `xinlijiankang_liuyan`(`id`,`xinlijiankang_id`,`yonghu_id`,`xinlijiankang_liuyan_text`,`insert_time`,`reply_text`,`update_time`,`create_time`) values (1,1,3,'留言内容1','2023-03-11 14:18:32','回复信息1','2023-03-11 14:18:32','2023-03-11 14:18:32'),(2,2,3,'留言内容2','2023-03-11 14:18:32','回复信息2','2023-03-11 14:18:32','2023-03-11 14:18:32'),(3,3,2,'留言内容3','2023-03-11 14:18:32','回复信息3','2023-03-11 14:18:32','2023-03-11 14:18:32'),(4,4,3,'留言内容4','2023-03-11 14:18:32','回复信息4','2023-03-11 14:18:32','2023-03-11 14:18:32'),(5,5,1,'留言内容5','2023-03-11 14:18:32','回复信息5','2023-03-11 14:18:32','2023-03-11 14:18:32'),(6,6,2,'留言内容6','2023-03-11 14:18:32','回复信息6','2023-03-11 14:18:32','2023-03-11 14:18:32'),(7,7,3,'留言内容7','2023-03-11 14:18:32','回复信息7','2023-03-11 14:18:32','2023-03-11 14:18:32'),(8,8,1,'留言内容8','2023-03-11 14:18:32','回复信息8','2023-03-11 14:18:32','2023-03-11 14:18:32'),(9,9,3,'留言内容9','2023-03-11 14:18:32','回复信息9','2023-03-11 14:18:32','2023-03-11 14:18:32'),(10,10,1,'留言内容10','2023-03-11 14:18:32','回复信息10','2023-03-11 14:18:32','2023-03-11 14:18:32'),(11,11,3,'留言内容11','2023-03-11 14:18:32','回复信息11','2023-03-11 14:18:32','2023-03-11 14:18:32'),(12,12,1,'留言内容12','2023-03-11 14:18:32','回复信息12','2023-03-11 14:18:32','2023-03-11 14:18:32'),(13,13,1,'留言内容13','2023-03-11 14:18:32','回复信息13','2023-03-11 14:18:32','2023-03-11 14:18:32'),(14,14,1,'留言内容14','2023-03-11 14:18:32','回复信息14','2023-03-11 14:18:32','2023-03-11 14:18:32'),(15,13,1,'123123','2023-03-11 14:37:46','123123','2023-03-11 14:56:55','2023-03-11 14:37:46');
/*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',1,'upload/yonghu1.jpg','410224199010102001','17703786901','1@qq.com',1,'2023-03-11 14:18:32'),(2,'a2','123456','用户姓名2',2,'upload/yonghu2.jpg','410224199010102002','17703786902','2@qq.com',1,'2023-03-11 14:18:32'),(3,'a3','123456','用户姓名3',2,'upload/yonghu3.jpg','410224199010102003','17703786903','3@qq.com',1,'2023-03-11 14:18:32');
/*Table structure for table `zhixunshi` */
DROP TABLE IF EXISTS `zhixunshi`;
CREATE TABLE `zhixunshi` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(200) DEFAULT NULL COMMENT '账户',
`password` varchar(200) DEFAULT NULL COMMENT '密码',
`zhixunshi_name` varchar(200) DEFAULT NULL COMMENT '咨询师姓名 Search111 ',
`sex_types` int(11) DEFAULT NULL COMMENT '性别 Search111',
`zhixunshi_photo` varchar(200) DEFAULT NULL COMMENT '咨询师头像',
`zhixunshi_id_number` varchar(200) DEFAULT NULL COMMENT '身份证号',
`zhixunshi_phone` varchar(200) DEFAULT NULL COMMENT '联系方式',
`zhixunshi_email` varchar(200) DEFAULT NULL COMMENT '电子邮箱',
`zhixunshi_congye` varchar(200) DEFAULT NULL COMMENT '从业时长',
`zhixunshi_shanchang` varchar(200) DEFAULT NULL COMMENT '擅长',
`zhixunshi_content` text COMMENT '个人简介',
`zhixunshi_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='咨询师';
/*Data for the table `zhixunshi` */
insert into `zhixunshi`(`id`,`username`,`password`,`zhixunshi_name`,`sex_types`,`zhixunshi_photo`,`zhixunshi_id_number`,`zhixunshi_phone`,`zhixunshi_email`,`zhixunshi_congye`,`zhixunshi_shanchang`,`zhixunshi_content`,`zhixunshi_delete`,`create_time`) values (1,'a1','123456','咨询师姓名1',1,'upload/zhixunshi1.jpg','410224199010102001','17703786901','1@qq.com','从业时长1','擅长1','个人简介1',1,'2023-03-11 14:18:32'),(2,'a2','123456','咨询师姓名2',1,'upload/zhixunshi2.jpg','410224199010102002','17703786902','2@qq.com','从业时长2','擅长2','个人简介2',1,'2023-03-11 14:18:32'),(3,'a3','123456','咨询师姓名3',1,'upload/zhixunshi3.jpg','410224199010102003','17703786903','3@qq.com','从业时长3','擅长3','个人简介3',1,'2023-03-11 14:18:32');
/*Table structure for table `zhixunshi_chat` */
DROP TABLE IF EXISTS `zhixunshi_chat`;
CREATE TABLE `zhixunshi_chat` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`yonghu_id` int(11) DEFAULT NULL COMMENT '提问人',
`zhixunshi_id` int(11) DEFAULT NULL COMMENT '回答人',
`zhixunshi_chat_issue_text` text COMMENT '问题',
`issue_time` timestamp NULL DEFAULT NULL COMMENT '问题时间',
`zhixunshi_chat_reply_text` text COMMENT '回复',
`reply_time` timestamp NULL DEFAULT NULL COMMENT '回复时间',
`zhuangtai_types` int(255) DEFAULT NULL COMMENT '状态',
`zhixunshi_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=17 DEFAULT CHARSET=utf8 COMMENT='心理咨询';
/*Data for the table `zhixunshi_chat` */
insert into `zhixunshi_chat`(`id`,`yonghu_id`,`zhixunshi_id`,`zhixunshi_chat_issue_text`,`issue_time`,`zhixunshi_chat_reply_text`,`reply_time`,`zhuangtai_types`,`zhixunshi_chat_types`,`insert_time`,`create_time`) values (1,2,3,'问题1','2023-03-11 14:18:32','回复1','2023-03-11 14:18:32',1,2,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(2,3,1,'问题2','2023-03-11 14:18:32','回复2','2023-03-11 14:18:32',1,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(3,3,2,'问题3','2023-03-11 14:18:32','回复3','2023-03-11 14:18:32',1,2,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(4,3,3,'问题4','2023-03-11 14:18:32','回复4','2023-03-11 14:18:32',2,2,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(5,2,1,'问题5','2023-03-11 14:18:32','回复5','2023-03-11 14:18:32',1,2,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(6,1,2,'问题6','2023-03-11 14:18:32','回复6','2023-03-11 14:18:32',1,2,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(7,1,1,'问题7','2023-03-11 14:18:32','回复7','2023-03-11 14:18:32',2,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(8,3,1,'问题8','2023-03-11 14:18:32','回复8','2023-03-11 14:18:32',2,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(9,2,2,'问题9','2023-03-11 14:18:32','回复9','2023-03-11 14:18:32',1,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(10,2,3,'问题10','2023-03-11 14:18:32','回复10','2023-03-11 14:18:32',2,2,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(11,2,3,'问题11','2023-03-11 14:18:32','回复11','2023-03-11 14:18:32',1,2,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(12,2,1,'问题12','2023-03-11 14:18:32','回复12','2023-03-11 14:18:32',2,2,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(13,2,2,'问题13','2023-03-11 14:18:32','回复13','2023-03-11 14:18:32',1,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(14,3,3,'问题14','2023-03-11 14:18:32','回复14','2023-03-11 14:18:32',1,1,'2023-03-11 14:18:32','2023-03-11 14:18:32'),(15,1,2,'12312312','2023-03-11 14:38:19',NULL,NULL,1,1,'2023-03-11 14:38:19','2023-03-11 14:38:19'),(16,1,1,NULL,NULL,'11223331231','2023-03-11 14:55:53',NULL,2,'2023-03-11 14:55:54','2023-03-11 14:55:54');
/*Table structure for table `zhixunshi_yuyue` */
DROP TABLE IF EXISTS `zhixunshi_yuyue`;
CREATE TABLE `zhixunshi_yuyue` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`zhixunshi_id` int(11) DEFAULT NULL COMMENT '咨询师',
`zhixunshi_yuyue_time` timestamp NULL DEFAULT NULL COMMENT '预约时间',
`zhixunshi_yuyue_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=16 DEFAULT CHARSET=utf8 COMMENT='咨询师预约';
/*Data for the table `zhixunshi_yuyue` */
insert into `zhixunshi_yuyue`(`id`,`zhixunshi_id`,`zhixunshi_yuyue_time`,`zhixunshi_yuyue_text`,`insert_time`,`create_time`) values (15,2,'2023-03-24 14:38:16','123123123','2023-03-11 14:38:26','2023-03-11 14:38:26');
/*!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 */;

@ -0,0 +1,189 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.jlwl</groupId>
<!-- 导入项目的名称 -->
<artifactId>xinliyalizixunpingpan</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>xinliyalizixunpingpan</name>
<description>心理健康咨询管理系统</description>
<properties>
<java.version>1.8</java.version>
<fastjson.version>1.2.8</fastjson.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.7.20</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<!--访问静态资源-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!--热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatisplus-spring-boot-starter</artifactId>
<version>1.0.5</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>cn.hutool</groupId>-->
<!-- <artifactId>hutool-all</artifactId>-->
<!-- <version>4.0.12</version>-->
<!-- </dependency>-->
<!-- FastJson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!--<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<scope>4.0</scope>
<version>4.0</version>
</dependency>-->
<!-- 百度人工智能 -->
<dependency>
<groupId>com.baidu.aip</groupId>
<artifactId>java-sdk</artifactId>
<version>4.4.1</version>
</dependency>
<!-- poi高版本额外包 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-examples</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-excelant</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,61 @@
package com.ServletContextListener;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.DictionaryEntity;
import com.service.DictionaryService;
import com.thread.MyThreadMethod;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
import javax.servlet.ServletContextListener;
import javax.servlet.ServletContextEvent;
import javax.servlet.annotation.WebListener;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* ,,
*/
@WebListener
public class DictionaryServletContextListener implements ServletContextListener {
private static final Logger logger = LoggerFactory.getLogger(DictionaryServletContextListener.class);
private MyThreadMethod myThreadMethod;
@Override
public void contextDestroyed(ServletContextEvent sce) {
logger.info("----------服务器停止----------");
}
@Override
public void contextInitialized(ServletContextEvent sce) {
ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(sce.getServletContext());
logger.info("----------字典表初始化开始----------");
DictionaryService dictionaryService = (DictionaryService)appContext.getBean("dictionaryService");
List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());
Map<String, Map<Integer,String>> map = new HashMap<>();
for(DictionaryEntity d :dictionaryEntities){
Map<Integer, String> m = map.get(d.getDicCode());
if(m ==null || m.isEmpty()){
m = new HashMap<>();
}
m.put(d.getCodeIndex(),d.getIndexName());
map.put(d.getDicCode(),m);
}
sce.getServletContext().setAttribute("dictionaryMap", map);
logger.info("----------字典表初始化完成----------");
logger.info("----------线程执行开始----------");
if (myThreadMethod == null) {
myThreadMethod = new MyThreadMethod();
myThreadMethod.start(); // servlet 上下文初始化时启动线程myThreadMethod
}
logger.info("----------线程执行结束----------");
}
}

@ -0,0 +1,15 @@
package com.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
*/
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface APPLoginUser {
}

@ -0,0 +1,13 @@
package com.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface ColumnInfo {
String comment();
String type();
}

@ -0,0 +1,13 @@
package com.annotation;
import java.lang.annotation.*;
/**
* Token
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface IgnoreAuth {
}

@ -0,0 +1,15 @@
package com.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
*/
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface LoginUser {
}

@ -0,0 +1,12 @@
package com.common;
public interface Constants {
String CODE_200 = "200"; // 成功
String CODE_500 = "500"; // 系统错误
String CODE_401 = "401"; // 权限不足
String CODE_400 = "400"; // 参数错误
String CODE_600 = "600"; // 其他业务异常
String DICT_TYPE_ICON = "icon"; // 图标类型
}

@ -0,0 +1,92 @@
package com.common;
/**
*
*/
public class Result {
// 返回成功还是失败
private String code;
// 失败的原因
private String msg;
// 后台所需要携带的数据
private Object data;
public Result() {
}
public Result(String code, String msg, Object data) {
this.code = code;
this.msg = msg;
this.data = data;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
/**
*
*
* @return
*/
public static Result success() {
return new Result(Constants.CODE_200, "", null);
}
/**
*
*
* @param data
* @return
*/
public static Result success(Object data) {
return new Result(Constants.CODE_200, "", data);
}
/**
*
*
* @param code
* @param msg
* @return
*/
public static Result error(String code, String msg) {
return new Result(code, msg, null);
}
/**
*
*
* @return
*/
public static Result error() {
return new Result(Constants.CODE_500, "系统错误", null);
}
}

@ -0,0 +1,7 @@
package com.common;
public enum RoleEnum {
ROLE_ADMIN, ROLE_USER;
}

@ -0,0 +1,39 @@
package com.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import com.interceptor.AuthorizationInterceptor;
@Configuration
public class InterceptorConfig extends WebMvcConfigurationSupport{
@Bean
public AuthorizationInterceptor getAuthorizationInterceptor() {
return new AuthorizationInterceptor();
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(getAuthorizationInterceptor()).addPathPatterns("/**").excludePathPatterns("/static/**");
super.addInterceptors(registry);
}
/**
* springboot 2.0WebMvcConfigurationSupport访addResourceHandlers
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**")
.addResourceLocations("classpath:/resources/")
.addResourceLocations("classpath:/static/")
.addResourceLocations("classpath:/admin/")
.addResourceLocations("classpath:/img/")
.addResourceLocations("classpath:/front/")
.addResourceLocations("classpath:/public/");
super.addResourceHandlers(registry);
}
}

@ -0,0 +1,28 @@
package com.config;
import java.util.Date;
import org.apache.ibatis.reflection.MetaObject;
import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
/**
*
*/
public class MyMetaObjectHandler extends MetaObjectHandler {
@Override
public void insertFill(MetaObject metaObject) {
this.setFieldValByName("ctime", new Date(), metaObject);
}
@Override
public boolean openUpdateFill() {
return false;
}
@Override
public void updateFill(MetaObject metaObject) {
// 关闭更新填充、这里不执行
}
}

@ -0,0 +1,24 @@
package com.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
/**
* mybatis-plus
*/
@Configuration
public class MybatisPlusConfig {
/**
*
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}

@ -0,0 +1,698 @@
package com.controller;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import com.alibaba.fastjson.JSON;
import com.utils.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baidu.aip.face.AipFace;
import com.baidu.aip.face.MatchRequest;
import com.baidu.aip.util.Base64Util;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.ConfigEntity;
import com.service.CommonService;
import com.service.ConfigService;
import com.utils.BaiduUtil;
import com.utils.FileUtil;
import com.utils.R;
/**
*
*/
@RestController
public class CommonController{
private static final Logger logger = LoggerFactory.getLogger(CommonController.class);
@Autowired
private CommonService commonService;
@Autowired
private ConfigService configService;
private static AipFace client = null;
private static String BAIDU_DITU_AK = null;
@RequestMapping("/location")
public R location(String lng,String lat) {
if(BAIDU_DITU_AK==null) {
BAIDU_DITU_AK = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "baidu_ditu_ak")).getValue();
if(BAIDU_DITU_AK==null) {
return R.error("请在配置管理中正确配置baidu_ditu_ak");
}
}
Map<String, String> map = BaiduUtil.getCityByLonLat(BAIDU_DITU_AK, lng, lat);
return R.ok().put("data", map);
}
/**
*
*
* @param face1 1
* @param face2 2
* @return
*/
@RequestMapping("/matchFace")
public R matchFace(String face1, String face2, HttpServletRequest request) {
if(client==null) {
/*String AppID = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "AppID")).getValue();*/
String APIKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "APIKey")).getValue();
String SecretKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "SecretKey")).getValue();
String token = BaiduUtil.getAuth(APIKey, SecretKey);
if(token==null) {
return R.error("请在配置管理中正确配置APIKey和SecretKey");
}
client = new AipFace(null, APIKey, SecretKey);
client.setConnectionTimeoutInMillis(2000);
client.setSocketTimeoutInMillis(60000);
}
JSONObject res = null;
try {
File file1 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face1);
File file2 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face2);
String img1 = Base64Util.encode(FileUtil.FileToByte(file1));
String img2 = Base64Util.encode(FileUtil.FileToByte(file2));
MatchRequest req1 = new MatchRequest(img1, "BASE64");
MatchRequest req2 = new MatchRequest(img2, "BASE64");
ArrayList<MatchRequest> requests = new ArrayList<MatchRequest>();
requests.add(req1);
requests.add(req2);
res = client.match(requests);
System.out.println(res.get("result"));
} catch (FileNotFoundException e) {
e.printStackTrace();
return R.error("文件不存在");
} catch (IOException e) {
e.printStackTrace();
}
return R.ok().put("data", com.alibaba.fastjson.JSONObject.parse(res.get("result").toString()));
}
/**
* tablecolumn()
* @return
*/
@RequestMapping("/option/{tableName}/{columnName}")
@IgnoreAuth
public R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,String level,String parent) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
if(StringUtils.isNotBlank(level)) {
params.put("level", level);
}
if(StringUtils.isNotBlank(parent)) {
params.put("parent", parent);
}
List<String> data = commonService.getOption(params);
return R.ok().put("data", data);
}
/**
* tablecolumn
* @return
*/
@RequestMapping("/follow/{tableName}/{columnName}")
@IgnoreAuth
public R getFollowByOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @RequestParam String columnValue) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
params.put("columnValue", columnValue);
Map<String, Object> result = commonService.getFollowByOption(params);
return R.ok().put("data", result);
}
/**
* tablesfsh
* @param map
* @return
*/
@RequestMapping("/sh/{tableName}")
public R sh(@PathVariable("tableName") String tableName, @RequestBody Map<String, Object> map) {
map.put("table", tableName);
commonService.sh(map);
return R.ok();
}
/**
*
* @param tableName
* @param columnName
* @param type 1: 2:
* @param map
* @return
*/
@RequestMapping("/remind/{tableName}/{columnName}/{type}")
@IgnoreAuth
public R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("table", tableName);
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
int count = commonService.remindCount(map);
return R.ok().put("count", count);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/group/{tableName}")
public R group1(@PathVariable("tableName") String tableName, @RequestParam Map<String,Object> params) {
params.put("table1", tableName);
List<Map<String, Object>> result = commonService.chartBoth(params);
return R.ok().put("data", result);
}
/**
*
*/
@RequestMapping("/cal/{tableName}/{columnName}")
@IgnoreAuth
public R cal(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
Map<String, Object> result = commonService.selectCal(params);
return R.ok().put("data", result);
}
/**
*
*/
@RequestMapping("/group/{tableName}/{columnName}")
@IgnoreAuth
public R group(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
List<Map<String, Object>> result = commonService.selectGroup(params);
return R.ok().put("data", result);
}
/**
*
*/
@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}")
@IgnoreAuth
public R value(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
List<Map<String, Object>> result = commonService.selectValue(params);
return R.ok().put("data", result);
}
/**
*
*
*
*
*/
/**
*
* tableName
* groupColumn
* sumCloum
* @return
*/
@RequestMapping("/newSelectGroupSum")
public R newSelectGroupSum(@RequestParam Map<String,Object> params) {
logger.debug("newSelectGroupSum:,,Controller:{},,params:{}",this.getClass().getName(),params);
List<Map<String, Object>> result = commonService.newSelectGroupSum(params);
return R.ok().put("data", result);
}
/**
tableName
condition1 1
condition1Value 1
average
Number(res.data.value.toFixed(1))
if(res.data){}
* */
@IgnoreAuth
@RequestMapping("/queryScore")
public R queryScore(@RequestParam Map<String, Object> params) {
logger.debug("queryScore:,,Controller:{},,params:{}",this.getClass().getName(),params);
Map<String, Object> queryScore = commonService.queryScore(params);
return R.ok().put("data", queryScore);
}
/**
*
* tableName
* groupColumn
* @return
*/
@RequestMapping("/newSelectGroupCount")
public R newSelectGroupCount(@RequestParam Map<String,Object> params) {
logger.debug("newSelectGroupCount:,,Controller:{},,params:{}",this.getClass().getName(),params);
List<Map<String, Object>> result = commonService.newSelectGroupCount(params);
return R.ok().put("data", result);
}
/**
*
* tableName
* groupColumn
* sumCloum
* dateFormatType 1: 2: 3:
* @return
*/
@RequestMapping("/newSelectDateGroupSum")
public R newSelectDateGroupSum(@RequestParam Map<String,Object> params) {
logger.debug("newSelectDateGroupSum:,,Controller:{},,params:{}",this.getClass().getName(),params);
String dateFormatType = String.valueOf(params.get("dateFormatType"));
if("1".equals(dateFormatType)){
params.put("dateFormat", "%Y");
}else if("2".equals(dateFormatType)){
params.put("dateFormat", "%Y-%m");
}else if("3".equals(dateFormatType)){
params.put("dateFormat", "%Y-%m-%d");
}else{
R.error("日期格式化不正确");
}
List<Map<String, Object>> result = commonService.newSelectDateGroupSum(params);
return R.ok().put("data", result);
}
/**
*
*
* tableName
* groupColumn
* dateFormatType 1: 2: 3:
* @return
*/
@RequestMapping("/newSelectDateGroupCount")
public R newSelectDateGroupCount(@RequestParam Map<String,Object> params) {
logger.debug("newSelectDateGroupCount:,,Controller:{},,params:{}",this.getClass().getName(),params);
String dateFormatType = String.valueOf(params.get("dateFormatType"));
if("1".equals(dateFormatType)){
params.put("dateFormat", "%Y");
}else if("2".equals(dateFormatType)){
params.put("dateFormat", "%Y-%m");
}else if("3".equals(dateFormatType)){
params.put("dateFormat", "%Y-%m-%d");
}else{
R.error("日期格式化类型不正确");
}
List<Map<String, Object>> result = commonService.newSelectDateGroupCount(params);
return R.ok().put("data", result);
}
/**
*
* --
--
-- --
-- --
--
-- --
-- --
--
-- --
-- --
--
--
-- --
-- --
--
-- --
-- --
--
-- --
-- --
*/
/**
*
--
--
-- 2 1
--
--
--
--
--
--
--
--
--
--
*/
/**
*
*/
@RequestMapping("/barSum")
public R barSum(@RequestParam Map<String,Object> params) {
logger.debug("barSum方法:,,Controller:{},,params:{}",this.getClass().getName(), com.alibaba.fastjson.JSONObject.toJSONString(params));
Boolean isJoinTableFlag = false;//是否有级联表相关
String one = "";//第一优先
String two = "";//第二优先
//处理thisTable和joinTable 处理内容是把json字符串转为Map并把带有,的切割为数组
//当前表
Map<String,Object> thisTable = JSON.parseObject(String.valueOf(params.get("thisTable")),Map.class);
params.put("thisTable",thisTable);
//级联表
String joinTableString = String.valueOf(params.get("joinTable"));
if(StringUtil.isNotEmpty(joinTableString)) {
Map<String, Object> joinTable = JSON.parseObject(joinTableString, Map.class);
params.put("joinTable", joinTable);
isJoinTableFlag = true;
}
if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("date")))){//当前表日期
thisTable.put("date",String.valueOf(thisTable.get("date")).split(","));
one = "thisDate0";
}
if(isJoinTableFlag){//级联表日期
Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("date")))){
joinTable.put("date",String.valueOf(joinTable.get("date")).split(","));
if(StringUtil.isEmpty(one)){
one ="joinDate0";
}else{
if(StringUtil.isEmpty(two)){
two ="joinDate0";
}
}
}
}
if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("string")))){//当前表字符串
thisTable.put("string",String.valueOf(thisTable.get("string")).split(","));
if(StringUtil.isEmpty(one)){
one ="thisString0";
}else{
if(StringUtil.isEmpty(two)){
two ="thisString0";
}
}
}
if(isJoinTableFlag){//级联表字符串
Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("string")))){
joinTable.put("string",String.valueOf(joinTable.get("string")).split(","));
if(StringUtil.isEmpty(one)){
one ="joinString0";
}else{
if(StringUtil.isEmpty(two)){
two ="joinString0";
}
}
}
}
if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("types")))){//当前表类型
thisTable.put("types",String.valueOf(thisTable.get("types")).split(","));
if(StringUtil.isEmpty(one)){
one ="thisTypes0";
}else{
if(StringUtil.isEmpty(two)){
two ="thisTypes0";
}
}
}
if(isJoinTableFlag){//级联表类型
Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("types")))){
joinTable.put("types",String.valueOf(joinTable.get("types")).split(","));
if(StringUtil.isEmpty(one)){
one ="joinTypes0";
}else{
if(StringUtil.isEmpty(two)){
two ="joinTypes0";
}
}
}
}
List<Map<String, Object>> result = commonService.barSum(params);
List<String> xAxis = new ArrayList<>();//报表x轴
List<List<String>> yAxis = new ArrayList<>();//y轴
List<String> legend = new ArrayList<>();//标题
if(StringUtil.isEmpty(two)){//不包含第二列
List<String> yAxis0 = new ArrayList<>();
yAxis.add(yAxis0);
legend.add("数值");
for(Map<String, Object> map :result){
String oneValue = String.valueOf(map.get(one));
String value = String.valueOf(map.get("value"));
xAxis.add(oneValue);
yAxis0.add(value);
}
}else{//包含第二列
Map<String, HashMap<String, String>> dataMap = new LinkedHashMap<>();
if(StringUtil.isNotEmpty(two)){
for(Map<String, Object> map :result){
String oneValue = String.valueOf(map.get(one));
String twoValue = String.valueOf(map.get(two));
String value = String.valueOf(map.get("value"));
if(!legend.contains(twoValue)){
legend.add(twoValue);//添加完成后 就是最全的第二列的类型
}
if(dataMap.containsKey(oneValue)){
dataMap.get(oneValue).put(twoValue,value);
}else{
HashMap<String, String> oneData = new HashMap<>();
oneData.put(twoValue,value);
dataMap.put(oneValue,oneData);
}
}
}
for(int i =0; i<legend.size(); i++){
yAxis.add(new ArrayList<String>());
}
Set<String> keys = dataMap.keySet();
for(String key:keys){
xAxis.add(key);
HashMap<String, String> map = dataMap.get(key);
for(int i =0; i<legend.size(); i++){
List<String> data = yAxis.get(i);
if(StringUtil.isNotEmpty(map.get(legend.get(i)))){
data.add(map.get(legend.get(i)));
}else{
data.add("0");
}
}
}
System.out.println();
}
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("xAxis",xAxis);
resultMap.put("yAxis",yAxis);
resultMap.put("legend",legend);
return R.ok().put("data", resultMap);
}
/**
*
*/
@RequestMapping("/barCount")
public R barCount(@RequestParam Map<String,Object> params) {
logger.debug("barCount方法:,,Controller:{},,params:{}",this.getClass().getName(), com.alibaba.fastjson.JSONObject.toJSONString(params));
Boolean isJoinTableFlag = false;//是否有级联表相关
String one = "";//第一优先
String two = "";//第二优先
//处理thisTable和joinTable 处理内容是把json字符串转为Map并把带有,的切割为数组
//当前表
Map<String,Object> thisTable = JSON.parseObject(String.valueOf(params.get("thisTable")),Map.class);
params.put("thisTable",thisTable);
//级联表
String joinTableString = String.valueOf(params.get("joinTable"));
if(StringUtil.isNotEmpty(joinTableString)) {
Map<String, Object> joinTable = JSON.parseObject(joinTableString, Map.class);
params.put("joinTable", joinTable);
isJoinTableFlag = true;
}
if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("date")))){//当前表日期
thisTable.put("date",String.valueOf(thisTable.get("date")).split(","));
one = "thisDate0";
}
if(isJoinTableFlag){//级联表日期
Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("date")))){
joinTable.put("date",String.valueOf(joinTable.get("date")).split(","));
if(StringUtil.isEmpty(one)){
one ="joinDate0";
}else{
if(StringUtil.isEmpty(two)){
two ="joinDate0";
}
}
}
}
if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("string")))){//当前表字符串
thisTable.put("string",String.valueOf(thisTable.get("string")).split(","));
if(StringUtil.isEmpty(one)){
one ="thisString0";
}else{
if(StringUtil.isEmpty(two)){
two ="thisString0";
}
}
}
if(isJoinTableFlag){//级联表字符串
Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("string")))){
joinTable.put("string",String.valueOf(joinTable.get("string")).split(","));
if(StringUtil.isEmpty(one)){
one ="joinString0";
}else{
if(StringUtil.isEmpty(two)){
two ="joinString0";
}
}
}
}
if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("types")))){//当前表类型
thisTable.put("types",String.valueOf(thisTable.get("types")).split(","));
if(StringUtil.isEmpty(one)){
one ="thisTypes0";
}else{
if(StringUtil.isEmpty(two)){
two ="thisTypes0";
}
}
}
if(isJoinTableFlag){//级联表类型
Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("types")))){
joinTable.put("types",String.valueOf(joinTable.get("types")).split(","));
if(StringUtil.isEmpty(one)){
one ="joinTypes0";
}else{
if(StringUtil.isEmpty(two)){
two ="joinTypes0";
}
}
}
}
List<Map<String, Object>> result = commonService.barCount(params);
List<String> xAxis = new ArrayList<>();//报表x轴
List<List<String>> yAxis = new ArrayList<>();//y轴
List<String> legend = new ArrayList<>();//标题
if(StringUtil.isEmpty(two)){//不包含第二列
List<String> yAxis0 = new ArrayList<>();
yAxis.add(yAxis0);
legend.add("数值");
for(Map<String, Object> map :result){
String oneValue = String.valueOf(map.get(one));
String value = String.valueOf(map.get("value"));
xAxis.add(oneValue);
yAxis0.add(value);
}
}else{//包含第二列
Map<String, HashMap<String, String>> dataMap = new LinkedHashMap<>();
if(StringUtil.isNotEmpty(two)){
for(Map<String, Object> map :result){
String oneValue = String.valueOf(map.get(one));
String twoValue = String.valueOf(map.get(two));
String value = String.valueOf(map.get("value"));
if(!legend.contains(twoValue)){
legend.add(twoValue);//添加完成后 就是最全的第二列的类型
}
if(dataMap.containsKey(oneValue)){
dataMap.get(oneValue).put(twoValue,value);
}else{
HashMap<String, String> oneData = new HashMap<>();
oneData.put(twoValue,value);
dataMap.put(oneValue,oneData);
}
}
}
for(int i =0; i<legend.size(); i++){
yAxis.add(new ArrayList<String>());
}
Set<String> keys = dataMap.keySet();
for(String key:keys){
xAxis.add(key);
HashMap<String, String> map = dataMap.get(key);
for(int i =0; i<legend.size(); i++){
List<String> data = yAxis.get(i);
if(StringUtil.isNotEmpty(map.get(legend.get(i)))){
data.add(map.get(legend.get(i)));
}else{
data.add("0");
}
}
}
System.out.println();
}
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("xAxis",xAxis);
resultMap.put("yAxis",yAxis);
resultMap.put("legend",legend);
return R.ok().put("data", resultMap);
}
}

@ -0,0 +1,111 @@
package com.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.service.ConfigService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
*
*/
@RequestMapping("config")
@RestController
public class ConfigController{
@Autowired
private ConfigService configService;
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ConfigEntity config){
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
PageUtils page = configService.queryPage(params);
return R.ok().put("data", page);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ConfigEntity config){
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
PageUtils page = configService.queryPage(params);
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
ConfigEntity config = configService.selectById(id);
return R.ok().put("data", config);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") String id){
ConfigEntity config = configService.selectById(id);
return R.ok().put("data", config);
}
/**
* name
*/
@RequestMapping("/info")
public R infoByName(@RequestParam String name){
ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
return R.ok().put("data", config);
}
/**
*
*/
@PostMapping("/save")
public R save(@RequestBody ConfigEntity config){
// ValidatorUtils.validateEntity(config);
configService.insert(config);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody ConfigEntity config){
// ValidatorUtils.validateEntity(config);
configService.updateById(config);//全部更新
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
configService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,283 @@
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("/dictionary")
public class DictionaryController {
private static final Logger logger = LoggerFactory.getLogger(DictionaryController.class);
private static final String TABLE_NAME = "dictionary";
@Autowired
private DictionaryService dictionaryService;
@Autowired
private TokenService tokenService;
//级联表非注册的service
//注册表service
@Autowired
private YonghuService yonghuService;
@Autowired
private ZhixunshiService zhixunshiService;
/**
*
*/
@RequestMapping("/page")
@IgnoreAuth
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
CommonUtil.checkMap(params);
PageUtils page = dictionaryService.queryPage(params);
//字典表数据转换
List<DictionaryView> list =(List<DictionaryView>)page.getList();
for(DictionaryView 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);
DictionaryEntity dictionary = dictionaryService.selectById(id);
if(dictionary !=null){
//entity转view
DictionaryView view = new DictionaryView();
BeanUtils.copyProperties( dictionary , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody DictionaryEntity dictionary, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>()
.eq("dic_code", dictionary.getDicCode())
.eq("index_name", dictionary.getIndexName())
;
if(dictionary.getDicCode().contains("_erji_types")){
queryWrapper.eq("super_id",dictionary.getSuperId());
}
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);
if(dictionaryEntity==null){
dictionary.setCreateTime(new Date());
dictionaryService.insert(dictionary);
//字典表新增数据,把数据再重新查出,放入监听器中
List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());
ServletContext servletContext = request.getServletContext();
Map<String, Map<Integer,String>> map = new HashMap<>();
for(DictionaryEntity d :dictionaryEntities){
Map<Integer, String> m = map.get(d.getDicCode());
if(m ==null || m.isEmpty()){
m = new HashMap<>();
}
m.put(d.getCodeIndex(),d.getIndexName());
map.put(d.getDicCode(),m);
}
servletContext.setAttribute("dictionaryMap",map);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody DictionaryEntity dictionary, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());
DictionaryEntity oldDictionaryEntity = dictionaryService.selectById(dictionary.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>()
.notIn("id",dictionary.getId())
.eq("dic_code", dictionary.getDicCode())
.eq("index_name", dictionary.getIndexName())
;
if(dictionary.getDicCode().contains("_erji_types")){
queryWrapper.eq("super_id",dictionary.getSuperId());
}
logger.info("sql语句:"+queryWrapper.getSqlSegment());
DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);
if(dictionaryEntity==null){
dictionaryService.updateById(dictionary);//根据id更新
//如果字典表修改数据的话,把数据再重新查出,放入监听器中
List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());
ServletContext servletContext = request.getServletContext();
Map<String, Map<Integer,String>> map = new HashMap<>();
for(DictionaryEntity d :dictionaryEntities){
Map<Integer, String> m = map.get(d.getDicCode());
if(m ==null || m.isEmpty()){
m = new HashMap<>();
}
m.put(d.getCodeIndex(),d.getIndexName());
map.put(d.getDicCode(),m);
}
servletContext.setAttribute("dictionaryMap",map);
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<DictionaryEntity> oldDictionaryList =dictionaryService.selectBatchIds(Arrays.asList(ids));//要删除的数据
dictionaryService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@RequestMapping("/maxCodeIndex")
public R maxCodeIndex(@RequestBody DictionaryEntity dictionary){
logger.debug("maxCodeIndex:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());
List<String> descs = new ArrayList<>();
descs.add("code_index");
Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>()
.eq("dic_code", dictionary.getDicCode())
.orderDesc(descs);
logger.info("sql语句:"+queryWrapper.getSqlSegment());
List<DictionaryEntity> dictionaryEntityList = dictionaryService.selectList(queryWrapper);
if(dictionaryEntityList.size()>0 ){
return R.ok().put("maxCodeIndex",dictionaryEntityList.get(0).getCodeIndex()+1);
}else{
return R.ok().put("maxCodeIndex",1);
}
}
/**
*
*/
@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<DictionaryEntity> dictionaryList = 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){
//循环
DictionaryEntity dictionaryEntity = new DictionaryEntity();
// dictionaryEntity.setDicCode(data.get(0)); //字段 要改的
// dictionaryEntity.setDicName(data.get(0)); //字段名 要改的
// dictionaryEntity.setCodeIndex(Integer.valueOf(data.get(0))); //编码 要改的
// dictionaryEntity.setIndexName(data.get(0)); //编码名字 要改的
// dictionaryEntity.setSuperId(Integer.valueOf(data.get(0))); //父字段id 要改的
// dictionaryEntity.setBeizhu(data.get(0)); //备注 要改的
// dictionaryEntity.setCreateTime(date);//时间
dictionaryList.add(dictionaryEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
dictionaryService.insertBatch(dictionaryList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
}

@ -0,0 +1,150 @@
package com.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.hutool.core.date.Quarter;
import com.common.Result;
import com.entity.UsersEntity;
import com.entity.YonghuEntity;
import com.entity.ZhixunshiEntity;
import com.entity.ZhixunshiYuyueEntity;
import com.service.UsersService;
import com.service.YonghuService;
import com.service.ZhixunshiService;
import com.service.ZhixunshiYuyueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/echarts")
public class EchartsController {
// @Autowired
// private IUserService userService;
//
// @Resource
// private FileMapper fileMapper;
//
// @Resource
// private StringRedisTemplate stringRedisTemplate;
@Autowired
private YonghuService yonghuService;
@Autowired
private UsersService usersService;
@Autowired
private ZhixunshiYuyueService zhixunshiYuyueService;
@Autowired
private ZhixunshiService zhixunshiService;
public static final String FILES_KEY = "FILES_FRONT_ALL";
/**
*
*
* @return
*/
@GetMapping("/example")
public Result get() {
Map<String, Object> map = new HashMap<>();
map.put("x", CollUtil.newArrayList("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"));
map.put("y", CollUtil.newArrayList(150, 230, 224, 218, 135, 147, 260));
return Result.success(map);
}
/**
*
*
* @return
*/
@GetMapping("/members")
public Result members() {
// List<User> list = uuserService
List<ZhixunshiYuyueEntity> zhixunshiYuyueEntities = zhixunshiYuyueService.selectList(null);
int q1 = 0; // 第一季度
int q2 = 0; // 第二季度
int q3 = 0; // 第三季度
int q4 = 0; // 第四季度
for (ZhixunshiYuyueEntity zhixunshiYuyueEntity : zhixunshiYuyueEntities) {
Date createTime = zhixunshiYuyueEntity.getCreateTime();
Quarter quarter = DateUtil.quarterEnum(createTime);
switch (quarter) {
case Q1:
q1 += 1;
break;
case Q2:
q2 += 1;
break;
case Q3:
q3 += 1;
break;
case Q4:
q4 += 1;
break;
default:
break;
}
}
return Result.success(CollUtil.newArrayList(q1, q2, q3, q4));
}
@GetMapping("/counts")
public Result counts() {
// List<User> list = uuserService
List<YonghuEntity> yonghuEntities = yonghuService.selectList(null);
List<UsersEntity> usersEntities = usersService.selectList(null);
List<ZhixunshiEntity> zhixunshiEntities = zhixunshiService.selectList(null);
List<ZhixunshiYuyueEntity> zhixunshiYuyueEntities = zhixunshiYuyueService.selectList(null);
int yonghu = yonghuEntities.size();
int users = usersEntities.size();
int zhixunshi = zhixunshiEntities.size();
int yuyue = zhixunshiYuyueEntities.size();
return Result.success(CollUtil.newArrayList(yonghu, users, zhixunshi, yuyue));
// List<Map<String, Object>> list = CollUtil.newArrayList();
}
/**
*
*
* @return
*/
// @GetMapping("/file/front/all")
// public Result frontAll() {
// // 1. 从缓存获取数据
// String jsonStr = stringRedisTemplate.opsForValue().get(FILES_KEY);
// List<Files> files;
// // 2. 取出来的json是空的
// if (StrUtil.isBlank(jsonStr)) {
// files = fileMapper.selectList(null);
// // 3. 从数据库取出数据再去缓存到redis
// stringRedisTemplate.opsForValue().set(FILES_KEY, JSONUtil.toJsonStr(files));
// }
// // 4. 取出来的json不是空的
// else {
// // 5. 如果有从redis缓存中获取数据减轻了数据库的压力
// files = JSONUtil.toBean(jsonStr, new TypeReference<List<Files>>() {
// }, true);
// }
// return Result.success(files);
// }
}

@ -0,0 +1,329 @@
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("/exampaper")
public class ExampaperController {
private static final Logger logger = LoggerFactory.getLogger(ExampaperController.class);
private static final String TABLE_NAME = "exampaper";
@Autowired
private ExampaperService exampaperService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表非注册的service
//注册表service
@Autowired
private YonghuService yonghuService;
@Autowired
private ZhixunshiService zhixunshiService;
/**
*
*/
@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("zhixunshiId",request.getSession().getAttribute("userId"));
params.put("exampaperDeleteStart",1);params.put("exampaperDeleteEnd",1);
CommonUtil.checkMap(params);
PageUtils page = exampaperService.queryPage(params);
//字典表数据转换
List<ExampaperView> list =(List<ExampaperView>)page.getList();
for(ExampaperView 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);
ExampaperEntity exampaper = exampaperService.selectById(id);
if(exampaper !=null){
//entity转view
ExampaperView view = new ExampaperView();
BeanUtils.copyProperties( exampaper , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody ExampaperEntity exampaper, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,exampaper:{}",this.getClass().getName(),exampaper.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<ExampaperEntity> queryWrapper = new EntityWrapper<ExampaperEntity>()
.eq("exampaper_name", exampaper.getExampaperName())
.eq("exampaper_date", exampaper.getExampaperDate())
.eq("exampaper_myscore", exampaper.getExampaperMyscore())
.eq("exampaper_types", exampaper.getExampaperTypes())
.eq("zujuan_types", exampaper.getZujuanTypes())
.eq("exampaper_delete", exampaper.getExampaperDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExampaperEntity exampaperEntity = exampaperService.selectOne(queryWrapper);
if(exampaperEntity==null){
exampaper.setExampaperDelete(1);
exampaper.setCreateTime(new Date());
exampaperService.insert(exampaper);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody ExampaperEntity exampaper, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,exampaper:{}",this.getClass().getName(),exampaper.toString());
ExampaperEntity oldExampaperEntity = exampaperService.selectById(exampaper.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<ExampaperEntity> queryWrapper = new EntityWrapper<ExampaperEntity>()
.notIn("id",exampaper.getId())
.andNew()
.eq("exampaper_name", exampaper.getExampaperName())
.eq("exampaper_date", exampaper.getExampaperDate())
.eq("exampaper_myscore", exampaper.getExampaperMyscore())
.eq("exampaper_types", exampaper.getExampaperTypes())
.eq("zujuan_types", exampaper.getZujuanTypes())
.eq("exampaper_delete", exampaper.getExampaperDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExampaperEntity exampaperEntity = exampaperService.selectOne(queryWrapper);
if(exampaperEntity==null){
exampaperService.updateById(exampaper);//根据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<ExampaperEntity> oldExampaperList =exampaperService.selectBatchIds(Arrays.asList(ids));//要删除的数据
ArrayList<ExampaperEntity> list = new ArrayList<>();
for(Integer id:ids){
ExampaperEntity exampaperEntity = new ExampaperEntity();
exampaperEntity.setId(id);
exampaperEntity.setExampaperDelete(2);
list.add(exampaperEntity);
}
if(list != null && list.size() >0){
exampaperService.updateBatchById(list);
}
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<ExampaperEntity> exampaperList = 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){
//循环
ExampaperEntity exampaperEntity = new ExampaperEntity();
// exampaperEntity.setExampaperName(data.get(0)); //心理测评名称 要改的
// exampaperEntity.setExampaperDate(Integer.valueOf(data.get(0))); //心理测评时长(分钟) 要改的
// exampaperEntity.setExampaperMyscore(Integer.valueOf(data.get(0))); //心理测评总分数 要改的
// exampaperEntity.setExampaperTypes(Integer.valueOf(data.get(0))); //心理测评状态 要改的
// exampaperEntity.setZujuanTypes(Integer.valueOf(data.get(0))); //组卷方式 要改的
// exampaperEntity.setExampaperDelete(1);//逻辑删除字段
// exampaperEntity.setCreateTime(date);//时间
exampaperList.add(exampaperEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
exampaperService.insertBatch(exampaperList);
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 = exampaperService.queryPage(params);
//字典表数据转换
List<ExampaperView> list =(List<ExampaperView>)page.getList();
for(ExampaperView 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);
ExampaperEntity exampaper = exampaperService.selectById(id);
if(exampaper !=null){
//entity转view
ExampaperView view = new ExampaperView();
BeanUtils.copyProperties( exampaper , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody ExampaperEntity exampaper, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,exampaper:{}",this.getClass().getName(),exampaper.toString());
Wrapper<ExampaperEntity> queryWrapper = new EntityWrapper<ExampaperEntity>()
.eq("exampaper_name", exampaper.getExampaperName())
.eq("exampaper_date", exampaper.getExampaperDate())
.eq("exampaper_myscore", exampaper.getExampaperMyscore())
.eq("exampaper_types", exampaper.getExampaperTypes())
.eq("zujuan_types", exampaper.getZujuanTypes())
.eq("exampaper_delete", exampaper.getExampaperDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExampaperEntity exampaperEntity = exampaperService.selectOne(queryWrapper);
if(exampaperEntity==null){
exampaper.setExampaperDelete(1);
exampaper.setCreateTime(new Date());
exampaperService.insert(exampaper);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}

@ -0,0 +1,663 @@
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("/exampapertopic")
public class ExampapertopicController {
private static final Logger logger = LoggerFactory.getLogger(ExampapertopicController.class);
private static final String TABLE_NAME = "exampapertopic";
@Autowired
private ExampapertopicService exampapertopicService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表非注册的service
@Autowired
private ExampaperService exampaperService;
@Autowired
private ExamquestionService examquestionService;
//注册表service
@Autowired
private YonghuService yonghuService;
@Autowired
private ZhixunshiService zhixunshiService;
/**
*
*/
@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("zhixunshiId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = exampapertopicService.queryPage(params);
//字典表数据转换
List<ExampapertopicView> list =(List<ExampapertopicView>)page.getList();
for(ExampapertopicView 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);
ExampapertopicEntity exampapertopic = exampapertopicService.selectById(id);
if(exampapertopic !=null){
//entity转view
ExampapertopicView view = new ExampapertopicView();
BeanUtils.copyProperties( exampapertopic , view );//把实体数据重构到view中
//级联表 题目表
//级联表
ExamquestionEntity examquestion = examquestionService.selectById(exampapertopic.getExamquestionId());
if(examquestion != null){
BeanUtils.copyProperties( examquestion , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setExamquestionId(examquestion.getId());
}
//级联表 心理测评表
//级联表
ExampaperEntity exampaper = exampaperService.selectById(exampapertopic.getExampaperId());
if(exampaper != null){
BeanUtils.copyProperties( exampaper , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setExampaperId(exampaper.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody ExampapertopicEntity exampapertopic, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,exampapertopic:{}",this.getClass().getName(),exampapertopic.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<ExampapertopicEntity> queryWrapper = new EntityWrapper<ExampapertopicEntity>()
.eq("exampaper_id", exampapertopic.getExampaperId())
.eq("examquestion_id", exampapertopic.getExamquestionId())
.eq("exampapertopic_number", exampapertopic.getExampapertopicNumber())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExampapertopicEntity exampapertopicEntity = exampapertopicService.selectOne(queryWrapper);
if(exampapertopicEntity==null){
exampapertopic.setCreateTime(new Date());
exampapertopicService.insert(exampapertopic);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody ExampapertopicEntity exampapertopic, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,exampapertopic:{}",this.getClass().getName(),exampapertopic.toString());
ExampapertopicEntity oldExampapertopicEntity = exampapertopicService.selectById(exampapertopic.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<ExampapertopicEntity> queryWrapper = new EntityWrapper<ExampapertopicEntity>()
.notIn("id",exampapertopic.getId())
.andNew()
.eq("exampaper_id", exampapertopic.getExampaperId())
.eq("examquestion_id", exampapertopic.getExamquestionId())
.eq("exampapertopic_number", exampapertopic.getExampapertopicNumber())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExampapertopicEntity exampapertopicEntity = exampapertopicService.selectOne(queryWrapper);
if(exampapertopicEntity==null){
exampapertopicService.updateById(exampapertopic);//根据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<ExampapertopicEntity> oldExampapertopicList =exampapertopicService.selectBatchIds(Arrays.asList(ids));//要删除的数据
exampapertopicService.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<ExampapertopicEntity> exampapertopicList = 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){
//循环
ExampapertopicEntity exampapertopicEntity = new ExampapertopicEntity();
// exampapertopicEntity.setExampaperId(Integer.valueOf(data.get(0))); //心理测评 要改的
// exampapertopicEntity.setExamquestionId(Integer.valueOf(data.get(0))); //题目 要改的
// exampapertopicEntity.setExampapertopicNumber(Integer.valueOf(data.get(0))); //题目分数 要改的
// exampapertopicEntity.setCreateTime(date);//时间
exampapertopicList.add(exampapertopicEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
exampapertopicService.insertBatch(exampapertopicList);
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 = exampapertopicService.queryPage(params);
//字典表数据转换
List<ExampapertopicView> list =(List<ExampapertopicView>)page.getList();
for(ExampapertopicView 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);
ExampapertopicEntity exampapertopic = exampapertopicService.selectById(id);
if(exampapertopic !=null){
//entity转view
ExampapertopicView view = new ExampapertopicView();
BeanUtils.copyProperties( exampapertopic , view );//把实体数据重构到view中
//级联表
ExamquestionEntity examquestion = examquestionService.selectById(exampapertopic.getExamquestionId());
if(examquestion != null){
BeanUtils.copyProperties( examquestion , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setExamquestionId(examquestion.getId());
}
//级联表
ExampaperEntity exampaper = exampaperService.selectById(exampapertopic.getExampaperId());
if(exampaper != null){
BeanUtils.copyProperties( exampaper , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setExampaperId(exampaper.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody ExampapertopicEntity exampapertopic, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,exampapertopic:{}",this.getClass().getName(),exampapertopic.toString());
Wrapper<ExampapertopicEntity> queryWrapper = new EntityWrapper<ExampapertopicEntity>()
.eq("exampaper_id", exampapertopic.getExampaperId())
.eq("examquestion_id", exampapertopic.getExamquestionId())
.eq("exampapertopic_number", exampapertopic.getExampapertopicNumber())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExampapertopicEntity exampapertopicEntity = exampapertopicService.selectOne(queryWrapper);
if(exampapertopicEntity==null){
exampapertopic.setCreateTime(new Date());
exampapertopicService.insert(exampapertopic);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
@Autowired
private ExamrecordService examrecordService;
@Autowired
private ExamredetailsService examredetailsService;
/**
*
*/
@RequestMapping("/examinationUpdate")
public R examinationUpdate(@RequestBody ExampapertopicEntity exampapertopic, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,exampapertopic:{}",this.getClass().getName(),exampapertopic.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
//根据字段查询是否有相同数据
Wrapper<ExampapertopicEntity> queryWrapper = new EntityWrapper<ExampapertopicEntity>()
.notIn("id",exampapertopic.getId())
.andNew()
.eq("exampaper_id", exampapertopic.getExampaperId())
.eq("examquestion_id", exampapertopic.getExamquestionId())
.eq("exampapertopic_number", exampapertopic.getExampapertopicNumber())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExampapertopicEntity exampapertopicEntity = exampapertopicService.selectOne(queryWrapper);
if(exampapertopicEntity==null){
ExampapertopicEntity exampapertopicEntity1 = exampapertopicService.selectById(exampapertopic.getId());
if(exampapertopic.getExampaperId() == null){
return R.error("修改时数据未获取到");
}
if(exampapertopicEntity1.getExampapertopicNumber()!=exampapertopic.getExampapertopicNumber()){
ExampaperEntity exampaperEntity = exampaperService.selectById(exampapertopic.getExampaperId());
exampaperEntity.setExampaperMyscore((exampaperEntity.getExampaperMyscore()-exampapertopicEntity1.getExampapertopicNumber())+exampapertopic.getExampapertopicNumber());
exampaperService.updateById(exampaperEntity);
}
exampapertopicService.updateById(exampapertopic);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/examinationDelete")
public R examinationDelete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
List<ExampapertopicEntity> exampapertopicEntities = exampapertopicService.selectBatchIds(Arrays.asList(ids));
ExampaperEntity exampaperEntity1 = exampaperService.selectById(exampapertopicEntities.get(0).getExampaperId());
for (ExampapertopicEntity topic:exampapertopicEntities) {
exampaperEntity1.setExampaperMyscore(exampaperEntity1.getExampaperMyscore()-topic.getExampapertopicNumber());
}
exampaperService.updateById(exampaperEntity1);
exampapertopicService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@RequestMapping("/zidongzujuan")
public R zidongzujuan(@RequestParam Map<String, Object> params, HttpServletRequest request){
//心理测评数据信息
ExampaperEntity exampaperEntity = new ExampaperEntity();
exampaperEntity.setId(Integer.valueOf(String.valueOf(params.get("exampaperId"))));
exampaperEntity.setExampaperMyscore(0);
//单选数量和分数
Integer danNum = Integer.valueOf(String.valueOf(params.get("danNum")));
Integer danFen = Integer.valueOf(String.valueOf(params.get("danFen")));
ArrayList<ExamquestionEntity> danList = new ArrayList<>();
//多选数量和分数
Integer duoNum = Integer.valueOf(String.valueOf(params.get("duoNum")));
Integer duoFen = Integer.valueOf(String.valueOf(params.get("duoFen")));
ArrayList<ExamquestionEntity> duoList = new ArrayList<>();
//判断数量和分数
Integer panNum = Integer.valueOf(String.valueOf(params.get("panNum")));
Integer panFen = Integer.valueOf(String.valueOf(params.get("panFen")));
ArrayList<ExamquestionEntity> panList = new ArrayList<>();
//填空数量和分数
Integer tianNum = Integer.valueOf(String.valueOf(params.get("tianNum")));
Integer tianFen = Integer.valueOf(String.valueOf(params.get("tianFen")));
ArrayList<ExamquestionEntity> tianList = new ArrayList<>();
//存储已经筛选的数据
ArrayList<ExampapertopicEntity> exampapertopicEntities = new ArrayList<>();
//随机数
Random random = new Random();
//查询全部题目信息
List<ExamquestionEntity> exampapertopicLists = examquestionService.selectList(null);
for (ExamquestionEntity examquestion: exampapertopicLists) {
//将对应类型数据放入对应的list集合中
if(examquestion.getExamquestionTypes() == 1){//单选题
danList.add(examquestion);
}else if(examquestion.getExamquestionTypes() == 2){//多选题
duoList.add(examquestion);
}else if(examquestion.getExamquestionTypes() == 3){//判断题
panList.add(examquestion);
}else{//填空题
tianList.add(examquestion);
}
}
//判断前台传来的题数值是否为空
if(danNum!=null && danNum>0 && danFen != null && danFen >0){//单选
if(danList.size()<danNum)
return R.error("单选题数量"+danNum+"超过数据库中存在的最大数量"+danList.size());
for (int i = 0 ;i<danNum;i++){
ExampapertopicEntity exampapertopicEntity = new ExampapertopicEntity();
int intRandom = random.nextInt(danList.size());
exampaperEntity.setExampaperMyscore(exampaperEntity.getExampaperMyscore()+danFen);
exampapertopicEntity.setExamquestionId(danList.get(intRandom).getId());
exampapertopicEntity.setExampapertopicNumber(danFen);
exampapertopicEntity.setExampaperId(exampaperEntity.getId());
exampapertopicEntities.add(exampapertopicEntity);
danList.remove(intRandom);
}
}
if(duoNum!=null && duoNum>0 && duoFen != null && duoFen >0){//多选
if(duoList.size()<duoNum)
return R.error("多选题数量"+duoNum+"超过数据库中存在的最大数量"+duoList.size());
for (int i = 0 ;i<duoNum;i++){
ExampapertopicEntity exampapertopicEntity = new ExampapertopicEntity();
int intRandom = random.nextInt(duoList.size() );
exampaperEntity.setExampaperMyscore(exampaperEntity.getExampaperMyscore()+duoFen);
exampapertopicEntity.setExamquestionId(duoList.get(intRandom).getId());
exampapertopicEntity.setExampapertopicNumber(duoFen);
exampapertopicEntity.setExampaperId(exampaperEntity.getId());
exampapertopicEntities.add(exampapertopicEntity);
duoList.remove(intRandom);
}
}
if(panNum!=null && panNum>0 && panFen != null && panFen >0){//判断
if(panList.size()<panNum)
return R.error("判断题数量"+panNum+"超过数据库中存在的最大数量"+panList.size());
for (int i = 0 ;i<panNum;i++){
ExampapertopicEntity exampapertopicEntity = new ExampapertopicEntity();
int intRandom = random.nextInt(panList.size());
exampaperEntity.setExampaperMyscore(exampaperEntity.getExampaperMyscore()+panFen);
exampapertopicEntity.setExamquestionId(panList.get(intRandom).getId());
exampapertopicEntity.setExampapertopicNumber(panFen);
exampapertopicEntity.setExampaperId(exampaperEntity.getId());
exampapertopicEntities.add(exampapertopicEntity);
panList.remove(intRandom);
}
}
if(tianNum!=null && tianNum>0 && tianFen != null && tianFen >0){//填空
if(tianList.size()<tianNum)
return R.error("填空题数量"+tianNum+"超过数据库中存在的最大数量"+tianList.size());
for (int i = 0 ;i<tianNum;i++){
ExampapertopicEntity exampapertopicEntity = new ExampapertopicEntity();
int intRandom = random.nextInt(tianList.size());
exampaperEntity.setExampaperMyscore(exampaperEntity.getExampaperMyscore()+tianFen);
exampapertopicEntity.setExamquestionId(tianList.get(intRandom).getId());
exampapertopicEntity.setExampapertopicNumber(tianFen);
exampapertopicEntity.setExampaperId(exampaperEntity.getId());
exampapertopicEntities.add(exampapertopicEntity);
tianList.remove(intRandom);
}
}
exampaperService.updateById(exampaperEntity);
exampapertopicService.insertBatch(exampapertopicEntities);
return R.ok();
}
/**
*
*/
@RequestMapping("/sumExampapertopicNumber")
public R sumExampapertopicNumber(Integer exampaperId, HttpServletRequest request){
if(exampaperId==null || exampaperId<=0)
return R.error("心理测评id不能为空");
List<ExampapertopicEntity> list = exampapertopicService.selectList(
new EntityWrapper<ExampapertopicEntity>()
.eq("exampaper_id", exampaperId)
);
Integer exampapertopicNumber=0;
if(!(list == null || list.size()==0)){
for(ExampapertopicEntity exampapertopicEntity:list){
exampapertopicNumber=exampapertopicNumber+exampapertopicEntity.getExampapertopicNumber();
}
}
return R.ok().put("exampapertopicNumber",exampapertopicNumber);
}
/**
*
*/
@RequestMapping("/questionAcquisition")
public R questionAcquisition(Integer exampaperId, HttpServletRequest request){
//获取当前心理测评的选题信息
HashMap<String, Object> params = new HashMap<>();
params.put("limit","9999");
params.put("exampaperId", exampaperId);
CommonUtil.checkMap(params);
PageUtils page = exampapertopicService.queryPage(params);
List<ExampapertopicView> exampapertopicView =(List<ExampapertopicView>)page.getList();
//题目id存放list
List<Integer> exampapertopicId = new ArrayList<>();
//循环选题信息获取题目id并存放起来
for (ExampapertopicEntity papertopic:exampapertopicView) {
exampapertopicId.add(papertopic.getExamquestionId());
}
//查询题目数据
List<ExamquestionEntity> examquestionEntity = examquestionService.selectBatchIds(exampapertopicId);
//题目数据存放到选题view中
examquestionEntity.forEach(item -> {
BeanUtils.copyProperties(item, exampapertopicView);
});
//字典表数据转换
for(ExampapertopicView c:exampapertopicView){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data",exampapertopicView);
}
/**
*
*/
@RequestMapping("/submitQuestions")
public R submitQuestions(@RequestParam Map<String, Object> params, HttpServletRequest request){
//答题编号
String uuid = String.valueOf(new Date().getTime());
//答题用户
Integer yonghuId = Integer.valueOf(String.valueOf(params.get("yonghuId")));
//心理测评id
Integer exampaperId = Integer.valueOf(String.valueOf(params.get("exampaperId")));
//心理测评记录表信息
ExamrecordEntity examrecordEntity = new ExamrecordEntity();
examrecordEntity.setExamrecordUuidNumber(uuid);
examrecordEntity.setTotalScore(0);//总分数
examrecordEntity.setExampaperId(exampaperId);//心理测评id
examrecordEntity.setYonghuId(yonghuId);//心理测评用户
examrecordEntity.setInsertTime(new Date());//时间
examrecordEntity.setCreateTime(new Date());//时间
//答题信息
List<Map<String,String>> answerList = (List<Map<String,String>>)JSON.parse(String.valueOf(params.get("answerList")));
//答题map
HashMap<String, String> answerMap = new HashMap<>();
for (Map<String,String> map:answerList) {
answerMap.put(map.get("examquestionId"),map.get("answer"));
}
//题目信息
HashMap<String, Object> map = new HashMap<>();
map.put("limit","9999");
map.put("exampaperId", exampaperId);
CommonUtil.checkMap(map);
PageUtils page = exampapertopicService.queryPage(map);
List<ExampapertopicView> exampapertopicList =(List<ExampapertopicView>)page.getList();
//答题详情
List<ExamredetailsEntity> examredetailsList = new ArrayList<>();
//错题详情
if(exampapertopicList != null && exampapertopicList.size()>0){
boolean insert = examrecordService.insert(examrecordEntity);
if(!insert){
return R.error();
}
}
//判断用户的答案
for (ExampapertopicView exampapertopic:exampapertopicList) {
boolean cuoti = false;
//答题信息
ExamredetailsEntity examredetailsEntity = new ExamredetailsEntity();
//答题数据补充
examredetailsEntity.setExamredetailsUuidNumber(uuid);
examredetailsEntity.setYonghuId(yonghuId);
examredetailsEntity.setExamquestionId(exampapertopic.getExamquestionId());
examredetailsEntity.setCreateTime(new Date());
//错题信息
//判断是否答题
if(StringUtil.isNotEmpty(answerMap.get(exampapertopic.getExamquestionId()))){
examredetailsEntity.setExamredetailsMyanswer(answerMap.get(exampapertopic.getExamquestionId()));
//多选题判断对错
if(exampapertopic.getExamquestionTypes() == 2){
//正确答案
List<String> split = Arrays.asList(exampapertopic.getExamquestionAnswer().split(","));
ArrayList<String> splitLs = new ArrayList<>();
splitLs.addAll(split);
//用户答案
List<String> answer = Arrays.asList(answerMap.get(exampapertopic.getExamquestionId()).split(","));
List<String> answerLs = new ArrayList<>();
answerLs.addAll(answer);
//判断用户是否回答正确
if(splitLs.size() == answerLs.size()){//判断用户回答信息的长度是否正确答案的长度一样
splitLs.retainAll(answerLs);
if(splitLs.size() == answerLs.size()){//判断内容是否正确
examrecordEntity.setTotalScore(examrecordEntity.getTotalScore()+exampapertopic.getExampapertopicNumber());
examredetailsEntity.setExamredetailsMyscore(exampapertopic.getExampapertopicNumber());
}else{//错误
cuoti = true;
examredetailsEntity.setExamredetailsMyscore(0);
}
}else{//错误
cuoti = true;
examredetailsEntity.setExamredetailsMyscore(0);
}
}else{
//其他题判断对错
if(answerMap.get(exampapertopic.getExamquestionId()).equals(exampapertopic.getExamquestionAnswer())){//正确
examredetailsEntity.setExamredetailsMyscore(exampapertopic.getExampapertopicNumber());
examrecordEntity.setTotalScore(examrecordEntity.getTotalScore()+exampapertopic.getExampapertopicNumber());
}else{//错误
cuoti = true;
examredetailsEntity.setExamredetailsMyscore(0);
}
}
}else{//未作答
cuoti = true;
examredetailsEntity.setExamredetailsMyanswer("未作答");
examredetailsEntity.setExamredetailsMyscore(0);
}
if(cuoti){
cuoti = false;
}
examredetailsList.add(examredetailsEntity);
}
examredetailsService.insertBatch(examredetailsList);
examrecordService.updateById(examrecordEntity);
return R.ok();
}
}

@ -0,0 +1,317 @@
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("/examquestion")
public class ExamquestionController {
private static final Logger logger = LoggerFactory.getLogger(ExamquestionController.class);
private static final String TABLE_NAME = "examquestion";
@Autowired
private ExamquestionService examquestionService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表非注册的service
//注册表service
@Autowired
private YonghuService yonghuService;
@Autowired
private ZhixunshiService zhixunshiService;
/**
*
*/
@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("zhixunshiId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = examquestionService.queryPage(params);
//字典表数据转换
List<ExamquestionView> list =(List<ExamquestionView>)page.getList();
for(ExamquestionView 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);
ExamquestionEntity examquestion = examquestionService.selectById(id);
if(examquestion !=null){
//entity转view
ExamquestionView view = new ExamquestionView();
BeanUtils.copyProperties( examquestion , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody ExamquestionEntity examquestion, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,examquestion:{}",this.getClass().getName(),examquestion.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<ExamquestionEntity> queryWrapper = new EntityWrapper<ExamquestionEntity>()
.eq("examquestion_name", examquestion.getExamquestionName())
.eq("examquestion_options", examquestion.getExamquestionOptions())
.eq("examquestion_answer", examquestion.getExamquestionAnswer())
.eq("examquestion_analysis", examquestion.getExamquestionAnalysis())
.eq("examquestion_types", examquestion.getExamquestionTypes())
.eq("examquestion_sequence", examquestion.getExamquestionSequence())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExamquestionEntity examquestionEntity = examquestionService.selectOne(queryWrapper);
if(examquestionEntity==null){
examquestion.setCreateTime(new Date());
examquestionService.insert(examquestion);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody ExamquestionEntity examquestion, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,examquestion:{}",this.getClass().getName(),examquestion.toString());
ExamquestionEntity oldExamquestionEntity = examquestionService.selectById(examquestion.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<ExamquestionEntity> queryWrapper = new EntityWrapper<ExamquestionEntity>()
.notIn("id",examquestion.getId())
.andNew()
.eq("examquestion_name", examquestion.getExamquestionName())
.eq("examquestion_options", examquestion.getExamquestionOptions())
.eq("examquestion_answer", examquestion.getExamquestionAnswer())
.eq("examquestion_analysis", examquestion.getExamquestionAnalysis())
.eq("examquestion_types", examquestion.getExamquestionTypes())
.eq("examquestion_sequence", examquestion.getExamquestionSequence())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExamquestionEntity examquestionEntity = examquestionService.selectOne(queryWrapper);
if(examquestionEntity==null){
examquestionService.updateById(examquestion);//根据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<ExamquestionEntity> oldExamquestionList =examquestionService.selectBatchIds(Arrays.asList(ids));//要删除的数据
examquestionService.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<ExamquestionEntity> examquestionList = 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){
//循环
ExamquestionEntity examquestionEntity = new ExamquestionEntity();
// examquestionEntity.setExamquestionName(data.get(0)); //题目名称 要改的
// examquestionEntity.setExamquestionOptions(data.get(0)); //选项json字符串 要改的
// examquestionEntity.setExamquestionAnswer(data.get(0)); //正确答案 要改的
// examquestionEntity.setExamquestionAnalysis(data.get(0)); //答案解析 要改的
// examquestionEntity.setExamquestionTypes(Integer.valueOf(data.get(0))); //题目类型 要改的
// examquestionEntity.setExamquestionSequence(Integer.valueOf(data.get(0))); //题目排序,值越大排越前面 要改的
// examquestionEntity.setCreateTime(date);//时间
examquestionList.add(examquestionEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
examquestionService.insertBatch(examquestionList);
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 = examquestionService.queryPage(params);
//字典表数据转换
List<ExamquestionView> list =(List<ExamquestionView>)page.getList();
for(ExamquestionView 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);
ExamquestionEntity examquestion = examquestionService.selectById(id);
if(examquestion !=null){
//entity转view
ExamquestionView view = new ExamquestionView();
BeanUtils.copyProperties( examquestion , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody ExamquestionEntity examquestion, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,examquestion:{}",this.getClass().getName(),examquestion.toString());
Wrapper<ExamquestionEntity> queryWrapper = new EntityWrapper<ExamquestionEntity>()
.eq("examquestion_name", examquestion.getExamquestionName())
.eq("examquestion_options", examquestion.getExamquestionOptions())
.eq("examquestion_answer", examquestion.getExamquestionAnswer())
.eq("examquestion_analysis", examquestion.getExamquestionAnalysis())
.eq("examquestion_types", examquestion.getExamquestionTypes())
.eq("examquestion_sequence", examquestion.getExamquestionSequence())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExamquestionEntity examquestionEntity = examquestionService.selectOne(queryWrapper);
if(examquestionEntity==null){
examquestion.setCreateTime(new Date());
examquestionService.insert(examquestion);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}

@ -0,0 +1,360 @@
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("/examrecord")
public class ExamrecordController {
private static final Logger logger = LoggerFactory.getLogger(ExamrecordController.class);
private static final String TABLE_NAME = "examrecord";
@Autowired
private ExamrecordService examrecordService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表非注册的service
@Autowired
private ExampaperService exampaperService;
//注册表service
@Autowired
private YonghuService yonghuService;
@Autowired
private ZhixunshiService zhixunshiService;
/**
*
*/
@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("zhixunshiId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = examrecordService.queryPage(params);
//字典表数据转换
List<ExamrecordView> list =(List<ExamrecordView>)page.getList();
for(ExamrecordView 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);
ExamrecordEntity examrecord = examrecordService.selectById(id);
if(examrecord !=null){
//entity转view
ExamrecordView view = new ExamrecordView();
BeanUtils.copyProperties( examrecord , view );//把实体数据重构到view中
//级联表 用户
//级联表
YonghuEntity yonghu = yonghuService.selectById(examrecord.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setYonghuId(yonghu.getId());
}
//级联表 心理测评表
//级联表
ExampaperEntity exampaper = exampaperService.selectById(examrecord.getExampaperId());
if(exampaper != null){
BeanUtils.copyProperties( exampaper , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setExampaperId(exampaper.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody ExamrecordEntity examrecord, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,examrecord:{}",this.getClass().getName(),examrecord.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("用户".equals(role))
examrecord.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<ExamrecordEntity> queryWrapper = new EntityWrapper<ExamrecordEntity>()
.eq("yonghu_id", examrecord.getYonghuId())
.eq("exampaper_id", examrecord.getExampaperId())
.eq("total_score", examrecord.getTotalScore())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExamrecordEntity examrecordEntity = examrecordService.selectOne(queryWrapper);
if(examrecordEntity==null){
examrecord.setInsertTime(new Date());
examrecord.setCreateTime(new Date());
examrecordService.insert(examrecord);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody ExamrecordEntity examrecord, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,examrecord:{}",this.getClass().getName(),examrecord.toString());
ExamrecordEntity oldExamrecordEntity = examrecordService.selectById(examrecord.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// examrecord.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
//根据字段查询是否有相同数据
Wrapper<ExamrecordEntity> queryWrapper = new EntityWrapper<ExamrecordEntity>()
.notIn("id",examrecord.getId())
.andNew()
.eq("yonghu_id", examrecord.getYonghuId())
.eq("exampaper_id", examrecord.getExampaperId())
.eq("total_score", examrecord.getTotalScore())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExamrecordEntity examrecordEntity = examrecordService.selectOne(queryWrapper);
if(examrecordEntity==null){
examrecordService.updateById(examrecord);//根据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<ExamrecordEntity> oldExamrecordList =examrecordService.selectBatchIds(Arrays.asList(ids));//要删除的数据
examrecordService.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<ExamrecordEntity> examrecordList = 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){
//循环
ExamrecordEntity examrecordEntity = new ExamrecordEntity();
// examrecordEntity.setExamrecordUuidNumber(data.get(0)); //心理测评编号 要改的
// examrecordEntity.setYonghuId(Integer.valueOf(data.get(0))); //心理测评学生 要改的
// examrecordEntity.setExampaperId(Integer.valueOf(data.get(0))); //所属心理测评id外键 要改的
// examrecordEntity.setTotalScore(Integer.valueOf(data.get(0))); //所得总分 要改的
// examrecordEntity.setInsertTime(date);//时间
// examrecordEntity.setCreateTime(date);//时间
examrecordList.add(examrecordEntity);
//把要查询是否重复的字段放入map中
//心理测评编号
if(seachFields.containsKey("examrecordUuidNumber")){
List<String> examrecordUuidNumber = seachFields.get("examrecordUuidNumber");
examrecordUuidNumber.add(data.get(0));//要改的
}else{
List<String> examrecordUuidNumber = new ArrayList<>();
examrecordUuidNumber.add(data.get(0));//要改的
seachFields.put("examrecordUuidNumber",examrecordUuidNumber);
}
}
//查询是否重复
//心理测评编号
List<ExamrecordEntity> examrecordEntities_examrecordUuidNumber = examrecordService.selectList(new EntityWrapper<ExamrecordEntity>().in("examrecord_uuid_number", seachFields.get("examrecordUuidNumber")));
if(examrecordEntities_examrecordUuidNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(ExamrecordEntity s:examrecordEntities_examrecordUuidNumber){
repeatFields.add(s.getExamrecordUuidNumber());
}
return R.error(511,"数据库的该表中的 [心理测评编号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
examrecordService.insertBatch(examrecordList);
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 = examrecordService.queryPage(params);
//字典表数据转换
List<ExamrecordView> list =(List<ExamrecordView>)page.getList();
for(ExamrecordView 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);
ExamrecordEntity examrecord = examrecordService.selectById(id);
if(examrecord !=null){
//entity转view
ExamrecordView view = new ExamrecordView();
BeanUtils.copyProperties( examrecord , view );//把实体数据重构到view中
//级联表
YonghuEntity yonghu = yonghuService.selectById(examrecord.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//级联表
ExampaperEntity exampaper = exampaperService.selectById(examrecord.getExampaperId());
if(exampaper != null){
BeanUtils.copyProperties( exampaper , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setExampaperId(exampaper.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody ExamrecordEntity examrecord, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,examrecord:{}",this.getClass().getName(),examrecord.toString());
Wrapper<ExamrecordEntity> queryWrapper = new EntityWrapper<ExamrecordEntity>()
.eq("examrecord_uuid_number", examrecord.getExamrecordUuidNumber())
.eq("yonghu_id", examrecord.getYonghuId())
.eq("exampaper_id", examrecord.getExampaperId())
.eq("total_score", examrecord.getTotalScore())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExamrecordEntity examrecordEntity = examrecordService.selectOne(queryWrapper);
if(examrecordEntity==null){
examrecord.setInsertTime(new Date());
examrecord.setCreateTime(new Date());
examrecordService.insert(examrecord);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}

@ -0,0 +1,361 @@
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("/examredetails")
public class ExamredetailsController {
private static final Logger logger = LoggerFactory.getLogger(ExamredetailsController.class);
private static final String TABLE_NAME = "examredetails";
@Autowired
private ExamredetailsService examredetailsService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表非注册的service
@Autowired
private ExamquestionService examquestionService;
//注册表service
@Autowired
private YonghuService yonghuService;
@Autowired
private ZhixunshiService zhixunshiService;
/**
*
*/
@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("zhixunshiId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = examredetailsService.queryPage(params);
//字典表数据转换
List<ExamredetailsView> list =(List<ExamredetailsView>)page.getList();
for(ExamredetailsView 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);
ExamredetailsEntity examredetails = examredetailsService.selectById(id);
if(examredetails !=null){
//entity转view
ExamredetailsView view = new ExamredetailsView();
BeanUtils.copyProperties( examredetails , view );//把实体数据重构到view中
//级联表 用户
//级联表
YonghuEntity yonghu = yonghuService.selectById(examredetails.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setYonghuId(yonghu.getId());
}
//级联表 题目表
//级联表
ExamquestionEntity examquestion = examquestionService.selectById(examredetails.getExamquestionId());
if(examquestion != null){
BeanUtils.copyProperties( examquestion , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setExamquestionId(examquestion.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody ExamredetailsEntity examredetails, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,examredetails:{}",this.getClass().getName(),examredetails.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("用户".equals(role))
examredetails.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<ExamredetailsEntity> queryWrapper = new EntityWrapper<ExamredetailsEntity>()
.eq("yonghu_id", examredetails.getYonghuId())
.eq("examquestion_id", examredetails.getExamquestionId())
.eq("examredetails_myanswer", examredetails.getExamredetailsMyanswer())
.eq("examredetails_myscore", examredetails.getExamredetailsMyscore())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExamredetailsEntity examredetailsEntity = examredetailsService.selectOne(queryWrapper);
if(examredetailsEntity==null){
examredetails.setCreateTime(new Date());
examredetailsService.insert(examredetails);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody ExamredetailsEntity examredetails, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,examredetails:{}",this.getClass().getName(),examredetails.toString());
ExamredetailsEntity oldExamredetailsEntity = examredetailsService.selectById(examredetails.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// examredetails.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
//根据字段查询是否有相同数据
Wrapper<ExamredetailsEntity> queryWrapper = new EntityWrapper<ExamredetailsEntity>()
.notIn("id",examredetails.getId())
.andNew()
.eq("yonghu_id", examredetails.getYonghuId())
.eq("examquestion_id", examredetails.getExamquestionId())
.eq("examredetails_myanswer", examredetails.getExamredetailsMyanswer())
.eq("examredetails_myscore", examredetails.getExamredetailsMyscore())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExamredetailsEntity examredetailsEntity = examredetailsService.selectOne(queryWrapper);
if(examredetailsEntity==null){
examredetailsService.updateById(examredetails);//根据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<ExamredetailsEntity> oldExamredetailsList =examredetailsService.selectBatchIds(Arrays.asList(ids));//要删除的数据
examredetailsService.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<ExamredetailsEntity> examredetailsList = 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){
//循环
ExamredetailsEntity examredetailsEntity = new ExamredetailsEntity();
// examredetailsEntity.setExamredetailsUuidNumber(data.get(0)); //心理测评编号 要改的
// examredetailsEntity.setYonghuId(Integer.valueOf(data.get(0))); //学生id 要改的
// examredetailsEntity.setExamquestionId(Integer.valueOf(data.get(0))); //题目id外键 要改的
// examredetailsEntity.setExamredetailsMyanswer(data.get(0)); //考生答案 要改的
// examredetailsEntity.setExamredetailsMyscore(Integer.valueOf(data.get(0))); //题目得分 要改的
// examredetailsEntity.setCreateTime(date);//时间
examredetailsList.add(examredetailsEntity);
//把要查询是否重复的字段放入map中
//心理测评编号
if(seachFields.containsKey("examredetailsUuidNumber")){
List<String> examredetailsUuidNumber = seachFields.get("examredetailsUuidNumber");
examredetailsUuidNumber.add(data.get(0));//要改的
}else{
List<String> examredetailsUuidNumber = new ArrayList<>();
examredetailsUuidNumber.add(data.get(0));//要改的
seachFields.put("examredetailsUuidNumber",examredetailsUuidNumber);
}
}
//查询是否重复
//心理测评编号
List<ExamredetailsEntity> examredetailsEntities_examredetailsUuidNumber = examredetailsService.selectList(new EntityWrapper<ExamredetailsEntity>().in("examredetails_uuid_number", seachFields.get("examredetailsUuidNumber")));
if(examredetailsEntities_examredetailsUuidNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(ExamredetailsEntity s:examredetailsEntities_examredetailsUuidNumber){
repeatFields.add(s.getExamredetailsUuidNumber());
}
return R.error(511,"数据库的该表中的 [心理测评编号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
examredetailsService.insertBatch(examredetailsList);
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 = examredetailsService.queryPage(params);
//字典表数据转换
List<ExamredetailsView> list =(List<ExamredetailsView>)page.getList();
for(ExamredetailsView 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);
ExamredetailsEntity examredetails = examredetailsService.selectById(id);
if(examredetails !=null){
//entity转view
ExamredetailsView view = new ExamredetailsView();
BeanUtils.copyProperties( examredetails , view );//把实体数据重构到view中
//级联表
YonghuEntity yonghu = yonghuService.selectById(examredetails.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//级联表
ExamquestionEntity examquestion = examquestionService.selectById(examredetails.getExamquestionId());
if(examquestion != null){
BeanUtils.copyProperties( examquestion , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setExamquestionId(examquestion.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody ExamredetailsEntity examredetails, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,examredetails:{}",this.getClass().getName(),examredetails.toString());
Wrapper<ExamredetailsEntity> queryWrapper = new EntityWrapper<ExamredetailsEntity>()
.eq("examredetails_uuid_number", examredetails.getExamredetailsUuidNumber())
.eq("yonghu_id", examredetails.getYonghuId())
.eq("examquestion_id", examredetails.getExamquestionId())
.eq("examredetails_myanswer", examredetails.getExamredetailsMyanswer())
.eq("examredetails_myscore", examredetails.getExamredetailsMyscore())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ExamredetailsEntity examredetailsEntity = examredetailsService.selectOne(queryWrapper);
if(examredetailsEntity==null){
examredetails.setCreateTime(new Date());
examredetailsService.insert(examredetails);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}

@ -0,0 +1,110 @@
package com.controller;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;
/**
*
*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{
@Autowired
private ConfigService configService;
/**
*
*/
@RequestMapping("/upload")
public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
if (file.isEmpty()) {
throw new EIException("上传文件不能为空");
}
String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
File path = new File(ResourceUtils.getURL("classpath:static").getPath());
if(!path.exists()) {
path = new File("");
}
File upload = new File(path.getAbsolutePath(),"/upload/");
if(!upload.exists()) {
upload.mkdirs();
}
String fileName = new Date().getTime()+"."+fileExt;
File dest = new File(upload.getAbsolutePath()+"/"+fileName);
file.transferTo(dest);
if(StringUtils.isNotBlank(type) && type.equals("1")) {
ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
if(configEntity==null) {
configEntity = new ConfigEntity();
configEntity.setName("faceFile");
configEntity.setValue(fileName);
} else {
configEntity.setValue(fileName);
}
configService.insertOrUpdate(configEntity);
}
return R.ok().put("file", fileName);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/download")
public ResponseEntity<byte[]> download(@RequestParam String fileName) {
try {
File path = new File(ResourceUtils.getURL("classpath:static").getPath());
if(!path.exists()) {
path = new File("");
}
File upload = new File(path.getAbsolutePath(),"/upload/");
if(!upload.exists()) {
upload.mkdirs();
}
File file = new File(upload.getAbsolutePath()+"/"+fileName);
if(file.exists()){
/*if(!fileService.canRead(file, SessionManager.getSessionUser())){
getResponse().sendError(403);
}*/
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
headers.setContentDispositionFormData("attachment", fileName);
return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
}
} catch (IOException e) {
e.printStackTrace();
}
return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}

@ -0,0 +1,309 @@
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("/news")
public class NewsController {
private static final Logger logger = LoggerFactory.getLogger(NewsController.class);
private static final String TABLE_NAME = "news";
@Autowired
private NewsService newsService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表非注册的service
//注册表service
@Autowired
private YonghuService yonghuService;
@Autowired
private ZhixunshiService zhixunshiService;
/**
*
*/
@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("zhixunshiId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = newsService.queryPage(params);
//字典表数据转换
List<NewsView> list =(List<NewsView>)page.getList();
for(NewsView 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);
NewsEntity news = newsService.selectById(id);
if(news !=null){
//entity转view
NewsView view = new NewsView();
BeanUtils.copyProperties( news , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody NewsEntity news, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<NewsEntity> queryWrapper = new EntityWrapper<NewsEntity>()
.eq("news_name", news.getNewsName())
.eq("news_types", news.getNewsTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
NewsEntity newsEntity = newsService.selectOne(queryWrapper);
if(newsEntity==null){
news.setInsertTime(new Date());
news.setCreateTime(new Date());
newsService.insert(news);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody NewsEntity news, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());
NewsEntity oldNewsEntity = newsService.selectById(news.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<NewsEntity> queryWrapper = new EntityWrapper<NewsEntity>()
.notIn("id",news.getId())
.andNew()
.eq("news_name", news.getNewsName())
.eq("news_types", news.getNewsTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
NewsEntity newsEntity = newsService.selectOne(queryWrapper);
if("".equals(news.getNewsPhoto()) || "null".equals(news.getNewsPhoto())){
news.setNewsPhoto(null);
}
if(newsEntity==null){
newsService.updateById(news);//根据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<NewsEntity> oldNewsList =newsService.selectBatchIds(Arrays.asList(ids));//要删除的数据
newsService.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<NewsEntity> newsList = 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){
//循环
NewsEntity newsEntity = new NewsEntity();
// newsEntity.setNewsName(data.get(0)); //公告标题 要改的
// newsEntity.setNewsTypes(Integer.valueOf(data.get(0))); //公告类型 要改的
// newsEntity.setNewsPhoto("");//详情和图片
// newsEntity.setInsertTime(date);//时间
// newsEntity.setNewsContent("");//详情和图片
// newsEntity.setCreateTime(date);//时间
newsList.add(newsEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
newsService.insertBatch(newsList);
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 = newsService.queryPage(params);
//字典表数据转换
List<NewsView> list =(List<NewsView>)page.getList();
for(NewsView 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);
NewsEntity news = newsService.selectById(id);
if(news !=null){
//entity转view
NewsView view = new NewsView();
BeanUtils.copyProperties( news , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody NewsEntity news, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());
Wrapper<NewsEntity> queryWrapper = new EntityWrapper<NewsEntity>()
.eq("news_name", news.getNewsName())
.eq("news_types", news.getNewsTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
NewsEntity newsEntity = newsService.selectOne(queryWrapper);
if(newsEntity==null){
news.setInsertTime(new Date());
news.setCreateTime(new Date());
newsService.insert(news);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}

@ -0,0 +1,167 @@
package com.controller;
import java.util.Arrays;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.UsersEntity;
import com.service.TokenService;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*/
@RequestMapping("users")
@RestController
public class UsersController {
@Autowired
private UsersService usersService;
@Autowired
private TokenService tokenService;
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
UsersEntity user = usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", username));
if(user==null || !user.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
R r = R.ok();
r.put("token", token);
r.put("role",user.getRole());
r.put("userId",user.getId());
return r;
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody UsersEntity user){
// ValidatorUtils.validateEntity(user);
if(usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
usersService.insert(user);
return R.ok();
}
/**
* 退
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
*
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
UsersEntity user = usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", username));
if(user==null) {
return R.error("账号不存在");
}
user.setPassword("123456");
usersService.update(user,null);
return R.ok("密码已重置为123456");
}
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,UsersEntity user){
EntityWrapper<UsersEntity> ew = new EntityWrapper<UsersEntity>();
PageUtils page = usersService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/list")
public R list( UsersEntity user){
EntityWrapper<UsersEntity> ew = new EntityWrapper<UsersEntity>();
ew.allEq(MPUtil.allEQMapPre( user, "user"));
return R.ok().put("data", usersService.selectListView(ew));
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
UsersEntity user = usersService.selectById(id);
return R.ok().put("data", user);
}
/**
* session
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Integer id = (Integer)request.getSession().getAttribute("userId");
UsersEntity user = usersService.selectById(id);
return R.ok().put("data", user);
}
/**
*
*/
@PostMapping("/save")
public R save(@RequestBody UsersEntity user){
// ValidatorUtils.validateEntity(user);
if(usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
usersService.insert(user);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody UsersEntity user){
// ValidatorUtils.validateEntity(user);
usersService.updateById(user);//全部更新
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
usersService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,340 @@
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("/xinlijiankangCollection")
public class XinlijiankangCollectionController {
private static final Logger logger = LoggerFactory.getLogger(XinlijiankangCollectionController.class);
private static final String TABLE_NAME = "xinlijiankangCollection";
@Autowired
private XinlijiankangCollectionService xinlijiankangCollectionService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表非注册的service
@Autowired
private XinlijiankangService xinlijiankangService;
//注册表service
@Autowired
private YonghuService yonghuService;
@Autowired
private ZhixunshiService zhixunshiService;
/**
*
*/
@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("zhixunshiId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = xinlijiankangCollectionService.queryPage(params);
//字典表数据转换
List<XinlijiankangCollectionView> list =(List<XinlijiankangCollectionView>)page.getList();
for(XinlijiankangCollectionView 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);
XinlijiankangCollectionEntity xinlijiankangCollection = xinlijiankangCollectionService.selectById(id);
if(xinlijiankangCollection !=null){
//entity转view
XinlijiankangCollectionView view = new XinlijiankangCollectionView();
BeanUtils.copyProperties( xinlijiankangCollection , view );//把实体数据重构到view中
//级联表 用户
//级联表
YonghuEntity yonghu = yonghuService.selectById(xinlijiankangCollection.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setYonghuId(yonghu.getId());
}
//级联表 心理健康
//级联表
XinlijiankangEntity xinlijiankang = xinlijiankangService.selectById(xinlijiankangCollection.getXinlijiankangId());
if(xinlijiankang != null){
BeanUtils.copyProperties( xinlijiankang , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setXinlijiankangId(xinlijiankang.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody XinlijiankangCollectionEntity xinlijiankangCollection, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,xinlijiankangCollection:{}",this.getClass().getName(),xinlijiankangCollection.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("用户".equals(role))
xinlijiankangCollection.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<XinlijiankangCollectionEntity> queryWrapper = new EntityWrapper<XinlijiankangCollectionEntity>()
.eq("xinlijiankang_id", xinlijiankangCollection.getXinlijiankangId())
.eq("yonghu_id", xinlijiankangCollection.getYonghuId())
.eq("xinlijiankang_collection_types", xinlijiankangCollection.getXinlijiankangCollectionTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
XinlijiankangCollectionEntity xinlijiankangCollectionEntity = xinlijiankangCollectionService.selectOne(queryWrapper);
if(xinlijiankangCollectionEntity==null){
xinlijiankangCollection.setInsertTime(new Date());
xinlijiankangCollection.setCreateTime(new Date());
xinlijiankangCollectionService.insert(xinlijiankangCollection);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody XinlijiankangCollectionEntity xinlijiankangCollection, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,xinlijiankangCollection:{}",this.getClass().getName(),xinlijiankangCollection.toString());
XinlijiankangCollectionEntity oldXinlijiankangCollectionEntity = xinlijiankangCollectionService.selectById(xinlijiankangCollection.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// xinlijiankangCollection.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
//根据字段查询是否有相同数据
Wrapper<XinlijiankangCollectionEntity> queryWrapper = new EntityWrapper<XinlijiankangCollectionEntity>()
.notIn("id",xinlijiankangCollection.getId())
.andNew()
.eq("xinlijiankang_id", xinlijiankangCollection.getXinlijiankangId())
.eq("yonghu_id", xinlijiankangCollection.getYonghuId())
.eq("xinlijiankang_collection_types", xinlijiankangCollection.getXinlijiankangCollectionTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
XinlijiankangCollectionEntity xinlijiankangCollectionEntity = xinlijiankangCollectionService.selectOne(queryWrapper);
if(xinlijiankangCollectionEntity==null){
xinlijiankangCollectionService.updateById(xinlijiankangCollection);//根据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<XinlijiankangCollectionEntity> oldXinlijiankangCollectionList =xinlijiankangCollectionService.selectBatchIds(Arrays.asList(ids));//要删除的数据
xinlijiankangCollectionService.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<XinlijiankangCollectionEntity> xinlijiankangCollectionList = 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){
//循环
XinlijiankangCollectionEntity xinlijiankangCollectionEntity = new XinlijiankangCollectionEntity();
// xinlijiankangCollectionEntity.setXinlijiankangId(Integer.valueOf(data.get(0))); //心理健康 要改的
// xinlijiankangCollectionEntity.setYonghuId(Integer.valueOf(data.get(0))); //用户 要改的
// xinlijiankangCollectionEntity.setXinlijiankangCollectionTypes(Integer.valueOf(data.get(0))); //类型 要改的
// xinlijiankangCollectionEntity.setInsertTime(date);//时间
// xinlijiankangCollectionEntity.setCreateTime(date);//时间
xinlijiankangCollectionList.add(xinlijiankangCollectionEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
xinlijiankangCollectionService.insertBatch(xinlijiankangCollectionList);
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 = xinlijiankangCollectionService.queryPage(params);
//字典表数据转换
List<XinlijiankangCollectionView> list =(List<XinlijiankangCollectionView>)page.getList();
for(XinlijiankangCollectionView 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);
XinlijiankangCollectionEntity xinlijiankangCollection = xinlijiankangCollectionService.selectById(id);
if(xinlijiankangCollection !=null){
//entity转view
XinlijiankangCollectionView view = new XinlijiankangCollectionView();
BeanUtils.copyProperties( xinlijiankangCollection , view );//把实体数据重构到view中
//级联表
YonghuEntity yonghu = yonghuService.selectById(xinlijiankangCollection.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//级联表
XinlijiankangEntity xinlijiankang = xinlijiankangService.selectById(xinlijiankangCollection.getXinlijiankangId());
if(xinlijiankang != null){
BeanUtils.copyProperties( xinlijiankang , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setXinlijiankangId(xinlijiankang.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody XinlijiankangCollectionEntity xinlijiankangCollection, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,xinlijiankangCollection:{}",this.getClass().getName(),xinlijiankangCollection.toString());
Wrapper<XinlijiankangCollectionEntity> queryWrapper = new EntityWrapper<XinlijiankangCollectionEntity>()
.eq("xinlijiankang_id", xinlijiankangCollection.getXinlijiankangId())
.eq("yonghu_id", xinlijiankangCollection.getYonghuId())
.eq("xinlijiankang_collection_types", xinlijiankangCollection.getXinlijiankangCollectionTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
XinlijiankangCollectionEntity xinlijiankangCollectionEntity = xinlijiankangCollectionService.selectOne(queryWrapper);
if(xinlijiankangCollectionEntity==null){
xinlijiankangCollection.setInsertTime(new Date());
xinlijiankangCollection.setCreateTime(new Date());
xinlijiankangCollectionService.insert(xinlijiankangCollection);
return R.ok();
}else {
return R.error(511,"您已经收藏过了");
}
}
}

@ -0,0 +1,337 @@
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("/xinlijiankang")
public class XinlijiankangController {
private static final Logger logger = LoggerFactory.getLogger(XinlijiankangController.class);
private static final String TABLE_NAME = "xinlijiankang";
@Autowired
private XinlijiankangService xinlijiankangService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表非注册的service
//注册表service
@Autowired
private YonghuService yonghuService;
@Autowired
private ZhixunshiService zhixunshiService;
/**
*
*/
@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("zhixunshiId",request.getSession().getAttribute("userId"));
params.put("xinlijiankangDeleteStart",1);params.put("xinlijiankangDeleteEnd",1);
CommonUtil.checkMap(params);
PageUtils page = xinlijiankangService.queryPage(params);
//字典表数据转换
List<XinlijiankangView> list =(List<XinlijiankangView>)page.getList();
for(XinlijiankangView 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);
XinlijiankangEntity xinlijiankang = xinlijiankangService.selectById(id);
if(xinlijiankang !=null){
//entity转view
XinlijiankangView view = new XinlijiankangView();
BeanUtils.copyProperties( xinlijiankang , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody XinlijiankangEntity xinlijiankang, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,xinlijiankang:{}",this.getClass().getName(),xinlijiankang.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<XinlijiankangEntity> queryWrapper = new EntityWrapper<XinlijiankangEntity>()
.eq("xinlijiankang_name", xinlijiankang.getXinlijiankangName())
.eq("xinlijiankang_video", xinlijiankang.getXinlijiankangVideo())
.eq("xinlijiankang_types", xinlijiankang.getXinlijiankangTypes())
.eq("zan_number", xinlijiankang.getZanNumber())
.eq("cai_number", xinlijiankang.getCaiNumber())
.eq("xinlijiankang_delete", xinlijiankang.getXinlijiankangDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
XinlijiankangEntity xinlijiankangEntity = xinlijiankangService.selectOne(queryWrapper);
if(xinlijiankangEntity==null){
xinlijiankang.setXinlijiankangDelete(1);
xinlijiankang.setCreateTime(new Date());
xinlijiankangService.insert(xinlijiankang);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody XinlijiankangEntity xinlijiankang, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,xinlijiankang:{}",this.getClass().getName(),xinlijiankang.toString());
XinlijiankangEntity oldXinlijiankangEntity = xinlijiankangService.selectById(xinlijiankang.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<XinlijiankangEntity> queryWrapper = new EntityWrapper<XinlijiankangEntity>()
.notIn("id",xinlijiankang.getId())
.andNew()
.eq("xinlijiankang_name", xinlijiankang.getXinlijiankangName())
.eq("xinlijiankang_video", xinlijiankang.getXinlijiankangVideo())
.eq("xinlijiankang_types", xinlijiankang.getXinlijiankangTypes())
.eq("zan_number", xinlijiankang.getZanNumber())
.eq("cai_number", xinlijiankang.getCaiNumber())
.eq("xinlijiankang_delete", xinlijiankang.getXinlijiankangDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
XinlijiankangEntity xinlijiankangEntity = xinlijiankangService.selectOne(queryWrapper);
if("".equals(xinlijiankang.getXinlijiankangPhoto()) || "null".equals(xinlijiankang.getXinlijiankangPhoto())){
xinlijiankang.setXinlijiankangPhoto(null);
}
if("".equals(xinlijiankang.getXinlijiankangVideo()) || "null".equals(xinlijiankang.getXinlijiankangVideo())){
xinlijiankang.setXinlijiankangVideo(null);
}
if(xinlijiankangEntity==null){
xinlijiankangService.updateById(xinlijiankang);//根据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<XinlijiankangEntity> oldXinlijiankangList =xinlijiankangService.selectBatchIds(Arrays.asList(ids));//要删除的数据
ArrayList<XinlijiankangEntity> list = new ArrayList<>();
for(Integer id:ids){
XinlijiankangEntity xinlijiankangEntity = new XinlijiankangEntity();
xinlijiankangEntity.setId(id);
xinlijiankangEntity.setXinlijiankangDelete(2);
list.add(xinlijiankangEntity);
}
if(list != null && list.size() >0){
xinlijiankangService.updateBatchById(list);
}
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<XinlijiankangEntity> xinlijiankangList = 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){
//循环
XinlijiankangEntity xinlijiankangEntity = new XinlijiankangEntity();
// xinlijiankangEntity.setXinlijiankangName(data.get(0)); //心理健康标题 要改的
// xinlijiankangEntity.setXinlijiankangPhoto("");//详情和图片
// xinlijiankangEntity.setXinlijiankangVideo(data.get(0)); //心理健康视频 要改的
// xinlijiankangEntity.setXinlijiankangTypes(Integer.valueOf(data.get(0))); //心理健康类型 要改的
// xinlijiankangEntity.setZanNumber(Integer.valueOf(data.get(0))); //赞 要改的
// xinlijiankangEntity.setCaiNumber(Integer.valueOf(data.get(0))); //踩 要改的
// xinlijiankangEntity.setXinlijiankangDelete(1);//逻辑删除字段
// xinlijiankangEntity.setXinlijiankangContent("");//详情和图片
// xinlijiankangEntity.setCreateTime(date);//时间
xinlijiankangList.add(xinlijiankangEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
xinlijiankangService.insertBatch(xinlijiankangList);
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 = xinlijiankangService.queryPage(params);
//字典表数据转换
List<XinlijiankangView> list =(List<XinlijiankangView>)page.getList();
for(XinlijiankangView 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);
XinlijiankangEntity xinlijiankang = xinlijiankangService.selectById(id);
if(xinlijiankang !=null){
//entity转view
XinlijiankangView view = new XinlijiankangView();
BeanUtils.copyProperties( xinlijiankang , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody XinlijiankangEntity xinlijiankang, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,xinlijiankang:{}",this.getClass().getName(),xinlijiankang.toString());
Wrapper<XinlijiankangEntity> queryWrapper = new EntityWrapper<XinlijiankangEntity>()
.eq("xinlijiankang_name", xinlijiankang.getXinlijiankangName())
.eq("xinlijiankang_video", xinlijiankang.getXinlijiankangVideo())
.eq("xinlijiankang_types", xinlijiankang.getXinlijiankangTypes())
.eq("zan_number", xinlijiankang.getZanNumber())
.eq("cai_number", xinlijiankang.getCaiNumber())
.eq("xinlijiankang_delete", xinlijiankang.getXinlijiankangDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
XinlijiankangEntity xinlijiankangEntity = xinlijiankangService.selectOne(queryWrapper);
if(xinlijiankangEntity==null){
xinlijiankang.setXinlijiankangDelete(1);
xinlijiankang.setCreateTime(new Date());
xinlijiankangService.insert(xinlijiankang);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}

@ -0,0 +1,317 @@
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("/xinlijiankangLiuyan")
public class XinlijiankangLiuyanController {
private static final Logger logger = LoggerFactory.getLogger(XinlijiankangLiuyanController.class);
private static final String TABLE_NAME = "xinlijiankangLiuyan";
@Autowired
private XinlijiankangLiuyanService xinlijiankangLiuyanService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表非注册的service
@Autowired
private XinlijiankangService xinlijiankangService;
//注册表service
@Autowired
private YonghuService yonghuService;
@Autowired
private ZhixunshiService zhixunshiService;
/**
*
*/
@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("zhixunshiId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = xinlijiankangLiuyanService.queryPage(params);
//字典表数据转换
List<XinlijiankangLiuyanView> list =(List<XinlijiankangLiuyanView>)page.getList();
for(XinlijiankangLiuyanView 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);
XinlijiankangLiuyanEntity xinlijiankangLiuyan = xinlijiankangLiuyanService.selectById(id);
if(xinlijiankangLiuyan !=null){
//entity转view
XinlijiankangLiuyanView view = new XinlijiankangLiuyanView();
BeanUtils.copyProperties( xinlijiankangLiuyan , view );//把实体数据重构到view中
//级联表 用户
//级联表
YonghuEntity yonghu = yonghuService.selectById(xinlijiankangLiuyan.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setYonghuId(yonghu.getId());
}
//级联表 心理健康
//级联表
XinlijiankangEntity xinlijiankang = xinlijiankangService.selectById(xinlijiankangLiuyan.getXinlijiankangId());
if(xinlijiankang != null){
BeanUtils.copyProperties( xinlijiankang , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setXinlijiankangId(xinlijiankang.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody XinlijiankangLiuyanEntity xinlijiankangLiuyan, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,xinlijiankangLiuyan:{}",this.getClass().getName(),xinlijiankangLiuyan.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("用户".equals(role))
xinlijiankangLiuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
xinlijiankangLiuyan.setCreateTime(new Date());
xinlijiankangLiuyan.setInsertTime(new Date());
xinlijiankangLiuyanService.insert(xinlijiankangLiuyan);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody XinlijiankangLiuyanEntity xinlijiankangLiuyan, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,xinlijiankangLiuyan:{}",this.getClass().getName(),xinlijiankangLiuyan.toString());
XinlijiankangLiuyanEntity oldXinlijiankangLiuyanEntity = xinlijiankangLiuyanService.selectById(xinlijiankangLiuyan.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// xinlijiankangLiuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
//根据字段查询是否有相同数据
Wrapper<XinlijiankangLiuyanEntity> queryWrapper = new EntityWrapper<XinlijiankangLiuyanEntity>()
.eq("id",0)
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
XinlijiankangLiuyanEntity xinlijiankangLiuyanEntity = xinlijiankangLiuyanService.selectOne(queryWrapper);
xinlijiankangLiuyan.setUpdateTime(new Date());
if(xinlijiankangLiuyanEntity==null){
xinlijiankangLiuyanService.updateById(xinlijiankangLiuyan);//根据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<XinlijiankangLiuyanEntity> oldXinlijiankangLiuyanList =xinlijiankangLiuyanService.selectBatchIds(Arrays.asList(ids));//要删除的数据
xinlijiankangLiuyanService.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<XinlijiankangLiuyanEntity> xinlijiankangLiuyanList = 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){
//循环
XinlijiankangLiuyanEntity xinlijiankangLiuyanEntity = new XinlijiankangLiuyanEntity();
// xinlijiankangLiuyanEntity.setXinlijiankangId(Integer.valueOf(data.get(0))); //心理健康 要改的
// xinlijiankangLiuyanEntity.setYonghuId(Integer.valueOf(data.get(0))); //用户 要改的
// xinlijiankangLiuyanEntity.setXinlijiankangLiuyanText(data.get(0)); //留言内容 要改的
// xinlijiankangLiuyanEntity.setInsertTime(date);//时间
// xinlijiankangLiuyanEntity.setReplyText(data.get(0)); //回复内容 要改的
// xinlijiankangLiuyanEntity.setUpdateTime(sdf.parse(data.get(0))); //回复时间 要改的
// xinlijiankangLiuyanEntity.setCreateTime(date);//时间
xinlijiankangLiuyanList.add(xinlijiankangLiuyanEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
xinlijiankangLiuyanService.insertBatch(xinlijiankangLiuyanList);
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 = xinlijiankangLiuyanService.queryPage(params);
//字典表数据转换
List<XinlijiankangLiuyanView> list =(List<XinlijiankangLiuyanView>)page.getList();
for(XinlijiankangLiuyanView 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);
XinlijiankangLiuyanEntity xinlijiankangLiuyan = xinlijiankangLiuyanService.selectById(id);
if(xinlijiankangLiuyan !=null){
//entity转view
XinlijiankangLiuyanView view = new XinlijiankangLiuyanView();
BeanUtils.copyProperties( xinlijiankangLiuyan , view );//把实体数据重构到view中
//级联表
YonghuEntity yonghu = yonghuService.selectById(xinlijiankangLiuyan.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//级联表
XinlijiankangEntity xinlijiankang = xinlijiankangService.selectById(xinlijiankangLiuyan.getXinlijiankangId());
if(xinlijiankang != null){
BeanUtils.copyProperties( xinlijiankang , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setXinlijiankangId(xinlijiankang.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody XinlijiankangLiuyanEntity xinlijiankangLiuyan, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,xinlijiankangLiuyan:{}",this.getClass().getName(),xinlijiankangLiuyan.toString());
xinlijiankangLiuyan.setCreateTime(new Date());
xinlijiankangLiuyan.setInsertTime(new Date());
xinlijiankangLiuyanService.insert(xinlijiankangLiuyan);
return R.ok();
}
}

@ -0,0 +1,500 @@
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 DictionaryService dictionaryService;
//级联表非注册的service
//注册表service
@Autowired
private ZhixunshiService zhixunshiService;
/**
*
*/
@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("zhixunshiId",request.getSession().getAttribute("userId"));
params.put("yonghuDeleteStart",1);params.put("yonghuDeleteEnd",1);
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())
.andNew()
.eq("yonghu_delete", 1)
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
if(yonghuEntity==null){
yonghu.setYonghuDelete(1);
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,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
.notIn("id",yonghu.getId())
.andNew()
.eq("username", yonghu.getUsername())
.or()
.eq("yonghu_phone", yonghu.getYonghuPhone())
.or()
.eq("yonghu_id_number", yonghu.getYonghuIdNumber())
.andNew()
.eq("yonghu_delete", 1)
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
if("".equals(yonghu.getYonghuPhoto()) || "null".equals(yonghu.getYonghuPhoto())){
yonghu.setYonghuPhoto(null);
}
if(yonghuEntity==null){
yonghuService.updateById(yonghu);//根据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<YonghuEntity> oldYonghuList =yonghuService.selectBatchIds(Arrays.asList(ids));//要删除的数据
ArrayList<YonghuEntity> list = new ArrayList<>();
for(Integer id:ids){
YonghuEntity yonghuEntity = new YonghuEntity();
yonghuEntity.setId(id);
yonghuEntity.setYonghuDelete(2);
list.add(yonghuEntity);
}
if(list != null && list.size() >0){
yonghuService.updateBatchById(list);
}
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<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.setYonghuName(data.get(0)); //用户姓名 要改的
// yonghuEntity.setSexTypes(Integer.valueOf(data.get(0))); //性别 要改的
// yonghuEntity.setYonghuPhoto("");//详情和图片
// yonghuEntity.setYonghuIdNumber(data.get(0)); //身份证号 要改的
// yonghuEntity.setYonghuPhone(data.get(0)); //联系方式 要改的
// yonghuEntity.setYonghuEmail(data.get(0)); //电子邮箱 要改的
// yonghuEntity.setYonghuDelete(1);//逻辑删除字段
// 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("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);
}
//联系方式
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);
}
}
//查询是否重复
//账户
List<YonghuEntity> yonghuEntities_username = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("username", seachFields.get("username")).eq("yonghu_delete", 1));
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_yonghuIdNumber = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("yonghu_id_number", seachFields.get("yonghuIdNumber")).eq("yonghu_delete", 1));
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());
}
//联系方式
List<YonghuEntity> yonghuEntities_yonghuPhone = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("yonghu_phone", seachFields.get("yonghuPhone")).eq("yonghu_delete", 1));
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());
}
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("账号或密码不正确");
else if(yonghu.getYonghuDelete() != 1)
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_id_number", yonghu.getYonghuIdNumber())
.or()
.eq("yonghu_phone", yonghu.getYonghuPhone())
.andNew()
.eq("yonghu_delete", 1)
;
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
if(yonghuEntity != null)
return R.error("账户或者联系方式或者身份证号已经被使用");
yonghu.setYonghuDelete(1);
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();
}
/**
*
*/
@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");
boolean b = yonghuService.updateById(yonghu);
if(!b){
return R.error();
}
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") Long 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_id_number", yonghu.getYonghuIdNumber())
.or()
.eq("yonghu_phone", yonghu.getYonghuPhone())
.andNew()
.eq("yonghu_delete", 1)
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
if(yonghuEntity==null){
yonghu.setYonghuDelete(1);
yonghu.setCreateTime(new Date());
yonghu.setPassword("123456");
yonghuService.insert(yonghu);
return R.ok();
}else {
return R.error(511,"账户或者联系方式或者身份证号已经被使用");
}
}
}

@ -0,0 +1,354 @@
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("/zhixunshiChat")
public class ZhixunshiChatController {
private static final Logger logger = LoggerFactory.getLogger(ZhixunshiChatController.class);
private static final String TABLE_NAME = "zhixunshiChat";
@Autowired
private ZhixunshiChatService zhixunshiChatService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表非注册的service
//注册表service
@Autowired
private YonghuService yonghuService;
@Autowired
private ZhixunshiService zhixunshiService;
/**
*
*/
@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("zhixunshiId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = zhixunshiChatService.queryPage(params);
//字典表数据转换
List<ZhixunshiChatView> list =(List<ZhixunshiChatView>)page.getList();
for(ZhixunshiChatView 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);
ZhixunshiChatEntity zhixunshiChat = zhixunshiChatService.selectById(id);
if(zhixunshiChat !=null){
//entity转view
ZhixunshiChatView view = new ZhixunshiChatView();
BeanUtils.copyProperties( zhixunshiChat , view );//把实体数据重构到view中
//级联表 咨询师
//级联表
ZhixunshiEntity zhixunshi = zhixunshiService.selectById(zhixunshiChat.getZhixunshiId());
if(zhixunshi != null){
BeanUtils.copyProperties( zhixunshi , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "zhixunshiId"
, "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setZhixunshiId(zhixunshi.getId());
}
//级联表 用户
//级联表
YonghuEntity yonghu = yonghuService.selectById(zhixunshiChat.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "zhixunshiId"
, "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 ZhixunshiChatEntity zhixunshiChat, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,zhixunshiChat:{}",this.getClass().getName(),zhixunshiChat.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("咨询师".equals(role))
zhixunshiChat.setZhixunshiId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
else if("用户".equals(role))
zhixunshiChat.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<ZhixunshiChatEntity> queryWrapper = new EntityWrapper<ZhixunshiChatEntity>()
.eq("yonghu_id", zhixunshiChat.getYonghuId())
.eq("zhixunshi_id", zhixunshiChat.getZhixunshiId())
.eq("zhuangtai_types", zhixunshiChat.getZhuangtaiTypes())
.eq("zhixunshi_chat_types", zhixunshiChat.getZhixunshiChatTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ZhixunshiChatEntity zhixunshiChatEntity = zhixunshiChatService.selectOne(queryWrapper);
if(zhixunshiChatEntity==null){
zhixunshiChat.setInsertTime(new Date());
zhixunshiChat.setCreateTime(new Date());
zhixunshiChatService.insert(zhixunshiChat);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody ZhixunshiChatEntity zhixunshiChat, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,zhixunshiChat:{}",this.getClass().getName(),zhixunshiChat.toString());
ZhixunshiChatEntity oldZhixunshiChatEntity = zhixunshiChatService.selectById(zhixunshiChat.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("咨询师".equals(role))
// zhixunshiChat.setZhixunshiId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
// else if("用户".equals(role))
// zhixunshiChat.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
//根据字段查询是否有相同数据
Wrapper<ZhixunshiChatEntity> queryWrapper = new EntityWrapper<ZhixunshiChatEntity>()
.notIn("id",zhixunshiChat.getId())
.andNew()
.eq("yonghu_id", zhixunshiChat.getYonghuId())
.eq("zhixunshi_id", zhixunshiChat.getZhixunshiId())
.eq("zhuangtai_types", zhixunshiChat.getZhuangtaiTypes())
.eq("zhixunshi_chat_types", zhixunshiChat.getZhixunshiChatTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ZhixunshiChatEntity zhixunshiChatEntity = zhixunshiChatService.selectOne(queryWrapper);
if(zhixunshiChatEntity==null){
zhixunshiChatService.updateById(zhixunshiChat);//根据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<ZhixunshiChatEntity> oldZhixunshiChatList =zhixunshiChatService.selectBatchIds(Arrays.asList(ids));//要删除的数据
zhixunshiChatService.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<ZhixunshiChatEntity> zhixunshiChatList = 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){
//循环
ZhixunshiChatEntity zhixunshiChatEntity = new ZhixunshiChatEntity();
// zhixunshiChatEntity.setYonghuId(Integer.valueOf(data.get(0))); //提问人 要改的
// zhixunshiChatEntity.setZhixunshiId(Integer.valueOf(data.get(0))); //回答人 要改的
// zhixunshiChatEntity.setZhixunshiChatIssueText(data.get(0)); //问题 要改的
// zhixunshiChatEntity.setIssueTime(sdf.parse(data.get(0))); //问题时间 要改的
// zhixunshiChatEntity.setZhixunshiChatReplyText(data.get(0)); //回复 要改的
// zhixunshiChatEntity.setReplyTime(sdf.parse(data.get(0))); //回复时间 要改的
// zhixunshiChatEntity.setZhuangtaiTypes(Integer.valueOf(data.get(0))); //状态 要改的
// zhixunshiChatEntity.setZhixunshiChatTypes(Integer.valueOf(data.get(0))); //数据类型 要改的
// zhixunshiChatEntity.setInsertTime(date);//时间
// zhixunshiChatEntity.setCreateTime(date);//时间
zhixunshiChatList.add(zhixunshiChatEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
zhixunshiChatService.insertBatch(zhixunshiChatList);
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 = zhixunshiChatService.queryPage(params);
//字典表数据转换
List<ZhixunshiChatView> list =(List<ZhixunshiChatView>)page.getList();
for(ZhixunshiChatView 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);
ZhixunshiChatEntity zhixunshiChat = zhixunshiChatService.selectById(id);
if(zhixunshiChat !=null){
//entity转view
ZhixunshiChatView view = new ZhixunshiChatView();
BeanUtils.copyProperties( zhixunshiChat , view );//把实体数据重构到view中
//级联表
ZhixunshiEntity zhixunshi = zhixunshiService.selectById(zhixunshiChat.getZhixunshiId());
if(zhixunshi != null){
BeanUtils.copyProperties( zhixunshi , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setZhixunshiId(zhixunshi.getId());
}
//级联表
YonghuEntity yonghu = yonghuService.selectById(zhixunshiChat.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 ZhixunshiChatEntity zhixunshiChat, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,zhixunshiChat:{}",this.getClass().getName(),zhixunshiChat.toString());
Wrapper<ZhixunshiChatEntity> queryWrapper = new EntityWrapper<ZhixunshiChatEntity>()
.eq("yonghu_id", zhixunshiChat.getYonghuId())
.eq("zhixunshi_id", zhixunshiChat.getZhixunshiId())
.eq("zhixunshi_chat_issue_text", zhixunshiChat.getZhixunshiChatIssueText())
.eq("zhixunshi_chat_reply_text", zhixunshiChat.getZhixunshiChatReplyText())
.eq("zhuangtai_types", zhixunshiChat.getZhuangtaiTypes())
.eq("zhixunshi_chat_types", zhixunshiChat.getZhixunshiChatTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ZhixunshiChatEntity zhixunshiChatEntity = zhixunshiChatService.selectOne(queryWrapper);
if(zhixunshiChatEntity==null){
zhixunshiChat.setInsertTime(new Date());
zhixunshiChat.setCreateTime(new Date());
zhixunshiChatService.insert(zhixunshiChat);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}

@ -0,0 +1,503 @@
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("/zhixunshi")
public class ZhixunshiController {
private static final Logger logger = LoggerFactory.getLogger(ZhixunshiController.class);
private static final String TABLE_NAME = "zhixunshi";
@Autowired
private ZhixunshiService zhixunshiService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表非注册的service
//注册表service
@Autowired
private YonghuService yonghuService;
/**
*
*/
@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("zhixunshiId",request.getSession().getAttribute("userId"));
params.put("zhixunshiDeleteStart",1);params.put("zhixunshiDeleteEnd",1);
CommonUtil.checkMap(params);
PageUtils page = zhixunshiService.queryPage(params);
//字典表数据转换
List<ZhixunshiView> list =(List<ZhixunshiView>)page.getList();
for(ZhixunshiView 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);
ZhixunshiEntity zhixunshi = zhixunshiService.selectById(id);
if(zhixunshi !=null){
//entity转view
ZhixunshiView view = new ZhixunshiView();
BeanUtils.copyProperties( zhixunshi , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody ZhixunshiEntity zhixunshi, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,zhixunshi:{}",this.getClass().getName(),zhixunshi.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<ZhixunshiEntity> queryWrapper = new EntityWrapper<ZhixunshiEntity>()
.eq("username", zhixunshi.getUsername())
.or()
.eq("zhixunshi_phone", zhixunshi.getZhixunshiPhone())
.or()
.eq("zhixunshi_id_number", zhixunshi.getZhixunshiIdNumber())
.andNew()
.eq("zhixunshi_delete", 1)
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ZhixunshiEntity zhixunshiEntity = zhixunshiService.selectOne(queryWrapper);
if(zhixunshiEntity==null){
zhixunshi.setZhixunshiDelete(1);
zhixunshi.setCreateTime(new Date());
zhixunshi.setPassword("123456");
zhixunshiService.insert(zhixunshi);
return R.ok();
}else {
return R.error(511,"账户或者联系方式或者身份证号已经被使用");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody ZhixunshiEntity zhixunshi, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,zhixunshi:{}",this.getClass().getName(),zhixunshi.toString());
ZhixunshiEntity oldZhixunshiEntity = zhixunshiService.selectById(zhixunshi.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<ZhixunshiEntity> queryWrapper = new EntityWrapper<ZhixunshiEntity>()
.notIn("id",zhixunshi.getId())
.andNew()
.eq("username", zhixunshi.getUsername())
.or()
.eq("zhixunshi_phone", zhixunshi.getZhixunshiPhone())
.or()
.eq("zhixunshi_id_number", zhixunshi.getZhixunshiIdNumber())
.andNew()
.eq("zhixunshi_delete", 1)
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ZhixunshiEntity zhixunshiEntity = zhixunshiService.selectOne(queryWrapper);
if("".equals(zhixunshi.getZhixunshiPhoto()) || "null".equals(zhixunshi.getZhixunshiPhoto())){
zhixunshi.setZhixunshiPhoto(null);
}
if(zhixunshiEntity==null){
zhixunshiService.updateById(zhixunshi);//根据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<ZhixunshiEntity> oldZhixunshiList =zhixunshiService.selectBatchIds(Arrays.asList(ids));//要删除的数据
ArrayList<ZhixunshiEntity> list = new ArrayList<>();
for(Integer id:ids){
ZhixunshiEntity zhixunshiEntity = new ZhixunshiEntity();
zhixunshiEntity.setId(id);
zhixunshiEntity.setZhixunshiDelete(2);
list.add(zhixunshiEntity);
}
if(list != null && list.size() >0){
zhixunshiService.updateBatchById(list);
}
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<ZhixunshiEntity> zhixunshiList = 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){
//循环
ZhixunshiEntity zhixunshiEntity = new ZhixunshiEntity();
// zhixunshiEntity.setUsername(data.get(0)); //账户 要改的
// //zhixunshiEntity.setPassword("123456");//密码
// zhixunshiEntity.setZhixunshiName(data.get(0)); //咨询师姓名 要改的
// zhixunshiEntity.setSexTypes(Integer.valueOf(data.get(0))); //性别 要改的
// zhixunshiEntity.setZhixunshiPhoto("");//详情和图片
// zhixunshiEntity.setZhixunshiIdNumber(data.get(0)); //身份证号 要改的
// zhixunshiEntity.setZhixunshiPhone(data.get(0)); //联系方式 要改的
// zhixunshiEntity.setZhixunshiEmail(data.get(0)); //电子邮箱 要改的
// zhixunshiEntity.setZhixunshiCongye(data.get(0)); //从业时长 要改的
// zhixunshiEntity.setZhixunshiShanchang(data.get(0)); //擅长 要改的
// zhixunshiEntity.setZhixunshiContent("");//详情和图片
// zhixunshiEntity.setZhixunshiDelete(1);//逻辑删除字段
// zhixunshiEntity.setCreateTime(date);//时间
zhixunshiList.add(zhixunshiEntity);
//把要查询是否重复的字段放入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("zhixunshiIdNumber")){
List<String> zhixunshiIdNumber = seachFields.get("zhixunshiIdNumber");
zhixunshiIdNumber.add(data.get(0));//要改的
}else{
List<String> zhixunshiIdNumber = new ArrayList<>();
zhixunshiIdNumber.add(data.get(0));//要改的
seachFields.put("zhixunshiIdNumber",zhixunshiIdNumber);
}
//联系方式
if(seachFields.containsKey("zhixunshiPhone")){
List<String> zhixunshiPhone = seachFields.get("zhixunshiPhone");
zhixunshiPhone.add(data.get(0));//要改的
}else{
List<String> zhixunshiPhone = new ArrayList<>();
zhixunshiPhone.add(data.get(0));//要改的
seachFields.put("zhixunshiPhone",zhixunshiPhone);
}
}
//查询是否重复
//账户
List<ZhixunshiEntity> zhixunshiEntities_username = zhixunshiService.selectList(new EntityWrapper<ZhixunshiEntity>().in("username", seachFields.get("username")).eq("zhixunshi_delete", 1));
if(zhixunshiEntities_username.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(ZhixunshiEntity s:zhixunshiEntities_username){
repeatFields.add(s.getUsername());
}
return R.error(511,"数据库的该表中的 [账户] 字段已经存在 存在数据为:"+repeatFields.toString());
}
//身份证号
List<ZhixunshiEntity> zhixunshiEntities_zhixunshiIdNumber = zhixunshiService.selectList(new EntityWrapper<ZhixunshiEntity>().in("zhixunshi_id_number", seachFields.get("zhixunshiIdNumber")).eq("zhixunshi_delete", 1));
if(zhixunshiEntities_zhixunshiIdNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(ZhixunshiEntity s:zhixunshiEntities_zhixunshiIdNumber){
repeatFields.add(s.getZhixunshiIdNumber());
}
return R.error(511,"数据库的该表中的 [身份证号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
//联系方式
List<ZhixunshiEntity> zhixunshiEntities_zhixunshiPhone = zhixunshiService.selectList(new EntityWrapper<ZhixunshiEntity>().in("zhixunshi_phone", seachFields.get("zhixunshiPhone")).eq("zhixunshi_delete", 1));
if(zhixunshiEntities_zhixunshiPhone.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(ZhixunshiEntity s:zhixunshiEntities_zhixunshiPhone){
repeatFields.add(s.getZhixunshiPhone());
}
return R.error(511,"数据库的该表中的 [联系方式] 字段已经存在 存在数据为:"+repeatFields.toString());
}
zhixunshiService.insertBatch(zhixunshiList);
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) {
ZhixunshiEntity zhixunshi = zhixunshiService.selectOne(new EntityWrapper<ZhixunshiEntity>().eq("username", username));
if(zhixunshi==null || !zhixunshi.getPassword().equals(password))
return R.error("账号或密码不正确");
else if(zhixunshi.getZhixunshiDelete() != 1)
return R.error("账户已被删除");
String token = tokenService.generateToken(zhixunshi.getId(),username, "zhixunshi", "咨询师");
R r = R.ok();
r.put("token", token);
r.put("role","咨询师");
r.put("username",zhixunshi.getZhixunshiName());
r.put("tableName","zhixunshi");
r.put("userId",zhixunshi.getId());
return r;
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody ZhixunshiEntity zhixunshi, HttpServletRequest request) {
// ValidatorUtils.validateEntity(user);
Wrapper<ZhixunshiEntity> queryWrapper = new EntityWrapper<ZhixunshiEntity>()
.eq("username", zhixunshi.getUsername())
.or()
.eq("zhixunshi_id_number", zhixunshi.getZhixunshiIdNumber())
.or()
.eq("zhixunshi_phone", zhixunshi.getZhixunshiPhone())
.andNew()
.eq("zhixunshi_delete", 1)
;
ZhixunshiEntity zhixunshiEntity = zhixunshiService.selectOne(queryWrapper);
if(zhixunshiEntity != null)
return R.error("账户或者联系方式或者身份证号已经被使用");
zhixunshi.setZhixunshiDelete(1);
zhixunshi.setCreateTime(new Date());
zhixunshiService.insert(zhixunshi);
return R.ok();
}
/**
*
*/
@GetMapping(value = "/resetPassword")
public R resetPassword(Integer id, HttpServletRequest request) {
ZhixunshiEntity zhixunshi = zhixunshiService.selectById(id);
zhixunshi.setPassword("123456");
zhixunshiService.updateById(zhixunshi);
return R.ok();
}
/**
*
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request) {
ZhixunshiEntity zhixunshi = zhixunshiService.selectOne(new EntityWrapper<ZhixunshiEntity>().eq("username", username));
if(zhixunshi!=null){
zhixunshi.setPassword("123456");
boolean b = zhixunshiService.updateById(zhixunshi);
if(!b){
return R.error();
}
return R.ok();
}else{
return R.error("账号不存在");
}
}
/**
* session
*/
@RequestMapping("/session")
public R getCurrZhixunshi(HttpServletRequest request){
Integer id = (Integer)request.getSession().getAttribute("userId");
ZhixunshiEntity zhixunshi = zhixunshiService.selectById(id);
if(zhixunshi !=null){
//entity转view
ZhixunshiView view = new ZhixunshiView();
BeanUtils.copyProperties( zhixunshi , 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 = zhixunshiService.queryPage(params);
//字典表数据转换
List<ZhixunshiView> list =(List<ZhixunshiView>)page.getList();
for(ZhixunshiView 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);
ZhixunshiEntity zhixunshi = zhixunshiService.selectById(id);
if(zhixunshi !=null){
//entity转view
ZhixunshiView view = new ZhixunshiView();
BeanUtils.copyProperties( zhixunshi , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody ZhixunshiEntity zhixunshi, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,zhixunshi:{}",this.getClass().getName(),zhixunshi.toString());
Wrapper<ZhixunshiEntity> queryWrapper = new EntityWrapper<ZhixunshiEntity>()
.eq("username", zhixunshi.getUsername())
.or()
.eq("zhixunshi_id_number", zhixunshi.getZhixunshiIdNumber())
.or()
.eq("zhixunshi_phone", zhixunshi.getZhixunshiPhone())
.andNew()
.eq("zhixunshi_delete", 1)
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ZhixunshiEntity zhixunshiEntity = zhixunshiService.selectOne(queryWrapper);
if(zhixunshiEntity==null){
zhixunshi.setZhixunshiDelete(1);
zhixunshi.setCreateTime(new Date());
zhixunshi.setPassword("123456");
zhixunshiService.insert(zhixunshi);
return R.ok();
}else {
return R.error(511,"账户或者联系方式或者身份证号已经被使用");
}
}
}

@ -0,0 +1,320 @@
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("/zhixunshiYuyue")
public class ZhixunshiYuyueController {
private static final Logger logger = LoggerFactory.getLogger(ZhixunshiYuyueController.class);
private static final String TABLE_NAME = "zhixunshiYuyue";
@Autowired
private ZhixunshiYuyueService zhixunshiYuyueService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表非注册的service
//注册表service
@Autowired
private YonghuService yonghuService;
@Autowired
private ZhixunshiService zhixunshiService;
/**
*
*/
@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("zhixunshiId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = zhixunshiYuyueService.queryPage(params);
//字典表数据转换
List<ZhixunshiYuyueView> list =(List<ZhixunshiYuyueView>)page.getList();
for(ZhixunshiYuyueView 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);
ZhixunshiYuyueEntity zhixunshiYuyue = zhixunshiYuyueService.selectById(id);
if(zhixunshiYuyue !=null){
//entity转view
ZhixunshiYuyueView view = new ZhixunshiYuyueView();
BeanUtils.copyProperties( zhixunshiYuyue , view );//把实体数据重构到view中
//级联表 咨询师
//级联表
ZhixunshiEntity zhixunshi = zhixunshiService.selectById(zhixunshiYuyue.getZhixunshiId());
if(zhixunshi != null){
BeanUtils.copyProperties( zhixunshi , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "zhixunshiId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setZhixunshiId(zhixunshi.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody ZhixunshiYuyueEntity zhixunshiYuyue, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,zhixunshiYuyue:{}",this.getClass().getName(),zhixunshiYuyue.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("咨询师".equals(role))
zhixunshiYuyue.setZhixunshiId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<ZhixunshiYuyueEntity> queryWrapper = new EntityWrapper<ZhixunshiYuyueEntity>()
.eq("zhixunshi_id", zhixunshiYuyue.getZhixunshiId())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ZhixunshiYuyueEntity zhixunshiYuyueEntity = zhixunshiYuyueService.selectOne(queryWrapper);
if(zhixunshiYuyueEntity==null){
zhixunshiYuyue.setInsertTime(new Date());
zhixunshiYuyue.setCreateTime(new Date());
zhixunshiYuyueService.insert(zhixunshiYuyue);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody ZhixunshiYuyueEntity zhixunshiYuyue, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,zhixunshiYuyue:{}",this.getClass().getName(),zhixunshiYuyue.toString());
ZhixunshiYuyueEntity oldZhixunshiYuyueEntity = zhixunshiYuyueService.selectById(zhixunshiYuyue.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("咨询师".equals(role))
// zhixunshiYuyue.setZhixunshiId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
//根据字段查询是否有相同数据
Wrapper<ZhixunshiYuyueEntity> queryWrapper = new EntityWrapper<ZhixunshiYuyueEntity>()
.notIn("id",zhixunshiYuyue.getId())
.andNew()
.eq("zhixunshi_id", zhixunshiYuyue.getZhixunshiId())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ZhixunshiYuyueEntity zhixunshiYuyueEntity = zhixunshiYuyueService.selectOne(queryWrapper);
if(zhixunshiYuyueEntity==null){
zhixunshiYuyueService.updateById(zhixunshiYuyue);//根据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<ZhixunshiYuyueEntity> oldZhixunshiYuyueList =zhixunshiYuyueService.selectBatchIds(Arrays.asList(ids));//要删除的数据
zhixunshiYuyueService.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<ZhixunshiYuyueEntity> zhixunshiYuyueList = 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){
//循环
ZhixunshiYuyueEntity zhixunshiYuyueEntity = new ZhixunshiYuyueEntity();
// zhixunshiYuyueEntity.setZhixunshiId(Integer.valueOf(data.get(0))); //咨询师 要改的
// zhixunshiYuyueEntity.setZhixunshiYuyueTime(sdf.parse(data.get(0))); //预约时间 要改的
// zhixunshiYuyueEntity.setZhixunshiYuyueText(data.get(0)); //备注 要改的
// zhixunshiYuyueEntity.setInsertTime(date);//时间
// zhixunshiYuyueEntity.setCreateTime(date);//时间
zhixunshiYuyueList.add(zhixunshiYuyueEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
zhixunshiYuyueService.insertBatch(zhixunshiYuyueList);
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 = zhixunshiYuyueService.queryPage(params);
//字典表数据转换
List<ZhixunshiYuyueView> list =(List<ZhixunshiYuyueView>)page.getList();
for(ZhixunshiYuyueView 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);
ZhixunshiYuyueEntity zhixunshiYuyue = zhixunshiYuyueService.selectById(id);
if(zhixunshiYuyue !=null){
//entity转view
ZhixunshiYuyueView view = new ZhixunshiYuyueView();
BeanUtils.copyProperties( zhixunshiYuyue , view );//把实体数据重构到view中
//级联表
ZhixunshiEntity zhixunshi = zhixunshiService.selectById(zhixunshiYuyue.getZhixunshiId());
if(zhixunshi != null){
BeanUtils.copyProperties( zhixunshi , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setZhixunshiId(zhixunshi.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody ZhixunshiYuyueEntity zhixunshiYuyue, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,zhixunshiYuyue:{}",this.getClass().getName(),zhixunshiYuyue.toString());
Wrapper<ZhixunshiYuyueEntity> queryWrapper = new EntityWrapper<ZhixunshiYuyueEntity>()
.eq("zhixunshi_id", zhixunshiYuyue.getZhixunshiId())
.eq("zhixunshi_yuyue_text", zhixunshiYuyue.getZhixunshiYuyueText())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ZhixunshiYuyueEntity zhixunshiYuyueEntity = zhixunshiYuyueService.selectOne(queryWrapper);
if(zhixunshiYuyueEntity==null){
zhixunshiYuyue.setInsertTime(new Date());
zhixunshiYuyue.setCreateTime(new Date());
zhixunshiYuyueService.insert(zhixunshiYuyue);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}

@ -0,0 +1,152 @@
package com.dao;
import java.util.List;
import java.util.Map;
/**
*
*/
public interface CommonDao{
List<String> getOption(Map<String, Object> params);
Map<String, Object> getFollowByOption(Map<String, Object> params);
List<String> getFollowByOption2(Map<String, Object> params);
void sh(Map<String, Object> params);
int remindCount(Map<String, Object> params);
Map<String, Object> selectCal(Map<String, Object> params);
/**
tableName
condition1 1
condition1Value 1
average
* */
Map<String, Object> queryScore(Map<String, Object> params);
List<Map<String, Object>> selectGroup(Map<String, Object> params);
List<Map<String, Object>> selectValue(Map<String, Object> params);
List<Map<String, Object>> chartBoth(Map<String, Object> params);
List<Map<String, Object>> chartOne(Map<String, Object> params);
/**
*
*/
/**
*
* @param params
* @return
*/
List<Map<String, Object>> newSelectGroupSum(Map<String, Object> params);
/**
*
* @param params
* @return
*/
List<Map<String, Object>> newSelectGroupCount(Map<String, Object> params);
/**
*
* @param params
* @return
*/
List<Map<String, Object>> newSelectDateGroupSum(Map<String, Object> params);
/**
*
* @param params
* @return
*/
List<Map<String, Object>> newSelectDateGroupCount(Map<String, Object> params);
/**
*
* @param params
* @return
*/
int plusCloumNumber(Map<String, Object> params);
/**
*
* @param params
* @return
*/
int reduceCloumNumber(Map<String, Object> params);
/**
*
* @param params
* @return
*/
int updateCloumValue(Map<String, Object> params);
/**
*
* --
--
-- --
-- --
--
-- --
-- --
--
-- --
-- --
--
--
-- --
-- --
--
-- --
-- --
--
-- --
-- --
*/
/**
*
--
--
-- 2 1
--
--
--
--
--
--
--
--
--
--
*/
/**
*
* @param params
* @return
*/
List<Map<String, Object>> barSum(Map<String, Object> params);
/**
*
* @param params
* @return
*/
List<Map<String, Object>> barCount(Map<String, Object> params);
}

@ -0,0 +1,12 @@
package com.dao;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.entity.ConfigEntity;
/**
*
*/
public interface ConfigDao extends BaseMapper<ConfigEntity> {
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.DictionaryEntity;
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.DictionaryView;
/**
* Dao
*
* @author
*/
public interface DictionaryDao extends BaseMapper<DictionaryEntity> {
List<DictionaryView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.ExampaperEntity;
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.ExampaperView;
/**
* Dao
*
* @author
*/
public interface ExampaperDao extends BaseMapper<ExampaperEntity> {
List<ExampaperView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.ExampapertopicEntity;
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.ExampapertopicView;
/**
* Dao
*
* @author
*/
public interface ExampapertopicDao extends BaseMapper<ExampapertopicEntity> {
List<ExampapertopicView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.ExamquestionEntity;
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.ExamquestionView;
/**
* Dao
*
* @author
*/
public interface ExamquestionDao extends BaseMapper<ExamquestionEntity> {
List<ExamquestionView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.ExamrecordEntity;
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.ExamrecordView;
/**
* Dao
*
* @author
*/
public interface ExamrecordDao extends BaseMapper<ExamrecordEntity> {
List<ExamrecordView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.ExamredetailsEntity;
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.ExamredetailsView;
/**
* Dao
*
* @author
*/
public interface ExamredetailsDao extends BaseMapper<ExamredetailsEntity> {
List<ExamredetailsView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.NewsEntity;
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.NewsView;
/**
* Dao
*
* @author
*/
public interface NewsDao extends BaseMapper<NewsEntity> {
List<NewsView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,22 @@
package com.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.entity.TokenEntity;
/**
* token
*/
public interface TokenDao extends BaseMapper<TokenEntity> {
List<TokenEntity> selectListView(@Param("ew") Wrapper<TokenEntity> wrapper);
List<TokenEntity> selectListView(Pagination page,@Param("ew") Wrapper<TokenEntity> wrapper);
}

@ -0,0 +1,22 @@
package com.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.entity.UsersEntity;
/**
*
*/
public interface UsersDao extends BaseMapper<UsersEntity> {
List<UsersEntity> selectListView(@Param("ew") Wrapper<UsersEntity> wrapper);
List<UsersEntity> selectListView(Pagination page, @Param("ew") Wrapper<UsersEntity> wrapper);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.XinlijiankangCollectionEntity;
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.XinlijiankangCollectionView;
/**
* Dao
*
* @author
*/
public interface XinlijiankangCollectionDao extends BaseMapper<XinlijiankangCollectionEntity> {
List<XinlijiankangCollectionView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.XinlijiankangEntity;
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.XinlijiankangView;
/**
* Dao
*
* @author
*/
public interface XinlijiankangDao extends BaseMapper<XinlijiankangEntity> {
List<XinlijiankangView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.XinlijiankangLiuyanEntity;
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.XinlijiankangLiuyanView;
/**
* Dao
*
* @author
*/
public interface XinlijiankangLiuyanDao extends BaseMapper<XinlijiankangLiuyanEntity> {
List<XinlijiankangLiuyanView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
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);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.ZhixunshiChatEntity;
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.ZhixunshiChatView;
/**
* Dao
*
* @author
*/
public interface ZhixunshiChatDao extends BaseMapper<ZhixunshiChatEntity> {
List<ZhixunshiChatView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.ZhixunshiEntity;
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.ZhixunshiView;
/**
* Dao
*
* @author
*/
public interface ZhixunshiDao extends BaseMapper<ZhixunshiEntity> {
List<ZhixunshiView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.ZhixunshiYuyueEntity;
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.ZhixunshiYuyueView;
/**
* Dao
*
* @author
*/
public interface ZhixunshiYuyueDao extends BaseMapper<ZhixunshiYuyueEntity> {
List<ZhixunshiYuyueView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,55 @@
package com.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
/**
* @author yangliyuan
* @version 202027 8:36:05
* :
*/
@TableName("config")
public class ConfigEntity implements Serializable{
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Long id;
/**
* key
*/
private String name;
/**
* value
*/
private String value;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

@ -0,0 +1,239 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("dictionary")
public class DictionaryEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public DictionaryEntity() {
}
public DictionaryEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@ColumnInfo(comment="主键",type="int(20)")
@TableField(value = "id")
private Integer id;
/**
*
*/
@ColumnInfo(comment="字段",type="varchar(200)")
@TableField(value = "dic_code")
private String dicCode;
/**
*
*/
@ColumnInfo(comment="字段名",type="varchar(200)")
@TableField(value = "dic_name")
private String dicName;
/**
*
*/
@ColumnInfo(comment="编码",type="int(11)")
@TableField(value = "code_index")
private Integer codeIndex;
/**
*
*/
@ColumnInfo(comment="编码名字",type="varchar(200)")
@TableField(value = "index_name")
private String indexName;
/**
* id
*/
@ColumnInfo(comment="父字段id",type="int(11)")
@TableField(value = "super_id")
private Integer superId;
/**
*
*/
@ColumnInfo(comment="备注",type="varchar(200)")
@TableField(value = "beizhu")
private String beizhu;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="创建时间",type="timestamp")
@TableField(value = "create_time",fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getDicCode() {
return dicCode;
}
/**
*
*/
public void setDicCode(String dicCode) {
this.dicCode = dicCode;
}
/**
*
*/
public String getDicName() {
return dicName;
}
/**
*
*/
public void setDicName(String dicName) {
this.dicName = dicName;
}
/**
*
*/
public Integer getCodeIndex() {
return codeIndex;
}
/**
*
*/
public void setCodeIndex(Integer codeIndex) {
this.codeIndex = codeIndex;
}
/**
*
*/
public String getIndexName() {
return indexName;
}
/**
*
*/
public void setIndexName(String indexName) {
this.indexName = indexName;
}
/**
* id
*/
public Integer getSuperId() {
return superId;
}
/**
* id
*/
public void setSuperId(Integer superId) {
this.superId = superId;
}
/**
*
*/
public String getBeizhu() {
return beizhu;
}
/**
*
*/
public void setBeizhu(String beizhu) {
this.beizhu = beizhu;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "Dictionary{" +
", id=" + id +
", dicCode=" + dicCode +
", dicName=" + dicName +
", codeIndex=" + codeIndex +
", indexName=" + indexName +
", superId=" + superId +
", beizhu=" + beizhu +
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,52 @@
package com.entity;
/**
*
*/
public class EIException extends RuntimeException {
private static final long serialVersionUID = 1L;
private String msg;
private int code = 500;
public EIException(String msg) {
super(msg);
this.msg = msg;
}
public EIException(String msg, Throwable e) {
super(msg, e);
this.msg = msg;
}
public EIException(String msg, int code) {
super(msg);
this.msg = msg;
this.code = code;
}
public EIException(String msg, int code, Throwable e) {
super(msg, e);
this.msg = msg;
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
}

@ -0,0 +1,239 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("exampaper")
public class ExampaperEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public ExampaperEntity() {
}
public ExampaperEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@ColumnInfo(comment="主键",type="int(20)")
@TableField(value = "id")
private Integer id;
/**
*
*/
@ColumnInfo(comment="心理测评名称",type="varchar(200)")
@TableField(value = "exampaper_name")
private String exampaperName;
/**
* ()
*/
@ColumnInfo(comment="心理测评时长(分钟)",type="int(11)")
@TableField(value = "exampaper_date")
private Integer exampaperDate;
/**
*
*/
@ColumnInfo(comment="心理测评总分数",type="int(20)")
@TableField(value = "exampaper_myscore")
private Integer exampaperMyscore;
/**
*
*/
@ColumnInfo(comment="心理测评状态",type="int(11)")
@TableField(value = "exampaper_types")
private Integer exampaperTypes;
/**
*
*/
@ColumnInfo(comment="组卷方式",type="int(11)")
@TableField(value = "zujuan_types")
private Integer zujuanTypes;
/**
* 1 2
*/
@ColumnInfo(comment="逻辑删除1代表未删除 2代表已删除",type="int(255)")
@TableField(value = "exampaper_delete")
private Integer exampaperDelete;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="创建时间",type="timestamp")
@TableField(value = "create_time",fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getExampaperName() {
return exampaperName;
}
/**
*
*/
public void setExampaperName(String exampaperName) {
this.exampaperName = exampaperName;
}
/**
* ()
*/
public Integer getExampaperDate() {
return exampaperDate;
}
/**
* ()
*/
public void setExampaperDate(Integer exampaperDate) {
this.exampaperDate = exampaperDate;
}
/**
*
*/
public Integer getExampaperMyscore() {
return exampaperMyscore;
}
/**
*
*/
public void setExampaperMyscore(Integer exampaperMyscore) {
this.exampaperMyscore = exampaperMyscore;
}
/**
*
*/
public Integer getExampaperTypes() {
return exampaperTypes;
}
/**
*
*/
public void setExampaperTypes(Integer exampaperTypes) {
this.exampaperTypes = exampaperTypes;
}
/**
*
*/
public Integer getZujuanTypes() {
return zujuanTypes;
}
/**
*
*/
public void setZujuanTypes(Integer zujuanTypes) {
this.zujuanTypes = zujuanTypes;
}
/**
* 1 2
*/
public Integer getExampaperDelete() {
return exampaperDelete;
}
/**
* 1 2
*/
public void setExampaperDelete(Integer exampaperDelete) {
this.exampaperDelete = exampaperDelete;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "Exampaper{" +
", id=" + id +
", exampaperName=" + exampaperName +
", exampaperDate=" + exampaperDate +
", exampaperMyscore=" + exampaperMyscore +
", exampaperTypes=" + exampaperTypes +
", zujuanTypes=" + zujuanTypes +
", exampaperDelete=" + exampaperDelete +
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,170 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("exampapertopic")
public class ExampapertopicEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public ExampapertopicEntity() {
}
public ExampapertopicEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@ColumnInfo(comment="主键",type="int(20)")
@TableField(value = "id")
private Integer id;
/**
*
*/
@ColumnInfo(comment="心理测评",type="int(20)")
@TableField(value = "exampaper_id")
private Integer exampaperId;
/**
*
*/
@ColumnInfo(comment="题目",type="int(20)")
@TableField(value = "examquestion_id")
private Integer examquestionId;
/**
*
*/
@ColumnInfo(comment="题目分数",type="int(20)")
@TableField(value = "exampapertopic_number")
private Integer exampapertopicNumber;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="创建时间",type="timestamp")
@TableField(value = "create_time",fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getExampaperId() {
return exampaperId;
}
/**
*
*/
public void setExampaperId(Integer exampaperId) {
this.exampaperId = exampaperId;
}
/**
*
*/
public Integer getExamquestionId() {
return examquestionId;
}
/**
*
*/
public void setExamquestionId(Integer examquestionId) {
this.examquestionId = examquestionId;
}
/**
*
*/
public Integer getExampapertopicNumber() {
return exampapertopicNumber;
}
/**
*
*/
public void setExampapertopicNumber(Integer exampapertopicNumber) {
this.exampapertopicNumber = exampapertopicNumber;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "Exampapertopic{" +
", id=" + id +
", exampaperId=" + exampaperId +
", examquestionId=" + examquestionId +
", exampapertopicNumber=" + exampapertopicNumber +
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,239 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("examquestion")
public class ExamquestionEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public ExamquestionEntity() {
}
public ExamquestionEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@ColumnInfo(comment="主键",type="int(20)")
@TableField(value = "id")
private Integer id;
/**
*
*/
@ColumnInfo(comment="题目名称",type="varchar(200)")
@TableField(value = "examquestion_name")
private String examquestionName;
/**
* json
*/
@ColumnInfo(comment="选项json字符串",type="longtext")
@TableField(value = "examquestion_options")
private String examquestionOptions;
/**
*
*/
@ColumnInfo(comment="正确答案",type="varchar(200)")
@TableField(value = "examquestion_answer")
private String examquestionAnswer;
/**
*
*/
@ColumnInfo(comment="答案解析",type="longtext")
@TableField(value = "examquestion_analysis")
private String examquestionAnalysis;
/**
*
*/
@ColumnInfo(comment="题目类型",type="int(20)")
@TableField(value = "examquestion_types")
private Integer examquestionTypes;
/**
*
*/
@ColumnInfo(comment="题目排序,值越大排越前面",type="int(20)")
@TableField(value = "examquestion_sequence")
private Integer examquestionSequence;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="创建时间",type="timestamp")
@TableField(value = "create_time",fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getExamquestionName() {
return examquestionName;
}
/**
*
*/
public void setExamquestionName(String examquestionName) {
this.examquestionName = examquestionName;
}
/**
* json
*/
public String getExamquestionOptions() {
return examquestionOptions;
}
/**
* json
*/
public void setExamquestionOptions(String examquestionOptions) {
this.examquestionOptions = examquestionOptions;
}
/**
*
*/
public String getExamquestionAnswer() {
return examquestionAnswer;
}
/**
*
*/
public void setExamquestionAnswer(String examquestionAnswer) {
this.examquestionAnswer = examquestionAnswer;
}
/**
*
*/
public String getExamquestionAnalysis() {
return examquestionAnalysis;
}
/**
*
*/
public void setExamquestionAnalysis(String examquestionAnalysis) {
this.examquestionAnalysis = examquestionAnalysis;
}
/**
*
*/
public Integer getExamquestionTypes() {
return examquestionTypes;
}
/**
*
*/
public void setExamquestionTypes(Integer examquestionTypes) {
this.examquestionTypes = examquestionTypes;
}
/**
*
*/
public Integer getExamquestionSequence() {
return examquestionSequence;
}
/**
*
*/
public void setExamquestionSequence(Integer examquestionSequence) {
this.examquestionSequence = examquestionSequence;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "Examquestion{" +
", id=" + id +
", examquestionName=" + examquestionName +
", examquestionOptions=" + examquestionOptions +
", examquestionAnswer=" + examquestionAnswer +
", examquestionAnalysis=" + examquestionAnalysis +
", examquestionTypes=" + examquestionTypes +
", examquestionSequence=" + examquestionSequence +
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,218 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("examrecord")
public class ExamrecordEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public ExamrecordEntity() {
}
public ExamrecordEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@ColumnInfo(comment="主键",type="int(20)")
@TableField(value = "id")
private Integer id;
/**
*
*/
@ColumnInfo(comment="心理测评编号",type="varchar(200)")
@TableField(value = "examrecord_uuid_number")
private String examrecordUuidNumber;
/**
*
*/
@ColumnInfo(comment="心理测评学生",type="int(20)")
@TableField(value = "yonghu_id")
private Integer yonghuId;
/**
* id
*/
@ColumnInfo(comment="所属心理测评id外键",type="int(20)")
@TableField(value = "exampaper_id")
private Integer exampaperId;
/**
*
*/
@ColumnInfo(comment="所得总分",type="int(200)")
@TableField(value = "total_score")
private Integer totalScore;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="心理测评时间",type="timestamp")
@TableField(value = "insert_time",fill = FieldFill.INSERT)
private Date insertTime;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="创建时间",type="timestamp")
@TableField(value = "create_time",fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getExamrecordUuidNumber() {
return examrecordUuidNumber;
}
/**
*
*/
public void setExamrecordUuidNumber(String examrecordUuidNumber) {
this.examrecordUuidNumber = examrecordUuidNumber;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
* id
*/
public Integer getExampaperId() {
return exampaperId;
}
/**
* id
*/
public void setExampaperId(Integer exampaperId) {
this.exampaperId = exampaperId;
}
/**
*
*/
public Integer getTotalScore() {
return totalScore;
}
/**
*
*/
public void setTotalScore(Integer totalScore) {
this.totalScore = totalScore;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "Examrecord{" +
", id=" + id +
", examrecordUuidNumber=" + examrecordUuidNumber +
", yonghuId=" + yonghuId +
", exampaperId=" + exampaperId +
", totalScore=" + totalScore +
", insertTime=" + DateUtil.convertString(insertTime,"yyyy-MM-dd") +
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,216 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("examredetails")
public class ExamredetailsEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public ExamredetailsEntity() {
}
public ExamredetailsEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@ColumnInfo(comment="主键",type="int(20)")
@TableField(value = "id")
private Integer id;
/**
*
*/
@ColumnInfo(comment="心理测评编号",type="varchar(200)")
@TableField(value = "examredetails_uuid_number")
private String examredetailsUuidNumber;
/**
* id
*/
@ColumnInfo(comment="学生id",type="int(20)")
@TableField(value = "yonghu_id")
private Integer yonghuId;
/**
* id
*/
@ColumnInfo(comment="题目id外键",type="int(20)")
@TableField(value = "examquestion_id")
private Integer examquestionId;
/**
*
*/
@ColumnInfo(comment="考生答案",type="varchar(200)")
@TableField(value = "examredetails_myanswer")
private String examredetailsMyanswer;
/**
*
*/
@ColumnInfo(comment="题目得分",type="int(20)")
@TableField(value = "examredetails_myscore")
private Integer examredetailsMyscore;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="创建时间",type="timestamp")
@TableField(value = "create_time",fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getExamredetailsUuidNumber() {
return examredetailsUuidNumber;
}
/**
*
*/
public void setExamredetailsUuidNumber(String examredetailsUuidNumber) {
this.examredetailsUuidNumber = examredetailsUuidNumber;
}
/**
* id
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
* id
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
* id
*/
public Integer getExamquestionId() {
return examquestionId;
}
/**
* id
*/
public void setExamquestionId(Integer examquestionId) {
this.examquestionId = examquestionId;
}
/**
*
*/
public String getExamredetailsMyanswer() {
return examredetailsMyanswer;
}
/**
*
*/
public void setExamredetailsMyanswer(String examredetailsMyanswer) {
this.examredetailsMyanswer = examredetailsMyanswer;
}
/**
*
*/
public Integer getExamredetailsMyscore() {
return examredetailsMyscore;
}
/**
*
*/
public void setExamredetailsMyscore(Integer examredetailsMyscore) {
this.examredetailsMyscore = examredetailsMyscore;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "Examredetails{" +
", id=" + id +
", examredetailsUuidNumber=" + examredetailsUuidNumber +
", yonghuId=" + yonghuId +
", examquestionId=" + examquestionId +
", examredetailsMyanswer=" + examredetailsMyanswer +
", examredetailsMyscore=" + examredetailsMyscore +
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,218 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("news")
public class NewsEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public NewsEntity() {
}
public NewsEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@ColumnInfo(comment="主键",type="int(11)")
@TableField(value = "id")
private Integer id;
/**
*
*/
@ColumnInfo(comment="公告标题",type="varchar(200)")
@TableField(value = "news_name")
private String newsName;
/**
*
*/
@ColumnInfo(comment="公告类型",type="int(11)")
@TableField(value = "news_types")
private Integer newsTypes;
/**
*
*/
@ColumnInfo(comment="公告图片",type="varchar(200)")
@TableField(value = "news_photo")
private String newsPhoto;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="添加时间",type="timestamp")
@TableField(value = "insert_time",fill = FieldFill.INSERT)
private Date insertTime;
/**
*
*/
@ColumnInfo(comment="公告详情",type="text")
@TableField(value = "news_content")
private String newsContent;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="创建时间",type="timestamp")
@TableField(value = "create_time",fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getNewsName() {
return newsName;
}
/**
*
*/
public void setNewsName(String newsName) {
this.newsName = newsName;
}
/**
*
*/
public Integer getNewsTypes() {
return newsTypes;
}
/**
*
*/
public void setNewsTypes(Integer newsTypes) {
this.newsTypes = newsTypes;
}
/**
*
*/
public String getNewsPhoto() {
return newsPhoto;
}
/**
*
*/
public void setNewsPhoto(String newsPhoto) {
this.newsPhoto = newsPhoto;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getNewsContent() {
return newsContent;
}
/**
*
*/
public void setNewsContent(String newsContent) {
this.newsContent = newsContent;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "News{" +
", id=" + id +
", newsName=" + newsName +
", newsTypes=" + newsTypes +
", newsPhoto=" + newsPhoto +
", insertTime=" + DateUtil.convertString(insertTime,"yyyy-MM-dd") +
", newsContent=" + newsContent +
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,132 @@
package com.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
/**
* token
*/
@TableName("token")
public class TokenEntity implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Integer id;
/**
* id
*/
private Integer userid;
/**
*
*/
private String username;
/**
*
*/
private String tablename;
/**
*
*/
private String role;
/**
* token
*/
private String token;
/**
*
*/
private Date expiratedtime;
/**
*
*/
private Date addtime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserid() {
return userid;
}
public void setUserid(Integer userid) {
this.userid = userid;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public String getToken() {
return token;
}
public String getTablename() {
return tablename;
}
public void setTablename(String tablename) {
this.tablename = tablename;
}
public void setToken(String token) {
this.token = token;
}
public Date getExpiratedtime() {
return expiratedtime;
}
public void setExpiratedtime(Date expiratedtime) {
this.expiratedtime = expiratedtime;
}
public Date getAddtime() {
return addtime;
}
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public TokenEntity(Integer userid, String username, String tablename,String role, String token, Date expiratedtime) {
super();
this.userid = userid;
this.username = username;
this.tablename = tablename;
this.role = role;
this.token = token;
this.expiratedtime = expiratedtime;
}
public TokenEntity() {
}
}

@ -0,0 +1,77 @@
package com.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*/
@TableName("users")
public class UsersEntity implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Integer id;
/**
*
*/
private String username;
/**
*
*/
private String password;
/**
*
*/
private String role;
private Date addtime;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public Date getAddtime() {
return addtime;
}
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
}

@ -0,0 +1,195 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("xinlijiankang_collection")
public class XinlijiankangCollectionEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public XinlijiankangCollectionEntity() {
}
public XinlijiankangCollectionEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@ColumnInfo(comment="主键",type="int(11)")
@TableField(value = "id")
private Integer id;
/**
*
*/
@ColumnInfo(comment="心理健康",type="int(11)")
@TableField(value = "xinlijiankang_id")
private Integer xinlijiankangId;
/**
*
*/
@ColumnInfo(comment="用户",type="int(11)")
@TableField(value = "yonghu_id")
private Integer yonghuId;
/**
*
*/
@ColumnInfo(comment="类型",type="int(11)")
@TableField(value = "xinlijiankang_collection_types")
private Integer xinlijiankangCollectionTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="收藏时间",type="timestamp")
@TableField(value = "insert_time",fill = FieldFill.INSERT)
private Date insertTime;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="创建时间",type="timestamp")
@TableField(value = "create_time",fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getXinlijiankangId() {
return xinlijiankangId;
}
/**
*
*/
public void setXinlijiankangId(Integer xinlijiankangId) {
this.xinlijiankangId = xinlijiankangId;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Integer getXinlijiankangCollectionTypes() {
return xinlijiankangCollectionTypes;
}
/**
*
*/
public void setXinlijiankangCollectionTypes(Integer xinlijiankangCollectionTypes) {
this.xinlijiankangCollectionTypes = xinlijiankangCollectionTypes;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "XinlijiankangCollection{" +
", id=" + id +
", xinlijiankangId=" + xinlijiankangId +
", yonghuId=" + yonghuId +
", xinlijiankangCollectionTypes=" + xinlijiankangCollectionTypes +
", insertTime=" + DateUtil.convertString(insertTime,"yyyy-MM-dd") +
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,285 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("xinlijiankang")
public class XinlijiankangEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public XinlijiankangEntity() {
}
public XinlijiankangEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@ColumnInfo(comment="主键",type="int(11)")
@TableField(value = "id")
private Integer id;
/**
*
*/
@ColumnInfo(comment="心理健康标题",type="varchar(200)")
@TableField(value = "xinlijiankang_name")
private String xinlijiankangName;
/**
*
*/
@ColumnInfo(comment="心理健康照片",type="varchar(200)")
@TableField(value = "xinlijiankang_photo")
private String xinlijiankangPhoto;
/**
*
*/
@ColumnInfo(comment="心理健康视频",type="varchar(200)")
@TableField(value = "xinlijiankang_video")
private String xinlijiankangVideo;
/**
*
*/
@ColumnInfo(comment="心理健康类型",type="int(11)")
@TableField(value = "xinlijiankang_types")
private Integer xinlijiankangTypes;
/**
*
*/
@ColumnInfo(comment="赞",type="int(11)")
@TableField(value = "zan_number")
private Integer zanNumber;
/**
*
*/
@ColumnInfo(comment="踩",type="int(11)")
@TableField(value = "cai_number")
private Integer caiNumber;
/**
*
*/
@ColumnInfo(comment="逻辑删除",type="int(11)")
@TableField(value = "xinlijiankang_delete")
private Integer xinlijiankangDelete;
/**
*
*/
@ColumnInfo(comment="心理健康详情",type="text")
@TableField(value = "xinlijiankang_content")
private String xinlijiankangContent;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="创建时间",type="timestamp")
@TableField(value = "create_time",fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getXinlijiankangName() {
return xinlijiankangName;
}
/**
*
*/
public void setXinlijiankangName(String xinlijiankangName) {
this.xinlijiankangName = xinlijiankangName;
}
/**
*
*/
public String getXinlijiankangPhoto() {
return xinlijiankangPhoto;
}
/**
*
*/
public void setXinlijiankangPhoto(String xinlijiankangPhoto) {
this.xinlijiankangPhoto = xinlijiankangPhoto;
}
/**
*
*/
public String getXinlijiankangVideo() {
return xinlijiankangVideo;
}
/**
*
*/
public void setXinlijiankangVideo(String xinlijiankangVideo) {
this.xinlijiankangVideo = xinlijiankangVideo;
}
/**
*
*/
public Integer getXinlijiankangTypes() {
return xinlijiankangTypes;
}
/**
*
*/
public void setXinlijiankangTypes(Integer xinlijiankangTypes) {
this.xinlijiankangTypes = xinlijiankangTypes;
}
/**
*
*/
public Integer getZanNumber() {
return zanNumber;
}
/**
*
*/
public void setZanNumber(Integer zanNumber) {
this.zanNumber = zanNumber;
}
/**
*
*/
public Integer getCaiNumber() {
return caiNumber;
}
/**
*
*/
public void setCaiNumber(Integer caiNumber) {
this.caiNumber = caiNumber;
}
/**
*
*/
public Integer getXinlijiankangDelete() {
return xinlijiankangDelete;
}
/**
*
*/
public void setXinlijiankangDelete(Integer xinlijiankangDelete) {
this.xinlijiankangDelete = xinlijiankangDelete;
}
/**
*
*/
public String getXinlijiankangContent() {
return xinlijiankangContent;
}
/**
*
*/
public void setXinlijiankangContent(String xinlijiankangContent) {
this.xinlijiankangContent = xinlijiankangContent;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "Xinlijiankang{" +
", id=" + id +
", xinlijiankangName=" + xinlijiankangName +
", xinlijiankangPhoto=" + xinlijiankangPhoto +
", xinlijiankangVideo=" + xinlijiankangVideo +
", xinlijiankangTypes=" + xinlijiankangTypes +
", zanNumber=" + zanNumber +
", caiNumber=" + caiNumber +
", xinlijiankangDelete=" + xinlijiankangDelete +
", xinlijiankangContent=" + xinlijiankangContent +
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,243 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("xinlijiankang_liuyan")
public class XinlijiankangLiuyanEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public XinlijiankangLiuyanEntity() {
}
public XinlijiankangLiuyanEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@ColumnInfo(comment="主键",type="int(11)")
@TableField(value = "id")
private Integer id;
/**
*
*/
@ColumnInfo(comment="心理健康",type="int(11)")
@TableField(value = "xinlijiankang_id")
private Integer xinlijiankangId;
/**
*
*/
@ColumnInfo(comment="用户",type="int(11)")
@TableField(value = "yonghu_id")
private Integer yonghuId;
/**
*
*/
@ColumnInfo(comment="留言内容",type="text")
@TableField(value = "xinlijiankang_liuyan_text")
private String xinlijiankangLiuyanText;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="留言时间",type="timestamp")
@TableField(value = "insert_time",fill = FieldFill.INSERT)
private Date insertTime;
/**
*
*/
@ColumnInfo(comment="回复内容",type="text")
@TableField(value = "reply_text")
private String replyText;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="回复时间",type="timestamp")
@TableField(value = "update_time",fill = FieldFill.UPDATE)
private Date updateTime;
/**
* listShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="创建时间",type="timestamp")
@TableField(value = "create_time",fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getXinlijiankangId() {
return xinlijiankangId;
}
/**
*
*/
public void setXinlijiankangId(Integer xinlijiankangId) {
this.xinlijiankangId = xinlijiankangId;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public String getXinlijiankangLiuyanText() {
return xinlijiankangLiuyanText;
}
/**
*
*/
public void setXinlijiankangLiuyanText(String xinlijiankangLiuyanText) {
this.xinlijiankangLiuyanText = xinlijiankangLiuyanText;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getReplyText() {
return replyText;
}
/**
*
*/
public void setReplyText(String replyText) {
this.replyText = replyText;
}
/**
*
*/
public Date getUpdateTime() {
return updateTime;
}
/**
*
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* listShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* listShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "XinlijiankangLiuyan{" +
", id=" + id +
", xinlijiankangId=" + xinlijiankangId +
", yonghuId=" + yonghuId +
", xinlijiankangLiuyanText=" + xinlijiankangLiuyanText +
", insertTime=" + DateUtil.convertString(insertTime,"yyyy-MM-dd") +
", replyText=" + replyText +
", updateTime=" + DateUtil.convertString(updateTime,"yyyy-MM-dd") +
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,308 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("yonghu")
public class YonghuEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public YonghuEntity() {
}
public YonghuEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@ColumnInfo(comment="主键",type="int(11)")
@TableField(value = "id")
private Integer id;
/**
*
*/
@ColumnInfo(comment="账户",type="varchar(200)")
@TableField(value = "username")
private String username;
/**
*
*/
@ColumnInfo(comment="密码",type="varchar(200)")
@TableField(value = "password")
private String password;
/**
*
*/
@ColumnInfo(comment="用户姓名",type="varchar(200)")
@TableField(value = "yonghu_name")
private String yonghuName;
/**
*
*/
@ColumnInfo(comment="性别",type="int(11)")
@TableField(value = "sex_types")
private Integer sexTypes;
/**
*
*/
@ColumnInfo(comment="用户头像",type="varchar(200)")
@TableField(value = "yonghu_photo")
private String yonghuPhoto;
/**
*
*/
@ColumnInfo(comment="身份证号",type="varchar(200)")
@TableField(value = "yonghu_id_number")
private String yonghuIdNumber;
/**
*
*/
@ColumnInfo(comment="联系方式",type="varchar(200)")
@TableField(value = "yonghu_phone")
private String yonghuPhone;
/**
*
*/
@ColumnInfo(comment="电子邮箱",type="varchar(200)")
@TableField(value = "yonghu_email")
private String yonghuEmail;
/**
*
*/
@ColumnInfo(comment="逻辑删除",type="int(11)")
@TableField(value = "yonghu_delete")
private Integer yonghuDelete;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="创建时间",type="timestamp")
@TableField(value = "create_time",fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getUsername() {
return username;
}
/**
*
*/
public void setUsername(String username) {
this.username = username;
}
/**
*
*/
public String getPassword() {
return password;
}
/**
*
*/
public void setPassword(String password) {
this.password = password;
}
/**
*
*/
public String getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "Yonghu{" +
", id=" + id +
", username=" + username +
", password=" + password +
", yonghuName=" + yonghuName +
", sexTypes=" + sexTypes +
", yonghuPhoto=" + yonghuPhoto +
", yonghuIdNumber=" + yonghuIdNumber +
", yonghuPhone=" + yonghuPhone +
", yonghuEmail=" + yonghuEmail +
", yonghuDelete=" + yonghuDelete +
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,314 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("zhixunshi_chat")
public class ZhixunshiChatEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public ZhixunshiChatEntity() {
}
public ZhixunshiChatEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@ColumnInfo(comment="主键",type="int(11)")
@TableField(value = "id")
private Integer id;
/**
*
*/
@ColumnInfo(comment="提问人",type="int(11)")
@TableField(value = "yonghu_id")
private Integer yonghuId;
/**
*
*/
@ColumnInfo(comment="回答人",type="int(11)")
@TableField(value = "zhixunshi_id")
private Integer zhixunshiId;
/**
*
*/
@ColumnInfo(comment="问题",type="text")
@TableField(value = "zhixunshi_chat_issue_text")
private String zhixunshiChatIssueText;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="问题时间",type="timestamp")
@TableField(value = "issue_time")
private Date issueTime;
/**
*
*/
@ColumnInfo(comment="回复",type="text")
@TableField(value = "zhixunshi_chat_reply_text")
private String zhixunshiChatReplyText;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="回复时间",type="timestamp")
@TableField(value = "reply_time")
private Date replyTime;
/**
*
*/
@ColumnInfo(comment="状态",type="int(255)")
@TableField(value = "zhuangtai_types")
private Integer zhuangtaiTypes;
/**
*
*/
@ColumnInfo(comment="数据类型",type="int(11)")
@TableField(value = "zhixunshi_chat_types")
private Integer zhixunshiChatTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="提问时间",type="timestamp")
@TableField(value = "insert_time",fill = FieldFill.INSERT)
private Date insertTime;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="创建时间",type="timestamp")
@TableField(value = "create_time",fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Integer getZhixunshiId() {
return zhixunshiId;
}
/**
*
*/
public void setZhixunshiId(Integer zhixunshiId) {
this.zhixunshiId = zhixunshiId;
}
/**
*
*/
public String getZhixunshiChatIssueText() {
return zhixunshiChatIssueText;
}
/**
*
*/
public void setZhixunshiChatIssueText(String zhixunshiChatIssueText) {
this.zhixunshiChatIssueText = zhixunshiChatIssueText;
}
/**
*
*/
public Date getIssueTime() {
return issueTime;
}
/**
*
*/
public void setIssueTime(Date issueTime) {
this.issueTime = issueTime;
}
/**
*
*/
public String getZhixunshiChatReplyText() {
return zhixunshiChatReplyText;
}
/**
*
*/
public void setZhixunshiChatReplyText(String zhixunshiChatReplyText) {
this.zhixunshiChatReplyText = zhixunshiChatReplyText;
}
/**
*
*/
public Date getReplyTime() {
return replyTime;
}
/**
*
*/
public void setReplyTime(Date replyTime) {
this.replyTime = replyTime;
}
/**
*
*/
public Integer getZhuangtaiTypes() {
return zhuangtaiTypes;
}
/**
*
*/
public void setZhuangtaiTypes(Integer zhuangtaiTypes) {
this.zhuangtaiTypes = zhuangtaiTypes;
}
/**
*
*/
public Integer getZhixunshiChatTypes() {
return zhixunshiChatTypes;
}
/**
*
*/
public void setZhixunshiChatTypes(Integer zhixunshiChatTypes) {
this.zhixunshiChatTypes = zhixunshiChatTypes;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "ZhixunshiChat{" +
", id=" + id +
", yonghuId=" + yonghuId +
", zhixunshiId=" + zhixunshiId +
", zhixunshiChatIssueText=" + zhixunshiChatIssueText +
", issueTime=" + DateUtil.convertString(issueTime,"yyyy-MM-dd") +
", zhixunshiChatReplyText=" + zhixunshiChatReplyText +
", replyTime=" + DateUtil.convertString(replyTime,"yyyy-MM-dd") +
", zhuangtaiTypes=" + zhuangtaiTypes +
", zhixunshiChatTypes=" + zhixunshiChatTypes +
", insertTime=" + DateUtil.convertString(insertTime,"yyyy-MM-dd") +
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,377 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("zhixunshi")
public class ZhixunshiEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public ZhixunshiEntity() {
}
public ZhixunshiEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@ColumnInfo(comment="主键",type="int(11)")
@TableField(value = "id")
private Integer id;
/**
*
*/
@ColumnInfo(comment="账户",type="varchar(200)")
@TableField(value = "username")
private String username;
/**
*
*/
@ColumnInfo(comment="密码",type="varchar(200)")
@TableField(value = "password")
private String password;
/**
*
*/
@ColumnInfo(comment="咨询师姓名",type="varchar(200)")
@TableField(value = "zhixunshi_name")
private String zhixunshiName;
/**
*
*/
@ColumnInfo(comment="性别",type="int(11)")
@TableField(value = "sex_types")
private Integer sexTypes;
/**
*
*/
@ColumnInfo(comment="咨询师头像",type="varchar(200)")
@TableField(value = "zhixunshi_photo")
private String zhixunshiPhoto;
/**
*
*/
@ColumnInfo(comment="身份证号",type="varchar(200)")
@TableField(value = "zhixunshi_id_number")
private String zhixunshiIdNumber;
/**
*
*/
@ColumnInfo(comment="联系方式",type="varchar(200)")
@TableField(value = "zhixunshi_phone")
private String zhixunshiPhone;
/**
*
*/
@ColumnInfo(comment="电子邮箱",type="varchar(200)")
@TableField(value = "zhixunshi_email")
private String zhixunshiEmail;
/**
*
*/
@ColumnInfo(comment="从业时长",type="varchar(200)")
@TableField(value = "zhixunshi_congye")
private String zhixunshiCongye;
/**
*
*/
@ColumnInfo(comment="擅长",type="varchar(200)")
@TableField(value = "zhixunshi_shanchang")
private String zhixunshiShanchang;
/**
*
*/
@ColumnInfo(comment="个人简介",type="text")
@TableField(value = "zhixunshi_content")
private String zhixunshiContent;
/**
*
*/
@ColumnInfo(comment="逻辑删除",type="int(11)")
@TableField(value = "zhixunshi_delete")
private Integer zhixunshiDelete;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="创建时间",type="timestamp")
@TableField(value = "create_time",fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getUsername() {
return username;
}
/**
*
*/
public void setUsername(String username) {
this.username = username;
}
/**
*
*/
public String getPassword() {
return password;
}
/**
*
*/
public void setPassword(String password) {
this.password = password;
}
/**
*
*/
public String getZhixunshiName() {
return zhixunshiName;
}
/**
*
*/
public void setZhixunshiName(String zhixunshiName) {
this.zhixunshiName = zhixunshiName;
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
}
/**
*
*/
public String getZhixunshiPhoto() {
return zhixunshiPhoto;
}
/**
*
*/
public void setZhixunshiPhoto(String zhixunshiPhoto) {
this.zhixunshiPhoto = zhixunshiPhoto;
}
/**
*
*/
public String getZhixunshiIdNumber() {
return zhixunshiIdNumber;
}
/**
*
*/
public void setZhixunshiIdNumber(String zhixunshiIdNumber) {
this.zhixunshiIdNumber = zhixunshiIdNumber;
}
/**
*
*/
public String getZhixunshiPhone() {
return zhixunshiPhone;
}
/**
*
*/
public void setZhixunshiPhone(String zhixunshiPhone) {
this.zhixunshiPhone = zhixunshiPhone;
}
/**
*
*/
public String getZhixunshiEmail() {
return zhixunshiEmail;
}
/**
*
*/
public void setZhixunshiEmail(String zhixunshiEmail) {
this.zhixunshiEmail = zhixunshiEmail;
}
/**
*
*/
public String getZhixunshiCongye() {
return zhixunshiCongye;
}
/**
*
*/
public void setZhixunshiCongye(String zhixunshiCongye) {
this.zhixunshiCongye = zhixunshiCongye;
}
/**
*
*/
public String getZhixunshiShanchang() {
return zhixunshiShanchang;
}
/**
*
*/
public void setZhixunshiShanchang(String zhixunshiShanchang) {
this.zhixunshiShanchang = zhixunshiShanchang;
}
/**
*
*/
public String getZhixunshiContent() {
return zhixunshiContent;
}
/**
*
*/
public void setZhixunshiContent(String zhixunshiContent) {
this.zhixunshiContent = zhixunshiContent;
}
/**
*
*/
public Integer getZhixunshiDelete() {
return zhixunshiDelete;
}
/**
*
*/
public void setZhixunshiDelete(Integer zhixunshiDelete) {
this.zhixunshiDelete = zhixunshiDelete;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "Zhixunshi{" +
", id=" + id +
", username=" + username +
", password=" + password +
", zhixunshiName=" + zhixunshiName +
", sexTypes=" + sexTypes +
", zhixunshiPhoto=" + zhixunshiPhoto +
", zhixunshiIdNumber=" + zhixunshiIdNumber +
", zhixunshiPhone=" + zhixunshiPhone +
", zhixunshiEmail=" + zhixunshiEmail +
", zhixunshiCongye=" + zhixunshiCongye +
", zhixunshiShanchang=" + zhixunshiShanchang +
", zhixunshiContent=" + zhixunshiContent +
", zhixunshiDelete=" + zhixunshiDelete +
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,197 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("zhixunshi_yuyue")
public class ZhixunshiYuyueEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public ZhixunshiYuyueEntity() {
}
public ZhixunshiYuyueEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
@ColumnInfo(comment="主键",type="int(11)")
@TableField(value = "id")
private Integer id;
/**
*
*/
@ColumnInfo(comment="咨询师",type="int(11)")
@TableField(value = "zhixunshi_id")
private Integer zhixunshiId;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="预约时间",type="timestamp")
@TableField(value = "zhixunshi_yuyue_time")
private Date zhixunshiYuyueTime;
/**
*
*/
@ColumnInfo(comment="备注",type="text")
@TableField(value = "zhixunshi_yuyue_text")
private String zhixunshiYuyueText;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="添加时间",type="timestamp")
@TableField(value = "insert_time",fill = FieldFill.INSERT)
private Date insertTime;
/**
* listShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@ColumnInfo(comment="创建时间",type="timestamp")
@TableField(value = "create_time",fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getZhixunshiId() {
return zhixunshiId;
}
/**
*
*/
public void setZhixunshiId(Integer zhixunshiId) {
this.zhixunshiId = zhixunshiId;
}
/**
*
*/
public Date getZhixunshiYuyueTime() {
return zhixunshiYuyueTime;
}
/**
*
*/
public void setZhixunshiYuyueTime(Date zhixunshiYuyueTime) {
this.zhixunshiYuyueTime = zhixunshiYuyueTime;
}
/**
*
*/
public String getZhixunshiYuyueText() {
return zhixunshiYuyueText;
}
/**
*
*/
public void setZhixunshiYuyueText(String zhixunshiYuyueText) {
this.zhixunshiYuyueText = zhixunshiYuyueText;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
* listShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* listShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "ZhixunshiYuyue{" +
", id=" + id +
", zhixunshiId=" + zhixunshiId +
", zhixunshiYuyueTime=" + DateUtil.convertString(zhixunshiYuyueTime,"yyyy-MM-dd") +
", zhixunshiYuyueText=" + zhixunshiYuyueText +
", insertTime=" + DateUtil.convertString(insertTime,"yyyy-MM-dd") +
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,187 @@
package com.entity.model;
import com.entity.DictionaryEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class DictionaryModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String dicCode;
/**
*
*/
private String dicName;
/**
*
*/
private Integer codeIndex;
/**
*
*/
private String indexName;
/**
* id
*/
private Integer superId;
/**
*
*/
private String beizhu;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getDicCode() {
return dicCode;
}
/**
*
*/
public void setDicCode(String dicCode) {
this.dicCode = dicCode;
}
/**
*
*/
public String getDicName() {
return dicName;
}
/**
*
*/
public void setDicName(String dicName) {
this.dicName = dicName;
}
/**
*
*/
public Integer getCodeIndex() {
return codeIndex;
}
/**
*
*/
public void setCodeIndex(Integer codeIndex) {
this.codeIndex = codeIndex;
}
/**
*
*/
public String getIndexName() {
return indexName;
}
/**
*
*/
public void setIndexName(String indexName) {
this.indexName = indexName;
}
/**
* id
*/
public Integer getSuperId() {
return superId;
}
/**
* id
*/
public void setSuperId(Integer superId) {
this.superId = superId;
}
/**
*
*/
public String getBeizhu() {
return beizhu;
}
/**
*
*/
public void setBeizhu(String beizhu) {
this.beizhu = beizhu;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,187 @@
package com.entity.model;
import com.entity.ExampaperEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class ExampaperModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String exampaperName;
/**
* ()
*/
private Integer exampaperDate;
/**
*
*/
private Integer exampaperMyscore;
/**
*
*/
private Integer exampaperTypes;
/**
*
*/
private Integer zujuanTypes;
/**
* 1 2
*/
private Integer exampaperDelete;
/**
* show2 photoShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getExampaperName() {
return exampaperName;
}
/**
*
*/
public void setExampaperName(String exampaperName) {
this.exampaperName = exampaperName;
}
/**
* ()
*/
public Integer getExampaperDate() {
return exampaperDate;
}
/**
* ()
*/
public void setExampaperDate(Integer exampaperDate) {
this.exampaperDate = exampaperDate;
}
/**
*
*/
public Integer getExampaperMyscore() {
return exampaperMyscore;
}
/**
*
*/
public void setExampaperMyscore(Integer exampaperMyscore) {
this.exampaperMyscore = exampaperMyscore;
}
/**
*
*/
public Integer getExampaperTypes() {
return exampaperTypes;
}
/**
*
*/
public void setExampaperTypes(Integer exampaperTypes) {
this.exampaperTypes = exampaperTypes;
}
/**
*
*/
public Integer getZujuanTypes() {
return zujuanTypes;
}
/**
*
*/
public void setZujuanTypes(Integer zujuanTypes) {
this.zujuanTypes = zujuanTypes;
}
/**
* 1 2
*/
public Integer getExampaperDelete() {
return exampaperDelete;
}
/**
* 1 2
*/
public void setExampaperDelete(Integer exampaperDelete) {
this.exampaperDelete = exampaperDelete;
}
/**
* show2 photoShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show2 photoShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,127 @@
package com.entity.model;
import com.entity.ExampapertopicEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class ExampapertopicModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private Integer exampaperId;
/**
*
*/
private Integer examquestionId;
/**
*
*/
private Integer exampapertopicNumber;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getExampaperId() {
return exampaperId;
}
/**
*
*/
public void setExampaperId(Integer exampaperId) {
this.exampaperId = exampaperId;
}
/**
*
*/
public Integer getExamquestionId() {
return examquestionId;
}
/**
*
*/
public void setExamquestionId(Integer examquestionId) {
this.examquestionId = examquestionId;
}
/**
*
*/
public Integer getExampapertopicNumber() {
return exampapertopicNumber;
}
/**
*
*/
public void setExampapertopicNumber(Integer exampapertopicNumber) {
this.exampapertopicNumber = exampapertopicNumber;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,187 @@
package com.entity.model;
import com.entity.ExamquestionEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class ExamquestionModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String examquestionName;
/**
* json
*/
private String examquestionOptions;
/**
*
*/
private String examquestionAnswer;
/**
*
*/
private String examquestionAnalysis;
/**
*
*/
private Integer examquestionTypes;
/**
*
*/
private Integer examquestionSequence;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getExamquestionName() {
return examquestionName;
}
/**
*
*/
public void setExamquestionName(String examquestionName) {
this.examquestionName = examquestionName;
}
/**
* json
*/
public String getExamquestionOptions() {
return examquestionOptions;
}
/**
* json
*/
public void setExamquestionOptions(String examquestionOptions) {
this.examquestionOptions = examquestionOptions;
}
/**
*
*/
public String getExamquestionAnswer() {
return examquestionAnswer;
}
/**
*
*/
public void setExamquestionAnswer(String examquestionAnswer) {
this.examquestionAnswer = examquestionAnswer;
}
/**
*
*/
public String getExamquestionAnalysis() {
return examquestionAnalysis;
}
/**
*
*/
public void setExamquestionAnalysis(String examquestionAnalysis) {
this.examquestionAnalysis = examquestionAnalysis;
}
/**
*
*/
public Integer getExamquestionTypes() {
return examquestionTypes;
}
/**
*
*/
public void setExamquestionTypes(Integer examquestionTypes) {
this.examquestionTypes = examquestionTypes;
}
/**
*
*/
public Integer getExamquestionSequence() {
return examquestionSequence;
}
/**
*
*/
public void setExamquestionSequence(Integer examquestionSequence) {
this.examquestionSequence = examquestionSequence;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,169 @@
package com.entity.model;
import com.entity.ExamrecordEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class ExamrecordModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String examrecordUuidNumber;
/**
*
*/
private Integer yonghuId;
/**
* id
*/
private Integer exampaperId;
/**
*
*/
private Integer totalScore;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getExamrecordUuidNumber() {
return examrecordUuidNumber;
}
/**
*
*/
public void setExamrecordUuidNumber(String examrecordUuidNumber) {
this.examrecordUuidNumber = examrecordUuidNumber;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
* id
*/
public Integer getExampaperId() {
return exampaperId;
}
/**
* id
*/
public void setExampaperId(Integer exampaperId) {
this.exampaperId = exampaperId;
}
/**
*
*/
public Integer getTotalScore() {
return totalScore;
}
/**
*
*/
public void setTotalScore(Integer totalScore) {
this.totalScore = totalScore;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,167 @@
package com.entity.model;
import com.entity.ExamredetailsEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class ExamredetailsModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String examredetailsUuidNumber;
/**
* id
*/
private Integer yonghuId;
/**
* id
*/
private Integer examquestionId;
/**
*
*/
private String examredetailsMyanswer;
/**
*
*/
private Integer examredetailsMyscore;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getExamredetailsUuidNumber() {
return examredetailsUuidNumber;
}
/**
*
*/
public void setExamredetailsUuidNumber(String examredetailsUuidNumber) {
this.examredetailsUuidNumber = examredetailsUuidNumber;
}
/**
* id
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
* id
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
* id
*/
public Integer getExamquestionId() {
return examquestionId;
}
/**
* id
*/
public void setExamquestionId(Integer examquestionId) {
this.examquestionId = examquestionId;
}
/**
*
*/
public String getExamredetailsMyanswer() {
return examredetailsMyanswer;
}
/**
*
*/
public void setExamredetailsMyanswer(String examredetailsMyanswer) {
this.examredetailsMyanswer = examredetailsMyanswer;
}
/**
*
*/
public Integer getExamredetailsMyscore() {
return examredetailsMyscore;
}
/**
*
*/
public void setExamredetailsMyscore(Integer examredetailsMyscore) {
this.examredetailsMyscore = examredetailsMyscore;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,169 @@
package com.entity.model;
import com.entity.NewsEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class NewsModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String newsName;
/**
*
*/
private Integer newsTypes;
/**
*
*/
private String newsPhoto;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
*
*/
private String newsContent;
/**
* show1 show2 nameShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getNewsName() {
return newsName;
}
/**
*
*/
public void setNewsName(String newsName) {
this.newsName = newsName;
}
/**
*
*/
public Integer getNewsTypes() {
return newsTypes;
}
/**
*
*/
public void setNewsTypes(Integer newsTypes) {
this.newsTypes = newsTypes;
}
/**
*
*/
public String getNewsPhoto() {
return newsPhoto;
}
/**
*
*/
public void setNewsPhoto(String newsPhoto) {
this.newsPhoto = newsPhoto;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getNewsContent() {
return newsContent;
}
/**
*
*/
public void setNewsContent(String newsContent) {
this.newsContent = newsContent;
}
/**
* show1 show2 nameShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show1 show2 nameShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,149 @@
package com.entity.model;
import com.entity.XinlijiankangCollectionEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class XinlijiankangCollectionModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private Integer xinlijiankangId;
/**
*
*/
private Integer yonghuId;
/**
*
*/
private Integer xinlijiankangCollectionTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
* show3 photoShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getXinlijiankangId() {
return xinlijiankangId;
}
/**
*
*/
public void setXinlijiankangId(Integer xinlijiankangId) {
this.xinlijiankangId = xinlijiankangId;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Integer getXinlijiankangCollectionTypes() {
return xinlijiankangCollectionTypes;
}
/**
*
*/
public void setXinlijiankangCollectionTypes(Integer xinlijiankangCollectionTypes) {
this.xinlijiankangCollectionTypes = xinlijiankangCollectionTypes;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
* show3 photoShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show3 photoShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,191 @@
package com.entity.model;
import com.entity.XinlijiankangLiuyanEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class XinlijiankangLiuyanModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private Integer xinlijiankangId;
/**
*
*/
private Integer yonghuId;
/**
*
*/
private String xinlijiankangLiuyanText;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
*
*/
private String replyText;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date updateTime;
/**
* show3 listShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getXinlijiankangId() {
return xinlijiankangId;
}
/**
*
*/
public void setXinlijiankangId(Integer xinlijiankangId) {
this.xinlijiankangId = xinlijiankangId;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public String getXinlijiankangLiuyanText() {
return xinlijiankangLiuyanText;
}
/**
*
*/
public void setXinlijiankangLiuyanText(String xinlijiankangLiuyanText) {
this.xinlijiankangLiuyanText = xinlijiankangLiuyanText;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getReplyText() {
return replyText;
}
/**
*
*/
public void setReplyText(String replyText) {
this.replyText = replyText;
}
/**
*
*/
public Date getUpdateTime() {
return updateTime;
}
/**
*
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* show3 listShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show3 listShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,227 @@
package com.entity.model;
import com.entity.XinlijiankangEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class XinlijiankangModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String xinlijiankangName;
/**
*
*/
private String xinlijiankangPhoto;
/**
*
*/
private String xinlijiankangVideo;
/**
*
*/
private Integer xinlijiankangTypes;
/**
*
*/
private Integer zanNumber;
/**
*
*/
private Integer caiNumber;
/**
*
*/
private Integer xinlijiankangDelete;
/**
*
*/
private String xinlijiankangContent;
/**
* show1 show2 photoShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getXinlijiankangName() {
return xinlijiankangName;
}
/**
*
*/
public void setXinlijiankangName(String xinlijiankangName) {
this.xinlijiankangName = xinlijiankangName;
}
/**
*
*/
public String getXinlijiankangPhoto() {
return xinlijiankangPhoto;
}
/**
*
*/
public void setXinlijiankangPhoto(String xinlijiankangPhoto) {
this.xinlijiankangPhoto = xinlijiankangPhoto;
}
/**
*
*/
public String getXinlijiankangVideo() {
return xinlijiankangVideo;
}
/**
*
*/
public void setXinlijiankangVideo(String xinlijiankangVideo) {
this.xinlijiankangVideo = xinlijiankangVideo;
}
/**
*
*/
public Integer getXinlijiankangTypes() {
return xinlijiankangTypes;
}
/**
*
*/
public void setXinlijiankangTypes(Integer xinlijiankangTypes) {
this.xinlijiankangTypes = xinlijiankangTypes;
}
/**
*
*/
public Integer getZanNumber() {
return zanNumber;
}
/**
*
*/
public void setZanNumber(Integer zanNumber) {
this.zanNumber = zanNumber;
}
/**
*
*/
public Integer getCaiNumber() {
return caiNumber;
}
/**
*
*/
public void setCaiNumber(Integer caiNumber) {
this.caiNumber = caiNumber;
}
/**
*
*/
public Integer getXinlijiankangDelete() {
return xinlijiankangDelete;
}
/**
*
*/
public void setXinlijiankangDelete(Integer xinlijiankangDelete) {
this.xinlijiankangDelete = xinlijiankangDelete;
}
/**
*
*/
public String getXinlijiankangContent() {
return xinlijiankangContent;
}
/**
*
*/
public void setXinlijiankangContent(String xinlijiankangContent) {
this.xinlijiankangContent = xinlijiankangContent;
}
/**
* show1 show2 photoShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show1 show2 photoShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,247 @@
package com.entity.model;
import com.entity.YonghuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class YonghuModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String username;
/**
*
*/
private String password;
/**
*
*/
private String yonghuName;
/**
*
*/
private Integer sexTypes;
/**
*
*/
private String yonghuPhoto;
/**
*
*/
private String yonghuIdNumber;
/**
*
*/
private String yonghuPhone;
/**
*
*/
private String yonghuEmail;
/**
*
*/
private Integer yonghuDelete;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getUsername() {
return username;
}
/**
*
*/
public void setUsername(String username) {
this.username = username;
}
/**
*
*/
public String getPassword() {
return password;
}
/**
*
*/
public void setPassword(String password) {
this.password = password;
}
/**
*
*/
public String getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,253 @@
package com.entity.model;
import com.entity.ZhixunshiChatEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class ZhixunshiChatModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private Integer yonghuId;
/**
*
*/
private Integer zhixunshiId;
/**
*
*/
private String zhixunshiChatIssueText;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date issueTime;
/**
*
*/
private String zhixunshiChatReplyText;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date replyTime;
/**
*
*/
private Integer zhuangtaiTypes;
/**
*
*/
private Integer zhixunshiChatTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Integer getZhixunshiId() {
return zhixunshiId;
}
/**
*
*/
public void setZhixunshiId(Integer zhixunshiId) {
this.zhixunshiId = zhixunshiId;
}
/**
*
*/
public String getZhixunshiChatIssueText() {
return zhixunshiChatIssueText;
}
/**
*
*/
public void setZhixunshiChatIssueText(String zhixunshiChatIssueText) {
this.zhixunshiChatIssueText = zhixunshiChatIssueText;
}
/**
*
*/
public Date getIssueTime() {
return issueTime;
}
/**
*
*/
public void setIssueTime(Date issueTime) {
this.issueTime = issueTime;
}
/**
*
*/
public String getZhixunshiChatReplyText() {
return zhixunshiChatReplyText;
}
/**
*
*/
public void setZhixunshiChatReplyText(String zhixunshiChatReplyText) {
this.zhixunshiChatReplyText = zhixunshiChatReplyText;
}
/**
*
*/
public Date getReplyTime() {
return replyTime;
}
/**
*
*/
public void setReplyTime(Date replyTime) {
this.replyTime = replyTime;
}
/**
*
*/
public Integer getZhuangtaiTypes() {
return zhuangtaiTypes;
}
/**
*
*/
public void setZhuangtaiTypes(Integer zhuangtaiTypes) {
this.zhuangtaiTypes = zhuangtaiTypes;
}
/**
*
*/
public Integer getZhixunshiChatTypes() {
return zhixunshiChatTypes;
}
/**
*
*/
public void setZhixunshiChatTypes(Integer zhixunshiChatTypes) {
this.zhixunshiChatTypes = zhixunshiChatTypes;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,307 @@
package com.entity.model;
import com.entity.ZhixunshiEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class ZhixunshiModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String username;
/**
*
*/
private String password;
/**
*
*/
private String zhixunshiName;
/**
*
*/
private Integer sexTypes;
/**
*
*/
private String zhixunshiPhoto;
/**
*
*/
private String zhixunshiIdNumber;
/**
*
*/
private String zhixunshiPhone;
/**
*
*/
private String zhixunshiEmail;
/**
*
*/
private String zhixunshiCongye;
/**
*
*/
private String zhixunshiShanchang;
/**
*
*/
private String zhixunshiContent;
/**
*
*/
private Integer zhixunshiDelete;
/**
* show1 show2 photoShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getUsername() {
return username;
}
/**
*
*/
public void setUsername(String username) {
this.username = username;
}
/**
*
*/
public String getPassword() {
return password;
}
/**
*
*/
public void setPassword(String password) {
this.password = password;
}
/**
*
*/
public String getZhixunshiName() {
return zhixunshiName;
}
/**
*
*/
public void setZhixunshiName(String zhixunshiName) {
this.zhixunshiName = zhixunshiName;
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
}
/**
*
*/
public String getZhixunshiPhoto() {
return zhixunshiPhoto;
}
/**
*
*/
public void setZhixunshiPhoto(String zhixunshiPhoto) {
this.zhixunshiPhoto = zhixunshiPhoto;
}
/**
*
*/
public String getZhixunshiIdNumber() {
return zhixunshiIdNumber;
}
/**
*
*/
public void setZhixunshiIdNumber(String zhixunshiIdNumber) {
this.zhixunshiIdNumber = zhixunshiIdNumber;
}
/**
*
*/
public String getZhixunshiPhone() {
return zhixunshiPhone;
}
/**
*
*/
public void setZhixunshiPhone(String zhixunshiPhone) {
this.zhixunshiPhone = zhixunshiPhone;
}
/**
*
*/
public String getZhixunshiEmail() {
return zhixunshiEmail;
}
/**
*
*/
public void setZhixunshiEmail(String zhixunshiEmail) {
this.zhixunshiEmail = zhixunshiEmail;
}
/**
*
*/
public String getZhixunshiCongye() {
return zhixunshiCongye;
}
/**
*
*/
public void setZhixunshiCongye(String zhixunshiCongye) {
this.zhixunshiCongye = zhixunshiCongye;
}
/**
*
*/
public String getZhixunshiShanchang() {
return zhixunshiShanchang;
}
/**
*
*/
public void setZhixunshiShanchang(String zhixunshiShanchang) {
this.zhixunshiShanchang = zhixunshiShanchang;
}
/**
*
*/
public String getZhixunshiContent() {
return zhixunshiContent;
}
/**
*
*/
public void setZhixunshiContent(String zhixunshiContent) {
this.zhixunshiContent = zhixunshiContent;
}
/**
*
*/
public Integer getZhixunshiDelete() {
return zhixunshiDelete;
}
/**
*
*/
public void setZhixunshiDelete(Integer zhixunshiDelete) {
this.zhixunshiDelete = zhixunshiDelete;
}
/**
* show1 show2 photoShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show1 show2 photoShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,151 @@
package com.entity.model;
import com.entity.ZhixunshiYuyueEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class ZhixunshiYuyueModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private Integer zhixunshiId;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date zhixunshiYuyueTime;
/**
*
*/
private String zhixunshiYuyueText;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
* show3 listShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getZhixunshiId() {
return zhixunshiId;
}
/**
*
*/
public void setZhixunshiId(Integer zhixunshiId) {
this.zhixunshiId = zhixunshiId;
}
/**
*
*/
public Date getZhixunshiYuyueTime() {
return zhixunshiYuyueTime;
}
/**
*
*/
public void setZhixunshiYuyueTime(Date zhixunshiYuyueTime) {
this.zhixunshiYuyueTime = zhixunshiYuyueTime;
}
/**
*
*/
public String getZhixunshiYuyueText() {
return zhixunshiYuyueText;
}
/**
*
*/
public void setZhixunshiYuyueText(String zhixunshiYuyueText) {
this.zhixunshiYuyueText = zhixunshiYuyueText;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
* show3 listShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show3 listShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,53 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.DictionaryEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("dictionary")
public class DictionaryView extends DictionaryEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
public DictionaryView() {
}
public DictionaryView(DictionaryEntity dictionaryEntity) {
try {
BeanUtils.copyProperties(this, dictionaryEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public String toString() {
return "DictionaryView{" +
"} " + super.toString();
}
}

@ -0,0 +1,91 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.ExampaperEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("exampaper")
public class ExampaperView extends ExampaperEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
/**
*
*/
@ColumnInfo(comment="心理测评状态的字典表值",type="varchar(200)")
private String exampaperValue;
/**
*
*/
@ColumnInfo(comment="组卷方式的字典表值",type="varchar(200)")
private String zujuanValue;
public ExampaperView() {
}
public ExampaperView(ExampaperEntity exampaperEntity) {
try {
BeanUtils.copyProperties(this, exampaperEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//当前表的
/**
*
*/
public String getExampaperValue() {
return exampaperValue;
}
/**
*
*/
public void setExampaperValue(String exampaperValue) {
this.exampaperValue = exampaperValue;
}
//当前表的
/**
*
*/
public String getZujuanValue() {
return zujuanValue;
}
/**
*
*/
public void setZujuanValue(String zujuanValue) {
this.zujuanValue = zujuanValue;
}
@Override
public String toString() {
return "ExampaperView{" +
", exampaperValue=" + exampaperValue +
", zujuanValue=" + zujuanValue +
"} " + super.toString();
}
}

@ -0,0 +1,345 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.ExampapertopicEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("exampapertopic")
public class ExampapertopicView extends ExampapertopicEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
//级联表 心理测评表
/**
*
*/
@ColumnInfo(comment="心理测评名称",type="varchar(200)")
private String exampaperName;
/**
* ()
*/
@ColumnInfo(comment="心理测评时长(分钟)",type="int(11)")
private Integer exampaperDate;
/**
*
*/
@ColumnInfo(comment="心理测评总分数",type="int(20)")
private Integer exampaperMyscore;
/**
*
*/
@ColumnInfo(comment="心理测评状态",type="int(11)")
private Integer exampaperTypes;
/**
*
*/
@ColumnInfo(comment="心理测评状态的字典表值",type="varchar(200)")
private String exampaperValue;
/**
*
*/
@ColumnInfo(comment="组卷方式",type="int(11)")
private Integer zujuanTypes;
/**
*
*/
@ColumnInfo(comment="组卷方式的字典表值",type="varchar(200)")
private String zujuanValue;
/**
* 1 2
*/
@ColumnInfo(comment="逻辑删除1代表未删除 2代表已删除",type="int(255)")
private Integer exampaperDelete;
//级联表 题目表
/**
*
*/
@ColumnInfo(comment="题目名称",type="varchar(200)")
private String examquestionName;
/**
* json
*/
@ColumnInfo(comment="选项json字符串",type="longtext")
private String examquestionOptions;
/**
*
*/
@ColumnInfo(comment="正确答案",type="varchar(200)")
private String examquestionAnswer;
/**
*
*/
@ColumnInfo(comment="答案解析",type="longtext")
private String examquestionAnalysis;
/**
*
*/
@ColumnInfo(comment="题目类型",type="int(20)")
private Integer examquestionTypes;
/**
*
*/
@ColumnInfo(comment="题目类型的字典表值",type="varchar(200)")
private String examquestionValue;
/**
*
*/
@ColumnInfo(comment="题目排序,值越大排越前面",type="int(20)")
private Integer examquestionSequence;
public ExampapertopicView() {
}
public ExampapertopicView(ExampapertopicEntity exampapertopicEntity) {
try {
BeanUtils.copyProperties(this, exampapertopicEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//级联表的get和set 心理测评表
/**
*
*/
public String getExampaperName() {
return exampaperName;
}
/**
*
*/
public void setExampaperName(String exampaperName) {
this.exampaperName = exampaperName;
}
/**
* ()
*/
public Integer getExampaperDate() {
return exampaperDate;
}
/**
* ()
*/
public void setExampaperDate(Integer exampaperDate) {
this.exampaperDate = exampaperDate;
}
/**
*
*/
public Integer getExampaperMyscore() {
return exampaperMyscore;
}
/**
*
*/
public void setExampaperMyscore(Integer exampaperMyscore) {
this.exampaperMyscore = exampaperMyscore;
}
/**
*
*/
public Integer getExampaperTypes() {
return exampaperTypes;
}
/**
*
*/
public void setExampaperTypes(Integer exampaperTypes) {
this.exampaperTypes = exampaperTypes;
}
/**
*
*/
public String getExampaperValue() {
return exampaperValue;
}
/**
*
*/
public void setExampaperValue(String exampaperValue) {
this.exampaperValue = exampaperValue;
}
/**
*
*/
public Integer getZujuanTypes() {
return zujuanTypes;
}
/**
*
*/
public void setZujuanTypes(Integer zujuanTypes) {
this.zujuanTypes = zujuanTypes;
}
/**
*
*/
public String getZujuanValue() {
return zujuanValue;
}
/**
*
*/
public void setZujuanValue(String zujuanValue) {
this.zujuanValue = zujuanValue;
}
/**
* 1 2
*/
public Integer getExampaperDelete() {
return exampaperDelete;
}
/**
* 1 2
*/
public void setExampaperDelete(Integer exampaperDelete) {
this.exampaperDelete = exampaperDelete;
}
//级联表的get和set 题目表
/**
*
*/
public String getExamquestionName() {
return examquestionName;
}
/**
*
*/
public void setExamquestionName(String examquestionName) {
this.examquestionName = examquestionName;
}
/**
* json
*/
public String getExamquestionOptions() {
return examquestionOptions;
}
/**
* json
*/
public void setExamquestionOptions(String examquestionOptions) {
this.examquestionOptions = examquestionOptions;
}
/**
*
*/
public String getExamquestionAnswer() {
return examquestionAnswer;
}
/**
*
*/
public void setExamquestionAnswer(String examquestionAnswer) {
this.examquestionAnswer = examquestionAnswer;
}
/**
*
*/
public String getExamquestionAnalysis() {
return examquestionAnalysis;
}
/**
*
*/
public void setExamquestionAnalysis(String examquestionAnalysis) {
this.examquestionAnalysis = examquestionAnalysis;
}
/**
*
*/
public Integer getExamquestionTypes() {
return examquestionTypes;
}
/**
*
*/
public void setExamquestionTypes(Integer examquestionTypes) {
this.examquestionTypes = examquestionTypes;
}
/**
*
*/
public String getExamquestionValue() {
return examquestionValue;
}
/**
*
*/
public void setExamquestionValue(String examquestionValue) {
this.examquestionValue = examquestionValue;
}
/**
*
*/
public Integer getExamquestionSequence() {
return examquestionSequence;
}
/**
*
*/
public void setExamquestionSequence(Integer examquestionSequence) {
this.examquestionSequence = examquestionSequence;
}
@Override
public String toString() {
return "ExampapertopicView{" +
", examquestionName=" + examquestionName +
", examquestionOptions=" + examquestionOptions +
", examquestionAnswer=" + examquestionAnswer +
", examquestionAnalysis=" + examquestionAnalysis +
", examquestionSequence=" + examquestionSequence +
", exampaperName=" + exampaperName +
", exampaperDate=" + exampaperDate +
", exampaperMyscore=" + exampaperMyscore +
", exampaperDelete=" + exampaperDelete +
"} " + super.toString();
}
}

@ -0,0 +1,72 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.ExamquestionEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("examquestion")
public class ExamquestionView extends ExamquestionEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
/**
*
*/
@ColumnInfo(comment="题目类型的字典表值",type="varchar(200)")
private String examquestionValue;
public ExamquestionView() {
}
public ExamquestionView(ExamquestionEntity examquestionEntity) {
try {
BeanUtils.copyProperties(this, examquestionEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//当前表的
/**
*
*/
public String getExamquestionValue() {
return examquestionValue;
}
/**
*
*/
public void setExamquestionValue(String examquestionValue) {
this.examquestionValue = examquestionValue;
}
@Override
public String toString() {
return "ExamquestionView{" +
", examquestionValue=" + examquestionValue +
"} " + super.toString();
}
}

@ -0,0 +1,329 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.ExamrecordEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("examrecord")
public class ExamrecordView extends ExamrecordEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
//级联表 心理测评表
/**
*
*/
@ColumnInfo(comment="心理测评名称",type="varchar(200)")
private String exampaperName;
/**
* ()
*/
@ColumnInfo(comment="心理测评时长(分钟)",type="int(11)")
private Integer exampaperDate;
/**
*
*/
@ColumnInfo(comment="心理测评总分数",type="int(20)")
private Integer exampaperMyscore;
/**
*
*/
@ColumnInfo(comment="心理测评状态",type="int(11)")
private Integer exampaperTypes;
/**
*
*/
@ColumnInfo(comment="心理测评状态的字典表值",type="varchar(200)")
private String exampaperValue;
/**
*
*/
@ColumnInfo(comment="组卷方式",type="int(11)")
private Integer zujuanTypes;
/**
*
*/
@ColumnInfo(comment="组卷方式的字典表值",type="varchar(200)")
private String zujuanValue;
/**
* 1 2
*/
@ColumnInfo(comment="逻辑删除1代表未删除 2代表已删除",type="int(255)")
private Integer exampaperDelete;
//级联表 用户
/**
*
*/
@ColumnInfo(comment="用户姓名",type="varchar(200)")
private String yonghuName;
/**
*
*/
@ColumnInfo(comment="用户头像",type="varchar(200)")
private String yonghuPhoto;
/**
*
*/
@ColumnInfo(comment="身份证号",type="varchar(200)")
private String yonghuIdNumber;
/**
*
*/
@ColumnInfo(comment="联系方式",type="varchar(200)")
private String yonghuPhone;
/**
*
*/
@ColumnInfo(comment="电子邮箱",type="varchar(200)")
private String yonghuEmail;
/**
*
*/
@ColumnInfo(comment="逻辑删除",type="int(11)")
private Integer yonghuDelete;
public ExamrecordView() {
}
public ExamrecordView(ExamrecordEntity examrecordEntity) {
try {
BeanUtils.copyProperties(this, examrecordEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//级联表的get和set 心理测评表
/**
*
*/
public String getExampaperName() {
return exampaperName;
}
/**
*
*/
public void setExampaperName(String exampaperName) {
this.exampaperName = exampaperName;
}
/**
* ()
*/
public Integer getExampaperDate() {
return exampaperDate;
}
/**
* ()
*/
public void setExampaperDate(Integer exampaperDate) {
this.exampaperDate = exampaperDate;
}
/**
*
*/
public Integer getExampaperMyscore() {
return exampaperMyscore;
}
/**
*
*/
public void setExampaperMyscore(Integer exampaperMyscore) {
this.exampaperMyscore = exampaperMyscore;
}
/**
*
*/
public Integer getExampaperTypes() {
return exampaperTypes;
}
/**
*
*/
public void setExampaperTypes(Integer exampaperTypes) {
this.exampaperTypes = exampaperTypes;
}
/**
*
*/
public String getExampaperValue() {
return exampaperValue;
}
/**
*
*/
public void setExampaperValue(String exampaperValue) {
this.exampaperValue = exampaperValue;
}
/**
*
*/
public Integer getZujuanTypes() {
return zujuanTypes;
}
/**
*
*/
public void setZujuanTypes(Integer zujuanTypes) {
this.zujuanTypes = zujuanTypes;
}
/**
*
*/
public String getZujuanValue() {
return zujuanValue;
}
/**
*
*/
public void setZujuanValue(String zujuanValue) {
this.zujuanValue = zujuanValue;
}
/**
* 1 2
*/
public Integer getExampaperDelete() {
return exampaperDelete;
}
/**
* 1 2
*/
public void setExampaperDelete(Integer exampaperDelete) {
this.exampaperDelete = exampaperDelete;
}
//级联表的get和set 用户
/**
*
*/
public String getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
@Override
public String toString() {
return "ExamrecordView{" +
", yonghuName=" + yonghuName +
", yonghuPhoto=" + yonghuPhoto +
", yonghuIdNumber=" + yonghuIdNumber +
", yonghuPhone=" + yonghuPhone +
", yonghuEmail=" + yonghuEmail +
", yonghuDelete=" + yonghuDelete +
", exampaperName=" + exampaperName +
", exampaperDate=" + exampaperDate +
", exampaperMyscore=" + exampaperMyscore +
", exampaperDelete=" + exampaperDelete +
"} " + super.toString();
}
}

@ -0,0 +1,313 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.ExamredetailsEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("examredetails")
public class ExamredetailsView extends ExamredetailsEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
//级联表 题目表
/**
*
*/
@ColumnInfo(comment="题目名称",type="varchar(200)")
private String examquestionName;
/**
* json
*/
@ColumnInfo(comment="选项json字符串",type="longtext")
private String examquestionOptions;
/**
*
*/
@ColumnInfo(comment="正确答案",type="varchar(200)")
private String examquestionAnswer;
/**
*
*/
@ColumnInfo(comment="答案解析",type="longtext")
private String examquestionAnalysis;
/**
*
*/
@ColumnInfo(comment="题目类型",type="int(20)")
private Integer examquestionTypes;
/**
*
*/
@ColumnInfo(comment="题目类型的字典表值",type="varchar(200)")
private String examquestionValue;
/**
*
*/
@ColumnInfo(comment="题目排序,值越大排越前面",type="int(20)")
private Integer examquestionSequence;
//级联表 用户
/**
*
*/
@ColumnInfo(comment="用户姓名",type="varchar(200)")
private String yonghuName;
/**
*
*/
@ColumnInfo(comment="用户头像",type="varchar(200)")
private String yonghuPhoto;
/**
*
*/
@ColumnInfo(comment="身份证号",type="varchar(200)")
private String yonghuIdNumber;
/**
*
*/
@ColumnInfo(comment="联系方式",type="varchar(200)")
private String yonghuPhone;
/**
*
*/
@ColumnInfo(comment="电子邮箱",type="varchar(200)")
private String yonghuEmail;
/**
*
*/
@ColumnInfo(comment="逻辑删除",type="int(11)")
private Integer yonghuDelete;
public ExamredetailsView() {
}
public ExamredetailsView(ExamredetailsEntity examredetailsEntity) {
try {
BeanUtils.copyProperties(this, examredetailsEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//级联表的get和set 题目表
/**
*
*/
public String getExamquestionName() {
return examquestionName;
}
/**
*
*/
public void setExamquestionName(String examquestionName) {
this.examquestionName = examquestionName;
}
/**
* json
*/
public String getExamquestionOptions() {
return examquestionOptions;
}
/**
* json
*/
public void setExamquestionOptions(String examquestionOptions) {
this.examquestionOptions = examquestionOptions;
}
/**
*
*/
public String getExamquestionAnswer() {
return examquestionAnswer;
}
/**
*
*/
public void setExamquestionAnswer(String examquestionAnswer) {
this.examquestionAnswer = examquestionAnswer;
}
/**
*
*/
public String getExamquestionAnalysis() {
return examquestionAnalysis;
}
/**
*
*/
public void setExamquestionAnalysis(String examquestionAnalysis) {
this.examquestionAnalysis = examquestionAnalysis;
}
/**
*
*/
public Integer getExamquestionTypes() {
return examquestionTypes;
}
/**
*
*/
public void setExamquestionTypes(Integer examquestionTypes) {
this.examquestionTypes = examquestionTypes;
}
/**
*
*/
public String getExamquestionValue() {
return examquestionValue;
}
/**
*
*/
public void setExamquestionValue(String examquestionValue) {
this.examquestionValue = examquestionValue;
}
/**
*
*/
public Integer getExamquestionSequence() {
return examquestionSequence;
}
/**
*
*/
public void setExamquestionSequence(Integer examquestionSequence) {
this.examquestionSequence = examquestionSequence;
}
//级联表的get和set 用户
/**
*
*/
public String getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
@Override
public String toString() {
return "ExamredetailsView{" +
", yonghuName=" + yonghuName +
", yonghuPhoto=" + yonghuPhoto +
", yonghuIdNumber=" + yonghuIdNumber +
", yonghuPhone=" + yonghuPhone +
", yonghuEmail=" + yonghuEmail +
", yonghuDelete=" + yonghuDelete +
", examquestionName=" + examquestionName +
", examquestionOptions=" + examquestionOptions +
", examquestionAnswer=" + examquestionAnswer +
", examquestionAnalysis=" + examquestionAnalysis +
", examquestionSequence=" + examquestionSequence +
"} " + super.toString();
}
}

@ -0,0 +1,72 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.NewsEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("news")
public class NewsView extends NewsEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
/**
*
*/
@ColumnInfo(comment="公告类型的字典表值",type="varchar(200)")
private String newsValue;
public NewsView() {
}
public NewsView(NewsEntity newsEntity) {
try {
BeanUtils.copyProperties(this, newsEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//当前表的
/**
*
*/
public String getNewsValue() {
return newsValue;
}
/**
*
*/
public void setNewsValue(String newsValue) {
this.newsValue = newsValue;
}
@Override
public String toString() {
return "NewsView{" +
", newsValue=" + newsValue +
"} " + super.toString();
}
}

@ -0,0 +1,372 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.XinlijiankangCollectionEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("xinlijiankang_collection")
public class XinlijiankangCollectionView extends XinlijiankangCollectionEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
/**
*
*/
@ColumnInfo(comment="类型的字典表值",type="varchar(200)")
private String xinlijiankangCollectionValue;
//级联表 心理健康
/**
*
*/
@ColumnInfo(comment="心理健康标题",type="varchar(200)")
private String xinlijiankangName;
/**
*
*/
@ColumnInfo(comment="心理健康照片",type="varchar(200)")
private String xinlijiankangPhoto;
/**
*
*/
@ColumnInfo(comment="心理健康视频",type="varchar(200)")
private String xinlijiankangVideo;
/**
*
*/
@ColumnInfo(comment="心理健康类型",type="int(11)")
private Integer xinlijiankangTypes;
/**
*
*/
@ColumnInfo(comment="心理健康类型的字典表值",type="varchar(200)")
private String xinlijiankangValue;
/**
*
*/
@ColumnInfo(comment="赞",type="int(11)")
private Integer zanNumber;
/**
*
*/
@ColumnInfo(comment="踩",type="int(11)")
private Integer caiNumber;
/**
*
*/
@ColumnInfo(comment="逻辑删除",type="int(11)")
private Integer xinlijiankangDelete;
/**
*
*/
@ColumnInfo(comment="心理健康详情",type="text")
private String xinlijiankangContent;
//级联表 用户
/**
*
*/
@ColumnInfo(comment="用户姓名",type="varchar(200)")
private String yonghuName;
/**
*
*/
@ColumnInfo(comment="用户头像",type="varchar(200)")
private String yonghuPhoto;
/**
*
*/
@ColumnInfo(comment="身份证号",type="varchar(200)")
private String yonghuIdNumber;
/**
*
*/
@ColumnInfo(comment="联系方式",type="varchar(200)")
private String yonghuPhone;
/**
*
*/
@ColumnInfo(comment="电子邮箱",type="varchar(200)")
private String yonghuEmail;
/**
*
*/
@ColumnInfo(comment="逻辑删除",type="int(11)")
private Integer yonghuDelete;
public XinlijiankangCollectionView() {
}
public XinlijiankangCollectionView(XinlijiankangCollectionEntity xinlijiankangCollectionEntity) {
try {
BeanUtils.copyProperties(this, xinlijiankangCollectionEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//当前表的
/**
*
*/
public String getXinlijiankangCollectionValue() {
return xinlijiankangCollectionValue;
}
/**
*
*/
public void setXinlijiankangCollectionValue(String xinlijiankangCollectionValue) {
this.xinlijiankangCollectionValue = xinlijiankangCollectionValue;
}
//级联表的get和set 心理健康
/**
*
*/
public String getXinlijiankangName() {
return xinlijiankangName;
}
/**
*
*/
public void setXinlijiankangName(String xinlijiankangName) {
this.xinlijiankangName = xinlijiankangName;
}
/**
*
*/
public String getXinlijiankangPhoto() {
return xinlijiankangPhoto;
}
/**
*
*/
public void setXinlijiankangPhoto(String xinlijiankangPhoto) {
this.xinlijiankangPhoto = xinlijiankangPhoto;
}
/**
*
*/
public String getXinlijiankangVideo() {
return xinlijiankangVideo;
}
/**
*
*/
public void setXinlijiankangVideo(String xinlijiankangVideo) {
this.xinlijiankangVideo = xinlijiankangVideo;
}
/**
*
*/
public Integer getXinlijiankangTypes() {
return xinlijiankangTypes;
}
/**
*
*/
public void setXinlijiankangTypes(Integer xinlijiankangTypes) {
this.xinlijiankangTypes = xinlijiankangTypes;
}
/**
*
*/
public String getXinlijiankangValue() {
return xinlijiankangValue;
}
/**
*
*/
public void setXinlijiankangValue(String xinlijiankangValue) {
this.xinlijiankangValue = xinlijiankangValue;
}
/**
*
*/
public Integer getZanNumber() {
return zanNumber;
}
/**
*
*/
public void setZanNumber(Integer zanNumber) {
this.zanNumber = zanNumber;
}
/**
*
*/
public Integer getCaiNumber() {
return caiNumber;
}
/**
*
*/
public void setCaiNumber(Integer caiNumber) {
this.caiNumber = caiNumber;
}
/**
*
*/
public Integer getXinlijiankangDelete() {
return xinlijiankangDelete;
}
/**
*
*/
public void setXinlijiankangDelete(Integer xinlijiankangDelete) {
this.xinlijiankangDelete = xinlijiankangDelete;
}
/**
*
*/
public String getXinlijiankangContent() {
return xinlijiankangContent;
}
/**
*
*/
public void setXinlijiankangContent(String xinlijiankangContent) {
this.xinlijiankangContent = xinlijiankangContent;
}
//级联表的get和set 用户
/**
*
*/
public String getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
@Override
public String toString() {
return "XinlijiankangCollectionView{" +
", xinlijiankangCollectionValue=" + xinlijiankangCollectionValue +
", yonghuName=" + yonghuName +
", yonghuPhoto=" + yonghuPhoto +
", yonghuIdNumber=" + yonghuIdNumber +
", yonghuPhone=" + yonghuPhone +
", yonghuEmail=" + yonghuEmail +
", yonghuDelete=" + yonghuDelete +
", xinlijiankangName=" + xinlijiankangName +
", xinlijiankangPhoto=" + xinlijiankangPhoto +
", xinlijiankangVideo=" + xinlijiankangVideo +
", zanNumber=" + zanNumber +
", caiNumber=" + caiNumber +
", xinlijiankangDelete=" + xinlijiankangDelete +
", xinlijiankangContent=" + xinlijiankangContent +
"} " + super.toString();
}
}

@ -0,0 +1,353 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.XinlijiankangLiuyanEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("xinlijiankang_liuyan")
public class XinlijiankangLiuyanView extends XinlijiankangLiuyanEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
//级联表 心理健康
/**
*
*/
@ColumnInfo(comment="心理健康标题",type="varchar(200)")
private String xinlijiankangName;
/**
*
*/
@ColumnInfo(comment="心理健康照片",type="varchar(200)")
private String xinlijiankangPhoto;
/**
*
*/
@ColumnInfo(comment="心理健康视频",type="varchar(200)")
private String xinlijiankangVideo;
/**
*
*/
@ColumnInfo(comment="心理健康类型",type="int(11)")
private Integer xinlijiankangTypes;
/**
*
*/
@ColumnInfo(comment="心理健康类型的字典表值",type="varchar(200)")
private String xinlijiankangValue;
/**
*
*/
@ColumnInfo(comment="赞",type="int(11)")
private Integer zanNumber;
/**
*
*/
@ColumnInfo(comment="踩",type="int(11)")
private Integer caiNumber;
/**
*
*/
@ColumnInfo(comment="逻辑删除",type="int(11)")
private Integer xinlijiankangDelete;
/**
*
*/
@ColumnInfo(comment="心理健康详情",type="text")
private String xinlijiankangContent;
//级联表 用户
/**
*
*/
@ColumnInfo(comment="用户姓名",type="varchar(200)")
private String yonghuName;
/**
*
*/
@ColumnInfo(comment="用户头像",type="varchar(200)")
private String yonghuPhoto;
/**
*
*/
@ColumnInfo(comment="身份证号",type="varchar(200)")
private String yonghuIdNumber;
/**
*
*/
@ColumnInfo(comment="联系方式",type="varchar(200)")
private String yonghuPhone;
/**
*
*/
@ColumnInfo(comment="电子邮箱",type="varchar(200)")
private String yonghuEmail;
/**
*
*/
@ColumnInfo(comment="逻辑删除",type="int(11)")
private Integer yonghuDelete;
public XinlijiankangLiuyanView() {
}
public XinlijiankangLiuyanView(XinlijiankangLiuyanEntity xinlijiankangLiuyanEntity) {
try {
BeanUtils.copyProperties(this, xinlijiankangLiuyanEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//级联表的get和set 心理健康
/**
*
*/
public String getXinlijiankangName() {
return xinlijiankangName;
}
/**
*
*/
public void setXinlijiankangName(String xinlijiankangName) {
this.xinlijiankangName = xinlijiankangName;
}
/**
*
*/
public String getXinlijiankangPhoto() {
return xinlijiankangPhoto;
}
/**
*
*/
public void setXinlijiankangPhoto(String xinlijiankangPhoto) {
this.xinlijiankangPhoto = xinlijiankangPhoto;
}
/**
*
*/
public String getXinlijiankangVideo() {
return xinlijiankangVideo;
}
/**
*
*/
public void setXinlijiankangVideo(String xinlijiankangVideo) {
this.xinlijiankangVideo = xinlijiankangVideo;
}
/**
*
*/
public Integer getXinlijiankangTypes() {
return xinlijiankangTypes;
}
/**
*
*/
public void setXinlijiankangTypes(Integer xinlijiankangTypes) {
this.xinlijiankangTypes = xinlijiankangTypes;
}
/**
*
*/
public String getXinlijiankangValue() {
return xinlijiankangValue;
}
/**
*
*/
public void setXinlijiankangValue(String xinlijiankangValue) {
this.xinlijiankangValue = xinlijiankangValue;
}
/**
*
*/
public Integer getZanNumber() {
return zanNumber;
}
/**
*
*/
public void setZanNumber(Integer zanNumber) {
this.zanNumber = zanNumber;
}
/**
*
*/
public Integer getCaiNumber() {
return caiNumber;
}
/**
*
*/
public void setCaiNumber(Integer caiNumber) {
this.caiNumber = caiNumber;
}
/**
*
*/
public Integer getXinlijiankangDelete() {
return xinlijiankangDelete;
}
/**
*
*/
public void setXinlijiankangDelete(Integer xinlijiankangDelete) {
this.xinlijiankangDelete = xinlijiankangDelete;
}
/**
*
*/
public String getXinlijiankangContent() {
return xinlijiankangContent;
}
/**
*
*/
public void setXinlijiankangContent(String xinlijiankangContent) {
this.xinlijiankangContent = xinlijiankangContent;
}
//级联表的get和set 用户
/**
*
*/
public String getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
@Override
public String toString() {
return "XinlijiankangLiuyanView{" +
", yonghuName=" + yonghuName +
", yonghuPhoto=" + yonghuPhoto +
", yonghuIdNumber=" + yonghuIdNumber +
", yonghuPhone=" + yonghuPhone +
", yonghuEmail=" + yonghuEmail +
", yonghuDelete=" + yonghuDelete +
", xinlijiankangName=" + xinlijiankangName +
", xinlijiankangPhoto=" + xinlijiankangPhoto +
", xinlijiankangVideo=" + xinlijiankangVideo +
", zanNumber=" + zanNumber +
", caiNumber=" + caiNumber +
", xinlijiankangDelete=" + xinlijiankangDelete +
", xinlijiankangContent=" + xinlijiankangContent +
"} " + super.toString();
}
}

@ -0,0 +1,72 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.XinlijiankangEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("xinlijiankang")
public class XinlijiankangView extends XinlijiankangEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
/**
*
*/
@ColumnInfo(comment="心理健康类型的字典表值",type="varchar(200)")
private String xinlijiankangValue;
public XinlijiankangView() {
}
public XinlijiankangView(XinlijiankangEntity xinlijiankangEntity) {
try {
BeanUtils.copyProperties(this, xinlijiankangEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//当前表的
/**
*
*/
public String getXinlijiankangValue() {
return xinlijiankangValue;
}
/**
*
*/
public void setXinlijiankangValue(String xinlijiankangValue) {
this.xinlijiankangValue = xinlijiankangValue;
}
@Override
public String toString() {
return "XinlijiankangView{" +
", xinlijiankangValue=" + xinlijiankangValue +
"} " + super.toString();
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save