基于javaweb+mysql的ssm酒店管理系统(java+ssm+jsp+bootstrap+echarts+mysql)

基于javaweb+mysql的ssm酒店管理系统(java+ssm+jsp+bootstrap+echarts+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

基于javaweb+mysql的SSM酒店管理系统(java+ssm+jsp+bootstrap+echarts+mysql)

项目介绍

本项目为基于ssm+mysql实现的JavaWeb酒店管理系统; 主要功能包括:

管理员登录,收入统计,客房管理,商品管理,客房预订,住宿登记,财务统计,旅客管理,接待对象管理等功能。

环境需要

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. 后端:Spring+SpringMVC+Mybatis 2. 前端:JSP+CSS+JavaScript+jquery+bootstrap+echarts

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中jdbc.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录
            if (predeterminePo.getPassengerID()==0) {                              //判断是否为团队还是散客
            	stayRegisterPo.setBillUnitID(28);
			}else {
				stayRegisterPo.setBillUnitID(27);
			}
            stayRegisterPo.setReceiveTargetID(predeterminePo.getPredetermineTargetID());
            stayRegisterPo.setIsBillID(68);
            stayRegisterPo.setRegisterTime(timestamp);
            stayRegisterPo.setStayNumber(predeterminePo.getPredetermineDay());
            stayRegisterPo.setSumConst(roomSetPo.getStandardPriceDay()
            		*Integer.parseInt(predeterminePo.getPredetermineDay()));      //获取房价 乘以 住宿天数
            stayRegisterService.insertAll(stayRegisterPo); //新增成功时,获取刚新增的id。
            Integer stayId=stayRegisterPo.getId();
            stayRegisterService.updateStayRegisterPredetermineID(Integer.parseInt(FenGe[i]), stayId);
            stayRegisterPo.setDepositStayRegisterID(stayId);
    		stayRegisterPo.setDepositRegisterTime(timestamp);
    		stayRegisterPo.setDepositPayWayID(predeterminePo.getPayWayID());
    		stayRegisterPo.setDeposit(predeterminePo.getDeposit());
    		stayRegisterService.insertDeposit(stayRegisterPo);
    		roomSetPoToRoomState.setId(predeterminePo.getRoomID());      //给新的 Po 赋房间ID的值
    		roomSetPoToRoomState.setRoomStateID(65);                     //给新的 Po 赋房态的值
    		roomSetService.updateByIdToRoomState(roomSetPoToRoomState);  //根据 房间ID 来修改 当前被选中的房间的房态
    	}
		if (tiaoZhuang==1) {
			mv=new ModelAndView("redirect:/StayRegister/tolist.do");
		}else if (tiaoZhuang==2){
			
			mv=new ModelAndView("redirect:/Predetermine/tolist.do");
		}
		return mv;
	}
		
		
}
package com.gx.web;

	}
	
	
/*--------------------------------------- 散客结账 end------------------------------------------------------------------*/		

	
	
/*--------------------------------------- 批量安排房间 start------------------------------------------------------------------*/			
	//批量安排房间
	@RequestMapping("/tovolumeroom")
	public ModelAndView tovolumeroom(Integer tuanDuiID, String teamName){
		ModelAndView mv=null;
		List<AttributePo> listPassengerType=attributeService.selectPassengerType();     //旅客类别
		List<AttributePo> listBillUnit=attributeService.selectBillUnit();              //结账单位
		List<AttributePo> listPayWay=attributeService.selectPayWay();                 //结账方式
		List<AttributePo> listRentOutType=attributeService.selectRentOutType();      //出租方式
		mv=new ModelAndView("/stayregister/volumeroom");
		mv.addObject("listPassengerType",listPassengerType);
		mv.addObject("listBillUnit",listBillUnit);
		mv.addObject("listPayWay",listPayWay);
		mv.addObject("listRentOutType",listRentOutType);
		mv.addObject("tuanDuiID",tuanDuiID);
		mv.addObject("teamName",teamName);
		return mv;
	}
	
	//批量安排房间
	@RequestMapping("/volumeroom")
	public ModelAndView volumeroom(String roomId,StayRegisterPo stayRegisterPo){
		ModelAndView mv=null;
		String[] FenGen=roomId.split(",");
		stayRegisterPo.setIsBillID(68);
		int chuZuFangShiId=stayRegisterPo.getRentOutTypeID();                           //获取 出租方式
		int tianShuOrZhongDian=Integer.parseInt(stayRegisterPo.getStayNumber());       //获取 住店天数/小时
		double yaJin=stayRegisterPo.getDeposit()/FenGen.length;
		stayRegisterPo.setDeposit(yaJin);
		RoomSetPo roomSetPoToRoomState=new RoomSetPo();
		roomSetPoToRoomState.setRoomStateID(65);                     //给新的 Po 赋房态的值
		Timestamp timestamp=Timestamp.valueOf(dformat.format(date)) ;  //将当前时间转为字符串
		
		String[] FenGe=id.split(",");                                    //分割到数组
		StayRegisterPo stayRegisterPo=new StayRegisterPo();
		RoomSetPo roomSetPoToRoomState=new RoomSetPo();
		for (int i = 0; i < FenGe.length; i++) {
            this.predetermineService.updatePredetermineStateID(Integer.parseInt(FenGe[i]));              //修改预订状态
            PredeterminePo predeterminePo=this.predetermineService.findById(Integer.parseInt(FenGe[i])); //查询预订信息
            RoomSetPo roomSetPo=this.roomSetService.selectById(predeterminePo.getRoomID());              //查询房间信息
            stayRegisterPo.setRoomID(predeterminePo.getRoomID());                                        //设置房间id
            stayRegisterPo.setRentOutTypeID(26);
            stayRegisterPo.setPassengerTypeID(29);
            if (predeterminePo.getPassengerID()==0) {                              //判断是否为团队还是散客
            	stayRegisterPo.setBillUnitID(28);
			}else {
				stayRegisterPo.setBillUnitID(27);
			}
            stayRegisterPo.setReceiveTargetID(predeterminePo.getPredetermineTargetID());
            stayRegisterPo.setIsBillID(68);
            stayRegisterPo.setRegisterTime(timestamp);
            stayRegisterPo.setStayNumber(predeterminePo.getPredetermineDay());
            stayRegisterPo.setSumConst(roomSetPo.getStandardPriceDay()
            		*Integer.parseInt(predeterminePo.getPredetermineDay()));      //获取房价 乘以 住宿天数
            stayRegisterService.insertAll(stayRegisterPo); //新增成功时,获取刚新增的id。
            Integer stayId=stayRegisterPo.getId();
            stayRegisterService.updateStayRegisterPredetermineID(Integer.parseInt(FenGe[i]), stayId);
            stayRegisterPo.setDepositStayRegisterID(stayId);
    		stayRegisterPo.setDepositRegisterTime(timestamp);
    		stayRegisterPo.setDepositPayWayID(predeterminePo.getPayWayID());
    		stayRegisterPo.setDeposit(predeterminePo.getDeposit());
    		stayRegisterService.insertDeposit(stayRegisterPo);
    		roomSetPoToRoomState.setId(predeterminePo.getRoomID());      //给新的 Po 赋房间ID的值
    		roomSetPoToRoomState.setRoomStateID(65);                     //给新的 Po 赋房态的值
    		roomSetService.updateByIdToRoomState(roomSetPoToRoomState);  //根据 房间ID 来修改 当前被选中的房间的房态
    	}
		if (tiaoZhuang==1) {
			mv=new ModelAndView("redirect:/StayRegister/tolist.do");
		}else if (tiaoZhuang==2){
			
			mv=new ModelAndView("redirect:/Predetermine/tolist.do");
		}else if (currentPage==0) {
			currentPage=1;
		}
		if(txtname==null)
		{
			txtname="";
		}
		vo.setCurrentPage(currentPage);
		vo=this.roomSetService.pageFuzzyselect(txtname, vo);
		mv.addObject("list",vo);
		mv.addObject("txtname",txtname);
		return mv;
	}
	

	@RequestMapping("/toadd")
	public ModelAndView toadd(){
		ModelAndView mv=null;
		List<AttributePo> listOne=attributeService.selectGuestRoomLevel();
		List<AttributePo> listTwo=attributeService.selectRoomState();
		mv=new ModelAndView("/roomset/add");
		mv.addObject("listOne",listOne);
		mv.addObject("listTwo",listTwo);
		return mv;
	}
	
	@RequestMapping("/add")
	public ModelAndView add(RoomSetPo roomSetPo){
		ModelAndView mv=null;
		roomSetService.insertAll(roomSetPo);
		mv=new ModelAndView("redirect:/RoomSet/tolist.do");
		return mv;
	}
	
	@RequestMapping("/toupdate")
	public ModelAndView toupdate(int id){
		ModelAndView mv=null;
		List<AttributePo> listOne=attributeService.selectGuestRoomLevel();
		List<AttributePo> listTwo=attributeService.selectRoomState();
		RoomSetPo listPo=roomSetService.selectById(id);
		mv=new ModelAndView("/roomset/update");
		mv.addObject("listOne",listOne);
		mv.addObject("listTwo",listTwo);

@Controller
@RequestMapping("/FinancialStatistics")
public class FinancialStatistics {
	
	@Autowired
	private StayRegisterService stayRegisterService;
	
	@RequestMapping("/tolist")
	public ModelAndView tolist(String datemin, String datemax,Integer currentPage){
		ModelAndView mv=null;
		int chuZuFangJianShu=0;
		int zhuSuRenShu=0;
		double xiaoFeiJinE=0;
		double JieZhangJinE=0;
		
		if (currentPage==null) {
			currentPage=1;
		}else if (currentPage==0) {
			currentPage=1;
		}
		mv=new ModelAndView("/financialstatistics/financialstatistics");
		Page<StayRegisterPo> vo=new Page<StayRegisterPo>();
		vo.setCurrentPage(currentPage);
		
		if (datemin=="" || datemax=="" || datemin==null || datemax==null) {
			List<StayRegisterPo> listJinE=this.stayRegisterService.selectPayJingJianBanNot();
			for (int i = 0; i < listJinE.size(); i++) {
				chuZuFangJianShu++;
				JieZhangJinE+=listJinE.get(i).getSumConst();
			}
			
			List<StayRegisterPo> listRenShu=this.stayRegisterService.selectPayStayNumberNot();
			for (int i = 0; i < listRenShu.size(); i++) {
				zhuSuRenShu++;
			}
			
			List<StayRegisterPo> listXiaoFei=this.stayRegisterService.selectPayXiaoFeiNot();
			for (int i = 0; i < listXiaoFei.size(); i++) {
				xiaoFeiJinE+=listXiaoFei.get(i).getConsumptionMoney();
			}
			
			vo=this.stayRegisterService.pageFuzzyselectFour(vo);
		}else {
			String dateminString=datemin+" 00:00:00";
		    String datemaxString=datemax+" 23:59:59";
		    Timestamp min=Timestamp.valueOf(dateminString);
		    Timestamp max=Timestamp.valueOf(datemaxString);
			
		if(chuZuFangShiId==26){
		    zhuSuFei=fangJiaTian*zhuDianShiChang;                                      //房价乘以天数得总费
		}else if(chuZuFangShiId==25){
			if (shouDuanShiChang >= zhuDianShiChang) { 
				zhuSuFei=shouDuanJiaGe;                              //首时段时长大于 他输入的钟点数     那么按 首段价格计算
			}else if (shouDuanShiChang <= zhuDianShiChang && zhuDianShiChang <= zuiDaShiChang) {
				int xiaoShi=zhuDianShiChang-shouDuanShiChang;                 //如果输入的钟点数 在 最大时长的范围之内
				zhuSuFei= shouDuanJiaGe+xiaoShi*fangJia;                   // 且大于等于首段时长 ,那么 计算出
			}else if(zhuDianShiChang>zuiDaShiChang){
				zhuSuFei=fangJiaTian;                                     //假如 输入的钟点数大于最大时长那么 按一天的价格计算
			}
		}
		for (int i = 0; i < listSource.size(); i++) {
			xiaoFeiJiaGe+=listSource.get(i).getConsumptionMoney();
		}
		double zongFeiYong=xiaoFeiJiaGe+zhuSuFei;
		stayRegisterService.updateSumConst(consumptionStayRegisterID, zongFeiYong);
		
		return mv;
	}
	
	@ResponseBody
	@RequestMapping(value="/tianJiaShangPin")
	public Object tianJiaShangPin(String name,int cboid){
		if(name==null){
			name="";
		}
		List<CommodityPo> listAjax=commodityService.fuzzySelect(name, cboid);
       Gson gson=new Gson();
       return gson.toJson(listAjax);
	}
	
/*--------------------------------------- 消费明细  end ------------------------------------------------------------------*/	
	
	

	
	
/*--------------------------------------- 散客结账 start------------------------------------------------------------------*/		
	
	@RequestMapping("/topay")
		
		@RequestMapping("/delete")
		public ModelAndView delete(String id){
			ModelAndView mv=null;
			String[] FenGe=id.split(",");
			for (int i = 0; i < FenGe.length; i++) {
				commodityService.deleteById(Integer.parseInt(FenGe[i]));
			}
			mv=new ModelAndView("redirect:/Commodity/tolist.do");
			return mv;
		}
		
		
		
		
		@RequestMapping("/openwindow")
		public ModelAndView openwindow(){
			ModelAndView mv=null;
			mv=new ModelAndView("/commodity/commoditytype");
			return mv;
		}
		
		@RequestMapping("/newadd")
		public ModelAndView newadd(String txtname){
			ModelAndView mv=null;
			int newid=3;
			attributeService.insertAll(newid,txtname);
			mv=new ModelAndView("redirect:/Commodity/tolist.do");
			return mv;
		}
		
		@RequestMapping("/newdelete")
		public ModelAndView newdelete(String id){
			ModelAndView mv=null;
			String[] FenGe=id.split(",");
			for (int i = 0; i < FenGe.length; i++) {
				attributeService.deleteById(Integer.parseInt(FenGe[i]));
			}
			mv=new ModelAndView("redirect:/Commodity/tolist.do");
			return mv;
		}
		
		
		@ResponseBody
		@RequestMapping(value="/YZ")
		public Object YZ(String commodityName){
			int YorN=commodityService.selectYZ(commodityName);
			Gson gson =new Gson();
			return gson.toJson(YorN);
		}
}
	
	@Autowired
	private ReceiveTargetService receiveTargetService;
	
	@Autowired
	private AttributeService attributeService;
	
	
	@RequestMapping("/tolist")
	public ModelAndView list(HttpServletRequest request, Integer currentPage, String txtname){
		ModelAndView mv=null;
		mv=new ModelAndView("/receivetarget/list");
		Page<ReceiveTargetPo> vo=new Page<ReceiveTargetPo>();
		if (currentPage==null) {
			currentPage=1;
		}else if (currentPage==0) {
			currentPage=1;
		}
		if(txtname==null)
		{
			txtname="";
		}
		vo.setCurrentPage(currentPage);
		vo=this.receiveTargetService.pageFuzzyselect(txtname, vo);
		mv.addObject("list",vo);
		mv.addObject("txtname",txtname);
		return mv;
	}
	
	@RequestMapping("/toadd")
	public ModelAndView toadd(){
		ModelAndView mv=null;
		List<AttributePo> listOne=attributeService.selectTargetType();
		mv=new ModelAndView("/receivetarget/add");
		mv.addObject("listOne",listOne);
		return mv;
	}
	
	@RequestMapping("/add")
	public ModelAndView add(ReceiveTargetPo receiveTargetPo){
		ModelAndView mv=null;
		receiveTargetService.insertAll(receiveTargetPo);
		mv=new ModelAndView("redirect:/ReceiveTarget/tolist.do");
		return mv;
	}
	
	@RequestMapping("/toupdate")
	public ModelAndView toupdate(int id){
		ModelAndView mv=null;
		List<AttributePo> listOne=attributeService.selectTargetType();
		ReceiveTargetPo list=receiveTargetService.selectById(id);
		for (int i = 0; i < listShangPin.size(); i++) {
			shangPinXiaoFei+=listShangPin.get(i).getConsumptionMoney();
		}
		if (chuZuFangShi==26) {
			zongFeiYong=JiuHuanFanFei+changRoomMoney+shangPinXiaoFei+shengZhuDianTianShu*fangJiaDay;
		}else if(chuZuFangShi==25){
			if (shouDuanShiChang>zhuDianShiJian) {
				zongFeiYong=JiuHuanFanFei+changRoomMoney+shangPinXiaoFei+shouDuanJiaGe;
			}else if(zhuDianShiJian>=shouDuanShiChang & zhuDianShiJian<=zuiDaShiChang){
				double jiSuan=(zhuDianShiJian-shouDuanShiChang)*fangJiaHour;
				zongFeiYong=JiuHuanFanFei+changRoomMoney+shangPinXiaoFei+shouDuanJiaGe+jiSuan;
			}else {
				zongFeiYong=JiuHuanFanFei+changRoomMoney+shangPinXiaoFei+fangJiaDay;
			}
		}
		if (huanFangCiShu==null || huanFangCiShu=="") {
			huanFangCiShu="1";
		}else{
			huanFangCiShu=String.valueOf(Integer.parseInt(huanFangCiShu)+1);
		}
		StayRegisterPo stayRegisterPo=new StayRegisterPo();
		RoomSetPo roomOne=new RoomSetPo();
		RoomSetPo roomTwo=new RoomSetPo();
		stayRegisterPo.setId(id);
		stayRegisterPo.setRoomID(roomId);
		stayRegisterPo.setSumConst(zongFeiYong);
		stayRegisterPo.setChangingRoomNumber(huanFangCiShu);
		stayRegisterPo.setChangRoomMoney(changRoomMoney+JiuHuanFanFei);
		stayRegisterPo.setChangRoomTime(changRoomTime);
		roomOne.setId(jiuFangJianId);
		roomOne.setRoomStateID(1);
		roomTwo.setId(roomId);
		roomTwo.setRoomStateID(65);
		
		roomSetService.updateByIdToRoomState(roomOne);
		roomSetService.updateByIdToRoomState(roomTwo);
		stayRegisterService.updateChangRoom(stayRegisterPo);
		
		mv=new ModelAndView("redirect:/StayRegister/tolist.do?LvKeLeiXingId="+LvKeLeiXingId);
		return mv;
	}
		
	@ResponseBody
	@RequestMapping(value="/changRoomSelectPassenger")
	public Object changRoomSelectPassenger(String roomNumber){
	   if(roomNumber==null){
		   roomNumber="";
	   }
	   List<RoomSetPo> list=roomSetService.selectInformation(roomNumber);
       Gson gson=new Gson();
       return gson.toJson(list);
	}
	
		}else if (tiaoZhuang==2){
			
			mv=new ModelAndView("redirect:/Predetermine/tolist.do");
		}
		return mv;
	}
		
		
}
package com.gx.web;

@Controller
@RequestMapping("/Passenger")
public class Passenger {
	
	@Autowired
	private AttributeService attributeService;
	
	@Autowired
	private PassengerService passengerService;
	
	@RequestMapping("/tolist")
	public ModelAndView tolist(HttpServletRequest request,Integer currentPage,String txtname){
		ModelAndView mv=null;
		mv=new ModelAndView("/passenger/list");
		Page<PassengerPo> vo=new Page<PassengerPo>();
		if (currentPage==null) {
			currentPage=1;
		}else if (currentPage==0) {
			currentPage=1;
		}
		if(txtname==null)
		{
			txtname="";
		}
		vo.setCurrentPage(currentPage);
			yaJin+=listDeposit.get(i).getDeposit();
		}
		for (int i = 0; i < list.size(); i++) {
			zongFeiYong+=list.get(i).getSumConst();
			huanFangFei+=list.get(i).getChangRoomMoney();
		}
		for (int i = 0; i < listConsumption.size(); i++) {
			xiaoFei+=listConsumption.get(i).getConsumptionMoney();
		}
		fangJianShu=list.size();
		zhuSuFei=zongFeiYong-huanFangFei-xiaoFei;
		yingBuJinE=zongFeiYong-yaJin;
		teamPayVo.setStayMoney(zhuSuFei);
		teamPayVo.setChangRoomMoney(huanFangFei);
		teamPayVo.setOtherMoney(xiaoFei);
		teamPayVo.setPayMoney(zongFeiYong);
		teamPayVo.setDepositMoney(yaJin);
		teamPayVo.setPayRepairMoney(yingBuJinE);
		mv=new ModelAndView("/stayregister/teampay");
		mv.addObject("listPayWay",listPayWay);
		mv.addObject("listConsumption",listConsumption);
		mv.addObject("teamPayVo",teamPayVo);
		mv.addObject("fangJianShu",fangJianShu);
		mv.addObject("timestamp",timestamp);
		mv.addObject("list",list);
		mv.addObject("tuanDuiID",tuanDuiID);
		return mv;
	}
	
	@RequestMapping("teamPay")
	public ModelAndView teamPay( String id,	String remarks, Integer payWay, Timestamp payTime){
		ModelAndView mv=null;
		RoomSetPo roomSetPo=new RoomSetPo();
		roomSetPo.setRoomStateID(1);
		String[] FenGe=id.split(",");
		for (int i = 0; i < FenGe.length; i++) {
			stayRegisterService.pay(Integer.parseInt(FenGe[i]), remarks, payTime, payWay);
			StayRegisterPo stayRegisterPo=stayRegisterService.selectById(Integer.parseInt(FenGe[i]));
			roomSetPo.setId(stayRegisterPo.getRoomID());
			roomSetService.updateByIdToRoomState(roomSetPo);
		}
		mv=new ModelAndView("redirect:/StayRegister/tolist.do?LvKeLeiXingId="+56);
		return mv;
	}
	
	
	//ajax查询房间信息
	
	
/*--------------------------------------- 押金 start------------------------------------------------------------------*/	
	
	
	@RequestMapping("/todeposit")
	public ModelAndView todeposit(Integer id,String lvKeName,Integer LvKeLeiXingId){
		ModelAndView mv=null;
		fangjianId=id;
		lvkeName=lvKeName;
		List<StayRegisterPo> list=stayRegisterService.selectDepositById(id);
		List<AttributePo> list2=attributeService.selectPayWay();
		mv=new ModelAndView("/stayregister/deposit");
		mv.addObject("list",list);
		mv.addObject("listTwo",list2);
		mv.addObject("lvKeName",lvKeName);
		mv.addObject("stayId",id);
		mv.addObject("LvKeLeiXingId",LvKeLeiXingId);
		return mv;
	}
	
	@RequestMapping("/deposit")
	public ModelAndView deposit(StayRegisterPo stayRegisterPo,Integer LvKeLeiXingId){
		ModelAndView mv=null;
		Date date=new Date();
		DateFormat dformat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");   //设置日期格式
		Timestamp timestamp=Timestamp.valueOf(dformat.format(date)) ;  //将当前时间转为字符串
		stayRegisterPo.setDepositRegisterTime(timestamp);
		mv=new ModelAndView("redirect:/StayRegister/todeposit.do?id="+fangjianId);
        mv.addObject("lvKeName", lvkeName);
        mv.addObject("LvKeLeiXingId",LvKeLeiXingId);
		stayRegisterService.insertDeposit(stayRegisterPo);		
		return mv;
	}
	
/*--------------------------------------- 押金  end ------------------------------------------------------------------*/	

	
	
	

	
/*--------------------------------------- 消费明细 start------------------------------------------------------------------*/	
	
	@RequestMapping("/toconsumption")
	public ModelAndView toconsumption(Integer id,String lvKeName,Integer currentPage,
			Integer LvKeLeiXingId,Integer isBillID){
		ModelAndView mv=null;
		fangjianId=id;
		lvkeName=lvKeName;
		Page<StayRegisterPo> vo=new Page<StayRegisterPo>();
			}
			if (currentPage==null) {
				currentPage=1;
			}else if (currentPage==0) {
				currentPage=1;
			}
			if(txtname==null)
			{
				txtname="";
			}
			vo.setCurrentPage(currentPage);
			vo=this.commodityService.pageFuzzyselect(txtname,commodityTypeID, vo);
			mv.addObject("list",vo);
			mv.addObject("txtname",txtname);
			mv.addObject("listOne",listOne);
			mv.addObject("commodityType",commodityTypeID);
			return mv;
		}
		
		
		@RequestMapping("/toadd")
		public ModelAndView toadd(){
			ModelAndView mv=null;
			List<AttributePo> listOne=attributeService.selectUOM();
			List<AttributePo> listTwo=attributeService.selectCommodityType();
			mv=new ModelAndView("/commodity/add");
			mv.addObject("listOne",listOne);
			mv.addObject("listTwo",listTwo);
			return mv;
		}
		
		@RequestMapping("/add")
		public ModelAndView add(CommodityPo commodityPo){
			ModelAndView mv=null;
			commodityService.insertAll(commodityPo);
			mv=new ModelAndView("redirect:/Commodity/tolist.do");
			return mv;
		}
		
		@RequestMapping("/toupdate")
				int zuiDaShiChang=Integer.parseInt(roomSetPo.getMaxDuration());              //获取最大时长
				int shouDuanShiChang=Integer.parseInt(roomSetPo.getFirstDuration());         //获取首段时长
				double shouDuanJiGe=roomSetPo.getFirstPrice();                              //获取首段价格
				if (shouDuanShiChang >= tianShuOrZhongDian) { 
					double sumConst=shouDuanJiGe;                                           //首时段时长大于 他输入的钟点数 
					stayRegisterPo.setSumConst(sumConst);                                    //那么按 首段价格计算
				}else if (shouDuanShiChang <= tianShuOrZhongDian && tianShuOrZhongDian <= zuiDaShiChang) {
					int xiaoShi=tianShuOrZhongDian-shouDuanShiChang;                 //如果输入的钟点数 在 最大时长的范围之内
					double sumConst= shouDuanJiGe+xiaoShi*fagnJia;                   // 且大于等于首段时长 ,那么 计算出
					stayRegisterPo.setSumConst(sumConst);                            // 首段价格 加上 钟点数乘以 多出的每小时价格
				}else if(tianShuOrZhongDian>zuiDaShiChang){
					stayRegisterPo.setSumConst(roomSetPo.getStandardPriceDay()); //假如 输入的钟点数大于最大时长那么 按一天的价格计算
				}
			}
			stayRegisterPo.setRoomID(Integer.parseInt(FenGen[i]));
			stayRegisterService.insertAll(stayRegisterPo);
			int id=stayRegisterPo.getId();
			stayRegisterPo.setDepositStayRegisterID(id);
			stayRegisterPo.setDepositRegisterTime(stayRegisterPo.getRegisterTime());
			stayRegisterService.insertDeposit(stayRegisterPo);
			roomSetPoToRoomState.setId(Integer.parseInt(FenGen[i]));                      //给新的 Po 赋房间ID的值
			roomSetService.updateByIdToRoomState(roomSetPoToRoomState);  //根据 房间ID 来修改 当前被选中的房间的房态
		}
		mv=new ModelAndView("redirect:/StayRegister/tolist.do?LvKeLeiXingId="+56);
		return mv;
	}
	
	//ajax查询房间信息
	@ResponseBody
	@RequestMapping(value="/ajaxSelectRoom")
	public Object ajaxSelectRoom(String id){
	   List<RoomSetPo> list=new ArrayList<RoomSetPo>();
	   String[] fenGe=id.split(",");
	   for (int i = 0; i < fenGe.length; i++) {
		  RoomSetPo roomSetPo=roomSetService.selectById(Integer.parseInt(fenGe[i]));
		  list.add(roomSetPo);
	   }
       Gson gson=new Gson();
       return gson.toJson(list);
	}
	
/*--------------------------------------- 批量安排房间 end------------------------------------------------------------------*/		
	
	
	@Autowired
	private RoomSetService roomSetService;
	
/*	@RequestMapping("/tolist")
	public ModelAndView tolist(){
		ModelAndView mv=null;
		List<RoomSetPo> list=roomSetService.selectAll();
		mv=new ModelAndView("/roomset/roomset");
		mv.addObject("list",list);
		return mv;
	}*/
	
	//分页和模糊查询
	@RequestMapping("/tolist")
	public ModelAndView list(HttpServletRequest request,Integer currentPage,String txtname){
		ModelAndView mv=null;
		mv=new ModelAndView("/roomset/roomset");
		Page<RoomSetPo> vo=new Page<RoomSetPo>();
		if (currentPage==null) {
			currentPage=1;
		}else if (currentPage==0) {
			currentPage=1;
		}
		if(txtname==null)
		{
			txtname="";
		}
		vo.setCurrentPage(currentPage);
		vo=this.roomSetService.pageFuzzyselect(txtname, vo);
		mv.addObject("list",vo);
		mv.addObject("txtname",txtname);
		return mv;
	}
	

	@RequestMapping("/toadd")
	public ModelAndView toadd(){
		ModelAndView mv=null;
		List<AttributePo> listOne=attributeService.selectGuestRoomLevel();
		List<AttributePo> listTwo=attributeService.selectRoomState();
		mv=new ModelAndView("/roomset/add");
		mv.addObject("listOne",listOne);
		mv.addObject("listTwo",listTwo);
		return mv;
	}
	
	@RequestMapping("/add")
	public ModelAndView add(RoomSetPo roomSetPo){
		ModelAndView mv=null;
		roomSetService.insertAll(roomSetPo);
		mv=new ModelAndView("redirect:/RoomSet/tolist.do");
	
	
	
	
	//团队押金
	@RequestMapping("/toteamdeposit")
	public ModelAndView toteamdeposit(){
		ModelAndView mv=null;
		mv=new ModelAndView("/stayregister/teamdeposit");
		return mv;
	}
	
	
	
	
	
	
/*--------------------------------------- 团队结账 start-----------------------------------------------------------------*/			
	
	//团队结账
	@RequestMapping("/toteampay")
	public ModelAndView toteampay(Integer tuanDuiID){
		ModelAndView mv=null;
		TeamPayVo teamPayVo=new TeamPayVo();
		double yaJin=0;
		double xiaoFei=0;
		double huanFangFei=0;
		double zongFeiYong=0;
		double zhuSuFei=0;
		double yingBuJinE=0;
		int fangJianShu=0;
		Date date=new Date();
		DateFormat dformat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");   //设置日期格式
		Timestamp timestamp=Timestamp.valueOf(dformat.format(date)) ;  //将当前时间转为字符串
		List<AttributePo> listPayWay=attributeService.selectPayWay();                 //结账方式
		List<StayRegisterPo> listDeposit=stayRegisterService.selectTeamDeposit(tuanDuiID);
		List<StayRegisterPo> listConsumption=stayRegisterService.selectTeamConsumption(tuanDuiID);
		List<StayRegisterPo> list=stayRegisterService.selectFormTeamId(tuanDuiID, 68);
		for (int i = 0; i < listDeposit.size(); i++) {
			yaJin+=listDeposit.get(i).getDeposit();
		}
		for (int i = 0; i < list.size(); i++) {
			zongFeiYong+=list.get(i).getSumConst();
			huanFangFei+=list.get(i).getChangRoomMoney();
		}
		String monthString10="";
		String monthString11="";
		String monthString12="";
		String monthString13="";
		Calendar cal = Calendar.getInstance();
		int year = cal.get(Calendar.YEAR);         //获取年
		int month = cal.get(Calendar.MONTH) + 1;   //获取月
		int day = cal.get(Calendar.DATE);         //获取日
		
		month=month+1;
		month1=month;
		year1=year;
		
		month2=month-1;
		month3=month-2;
		month4=month-3;
		month5=month-4;
		month6=month-5;
		month7=month-6;
		month8=month-7;
		month9=month-8;
		month10=month-9;
		month11=month-10;
		month12=month-11;
		month13=month-12;
		if (month2<=0) {
			month2=month2+12;
			year2=year-1;
		}else {
			year2=year;
		}
		if (month3<=0) {
			month3=12+month3;
			year3=year-1;
		}else {
			year3=year;
		}
		if (month4<=0) {
			month4=12+month4;
			year4=year-1;
		}else {
			year4=year;
		}
		if (month5<=0) {
			month5=12+month5;
			mv=new ModelAndView("/commodity/commoditytype");
			return mv;
		}
		
		@RequestMapping("/newadd")
		public ModelAndView newadd(String txtname){
			ModelAndView mv=null;
			int newid=3;
			attributeService.insertAll(newid,txtname);
			mv=new ModelAndView("redirect:/Commodity/tolist.do");
			return mv;
		}
		
		@RequestMapping("/newdelete")
		public ModelAndView newdelete(String id){
			ModelAndView mv=null;
			String[] FenGe=id.split(",");
			for (int i = 0; i < FenGe.length; i++) {
				attributeService.deleteById(Integer.parseInt(FenGe[i]));
			}
			mv=new ModelAndView("redirect:/Commodity/tolist.do");
			return mv;
		}
		
		
		@ResponseBody
		@RequestMapping(value="/YZ")
		public Object YZ(String commodityName){
			int YorN=commodityService.selectYZ(commodityName);
			Gson gson =new Gson();
			return gson.toJson(YorN);
		}
}
package com.gx.web;

请添加图片描述

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

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值