package com.gx.web;
import java.sql.Time;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.omg.PortableServer.POA;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.google.gson.Gson;
import com.gx.page.Page;
import com.gx.po.AttributePo;
import com.gx.po.CommodityPo;
import com.gx.po.PassengerPo;
import com.gx.po.ReceiveTargetPo;
import com.gx.po.RoomSetPo;
import com.gx.po.StayRegisterPo;
import com.gx.service.AttributeService;
import com.gx.service.CommodityService;
import com.gx.service.PassengerService;
import com.gx.service.ReceiveTargetService;
import com.gx.service.RoomSetService;
import com.gx.service.StayRegisterService;
import com.gx.vo.TeamPayVo;
@Controller
@RequestMapping("/StayRegister")
public class StayRegister {
@Autowired
private AttributeService attributeService;
@Autowired
private RoomSetService roomSetService;
@Autowired
private StayRegisterService stayRegisterService;
@Autowired
private PassengerService passengerService;
@Autowired
private CommodityService commodityService;
@Autowired
private ReceiveTargetService receiveTargetService;
int fangjianId=0;
String lvkeName="";
double zhuDianTianShu=0; //住店天数
double shengZhuDianTianShu=0; //剩住店天数
double zhuDianTianShuOne=0; //住店天数
//散客的list查询
@RequestMapping("/tolist")
public ModelAndView tolist(HttpServletRequest request, Integer currentPage,
String txtname,Integer LvKeLeiXingId,Integer isBillID){
ModelAndView mv=null;
List<StayRegisterPo> listAll=stayRegisterService.selectAll();
Date date=new Date();
DateFormat dformat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //设置日期格式
Timestamp timestamp=Timestamp.valueOf(dformat.format(date)) ; //将当前时间转为字符串
int id=0;
long xiangChaTianShu;
long days;
long hours;
String zhuSu="";
for (int i = 0; i < listAll.size(); i++) {
id=listAll.get(i).getId(); //获取ID
Timestamp registerTime=listAll.get(i).getRegisterTime(); //获取登记时间
zhuSu=listAll.get(i).getStayNumber(); //获取登记时间
xiangChaTianShu=timestamp.getTime()-registerTime.getTime(); //当前时间-登记时间
days=xiangChaTianShu/(1000 * 60 * 60 * 24); //转化为天
hours=xiangChaTianShu/(1000 * 60 * 60 )-days*24; //转化为小时
if (Long.parseLong(zhuSu)<=days) {
if (hours>0) {
stayRegisterService.updateRemind(id, 1);
}
}
}
List<AttributePo> listOne=attributeService.selectIsPay();
mv=new ModelAndView("/stayregister/list");
if (isBillID==null) {
isBillID=68;
}
if (LvKeLeiXingId==null) {
LvKeLeiXingId=55;
}
if (currentPage==null) {
currentPage=1;
}else if (currentPage==0) {
currentPage=1;
}
Page<StayRegisterPo> vo=new Page<StayRegisterPo>();
vo.setCurrentPage(currentPage);
if(txtname==null)
{
txtname="";
}
vo=this.stayRegisterService.pageFuzzyselectOne(LvKeLeiXingId, isBillID, txtname, vo);
mv.addObject("list",vo);
mv.addObject("listOne",listOne);
mv.addObject("LvKeLeiXingId",LvKeLeiXingId);
mv.addObject("isBillID",isBillID);
mv.addObject("txtname",txtname);
return mv;
}
//团队的list查询
@RequestMapping("/toteamlist")
public ModelAndView toteamlist(HttpServletRequest request, Integer currentPage,
String txtname,Integer LvKeLeiXingId,Integer isBillID,Integer tuanDuiID,
String teamNameId, String teamCodeId, String principalId,
String contactPhoneNUmberId, String registerTimeId){
ModelAndView mv=null;
List<StayRegisterPo> listTeam=null;
List<StayRegisterPo> listAll=stayRegisterService.selectAll();
Date date=new Date();
DateFormat dformat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //设置日期格式
Timestamp timestamp=Timestamp.valueOf(dformat.format(date)) ; //将当前时间转为字符串
int id=0;
long xiangChaTianShu;
long days;
long hours;
String zhuSu="";
double teamSumConst=0;
for (int i = 0; i < listAll.size(); i++) {
id=listAll.get(i).getId(); //获取ID
Timestamp registerTime=listAll.get(i).getRegisterTime(); //获取登记时间
zhuSu=listAll.get(i).getStayNumber(); //获取登记时间
xiangChaTianShu=timestamp.getTime()-registerTime.getTime(); //当前时间-登记时间
days=xiangChaTianShu/(1000 * 60 * 60 * 24); //转化为天
hours=xiangChaTianShu/(1000 * 60 * 60 )-days*24; //转化为小时
if (Long.parseLong(zhuSu)<=days) {
if (hours>0) {
stayRegisterService.updateRemind(id, 1);
}
}
}
List<AttributePo> listOne=attributeService.selectIsPay();
mv=new ModelAndView("/stayregister/list");
if (isBillID==null) {
isBillID=68;
}
if (LvKeLeiXingId==null) {
LvKeLeiXingId=56;
}
if (tuanDuiID==null) {
listTeam=this.stayRegisterService.selectFormTeamIdTwo(isBillID);
}else {
listTeam=this.stayRegisterService.selectFormTeamId(tuanDuiID, isBillID);
}
if (currentPage==null) {
currentPage=1;
}else if (currentPage==0) {
currentPage=1;
}
for (int i = 0; i < listTeam.size(); i++) {
teamSumConst+=listTeam.get(i).getSumConst();
}
Page<StayRegisterPo> vo=new Page<StayRegisterPo>();
vo.setCurrentPage(currentPage);
if(txtname==null)
{
txtname="";
}
if (tuanDuiID==null) {
vo=this.stayRegisterService.pageFuzzyselectThree(isBillID, txtname, vo);
}else {
vo=this.stayRegisterService.pageFuzzyselectTwo(tuanDuiID, isBillID, txtname, vo);
}
mv.addObject("list",vo);
mv.addObject("listOne",listOne);
mv.addObject("LvKeLeiXingId",LvKeLeiXingId);
mv.addObject("isBillID",isBillID);
mv.addObject("txtname",txtname);
mv.addObject("tuanDui",tuanDuiID);
mv.addObject("teamNameId",teamNameId);
mv.addObject("teamCodeId",teamCodeId);
mv.addObject("principalId",principalId);
mv.addObject("contactPhoneNUmberId",contactPhoneNUmberId);
mv.addObject("registerTimeId",registerTimeId);
mv.addObject("teamSumConst",teamSumConst);
return mv;
}
@ResponseBody
@RequestMapping(value="/ajaxSelectTeamSumcont")
public Object ajaxSelectTeamSumcont(Integer tuanDuiID, Integer isBillID){
double teamSumConst=0;
List<StayRegisterPo> listTeam=this.stayRegisterService.selectFormTeamId(tuanDuiID, isBillID);
for (int i = 0; i < listTeam.size(); i++) {
teamSumConst+=listTeam.get(i).getSumConst();
}
Gson gson=new Gson();
return gson.toJson(teamSumConst);
}
@RequestMapping("/toadd")
public ModelAndView toadd(){
ModelAndView mv=null;
mv=new ModelAndView("/stayregister/add");
return mv;
}
/*--------------------------------------- 登记 start------------------------------------------------------------------*/
//登记
@RequestM
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
一、项目简介 酒店管理系统,基于Java的SSM框架实现的酒店管理系统 二、技术实现 后台框架:Spring、SpringMVC、MyBatis UI界面:BootStrap、JSP、jQuery 数据库:MySQL 三、系统功能 系统主要功能模块: 1. 客房管理 2. 预订管理 3. 商品管理 4. 财务管理 5. 旅客管理 1)系统登陆界面 2)客房预订 3)住宿登记 4)旅客管理 四、环境搭建 运行环境: JDK 8 Eclipse Tomcat 7 MySQL 5.5
资源详情
资源评论
资源推荐
收起资源包目录
基于javaweb开发的酒店后台管理系统 (513个子文件)
StayRegister.class 34KB
StayRegisterPo.class 31KB
PredeterminePo.class 12KB
Predetermine.class 11KB
DateView.class 10KB
StayRegisterService.class 10KB
PassengerPo.class 6KB
FinancialStatistics.class 5KB
Commodity.class 5KB
Passenger.class 5KB
StayRegisterDao.class 4KB
RoomSet.class 4KB
ReceiveTarget.class 4KB
StayRegisterService.class 3KB
RoomSetServiceImpl.class 3KB
PredetermineServiceImpl.class 3KB
RoomSetPo.class 3KB
AttributeServiceImpl.class 3KB
PassengerServiceImpl.class 3KB
CommodityServiceImpl.class 3KB
ReceiveTargetServiceImpl.class 3KB
Login.class 3KB
ReceiveTargetPo.class 2KB
Page.class 2KB
CommodityPo.class 2KB
TeamPayVo.class 1KB
AttributePo.class 1KB
PredetermineDao.class 1KB
RoomSetDao.class 1KB
AttributeDao.class 1010B
RoomSetService.class 996B
UserPo.class 966B
CommodityDao.class 932B
PassengerDao.class 923B
AttributeService.class 890B
PredetermineService.class 882B
ReceiveTargetDao.class 852B
UserServiceImpl.class 835B
PassengerService.class 800B
ReceiveTargetService.class 729B
CommodityService.class 706B
Main.class 588B
UserService.class 181B
UserDao.class 169B
.classpath 1KB
org.eclipse.wst.common.component 459B
org.eclipse.wst.jsdt.ui.superType.container 49B
amazeui.min.css 241KB
ace.min.css 216KB
bootstrap.css 149KB
bootstrap.css 124KB
bootstrap.min.css 118KB
bootstrap.min.css 104KB
bootstrap.min.css 104KB
font-awesome-ie7.min.css 37KB
font-awesome.css 28KB
ace-skins.min.css 26KB
bootstrap-responsive.css 22KB
bootstrap-responsive.css 22KB
font-awesome.min.css 22KB
bootstrap-editable.css 20KB
select2.css 19KB
bootstrap-responsive.min.css 16KB
bootstrap-responsive.min.css 16KB
chosen.css 16KB
ace-responsive.min.css 15KB
layer.css 14KB
fullcalendar.css 11KB
datepicker.css 10KB
style.css 9KB
toastr.css 7KB
demo.css 6KB
ace-ie.min.css 6KB
default.css 5KB
layer.css 5KB
datepicker-dev.css 5KB
daterangepicker.css 5KB
colorbox.css 4KB
iconfont.css 4KB
datepicker.css 4KB
styles.css 3KB
datepicker.css 3KB
datepicker.css 3KB
style.css 3KB
jquery-ui-1.10.3.custom.min.css 3KB
bootstrap-timepicker.css 3KB
index.css 3KB
github-light.css 3KB
colorpicker.css 2KB
highlight-8.6.default.min.css 2KB
jquery.gritter.css 2KB
normalize.css 2KB
login.css 2KB
mycss.css 1KB
page.css 901B
prettify.css 817B
file.css 537B
roomset.css 380B
zshop.css 298B
WdatePicker.css 144B
共 513 条
- 1
- 2
- 3
- 4
- 5
- 6
csdnid233333
- 粉丝: 1
- 资源: 24
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0