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 web 信息系统综合课程设计 (530个子文件)
ssm+mysql实现的Java web酒店管理项目源码.avi 100.3MB
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 2KB
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 485B
org.eclipse.wst.jsdt.ui.superType.container 49B
amazeui.min.css 241KB
ace.min.css 216KB
bootstrap.css 124KB
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-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
toastr.css 7KB
ace-ie.min.css 6KB
default.css 5KB
layer.css 5KB
datepicker-dev.css 5KB
daterangepicker.css 5KB
colorbox.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
colorpicker.css 2KB
highlight-8.6.default.min.css 2KB
jquery.gritter.css 2KB
normalize.css 2KB
page.css 901B
prettify.css 817B
roomset.css 380B
WdatePicker.css 144B
fontawesome-webfont_2d2816fe.eot 37KB
fontawesome-webfont_aea8981c.eot 37KB
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
共 530 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
Cool_1943
- 粉丝: 4
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 数据库基本内容讲解和操作
- Centos8.x通过RPM包升级OpenSSH9.9.(openssl-3.4.0) 升级有风险,前务必做好快照,以免升级后出现异常影响业务
- FortFirewall-3.14.7-windows10-x86-64 防火墙
- javaweb基本操作
- Centos7.x升级openssl-1.1.1w rpm安装包 升级有风险,前务必做好快照,以免升级后出现异常影响业务
- yolo的基本操作用法
- Ubuntu20/22/24通过deb包升级OpenSSH9.9方法 不支持16、18版本,升级有风险,前务必做好快照,以免升级后出现异常影响业务
- java swing(Gui窗体)宿舍管理系统 (有附件)
- 数据集格式转换以及标注框可视化脚本
- 火狐国际开发版安装文件
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功