开发的甘肃旅游服务平台对收货地址管理、购物车管理、字典表管理、公告信息管理、景点管理、景点收藏管理、景点评价管理、景点门票订单管理、酒店管理、房间收藏管理、酒店评价管理、酒店订单管理、美食管理、美食收藏管理、美食评价管理、美食订单管理、商家管理、商品管理、商品收藏管理、商品评价管理、商品订单管理、用户管理、管理员管理等进行集中化处理。经过前面自己查阅的网络知识,加上自己在学校课堂上学习的知识,决定开发系统选择小程序模式这种高效率的模式完成系统功能开发。这种模式让操作员基于浏览器的方式进行网站访问,采用的主流的Java语言这种面向对象的语言进行甘肃旅游服务平台程序的开发,在数据库的选择上面,选择功能强大的Mysql数据库进行数据的存放操作。甘肃旅游服务平台的开发让用户查看景点信息变得容易,让管理员高效管理景点信息。
关键词:甘肃旅游服务平台;景点信息;公告;自助资讯
基于springboot旅游服务平台代码和论文553
演示视频:
基于springboot旅游服务平台代码和论文
程序设计是离不开对应数据库的设计操作的,这样的做法就是减少数据对程序的依赖性,所以数据库的设计也是需要花费大量的日常时间来进行设计的,在设计中对程序开发需要存储的数据信息进行实体划分,先确认实体,然后设计实体的属性等操作,这种设计就是数据库设计里面不能少的必须有的E-R模型设计。为了降低程序设计的对应的数据库设计难度,开发人员也可以使用相应的工具来进行E-R模型设计,现在市面上设计E-R模型的工具有PowerDesigner建模工具,Navicat制作工具,还有微软的Visio绘图工具。为了简便起见,本程序在设计E-R模型的时候,就选用了微软的Visio这款功能强大,操作便利的绘图工具。
(1)下图是美食实体和其具备的属性。
package com.controller;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.util.ArrayList;
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 java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.format.annotation.DateTimeFormat;
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.ShangpingoumaiEntity;
import com.entity.view.ShangpingoumaiView;
import com.service.ShangpingoumaiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
/**
* 商品购买
* 后端接口
* @author
* @email
* @date 2023-04-08 17:42:25
*/
@RestController
@RequestMapping("/shangpingoumai")
public class ShangpingoumaiController {
@Autowired
private ShangpingoumaiService shangpingoumaiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ShangpingoumaiEntity shangpingoumai,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("guke")) {
shangpingoumai.setGukezhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<ShangpingoumaiEntity> ew = new EntityWrapper<ShangpingoumaiEntity>();
PageUtils page = shangpingoumaiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shangpingoumai), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ShangpingoumaiEntity shangpingoumai,
HttpServletRequest request){
EntityWrapper<ShangpingoumaiEntity> ew = new EntityWrapper<ShangpingoumaiEntity>();
PageUtils page = shangpingoumaiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shangpingoumai), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( ShangpingoumaiEntity shangpingoumai){
EntityWrapper<ShangpingoumaiEntity> ew = new EntityWrapper<ShangpingoumaiEntity>();
ew.allEq(MPUtil.allEQMapPre( shangpingoumai, "shangpingoumai"));
return R.ok().put("data", shangpingoumaiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(ShangpingoumaiEntity shangpingoumai){
EntityWrapper< ShangpingoumaiEntity> ew = new EntityWrapper< ShangpingoumaiEntity>();
ew.allEq(MPUtil.allEQMapPre( shangpingoumai, "shangpingoumai"));
ShangpingoumaiView shangpingoumaiView = shangpingoumaiService.selectView(ew);
return R.ok("查询商品购买成功").put("data", shangpingoumaiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
ShangpingoumaiEntity shangpingoumai = shangpingoumaiService.selectById(id);
return R.ok().put("data", shangpingoumai);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
ShangpingoumaiEntity shangpingoumai = shangpingoumaiService.selectById(id);
return R.ok().put("data", shangpingoumai);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ShangpingoumaiEntity shangpingoumai, HttpServletRequest request){
shangpingoumai.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(shangpingoumai);
shangpingoumaiService.insert(shangpingoumai);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody ShangpingoumaiEntity shangpingoumai, HttpServletRequest request){
shangpingoumai.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(shangpingoumai);
shangpingoumaiService.insert(shangpingoumai);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody ShangpingoumaiEntity shangpingoumai, HttpServletRequest request){
//ValidatorUtils.validateEntity(shangpingoumai);
shangpingoumaiService.updateById(shangpingoumai);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
shangpingoumaiService.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<ShangpingoumaiEntity> wrapper = new EntityWrapper<ShangpingoumaiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("guke")) {
wrapper.eq("gukezhanghao", (String)request.getSession().getAttribute("username"));
}
int count = shangpingoumaiService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
package com.controller;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.util.ArrayList;
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 java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.format.annotation.DateTimeFormat;
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.ErshouxianzhiEntity;
import com.entity.view.ErshouxianzhiView;
import com.service.ErshouxianzhiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
import com.service.StoreupService;
import com.entity.StoreupEntity;
/**
* 二手闲置
* 后端接口
* @author
* @email
* @date 2023-04-03 17:44:37
*/
@RestController
@RequestMapping("/ershouxianzhi")
public class ErshouxianzhiController {
@Autowired
private ErshouxianzhiService ershouxianzhiService;
@Autowired
private StoreupService storeupService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ErshouxianzhiEntity ershouxianzhi,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
ershouxianzhi.setZhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<ErshouxianzhiEntity> ew = new EntityWrapper<ErshouxianzhiEntity>();
PageUtils page = ershouxianzhiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, ershouxianzhi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ErshouxianzhiEntity ershouxianzhi,
HttpServletRequest request){
EntityWrapper<ErshouxianzhiEntity> ew = new EntityWrapper<ErshouxianzhiEntity>();
PageUtils page = ershouxianzhiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, ershouxianzhi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( ErshouxianzhiEntity ershouxianzhi){
EntityWrapper<ErshouxianzhiEntity> ew = new EntityWrapper<ErshouxianzhiEntity>();
ew.allEq(MPUtil.allEQMapPre( ershouxianzhi, "ershouxianzhi"));
return R.ok().put("data", ershouxianzhiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(ErshouxianzhiEntity ershouxianzhi){
EntityWrapper< ErshouxianzhiEntity> ew = new EntityWrapper< ErshouxianzhiEntity>();
ew.allEq(MPUtil.allEQMapPre( ershouxianzhi, "ershouxianzhi"));
ErshouxianzhiView ershouxianzhiView = ershouxianzhiService.selectView(ew);
return R.ok("查询二手闲置成功").put("data", ershouxianzhiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
ErshouxianzhiEntity ershouxianzhi = ershouxianzhiService.selectById(id);
ershouxianzhi.setClicknum(ershouxianzhi.getClicknum()+1);
ershouxianzhi.setClicktime(new Date());
ershouxianzhiService.updateById(ershouxianzhi);
return R.ok().put("data", ershouxianzhi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
ErshouxianzhiEntity ershouxianzhi = ershouxianzhiService.selectById(id);
ershouxianzhi.setClicknum(ershouxianzhi.getClicknum()+1);
ershouxianzhi.setClicktime(new Date());
ershouxianzhiService.updateById(ershouxianzhi);
return R.ok().put("data", ershouxianzhi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ErshouxianzhiEntity ershouxianzhi, HttpServletRequest request){
ershouxianzhi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(ershouxianzhi);
ershouxianzhiService.insert(ershouxianzhi);
return R.ok();
}
/**
* 前端保存
*/
@IgnoreAuth
@RequestMapping("/add")
public R add(@RequestBody ErshouxianzhiEntity ershouxianzhi, HttpServletRequest request){
ershouxianzhi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(ershouxianzhi);
ershouxianzhiService.insert(ershouxianzhi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody ErshouxianzhiEntity ershouxianzhi, HttpServletRequest request){
//ValidatorUtils.validateEntity(ershouxianzhi);
ershouxianzhiService.updateById(ershouxianzhi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
ershouxianzhiService.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<ErshouxianzhiEntity> wrapper = new EntityWrapper<ErshouxianzhiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
wrapper.eq("zhanghao", (String)request.getSession().getAttribute("username"));
}
int count = ershouxianzhiService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,ErshouxianzhiEntity ershouxianzhi, HttpServletRequest request,String pre){
EntityWrapper<ErshouxianzhiEntity> ew = new EntityWrapper<ErshouxianzhiEntity>();
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 key = entry.getKey();
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 = ershouxianzhiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, ershouxianzhi), params), params));
return R.ok().put("data", page);
}
}