springboot 报表管理系统(基于SpingBoot框架的企业办公管理系统)
springboot 报表管理系统(基于SpingBoot框架的企业办公管理系统)List<Memo> list = service.getUserMemoList(); request.setAttribute("memolist" list);前端html: @Pointcut("@annotation(com.du.lin.annotation.BizLog)") public void logCut() { }使用Thymeleaf使得html代码更简洁下面是便签功能实现的部分片段。 后端:Lin中摒弃了传统的xml配置文件,使得配置文件更加清晰、简洁,下列为Shrio配置文件中的片段@Configuration public class ShiroConfig { /** * 安全管理器 * @param rememberMeManager *
企业办公管理系统,可以提供强大的模块化服务,帮助企业进行诸如制定计划、组织活动、上班考勤、领导管理和日志记录等功能,各个部分以模块化进行划分,软件具体可以分为部门管理、角色管理、用户管理、考勤管理、日志管理等部分。
这个系统使用了现在很流行的开发软件和相关技术,使用了目前最流行最方便的JAVA框架——SpringBoot框架,安全的Shiro权限管理解决方案、前端使用了Thymeleaf作为模板语言,关系型数据库框架——Mybatis,其中的MySQL数据库是中小型数据处理的最优选择方案。
SpringBoot框架是继spingMVC框架之后的有一个非常受欢迎的框架,具有很高的实用性,大大地减少了框架搭建之时的各种配置工作。是目前最优秀的JAVA框架,可以说是当SpringBoot框架出现之后,别的框架就黯然失色。该特性使开发人员能够摆脱复杂的配置工作和依赖的管理工作,更加关注业务逻辑。
项目特点1.项目基于SpringBoot,简化了大量的配置和Maven依赖。
2.日志记录系统,记录用户的登陆、登出,用户执行的操作,通过@BizLog注解以及Spring中的AOP功能,记录了具体到用户的业务操作、登入登出,并且可以下载excel格式,方便查看。
3.利用Thymeleaf使得前端html代码看起来更加清晰。
4.通过角色管理来配置菜单,达到菜单为不同部门显示的目的,间接实现了权限的管理。
5.创建表后,通过LinGenerater类可生成包括html、js、Dao、Service、Controller等代码,复制进项目可直接使用。
Lin中摒弃了传统的xml配置文件,使得配置文件更加清晰、简洁,下列为Shrio配置文件中的片段
@Configuration
public class ShiroConfig {
/**
* 安全管理器
* @param rememberMeManager
* @return
*/
@Bean
public DefaultWebSecurityManager securityManager(CookieRememberMeManager rememberMeManager){
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
securityManager.setRememberMeManager(rememberMeManager);
securityManager.setRealm(this.shiroDbRealm());
return securityManager;
}
@Bean
public ShiroDbRealm shiroDbRealm(){
return new ShiroDbRealm();
}
代码生成
项目借助Mybatis Plus代码生成器生成Bean以及Dao,通过Velocity生成Controller、Service、ServiceImpl、html、js文件。在数据库中创建新表后,代码生成文件即可根据此表生成上述文件,实现了基本的表格展示、增删改查功能,可直接复制进项目中直接使用,添加菜单数据到数据库,即可在项目中看到此菜单页面。
public static void main(String[] args) throws IOException {
// 参数为表名
LinGenerater lg = new LinGenerater("thing");
// 此方法可以生成代码
lg.execute();
// 此方法可以插入菜单数据
lg.insertMenu("thing" "测试生成" "globe");
}
日志记录
日志记录通过aop(LogAop类)方式对所有包含@BizLog注解的方法进行aop切入,通过@Bizlog注解中的value属性来获取用户所做的操作,封装为日志类,异步存入数据库中(通过ScheduledThreadPoolExecutor类)。
@Pointcut("@annotation(com.du.lin.annotation.BizLog)")
public void logCut() {
}
使用Thymeleaf使得html代码更简洁
下面是便签功能实现的部分片段。 后端:
List<Memo> list = service.getUserMemoList();
request.setAttribute("memolist" list);
前端html:
<li th:each="memo memoStat:${memolist}">
<div>
<small th:text="${memo.time}"></small>
<small th:text="${memo.time}"></small>
<h4 th:text="${memo.title}"></h4>
<p th:text="${memo.text}"></p>
<a th:id="${memo.id}" onclick="deletememodialog(this)">
<i class="fa fa-trash-o "></i></a>
</div>
</li>
所用框架前端
- Bootstrap
- jQuery
- jqGrid
- jstree
- SweetAlert
- SpringBoot
- MyBatis Plus
- Spring
- Thymeleaf
- Ehcache
- Kaptcha
- Shiro
- Velocity
项目演示视频如下:
获取源码请关注并私信“BG”