博主介绍:?从事软件开发10年之余,专注于Java技术领域、Python人工智能及数据挖掘、小程序项目开发和Android项目开发等。CSDN、掘金、华为云、InfoQ、阿里云等平台优质作者?
🍅文末获取源码联系🍅
👇🏻 精彩专栏推荐订阅👇🏻 不然下次找不到哟
————————————————
计算机毕业设计《1000套》?
目录
1、项目介绍及开发技术
传统办法管理信息首先需要花费的时间比较多,其次数据出错率比较高,而且对错误的数据进行更改也比较困难,最后,检索数据费事费力。因此,在计算机上安装高校宣讲会管理系统软件来发挥其高效地信息处理的作用,可以规范信息管理流程,让管理工作可以系统化和程序化,同时,高校宣讲会管理系统的有效运用可以帮助管理人员准确快速地处理信息。
高校宣讲会管理系统在对开发工具的选择上也很慎重,为了便于开发实现,选择的开发工具为Eclipse,选择的数据库工具为Mysql。以此搭建开发环境实现高校宣讲会管理系统的功能。其中管理员管理用户,新闻公告。
高校宣讲会管理系统是一款运用软件开发技术设计实现的应用系统,在信息处理上可以达到快速的目的,不管是针对数据添加,数据维护和统计,以及数据查询等处理要求,高校宣讲会管理系统都可以轻松应对。
Java开发语言、SpringBoot、MyBatisPlus、MySQL数据库、Maven、IDEA开发工具、JDK1.8+、Vue、HTML、CSS、JS。
2、系统功能设计结构图
3、功能截图
登录
首页
论坛:用户可以在这里浏览和发布帖子。
企业:用户在这里可以看到各个企业的介绍以及联系方式并进行搜索。
公告信息:用户在这里可以看到各个公告信息并进行搜索。
宣讲会:用户可以在该模块下浏览以及搜索相关的宣讲会并进行报名预约。
个人中心
学生信息:管理员可以对学生信息的进行查询管理,可以删除学生信息、修改学生信息、新增学生信息等。
?企业信息管理:管理员可以查看已发布的企业信息数据,修改企业信息,企业信息作废,即可删除,还进行了对企业信息名称的模糊查询 企业信息信息的类型查询等等一些条件。
宣讲会管理:管理员根据宣讲会进行条件查询,还可以对宣讲会进行新增、修改、查询操作等等。
公告信息管理: 管理员可以根据公告信息进行新增、修改、查询操作等等。
4、数据库表结构设计
/*
SQLyog Ultimate v11.3 (64 bit)
MySQL - 5.7.32-log : Database - gaoxiaoxuanjianghuiguanli
*********************************************************************
*/
/*!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*/`gaoxiaoxuanjianghuiguanli` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `gaoxiaoxuanjianghuiguanli`;
/*Table structure for table `config` */
DROP TABLE IF EXISTS `config`;
CREATE TABLE `config` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(100) DEFAULT NULL COMMENT '配置参数名称',
`value` varchar(100) DEFAULT NULL COMMENT '配置参数值',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='配置文件';
/*Data for the table `config` */
insert into `config`(`id`,`name`,`value`) values (1,'轮播图1','upload/config1.jpg'),(2,'轮播图2','upload/config2.jpg'),(3,'轮播图3','upload/config3.jpg');
/*Table structure for table `dangqianqingkuang` */
DROP TABLE IF EXISTS `dangqianqingkuang`;
CREATE TABLE `dangqianqingkuang` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`yonghu_id` int(11) DEFAULT NULL COMMENT '学生',
`dangqianqingkuang_types` int(11) DEFAULT NULL COMMENT '就业状态 Search111',
`dangqianqingkuang_text` longtext COMMENT '备注',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '记录时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='就业情况';
/*Data for the table `dangqianqingkuang` */
insert into `dangqianqingkuang`(`id`,`yonghu_id`,`dangqianqingkuang_types`,`dangqianqingkuang_text`,`insert_time`,`create_time`) values (1,1,1,'备注1','2023-03-21 11:53:52','2023-03-21 11:53:52'),(2,3,2,'备注2','2023-03-21 11:53:52','2023-03-21 11:53:52'),(3,1,2,'备注3','2023-03-21 11:53:52','2023-03-21 11:53:52'),(4,3,1,'备注4','2023-03-21 11:53:52','2023-03-21 11:53:52'),(5,2,1,'备注5','2023-03-21 11:53:52','2023-03-21 11:53:52'),(6,3,1,'备注6','2023-03-21 11:53:52','2023-03-21 11:53:52'),(7,2,2,'备注7','2023-03-21 11:53:52','2023-03-21 11:53:52'),(8,3,1,'备注8','2023-03-21 11:53:52','2023-03-21 11:53:52'),(9,1,1,'备注9','2023-03-21 11:53:52','2023-03-21 11:53:52'),(10,3,1,'备注10','2023-03-21 11:53:52','2023-03-21 11:53:52'),(11,1,1,'备注11','2023-03-21 11:53:52','2023-03-21 11:53:52'),(12,2,1,'备注12','2023-03-21 11:53:52','2023-03-21 11:53:52'),(13,2,2,'备注13','2023-03-21 11:53:52','2023-03-21 11:53:52'),(14,1,2,'备注14','2023-03-21 11:53:52','2023-03-21 11:53:52'),(15,1,2,'123123123','2023-03-21 15:28:46','2023-03-21 15:28:46');
/*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 (20,'sex_types','性别',1,'男',NULL,NULL,'2023-03-21 11:53:20'),(21,'sex_types','性别',2,'女',NULL,NULL,'2023-03-21 11:53:20'),(22,'news_types','公告信息类型',1,'公告信息类型1',NULL,NULL,'2023-03-21 11:53:20'),(23,'news_types','公告信息类型',2,'公告信息类型2',NULL,NULL,'2023-03-21 11:53:20'),(24,'news_types','公告信息类型',3,'公告信息类型3',NULL,NULL,'2023-03-21 11:53:20'),(25,'zhuanye_types','专业',1,'专业1',NULL,NULL,'2023-03-21 11:53:20'),(26,'zhuanye_types','专业',2,'专业2',NULL,NULL,'2023-03-21 11:53:20'),(27,'zhuanye_types','专业',3,'专业3',NULL,NULL,'2023-03-21 11:53:20'),(28,'xueyuan_types','学院',1,'学院1',NULL,NULL,'2023-03-21 11:53:20'),(29,'xueyuan_types','学院',2,'学院2',NULL,NULL,'2023-03-21 11:53:20'),(30,'xueyuan_types','学院',3,'学院3',NULL,NULL,'2023-03-21 11:53:20'),(31,'gongsi_types','企业类型',1,'企业类型1',NULL,NULL,'2023-03-21 11:53:20'),(32,'gongsi_types','企业类型',2,'企业类型2',NULL,NULL,'2023-03-21 11:53:20'),(33,'gongsi_types','企业类型',3,'企业类型3',NULL,NULL,'2023-03-21 11:53:20'),(34,'xuanjianghui_types','宣讲会类型',1,'宣讲会类型1',NULL,NULL,'2023-03-21 11:53:20'),(35,'xuanjianghui_types','宣讲会类型',2,'宣讲会类型2',NULL,NULL,'2023-03-21 11:53:20'),(36,'xuanjianghui_types','宣讲会类型',3,'宣讲会类型3',NULL,NULL,'2023-03-21 11:53:20'),(37,'xianxia_types','线下面试',1,'是',NULL,NULL,'2023-03-21 11:53:20'),(38,'xianxia_types','线下面试',2,'否',NULL,NULL,'2023-03-21 11:53:21'),(39,'xuanjianghui_yesno_types','审核状态',1,'待审核',NULL,NULL,'2023-03-21 11:53:21'),(40,'xuanjianghui_yesno_types','审核状态',2,'同意',NULL,NULL,'2023-03-21 11:53:21'),(41,'xuanjianghui_yesno_types','审核状态',3,'拒绝',NULL,NULL,'2023-03-21 11:53:21'),(42,'xuanjianghui_collection_types','收藏表类型',1,'收藏',NULL,NULL,'2023-03-21 11:53:21'),(43,'dangqianqingkuang_types','就业状态',1,'已就业',NULL,NULL,'2023-03-21 11:53:21'),(44,'dangqianqingkuang_types','就业状态',2,'未就业',NULL,NULL,'2023-03-21 11:53:21'),(45,'forum_state_types','帖子状态',1,'发帖',NULL,NULL,'2023-03-21 11:53:21'),(46,'forum_state_types','帖子状态',2,'回帖',NULL,NULL,'2023-03-21 11:53:21');
/*Table structure for table `forum` */
DROP TABLE IF EXISTS `forum`;
CREATE TABLE `forum` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`forum_name` varchar(200) DEFAULT NULL COMMENT '帖子标题 Search111 ',
`gongsi_id` int(11) DEFAULT NULL COMMENT '企业',
`yonghu_id` int(11) DEFAULT NULL COMMENT '学生',
`users_id` int(11) DEFAULT NULL COMMENT '管理员',
`forum_content` longtext COMMENT '发布内容',
`super_ids` int(11) DEFAULT NULL COMMENT '父id',
`forum_state_types` int(11) DEFAULT NULL COMMENT '帖子状态',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '发帖时间',
`update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show2',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COMMENT='论坛';
/*Data for the table `forum` */
insert into `forum`(`id`,`forum_name`,`gongsi_id`,`yonghu_id`,`users_id`,`forum_content`,`super_ids`,`forum_state_types`,`insert_time`,`update_time`,`create_time`) values (1,'帖子标题1',NULL,1,NULL,'发布内容1',387,1,'2023-03-21 11:53:52','2023-03-21 11:53:52','2023-03-21 11:53:52'),(2,'帖子标题2',NULL,3,NULL,'发布内容2',114,1,'2023-03-21 11:53:52','2023-03-21 11:53:52','2023-03-21 11:53:52'),(3,'帖子标题3',NULL,1,NULL,'发布内容3',159,1,'2023-03-21 11:53:52','2023-03-21 11:53:52','2023-03-21 11:53:52'),(4,'帖子标题4',NULL,2,NULL,'发布内容4',195,1,'2023-03-21 11:53:52','2023-03-21 11:53:52','2023-03-21 11:53:52'),(5,'帖子标题5',NULL,3,NULL,'发布内容5',474,1,'2023-03-21 11:53:52','2023-03-21 11:53:52','2023-03-21 11:53:52'),(6,'帖子标题6',NULL,1,NULL,'发布内容6',280,1,'2023-03-21 11:53:52','2023-03-21 11:53:52','2023-03-21 11:53:52'),(7,'帖子标题7',NULL,1,NULL,'发布内容7',237,1,'2023-03-21 11:53:52','2023-03-21 11:53:52','2023-03-21 11:53:52'),(8,'帖子标题8',NULL,3,NULL,'发布内容8',422,1,'2023-03-21 11:53:52','2023-03-21 11:53:52','2023-03-21 11:53:52'),(9,'帖子标题9',NULL,3,NULL,'发布内容9',471,1,'2023-03-21 11:53:52','2023-03-21 11:53:52','2023-03-21 11:53:52'),(10,'帖子标题10',NULL,1,NULL,'发布内容10',422,1,'2023-03-21 11:53:52','2023-03-21 11:53:52','2023-03-21 11:53:52'),(11,'帖子标题11',NULL,1,NULL,'发布内容11',367,1,'2023-03-21 11:53:52','2023-03-21 11:53:52','2023-03-21 11:53:52'),(12,'帖子标题12',NULL,3,NULL,'发布内容12',7,1,'2023-03-21 11:53:52','2023-03-21 11:53:52','2023-03-21 11:53:52'),(13,'帖子标题13',NULL,1,NULL,'发布内容13',197,1,'2023-03-21 11:53:52','2023-03-21 11:53:52','2023-03-21 11:53:52'),(14,'帖子标题14',NULL,3,NULL,'发布内容14',208,1,'2023-03-21 11:53:52','2023-03-21 11:53:52','2023-03-21 11:53:52'),(15,NULL,NULL,1,NULL,'123123',14,2,'2023-03-21 15:28:02',NULL,'2023-03-21 15:28:02'),(16,NULL,1,NULL,NULL,'1213212',14,2,'2023-03-21 15:29:48',NULL,'2023-03-21 15:29:48'),(17,NULL,NULL,NULL,1,'1111111111',14,2,'2023-03-21 15:32:07',NULL,'2023-03-21 15:32:07');
/*Table structure for table `gongsi` */
DROP TABLE IF EXISTS `gongsi`;
CREATE TABLE `gongsi` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`username` varchar(200) DEFAULT NULL COMMENT '账户 ',
`password` varchar(200) DEFAULT NULL COMMENT '密码 ',
`gongsi_name` varchar(200) DEFAULT NULL COMMENT '企业名称 Search111 ',
`gongsi_types` int(11) DEFAULT NULL COMMENT '企业类型',
`gongsi_phone` varchar(200) DEFAULT NULL COMMENT '联系方式',
`gongsi_email` varchar(200) DEFAULT NULL COMMENT '邮箱',
`gongsi_photo` varchar(200) DEFAULT NULL COMMENT '企业封面',
`gongsi_content` longtext COMMENT '企业简介 ',
`gongsi_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 photoShow ',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='企业';
/*Data for the table `gongsi` */
insert into `gongsi`(`id`,`username`,`password`,`gongsi_name`,`gongsi_types`,`gongsi_phone`,`gongsi_email`,`gongsi_photo`,`gongsi_content`,`gongsi_delete`,`create_time`) values (1,'a1','123456','企业名称1',3,'17703786901','1@qq.com','upload/gongsi1.jpg','企业简介1',1,'2023-03-21 11:53:52'),(2,'a2','123456','企业名称2',1,'17703786902','2@qq.com','upload/gongsi2.jpg','企业简介2',1,'2023-03-21 11:53:52'),(3,'a3','123456','企业名称3',2,'17703786903','3@qq.com','upload/gongsi3.jpg','企业简介3',1,'2023-03-21 11:53:52');
/*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` longtext COMMENT '公告信息详情',
`news_delete` int(11) DEFAULT '1' 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`,`news_delete`,`create_time`) values (1,'公告信息标题1',3,'upload/news1.jpg','2023-03-21 11:53:52','公告信息详情1',1,'2023-03-21 11:53:52'),(2,'公告信息标题2',1,'upload/news2.jpg','2023-03-21 11:53:52','公告信息详情2',1,'2023-03-21 11:53:52'),(3,'公告信息标题3',2,'upload/news3.jpg','2023-03-21 11:53:52','公告信息详情3',1,'2023-03-21 11:53:52'),(4,'公告信息标题4',1,'upload/news4.jpg','2023-03-21 11:53:52','公告信息详情4',1,'2023-03-21 11:53:52'),(5,'公告信息标题5',2,'upload/news5.jpg','2023-03-21 11:53:52','公告信息详情5',1,'2023-03-21 11:53:52'),(6,'公告信息标题6',3,'upload/news6.jpg','2023-03-21 11:53:52','公告信息详情6',1,'2023-03-21 11:53:52'),(7,'公告信息标题7',3,'upload/news7.jpg','2023-03-21 11:53:52','公告信息详情7',1,'2023-03-21 11:53:52'),(8,'公告信息标题8',3,'upload/news8.jpg','2023-03-21 11:53:52','公告信息详情8',1,'2023-03-21 11:53:52'),(9,'公告信息标题9',1,'upload/news9.jpg','2023-03-21 11:53:52','公告信息详情9',1,'2023-03-21 11:53:52'),(10,'公告信息标题10',1,'upload/news10.jpg','2023-03-21 11:53:52','公告信息详情10',1,'2023-03-21 11:53:52'),(11,'公告信息标题11',3,'upload/news11.jpg','2023-03-21 11:53:52','公告信息详情11',1,'2023-03-21 11:53:52'),(12,'公告信息标题12',2,'upload/news12.jpg','2023-03-21 11:53:52','公告信息详情12',1,'2023-03-21 11:53:52'),(13,'公告信息标题13',2,'upload/news13.jpg','2023-03-21 11:53:52','公告信息详情13',1,'2023-03-21 11:53:52'),(14,'公告信息标题14',2,'upload/news14.jpg','2023-03-21 11:53:52','公告信息详情14',1,'2023-03-21 11:53:52');
/*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=5 DEFAULT CHARSET=utf8 COMMENT='token表';
/*Data for the table `token` */
insert into `token`(`id`,`userid`,`username`,`tablename`,`role`,`token`,`addtime`,`expiratedtime`) values (1,4,'123','yonghu','学生','pya4p8y482rwfgxojt4bxvtwyrarf63f','2023-03-21 13:09:58','2023-03-21 14:09:59'),(2,1,'a1','yonghu','学生','8ixk9x5mdlxip4d5jxgu5z69c9r7h1rx','2023-03-21 13:10:37','2023-03-21 16:27:45'),(3,1,'admin','users','管理员','m4wx576u121oyqg4vsyxvnzwftlvytdm','2023-03-21 13:15:29','2023-03-21 16:33:45'),(4,1,'a1','gongsi','企业','p71dubqfgzne92no0pw02u2d2c8fhjlt','2023-03-21 15:28:55','2023-03-21 16:28:55');
/*Table structure for table `users` */
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(100) NOT NULL COMMENT '采购员名',
`password` varchar(100) NOT NULL COMMENT '密码',
`role` varchar(100) DEFAULT '管理员' COMMENT '角色',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='管理员';
/*Data for the table `users` */
insert into `users`(`id`,`username`,`password`,`role`,`addtime`) values (1,'admin','admin','管理员','2023-03-21 11:53:20');
/*Table structure for table `xuanjianghui` */
DROP TABLE IF EXISTS `xuanjianghui`;
CREATE TABLE `xuanjianghui` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`gongsi_id` int(11) DEFAULT NULL COMMENT '企业',
`xuanjianghui_name` varchar(200) DEFAULT NULL COMMENT '宣讲会标题 Search111 ',
`xuanjianghui_photo` varchar(200) DEFAULT NULL COMMENT '宣讲会封面',
`xuanjianghui_daiyu` varchar(200) DEFAULT NULL COMMENT '企业资质',
`xuanjianghui_types` int(11) DEFAULT NULL COMMENT '宣讲会类型 Search111',
`zhuanye_types` int(11) DEFAULT NULL COMMENT '专业 Search111',
`xuanjianghui_gangwei` varchar(200) DEFAULT NULL COMMENT '招聘岗位 ',
`xuanjianghui_renshu_number` int(11) DEFAULT NULL COMMENT '招聘人数',
`xuanjianghui_time` timestamp NULL DEFAULT NULL COMMENT '宣讲时间',
`xianxia_types` int(11) DEFAULT NULL COMMENT '线下面试 Search111',
`xuanjianghui_content` longtext COMMENT '宣讲会详情',
`xuanjianghui_yesno_types` int(11) DEFAULT NULL COMMENT '审核状态 Search111 ',
`xuanjianghui_yesno_text` longtext COMMENT '审核回复',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='宣讲会';
/*Data for the table `xuanjianghui` */
insert into `xuanjianghui`(`id`,`gongsi_id`,`xuanjianghui_name`,`xuanjianghui_photo`,`xuanjianghui_daiyu`,`xuanjianghui_types`,`zhuanye_types`,`xuanjianghui_gangwei`,`xuanjianghui_renshu_number`,`xuanjianghui_time`,`xianxia_types`,`xuanjianghui_content`,`xuanjianghui_yesno_types`,`xuanjianghui_yesno_text`,`create_time`) values (1,2,'宣讲会标题1','upload/xuanjianghui1.jpg','企业资质1',2,1,'招聘岗位1',195,'2023-03-21 11:53:52',2,'宣讲会详情1',2,'同意','2023-03-21 11:53:52'),(2,3,'宣讲会标题2','upload/xuanjianghui2.jpg','企业资质2',1,1,'招聘岗位2',464,'2023-03-21 11:53:52',2,'宣讲会详情2',2,'同意','2023-03-21 11:53:52'),(3,2,'宣讲会标题3','upload/xuanjianghui3.jpg','企业资质3',2,3,'招聘岗位3',232,'2023-03-21 11:53:52',2,'宣讲会详情3',2,'同意','2023-03-21 11:53:52'),(4,1,'宣讲会标题4','upload/xuanjianghui4.jpg','企业资质4',3,3,'招聘岗位4',74,'2023-03-21 11:53:52',2,'宣讲会详情4',2,'同意','2023-03-21 11:53:52'),(5,2,'宣讲会标题5','upload/xuanjianghui5.jpg','企业资质5',2,3,'招聘岗位5',322,'2023-03-21 11:53:52',1,'宣讲会详情5',2,'同意','2023-03-21 11:53:52'),(6,3,'宣讲会标题6','upload/xuanjianghui6.jpg','企业资质6',1,2,'招聘岗位6',68,'2023-03-21 11:53:52',2,'宣讲会详情6',2,'同意','2023-03-21 11:53:52'),(7,2,'宣讲会标题7','upload/xuanjianghui7.jpg','企业资质7',1,3,'招聘岗位7',201,'2023-03-21 11:53:52',2,'宣讲会详情7',2,'同意','2023-03-21 11:53:52'),(8,2,'宣讲会标题8','upload/xuanjianghui1.jpg','企业资质8',3,3,'招聘岗位8',172,'2023-03-21 11:53:52',2,'宣讲会详情8',2,'同意','2023-03-21 11:53:52'),(9,3,'宣讲会标题9','upload/xuanjianghui2.jpg','企业资质9',2,3,'招聘岗位9',473,'2023-03-21 11:53:52',1,'宣讲会详情9',1,NULL,'2023-03-21 11:53:52'),(10,1,'宣讲会标题10','upload/xuanjianghui3.jpg','企业资质10',3,3,'招聘岗位10',51,'2023-03-21 11:53:52',1,'宣讲会详情10',1,NULL,'2023-03-21 11:53:52'),(11,1,'宣讲会标题11','upload/xuanjianghui4.jpg','企业资质11',2,2,'招聘岗位11',64,'2023-03-21 11:53:52',1,'宣讲会详情11',1,NULL,'2023-03-21 11:53:52'),(12,3,'宣讲会标题12','upload/xuanjianghui5.jpg','企业资质12',3,2,'招聘岗位12',158,'2023-03-21 11:53:52',1,'宣讲会详情12',1,NULL,'2023-03-21 11:53:52'),(13,2,'宣讲会标题13','upload/xuanjianghui6.jpg','企业资质13',2,1,'招聘岗位13',19,'2023-03-21 11:53:52',1,'宣讲会详情13',1,NULL,'2023-03-21 11:53:52'),(14,2,'宣讲会标题14','upload/xuanjianghui7.jpg','企业资质14',1,3,'招聘岗位14',495,'2023-03-21 11:53:52',2,'宣讲会详情14',1,NULL,'2023-03-21 11:53:52'),(15,1,'申请宣讲会1111','/upload/1679383756491.jpg','123',3,3,'123',123,'2023-03-23 00:00:00',1,'<p>123</p>',2,'12','2023-03-21 15:29:26');
/*Table structure for table `xuanjianghui_collection` */
DROP TABLE IF EXISTS `xuanjianghui_collection`;
CREATE TABLE `xuanjianghui_collection` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`xuanjianghui_id` int(11) DEFAULT NULL COMMENT '宣讲会',
`yonghu_id` int(11) DEFAULT NULL COMMENT '学生',
`xuanjianghui_collection_types` int(11) DEFAULT NULL COMMENT '类型',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '收藏时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='宣讲会收藏';
/*Data for the table `xuanjianghui_collection` */
insert into `xuanjianghui_collection`(`id`,`xuanjianghui_id`,`yonghu_id`,`xuanjianghui_collection_types`,`insert_time`,`create_time`) values (1,1,3,1,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(2,2,3,1,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(3,3,3,1,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(4,4,3,1,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(5,5,3,1,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(6,6,3,1,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(9,9,3,1,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(10,10,3,1,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(11,11,3,1,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(12,12,3,1,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(13,13,3,1,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(14,14,3,1,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(16,8,1,1,'2023-03-21 15:28:35','2023-03-21 15:28:35');
/*Table structure for table `xuanjianghui_yuyue` */
DROP TABLE IF EXISTS `xuanjianghui_yuyue`;
CREATE TABLE `xuanjianghui_yuyue` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`xuanjianghui_yuyue_uuid_number` varchar(200) DEFAULT NULL COMMENT '报名编号 Search111 ',
`xuanjianghui_id` int(11) DEFAULT NULL COMMENT '宣讲会',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '报名时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8 COMMENT='宣讲会报名';
/*Data for the table `xuanjianghui_yuyue` */
insert into `xuanjianghui_yuyue`(`id`,`xuanjianghui_yuyue_uuid_number`,`xuanjianghui_id`,`yonghu_id`,`insert_time`,`create_time`) values (1,'1679370832132',1,2,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(2,'1679370832100',2,1,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(3,'1679370832076',3,3,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(4,'1679370832111',4,3,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(5,'1679370832123',5,2,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(6,'1679370832141',6,2,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(7,'1679370832130',7,2,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(8,'1679370832124',8,2,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(10,'1679370832139',10,3,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(11,'1679370832109',11,2,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(12,'1679370832089',12,2,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(13,'1679370832099',13,2,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(14,'1679370832045',14,3,'2023-03-21 11:53:52','2023-03-21 11:53:52'),(19,'1679383666214',7,1,'2023-03-21 15:27:46','2023-03-21 15:27: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 ',
`yonghu_photo` varchar(255) DEFAULT NULL COMMENT '头像',
`yonghu_phone` varchar(200) DEFAULT NULL COMMENT '学生手机号',
`yonghu_id_number` varchar(200) DEFAULT NULL COMMENT '学生身份证号 ',
`yonghu_email` varchar(200) DEFAULT NULL COMMENT '邮箱',
`sex_types` int(11) DEFAULT NULL COMMENT '性别 Search111 ',
`xueyuan_types` int(11) DEFAULT NULL COMMENT '学院 Search111 ',
`zhuanye_types` int(11) DEFAULT NULL COMMENT '专业 Search111 ',
`yonghu_delete` int(11) DEFAULT '1' COMMENT '假删',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='学生';
/*Data for the table `yonghu` */
insert into `yonghu`(`id`,`username`,`password`,`yonghu_name`,`yonghu_photo`,`yonghu_phone`,`yonghu_id_number`,`yonghu_email`,`sex_types`,`xueyuan_types`,`zhuanye_types`,`yonghu_delete`,`create_time`) values (1,'a1','123456','学生姓名1','upload/yonghu1.jpg','17703786901','410224199010102001','1@qq.com',2,2,2,1,'2023-03-21 11:53:52'),(2,'a2','123456','学生姓名2','upload/yonghu2.jpg','17703786902','410224199010102002','2@qq.com',1,1,1,1,'2023-03-21 11:53:52'),(3,'a3','123456','学生姓名3','upload/yonghu3.jpg','17703786903','410224199010102003','3@qq.com',1,3,3,1,'2023-03-21 11:53:52');
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
5、关键代码
/**
* 宣讲会
* 后端接口
* @author 学长编程
* @email
* WeChat jsjbysj88
*/
@RestController
@Controller
@RequestMapping("/xuanjianghui")
public class XuanjianghuiController {
private static final Logger logger = LoggerFactory.getLogger(XuanjianghuiController.class);
private static final String TABLE_NAME = "xuanjianghui";
@Autowired
private XuanjianghuiService xuanjianghuiService;
@Autowired
private TokenService tokenService;
@Autowired
private DangqianqingkuangService dangqianqingkuangService;//就业情况
@Autowired
private DictionaryService dictionaryService;//字典表
@Autowired
private ForumService forumService;//论坛
@Autowired
private GongsiService gongsiService;//企业
@Autowired
private NewsService newsService;//公告信息
@Autowired
private XuanjianghuiCollectionService xuanjianghuiCollectionService;//宣讲会收藏
@Autowired
private XuanjianghuiYuyueService xuanjianghuiYuyueService;//宣讲会报名
@Autowired
private YonghuService yonghuService;//学生
@Autowired
private UsersService usersService;//管理员
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永不会进入");
else if("学生".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
else if("企业".equals(role))
params.put("gongsiId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = xuanjianghuiService.queryPage(params);
//字典表数据转换
List<XuanjianghuiView> list =(List<XuanjianghuiView>)page.getList();
for(XuanjianghuiView 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);
XuanjianghuiEntity xuanjianghui = xuanjianghuiService.selectById(id);
if(xuanjianghui !=null){
//entity转view
XuanjianghuiView view = new XuanjianghuiView();
BeanUtils.copyProperties( xuanjianghui , view );//把实体数据重构到view中
//级联表 企业
//级联表
GongsiEntity gongsi = gongsiService.selectById(xuanjianghui.getGongsiId());
if(gongsi != null){
BeanUtils.copyProperties( gongsi , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "gongsiId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setGongsiId(gongsi.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody XuanjianghuiEntity xuanjianghui, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,xuanjianghui:{}",this.getClass().getName(),xuanjianghui.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("企业".equals(role))
xuanjianghui.setGongsiId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<XuanjianghuiEntity> queryWrapper = new EntityWrapper<XuanjianghuiEntity>()
.eq("gongsi_id", xuanjianghui.getGongsiId())
.eq("xuanjianghui_name", xuanjianghui.getXuanjianghuiName())
.eq("xuanjianghui_daiyu", xuanjianghui.getXuanjianghuiDaiyu())
.eq("xuanjianghui_types", xuanjianghui.getXuanjianghuiTypes())
.eq("zhuanye_types", xuanjianghui.getZhuanyeTypes())
.eq("xuanjianghui_gangwei", xuanjianghui.getXuanjianghuiGangwei())
.eq("xuanjianghui_renshu_number", xuanjianghui.getXuanjianghuiRenshuNumber())
.eq("xianxia_types", xuanjianghui.getXianxiaTypes())
.in("xuanjianghui_yesno_types", new Integer[]{1,2})
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
XuanjianghuiEntity xuanjianghuiEntity = xuanjianghuiService.selectOne(queryWrapper);
if(xuanjianghuiEntity==null){
xuanjianghui.setXuanjianghuiYesnoTypes(1);
xuanjianghui.setCreateTime(new Date());
xuanjianghuiService.insert(xuanjianghui);
return R.ok();
}else {
if(xuanjianghuiEntity.getXuanjianghuiYesnoTypes()==1)
return R.error(511,"有相同的待审核的数据");
else if(xuanjianghuiEntity.getXuanjianghuiYesnoTypes()==2)
return R.error(511,"有相同的审核通过的数据");
else
return R.error(511,"表中有相同数据");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody XuanjianghuiEntity xuanjianghui, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,xuanjianghui:{}",this.getClass().getName(),xuanjianghui.toString());
XuanjianghuiEntity oldXuanjianghuiEntity = xuanjianghuiService.selectById(xuanjianghui.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("企业".equals(role))
// xuanjianghui.setGongsiId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
if("".equals(xuanjianghui.getXuanjianghuiPhoto()) || "null".equals(xuanjianghui.getXuanjianghuiPhoto())){
xuanjianghui.setXuanjianghuiPhoto(null);
}
xuanjianghuiService.updateById(xuanjianghui);//根据id更新
return R.ok();
}
/**
* 审核
*/
@RequestMapping("/shenhe")
public R shenhe(@RequestBody XuanjianghuiEntity xuanjianghuiEntity, HttpServletRequest request){
logger.debug("shenhe方法:,,Controller:{},,xuanjianghuiEntity:{}",this.getClass().getName(),xuanjianghuiEntity.toString());
XuanjianghuiEntity oldXuanjianghui = xuanjianghuiService.selectById(xuanjianghuiEntity.getId());//查询原先数据
// if(xuanjianghuiEntity.getXuanjianghuiYesnoTypes() == 2){//通过
// xuanjianghuiEntity.setXuanjianghuiTypes();
// }else if(xuanjianghuiEntity.getXuanjianghuiYesnoTypes() == 3){//拒绝
// xuanjianghuiEntity.setXuanjianghuiTypes();
// }
xuanjianghuiService.updateById(xuanjianghuiEntity);//审核
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
List<XuanjianghuiEntity> oldXuanjianghuiList =xuanjianghuiService.selectBatchIds(Arrays.asList(ids));//要删除的数据
xuanjianghuiService.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<XuanjianghuiEntity> xuanjianghuiList = 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){
//循环
XuanjianghuiEntity xuanjianghuiEntity = new XuanjianghuiEntity();
// xuanjianghuiEntity.setGongsiId(Integer.valueOf(data.get(0))); //企业 要改的
// xuanjianghuiEntity.setXuanjianghuiName(data.get(0)); //宣讲会标题 要改的
// xuanjianghuiEntity.setXuanjianghuiPhoto("");//详情和图片
// xuanjianghuiEntity.setXuanjianghuiDaiyu(data.get(0)); //企业资质 要改的
// xuanjianghuiEntity.setXuanjianghuiTypes(Integer.valueOf(data.get(0))); //宣讲会类型 要改的
// xuanjianghuiEntity.setZhuanyeTypes(Integer.valueOf(data.get(0))); //专业 要改的
// xuanjianghuiEntity.setXuanjianghuiGangwei(data.get(0)); //招聘岗位 要改的
// xuanjianghuiEntity.setXuanjianghuiRenshuNumber(Integer.valueOf(data.get(0))); //招聘人数 要改的
// xuanjianghuiEntity.setXuanjianghuiTime(sdf.parse(data.get(0))); //宣讲时间 要改的
// xuanjianghuiEntity.setXianxiaTypes(Integer.valueOf(data.get(0))); //线下面试 要改的
// xuanjianghuiEntity.setXuanjianghuiContent("");//详情和图片
// xuanjianghuiEntity.setXuanjianghuiYesnoTypes(Integer.valueOf(data.get(0))); //审核状态 要改的
// xuanjianghuiEntity.setXuanjianghuiYesnoText(data.get(0)); //审核回复 要改的
// xuanjianghuiEntity.setCreateTime(date);//时间
xuanjianghuiList.add(xuanjianghuiEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
xuanjianghuiService.insertBatch(xuanjianghuiList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
* 个性推荐
*/
@IgnoreAuth
@RequestMapping("/gexingtuijian")
public R gexingtuijian(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("gexingtuijian方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
CommonUtil.checkMap(params);
List<XuanjianghuiView> returnXuanjianghuiViewList = new ArrayList<>();
//查看收藏
Map<String, Object> params1 = new HashMap<>(params);params1.put("sort","id");params1.put("yonghuId",request.getSession().getAttribute("userId"));
PageUtils pageUtils = xuanjianghuiCollectionService.queryPage(params1);
List<XuanjianghuiCollectionView> collectionViewsList =(List<XuanjianghuiCollectionView>)pageUtils.getList();
Map<Integer,Integer> typeMap=new HashMap<>();//购买的类型list
for(XuanjianghuiCollectionView collectionView:collectionViewsList){
Integer xuanjianghuiTypes = collectionView.getXuanjianghuiTypes();
if(typeMap.containsKey(xuanjianghuiTypes)){
typeMap.put(xuanjianghuiTypes,typeMap.get(xuanjianghuiTypes)+1);
}else{
typeMap.put(xuanjianghuiTypes,1);
}
}
List<Integer> typeList = new ArrayList<>();//排序后的有序的类型 按最多到最少
typeMap.entrySet().stream().sorted((o1, o2) -> o2.getValue() - o1.getValue()).forEach(e -> typeList.add(e.getKey()));//排序
Integer limit = Integer.valueOf(String.valueOf(params.get("limit")));
for(Integer type:typeList){
Map<String, Object> params2 = new HashMap<>(params);params2.put("xuanjianghuiTypes",type);
PageUtils pageUtils1 = xuanjianghuiService.queryPage(params2);
List<XuanjianghuiView> xuanjianghuiViewList =(List<XuanjianghuiView>)pageUtils1.getList();
returnXuanjianghuiViewList.addAll(xuanjianghuiViewList);
if(returnXuanjianghuiViewList.size()>= limit) break;//返回的推荐数量大于要的数量 跳出循环
}
//正常查询出来商品,用于补全推荐缺少的数据
PageUtils page = xuanjianghuiService.queryPage(params);
if(returnXuanjianghuiViewList.size()<limit){//返回数量还是小于要求数量
int toAddNum = limit - returnXuanjianghuiViewList.size();//要添加的数量
List<XuanjianghuiView> xuanjianghuiViewList =(List<XuanjianghuiView>)page.getList();
for(XuanjianghuiView xuanjianghuiView:xuanjianghuiViewList){
Boolean addFlag = true;
for(XuanjianghuiView returnXuanjianghuiView:returnXuanjianghuiViewList){
if(returnXuanjianghuiView.getId().intValue() ==xuanjianghuiView.getId().intValue()) addFlag=false;//返回的数据中已存在此商品
}
if(addFlag){
toAddNum=toAddNum-1;
returnXuanjianghuiViewList.add(xuanjianghuiView);
if(toAddNum==0) break;//够数量了
}
}
}else {
returnXuanjianghuiViewList = returnXuanjianghuiViewList.subList(0, limit);
}
for(XuanjianghuiView c:returnXuanjianghuiViewList)
dictionaryService.dictionaryConvert(c, request);
page.setList(returnXuanjianghuiViewList);
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@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 = xuanjianghuiService.queryPage(params);
//字典表数据转换
List<XuanjianghuiView> list =(List<XuanjianghuiView>)page.getList();
for(XuanjianghuiView 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);
XuanjianghuiEntity xuanjianghui = xuanjianghuiService.selectById(id);
if(xuanjianghui !=null){
//entity转view
XuanjianghuiView view = new XuanjianghuiView();
BeanUtils.copyProperties( xuanjianghui , view );//把实体数据重构到view中
//级联表
GongsiEntity gongsi = gongsiService.selectById(xuanjianghui.getGongsiId());
if(gongsi != null){
BeanUtils.copyProperties( gongsi , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setGongsiId(gongsi.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody XuanjianghuiEntity xuanjianghui, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,xuanjianghui:{}",this.getClass().getName(),xuanjianghui.toString());
Wrapper<XuanjianghuiEntity> queryWrapper = new EntityWrapper<XuanjianghuiEntity>()
.eq("gongsi_id", xuanjianghui.getGongsiId())
.eq("xuanjianghui_name", xuanjianghui.getXuanjianghuiName())
.eq("xuanjianghui_daiyu", xuanjianghui.getXuanjianghuiDaiyu())
.eq("xuanjianghui_types", xuanjianghui.getXuanjianghuiTypes())
.eq("zhuanye_types", xuanjianghui.getZhuanyeTypes())
.eq("xuanjianghui_gangwei", xuanjianghui.getXuanjianghuiGangwei())
.eq("xuanjianghui_renshu_number", xuanjianghui.getXuanjianghuiRenshuNumber())
.eq("xianxia_types", xuanjianghui.getXianxiaTypes())
.in("xuanjianghui_yesno_types", new Integer[]{1,2})
.eq("xuanjianghui_yesno_text", xuanjianghui.getXuanjianghuiYesnoText())
// .notIn("xuanjianghui_types", new Integer[]{102})
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
XuanjianghuiEntity xuanjianghuiEntity = xuanjianghuiService.selectOne(queryWrapper);
if(xuanjianghuiEntity==null){
xuanjianghui.setXuanjianghuiYesnoTypes(1);
xuanjianghui.setCreateTime(new Date());
xuanjianghuiService.insert(xuanjianghui);
return R.ok();
}else {
if(xuanjianghuiEntity.getXuanjianghuiYesnoTypes()==1)
return R.error(511,"有相同的待审核的数据");
else if(xuanjianghuiEntity.getXuanjianghuiYesnoTypes()==2)
return R.error(511,"有相同的审核通过的数据");
else
return R.error(511,"表中有相同数据");
}
}
}
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.XuanjianghuiEntity;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.lang.Nullable;
import java.util.List;
/**
* 宣讲会 服务类
*/
public interface XuanjianghuiService extends IService<XuanjianghuiEntity> {
/**
* @param params 查询参数
* @return 带分页的查询出来的数据
*/
PageUtils queryPage(Map<String, Object> params);
}
package com.service.impl;
import com.utils.StringUtil;
import com.service.DictionaryService;
import com.utils.ClazzDiff;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.*;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import com.dao.XuanjianghuiDao;
import com.entity.XuanjianghuiEntity;
import com.service.XuanjianghuiService;
import com.entity.view.XuanjianghuiView;
/**
* 宣讲会 服务实现类
*/
@Service("xuanjianghuiService")
@Transactional
public class XuanjianghuiServiceImpl extends ServiceImpl<XuanjianghuiDao, XuanjianghuiEntity> implements XuanjianghuiService {
@Override
public PageUtils queryPage(Map<String,Object> params) {
Page<XuanjianghuiView> page =new Query<XuanjianghuiView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}
package com.dao;
import com.entity.XuanjianghuiEntity;
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.XuanjianghuiView;
/**
* 宣讲会 Dao 接口
*
* @author 学长编程
*/
public interface XuanjianghuiDao extends BaseMapper<XuanjianghuiEntity> {
List<XuanjianghuiView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}
6、论文目录结构
7、源码获取
感谢大家的阅读,如有不懂的问题可以评论区交流或私聊!
喜欢文章可以点赞、收藏、关注、评论啦
→获取源码请私信←