package com.wzy.controller;
import java.sql.Time;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import com.wzy.page.Page;
import com.wzy.pojo.*;
import com.wzy.service.*;
import com.wzy.vo.TeamPayVo;
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;
/**
* 登记
*/
@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------------------------------------------------------------------*/
//登记
@RequestMapping("/toregister")
public ModelAndView toregister(int id,String roomNumber,Integer LvKeLeiXingId){
ModelAndView mv=null;
List<AttributePo> listGender=attributeService.selectGender(); //性别
List<AttributePo> listNation=attributeService.selectNation(); //民族
List<AttributePo> listPassengerLevel=attributeService.selectPassengerLevel(); //旅客级别
List<AttributePo> listEducationDegree=attributeService.selectEducationDegree(); //文化程度
List<AttributePo> listPapers=attributeService.selectPapers(); //证件类型
List<AttributePo> listThingReason=attributeService.selectThingReason();
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
酒店客房管理系统设计源码:该项目基于Java开发,包含306个文件,主要使用JavaScript、CSS、Java和HTML语言。该系统是基于SSM框架实现的酒店客房管理系统,适合Java项目入门学习以及企业级Java开发熟悉。项目简洁,采用的技术非常经典,适合用于学习和实践Java项目开发。
资源推荐
资源详情
资源评论
收起资源包目录
基于Java的酒店客房管理系统设计源码(SSM框架实现) (456个子文件)
update.bat 92B
amazeui.min.css 241KB
ace.min.css 216KB
bootstrap.css 143KB
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
font-awesome.min.css 22KB
bootstrap-responsive.css 21KB
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
daterangepicker.css 5KB
datepicker-dev.css 4KB
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
github-light.css 3KB
index.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 892B
prettify.css 817B
file.css 537B
roomset.css 350B
zshop.css 298B
WdatePicker.css 144B
backitem.css 91B
fontawesome-webfont_aea8981c.eot 37KB
fontawesome-webfont_2d2816fe.eot 37KB
glyphicons-halflings-regular.eot 20KB
iconfont.eot 4KB
loading.gif 9KB
loading-0.gif 6KB
select2-spinner.gif 2KB
loading-2.gif 2KB
img.gif 2KB
img.gif 2KB
datePicker.gif 1KB
loading-1.gif 701B
img.gif 475B
.gitignore 1B
demo_symbol.html 5KB
demo_unicode.html 5KB
demo_fontclass.html 3KB
th.fc-agenda-gutter.html 0B
uq.val.html 0B
ui.draggable.html 0B
blur.validate-equalTo.html 0B
ui.resizable.html 0B
change._change.html 0B
ui.sortable.html 0B
1.10.2.html 0B
keyup.k.html 0B
scroll.affix.data-api.html 0B
focus.typeahead.data-api.html 0B
li.select2-more-results.html 0B
a.chzn-single.html 0B
1.3.1.html 0B
click.collapse.data-api.html 0B
Link.html 0B
click.markdown.data-api.html 0B
keydown.mask.html 0B
ui.selectable.html 0B
ul.chzn-choices.html 0B
1.9.4.html 0B
focusin.modal.html 0B
change.select2.html 0B
li.active-result.html 0B
4.0em.html 0B
keypress.mask.html 0B
div.dataTables_filter.html 0B
keyup.DT.html 0B
共 456 条
- 1
- 2
- 3
- 4
- 5
资源评论
沐知全栈开发
- 粉丝: 4962
- 资源: 4984
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功