社区防疫物资申报系统--论文pf

news2024/9/24 1:14:24

@TOC

springboot414社区防疫物资申报系统--论文pf

第1章 绪论

1.1选题动因

当前的网络技术,软件技术等都具备成熟的理论基础,市场上也出现各种技术开发的软件,这些软件都被用于各个领域,包括生活和工作的领域。随着电脑和笔记本的广泛运用,以及各种计算机硬件的完善和升级,市面上的电脑和笔记本的性能都得到提升,可以支持的软件也逐渐增多,因此,在计算机上安装软件来发挥其高效地信息处理的作用,则很受人们的青睐。对于社区防疫物资申报系统信息来讲,通过手工形式处理,在面对庞大的信息数量时,就显得不适宜了,首先需要花费的时间比较多,其次数据出错率比较高,而且对错误的数据进行更改也比较困难,最后,检索数据费事费力。因此,为了解决上述问题,有必要建立社区防疫物资申报系统,来规范社区防疫物资申报系统信息管理流程,让管理工作可以系统化和程序化,同时,社区防疫物资申报系统的有效运用可以帮助管理人员准确快速地处理信息。

1.2目的和意义

社区防疫物资申报系统可以对社区防疫物资申报系统信息进行集中管理,可以真正避免传统管理的缺陷。社区防疫物资申报系统是一款运用软件开发技术设计实现的应用系统,在信息处理上可以达到快速的目的,不管是针对数据添加,数据维护和统计,以及数据查询等处理要求,社区防疫物资申报系统都可以轻松应对。所以,社区防疫物资申报系统的运用是让社区防疫物资申报系统信息管理升级的最好方式。它可以实现信息处理的便利化要求,还可以规范信息处理的流程,让事务处理成为管理人员手中的一件简单事,而不是之前手工处理时的困难事。尽管社区防疫物资申报系统具备较完善的功能,但是也需要管理人员利用闲暇时间提升自身素质以及个人能力,在操作社区防疫物资申报系统时可以最大化运用社区防疫物资申报系统提供的功能,让系统在满足高效率处理数据的同时,也能始终稳定运行,还可以确保数据的可靠性与数据处理的质量。

1.3论文结构安排

本文总共分为6个章节,每个章节都对本系统描述了不同的内容。接下来就对本文的研究内容进行阐述。

第1章:这个章节是论文的绪论部分。从选题的背景和意义的角度阐述即将开发的系统。

第2章:这个章节是技术介绍部分。从本系统需要运用的技术知识的角度阐述系统。

第3章:这个章节是系统分析部分。从分析系统可行性,分析系统功能和性能等角度阐述系统。

第4章:这个章节是系统设计部分。从系统功能结构的角度和数据库设计的角度阐述系统。

第5章:这个章节是系统实现部分。从系统功能模块运行效果的角度阐述系统。

第6章:这个章节是系统测试部分。从测试系统功能,系统测试方法的角度阐述系统。

第2章 开发环境与技术

开发社区防疫物资申报系统需要搭建编程的环境,也需要通过调查,对各个相关技术进行分析,选取适合本系统开发的技术与工具。

2.1 MYSQL数据库

题目确定了是一个应用程序之后,就开始按部就班的进行设计与分析。本课题是需要数据库作为数据管理工具以及数据载体,从程序功能分析到数据分析,选择合适的关系型数据库是当下所选择的重要环节。关系型数据库可选择余地不多,本身甲骨文公司的两个,微软的两个,IBM的一个,也就是这五个了,功能和差异都不影响数据库的选择,因为这些数据库都能实现应用程序功能所需的,那么只能从其他的方面来综合考虑哪种数据库更合适。作为开发使用的电脑硬件上来讲,还是大一的时候买的,当初并没有太多的钱买好一点的电脑,只是作为学习用的,所以经过这么几年的使用,电脑老化了,性能下降也比较厉害,还有好多需要用的学习资料,本身面临毕业,选择学校机房也不是一个长久的打算,选择一个数据库适合自己的老旧笔记本电脑作为学习开发当前的应用,是最重要的。综合考虑的结果就是选用MySQL数据库作为应用数据库,因为MySQL数据库体积小,占用内存小,不影响电脑上其他用的软件运行,并且不需要因为安装维护MySQL数据库而重装系统,最终选择的数据库就是MySQL数据库。

2.2 Tomcat 介绍

刚开始学习Java语言的时候,是不知道还有Tomcat这些东西的,各种语法各种输出在控制台进行输出结果,当Java网站开发的时候就不可避免的学习到了Tomcat服务器。Tomcat准确的来讲不算是服务器,可以说是vue引擎或者一个容器,这些都是学术上或者原理上都比较贴切的,但是实际工作中Tomcat就是作为一个web服务器来用的,因为可以实现网站的发布和运行。因为工作原理的原因,Tomcat一般作为中小型企业和并发量并不突出的一种轻量级的服务器存在的,比如某些行业的应用系统,本身客户端就不多,需要的连接也不多,一般都用Tomcat的。Tomcat里面可以配置多个网站,配置文件后缀是config的文档,类似于XML的结构,比较清晰明了。每当Java发布新的版本的时候,Tomcat也会为了匹配Java的版本进行升级,目前Tomcat版本已经到版本10了。Tomcat标识是一只有点发黄的小猫咪,当Tomcat配置成功一般测试的时候能看到这个小猫咪就算是成功的,才能进行下一步的配置。Tomcat服务器在Java网站开发中还是挺合适的。

2.3 vue技术

vue技术可以让初学者尽快上手进行编写动态网站,不需要变成高级的Java编程人员才可以书写代码,从学习的效率还有编写的效率上都有很大的提升。让着重于网页开发者与着重于后台逻辑开发进行分离合作开发变成了一种可能,降低了学习成本,不需要考虑程序运行解释编译阶段的话,vue网页本身就可以理解成一个普通的Servlet。vue结构上面,主要分为两个方面,一个是专属的vue引擎,通俗的讲就是可以实现vue编译后运行解释的一个东西,另一个就是web服务器。vue运行编译需要vue引擎和web服务器进行配合以及相互协作,当然他们的分工也是很明确的,这样才可以真正的运行起来。vue容器和引擎有Tomcat,这个Tomcat其实也还有Apache静态解释代码的部分,虽然看起来运行效果差不多,但是其实是两个截然不同的工具,在文件系统里目录也是不一样的,当然如果有特殊需求也是可以进行特殊的配置的,配置上面还是比较灵活的。虽然Tomcat部署了网站之后就可以运行网页让客户访问,但是Tomcat也只是vue引擎而非web服务器。比如JRUN和Resin都算是vue引擎,而web服务器的职责比较单一,就是处理客户端请求还有返回给客户显示请求处理后的数据而已。vue引擎则可以运行纯HTML编写的网站,也可以运行vue编写的动态网站,在效率上也只是比单纯的web服务器而已,但是从纯web服务器无法运行动态网站上来讲,vue引擎在功能上还是强大了很多,提升一点点效率反而算不了什么,对于必须实现的功能这些要素上,选择了vue技术。

2.4 SpringBoot框架

java一直被人诟病的一点就是臃肿、麻烦。当我们还在辛苦的搭建项目时,可能Python程序员已经把功能写好了,究其原因注意是两点:复杂的配置,项目各种配置其实是开发时的损耗, 因为在思考 Spring 特性配置和解决业务问题之间需要进行思维切换,所以写配置挤占了写应用程序逻辑的时间。一个是混乱的依赖管理。项目的依赖管理也是件吃力不讨好的事情。决定项目里要用哪些库就已经够让人头痛的了,你还要知道这些库的哪个版本和其他库不会有冲突,这难题实在太棘手。并且,依赖管理也是一种损耗,添加依赖不是写应用程序代码。一旦选错了依赖的版本,随之而来的不兼容问题毫无疑问会是生产力杀手。而SpringBoot让这一切成为过去!Spring Boot 简化了基于Spring的应用开发,只需要“run”就能创建一个独立的、生产级别的Spring应用。Spring Boot为Spring平台及第三方库提供开箱即用的设置(提供默认设置,存放默认配置的包就是启动器),这样我们就可以简单的开始。多数Spring Boot应用只需要很少的Spring配置。我们可以使用SpringBoot创建java应用,并使用java –jar 启动它,就能得到一个生产级别的web工程。

第3章 系统分析

用户的需求以及与本系统相似的在市场上存在的其它系统可以作为系统分析中参考的资料,分析人员可以根据这些信息确定出本系统具备的功能,分析出本系统具备的性能等内容。

3.1可行性分析

尽管系统是根据用户的要求进行制作,但是在确定制作前,有必要分析其可行性。

3.1.1操作可行性分析

开发本系统需要用到的工具,本人都比较熟悉,因此可以使用这些工具,完整开发社区防疫物资申报系统。此外,社区防疫物资申报系统在功能上,基本都是完成信息的处理,涵盖了添加,修改,删除等,而且操作者面对的都是各个功能操作界面,并不是编码后台,所以一般的使用者都可以通过操作界面轻松完成信息的加工处理。因此,本系统操作可行。

3.1.2经济可行性分析

开发本系统,并没有投入资金购买开发工具。因为使用的开发工具都是事先在百度上下载安装在本人电脑上的,随着软件开发技术的成熟,系统功能实现的编码也都模块化,很容易通过各大软件开发类网站获取,并通过小部分代码改动,运用到本系统中,这些都不需要资金投入,同时,本系统开发的结构选用B/S,成本可以忽略不计。

3.1.3技术可行性分析

本系统需要的软件包括Eclipse,Tomcat,Mysql等,这些工具都接触并使用过,至于JAVA,B/S,vue,Html等技术,图书馆都有对应的书籍可以参考学习,加上平时课堂上学习的编程小项目对这些技术都有讲解,另外,本人也从课程设计作业中锻炼了编程能力。所以在技术上,可以完成社区防疫物资申报系统的编程开发。

通过上面的分析,已经确定了本系统在经济上的可行,本系统在技术上的可行,本系统在操作上的可行。由此,可以得出在目前的条件下,对于社区防疫物资申报系统的设计与实现是可以进行下去的。

3.2系统流程分析

本系统在处理数据时,其内部的操作逻辑也需要使用相应的工具进行展示。

在本系统的数据录入页面,对于操作者提供的每条数据都有相应的检验规则,比如数据信息不能有非法字符,或者本来应该是汉字的数据,不能用字母代替,还有对数据内容的长度等进行规范,这样的可以确保数据准确性的检验规则,在编码时,就提前编写好了。数据添加的流程见下图。如果数据已经保存进入数据库,则说明操作者提供的数据内容和格式都是符合要求的。

图3.1 添加信息流程图

很多时候,面对系统中的大量数据,难免会发现一些错误,因此需要及时纠正错误,本系统也提供数据后期的修改功能,其流程见下图。但是更新的数据也需要通过数据有效性检验。能够最终写入数据库则说明修改的数据是符合要求的。

图3.2 修改信息流程图

面对数据库里面大量数据,在系统的前台,要想快速获取需要的信息,就需要使用查询功能。其流程见下图。该功能需要操作者提前输入关键词,当系统的后台数据库保存了与关键词匹配的数据时,就会及时显示出来,整个过程耗时很短。

图3.3 查询信息流程图

3.3系统性能分析

分析社区防疫物资申报系统对于性能的需求主要还是从下面的5个角度来分析,它们分别是系统的实用性,系统的适应性,系统的易操作性,系统的安全性和系统的易维护性。

性能需求一:系统的实用性,本系统主要是让管理人员集中处理相关信息,可以提供方便快捷的信息添加,信息编辑等操作。在提高信息管理人员的工作效率的同时,也可以降低管理成本,并大大减少管理人员日常繁琐的工作量。

性能需求二:系统的适应性,本系统对于运行环境的要求并不高,可以被广泛运用在生活中。因为使用者只要在日常使用的计算机,或者是随身携带的笔记本上搭建运行环境都能运行本系统,另外系统提供的基础功能包括添加,修改等都能随时操作。

性能需求三:系统的易操作性,本系统提供的功能跟同类型系统一样,也具备简单的增删改操作,操作流程的逻辑也符合广大使用者的使用需求,使用者使用本系统管理数据会非常顺手。

性能需求四:系统的安全性,本系统在数据保存与管理上安全系数要达标,在设计与编码阶段,通过对用户进行权限分配,把系统的功能依照不同用户的角色进行分配,在首次进入系统时,通过编写安全验证的代码模块,引导不同用户进入不同的操作界面。还可以对用户基础信息包括登录的账号密码等进行加密保存,可以利用当下常用的技术成熟的MD5加密技术实现。

性能需求五:系统的易维护性,本系统在后期运行中,会根据使用者的操作,产生许多数据信息,为了便于维护,就要求这些数据可以通过工具从数据库中导出来,对于一些阶段性数据,可以进行批量删除,以此达到轻负荷处理数据的目标,让本系统可以变得更加轻盈。

第4章 系统设计

市面上设计比较好的系统都有一个共同特征,就是主题鲜明突出。通过对页面简洁清晰的布局,让页面的内容,包括文字语言,或者视频图片等元素可以清晰表达出系统的主题。让来访用户无需花费过多精力和时间找寻需要的内容。

4.1界面设计原则

一般来说,大部分用户使用系统,有些是想从系统中获取需要的信息,有些则是使用系统提供的服务。所以,为了改善用户体验,提高系统的使用率,在对系统界面设计时,需要按照下面的原则进行。

第一点,对用户进行分析,了解用户使用系统的目的,以及使用系统的方式,考虑大部分用户的阅读习惯,设计Z字形或F型结构可以方便用户获取信息。

第二点:设计有效的导航,这个包括每个页面上都有导航条的显示,有时也可以在页面的底部设计导航条,当用户进入具体页面时,要设计相应的位置提示,在页面中比较特殊的位置,需要设计返回链接,可以返回上个页面,也可以返回首页等。

第三点:对整个系统要运用统一的设计方案,包括色彩方案的一致性,页面模板的相似性等,对相同操作和专业术语的描述在整个系统中也应该保持一致。

第四点:设计的界面要保证传达的内容清晰准确。要避免在同一个页面设计非常多的内容,另外可以准确对系统内容进行分类,把页面中用户视觉集中的位置,用来显示重要信息。

作为初学者,并没有那么多的设计经验,但是可以运用上面提到的界面设计原则设计出比较好的系统,可以让用户产生良好的使用体验。

4.2功能结构设计

为了让系统的编码可以顺利进行,特意对本系统功能进行细分设计,设计的系统功能结构见下图。

结构设计图

图4.1 系统功能结构图

4.3数据库设计

一般来说,对用户进行调查,了解其需求,主要还是完成功能上的分析设计,殊不知,设计功能时,也要展示对数据库的设计。数据库服务于程序,它可以按照设定的规则对程序的数据进行保存,因此,也可以说数据库就是程序相关数据的集合。为了保证程序的高质量,数据库提供的数据存储服务也需要快速响应,同时数据信息也要安全合法可靠,所以设计一个数据库这样的任务也需要高度重视,并花时间和精力去努力完成。毕竟这影响到后期程序的开发和使用。试想而知,假设设计一个不好的数据库,遇到的问题将会有:第一,面对信息处理,会有着繁琐的业务逻辑,延长事务处理时间。第二:程序编码期间,将会产生更多的代码去完成数据处理的功能,产生大量的数据冗余,而且也不方便注释代码,还会占用更多的存储空间。综上所述,设计出合理的数据库是多么的重要。

(1)下图是论坛实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\论坛.jpg 论坛实体属性图

(2)下图是出入库详情实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\出入库详情.jpg 出入库详情实体属性图

(3)下图是用户实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\用户.jpg 用户实体属性图

(4)下图是通知公告实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\通知公告.jpg 通知公告实体属性图

(5)下图是社区人员实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\社区人员.jpg 社区人员实体属性图

(6)下图是物资实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\物资.jpg 物资实体属性图

(7)下图是出入库实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\出入库.jpg 出入库实体属性图

(8)下图是字典表实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\字典表.jpg 字典表实体属性图

(9)下图是物资申请实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\物资申请.jpg 物资申请实体属性图

(10)下图是工作分配实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\工作分配.jpg 工作分配实体属性图

4.3.2 数据库物理设计

作为程序后台的支持,本数据库也需要设计数据存储的结构。而数据存储结构的设计就包括了数据表结构的设计和创建。数据表结构包括了字段,数据类型,还有字段的取值范围等信息。而E-R模型中的实体就是一张表,实体的特征就可以作为该表中的字段,根据本程序信息存储要求,设计每个字段需要的类型,还有该字段的取值范围等。每当设计完成一张数据表,就需要及时保存在数据库里面,并对该设计的数据表准确命名,要求设置的数据表的名称尽量不要是中文,而且要方便记忆。因为在程序编码阶段,通过SQL语句可以把程序里面的数据写入在各个数据表里面,而这个环节需要使用到数据表的名称。如果数据表名称是中文的话,可能会乱码并影响程序运行。下面就以表格形式展示设计的结果。

表4.1字典表表

序号列名数据类型说明允许空
1IdIntid
2dic_codeString字段
3dic_nameString字段名
4code_indexInteger编码
5index_nameString编码名字
6super_idInteger父字段id
7beizhuString备注
8create_timeDate创建时间

表4.2论坛表

序号列名数据类型说明允许空
1IdIntid
2forum_nameString帖子标题
3yonghu_idInteger用户
4users_idInteger管理员
5forum_phoneString图片
6forum_contentString发布内容
7super_idsInteger父id
8forum_state_typesInteger帖子状态
9insert_timeDate发帖时间
10update_timeDate修改时间
11create_timeDate创建时间

表4.3工作分配表

序号列名数据类型说明允许空
1IdIntid
2gongzuofenpei_uuid_numberString编号
3gongzuofenpei_nameString工作标题
4gongzuofenpei_photoString工作图片
5shequrenyuan_idInteger社区人员
6gongzuofenpei_typesInteger工作类型
7gongzuofenpei_timeDate分配时间
8gongzuofenpei_contentString工作分配详情
9gongzuofenpei_deleteInteger逻辑删除
10insert_timeDate录入时间
11create_timeDate创建时间

表4.4通知公告表

序号列名数据类型说明允许空
1IdIntid
2news_nameString公告标题
3news_typesInteger工作分配
4news_photoString公告图片
5insert_timeDate添加时间
6news_contentString公告详情
7create_timeDate创建时间

表4.5社区人员表

序号列名数据类型说明允许空
1IdIntid
2shequrenyuan_nameString社区人员名称
3sex_typesInteger性别
4shequrenyuan_photoString人员头像
5shequrenyuan_phoneString联系方式
6shequrenyuan_emailString电子邮箱
7shequrenyuan_addressString住址
8shequrenyuan_deleteInteger逻辑删除
9create_timeDate创建时间

表4.6物资表

序号列名数据类型说明允许空
1IdIntid
2wuzi_uuid_numberString物资编号
3wuzi_nameString物资名称
4wuzi_photoString物资图片
5wuzi_typesInteger物资类型
6wuzi_kucun_numberInteger物资库存
7wuzi_contentString物资介绍
8wuzi_deleteInteger逻辑删除
9insert_timeDate录入时间
10create_timeDate创建时间 homeMain

表4.7出入库表

序号列名数据类型说明允许空
1IdIntid
2wuzi_churu_inout_uuid_numberString出入库流水号
3wuzi_churu_inout_nameString出入库名称
4wuzi_churu_inout_typesInteger出入库类型
5wuzi_churu_inout_contentString备注
6insert_timeDate添加时间
7create_timeDate创建时间

表4.8出入库详情表

序号列名数据类型说明允许空
1IdIntid
2wuzi_churu_inout_idInteger出入库
3wuzi_idInteger物资
4wuzi_churu_inout_list_numberInteger操作数量
5insert_timeDate操作时间
6create_timeDate创建时间

表4.9物资申请表

序号列名数据类型说明允许空
1IdIntid
2wuzi_idInteger物资
3yonghu_idInteger用户
4wuzi_yuyue_numberInteger申请数量
5wuzi_yuyue_yesno_typesInteger申请状态
6wuzi_yuyue_yesno_textString申请结果
7insert_timeDate申请时间
8create_timeDate创建时间

表4.10用户表

序号列名数据类型说明允许空
1IdIntid
2yonghu_nameString用户姓名
3yonghu_photoString用户头像
4yonghu_id_numberString身份证号
5yonghu_phoneString联系方式
6yonghu_emailString电子邮箱
7yonghu_deleteInteger逻辑删除
8create_timeDate创建时间

表4.11管理员表

序号列名数据类型说明允许空
1IdIntid
2usernameString用户名
3passwordString密码
4roleString角色
5addtimeDate新增时间

第5章 系统实现

这个环节需要使用前面的设计方案,包括对系统模块的设计,还有对程序后台的数据支持的数据库的设计等。不过这部分内容还是强调系统编码人员的开发能力,要把前面设计的内容通过编码的形式以一个完整的,可以运行的系统呈现出来。

功能模块的实现

5.1用户信息管理

如图5.1显示的就是用户信息管理页面,此页面提供给管理员的功能有:用户信息的查询管理,可以删除用户信息、修改用户信息、新增用户信息,

还进行了对用户名称的模糊查询的条件

图5.1 用户信息管理页面

5.2 物资信息管理

如图5.2显示的就是物资信息管理页面,此页面提供给管理员的功能有:查看已发布的物资信息数据,修改物资信息,物资信息作废,即可删除,还进行了对物资信息名称的模糊查询 物资信息信息的类型查询等等一些条件。

图5.2 物资信息管理页面

5.3工作分配管理

如图5.3显示的就是工作分配管理页面,此页面提供给管理员的功能有:根据工作分配进行条件查询,还可以对工作分配进行新增、修改、查询操作等等。

图5.3 工作分配管理页面

5.1公告信息管理

如图5.4显示的就是公告信息管理页面,此页面提供给管理员的功能有:根据公告信息进行新增、修改、查询操作等等。

图5.4 公告信息管理页面

GongzuofenpeiController.java

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("/gongzuofenpei")
public class GongzuofenpeiController {
    private static final Logger logger = LoggerFactory.getLogger(GongzuofenpeiController.class);

    private static final String TABLE_NAME = "gongzuofenpei";

    @Autowired
    private GongzuofenpeiService gongzuofenpeiService;


    @Autowired
    private TokenService tokenService;

    @Autowired
    private DictionaryService dictionaryService;//字典表
    @Autowired
    private ForumService forumService;//论坛
    @Autowired
    private NewsService newsService;//通知公告
    @Autowired
    private ShequrenyuanService shequrenyuanService;//社区人员
    @Autowired
    private WuziService wuziService;//物资
    @Autowired
    private WuziChuruInoutService wuziChuruInoutService;//出入库
    @Autowired
    private WuziChuruInoutListService wuziChuruInoutListService;//出入库详情
    @Autowired
    private WuziYuyueService wuziYuyueService;//物资申请
    @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"));
        params.put("gongzuofenpeiDeleteStart",1);params.put("gongzuofenpeiDeleteEnd",1);
        CommonUtil.checkMap(params);
        PageUtils page = gongzuofenpeiService.queryPage(params);

        //字典表数据转换
        List<GongzuofenpeiView> list =(List<GongzuofenpeiView>)page.getList();
        for(GongzuofenpeiView 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);
        GongzuofenpeiEntity gongzuofenpei = gongzuofenpeiService.selectById(id);
        if(gongzuofenpei !=null){
            //entity转view
            GongzuofenpeiView view = new GongzuofenpeiView();
            BeanUtils.copyProperties( gongzuofenpei , view );//把实体数据重构到view中
            //级联表 社区人员
            //级联表
            ShequrenyuanEntity shequrenyuan = shequrenyuanService.selectById(gongzuofenpei.getShequrenyuanId());
            if(shequrenyuan != null){
            BeanUtils.copyProperties( shequrenyuan , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
            view.setShequrenyuanId(shequrenyuan.getId());
            }
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("/save")
    public R save(@RequestBody GongzuofenpeiEntity gongzuofenpei, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,gongzuofenpei:{}",this.getClass().getName(),gongzuofenpei.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永远不会进入");

        Wrapper<GongzuofenpeiEntity> queryWrapper = new EntityWrapper<GongzuofenpeiEntity>()
            .eq("gongzuofenpei_name", gongzuofenpei.getGongzuofenpeiName())
            .eq("shequrenyuan_id", gongzuofenpei.getShequrenyuanId())
            .eq("gongzuofenpei_types", gongzuofenpei.getGongzuofenpeiTypes())
            .eq("gongzuofenpei_delete", 1)
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        GongzuofenpeiEntity gongzuofenpeiEntity = gongzuofenpeiService.selectOne(queryWrapper);
        if(gongzuofenpeiEntity==null){
            gongzuofenpei.setGongzuofenpeiDelete(1);
            gongzuofenpei.setInsertTime(new Date());
            gongzuofenpei.setCreateTime(new Date());
            gongzuofenpeiService.insert(gongzuofenpei);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

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

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
        if("".equals(gongzuofenpei.getGongzuofenpeiPhoto()) || "null".equals(gongzuofenpei.getGongzuofenpeiPhoto())){
                gongzuofenpei.setGongzuofenpeiPhoto(null);
        }

            gongzuofenpeiService.updateById(gongzuofenpei);//根据id更新
            return R.ok();
    }



    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        List<GongzuofenpeiEntity> oldGongzuofenpeiList =gongzuofenpeiService.selectBatchIds(Arrays.asList(ids));//要删除的数据
        ArrayList<GongzuofenpeiEntity> list = new ArrayList<>();
        for(Integer id:ids){
            GongzuofenpeiEntity gongzuofenpeiEntity = new GongzuofenpeiEntity();
            gongzuofenpeiEntity.setId(id);
            gongzuofenpeiEntity.setGongzuofenpeiDelete(2);
            list.add(gongzuofenpeiEntity);
        }
        if(list != null && list.size() >0){
            gongzuofenpeiService.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");
        //.eq("time", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))
        try {
            List<GongzuofenpeiEntity> gongzuofenpeiList = 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){
                            //循环
                            GongzuofenpeiEntity gongzuofenpeiEntity = new GongzuofenpeiEntity();
//                            gongzuofenpeiEntity.setGongzuofenpeiUuidNumber(data.get(0));                    //编号 要改的
//                            gongzuofenpeiEntity.setGongzuofenpeiName(data.get(0));                    //工作标题 要改的
//                            gongzuofenpeiEntity.setGongzuofenpeiPhoto("");//详情和图片
//                            gongzuofenpeiEntity.setShequrenyuanId(Integer.valueOf(data.get(0)));   //社区人员 要改的
//                            gongzuofenpeiEntity.setGongzuofenpeiTypes(Integer.valueOf(data.get(0)));   //工作类型 要改的
//                            gongzuofenpeiEntity.setGongzuofenpeiTime(sdf.parse(data.get(0)));          //分配时间 要改的
//                            gongzuofenpeiEntity.setGongzuofenpeiContent("");//详情和图片
//                            gongzuofenpeiEntity.setGongzuofenpeiDelete(1);//逻辑删除字段
//                            gongzuofenpeiEntity.setInsertTime(date);//时间
//                            gongzuofenpeiEntity.setCreateTime(date);//时间
                            gongzuofenpeiList.add(gongzuofenpeiEntity);


                            //把要查询是否重复的字段放入map中
                                //编号
                                if(seachFields.containsKey("gongzuofenpeiUuidNumber")){
                                    List<String> gongzuofenpeiUuidNumber = seachFields.get("gongzuofenpeiUuidNumber");
                                    gongzuofenpeiUuidNumber.add(data.get(0));//要改的
                                }else{
                                    List<String> gongzuofenpeiUuidNumber = new ArrayList<>();
                                    gongzuofenpeiUuidNumber.add(data.get(0));//要改的
                                    seachFields.put("gongzuofenpeiUuidNumber",gongzuofenpeiUuidNumber);
                                }
                        }

                        //查询是否重复
                         //编号
                        List<GongzuofenpeiEntity> gongzuofenpeiEntities_gongzuofenpeiUuidNumber = gongzuofenpeiService.selectList(new EntityWrapper<GongzuofenpeiEntity>().in("gongzuofenpei_uuid_number", seachFields.get("gongzuofenpeiUuidNumber")).eq("gongzuofenpei_delete", 1));
                        if(gongzuofenpeiEntities_gongzuofenpeiUuidNumber.size() >0 ){
                            ArrayList<String> repeatFields = new ArrayList<>();
                            for(GongzuofenpeiEntity s:gongzuofenpeiEntities_gongzuofenpeiUuidNumber){
                                repeatFields.add(s.getGongzuofenpeiUuidNumber());
                            }
                            return R.error(511,"数据库的该表中的 [编号] 字段已经存在 存在数据为:"+repeatFields.toString());
                        }
                        gongzuofenpeiService.insertBatch(gongzuofenpeiList);
                        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 = gongzuofenpeiService.queryPage(params);

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


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

                //级联表
                    ShequrenyuanEntity shequrenyuan = shequrenyuanService.selectById(gongzuofenpei.getShequrenyuanId());
                if(shequrenyuan != null){
                    BeanUtils.copyProperties( shequrenyuan , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setShequrenyuanId(shequrenyuan.getId());
                }
                //修改对应字典表字段
                dictionaryService.dictionaryConvert(view, request);
                return R.ok().put("data", view);
            }else {
                return R.error(511,"查不到数据");
            }
    }


    /**
    * 前端保存
    */
    @RequestMapping("/add")
    public R add(@RequestBody GongzuofenpeiEntity gongzuofenpei, HttpServletRequest request){
        logger.debug("add方法:,,Controller:{},,gongzuofenpei:{}",this.getClass().getName(),gongzuofenpei.toString());
        Wrapper<GongzuofenpeiEntity> queryWrapper = new EntityWrapper<GongzuofenpeiEntity>()
            .eq("gongzuofenpei_uuid_number", gongzuofenpei.getGongzuofenpeiUuidNumber())
            .eq("gongzuofenpei_name", gongzuofenpei.getGongzuofenpeiName())
            .eq("shequrenyuan_id", gongzuofenpei.getShequrenyuanId())
            .eq("gongzuofenpei_types", gongzuofenpei.getGongzuofenpeiTypes())
            .eq("gongzuofenpei_delete", gongzuofenpei.getGongzuofenpeiDelete())
//            .notIn("gongzuofenpei_types", new Integer[]{102})
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        GongzuofenpeiEntity gongzuofenpeiEntity = gongzuofenpeiService.selectOne(queryWrapper);
        if(gongzuofenpeiEntity==null){
            gongzuofenpei.setGongzuofenpeiDelete(1);
            gongzuofenpei.setInsertTime(new Date());
            gongzuofenpei.setCreateTime(new Date());
        gongzuofenpeiService.insert(gongzuofenpei);

            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

}


DictionaryController.java

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;

    @Autowired
    private ForumService forumService;//论坛
    @Autowired
    private GongzuofenpeiService gongzuofenpeiService;//工作分配
    @Autowired
    private NewsService newsService;//通知公告
    @Autowired
    private ShequrenyuanService shequrenyuanService;//社区人员
    @Autowired
    private WuziService wuziService;//物资
    @Autowired
    private WuziChuruInoutService wuziChuruInoutService;//出入库
    @Autowired
    private WuziChuruInoutListService wuziChuruInoutListService;//出入库详情
    @Autowired
    private WuziYuyueService wuziYuyueService;//物资申请
    @Autowired
    private YonghuService yonghuService;//用户
    @Autowired
    private UsersService usersService;//管理员


    /**
    * 后端列表
    */
    @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,"永远不会进入");

            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();
    }



    /**
    * 删除
    */
    @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");
        //.eq("time", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))
        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,"批量插入数据异常,请联系管理员");
        }
    }




}


WuziController.java

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("/wuzi")
public class WuziController {
    private static final Logger logger = LoggerFactory.getLogger(WuziController.class);

    private static final String TABLE_NAME = "wuzi";

    @Autowired
    private WuziService wuziService;


    @Autowired
    private TokenService tokenService;

    @Autowired
    private DictionaryService dictionaryService;//字典表
    @Autowired
    private ForumService forumService;//论坛
    @Autowired
    private GongzuofenpeiService gongzuofenpeiService;//工作分配
    @Autowired
    private NewsService newsService;//通知公告
    @Autowired
    private ShequrenyuanService shequrenyuanService;//社区人员
    @Autowired
    private WuziChuruInoutService wuziChuruInoutService;//出入库
    @Autowired
    private WuziChuruInoutListService wuziChuruInoutListService;//出入库详情
    @Autowired
    private WuziYuyueService wuziYuyueService;//物资申请
    @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"));
        params.put("wuziDeleteStart",1);params.put("wuziDeleteEnd",1);
        CommonUtil.checkMap(params);
        PageUtils page = wuziService.queryPage(params);

        //字典表数据转换
        List<WuziView> list =(List<WuziView>)page.getList();
        for(WuziView 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);
        WuziEntity wuzi = wuziService.selectById(id);
        if(wuzi !=null){
            //entity转view
            WuziView view = new WuziView();
            BeanUtils.copyProperties( wuzi , view );//把实体数据重构到view中
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("/save")
    public R save(@RequestBody WuziEntity wuzi, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,wuzi:{}",this.getClass().getName(),wuzi.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永远不会进入");

        Wrapper<WuziEntity> queryWrapper = new EntityWrapper<WuziEntity>()
            .eq("wuzi_name", wuzi.getWuziName())
            .eq("wuzi_types", wuzi.getWuziTypes())
            .eq("wuzi_kucun_number", wuzi.getWuziKucunNumber())
            .eq("wuzi_delete", 1)
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        WuziEntity wuziEntity = wuziService.selectOne(queryWrapper);
        if(wuziEntity==null){
            wuzi.setWuziDelete(1);
            wuzi.setInsertTime(new Date());
            wuzi.setCreateTime(new Date());
            wuziService.insert(wuzi);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

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

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
        if("".equals(wuzi.getWuziPhoto()) || "null".equals(wuzi.getWuziPhoto())){
                wuzi.setWuziPhoto(null);
        }

            wuziService.updateById(wuzi);//根据id更新
            return R.ok();
    }



    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        List<WuziEntity> oldWuziList =wuziService.selectBatchIds(Arrays.asList(ids));//要删除的数据
        ArrayList<WuziEntity> list = new ArrayList<>();
        for(Integer id:ids){
            WuziEntity wuziEntity = new WuziEntity();
            wuziEntity.setId(id);
            wuziEntity.setWuziDelete(2);
            list.add(wuziEntity);
        }
        if(list != null && list.size() >0){
            wuziService.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");
        //.eq("time", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))
        try {
            List<WuziEntity> wuziList = 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){
                            //循环
                            WuziEntity wuziEntity = new WuziEntity();
//                            wuziEntity.setWuziUuidNumber(data.get(0));                    //物资编号 要改的
//                            wuziEntity.setWuziName(data.get(0));                    //物资名称 要改的
//                            wuziEntity.setWuziPhoto("");//详情和图片
//                            wuziEntity.setWuziTypes(Integer.valueOf(data.get(0)));   //物资类型 要改的
//                            wuziEntity.setWuziKucunNumber(Integer.valueOf(data.get(0)));   //物资库存 要改的
//                            wuziEntity.setWuziContent("");//详情和图片
//                            wuziEntity.setWuziDelete(1);//逻辑删除字段
//                            wuziEntity.setInsertTime(date);//时间
//                            wuziEntity.setCreateTime(date);//时间
                            wuziList.add(wuziEntity);


                            //把要查询是否重复的字段放入map中
                                //物资编号
                                if(seachFields.containsKey("wuziUuidNumber")){
                                    List<String> wuziUuidNumber = seachFields.get("wuziUuidNumber");
                                    wuziUuidNumber.add(data.get(0));//要改的
                                }else{
                                    List<String> wuziUuidNumber = new ArrayList<>();
                                    wuziUuidNumber.add(data.get(0));//要改的
                                    seachFields.put("wuziUuidNumber",wuziUuidNumber);
                                }
                        }

                        //查询是否重复
                         //物资编号
                        List<WuziEntity> wuziEntities_wuziUuidNumber = wuziService.selectList(new EntityWrapper<WuziEntity>().in("wuzi_uuid_number", seachFields.get("wuziUuidNumber")).eq("wuzi_delete", 1));
                        if(wuziEntities_wuziUuidNumber.size() >0 ){
                            ArrayList<String> repeatFields = new ArrayList<>();
                            for(WuziEntity s:wuziEntities_wuziUuidNumber){
                                repeatFields.add(s.getWuziUuidNumber());
                            }
                            return R.error(511,"数据库的该表中的 [物资编号] 字段已经存在 存在数据为:"+repeatFields.toString());
                        }
                        wuziService.insertBatch(wuziList);
                        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 = wuziService.queryPage(params);

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


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

                //修改对应字典表字段
                dictionaryService.dictionaryConvert(view, request);
                return R.ok().put("data", view);
            }else {
                return R.error(511,"查不到数据");
            }
    }


    /**
    * 前端保存
    */
    @RequestMapping("/add")
    public R add(@RequestBody WuziEntity wuzi, HttpServletRequest request){
        logger.debug("add方法:,,Controller:{},,wuzi:{}",this.getClass().getName(),wuzi.toString());
        Wrapper<WuziEntity> queryWrapper = new EntityWrapper<WuziEntity>()
            .eq("wuzi_uuid_number", wuzi.getWuziUuidNumber())
            .eq("wuzi_name", wuzi.getWuziName())
            .eq("wuzi_types", wuzi.getWuziTypes())
            .eq("wuzi_kucun_number", wuzi.getWuziKucunNumber())
            .eq("wuzi_delete", wuzi.getWuziDelete())
//            .notIn("wuzi_types", new Integer[]{102})
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        WuziEntity wuziEntity = wuziService.selectOne(queryWrapper);
        if(wuziEntity==null){
            wuzi.setWuziDelete(1);
            wuzi.setInsertTime(new Date());
            wuzi.setCreateTime(new Date());
        wuziService.insert(wuzi);

            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

}


IndexAsideStatic.vue
<template>
  <el-aside class="index-aside" width="210px">
    <div class="index-aside-inner menulist">
      <div v-for="item in menuList" :key="item.roleName" v-if="role==item.roleName" class="menulist-item">
        <div class="menulistImg" v-if="false && 2 == 2">
          <el-image :style='{"padding":"0","boxShadow":"0 0 6px rgba(0,0,0,0)","margin":"0","borderColor":"rgba(0,0,0,0)","borderRadius":"0","borderWidth":"0","width":"100%","borderStyle":"solid","height":"auto"}' v-if="'http://codegen.caihongy.cn/20201021/cc7d45d9c8164b58b18351764eba9be1.jpg'" src="http://codegen.caihongy.cn/20201021/cc7d45d9c8164b58b18351764eba9be1.jpg" fit="cover" />
        </div>
		<el-menu :mode="2 == 1? 'horizontal':'vertical'" :unique-opened="true" class="el-menu-demo" default-active="0">
          <el-menu-item index="0" @click="menuHandler('')"><i v-if="true" class="el-icon-menu el-icon-s-home" />首页</el-menu-item>
          <el-submenu :index="1+''">
            <template slot="title">
				<i v-if="true" class="el-icon-menu el-icon-user-solid" />
				<span>个人中心</span>
            </template>
            <el-menu-item :index="1-1" @click="menuHandler('updatePassword')">修改密码</el-menu-item>
            <el-menu-item :index="1-2" @click="menuHandler('center')">个人信息</el-menu-item>
          </el-submenu>
          <el-submenu v-for=" (menu,index) in item.backMenu" :key="menu.menu" :index="index+2+''">
            <template slot="title">
				<i v-if="true" class="el-icon-menu" :class="icons[index]" />
				<span>{{ menu.menu }}</span>
            </template>
            <el-menu-item v-for=" (child,sort) in menu.child" :key="sort" :index="(index+2)+'-'+sort" @click="menuHandler(child.tableName)">{{ child.menu }}</el-menu-item>
          </el-submenu>
        </el-menu>
      </div>
    </div>
  </el-aside>
</template>

<script>
import menu from '@/utils/menu'
export default {
  data() {
    return {
      menuList: [],
      dynamicMenuRoutes: [],
      role: '',
      icons: [
        'el-icon-s-cooperation',
        'el-icon-s-order',
        'el-icon-s-platform',
        'el-icon-s-fold',
        'el-icon-s-unfold',
        'el-icon-s-operation',
        'el-icon-s-promotion',
        'el-icon-s-release',
        'el-icon-s-ticket',
        'el-icon-s-management',
        'el-icon-s-open',
        'el-icon-s-shop',
        'el-icon-s-marketing',
        'el-icon-s-flag',
        'el-icon-s-comment',
        'el-icon-s-finance',
        'el-icon-s-claim',
        'el-icon-s-custom',
        'el-icon-s-opportunity',
        'el-icon-s-data',
        'el-icon-s-check',
        'el-icon-s-grid',
        'el-icon-menu',
        'el-icon-chat-dot-square',
        'el-icon-message',
        'el-icon-postcard',
        'el-icon-position',
        'el-icon-microphone',
        'el-icon-close-notification',
        'el-icon-bangzhu',
        'el-icon-time',
        'el-icon-odometer',
        'el-icon-crop',
        'el-icon-aim',
        'el-icon-switch-button',
        'el-icon-full-screen',
        'el-icon-copy-document',
        'el-icon-mic',
        'el-icon-stopwatch',
      ],
      menulistStyle: 'vertical',
	  menulistBorderBottom: {},
    }
  },
  mounted() {
    const menus = menu.list()
    if(menus) {
        this.menuList = menus
    } else {
        let params = {
            page: 1,
            limit: 1,
            sort: 'id',
        }
        this.$http({
            url: "menu/list",
            method: "get",
            params: params
        }).then(({
            data
        }) => {
            if (data && data.code === 0) {
                this.menuList = JSON.parse(data.data.list[0].menujson);
                this.$storage.set("menus", this.menuList);
            }
        })
    }
    this.role = this.$storage.get('role')
  },
  created(){
    setTimeout(()=>{
      this.menulistStyleChange()
    },10)
    this.icons.sort(()=>{
      return (0.5-Math.random())
    })
	this.lineBorder()
  },
  methods: {
	lineBorder() {
		let style = 'vertical'
		let w = '4px'
		let s = 'solid'
		let c = '#ccc'
		if(style == 'vertical') {
			this.menulistBorderBottom = {
				borderBottomWidth: w,
				borderBottomStyle: s,
				borderBottomColor: c
			}
		} else {
			this.menulistBorderBottom = {
				borderRightWidth: w,
				borderRightStyle: s,
				borderRightColor: c
			}
		}
	},
    menuHandler(name) {
      let router = this.$router
      name = '/'+name
      router.push(name)
    },
    // 菜单
    setMenulistHoverColor(){
      let that = this
	  return;
      this.$nextTick(()=>{
        document.querySelectorAll('.menulist .el-menu-item').forEach(el=>{
          el.addEventListener("mouseenter", e => {
            e.stopPropagation()
            el.style.backgroundColor = "rgba(36, 139, 146, 1)"
          })
          el.addEventListener("mouseleave", e => {
            e.stopPropagation()
            // el.style.backgroundColor = "linear-gradient(to right,var(--publicSubColor)  , rgba(36, 139, 146, 1))"
			el.style.background = "none"
          })
          el.addEventListener("focus", e => {
            e.stopPropagation()
            el.style.backgroundColor = "rgba(36, 139, 146, 1)"
          })
        })
        document.querySelectorAll('.menulist .el-submenu__title').forEach(el=>{
          el.addEventListener("mouseenter", e => {
            e.stopPropagation()
            el.style.backgroundColor = "rgba(36, 139, 146, 1)"
          })
          el.addEventListener("mouseleave", e => {
            e.stopPropagation()
            // el.style.backgroundColor = "linear-gradient(to right,var(--publicSubColor)  , rgba(36, 139, 146, 1))"
			el.style.background = "none"
          })
        })
      })
    },
    setMenulistIconColor() {
      this.$nextTick(()=>{
        document.querySelectorAll('.menulist .el-submenu__title .el-submenu__icon-arrow').forEach(el=>{
          el.style.color = "rgba(255, 255, 255, 1)"
        })
      })
    },
    menulistStyleChange() {
      this.setMenulistIconColor()
      this.setMenulistHoverColor()
      this.setMenulistStyleHeightChange()
      let str = "2"
      if(1 == str) {
        this.$nextTick(()=>{
          document.querySelectorAll('.el-container .el-container').forEach(el=>{
            el.style.display = "block"
            el.style.paddingTop = "60px" // header 高度
          })
          document.querySelectorAll('.el-aside').forEach(el=>{
            el.style.width = "100%"
            el.style.height = "100%"
            el.style.paddingTop = '0'
          })
          document.querySelectorAll('.index-aside .index-aside-inner').forEach(el=>{
            el.style.paddingTop = '0'
			el.style.width = "100%"
          })
        })
      }
      if(2 === str) {
        this.$nextTick(()=>{
          document.querySelectorAll('.index-aside .index-aside-inner').forEach(el=>{
            el.style.paddingTop = "60px"
          })
        })
      }
    },
    setMenulistStyleHeightChange() {
		return;
      this.$nextTick(()=>{
        document.querySelectorAll('.menulist-item>.el-menu--horizontal>.el-menu-item').forEach(el=>{
          el.style.height = "50px"
          el.style.lineHeight = "50px"
        })
        document.querySelectorAll('.menulist-item>.el-menu--horizontal>.el-submenu>.el-submenu__title').forEach(el=>{
          el.style.height = "50px"
          el.style.lineHeight = "50px"
        })
      })
    },
  }
}
</script>
<style lang="scss" scoped>
.el-container {
  display: block;
}
.index-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;

  .menulistImg {
    font-size: 0;
    box-sizing: border-box;

    .el-image {
      margin: 0 auto;
      width: 100px;
      height: 100px;
      border-radius: 100%;
      display: block;
    }
  }

  .index-aside-inner {
    height: 100%;
    margin-right: -17px;
    margin-bottom: -17px;
    overflow: scroll;
    overflow-x: hidden !important;
    padding-top: 60px;
    box-sizing: border-box;

    &:focus {
      outline: none;
    }

    & /deep/ .el-menu {
      border: 0;
      background-color: transparent;
    }
  }

  .index-aside .index-aside-inner.menulist {
    height: 100% !important;
  }
  .menulist-item {
    width: 210px;
    padding: 0;
    margin: 0;
    border-radius: 0;
    border-width: 0 !important;
    border-style: solid !important;
    border-color: rgba(0,0,0,.3) !important;
    background: linear-gradient(to right, var(--publicMainColor) 0%, var(--publicMainColor) 50%, var(--publicSubColor) 100%) !important;
    box-shadow: 0 0 6px rgba(30, 144, 255, 0);
    box-sizing: border-box;
  }
  .el-menu-demo {
    box-sizing: border-box;
    min-height: calc(100vh - 60px);

    &>.el-menu-item {
      width: 200px;
      height: auto !important;
      line-height: 40px !important;
      padding: 10px;
      margin: 0px 0px 0px 5px;
      color: rgba(255, 255, 255, 1);
      font-size: 14px;
      border-radius: 0;
      border-width: 0px 0px 3px 0px;
      border-style: groove;
      border-color: rgba(220, 223, 230, 1) !important;
      background-color: rgba(144, 238, 144, 0) !important;
      box-shadow: 0 0 6px rgba(255,255,255,0);
      box-sizing: initial;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      box-sizing: border-box;

      .el-icon-menu {
        margin: 0 5px 0 0;
        padding: 0;
        width: 24px;
        line-height: 24px;
        color: rgba(220, 223, 230, 1);
        font-size: 16px;
        border-radius: 0;
        border-width: 0;
        border-style: solid;
        border-color: #fff;
        background-color: rgba(255,255,255,0);
        box-shadow: 0 0 6px rgba(255,255,255,0);
      }
    }

    .el-submenu {
      margin: 0px 0px 0px 5px;
    }

    & /deep/ .el-submenu__title {
      width: 200px;
      height: auto !important;
      line-height: 40px !important;
      padding: 10px;
      color: rgba(255, 255, 255, 1);
      font-size: 14px;
      border-radius: 0;
      border-width: 0px 0px 3px 0px;
      border-style: groove;
      border-color: rgba(220, 223, 230, 1) !important;
      background-color: rgba(144, 238, 144, 0) !important;
      box-shadow: 0 0 6px rgba(255,255,255,0);
      box-sizing: initial;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      box-sizing: border-box;

      .el-icon-menu {
        margin: 0 5px 0 0;
        padding: 0;
        width: 24px;
        line-height: 24px;
        color: rgba(220, 223, 230, 1);
        font-size: 16px;
        border-radius: 0;
        border-width: 0;
        border-style: solid;
        border-color: #fff;
        background-color: rgba(255,255,255,0);
        box-shadow: 0 0 6px rgba(255,255,255,0);
      }

      .el-submenu__icon-arrow {
        margin: 0 10px 0 0;
        padding: 0;
        width: 12px;
        line-height: 12px;
        color: rgba(220, 223, 230, 1) !important;
        font-size: 12px;
        border-radius: 0;
        border-width: 0;
        border-style: solid;
        border-color: #fff;
        background-color: rgba(255,255,255,0);
        box-shadow: 0 0 6px rgba(255,255,255,0);
        position: absolute;
        top: 50%;
        right: 0;
        transform: translateY(-50%);
        text-align: center;
        display: block;
      }
    }

    & /deep/ .el-menu.el-menu--inline {
      width: 100%;
      height: auto;
      padding: 0px 0px 0px 0px;
      margin: 0px 0px 0px -3px;
      border-radius: 0;
      border-width: 0;
      border-style: solid;
      border-color: rgba(0,0,0,.3);
      background-color: rgba(245, 245, 245, 1);
      box-shadow: 0 0 0px rgba(0, 0, 0, .3);

      .el-menu-item {
        width: 100%;
        height: 48px;
        line-height: 48px;
        padding: 0px 50px 0px 0px !important;
        margin: 0px 0px 0px 0px;
        color: #333 !important;
        font-size: 14px;
        border-radius: 0;
        border-width: 0;
        border-style: solid;
        border-color: rgba(0, 0, 0, .3);
        background-color: rgba(245, 245, 245, 1) !important;
        box-shadow: 0 0 6px rgba(30, 144, 255, 0);
        text-align: center;
        min-width: auto;

        &.is-active {
          width: 100%;
          height: 44px;
          line-height: 44px;
          padding: 0px 50px 0px 0px !important;
          margin: 0;
          color: rgba(0, 0, 0, 1) !important;
          font-size: 14px;
          border-radius: 0;
          border-width: 0;
          border-style: solid;
          border-color: rgba(0, 0, 0, 0);
          background-color: rgba(102, 102, 102, 0) !important;
          box-shadow: 0 0 6px rgba(30, 144, 255, 0);
          text-align: center;
        }

        &:hover {
          width: 100%;
          height: 48px;
          line-height: 48px;
          padding: 0px 50px 0px 0px !important;
          margin: 0px 0px 0px 0px;
          color: #fff !important;
          font-size: 14px;
          border-radius: 0;
          border-width: 0;
          border-style: solid;
          border-color: rgba(0, 0, 0, .3);
          background-color:var(--publicSubColor) !important;
          box-shadow: 0 0 6px rgba(30, 144, 255, 0);
          text-align: center;
        }
      }
    }
  }
}
</style>
<style>

.el-menu--horizontal .el-menu--popup {
  width: 100%;
  height: auto;
  padding: 0px 0px 0px 0px;
  margin: 0px 0px 0px -3px;
  border-radius: 0;
  border-width: 0;
  border-style: solid;
  border-color: rgba(0,0,0,.3);
  background-color: rgba(245, 245, 245, 1);
  box-shadow: 0 0 0px rgba(0, 0, 0, .3);
  min-width: auto;
}
.el-menu--horizontal .el-menu--popup .el-menu-item {
  width: 100%;
  height: 48px;
  line-height: 48px;
  padding: 0px 50px 0px 0px;
  margin: 0px 0px 0px 0px;
  color: #333 !important;
  font-size: 14px;
  border-radius: 0;
  border-width: 0;
  border-style: solid;
  border-color: rgba(0, 0, 0, .3);
  background-color: rgba(245, 245, 245, 1) !important;
  box-shadow: 0 0 6px rgba(30, 144, 255, 0);
  text-align: center;
  min-width: auto;
}
.el-menu--horizontal .el-menu--popup .el-menu-item:hover {
  width: 100%;
  height: 48px;
  line-height: 48px;
  padding: 0px 50px 0px 0px;
  margin: 0px 0px 0px 0px;
  color: #fff !important;
  font-size: 14px;
  border-radius: 0;
  border-width: 0;
  border-style: solid;
  border-color: rgba(0, 0, 0, .3);
  background-color:var(--publicSubColor) !important;
  box-shadow: 0 0 6px rgba(30, 144, 255, 0);
  text-align: center;
}
</style>

声明

本博客适用于广泛的学术和教育用途,包括但不限于个人学习、开发设计,产品设计。仅供学习参考,旨在为读者提供深入理解和学术研究的材料。

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

容器编排简介

1.1 什么是容器编排 容器编排是管理和自动化容器化应用程序的部署、扩展、运行和维护的过程。随着微服务架构的普及&#xff0c;应用程序被拆分成许多小型、独立的服务&#xff0c;每个服务都可以封装在容器中独立运行。容器编排工具应运而生&#xff0c;帮助开发者和运维团队更…

嵌入式系统实时任务调度算法优化与实现

嵌入式系统实时任务调度算法优化与实现 目录 嵌入式系统实时任务调度算法优化与实现 引言 1.1 嵌入式系统的重要性 1.2 实时任务调度的重要性 实时任务的定义与分类 2.1 实时任务的定义 2.2 实时任务的分类 2.3 实时任务的其他分类方法 硬实时与软实时系统 3.1 硬实…

STM32CubeMX 配置CAN通信 HAL库

一、CAN总线波特率计算 CAN总线通信的各节点通信时会产生相位差&#xff0c;所以要进行位同步&#xff0c;两个节点保持步调一致。 CAN_SJW&#xff1a;重新同步跳跃宽度(SJW) 。定义了在每位中可以延长或缩短多少个时间单元的上限。其值可以编程为1到4个时间单元。 CAN_BS1&a…

记录一次搭建uniapp-vue3的基础项目

1.使用 HBuilder X 创建uniapp vue3的基础项目 2.安装 自动导包插件 unplugin-auto-import npm install unplugin-auto-import或者 pnpm install unplugin-auto-import2.1 根目录下创建 vite.config.js 复制粘贴以下内容 import { defineConfig } from vite import uni fro…

QT基础知识4

思维导图 项目文件里面要加texttospeech模块 widget.h: #ifndef WIDGET_H #define WIDGET_H#include <QWidget> #include <QTime>//时间类 #include <QTextToSpeech>//语音播报类QT_BEGIN_NAMESPACE namespace Ui { class Widget; } QT_END_NAMESPACEclass…

“论数据分片技术及其应用”写作框架,软考高级,系统架构设计师

论文真题 数据分片就是按照一定的规则&#xff0c;将数据集划分成相互独立、正交的数据子集&#xff0c;然后将数据子集分布到不同的节点上。通过设计合理的数据分片规则&#xff0c;可将系统中的数据分布在不同的物理数据库中&#xff0c;达到提升应用系统数据处理速度的目的…

企业高性能web服务器---nginx详解(基础介绍配置,核心配置)

目录 一、web服务器介绍 1.1 Apache prefork 模型 1.2 Apache worker 模型 ​编辑 1.3 Apache event模型 1.4 Nginx-高性能的web服务端 1.5 服务端 I/O 流程 1.5.1 磁盘 I/O 1.5.2 网络 I/O 二 、nginx 架构及安装 2.1 nginx 进程结构 2.2源码编译安装nginx 2.2.1…

vscode+pyqt5环境搭建

参考&#xff1a;https://blog.csdn.net/qq_37080185/article/details/121616507 一、安装Python 从Python官网上下载安装包&#xff08;https://www.python.org/&#xff09; 安装Python&#xff0c;将安装目录添加到环境变量中。 二、安装Pyqt5 PyQt5以及PyQt5-tools(des…

将光谱数据图片转换成数值格式

文章目录 任务所需工具步骤一&#xff1a;安装必要的Python库步骤二&#xff1a;图像OCR识别步骤三&#xff1a;提取光谱数值并存储完整代码 任务 现测量收集到一批目标色彩样本的光谱响应数据截图(图片保存在spectrum_screenshots文件夹内&#xff0c;截图样例见图1)。其中&a…

PyQt5中如何只使用一个dateEdit控件实现自动选择日期区间功能

wxpython设计GUI&#xff1a;选中wxFormBuilder工具wxCalendarCtrl控件&#xff0c;实现自动选择日期功能 wxPython设计界面转PyQt5设计界面&#xff0c;相同的界面功能&#xff0c;通过移植wxPython源代码实现PyQt5相同界面功能&#xff0c;在实现上述链接提到的自动选择日期…

Windows电脑设置开启自启动Java程序,并且不出现黑窗口

第一步&#xff1a;创建需要运行的批处理文件&#xff08;.bat 文件&#xff09; 在jar文件同级目录下新建文本输入以下内容&#xff0c;其中tunnel-monitoring-server.jar改为自己的程序名称&#xff0c;保存文件后缀改为bat。如下图1&#xff1a; echo off java -jar tunne…

开源的Umi-OCR 文字识别工具

开源的Umi-OCR 文字识别工具&#xff1a;OCR software, free and offline. 开源、免费的离线OCR软件。支持截屏/批量导入图片&#xff0c;PDF文档识别&#xff0c;排除水印/页眉页脚&#xff0c;扫描/生成二维码。内置多国语言库。 可以将图片PDF识别文字&#xff0c;并可以保存…

python | 字符串编码问题怎么破

python字符串常见两种类型&#xff1a;str和 bytes类型 str表示Unicode字符&#xff0c;bytes表示二进制数据 两者之间转换使用&#xff1a;encode()和decode()方法 一、enocde()和decode()方法 &#xff08;一&#xff09;encode()方法 encode()—编码&#xff0c;语法&…

软件测试之常见逻辑思维题

一个岔路口分别通向诚实国和说谎国。来了两个人&#xff0c;已知一个是诚实国的&#xff0c;另一个是说谎国的。诚实国永远说实话&#xff0c;说谎国永远说谎话。现在你要去说谎国&#xff0c;但不知道应该走哪条路&#xff0c;需要问这两个人。请问应该怎么问&#xff1f; 如…

[HDCTF 2023]Welcome To HDCTF 2023

方法一&#xff1a;找个炸弹死掉&#xff0c;flag就出现 方法二&#xff1a;查看页面源码&#xff0c;发现底部assets/js/game.js 复制后访问看到jsfuck编码 复制到控制台查看flag

上海交大周冰心博士:锚定稀缺生物数据挑战,图神经网络重塑蛋白质理解与生成

8 月 12 日&#xff0c;上海交通大学 AI for Bioengineering 暑期学校正式开幕&#xff0c;吸引了来自国内外 30 余所高校和 27 家企业的百余名业内人士。在为期 3 天的学习交流中&#xff0c;多位行业专家、企业界代表及优秀青年学者&#xff0c;围绕 AI 与生物工程的融合与创…

【前缀和算法】--- 一维和二维前缀和模板

Welcome to 9ilks Code World (๑•́ ₃ •̀๑) 个人主页: 9ilk (๑•́ ₃ •̀๑) 文章专栏&#xff1a; 算法Journey 本文开始,博主开始讲解有关前缀和的算法&#xff0c;本篇博客我们先来了解一下有关前缀和的两个模板。 &#x1f3e0; 一维前缀和模板 &…

CPU内部单总线数据通路各阶段的微操作序列利控制信号

1.内部总线与系统总线 内部总线是指同一部件&#xff0c;如CPU内部连接各寄存器及运算部件之间的总线&#xff1b; 系统总线是指同一台计算机系统的各部件&#xff0c;如CPU、内存、通道和各类/0接口间互相连接的总线。 2.寄存器之间数据传送 比如把PC内容送至MAR&#xff…

利用多Lora节省大模型部署成本|得物技术

一、背景 近期&#xff0c;我们在大模型集群的部署过程中遇到了一些挑战。公司有多个业务场景&#xff0c;每个场景都基于自身的数据进行微调&#xff0c;训练出相应的大模型并上线。然而&#xff0c;这些场景的调用量并不高&#xff0c;同时大模型的部署成本较为昂贵&#xf…

从0到1!如何利用GPT创作高质量的儿童绘本故事?(附提示词)

儿童绘本故事需要有趣、富有教育意义&#xff0c;并且简单易懂。利用GPT来创作这样的故事&#xff0c;可以让创意过程变得轻松且高效。以下是一份详细教程&#xff0c;帮助你用GPT创作出吸引孩子们的高质量绘本故事。 1. 明确故事目标和受众 在开始创作之前&#xff0c;明确故事…