springBoot员工管理系统

本文档详细介绍了如何使用SpringBoot构建一个员工管理系统,包括新建项目、导入依赖、配置静态资源、数据库模拟、DAO层设计、主页搭建、页面国际化、登录功能、登录拦截器、员工列表展示、添加、编辑和删除员工功能,以及整合jdbc、druid数据源和mybatis的步骤。

员工管理系统

1、准备工作

静态资源:链接:https://pan.baidu.com/s/1qtUDuJNVupr872kVDO-veg
提取码:fabo

gitee:https://gitee.com/planting-trees-chen/spring-boot

新建springboot项目

image-20201109155818293

导入jar包

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.18.12</version>
        <scope>provided</scope>
    </dependency>


    <!--thymeleaf-->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>

    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>jquery</artifactId>
        <version>3.4.1</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf-spring5</artifactId>
        <version>3.0.9.RELEASE</version>
        <type>pom</type>
    </dependency>

    <dependency>
        <groupId>org.thymeleaf.extras</groupId>
        <artifactId>thymeleaf-extras-java8time</artifactId>
    </dependency>

</dependencies>

添加静态资源

image-20201109160148706

数据库文件,模拟

实体类Department部门

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department {
   
   
    private Integer id;
    private String departmentName;
}

实体类,员工Employee

@Data
@NoArgsConstructor
public class Employee {
   
   
    private Integer id;
    private String lastName;
    private String email;
    private Integer gender;
    private Department department;
    private Date birth;

    public Employee(Integer id, String lastName, String email, Integer gender, Department department) {
   
   
        this.id = id;
        this.lastName = lastName;
        this.email = email;
        this.gender = gender;
        this.department = department;
        this.birth = new Date();
    }
}

dao层

//部门dao
@Repository
public class DepartmentDao {
   
   
    //模拟数据库数据
    private static Map<Integer, Department> departments = null;

    static {
   
   
        departments = new HashMap<>();
        departments.put(101, new Department(101, "教学部"));
        departments.put(102, new Department(102, "市场部"));
        departments.put(103, new Department(103, "教研部"));
        departments.put(104, new Department(104, "运营部"));
        departments.put(105, new Department(105, "后勤部"));
    }

    //获得所有部门信息
    public Collection<Department> getDepartment() {
   
   
        return departments.values();
    }

    //通过ID的到部门
    public Department getDepartmentById(Integer id) {
   
   
        return departments.get(id);
    }
}
//员工dao
@Repository
public class EmployeeDao {
   
   

    private static Map<Integer, Employee> employees = null;

    //员工所属部门
    @Autowired
    private DepartmentDao departmentDao;

    static {
   
   
        employees = new HashMap<>();    //创建部门表

        employees.put(1001, new Employee(1001, "AA", "2921625927@qq.com", 1, new Department(101, "教学部")));
        employees.put(1002, new Employee(1002, "BB", "4534545434@qq.com", 0, new Department(102, "市场部")));
        employees.put(1003, new Employee(1003, "CC", "7767546755@qq.com", 1, new Department(103, "教研部")));
        employees.put(1004, new Employee(1004, "DD", "7654788797@qq.com", 0, new Department(104, "运营部")));
        employees.put(1005, new Employee(1005, "EE", "4343546768@qq.com", 1, new Department(105, "后勤部")));

    }

    //主键自增
    private static Integer initId = 1006;

    //添加员工
    public void save(Employee employee) {
   
   
        if (employee.getId() == null) {
   
   
            employee.setId(initId++);
        }
        employee.setDepartment(departmentDao.getDepartmentById(employee.getDepartment().getId()));
        employees.put(employee.getId(), employee);
    }

    //查询全部员工信息
    public Collection<Employee> getAll() {
   
   
        return employees.values();
    }

    //通过id查询
    public Employee getEmployeeById(Integer id) {
   
   
        return employees.get(id);
    }

    //删除
    public void delete(Integer id) {
   
   
        employees.remove(id);
    }
}

课程简介:历经半个多月的时间,Debug亲自撸的 “企业员工角色权限管理平台” 终于完成了。正如字面意思,本课程讲解的是一个真正意义上的、企业级的项目实战,主要介绍了企业级应用系统中后端应用权限的管理,其中主要涵盖了六大核心业务模块、十几张数据库表。 其中的核心业务模块主要包括用户模块、部门模块、岗位模块、角色模块、菜单模块和系统日志模块;与此同时,Debug还亲自撸了额外的附属模块,包括字典管理模块、商品分类模块以及考勤管理模块等等,主要是为了更好地巩固相应的技术栈以及企业应用系统业务模块的开发流程! 核心技术栈列表: 值得介绍的是,本课程在技术栈层面涵盖了前端和后端的大部分常用技术,包括Spring Boot、Spring MVC、Mybatis、Mybatis-Plus、Shiro(身份认证与资源授权跟会话等等)、Spring AOP、防止XSS攻击、防止SQL注入攻击、过滤器Filter、验证码Kaptcha、热部署插件Devtools、POI、Vue、LayUI、ElementUI、JQuery、HTML、Bootstrap、Freemarker、一键打包部署运行工具Wagon等等,如下图所示: 课程内容与收益: 总的来说,本课程是一门具有很强实践性质的“项目实战”课程,即“企业应用员工角色权限管理平台”,主要介绍了当前企业级应用系统中员工、部门、岗位、角色、权限、菜单以及其他实体模块的管理;其中,还重点讲解了如何基于Shiro的资源授权实现员工-角色-操作权限、员工-角色-数据权限的管理;在课程的最后,还介绍了如何实现一键打包上传部署运行项目等等。如下图所示为本权限管理平台的数据库设计图: 以下为项目整体的运行效果截图: 值得一提的是,在本课程中,Debug也向各位小伙伴介绍了如何在企业级应用系统业务模块的开发中,前端到后端再到数据库,最后再到服务器的上线部署运行等流程,如下图所示:
基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目),个人经导师指导并认可通过的高分设计项目,评审分99分,代码完整确保可以运行,小白也可以亲自搞定,主要针对计算机相关专业的正在做大作业的学生和需要项目实战练习的学习者,可作为毕业设计、课程设计、期末大作业。基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(高分项目)基于fisco-bcos区块链平台搭建的供应链系统全部资料(
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值