Java项目:企业固定资产管理系统(java+SpringBoot+VUE+maven+mysql)

news/2024/7/10 1:23:23 标签: java, mysql, springboot, VUE, shiro

源码获取:博客首页 "资源" 里下载!

项目介绍

本项目分为管理员与游客两种角色,
超级管理员角色包含以下功能:
管理员登录,借还管理,资产添加,资产总览,借还报表,用户管理,角色管理,权限管理,资源类型,网点管理等功能。

游客角色包含以下功能:
游客首页-广告页等功能。

PS:左上角WEB控制台点击进去管理页面,需要注意的是,管理员可以在后台添加无数个角色和权限,所以这个不是一个单角色的系统。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;

5.数据库:MySql 5.7版本;

6.是否Maven项目:是;

技术栈

1. 后端:springboot, mybatis, shiro

2. 前端:HTML+CSS+JavaScript+VUE

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中config/application.properties配置文件中的数据库配置改为自己的配置;
4. 运行项目,输入http://localhost:8080/ 登录
管理员账号/密码:admin/123456

 

 

 

 

 

组织机构控制器:

/**
 * 组织机构控制器
 */

@Controller
@RequestMapping("/organization")
public class OrgController {
    @Autowired
    private OrganizationService organizationService;

    /**
     * 根据条件动态查询组织,数据加载到表格
     */
    @PostMapping("/list")
    public String listOrganizationByLevel(Organization example, ModelMap map){
        List<Organization> list = organizationService.listOrganizationByExample(example);
        int sublevel = example.getOrgLevel();
        map.put("dtoList",list);
        String pageName = null;
        switch (sublevel) {  //根据参数确定返回页面目标
            case  1: pageName= "friDepartments" ;break;
            case  2: pageName= "secDepartments" ;break;
            case  3: pageName= "macAddress" ;break;
        }
        return  pageName+"::table-refresh";
    }

    /**
     * 根据条件动态查询子级组织
     */
    @PostMapping("/sub/list")
    @ResponseBody
    public List listOrganization(Organization example){
        List<Organization> list = organizationService.listOrganizationByExample(example);
        return  list;
    }

    /**
     * 根据一级部门和二级部门id查询物理位置
     */
    @PostMapping("/macAddress/list")
    public String listMacaddress(String fristId,String secondId,ModelMap map){
        List<Organization> list = organizationService.listMacaddressByRootID(fristId,secondId);
        map.put("dtoList",list);
        return  "macAddress::table-refresh";
    }



    /**
     * 添加组织
     * @param organization
     * @return
     */
    @PostMapping
    @ResponseBody
    public int addOrganization(Organization organization){
        return organizationService.insertOrganization(organization);
    }

    /**
     * 删除组织
     * @param orgId
     * @return
     */
    @DeleteMapping("/{orgId}")
    @ResponseBody
    public int delteOrganizationByid(@PathVariable("orgId") String orgId){
        return organizationService.deleteOrganizationById(orgId);
    }

    /**
     * 修改组织名称
     * @param organization
     * @return
     */
    @PutMapping
    @ResponseBody
    public int updateDeviceType(Organization organization){
        return organizationService.updateOrganizationName(organization);
    }

    /**
     * 获取组织树
     * @return
     */
    @GetMapping("/tree")
    @ResponseBody
    public OrganizationDTO getOrganizationTree(){
        return organizationService.getOrgTree();
    }

}

账户管理控制层: 

@Controller
@RequestMapping("/account")
public class AccountController {
    //自动注入服务类
    @Autowired
    private AccountService accountService;

    /**
     * 管理员账户信息
     * @return
     */
    @GetMapping("/admins")
    public String listAdmins(ModelMap map){
        List<AccountDTO> adminList = accountService.listAccountByLevel(2);
        List<AccountDTO> superAdminList = accountService.listAccountByLevel(1);
        adminList.addAll(superAdminList);
        map.put("adminsList", adminList);
        return "system::table-refresh";
    }

    /**
     * 获取所有账户信息
     * @param map
     * @return
     */
    @GetMapping("/list")
    public String listAccounts(ModelMap map){
       List<AccountDTO> accountList = accountService.listAccount();
        map.put("accountDTOList", accountList);
        return "account::table-refresh";
    }

    /**
     * 通过用户名称搜索用户
     * @param map
     * @param userName
     * @return
     */
    @GetMapping("/list/{userName}")
    public String listAccountsByUserName(ModelMap map,@PathVariable("userName")String userName){
       List<AccountDTO> accountList = accountService.listAccountByName(userName);
        map.put("accountDTOList", accountList);
        return "account::table-refresh";
    }
    /**
     * 添加管理员页面
     * @param map
     * @return
     */
    @GetMapping("/users")
    public String listUsers(ModelMap map){
        List<AccountDTO> accountList = accountService.listAccountByLevel(3);
        map.put("usersDTOList", accountList);
        return "system::list-refresh";
    }

    /**
     * 获取设备使用人信息
     * @param map
     * @param devId
     * @return
     */
    @GetMapping("/ownerList")
    public String getOwnerList(ModelMap map, String devId){
        Map resMap  = accountService.listOwenrByDevId(devId);
        map.put("ownerMap", resMap);
        return "allotDevice::list-refresh";
    }

    /**
     * 添加账户
     * @param account
     * @return
     */
    @PostMapping
    @ResponseBody
    public int addAccount(Account account){
        return accountService.addAccount(account);
    }

    /**
     * 根据uuid删除账户
     * @param uuid
     * @return
     */
    @DeleteMapping("/{uuid}")
    @ResponseBody
    public int deleteAccount(@PathVariable("uuid")String uuid){
        return accountService.deleteAccountById(uuid);
    }

    /**
     * 修改账户密码
     * @param uuid
     * @param password
     * @return
     */
    @PutMapping("/password")
    @ResponseBody
    public int updatePassword(String uuid, String password){
        return accountService.updatePasswordByid(uuid,password);
    }

    /**
     * 修改账户状态
     * @param uuid
     * @param status
     * @return
     */
    @PutMapping("/status")
    @ResponseBody
    public int updateStatus(String uuid,int status){
        return accountService.updateStatusByid(uuid,status);
    }

    /**
     * 更改管理员
     * @return
     */
    @PutMapping("/admins")
    @ResponseBody
    public int updateDevOwner(HttpServletRequest request){
        String[] groups = request.getParameter("groups").split(",");
        int level = Integer.parseInt(request.getParameter("level"));
        return  accountService.updateAccountLevel(level,groups);
    };

}

登录控制层:

@Controller
public class LoginController {

    @RequestMapping("/login")
    public String login(HttpServletRequest request, Model mv) {
        String e = (String) request.getAttribute("shiroLoginFailure");
        if (e != null) {
            if (e.contains("org.apache.shiro.authc.UnknownAccountException")) {
                mv.addAttribute("msg", "账号不存在");
            } else if (e.contains("org.apache.shiro.authc.IncorrectCredentialsException")) {
                mv.addAttribute("msg", "密码错误");
            } else if (e.contains("org.apache.shiro.authc.LockedAccountException")) {
                mv.addAttribute("msg", "账户已停用");
            }
        }
        return "login";
    }

}

源码获取:博客首页 "资源" 里下载! 


http://www.niftyadmin.cn/n/1554126.html

相关文章

Linux c PHP通讯,Linux C编程 - 管道pipe

在linux中&#xff0c;管道也是一种文件&#xff0c;只不过比较特殊&#xff0c;我们可以用pipe函数创建一个管道&#xff0c;其原型声明如下&#xff1a;#inlcude int pipe(int fields[2]);其实它相当于一个通信缓冲区&#xff0c;fields[0]用来读&#xff0c;fields[1]用来写…

Java项目:汽车配件销售管理系统(java+SpringBoot+layui+html+maven+mysql)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 项目介绍 本项目为后台管理系统&#xff0c; 主要功能包括&#xff1a; 公告增删改查&#xff0c;用户管理&#xff0c;登录页面&#xff0c;订单查询&#xff0c;配件添加等等 环境需要 1.运行环境&…

php字符串搜索和正则匹配,php针对字符串的正则匹配

本篇文章主要介绍php针对字符串的正则匹配&#xff0c;感兴趣的朋友参考下&#xff0c;希望对大家有所帮助。具体实现方法如下&#xff1a;/*** is_external_link 检测字符串是否包含外链* param string $text 文字* param string $host 域名* return boolean false 有外链 tru…

Java项目:简单博客管理系统(java+SpringBoot+jsp+html+maven+mysql)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 项目介绍 本项目为前后台管理系统&#xff0c;包括博主与游客两种角色&#xff1b; 博主角色包含以下功能&#xff1a; 博主登录,发博客,博主可以删除博客等功能。 游客角色包含以下功能&#xff1a; 首页,…

Java项目:体育用品商城(java+SpringBoot+jsp+html+maven+mysql)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 项目介绍 本项目为前后台管理系统&#xff0c;包括管理员与普通用户两种角色&#xff1b; 管理员角色包含以下功能&#xff1a; 管理员登录,用户管理,商品类型管理,商品管理,订单信息管理,用户留言管理,资讯…

在线库和离线库oracle,在线移动数据库文件

在线移动数据库文件在12C以前的版中&#xff0c;如果需要移动数据文件到新的位置&#xff0c;基本的过程如下:1,表空间离线;2,copy或是mv文件到新的位置;3,修改位置alter tablespace t1 rename datafile datafile1 to datafile2;或是alter database rename file datafile1 to d…

oracle 11.2 安装asm,oracle 11.2+asm重建经验(单机)

今天打算把这些天的经验所得写下来&#xff0c;一来自己可以再次回忆一遍&#xff0c;记得更牢&#xff0c;二来别人可能也会碰到跟我一样的问题&#xff1a;前段时间&#xff0c;数据中心的一台数据库服务器出现故障无法登陆&#xff0c;让机房人员重启了下服务器&#xff0c;…

Java项目:共享自习室预约管理系统(java+SpringBoot+Thymeleaf+html+maven+mysql)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 项目介绍 项目主要功能包括&#xff1a; 数据分析&#xff1a;柱状图分析、折线图分析、统计数据等&#xff0c;每10秒自动刷新 用户管理&#xff1a;用户信息管理、用户投诉管理、投诉反馈信息、黑名单管理…