Java项目:中小企业设备管理系统(java+SpringBoot+Mybaits+Vue+elementui+mysql)

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

环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 
4.数据库:MySql 5.7/8.0版本均可;
5.是否Maven项目:是;

技术栈
后端:SpringBoot+Mybaits
前端:Vue+elementui

使用说明
项目运行:
1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
4. 运行项目,在浏览器中输入地址:
前台地址:http://localhost:8080/springbootrpj39/front/index.html
后台地址:http://localhost:8080/springbootrpj39/admin/dist/index.html
管理员 abo 密码 abo
用户:用户1 密码: 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
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";
    }

}

设备类型信息控制层:

@Controller
@RequestMapping("/baseInfos")
public class BaseInfoController {

    @Autowired
    private BaseInfoService baseInfoService;
    @Autowired
    private LogService logService;

    /**
     * 获取所有设备类型信息
     * @param map
     * @return
     */
    @RequestMapping("/type/list")
    public String listDeviceType(ModelMap map){
        List<DeviceType> typeList = baseInfoService.listDeviceType();
        map.put("typeList",typeList);
     return "deviceTypes::table-refresh";
    }

    /**
     * 添加设备类型
     * @param deviceType
     * @return
     */
    @PostMapping("/type")
    @ResponseBody
    public int addtDeviceType(DeviceType deviceType){
        return baseInfoService.addtDeviceType(deviceType);
    }

    /**
     * 删除设备类型
     * @param typeId
     * @return
     */
    @DeleteMapping("/type/{typeId}")
    @ResponseBody
    public int delteDeviceTypByid(@PathVariable("typeId") String typeId){
        return baseInfoService.deleteDeviceTypeById(typeId);
    }

    /**
     * 修改设备类型
     * @param deviceType
     * @return
     */
    @PutMapping("/type")
    @ResponseBody
    public int updateDeviceType(DeviceType deviceType){
        return baseInfoService.updateDeviceType(deviceType);
    }

    /**
     * 获取所有设备品牌信息
     * @param map
     * @return
     */
    @RequestMapping("/brand/list")
    public String listDeviceBrand(ModelMap map){
        List<DeviceBrand> brandList = baseInfoService.listDeviceBrand();
        map.put("brandList",brandList);
        return "deviceBrands::table-refresh";
    }

    /**
     * 添加设备品牌
     * @param deviceBrand
     * @return
     */
    @PostMapping("/brand")
    @ResponseBody
    public int addtDeviceBrand(DeviceBrand deviceBrand){
        return baseInfoService.addtDeviceBrand(deviceBrand);
    }

    /**
     * 删除设备品牌
     * @param brandId
     * @return
     */
    @DeleteMapping("/brand/{brandId}")
    @ResponseBody
    public int delteDeviceBrandByid(@PathVariable("brandId") String brandId){
        return baseInfoService.deleteDeviceBrandById(brandId);
    }

    /**
     * 修改品牌
     * @param deviceBrand
     * @return
     */
    @PutMapping("/brand")
    @ResponseBody
    public int updateDeviceBrand(DeviceBrand deviceBrand){
        return baseInfoService.updateDeviceBrand(deviceBrand);
    }


    /**
     * 获取系统日志
     * @param map
     * @return
     */
    @RequestMapping("/log")
    public String listLog(ModelMap map, HttpServletRequest request){
        String startTime = request.getParameter("startTime");
        String endTime = request.getParameter("endTime");
        List<SystemLog> logs = logService.listLogsByDate(startTime,endTime);
        map.put("logList",logs);
        return "system::logList-refresh";
    }


}

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

OldWinePot

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值