博主介绍:✌从事软件开发10年之余,专注于Java技术领域、Python人工智能及数据挖掘、小程序项目开发和Android项目开发等。CSDN、掘金、华为云、InfoQ、阿里云等平台优质作者✌
文末获取源码联系
精彩专栏推荐订阅 不然下次找不到哟
————————————————
计算机毕业设计《1000套》✌
目录
1、项目介绍及开发技术
1.1 项目介绍
1.2 开发技术
2、系统功能设计结构图
3、功能截图
3.1 前台功能
3.2 后台功能
4、数据库表结构设计
5、关键代码
5.1 物资管理Controller模块
5.2 物资管理Service模块
5.3 物资管理ServiceImpl模块
5.4 物资管理Dao模块
6、论文目录结构
7、源码获取
1、项目介绍及开发技术
当前的网络技术,软件技术等都具备成熟的理论基础,市场上也出现各种技术开发的软件,这些软件都被用于各个领域,包括生活和工作的领域。随着电脑和笔记本的广泛运用,以及各种计算机硬件的完善和升级,市面上的电脑和笔记本的性能都得到提升,可以支持的软件也逐渐增多,因此,在计算机上安装软件来发挥其高效地信息处理的作用,则很受人们的青睐。对于物资管理信息系统信息来讲,通过手工形式处理,在面对庞大的信息数量时,就显得不适宜了,首先需要花费的时间比较多,其次数据出错率比较高,而且对错误的数据进行更改也比较困难,最后,检索数据费事费力。因此,为了解决上述问题,有必要建立物资管理信息系统,来规范物资管理信息系统信息管理流程,让管理工作可以系统化和程序化,同时,物资管理信息系统的有效运用可以帮助管理人员准确快速地处理信息。
物资管理信息系统可以对系统信息进行集中管理,可以真正避免传统管理的缺陷。管理信息系统是一款运用软件开发技术设计实现的应用系统,在信息处理上可以达到快速的目的,不管是针对数据添加,数据维护和统计,以及数据查询等处理要求,物资管理信息系统都可以轻松应对。所以,物资管理信息系统的运用是让系统信息管理升级的最好方式。它可以实现信息处理的便利化要求,还可以规范信息处理的流程,让事务处理成为管理人员手中的一件简单事,而不是之前手工处理时的困难事。尽管该系统具备较完善的功能,但是也需要管理人员利用闲暇时间提升自身素质以及个人能力,在操作系统时可以最大化运用物资管理信息系统提供的功能,让系统在满足高效率处理数据的同时,也能始终稳定运行,还可以确保数据的可靠性与数据处理的质量。
Java开发语言、SpringBoot、MyBatisPlus、MySQL数据库、Maven、IDEA开发工具、JDK1.8+、Vue、HTML、CSS、JS。
2、系统功能设计结构图
3、功能截图
登录
首页
物资
论坛
意见反馈
通知公告
个人中心
登录
首页
物资管理
出入库管理
物资申请管理
出入库管理
论坛管理
4、数据库表结构设计
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=16 DEFAULT CHARSET=utf8 COMMENT='字典表';
/*Data for the table `dictionary` */
insert into `dictionary`(`id`,`dic_code`,`dic_name`,`code_index`,`index_name`,`super_id`,`beizhu`,`create_time`) values (1,'fangyiwuzi_types','物资类型',1,'物资类型1',NULL,NULL,'2023-02-20 16:15:12'),(2,'fangyiwuzi_types','物资类型',2,'物资类型2',NULL,NULL,'2023-02-20 16:15:12'),(3,'fangyiwuzi_types','物资类型',3,'物资类型3',NULL,NULL,'2023-02-20 16:15:12'),(4,'fangyiwuzi_churu_inout_types','出入库类型',1,'出库',NULL,NULL,'2023-02-20 16:15:12'),(5,'fangyiwuzi_churu_inout_types','出入库类型',2,'入库',NULL,NULL,'2023-02-20 16:15:12'),(6,'fangyiwuzi_yuyue_yesno_types','申请状态',1,'已申请',NULL,NULL,'2023-02-20 16:15:12'),(7,'fangyiwuzi_yuyue_yesno_types','申请状态',2,'已同意',NULL,NULL,'2023-02-20 16:15:12'),(8,'fangyiwuzi_yuyue_yesno_types','申请状态',3,'已拒绝',NULL,NULL,'2023-02-20 16:15:12'),(9,'news_types','公告类型',1,'公告类型1',NULL,NULL,'2023-02-20 16:15:13'),(10,'news_types','公告类型',2,'公告类型2',NULL,NULL,'2023-02-20 16:15:13'),(11,'news_types','公告类型',3,'公告类型3',NULL,NULL,'2023-02-20 16:15:13'),(12,'sex_types','性别',1,'男',NULL,NULL,'2023-02-20 16:15:13'),(13,'sex_types','性别',2,'女',NULL,NULL,'2023-02-20 16:15:13'),(14,'forum_state_types','帖子状态',1,'发帖',NULL,NULL,'2023-02-20 16:15:13'),(15,'forum_state_types','帖子状态',2,'回帖',NULL,NULL,'2023-02-20 16:15:13');
/*Table structure for table `fangyiwuzi` */
DROP TABLE IF EXISTS `fangyiwuzi`;
CREATE TABLE `fangyiwuzi` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`fangyiwuzi_uuid_number` varchar(200) DEFAULT NULL COMMENT '物资编号',
`fangyiwuzi_name` varchar(200) DEFAULT NULL COMMENT '物资名称 Search111 ',
`fangyiwuzi_photo` varchar(200) DEFAULT NULL COMMENT '物资图片',
`fangyiwuzi_types` int(11) DEFAULT NULL COMMENT '物资类型 Search111',
`fangyiwuzi_kucun_number` int(11) DEFAULT NULL COMMENT '物资库存',
`fangyiwuzi_content` text COMMENT '物资介绍 ',
`fangyiwuzi_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 photoShow homeMain',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='物资';
/*Data for the table `fangyiwuzi` */
insert into `fangyiwuzi`(`id`,`fangyiwuzi_uuid_number`,`fangyiwuzi_name`,`fangyiwuzi_photo`,`fangyiwuzi_types`,`fangyiwuzi_kucun_number`,`fangyiwuzi_content`,`fangyiwuzi_delete`,`insert_time`,`create_time`) values (1,'1676880958984','物资名称1','upload/fangyiwuzi1.jpg',2,101,'物资介绍1',1,'2023-02-20 16:15:58','2023-02-20 16:15:58'),(2,'1676880958945','物资名称2','upload/fangyiwuzi2.jpg',3,102,'物资介绍2',1,'2023-02-20 16:15:58','2023-02-20 16:15:58'),(3,'1676880958980','物资名称3','upload/fangyiwuzi3.jpg',1,102,'物资介绍3',1,'2023-02-20 16:15:58','2023-02-20 16:15:58'),(4,'1676880958931','物资名称4','upload/fangyiwuzi4.jpg',2,103,'物资介绍4',1,'2023-02-20 16:15:58','2023-02-20 16:15:58'),(5,'1676880959014','物资名称5','upload/fangyiwuzi5.jpg',2,101,'物资介绍5',1,'2023-02-20 16:15:58','2023-02-20 16:15:58');
/*Table structure for table `fangyiwuzi_churu_inout` */
DROP TABLE IF EXISTS `fangyiwuzi_churu_inout`;
CREATE TABLE `fangyiwuzi_churu_inout` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`fangyiwuzi_churu_inout_uuid_number` varchar(200) DEFAULT NULL COMMENT '出入库流水号',
`fangyiwuzi_churu_inout_name` varchar(200) DEFAULT NULL COMMENT '出入库名称 Search111 ',
`fangyiwuzi_churu_inout_types` int(11) DEFAULT NULL COMMENT '出入库类型 Search111 ',
`fangyiwuzi_churu_inout_content` text COMMENT '备注',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '添加时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='出入库';
/*Data for the table `fangyiwuzi_churu_inout` */
insert into `fangyiwuzi_churu_inout`(`id`,`fangyiwuzi_churu_inout_uuid_number`,`fangyiwuzi_churu_inout_name`,`fangyiwuzi_churu_inout_types`,`fangyiwuzi_churu_inout_content`,`insert_time`,`create_time`) values (1,'1676880958934','出入库名称1',2,'备注1','2023-02-20 16:15:58','2023-02-20 16:15:58'),(2,'1676880959010','出入库名称2',1,'备注2','2023-02-20 16:15:58','2023-02-20 16:15:58'),(3,'1676880958961','出入库名称3',2,'备注3','2023-02-20 16:15:58','2023-02-20 16:15:58'),(4,'1676880958971','出入库名称4',2,'备注4','2023-02-20 16:15:58','2023-02-20 16:15:58'),(5,'1676880958985','出入库名称5',2,'备注5','2023-02-20 16:15:58','2023-02-20 16:15:58'),(6,'1676892754840','出库1111',1,'','2023-02-20 19:32:35','2023-02-20 19:32:35');
/*Table structure for table `fangyiwuzi_churu_inout_list` */
DROP TABLE IF EXISTS `fangyiwuzi_churu_inout_list`;
CREATE TABLE `fangyiwuzi_churu_inout_list` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`fangyiwuzi_churu_inout_id` int(11) DEFAULT NULL COMMENT '出入库',
`fangyiwuzi_id` int(11) DEFAULT NULL COMMENT '物资',
`fangyiwuzi_churu_inout_list_number` 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=9 DEFAULT CHARSET=utf8 COMMENT='出入库详情';
/*Data for the table `fangyiwuzi_churu_inout_list` */
insert into `fangyiwuzi_churu_inout_list`(`id`,`fangyiwuzi_churu_inout_id`,`fangyiwuzi_id`,`fangyiwuzi_churu_inout_list_number`,`insert_time`,`create_time`) values (1,1,1,415,'2023-02-20 16:15:58','2023-02-20 16:15:58'),(2,2,2,472,'2023-02-20 16:15:58','2023-02-20 16:15:58'),(3,3,3,58,'2023-02-20 16:15:58','2023-02-20 16:15:58'),(4,4,4,438,'2023-02-20 16:15:58','2023-02-20 16:15:58'),(5,5,5,169,'2023-02-20 16:15:58','2023-02-20 16:15:58'),(6,6,3,1,'2023-02-20 19:32:35','2023-02-20 19:32:35'),(7,6,4,1,'2023-02-20 19:32:35','2023-02-20 19:32:35'),(8,6,5,1,'2023-02-20 19:32:35','2023-02-20 19:32:35');
/*Table structure for table `fangyiwuzi_yuyue` */
DROP TABLE IF EXISTS `fangyiwuzi_yuyue`;
CREATE TABLE `fangyiwuzi_yuyue` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`fangyiwuzi_id` int(11) DEFAULT NULL COMMENT '物资',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
`fangyiwuzi_yuyue_number` int(11) DEFAULT NULL COMMENT '申请数量',
`fangyiwuzi_yuyue_yesno_types` int(11) DEFAULT NULL COMMENT '申请状态 Search111',
`fangyiwuzi_yuyue_yesno_text` text COMMENT '申请结果',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '申请时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='物资申请';
/*Data for the table `fangyiwuzi_yuyue` */
insert into `fangyiwuzi_yuyue`(`id`,`fangyiwuzi_id`,`yonghu_id`,`fangyiwuzi_yuyue_number`,`fangyiwuzi_yuyue_yesno_types`,`fangyiwuzi_yuyue_yesno_text`,`insert_time`,`create_time`) values (1,1,1,236,1,NULL,'2023-02-20 16:15:58','2023-02-20 16:15:58'),(2,2,2,233,1,NULL,'2023-02-20 16:15:58','2023-02-20 16:15:58'),(3,3,1,220,1,NULL,'2023-02-20 16:15:58','2023-02-20 16:15:58'),(4,4,2,54,1,NULL,'2023-02-20 16:15:58','2023-02-20 16:15:58'),(5,5,1,275,1,NULL,'2023-02-20 16:15:58','2023-02-20 16:15:58'),(7,5,1,3,2,'123123','2023-02-20 19:15:54','2023-02-20 19:15:54');
/*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 ',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
`users_id` int(11) DEFAULT NULL COMMENT '管理员',
`forum_phone` varchar(200) DEFAULT NULL COMMENT '图片',
`forum_content` text COMMENT '发布内容',
`super_ids` int(11) DEFAULT NULL COMMENT '父id',
`forum_state_types` int(11) DEFAULT NULL COMMENT '帖子状态',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '发帖时间',
`update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show2',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COMMENT='论坛';
/*Data for the table `forum` */
insert into `forum`(`id`,`forum_name`,`yonghu_id`,`users_id`,`forum_phone`,`forum_content`,`super_ids`,`forum_state_types`,`insert_time`,`update_time`,`create_time`) values (1,'帖子标题1',3,NULL,'17703786901','发布内容1',284,1,'2023-02-20 16:15:58','2023-02-20 16:15:58','2023-02-20 16:15:58'),(2,'帖子标题2',3,NULL,'17703786902','发布内容2',366,1,'2023-02-20 16:15:58','2023-02-20 16:15:58','2023-02-20 16:15:58'),(3,'帖子标题3',3,NULL,'17703786903','发布内容3',143,1,'2023-02-20 16:15:58','2023-02-20 16:15:58','2023-02-20 16:15:58'),(4,'帖子标题4',1,NULL,'17703786904','发布内容4',126,1,'2023-02-20 16:15:58','2023-02-20 16:15:58','2023-02-20 16:15:58'),(5,'帖子标题5',1,NULL,'17703786905','发布内容5',217,1,'2023-02-20 16:15:58','2023-02-20 16:15:58','2023-02-20 16:15:58');
/*Table structure for table `liuyan` */
DROP TABLE IF EXISTS `liuyan`;
CREATE TABLE `liuyan` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
`liuyan_name` varchar(200) DEFAULT NULL COMMENT '标题 Search111 ',
`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 '创建时间 show2 nameShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='意见反馈';
/*Data for the table `liuyan` */
insert into `liuyan`(`id`,`yonghu_id`,`liuyan_name`,`liuyan_text`,`insert_time`,`reply_text`,`update_time`,`create_time`) values (1,1,'标题1','反馈内容1','2023-02-20 16:15:58','回复信息1','2023-02-20 16:15:58','2023-02-20 16:15:58'),(2,2,'标题2','反馈内容2','2023-02-20 16:15:58','回复信息2','2023-02-20 16:15:58','2023-02-20 16:15:58'),(3,2,'标题3','反馈内容3','2023-02-20 16:15:58','回复信息3','2023-02-20 16:15:58','2023-02-20 16:15:58'),(4,2,'标题4','反馈内容4','2023-02-20 16:15:58','回复信息4','2023-02-20 16:15:58','2023-02-20 16:15:58'),(5,1,'标题5','反馈内容5','2023-02-20 16:15:58','回复信息5','2023-02-20 16:15:58','2023-02-20 16:15:58');
/*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=6 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-02-20 16:15:58','公告详情1','2023-02-20 16:15:58'),(2,'公告标题2',2,'upload/news2.jpg','2023-02-20 16:15:58','公告详情2','2023-02-20 16:15:58'),(3,'公告标题3',2,'upload/news3.jpg','2023-02-20 16:15:58','公告详情3','2023-02-20 16:15:58'),(4,'公告标题4',2,'upload/news4.jpg','2023-02-20 16:15:58','公告详情4','2023-02-20 16:15:58'),(5,'公告标题5',1,'upload/news5.jpg','2023-02-20 16:15:58','公告详情5','2023-02-20 16:15:58');
/*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=3 DEFAULT CHARSET=utf8 COMMENT='token表';
/*Data for the table `token` */
insert into `token`(`id`,`userid`,`username`,`tablename`,`role`,`token`,`addtime`,`expiratedtime`) values (1,1,'a1','yonghu','用户','oj7mjdjmmr57wlterrq4xeth59ej8kq8','2023-02-20 16:26:01','2023-02-20 20:22:12'),(2,1,'admin','users','管理员','k9djgmu3kbs1kegkstjx53lqvne91uwx','2023-02-20 16:26:16','2023-02-20 20:30:44');
/*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 `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_address` 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_address`,`yonghu_delete`,`create_time`) values (1,'a1','123456','用户姓名1',2,'upload/yonghu1.jpg','410224199010102001','17703786901','[email protected]','地址1',1,'2023-02-20 16:15:58'),(2,'a2','123456','用户姓名2',2,'upload/yonghu2.jpg','410224199010102002','17703786902','[email protected]','地址2',1,'2023-02-20 16:15:58'),(3,'a3','123456','用户姓名3',2,'upload/yonghu3.jpg','410224199010102003','17703786903','[email protected]','地址3',1,'2023-02-20 16:15:58');
/*!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("/fangyiwuzi")
public class FangyiwuziController {
private static final Logger logger = LoggerFactory.getLogger(FangyiwuziController.class);
private static final String TABLE_NAME = "fangyiwuzi";
@Autowired
private FangyiwuziService fangyiwuziService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表非注册的service
//注册表service
@Autowired
private YonghuService yonghuService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map 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"));
params.put("fangyiwuziDeleteStart",1);params.put("fangyiwuziDeleteEnd",1);
CommonUtil.checkMap(params);
PageUtils page = fangyiwuziService.queryPage(params);
//字典表数据转换
List list =(List)page.getList();
for(FangyiwuziView 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);
FangyiwuziEntity fangyiwuzi = fangyiwuziService.selectById(id);
if(fangyiwuzi !=null){
//entity转view
FangyiwuziView view = new FangyiwuziView();
BeanUtils.copyProperties( fangyiwuzi , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody FangyiwuziEntity fangyiwuzi, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,fangyiwuzi:{}",this.getClass().getName(),fangyiwuzi.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper queryWrapper = new EntityWrapper()
.eq("fangyiwuzi_name", fangyiwuzi.getFangyiwuziName())
.eq("fangyiwuzi_types", fangyiwuzi.getFangyiwuziTypes())
.eq("fangyiwuzi_kucun_number", fangyiwuzi.getFangyiwuziKucunNumber())
.eq("fangyiwuzi_delete", fangyiwuzi.getFangyiwuziDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
FangyiwuziEntity fangyiwuziEntity = fangyiwuziService.selectOne(queryWrapper);
if(fangyiwuziEntity==null){
fangyiwuzi.setFangyiwuziDelete(1);
fangyiwuzi.setInsertTime(new Date());
fangyiwuzi.setCreateTime(new Date());
fangyiwuziService.insert(fangyiwuzi);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody FangyiwuziEntity fangyiwuzi, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,fangyiwuzi:{}",this.getClass().getName(),fangyiwuzi.toString());
FangyiwuziEntity oldFangyiwuziEntity = fangyiwuziService.selectById(fangyiwuzi.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper queryWrapper = new EntityWrapper()
.notIn("id",fangyiwuzi.getId())
.andNew()
.eq("fangyiwuzi_name", fangyiwuzi.getFangyiwuziName())
.eq("fangyiwuzi_types", fangyiwuzi.getFangyiwuziTypes())
.eq("fangyiwuzi_kucun_number", fangyiwuzi.getFangyiwuziKucunNumber())
.eq("fangyiwuzi_delete", fangyiwuzi.getFangyiwuziDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
FangyiwuziEntity fangyiwuziEntity = fangyiwuziService.selectOne(queryWrapper);
if("".equals(fangyiwuzi.getFangyiwuziPhoto()) || "null".equals(fangyiwuzi.getFangyiwuziPhoto())){
fangyiwuzi.setFangyiwuziPhoto(null);
}
if(fangyiwuziEntity==null){
fangyiwuziService.updateById(fangyiwuzi);//根据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 oldFangyiwuziList =fangyiwuziService.selectBatchIds(Arrays.asList(ids));//要删除的数据
ArrayList list = new ArrayList<>();
for(Integer id:ids){
FangyiwuziEntity fangyiwuziEntity = new FangyiwuziEntity();
fangyiwuziEntity.setId(id);
fangyiwuziEntity.setFangyiwuziDelete(2);
list.add(fangyiwuziEntity);
}
if(list != null && list.size() >0){
fangyiwuziService.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 fangyiwuziList = new ArrayList<>();//上传的东西
Map> 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> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List data:dataList){
//循环
FangyiwuziEntity fangyiwuziEntity = new FangyiwuziEntity();
fangyiwuziEntity.setFangyiwuziUuidNumber(data.get(0)); //物资编号 要改的
fangyiwuziEntity.setFangyiwuziName(data.get(1)); //物资名称 要改的
fangyiwuziEntity.setFangyiwuziPhoto("");//详情和图片
fangyiwuziEntity.setFangyiwuziTypes(Integer.valueOf(data.get(2))); //物资类型 要改的
fangyiwuziEntity.setFangyiwuziKucunNumber(Integer.valueOf(data.get(3))); //物资库存 要改的
fangyiwuziEntity.setFangyiwuziContent("");//详情和图片
fangyiwuziEntity.setFangyiwuziDelete(1);//逻辑删除字段
fangyiwuziEntity.setInsertTime(date);//时间
fangyiwuziEntity.setCreateTime(date);//时间
fangyiwuziList.add(fangyiwuziEntity);
//把要查询是否重复的字段放入map中
//物资编号
if(seachFields.containsKey("fangyiwuziUuidNumber")){
List fangyiwuziUuidNumber = seachFields.get("fangyiwuziUuidNumber");
fangyiwuziUuidNumber.add(data.get(0));//要改的
}else{
List fangyiwuziUuidNumber = new ArrayList<>();
fangyiwuziUuidNumber.add(data.get(0));//要改的
seachFields.put("fangyiwuziUuidNumber",fangyiwuziUuidNumber);
}
}
//查询是否重复
//物资编号
List fangyiwuziEntities_fangyiwuziUuidNumber = fangyiwuziService.selectList(new EntityWrapper().in("fangyiwuzi_uuid_number", seachFields.get("fangyiwuziUuidNumber")).eq("fangyiwuzi_delete", 1));
if(fangyiwuziEntities_fangyiwuziUuidNumber.size() >0 ){
ArrayList repeatFields = new ArrayList<>();
for(FangyiwuziEntity s:fangyiwuziEntities_fangyiwuziUuidNumber){
repeatFields.add(s.getFangyiwuziUuidNumber());
}
return R.error(511,"数据库的该表中的 [物资编号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
fangyiwuziService.insertBatch(fangyiwuziList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
CommonUtil.checkMap(params);
PageUtils page = fangyiwuziService.queryPage(params);
//字典表数据转换
List list =(List)page.getList();
for(FangyiwuziView 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);
FangyiwuziEntity fangyiwuzi = fangyiwuziService.selectById(id);
if(fangyiwuzi !=null){
//entity转view
FangyiwuziView view = new FangyiwuziView();
BeanUtils.copyProperties( fangyiwuzi , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody FangyiwuziEntity fangyiwuzi, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,fangyiwuzi:{}",this.getClass().getName(),fangyiwuzi.toString());
Wrapper queryWrapper = new EntityWrapper()
.eq("fangyiwuzi_uuid_number", fangyiwuzi.getFangyiwuziUuidNumber())
.eq("fangyiwuzi_name", fangyiwuzi.getFangyiwuziName())
.eq("fangyiwuzi_types", fangyiwuzi.getFangyiwuziTypes())
.eq("fangyiwuzi_kucun_number", fangyiwuzi.getFangyiwuziKucunNumber())
.eq("fangyiwuzi_delete", fangyiwuzi.getFangyiwuziDelete())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
FangyiwuziEntity fangyiwuziEntity = fangyiwuziService.selectOne(queryWrapper);
if(fangyiwuziEntity==null){
fangyiwuzi.setFangyiwuziDelete(1);
fangyiwuzi.setInsertTime(new Date());
fangyiwuzi.setCreateTime(new Date());
fangyiwuziService.insert(fangyiwuzi);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}
/**
* 物资 服务类
*/
public interface FangyiwuziService extends IService {
/**
* @param params 查询参数
* @return 带分页的查询出来的数据
*/
PageUtils queryPage(Map params);
}
/**
* 物资 服务实现类
*/
@Service("fangyiwuziService")
@Transactional
public class FangyiwuziServiceImpl extends ServiceImpl implements FangyiwuziService {
@Override
public PageUtils queryPage(Map params) {
Page page =new Query(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}
/**
* 物资 Dao 接口
*
* @author 学长编程
* Wechat jsjbysj88
*/
public interface FangyiwuziDao extends BaseMapper {
List selectListView(Pagination page,@Param("params")Map params);
}
6、论文目录结构
7、源码获取
感谢大家的阅读,如有不懂的问题可以评论区交流或私聊!
喜欢文章可以点赞、收藏、关注、评论啦
→获取源码请私信←