基于javaweb+mysql的springboot酒店宾馆管理系统(java+springboot+html+layui+jquery+maven+mysql)

基于javaweb+mysql的springboot酒店宾馆管理系统(java+springboot+html+layui+jquery+maven+mysql)

运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

基于javaweb+mysql的SpringBoot酒店宾馆管理系统(java+springboot+html+layui+jquery+maven+mysql)

功能介绍

springboot酒店宾馆管理系统。该系统为后管系统,无前台。主要分三种角色:管理者/工作人员/前台人员。

主要功能有: 客房:客房标准、房间信息; 订单:入住订单; 员工:员工信息; 事务:事务信息; 停车:车位信息; 财务:财务信息; 历史:订单历史、车库历史; 会员:会员信息;

环境需要

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.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目

6.数据库:MySql 8.0版本;

技术栈

  1. 后端:SpringBoot

  2. 前端:html+layui+jQuery

使用说明

  1. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,下载所需jar包;

  2. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 3. 将项目中db.properties配置文件中的数据库配置改为自己的配置 4. 配置tomcat,然后运行项目,输入localhost:8888 登录 5. 数据库中的employ中有密码,密码是加密过的,三种权限,管理者/工作人员/前台人员 管理账号:admin 密码:worker1 工作人员账号:worker1 密码:worker1

前台人员:sever1 密码:worker1

        e.setEmployage(employage);
        e.setEmploysex(employsex);
        e.setEmployname(employname);
        e.setEmploypaymentpermonth(employpaymentpermonth);
        e.setEmployauthority(employauthority);
        e.setUsername(username);
        e.setPassword(BCrypt.hashpw(password, BCrypt.gensalt()));
        return e;
    }

}

@RestController
public class RoomInformationController {
    private final StandardService standservice;

    private final RoomService roomservice;

    @Autowired
    public RoomInformationController(StandardService standservice,RoomService roomservice)
    {
        this.standservice=standservice;
        this.roomservice=roomservice;
    }

    //查询房间标准列表
    @RequestMapping("/standard")
    public Result<List<Standard>> standardList() {
        return ResultReturn.success(standservice.getAll());
    }

    //添加客房标准

	//roomid表查看
	@RequestMapping("/order/orderroom/roomid/list/{roomno}")
	public Result<List<Roomid>> roomidList(@PathVariable("roomno") int roomno)
	{
		return ResultReturn.success(roomidservice.findAll(roomno));
	}

	/**
	 * 根据房间-身份证表的序号查找对应信息
	 *
	 * @param rino 房间-身份证表的序号
	 * @return 返回对应信息
	 */
	@RequestMapping("/order/orderroom/roomid/roomidSearchOne/{rino}")
	public Result<Roomid> roomidSearchOne(@PathVariable("rino") int rino)
	{
		return ResultReturn.success(roomidservice.findByRino(rino));
	}

	/**
	 * 房间-身份证表更新
	 *
	 * @param rino 房间-身份证表的序号
	 * @param name 姓名
	 * @param id   身份证
	 * @return 返回更改后的信息
	 */
	@RequestMapping("/order/orderroom/roomid/update/{rino}")
	public Result roomidUpdate(@PathVariable("rino") int rino,@RequestParam("name") String name,
							   @RequestParam("id") String id)
	{
		Roomid ri=roomidservice.findByRino(rino);
		ri.setId(id);
		ri.setName(name);
		return ResultReturn.success(roomidservice.save(ri));
	}

	/**
	 * 寻找未入住的房间号列表
	 *
	 * @return 返回房间号列表
	 */
	@RequestMapping("/order/orderroom/roomid/getEmptyRoomno")
	public Result<List<Integer>> getEmptyRoomno()
	 * @param year 欲查询年财务报表的年份
	 * @return 返回年财务报表
	 */
	@RequestMapping("/finance/getbyyear")
	public Result<Finance> getByDay(@RequestParam("year") int year)
	{
		return ResultReturn.success(financeService.findByYear(year));
	}

	/**
	 * @param object 收入对象
	 * @throws HotelException 抛出异常收入的错误
	 */
	void insert(Object object) throws HotelException
	{
		if(object instanceof OrderHistory)
		{
			Finance finance=new Finance();

			finance.setMoney(((OrderHistory)object).getPrice());
			finance.setTime(((OrderHistory)object).getEndtime());
			finance.setType("订单");

			financeService.save(finance);
		}
		else if(object instanceof GarageHistory)
		{
			Finance finance=new Finance();

			finance.setMoney(((GarageHistory)object).getPrice());
			finance.setTime(((GarageHistory)object).getEndtime());
			finance.setType("车库");

			financeService.save(finance);
		}
		else
		{
			throw new HotelException(ExceptionType.FINANCE_INSERT_TYPE_ERROR.getCode(),
					ExceptionType.FINANCE_INSERT_TYPE_ERROR.getMsg());
		}
	}
}
		Room roomAfter=roomservice.findByRoom(roomnoAfter);
		Room roomBefore=roomservice.findByRoom(roomnoBefore);
		order.setPrice(order.getPrice()+roomAfter.getPrice()-roomBefore.getPrice());
		orderservice.save(order);

		return ResultReturn.success(orderroomservice.save(or));
	}

	//roomid表查看
	@RequestMapping("/order/orderroom/roomid/list/{roomno}")
	public Result<List<Roomid>> roomidList(@PathVariable("roomno") int roomno)
	{
		return ResultReturn.success(roomidservice.findAll(roomno));
	}

	/**
	 * 根据房间-身份证表的序号查找对应信息
	 *
	 * @param rino 房间-身份证表的序号
	 * @return 返回对应信息
	 */
	@RequestMapping("/order/orderroom/roomid/roomidSearchOne/{rino}")
	public Result<Roomid> roomidSearchOne(@PathVariable("rino") int rino)
	{
		return ResultReturn.success(roomidservice.findByRino(rino));
	}

	/**
	 * 房间-身份证表更新
	 *
	 * @param rino 房间-身份证表的序号
	 * @param name 姓名
	 * @param id   身份证
	 * @return 返回更改后的信息
	 */
	@RequestMapping("/order/orderroom/roomid/update/{rino}")
	public Result roomidUpdate(@PathVariable("rino") int rino,@RequestParam("name") String name,
							   @RequestParam("id") String id)
	{
		Roomid ri=roomidservice.findByRino(rino);
		ri.setId(id);
		ri.setName(name);
		return ResultReturn.success(roomidservice.save(ri));
	}
	private final GarageHistoryService garageHistoryService;

	private final FinanceService financeService;

	@Autowired
	public GarageHistoryController(GarageHistoryService garageHistoryService,FinanceService financeService)
	{
		this.garageHistoryService=garageHistoryService;
		this.financeService=financeService;
	}

	/**
	 * @return 返回车库历史纪录列表
	 */
	@RequestMapping("/garagehistory/getall")
	public Result<List<GarageHistory>> garageHistoryList()
	{
		return ResultReturn.success(garageHistoryService.findAll());
	}

	/**
	 * @param garageId 车库(位)编号
	 * @return 返回根据车库(位)编号查询到的车库历史纪录列表
	 */
	@RequestMapping("/garagehistory/getallbyid/{garageno}")
	public Result<List<GarageHistory>> garageHistoryListById(@PathVariable("garageno") int garageId)
	{
		return ResultReturn.success(garageHistoryService.findAllById(garageId));
	}

	/**
	 * @param brand 车牌
	 * @return 返回根据车牌查询到的车库历史纪录列表
	 */
	@RequestMapping("/garagehistory/getallbybrand/{brand}")
	public Result<List<GarageHistory>> garageHistoryListByBrand(@PathVariable("brand") String brand)
	{
		return ResultReturn.success(garageHistoryService.findAllByBrand(brand));
	}

	/**
	 * @param year  年份
	 * @param month 月份
	 * @param day   天数
	 * @return 返回日车库历史
	 */
	@RequestMapping("/garagehistory/getallbyday")
			garageList.add(garageService.save(newGarage));
			garageService.save(newGarage);
		}while (--number>0);

		return ResultReturn.success(garageList);
	}
}

@RestController
public class OrderHistoryController
{

	private final OrderHistoryService orderHistoryService;

	private final FinanceService financeService;

	@Autowired
	public OrderHistoryController(OrderHistoryService orderHistoryService,FinanceService financeService)
	{
		this.orderHistoryService=orderHistoryService;
		this.financeService=financeService;
	}

	/**
	 * @return 返回订单历史集合
	 */
	@RequestMapping("/orderhistory/getall")
	public Result<List<OrderHistory>> getAll()
	{
		return ResultReturn.success(orderHistoryService.findAll());
	}

	/**
	 * @param year  年份
	 * @param month 月份
	 * @param day   天数
	 * @return 返回对应的日订单历史
	 */
			return ResultReturn.error(1,"it's not exist, you can't delete!");
		}
		else
		{
			return ResultReturn.success(e);
		}
	}

}

@RestController
public class FinanceController
{
	private final FinanceService financeService;

	@Autowired
	public FinanceController(FinanceService financeService)
	{
		this.financeService=financeService;
	}

	/**
	 * @return 返回全部财务报表
	 */
	@RequestMapping("/finance/getall")
	public Result<Finance> getAll()
	{
		return ResultReturn.success(financeService.findAll());
	}

	/**
	 * @param year  欲查询日财务报表的年份
	 * @param month 欲查询日财务报表的月份
	 * @param day   欲查询日财务报表的日数
	 * @return 返回日财务报表
	 */
	@RequestMapping("/finance/getbyday")
	public Result<Finance> getByDay(@RequestParam("year") int year,@RequestParam("month") int month,
									@RequestParam("day") int day)
	{
	/**
	 * @param order 结算完成的订单
	 * @return 返回对应的订单记录(作为历史记录)
	 */
	private OrderHistory saveOrderHistory(Order order)
	{
		OrderHistory orderHistory=new OrderHistory();
		orderHistory.setEndtime(order.getEndtime());
		orderHistory.setId(order.getId());
		orderHistory.setMember(order.getIsmenber());
		orderHistory.setName(order.getName());
		orderHistory.setPhone(order.getPhone());
		orderHistory.setPrice(order.getPrice());
		orderHistory.setRoomcount(order.getRoomcount());
		orderHistory.setStarttime(order.getStarttime());

		return orderHistory;
	}

	/**
	 * 注意!!此方法只于OrderController中调用!!
	 *
	 * @param order 结算完成的订单
	 * @return 返回插入新的订单记录的结果
	 */
	Result<OrderHistory> orderHistoryInsert(Order order)
	{
		OrderHistory orderHistory=saveOrderHistory(order);
		orderHistory.setOrderno(new TimeStampUtil().getString(new Timestamp(System.currentTimeMillis())));

		new FinanceController(financeService).insert(orderHistory);
		return ResultReturn.success(orderHistoryService.save(orderHistory));
	}
}

	 * @param id   身份证
	 * @return 返回更改后的信息
	 */
	@RequestMapping("/order/orderroom/roomid/update/{rino}")
	public Result roomidUpdate(@PathVariable("rino") int rino,@RequestParam("name") String name,
							   @RequestParam("id") String id)
	{
		Roomid ri=roomidservice.findByRino(rino);
		ri.setId(id);
		ri.setName(name);
		return ResultReturn.success(roomidservice.save(ri));
	}

	/**
	 * 寻找未入住的房间号列表
	 *
	 * @return 返回房间号列表
	 */
	@RequestMapping("/order/orderroom/roomid/getEmptyRoomno")
	public Result<List<Integer>> getEmptyRoomno()
	{
		List<Roomid> ri=roomidservice.findAllWithoutparam();
		List<Integer> q=new ArrayList<>(ri.size());
		for (Roomid aRi : ri)
		{
			q.add(aRi.getRoomno());
		}
		List<Room> r=roomservice.getEmpty(q);
		List<Integer> sum=new ArrayList<>();
		for (Room aR : r)
		{
			sum.add(aR.getRoomno());
		}
		return ResultReturn.success(sum);
	}

	/**
	 * 结算订单
	 *
	 * @param orderno 订单号
	 * @return 返回订单结算结果
	 * @throws HotelException 抛出订单未入住异常 code: 601
	 */
		Room roomAfter=roomservice.findByRoom(roomnoAfter);
		Room roomBefore=roomservice.findByRoom(roomnoBefore);
		order.setPrice(order.getPrice()+roomAfter.getPrice()-roomBefore.getPrice());
		orderservice.save(order);

		return ResultReturn.success(orderroomservice.save(or));
	}

	//roomid表查看
	@RequestMapping("/order/orderroom/roomid/list/{roomno}")
	public Result<List<Roomid>> roomidList(@PathVariable("roomno") int roomno)
	{
		return ResultReturn.success(roomidservice.findAll(roomno));
	}

	/**
	 * 根据房间-身份证表的序号查找对应信息
	 *
	 * @param rino 房间-身份证表的序号
	 * @return 返回对应信息
	 */
	@RequestMapping("/order/orderroom/roomid/roomidSearchOne/{rino}")
	public Result<Roomid> roomidSearchOne(@PathVariable("rino") int rino)
	{
		return ResultReturn.success(roomidservice.findByRino(rino));
	}

	/**
	 * 房间-身份证表更新
	 *
	 * @param rino 房间-身份证表的序号
	 * @param name 姓名
	 * @param id   身份证
	 * @return 返回更改后的信息
	 */
	@RequestMapping("/order/orderroom/roomid/update/{rino}")
	public Result roomidUpdate(@PathVariable("rino") int rino,@RequestParam("name") String name,
							   @RequestParam("id") String id)
	{
		Roomid ri=roomidservice.findByRino(rino);
    public Result standardAdd(@RequestParam("stdname") String stdname,
                              @RequestParam("roomarea") int roomarea,@RequestParam("bedno") int bedno,
                              @RequestParam("equip1") String equip1,@RequestParam("equip2") String equip2) {
        Standard standard = saveStandard(stdname,roomarea,bedno,equip1,equip2);
        return ResultReturn.success(standservice.save(standard));
    }

    //删除客房标准
    @RequestMapping("/standard/deletebystdno")
    public Result deleteByStdNo(@RequestParam("stdno") int stdno){
        standservice.delete(standservice.findByStandard(stdno));
        return ResultReturn.success();
    }
    //查询客房信息列表
    @RequestMapping("/room/roomlist")
    public Result<List<Room>> roomList() {
        return ResultReturn.success(roomservice.getAll()) ;
    }

    //添加客房信息
    @PostMapping("/room/add")
    public Result roomAdd(@RequestParam("roomno") int roomno,@RequestParam("type") int type,
						  @RequestParam("price") int price,@RequestParam("ifwindow") int ifwindow,
						  @RequestParam("comment") String comment) {
        System.out.println("qian"+roomno+"   "+roomservice.findByRoom(roomno));
        //需要做检测
        if(roomservice.findByRoom(roomno)==null) {
            System.out.println(roomno);
            Room r = saveRoom(roomno, type, price, ifwindow, comment);
            return ResultReturn.success(roomservice.save(r));
        }
        else
            return ResultReturn.error(2,"客房编号已存在!");
    }

    //更新已有信息
    @RequestMapping("/room/update/{roomno}")
    public Result roomUpdate(@PathVariable("roomno") int roomno,@RequestParam("type") int type,
							 @RequestParam("price") int price,@RequestParam("ifwindow") int ifwindow,
							 @RequestParam("comment") String comment) {
        //需要先查询是否存在
        if(roomservice.findByRoom(roomno)==null) {
		return ResultReturn.success(garageList);
	}
}

@RestController
public class OrderHistoryController
{

	private final OrderHistoryService orderHistoryService;

	private final FinanceService financeService;

	@Autowired
	public OrderHistoryController(OrderHistoryService orderHistoryService,FinanceService financeService)
	{
		this.orderHistoryService=orderHistoryService;
		this.financeService=financeService;
	}

	/**
	 * @return 返回订单历史集合
	 */
	@RequestMapping("/orderhistory/getall")
	public Result<List<OrderHistory>> getAll()
	{
		return ResultReturn.success(orderHistoryService.findAll());
	}

	/**
	 * @param year  年份
	 * @param month 月份
	 * @param day   天数
	 * @return 返回对应的日订单历史
	 */
	@RequestMapping("/orderhistory/getallbyday")
	public Result<List<OrderHistory>> getAllByDay(@RequestParam("year") int year,@RequestParam("month") int month,
												  @RequestParam("day") int day)
	{
		return ResultReturn.success(orderHistoryService.findByDay(year,month,day));
	}
        else if (roles.contains("ROLE_WORKER")){
            response.sendRedirect(basePath+"workerHotel");
            return;
        }
        else if (roles.contains("ROLE_SERVER")){
            response.sendRedirect(basePath+"serverHotel");
            return;
        }
        else {
            response.sendRedirect(basePath+"/403");
        }
    }

    }

@ControllerAdvice
public class ExceptionHandle
{
	@ExceptionHandler(value=Exception.class)
	@ResponseBody
	public Result handel(Exception e)
	{
		if(e instanceof HotelException)
		{
			HotelException hotelException=(HotelException)e;
			return ResultReturn.error(
					hotelException.getCode(),
					hotelException.getMessage()
			);
		}
		else
		{
			e.printStackTrace();
			
			return ResultReturn.error(
					ExceptionType.UNKNOWN_ERROR.getCode(),
					ExceptionType.UNKNOWN_ERROR.getMsg()
			);
		}
	/**
	 * @param garageNo 车位
	 * @return 返回查询到的车库
	 */
	@RequestMapping("/garage/getonebyid/{garageno}")
	public Result<Garage> garageFindById(@PathVariable("garageno") int garageNo)
	{
		return ResultReturn.success(garageService.findById(garageNo));
	}

	/**
	 * @param garageNo  车库(位)编号
	 * @param type      类型
	 * @param startTime 入库时间
	 * @param endTime   出库时间
	 * @param brand     车牌
	 * @return 返回更新车库结果
	 */
	@RequestMapping("/garage/update")
	public Result<Garage> garageUpdate(@RequestParam("garageno") int garageNo,@RequestParam("type") int type,
									   @RequestParam("starttime") Timestamp startTime,
									   @RequestParam("endtime") Timestamp endTime,@RequestParam("brand") String brand)
	{
		Garage garage=garageService.findById(garageNo);
		garage.setType(type);
		garage.setStarttime(startTime);
		garage.setEndtime(endTime);
		garage.setBrand(brand);

		return ResultReturn.success(garageService.save(garage));
	}

	/**
	 * @param garageNo 车库(位)编号
	 * @param type     类型
	 * @param brand    车牌
	 * @return 返回更新车库结果
	 */
	@RequestMapping("/garage/drivein")
	public Result<Garage> garageDriveIn(@RequestParam("garageno") int garageNo,@RequestParam("type") int type,
										@RequestParam("brand") String brand)
	{
		Garage garage=garageService.findById(garageNo);
		garage.setType(type);
		garage.setStarttime(new Timestamp(System.currentTimeMillis()));
		garage.setEndtime(new Timestamp(0));
		garage.setBrand(brand);

		return ResultReturn.success(garageService.save(garage));
	}

        if(r == null) {
            return ResultReturn.error(1,"it's not exist!");
        }
        else {
            return ResultReturn.success(r);
        }
    }

    @RequestMapping("/room/delete/{roomno}")
    public Result roomDelete(@PathVariable("roomno") int roomno) {
        //需要先查询是否存在
        Room r = roomservice.findByRoom(roomno);
        if(r == null) {
            return ResultReturn.error(1,"it's not exist, you can't delete!");
        }
        else {
            roomservice.delete(r);
            return ResultReturn.success(r);
        }
    }

    public Room saveRoom(int roomno,int type,int price,int ifwindow,String comment) {
        Room r = new Room();
        r.setRoomno(roomno);
        r.setType(type);
        r.setPrice(price);
        r.setIfwindow(ifwindow);
        r.setComment(comment);
        return r;
    }

    public Standard saveStandard(String stdname,int roomarea,int bedno,String equip1,String equip2){
        Standard s = new Standard();
        s.setStdname(stdname);
        s.setRoomerea(roomarea);
        s.setBedno(bedno);
        s.setEquip1(equip1);
        s.setEquip2(equip2);
        return s;
    }
}

	 */
	@RequestMapping("/order/orderroom/roomid/getEmptyRoomno")
	public Result<List<Integer>> getEmptyRoomno()
	{
		List<Roomid> ri=roomidservice.findAllWithoutparam();
		List<Integer> q=new ArrayList<>(ri.size());
		for (Roomid aRi : ri)
		{
			q.add(aRi.getRoomno());
		}
		List<Room> r=roomservice.getEmpty(q);
		List<Integer> sum=new ArrayList<>();
		for (Room aR : r)
		{
			sum.add(aR.getRoomno());
		}
		return ResultReturn.success(sum);
	}

	/**
	 * 结算订单
	 *
	 * @param orderno 订单号
	 * @return 返回订单结算结果
	 * @throws HotelException 抛出订单未入住异常 code: 601
	 */
	@RequestMapping("/order/settle/{orderno}")
	public Result<OrderHistory> orderSettle(@PathVariable("orderno") int orderno) throws HotelException
	{
		Order order=orderservice.findByOrderNo(orderno);
		if(order.getIsenter()==1)
		{
			Order orderTemp=new Order(order);
			orderservice.delete(order);

			return new OrderHistoryController(orderHistoryService,financeService).orderHistoryInsert(orderTemp);
		}
		else
		{
			throw new HotelException(ExceptionType.ORDER_ISENTER_ERROR.getCode(),
					ExceptionType.ORDER_ISENTER_ERROR.getMsg());
	}

	/**
	 * @param year  年份
	 * @param month 月份
	 * @return 返回日车库历史
	 */
	@RequestMapping("/garagehistory/getallbymonth")
	public Result<List<GarageHistory>> getAllByMonth(@RequestParam("year") int year,@RequestParam("month") int month)
	{
		return ResultReturn.success(garageHistoryService.findAllByMonth(year,month));
	}

	/**
	 * @param year 年份
	 * @return 返回日车库历史
	 */
	@RequestMapping("/garagehistory/getallbyyear")
	public Result<List<GarageHistory>> getAllByYear(@RequestParam("year") int year)
	{
		return ResultReturn.success(garageHistoryService.findAllByYear(year));
	}

	/**
	 * 注意!!此方法只于GarageController中调用!!
	 *
	 * @param garage  车库对象
	 * @param endTime 出库时间
	 * @return 返回当前车库记录
	 */
	Result<GarageHistory> garageHistoryInsertLog(Garage garage,Timestamp endTime)
	{
		GarageHistory newGarageHistory=new GarageHistory();

		newGarageHistory.setEndtime(endTime);
		newGarageHistory.setBrand(garage.getBrand());
		newGarageHistory.setGarageid(garage.getGarageno());
		newGarageHistory.setStarttime(garage.getStarttime());
		newGarageHistory.setType(garage.getType());
		if(garage.getType()==0)
		{
			newGarageHistory.setPrice(new TimeStampUtil().getHoursFromTwoTimeStamp(garage.getStarttime(),
					endTime)*GarageUtil.getGaragePricePreHour());

			new FinanceController(financeService).insert(newGarageHistory);
		}
		return ResultReturn.success(garageHistoryService.save(newGarageHistory));
	}
}


class LoginSuccessHandle implements AuthenticationSuccessHandler {
    public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
                                        Authentication authentication) throws IOException,ServletException {
        Set<String> roles = AuthorityUtils.authorityListToSet(authentication.getAuthorities());
        String path = request.getContextPath() ;
        String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
        if (roles.contains("ROLE_ADMIN")){
            response.sendRedirect(basePath+"adminHotel");
            return;
        }
        else if (roles.contains("ROLE_WORKER")){
            response.sendRedirect(basePath+"workerHotel");
            return;
        }
        else if (roles.contains("ROLE_SERVER")){
            response.sendRedirect(basePath+"serverHotel");
            return;
        }
        else {
            response.sendRedirect(basePath+"/403");
        }
    }

    }

@ControllerAdvice
public class ExceptionHandle
{
	@ExceptionHandler(value=Exception.class)
	@ResponseBody
	public Result handel(Exception e)
	{
		if(e instanceof HotelException)
		{
			HotelException hotelException=(HotelException)e;
			return ResultReturn.error(
					hotelException.getCode(),
					hotelException.getMessage()
			);
		}
		else

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

请添加图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值