基于Sprngboot+Vue的分布式酒店管理系统

简介: 基于Sprngboot+Vue的分布式酒店管理系统

使用技术:dubbo+zookeeper实现分布式

开发技术:springboot+springmvc+mybatis+shiro(权限管理)

开发工具:IDEA、ECLIPSE

数据库:MYSQL

第三方存储:阿里云OSS存储照片

依赖管理:Maven

前端技术:Vue

开发方式:前后端分离

项目编号:BS-XX-028

本系统功能完整,运行无误,页面交互性强,使用技术先进,适合做毕业设计使用。

部分功能展示:

登陆界面

宾客管理

客房管理

客人登记入住:

历史记录

角色管理

权限管理

本项目功能强大,技术先进,适合做毕业设计使用。

部分实现代码:

package gmail.zxm.dubboz1jdglweb.controller;
import com.alibaba.dubbo.config.annotation.Reference;
import d.z1.entity.Authority;
import d.z1.entity.Message;
import d.z1.jdgl.api.IAuthorityService;
import gmail.zxm.dubboz1jdglweb.oss.OSSUtil;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.websocket.server.PathParam;
@RestController
@RequestMapping("/authority")
public class AuthorityController {
    @Reference
    private IAuthorityService authorityService;
    private Message msg = new Message();
    private static Logger log = LoggerFactory.getLogger(AuthorityController.class);
    @PostMapping("/add")
    public Message add(Authority authority, @RequestParam(value = "file",required = false) MultipartFile file) throws Exception {
        try {
//            文件不为null时,添加文件
            if (!file.isEmpty()) {
                String fileType = file.getContentType().replace("/", "_");
                authority.setPicture(OSSUtil.uploadDocument(file, fileType));
            }
            msg.setData(authorityService.add(authority));
            msg.setPageSizes(1);
            msg.setStatus(200);
        } catch (Exception e) {
            throw e;
        }
        return msg;
    }
    @PostMapping("/del")
    public Message del(Authority authority) throws Exception {
        if (authority == null)
            return msg;
        try {
//            获取文件的url访问地址
            String fileName = authority.getPicture().substring(authority.getPicture().indexOf("images"));
            msg.setData(authorityService.del(authority));
//            对象删除成功,删除图片
            OSSUtil.deleteDocument(fileName);
            msg.setPageSizes(1);
            msg.setStatus(200);
        } catch (Exception e) {
            throw e;
        }
        return msg;
    }
    @RequiresAuthentication
    @PostMapping("/rep")
    public Message rep(Authority authority,
                       @RequestParam(value = "file", required = false) MultipartFile file) throws Exception {
        try {
//            删除旧文件,并上传新文件
            if (file != null) {
                authority.setPicture(OSSUtil.updateDocument(file,
                        file.getContentType().replace("/", "_"),
                        authority.getPicture().substring(authority.getPicture().indexOf("images"))));
            }
            msg.setData(authorityService.rep(authority));
            msg.setPageSizes(1);
            msg.setStatus(200);
        } catch (Exception e) {
            throw e;
        }
        return msg;
    }
    @RequiresAuthentication
    @GetMapping("/getAll/{startIndex}/{endSize}")
    public Message getAll(@PathVariable Integer startIndex,
                          @PathVariable Integer endSize) throws Exception {
        try {
            msg.setData(authorityService.getAll(startIndex, endSize));
            msg.setPageSizes(authorityService.getSize());
            msg.setStatus(200);
            System.out.println(authorityService.getAll(startIndex, endSize));
        } catch (Exception e) {
            throw e;
        }
        return msg;
    }
    @PostMapping("/getT")
    public Message getT(Authority authority, @RequestParam("startIndex") Integer startIndex,
                        @RequestParam("endSize") Integer endSize) throws Exception {
        try {
            msg.setData(authorityService.getT(authority, startIndex, endSize));
            msg.setPageSizes(authorityService.getSize());
            msg.setStatus(200);
        } catch (Exception e) {
            throw e;
        }
        return msg;
    }
    /**
     * 接口默认方法,根据权限名,返回,该权限的状态,是否启用权限
     *
     * @param auth 权限名
     * @return 返回满足条件的一个字段
     */
    @GetMapping("/getAuthority/{auth}")
    public Message getAuthority(@PathVariable String[] auth) throws Exception {
        try {
            msg.setData(authorityService.getAuthority(auth));
            msg.setStatus(200);
            System.out.println(msg);
        } catch (Exception e) {
            throw e;
        }
        return msg;
    }
}
package gmail.zxm.dubboz1jdglweb.controller;
import com.alibaba.dubbo.config.annotation.Reference;
import d.z1.entity.Book;
import d.z1.entity.Message;
import d.z1.jdgl.api.IBookService;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;
import javax.websocket.server.PathParam;
@RestController
@RequestMapping("/book")
public class BookController {
    @Reference
    private IBookService bookService;
    private Message msg = new Message();
    @PostMapping("/add")
    @RequiresPermissions("book:add")
    public Message add(Book book)throws Exception {
        try {
            msg.setData(bookService.add(book));
            msg.setPageSizes(1);
            msg.setStatus(200);
        } catch (Exception e) {
            throw e;
        }
        return msg;
    }
    @PostMapping("/del")
    @RequiresPermissions("book:del")
    public Message del(Book book)throws Exception {
        System.out.println(book.getRecord());
        if (book == null)
            return msg;
        try {
            msg.setData(bookService.del(book));
            msg.setPageSizes(1);
            msg.setStatus(200);
        } catch (Exception e) {
            throw e;
        }
        return msg;
    }
    @PostMapping("/rep")
    @RequiresPermissions("book:rep")
    public Message rep(Book book)throws Exception {
        try {
            msg.setData(bookService.rep(book));
            msg.setPageSizes(1);
            msg.setStatus(200);
        } catch (Exception e) {
            throw e;
        }
        return msg;
    }
    @GetMapping("/getAll/{startIndex}/{endSize}")
    @RequiresAuthentication
    public Message getAll(@PathVariable Integer startIndex, @PathVariable Integer endSize)throws Exception {
        try {
            msg.setData(bookService.getAll(startIndex,endSize));
            msg.setPageSizes(bookService.getSize());
            msg.setStatus(200);
            System.out.println(bookService.getAll(startIndex,endSize));
        } catch (Exception e) {
            throw e;
        }
        return msg;
    }
    @PostMapping("/getT")
    @RequiresAuthentication
    public Message getT(Book book, @RequestParam("startIndex") Integer startIndex,
                        @RequestParam("endSize") Integer endSize)throws Exception {
        try {
            msg.setData(bookService.getT(book,startIndex,endSize));
            msg.setPageSizes(bookService.getSize());
            msg.setStatus(200);
        } catch (Exception e) {
            throw e;
        }
        return msg;
    }
}
package gmail.zxm.dubboz1jdglweb.controller;
import com.alibaba.dubbo.config.annotation.Reference;
import d.z1.entity.Message;
import d.z1.jdgl.api.ICustomerService;
import d.z1.entity.Customer;
import gmail.zxm.dubboz1jdglweb.oss.OSSUtil;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.websocket.server.PathParam;
@RestController
@RequestMapping("/customer")
public class CustomerController {
    @Reference
    private ICustomerService customerService;
    private Message msg = new Message();
    @PostMapping("/add")
    @RequiresPermissions("customer:add")
    public Message add(Customer customer, @RequestParam(value = "file",required = false) MultipartFile file) throws Exception {
        try {
//            文件不为null时,添加新文件
            if (file != null)
                customer.setCustomerPicture(OSSUtil.uploadDocument(file, file.getContentType().replace("/","_")));
            msg.setData(customerService.add(customer));
            msg.setPageSizes(1);
            msg.setStatus(200);
        } catch (Exception e) {
            throw e;
        }
        return msg;
    }
    @PostMapping("/del")
    @RequiresPermissions("customer:del")
    public Message del(Customer customer) throws Exception {
        if (customer == null)
            return msg;
        try {
//            获取文件url访问地址
            String fileName = customer.getCustomerPicture().substring(customer.getCustomerPicture().indexOf("images"));
            msg.setData(customerService.del(customer));
//            对象删除成功时,根据文件名删除文件
            OSSUtil.deleteDocument(fileName);
            msg.setPageSizes(1);
            msg.setStatus(200);
        } catch (Exception e) {
            throw e;
        }
        return msg;
    }
    @PostMapping("/rep")
    @RequiresPermissions("customer:rep")
    public Message rep(Customer customer, @RequestParam(value = "file",required = false) MultipartFile file) throws Exception {
        try {
//            删除旧文件,并上传新文件
            if (file != null){
                customer.setCustomerPicture(OSSUtil.updateDocument(file,
                        file.getContentType().replace("/","_"),
                        customer.getCustomerPicture().substring(customer.getCustomerPicture().indexOf("upload"))));
            }
            msg.setData(customerService.rep(customer));
            msg.setPageSizes(1);
            msg.setStatus(200);
        } catch (Exception e) {
            throw e;
        }
        return msg;
    }
    @RequiresAuthentication
    @GetMapping("/getAll/{startIndex}/{endSize}")
    public Message getAll(@PathVariable Integer startIndex,
                          @PathVariable Integer endSize) throws Exception {
        try {
            msg.setData(customerService.getAll(startIndex, endSize));
            msg.setPageSizes(customerService.getSize());
            msg.setStatus(200);
        } catch (Exception e) {
            throw e;
        }
        return msg;
    }
    @PostMapping("/getT")
    @RequiresAuthentication
    public Message getT(Customer customer, @RequestParam("startIndex") Integer startIndex,
                        @RequestParam("endSize") Integer endSize) throws Exception {
        try {
            msg.setData(customerService.getT(customer, startIndex, endSize));
            msg.setPageSizes(customerService.getSize());
            msg.setStatus(200);
        } catch (Exception e) {
            throw e;
        }
        return msg;
    }
}
相关文章
|
9天前
|
存储 安全 数据管理
新型数据库技术:基于区块链的分布式数据存储系统
传统数据库系统面临着中心化管理、数据安全性和可信度等方面的挑战。本文介绍了一种基于区块链技术的新型数据库系统,通过分布式存储和去中心化的特性,提高了数据的安全性和可信度,同时实现了高效的数据管理和共享。该系统在多个领域如金融、医疗和物联网等具有广阔的应用前景。
|
5天前
|
存储 安全 数据管理
新一代数据库技术:融合区块链的分布式存储系统
传统数据库技术在面对日益增长的数据量和复杂的数据管理需求时显现出局限性。本文介绍了一种新一代数据库技术:融合区块链的分布式存储系统。通过将区块链技术与传统数据库相结合,实现了数据的分布式存储、安全性和透明度,以及去中心化的特性。这一技术的应用将极大地推动数据库系统的发展,为数据管理带来全新的解决方案。
|
5天前
|
存储 安全 数据管理
新一代数据库技术:融合区块链的分布式数据存储系统
传统数据库系统面临着数据安全性、可信度和去中心化等挑战,而区块链技术的兴起为解决这些问题提供了新的思路。本文介绍了一种新一代数据库技术,将区块链技术与传统的分布式数据存储系统相融合,实现了更高水平的数据安全性和可信度,以及去中心化的优势。通过结合区块链的不可篡改性和分布式存储系统的高性能,这一新型数据库技术将在未来的数据管理领域发挥重要作用。
|
11天前
|
分布式计算 Ubuntu 调度
如何本地搭建开源分布式任务调度系统DolphinScheduler并远程访问
如何本地搭建开源分布式任务调度系统DolphinScheduler并远程访问
|
2月前
|
存储 分布式计算 大数据
现代化数据库技术——面向大数据的分布式存储系统
传统的关系型数据库在面对大规模数据处理时遇到了诸多挑战,而面向大数据的分布式存储系统应运而生。本文将深入探讨现代化数据库技术中的分布式存储系统,包括其优势、工作原理以及在大数据领域的应用。
|
2月前
|
JavaScript 安全 Java
Spring Boot 和 Vue.js 实现的前后端分离的用户权限管理系统
Spring Boot 和 Vue.js 实现的前后端分离的用户权限管理系统
56 0
|
2月前
|
消息中间件 存储 NoSQL
【Redis项目实战】使用Springcloud整合Redis分布式锁+RabbitMQ技术实现高并发预约管理处理系统
【Redis项目实战】使用Springcloud整合Redis分布式锁+RabbitMQ技术实现高并发预约管理处理系统
|
2月前
|
存储 Web App开发 运维
原来10张图就可以搞懂分布式链路追踪系统原理
原来10张图就可以搞懂分布式链路追踪系统原理
|
2月前
|
算法 Java 数据中心
分布式ID生成系统之雪花算法详解
在当今的云计算和微服务架构盛行的时代,分布式系统已成为软件开发的重要组成部分。随着系统规模的扩大和业务的复杂化,对数据一致性和唯一性的要求也越来越高,尤其是在全局唯一标识符(ID)的生成上。因此,分布式ID生成系统应运而生,成为保证数据唯一性和提高系统可扩展性的关键技术之一。雪花算法(Snowflake)是Twitter开源的一种算法,用于生成64位的全局唯一ID,非常适用于分布式系统中生成唯一标识符。下面我们将深入探讨雪花算法的原理、结构和实现方式。
108 2
 分布式ID生成系统之雪花算法详解
|
2月前
|
NoSQL 算法 安全
Redlock 算法-主从redis分布式锁主节点宕机锁丢失的问题
Redlock 算法-主从redis分布式锁主节点宕机锁丢失的问题
155 0