SSM+Vue酒店管理系统,JavaWeb酒店管理系统,项目由maven工具管理依赖,数据库Mysql,一共19张表,前端用Vue写的管理端,功能丰富,需要可在最后位置联系我,可加购调试,讲解,项目带文档。
功能如下:
个人中心
客房分类管理
酒店信息管理
房客信息管理
酒店餐饮管理
用户管理
客房预订管理
客房续订管理
退房评价管理
餐饮订单管理
餐饮配送管理
跟管理员管理
系统公告,轮播图,客服管理
图示:
部分数据库设计:
kefangxinxi表
列名 | 数据类型 | 长度 | 约束 |
id | bigint | 20 | NOT NULL |
addtime | timestamp | 0 | NOT NULL |
kefangmingcheng | varchar | 200 | NOT NULL |
kefangleixing | varchar | 200 | NOT NULL |
kefangtupian | varchar | 200 | NOT NULL |
kefangsheshi | varchar | 200 | NOT NULL |
kefangjiage | int | 11 | NOT NULL |
kefangzhuangtai | varchar | 200 | NOT NULL |
jiudianmingcheng | varchar | 200 | NOT NULL |
leibie | varchar | 200 | NOT NULL |
xingji | varchar | 200 | NOT NULL |
jiudiandizhi | varchar | 200 | NOT NULL |
zixundianhua | varchar | 200 | NOT NULL |
kefangjieshao | longtext | 0 | NOT NULL |
clicktime | datetime | 0 | NOT NULL |
clicknum | int | 11 | NOT NULL |
kefangyuding表
列名 | 数据类型 | 长度 | 约束 |
id | int | 11 | NOT NULL |
addtime | varchar | 50 | default NULL |
dingdanbianhao | varchar | 50 | default NULL |
fangjianhao | varchar | 50 | default NULL |
kefangmingcheng | varchar | 50 | default NULL |
kefangleixing | varchar | 50 | default NULL |
kefangzhuangtai | varchar | 50 | default NULL |
kefangjiage | varchar | 50 | default NULL |
yudingtianshu | varchar | 50 | default NULL |
zongjiage | varchar | 50 | default NULL |
xiadanshijian | varchar | 50 | default NULL |
ruzhushijian | varchar | 50 | default NULL |
yonghuming | varchar | 50 | default NULL |
lianxidianhua | varchar | 50 | default NULL |
shenfenzheng | varchar | 50 | default NULL |
sfsh | varchar | 50 | default NULL |
shhf | varchar | 50 | default NULL |
ruzhudengji表
列名 | 数据类型 | 长度 | 约束 |
id | bigint | 20 | NOT NULL |
addtime | timestamp | 0 | NOT NULL |
dingdanbianhao | varchar | 200 | NOT NULL |
kefangmingcheng | varchar | 200 | NOT NULL |
kefangleixing | varchar | 200 | NOT NULL |
kefangtupian | varchar | 200 | NOT NULL |
kefangzhuangtai | varchar | 200 | NOT NULL |
jiudianmingcheng | varchar | 200 | NOT NULL |
jiudiandizhi | varchar | 200 | NOT NULL |
zixundianhua | varchar | 200 | NOT NULL |
kefangjiage | int | 11 | NOT NULL |
ruzhutianshu | int | 11 | NOT NULL |
zongjiage | int | 11 | NOT NULL |
ruzhurenshu | int | 11 | NOT NULL |
xiadanshijian | datetime | 0 | NOT NULL |
ruzhushijian | datetime | 0 | NOT NULL |
liuyanbeizhu | varchar | 200 | NOT NULL |
yonghuming | varchar | 200 | NOT NULL |
xingming | varchar | 200 | NOT NULL |
shouji | varchar | 200 | NOT NULL |
shenfenzheng | varchar | 200 | NOT NULL |
sfsh | varchar | 200 | NOT NULL |
shhf | longtext | 0 | NOT NULL |
ispay | varchar | 200 | NOT NULL |
部分代码设计:
1.客房信息后端接口
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.KefangxinxiEntity;
import com.entity.view.KefangxinxiView;
import com.service.KefangxinxiService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
/**
* 客房信息后端接口
*/
@RestController
@RequestMapping("/kefangxinxi")
public class KefangxinxiController {
@Autowired
private KefangxinxiService kefangxinxiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, KefangxinxiEntity kefangxinxi, HttpServletRequest request) {
EntityWrapper<KefangxinxiEntity> ew = new EntityWrapper<KefangxinxiEntity>();
PageUtils page = kefangxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, kefangxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, KefangxinxiEntity kefangxinxi, HttpServletRequest request) {
EntityWrapper<KefangxinxiEntity> ew = new EntityWrapper<KefangxinxiEntity>();
PageUtils page = kefangxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, kefangxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list(KefangxinxiEntity kefangxinxi) {
EntityWrapper<KefangxinxiEntity> ew = new EntityWrapper<KefangxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre(kefangxinxi, "kefangxinxi"));
return R.ok().put("data", kefangxinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(KefangxinxiEntity kefangxinxi) {
EntityWrapper<KefangxinxiEntity> ew = new EntityWrapper<KefangxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre(kefangxinxi, "kefangxinxi"));
KefangxinxiView kefangxinxiView = kefangxinxiService.selectView(ew);
return R.ok("查询客房信息成功").put("data", kefangxinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id) {
KefangxinxiEntity kefangxinxi = kefangxinxiService.selectById(id);
kefangxinxi.setClicknum(kefangxinxi.getClicknum() + 1);
kefangxinxi.setClicktime(new Date());
kefangxinxiService.updateById(kefangxinxi);
return R.ok().put("data", kefangxinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") String id) {
KefangxinxiEntity kefangxinxi = kefangxinxiService.selectById(id);
kefangxinxi.setClicknum(kefangxinxi.getClicknum() + 1);
kefangxinxi.setClicktime(new Date());
kefangxinxiService.updateById(kefangxinxi);
return R.ok().put("data", kefangxinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody KefangxinxiEntity kefangxinxi, HttpServletRequest request) {
kefangxinxi.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
kefangxinxiService.insert(kefangxinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody KefangxinxiEntity kefangxinxi, HttpServletRequest request) {
kefangxinxi.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
kefangxinxiService.insert(kefangxinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody KefangxinxiEntity kefangxinxi, HttpServletRequest request) {
kefangxinxiService.updateById(kefangxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids) {
kefangxinxiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if (type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if (map.get("remindstart") != null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH, remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if (map.get("remindend") != null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH, remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<KefangxinxiEntity> wrapper = new EntityWrapper<KefangxinxiEntity>();
if (map.get("remindstart") != null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if (map.get("remindend") != null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = kefangxinxiService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params, KefangxinxiEntity kefangxinxi, HttpServletRequest request, String pre) {
EntityWrapper<KefangxinxiEntity> ew = new EntityWrapper<KefangxinxiEntity>();
Map<String, Object> newMap = new HashMap<String, Object>();
Map<String, Object> param = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
String newKey = entry.getKey();
if (pre.endsWith(".")) {
newMap.put(pre + newKey, entry.getValue());
} else if (StringUtils.isEmpty(pre)) {
newMap.put(newKey, entry.getValue());
} else {
newMap.put(pre + "." + newKey, entry.getValue());
}
}
params.put("sort", "clicknum");
params.put("order", "desc");
PageUtils page = kefangxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, kefangxinxi), params), params));
return R.ok().put("data", page);
}
}
客房信息实体类
import com.entity.KefangxinxiEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
* 客房信息
* 手机端接口返回实体辅助类
* (主要作用去除一些不必要的字段)
*/
public class KefangxinxiVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客房类型
*/
private String kefangleixing;
/**
* 客房图片
*/
private String kefangtupian;
/**
* 客房设施
*/
private String kefangsheshi;
/**
* 客房价格
*/
private Integer kefangjiage;
/**
* 客房状态
*/
private String kefangzhuangtai;
/**
* 酒店名称
*/
private String jiudianmingcheng;
/**
* 类别
*/
private String leibie;
/**
* 星级
*/
private String xingji;
/**
* 酒店地址
*/
private String jiudiandizhi;
/**
* 咨询电话
*/
private String zixundianhua;
/**
* 客房介绍
*/
private String kefangjieshao;
/**
* 最近点击时间
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date clicktime;
/**
* 点击次数
*/
private Integer clicknum;
/**
* 设置:客房类型
*/
public void setKefangleixing(String kefangleixing) {
this.kefangleixing = kefangleixing;
}
/**
* 获取:客房类型
*/
public String getKefangleixing() {
return kefangleixing;
}
/**
* 设置:客房图片
*/
public void setKefangtupian(String kefangtupian) {
this.kefangtupian = kefangtupian;
}
/**
* 获取:客房图片
*/
public String getKefangtupian() {
return kefangtupian;
}
/**
* 设置:客房设施
*/
public void setKefangsheshi(String kefangsheshi) {
this.kefangsheshi = kefangsheshi;
}
/**
* 获取:客房设施
*/
public String getKefangsheshi() {
return kefangsheshi;
}
/**
* 设置:客房价格
*/
public void setKefangjiage(Integer kefangjiage) {
this.kefangjiage = kefangjiage;
}
/**
* 获取:客房价格
*/
public Integer getKefangjiage() {
return kefangjiage;
}
/**
* 设置:客房状态
*/
public void setKefangzhuangtai(String kefangzhuangtai) {
this.kefangzhuangtai = kefangzhuangtai;
}
/**
* 获取:客房状态
*/
public String getKefangzhuangtai() {
return kefangzhuangtai;
}
/**
* 设置:酒店名称
*/
public void setJiudianmingcheng(String jiudianmingcheng) {
this.jiudianmingcheng = jiudianmingcheng;
}
/**
* 获取:酒店名称
*/
public String getJiudianmingcheng() {
return jiudianmingcheng;
}
/**
* 设置:类别
*/
public void setLeibie(String leibie) {
this.leibie = leibie;
}
/**
* 获取:类别
*/
public String getLeibie() {
return leibie;
}
/**
* 设置:星级
*/
public void setXingji(String xingji) {
this.xingji = xingji;
}
/**
* 获取:星级
*/
public String getXingji() {
return xingji;
}
/**
* 设置:酒店地址
*/
public void setJiudiandizhi(String jiudiandizhi) {
this.jiudiandizhi = jiudiandizhi;
}
/**
* 获取:酒店地址
*/
public String getJiudiandizhi() {
return jiudiandizhi;
}
/**
* 设置:咨询电话
*/
public void setZixundianhua(String zixundianhua) {
this.zixundianhua = zixundianhua;
}
/**
* 获取:咨询电话
*/
public String getZixundianhua() {
return zixundianhua;
}
/**
* 设置:客房介绍
*/
public void setKefangjieshao(String kefangjieshao) {
this.kefangjieshao = kefangjieshao;
}
/**
* 获取:客房介绍
*/
public String getKefangjieshao() {
return kefangjieshao;
}
/**
* 设置:最近点击时间
*/
public void setClicktime(Date clicktime) {
this.clicktime = clicktime;
}
/**
* 获取:最近点击时间
*/
public Date getClicktime() {
return clicktime;
}
/**
* 设置:点击次数
*/
public void setClicknum(Integer clicknum) {
this.clicknum = clicknum;
}
/**
* 获取:点击次数
*/
public Integer getClicknum() {
return clicknum;
}
}
需要可以联系我: