博主介绍:✌从事软件开发10年之余,专注于Java技术领域、Python人工智能及数据挖掘、小程序项目开发和Android项目开发等。CSDN、掘金、华为云、InfoQ、阿里云等平台优质作者✌
文末获取源码联系
精彩专栏推荐订阅 不然下次找不到哟
————————————————计算机毕业设计题目《1000套》✌
目录
一.前言介绍及开发技术
二.功能设计
三.功能截图
四.数据库表结构设计
五.关键代码
六.论文目录参考
七.源码获取
一.前言介绍及开发技术
本系统设计的现状和趋势,从需求、结构、数据库等方面的设计到系统的实现,分别为管理员和用户的实现。论文的内容从系统的设计、描述、实现、分析、测试方面来表明开发的过程。本系统根据现实情况来选择一种可行的开发方案,借助java编程语言和MySQL数据库等实现系统的全部功能,接下来对系统进行测试,测试系统是否有漏洞和测试用户权限来完善系统,最终系统完成达到相关标准。此次管理系统的关键技术和架构由B/S结构、java和mysql数据库、ssm框架和Vue是本系统的关键开发技术,对系统的整体、数据库、功能模块、系统页面以及系统程序等设计进行了详细的研究与规划。
在该在线消防物资存储系统中,Eclipse能给用户提供更多的方便,其特点一是方便学习,方便快捷;二是有非常大的信息储存量,主要功能是用在对数据库中查询和编程。其功能有比较灵活的数据应用,只需利用小部分代码就能实现非常强大的功能。因此,利用Eclipse 技术进行系统代码管理是该系统数据库的首选。
二.功能设计
考虑到实际生活中在消防物资存储管理方面的需要以及对该系统认真的分析,将系统权限按管理员和用户这两类涉及用户划分。用户登陆后,主要模块包括首页,个人中心,仓库管理,物资入库管理,物资出库管理,仓库管理,物资详情管理,报警通知管理,安全检查提醒管理等功能。管理员登陆后,主要模块包括首页,个人中心,用户管理,仓库管理,物资入库管理,物资出库管理,仓位管理,物资详情管理,报警通知管理,安全检查提醒管理等功能。
三.功能截图
系统登录,管理员和用户进入系统前在登录页面根据要求填写账号,密码,验证码和选择角色等信息,点击登录进行登录操作。
用户以及管理员登陆系统后,可以查看首页,个人中心,仓库管理,物资入库管理,物资出库管理,仓库管理,物资详情管理,报警通知管理,安全检查提醒管理等功能,还能对每个功能逐一进行相应操作。
仓库管理,在仓库管理页面可以对索引,仓库名称,仓库类型,物资编号,物资名称,数量,图片等内容进行详情,物资出库,物资入库,修改和删除操作。
物资入库管理,在物资入库管理页面可以对索引,物资编号,物资名称,图片,数量,入库时间等内容进行修改和删除操作。
物资出库管理,在物资出库管理页面可以对索引,物资编号,物资名称,图片,数量,出库时间等内容进行详情,修改和删除等操作。
仓库管理,在仓库管理页面可以对索引,序列号,物资编号,物资名称,对应仓库号,状态,长度等内容进行详情操作。
物资详情管理,在物资详情管理页面可以对索引,物资编号,物资名称,图片,体积,数量,入库时间,状态,位置,存放温度,生产日期,保质期,备注等内容进行删除操作。
报警通知管理,在报警通知管理页面可以对索引,标题,封面,发布时间等内容进行详情和删除操作。
安全检查提醒管理,在安全检查提醒管理页面可以对索引,标题,封面,发布时间等内容进行详情和删除操作。
四.数据库表结构设计
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `ssmr46x1` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE `ssmr46x1`;
--
-- Table structure for table `anquanjianchatixing`
--
DROP TABLE IF EXISTS `anquanjianchatixing`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `anquanjianchatixing` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`biaoti` varchar(200) DEFAULT NULL COMMENT '标题',
`fengmian` varchar(200) DEFAULT NULL COMMENT '封面',
`neirongxiangqing` longtext COMMENT '内容详情',
`fabushijian` date DEFAULT NULL COMMENT '发布时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=87 DEFAULT CHARSET=utf8 COMMENT='安全检查提醒';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `anquanjianchatixing`
--
LOCK TABLES `anquanjianchatixing` WRITE;
/*!40000 ALTER TABLE `anquanjianchatixing` DISABLE KEYS */;
INSERT INTO `anquanjianchatixing` VALUES (81,'2022-04-11 08:05:33','标题1','upload/anquanjianchatixing_fengmian1.jpg','内容详情1','2022-04-11'),(82,'2022-04-11 08:05:33','标题2','upload/anquanjianchatixing_fengmian2.jpg','内容详情2','2022-04-11'),(83,'2022-04-11 08:05:33','标题3','upload/anquanjianchatixing_fengmian3.jpg','内容详情3','2022-04-11'),(84,'2022-04-11 08:05:33','标题4','upload/anquanjianchatixing_fengmian4.jpg','内容详情4','2022-04-11'),(85,'2022-04-11 08:05:33','标题5','upload/anquanjianchatixing_fengmian5.jpg','内容详情5','2022-04-11'),(86,'2022-04-11 08:05:33','标题6','upload/anquanjianchatixing_fengmian6.jpg','内容详情6','2022-04-11');
/*!40000 ALTER TABLE `anquanjianchatixing` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `baojingtongzhi`
--
DROP TABLE IF EXISTS `baojingtongzhi`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `baojingtongzhi` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`biaoti` varchar(200) DEFAULT NULL COMMENT '标题',
`fengmian` varchar(200) DEFAULT NULL COMMENT '封面',
`neirongxiangqing` longtext COMMENT '内容详情',
`fabushijian` date DEFAULT NULL COMMENT '发布时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=77 DEFAULT CHARSET=utf8 COMMENT='报警通知';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `baojingtongzhi`
--
LOCK TABLES `baojingtongzhi` WRITE;
/*!40000 ALTER TABLE `baojingtongzhi` DISABLE KEYS */;
INSERT INTO `baojingtongzhi` VALUES (71,'2022-04-11 08:05:33','标题1','upload/baojingtongzhi_fengmian1.jpg','内容详情1','2022-04-11'),(72,'2022-04-11 08:05:33','标题2','upload/baojingtongzhi_fengmian2.jpg','内容详情2','2022-04-11'),(73,'2022-04-11 08:05:33','标题3','upload/baojingtongzhi_fengmian3.jpg','内容详情3','2022-04-11'),(74,'2022-04-11 08:05:33','标题4','upload/baojingtongzhi_fengmian4.jpg','内容详情4','2022-04-11'),(75,'2022-04-11 08:05:33','标题5','upload/baojingtongzhi_fengmian5.jpg','内容详情5','2022-04-11'),(76,'2022-04-11 08:05:33','标题6','upload/baojingtongzhi_fengmian6.jpg','内容详情6','2022-04-11');
/*!40000 ALTER TABLE `baojingtongzhi` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `cangku`
--
DROP TABLE IF EXISTS `cangku`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cangku` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`cangkumingcheng` varchar(200) DEFAULT NULL COMMENT '仓库名称',
`cangkuleixing` varchar(200) DEFAULT NULL COMMENT '仓库类型',
`wuzibianhao` varchar(200) DEFAULT NULL COMMENT '物资编号',
`wuzimingcheng` varchar(200) DEFAULT NULL COMMENT '物资名称',
`shuliang` int(11) DEFAULT NULL COMMENT '数量',
`tupian` varchar(200) DEFAULT NULL COMMENT '图片',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8 COMMENT='仓库';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `cangku`
--
LOCK TABLES `cangku` WRITE;
/*!40000 ALTER TABLE `cangku` DISABLE KEYS */;
INSERT INTO `cangku` VALUES (21,'2022-04-11 08:05:33','仓库名称1','救助类','物资编号1','物资名称1',11,'upload/cangku_tupian1.jpg'),(22,'2022-04-11 08:05:33','仓库名称2','灭火类','物资编号2','物资名称2',2,'upload/cangku_tupian2.jpg'),(23,'2022-04-11 08:05:33','仓库名称3','灭火类','物资编号3','物资名称3',3,'upload/cangku_tupian3.jpg'),(24,'2022-04-11 08:05:33','仓库名称4','灭火类','物资编号4','物资名称4',4,'upload/cangku_tupian4.jpg'),(25,'2022-04-11 08:05:33','仓库名称5','灭火类','物资编号5','物资名称5',5,'upload/cangku_tupian5.jpg'),(26,'2022-04-11 08:05:33','仓库名称6','灭火类','物资编号6','物资名称6',6,'upload/cangku_tupian6.jpg');
/*!40000 ALTER TABLE `cangku` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `cangwei`
--
DROP TABLE IF EXISTS `cangwei`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cangwei` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`xuliehao` varchar(200) NOT NULL COMMENT '序列号',
`wuzibianhao` varchar(200) DEFAULT NULL COMMENT '物资编号',
`wuzimingcheng` varchar(200) DEFAULT NULL COMMENT '物资名称',
`duiyingcangkuhao` varchar(200) DEFAULT NULL COMMENT '对应仓库号',
`zhuangtai` varchar(200) DEFAULT NULL COMMENT '状态',
`zhangdu` varchar(200) DEFAULT NULL COMMENT '长度',
`cangweixiangqing` longtext COMMENT '仓位详情',
PRIMARY KEY (`id`),
UNIQUE KEY `xuliehao` (`xuliehao`)
) ENGINE=InnoDB AUTO_INCREMENT=1649664761344 DEFAULT CHARSET=utf8 COMMENT='仓位';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `cangwei`
--
LOCK TABLES `cangwei` WRITE;
/*!40000 ALTER TABLE `cangwei` DISABLE KEYS */;
INSERT INTO `cangwei` VALUES (51,'2022-04-11 08:05:33','1111111111','物资编号1','物资名称1','对应仓库号1','已占用','长度1','仓位详情1'),(52,'2022-04-11 08:05:33','2222222222','物资编号2','物资名称2','对应仓库号2','已占用','长度2','仓位详情2'),(53,'2022-04-11 08:05:33','3333333333','物资编号3','物资名称3','对应仓库号3','已占用','长度3','仓位详情3'),(54,'2022-04-11 08:05:33','4444444444','物资编号4','物资名称4','对应仓库号4','已占用','长度4','仓位详情4'),(55,'2022-04-11 08:05:33','5555555555','物资编号5','物资名称5','对应仓库号5','已占用','长度5','仓位详情5'),(56,'2022-04-11 08:05:33','6666666666','物资编号6','物资名称6','对应仓库号6','已占用','长度6','仓位详情6'),(1649664761343,'2022-04-11 08:12:40','1649664733590','001','测试','001','未占用','10','测试
');
/*!40000 ALTER TABLE `cangwei` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `config`
--
DROP TABLE IF EXISTS `config`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
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='配置文件';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `config`
--
LOCK TABLES `config` WRITE;
/*!40000 ALTER TABLE `config` DISABLE KEYS */;
INSERT INTO `config` VALUES (1,'picture1','upload/picture1.jpg'),(2,'picture2','upload/picture2.jpg'),(3,'picture3','upload/picture3.jpg');
/*!40000 ALTER TABLE `config` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `token`
--
DROP TABLE IF EXISTS `token`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
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=3 DEFAULT CHARSET=utf8 COMMENT='token表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `token`
--
LOCK TABLES `token` WRITE;
/*!40000 ALTER TABLE `token` DISABLE KEYS */;
INSERT INTO `token` VALUES (1,1649664451094,'11','yonghu','用户','7bnae0xlt9xa6pncr55k2oa1n6xjzuxq','2022-04-11 08:07:37','2022-04-11 09:07:37'),(2,1,'abo','users','管理员','3y5izeuyfx4uh6x4eykj7p1fh5vmzwhl','2022-04-11 08:13:24','2022-04-11 09:13:25');
/*!40000 ALTER TABLE `token` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
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='用户表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,'abo','abo','管理员','2022-04-11 08:05:33');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `wuzichuku`
--
DROP TABLE IF EXISTS `wuzichuku`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wuzichuku` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`wuzibianhao` varchar(200) NOT NULL COMMENT '物资编号',
`wuzimingcheng` varchar(200) DEFAULT NULL COMMENT '物资名称',
`tupian` varchar(200) DEFAULT NULL COMMENT '图片',
`shuliang` int(11) DEFAULT NULL COMMENT '数量',
`chukushijian` date DEFAULT NULL COMMENT '出库时间',
PRIMARY KEY (`id`),
UNIQUE KEY `wuzibianhao` (`wuzibianhao`)
) ENGINE=InnoDB AUTO_INCREMENT=1649664548027 DEFAULT CHARSET=utf8 COMMENT='物资出库';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `wuzichuku`
--
LOCK TABLES `wuzichuku` WRITE;
/*!40000 ALTER TABLE `wuzichuku` DISABLE KEYS */;
INSERT INTO `wuzichuku` VALUES (41,'2022-04-11 08:05:33','1111111111','物资名称1','upload/wuzichuku_tupian1.jpg',1,'2022-04-11'),(42,'2022-04-11 08:05:33','2222222222','物资名称2','upload/wuzichuku_tupian2.jpg',2,'2022-04-11'),(43,'2022-04-11 08:05:33','3333333333','物资名称3','upload/wuzichuku_tupian3.jpg',3,'2022-04-11'),(44,'2022-04-11 08:05:33','4444444444','物资名称4','upload/wuzichuku_tupian4.jpg',4,'2022-04-11'),(45,'2022-04-11 08:05:33','5555555555','物资名称5','upload/wuzichuku_tupian5.jpg',5,'2022-04-11'),(46,'2022-04-11 08:05:33','6666666666','物资名称6','upload/wuzichuku_tupian6.jpg',6,'2022-04-11'),(1649664548026,'2022-04-11 08:09:08','物资编号1','物资名称1','upload/cangku_tupian1.jpg',10,'2022-04-11');
/*!40000 ALTER TABLE `wuzichuku` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `wuziruku`
--
DROP TABLE IF EXISTS `wuziruku`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wuziruku` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`wuzibianhao` varchar(200) NOT NULL COMMENT '物资编号',
`wuzimingcheng` varchar(200) DEFAULT NULL COMMENT '物资名称',
`tupian` varchar(200) DEFAULT NULL COMMENT '图片',
`shuliang` int(11) DEFAULT NULL COMMENT '数量',
`rukushijian` date DEFAULT NULL COMMENT '入库时间',
PRIMARY KEY (`id`),
UNIQUE KEY `wuzibianhao` (`wuzibianhao`)
) ENGINE=InnoDB AUTO_INCREMENT=1649664518730 DEFAULT CHARSET=utf8 COMMENT='物资入库';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `wuziruku`
--
LOCK TABLES `wuziruku` WRITE;
/*!40000 ALTER TABLE `wuziruku` DISABLE KEYS */;
INSERT INTO `wuziruku` VALUES (31,'2022-04-11 08:05:33','1111111111','物资名称1','upload/wuziruku_tupian1.jpg',1,'2022-04-11'),(32,'2022-04-11 08:05:33','2222222222','物资名称2','upload/wuziruku_tupian2.jpg',2,'2022-04-11'),(33,'2022-04-11 08:05:33','3333333333','物资名称3','upload/wuziruku_tupian3.jpg',3,'2022-04-11'),(34,'2022-04-11 08:05:33','4444444444','物资名称4','upload/wuziruku_tupian4.jpg',4,'2022-04-11'),(35,'2022-04-11 08:05:33','5555555555','物资名称5','upload/wuziruku_tupian5.jpg',5,'2022-04-11'),(36,'2022-04-11 08:05:33','6666666666','物资名称6','upload/wuziruku_tupian6.jpg',6,'2022-04-11'),(1649664518729,'2022-04-11 08:08:37','物资编号1','物资名称1','upload/cangku_tupian1.jpg',20,'2022-04-11');
/*!40000 ALTER TABLE `wuziruku` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `wuzixiangqing`
--
DROP TABLE IF EXISTS `wuzixiangqing`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wuzixiangqing` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`wuzibianhao` varchar(200) NOT NULL COMMENT '物资编号',
`wuzimingcheng` varchar(200) DEFAULT NULL COMMENT '物资名称',
`tupian` varchar(200) DEFAULT NULL COMMENT '图片',
`cangweixinxi` longtext COMMENT '仓位信息',
`tiji` varchar(200) DEFAULT NULL COMMENT '体积',
`shuliang` int(11) DEFAULT NULL COMMENT '数量',
`rukushijian` date DEFAULT NULL COMMENT '入库时间',
`zhuangtai` varchar(200) DEFAULT NULL COMMENT '状态',
`weizhi` varchar(200) DEFAULT NULL COMMENT '位置',
`cunfangwendu` varchar(200) DEFAULT NULL COMMENT '存放温度',
`shengchanriqi` datetime DEFAULT NULL COMMENT '生产日期',
`baozhiqi` varchar(200) DEFAULT NULL COMMENT '保质期',
`beizhu` varchar(200) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`),
UNIQUE KEY `wuzibianhao` (`wuzibianhao`)
) ENGINE=InnoDB AUTO_INCREMENT=67 DEFAULT CHARSET=utf8 COMMENT='物资详情';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `wuzixiangqing`
--
LOCK TABLES `wuzixiangqing` WRITE;
/*!40000 ALTER TABLE `wuzixiangqing` DISABLE KEYS */;
INSERT INTO `wuzixiangqing` VALUES (61,'2022-04-11 08:05:33','1111111111','物资名称1','upload/wuzixiangqing_tupian1.jpg','仓位信息1','体积1',1,'2022-04-11','状态1','位置1','存放温度1','2022-04-11 16:05:33','保质期1','备注1'),(62,'2022-04-11 08:05:33','2222222222','物资名称2','upload/wuzixiangqing_tupian2.jpg','仓位信息2','体积2',2,'2022-04-11','状态2','位置2','存放温度2','2022-04-11 16:05:33','保质期2','备注2'),(63,'2022-04-11 08:05:33','3333333333','物资名称3','upload/wuzixiangqing_tupian3.jpg','仓位信息3','体积3',3,'2022-04-11','状态3','位置3','存放温度3','2022-04-11 16:05:33','保质期3','备注3'),(64,'2022-04-11 08:05:33','4444444444','物资名称4','upload/wuzixiangqing_tupian4.jpg','仓位信息4','体积4',4,'2022-04-11','状态4','位置4','存放温度4','2022-04-11 16:05:33','保质期4','备注4'),(65,'2022-04-11 08:05:33','5555555555','物资名称5','upload/wuzixiangqing_tupian5.jpg','仓位信息5','体积5',5,'2022-04-11','状态5','位置5','存放温度5','2022-04-11 16:05:33','保质期5','备注5'),(66,'2022-04-11 08:05:33','6666666666','物资名称6','upload/wuzixiangqing_tupian6.jpg','仓位信息6','体积6',6,'2022-04-11','状态6','位置6','存放温度6','2022-04-11 16:05:33','保质期6','备注6');
/*!40000 ALTER TABLE `wuzixiangqing` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `yonghu`
--
DROP TABLE IF EXISTS `yonghu`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `yonghu` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`yonghuzhanghao` varchar(200) NOT NULL COMMENT '用户账号',
`yonghuxingming` varchar(200) DEFAULT NULL COMMENT '用户姓名',
`mima` varchar(200) DEFAULT NULL COMMENT '密码',
`xingbie` varchar(200) DEFAULT NULL COMMENT '性别',
`lianxifangshi` varchar(200) DEFAULT NULL COMMENT '联系方式',
`touxiang` varchar(200) DEFAULT NULL COMMENT '头像',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1649664451095 DEFAULT CHARSET=utf8 COMMENT='用户';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `yonghu`
--
LOCK TABLES `yonghu` WRITE;
/*!40000 ALTER TABLE `yonghu` DISABLE KEYS */;
INSERT INTO `yonghu` VALUES (11,'2022-04-11 08:05:33','用户账号1','用户姓名1','123456','男','13823888881','upload/yonghu_touxiang1.jpg'),(12,'2022-04-11 08:05:33','用户账号2','用户姓名2','123456','男','13823888882','upload/yonghu_touxiang2.jpg'),(13,'2022-04-11 08:05:33','用户账号3','用户姓名3','123456','男','13823888883','upload/yonghu_touxiang3.jpg'),(14,'2022-04-11 08:05:33','用户账号4','用户姓名4','123456','男','13823888884','upload/yonghu_touxiang4.jpg'),(15,'2022-04-11 08:05:33','用户账号5','用户姓名5','123456','男','13823888885','upload/yonghu_touxiang5.jpg'),(16,'2022-04-11 08:05:33','用户账号6','用户姓名6','123456','男','13823888886','upload/yonghu_touxiang6.jpg'),(1649664451094,'2022-04-11 08:07:31','11','李密','11',NULL,'15807556666',NULL);
/*!40000 ALTER TABLE `yonghu` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2022-04-11 22:44:03
五.关键代码
package com.controller;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
* 登录相关
*/
@RequestMapping("users")
@RestController
public class UserController{
@Autowired
private UserService userService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
UserEntity user = userService.selectOne(new EntityWrapper().eq("username", username));
if(user==null || !user.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.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){
UserEntity user = userService.selectOne(new EntityWrapper().eq("username", username));
if(user==null) {
return R.error("账号不存在");
}
user.setPassword("123456");
userService.update(user,null);
return R.ok("密码已重置为:123456");
}
/**
* 列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map params,UserEntity user){
EntityWrapper ew = new EntityWrapper();
PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/list")
public R list( UserEntity user){
EntityWrapper ew = new EntityWrapper();
ew.allEq(MPUtil.allEQMapPre( user, "user"));
return R.ok().put("data", userService.selectListView(ew));
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
* 保存
*/
@PostMapping("/save")
public R save(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
UserEntity u = userService.selectOne(new EntityWrapper().eq("username", user.getUsername()));
if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) {
return R.error("用户名已存在。");
}
userService.updateById(user);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
userService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}
六.论文目录参考
七.源码获取
感谢大家的阅读,如有不懂的问题可以评论区交流或私聊!
喜欢文章可以点赞、收藏、关注、评论啦 、获取源码+V:jsjbysj88