ssm+vue亿互游在线平台源码和论文

ssm+vue亿互游在线平台源码和论文118

 开发工具:idea 
 数据库mysql5.7+
 数据库链接工具:navcat,小海豚等
  技术:ssm

摘 要

随着旅游业的迅速发展,传统的旅游资讯查询方式,已经无法满足用户需求,因此,结合计算机技术的优势和普及,特开发了本亿互游在线平台。

本文研究的亿互游在线平台基于SSM框架,采用JSP技术、Java语言和MYSQL数据库设计开发。通过本系统,满足了不同权限用户的需求,包括管理员用户和前台用户通过本系统可查看旅游信息,注册登录后还可进行酒店预订、美食购买等,前台注册登录后可实现景点信息管理、路线规划管理、景点美食管理以及住宿信息管理功能,管理员可登录系统后台对系统进行全面管理,确保系统正常稳定运行更好的为用户服务

本系统经过测试,运行效果稳定,操作方便、快捷,是一个功能全面、实用性好、安全性高,并具有良好的可扩展性、可维护性的亿互游在线平台

关键字:亿互游在线平台SSM框架;JSP技术;MYSQL数据库

package com.controller;

import java.text.SimpleDateFormat;
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.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.QiantaiEntity;
import com.entity.view.QiantaiView;

import com.service.QiantaiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;


/**
 * 前台
 * 后端接口
 * @author 
 * @email 
 * @date 2021-03-20 09:46:50
 */
@RestController
@RequestMapping("/qiantai")
public class QiantaiController {
    @Autowired
    private QiantaiService qiantaiService;
    
	@Autowired
	private TokenService tokenService;
	
	/**
	 * 登录
	 */
	@IgnoreAuth
	@RequestMapping(value = "/login")
	public R login(String username, String password, String captcha, HttpServletRequest request) {
		QiantaiEntity user = qiantaiService.selectOne(new EntityWrapper<QiantaiEntity>().eq("qiantaizhanghao", username));
		if(user==null || !user.getMima().equals(password)) {
			return R.error("账号或密码不正确");
		}
		String token = tokenService.generateToken(user.getId(), username,"qiantai",  "前台" );
		return R.ok().put("token", token);
	}
	
	/**
     * 注册
     */
	@IgnoreAuth
    @RequestMapping("/register")
    public R register(@RequestBody QiantaiEntity qiantai){
    	//ValidatorUtils.validateEntity(qiantai);
    	QiantaiEntity user = qiantaiService.selectOne(new EntityWrapper<QiantaiEntity>().eq("qiantaizhanghao", qiantai.getQiantaizhanghao()));
		if(user!=null) {
			return R.error("注册用户已存在");
		}
		Long uId = new Date().getTime();
		qiantai.setId(uId);
        qiantaiService.insert(qiantai);
        return R.ok();
    }
	
	/**
	 * 退出
	 */
	@RequestMapping("/logout")
	public R logout(HttpServletRequest request) {
		request.getSession().invalidate();
		return R.ok("退出成功");
	}
	
	/**
     * 获取用户的session用户信息
     */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
    	Long id = (Long)request.getSession().getAttribute("userId");
        QiantaiEntity user = qiantaiService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * 密码重置
     */
    @IgnoreAuth
	@RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
    	QiantaiEntity user = qiantaiService.selectOne(new EntityWrapper<QiantaiEntity>().eq("qiantaizhanghao", username));
    	if(user==null) {
    		return R.error("账号不存在");
    	}
    	user.setMima("123456");
        qiantaiService.updateById(user);
        return R.ok("密码已重置为:123456");
    }


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,QiantaiEntity qiantai, 
		HttpServletRequest request){

        EntityWrapper<QiantaiEntity> ew = new EntityWrapper<QiantaiEntity>();
		PageUtils page = qiantaiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, qiantai), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,QiantaiEntity qiantai, HttpServletRequest request){
        EntityWrapper<QiantaiEntity> ew = new EntityWrapper<QiantaiEntity>();
		PageUtils page = qiantaiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, qiantai), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( QiantaiEntity qiantai){
       	EntityWrapper<QiantaiEntity> ew = new EntityWrapper<QiantaiEntity>();
      	ew.allEq(MPUtil.allEQMapPre( qiantai, "qiantai")); 
        return R.ok().put("data", qiantaiService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(QiantaiEntity qiantai){
        EntityWrapper< QiantaiEntity> ew = new EntityWrapper< QiantaiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( qiantai, "qiantai")); 
		QiantaiView qiantaiView =  qiantaiService.selectView(ew);
		return R.ok("查询前台成功").put("data", qiantaiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        QiantaiEntity qiantai = qiantaiService.selectById(id);
        return R.ok().put("data", qiantai);
    }

    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        QiantaiEntity qiantai = qiantaiService.selectById(id);
        return R.ok().put("data", qiantai);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody QiantaiEntity qiantai, HttpServletRequest request){
    	qiantai.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(qiantai);
    	QiantaiEntity user = qiantaiService.selectOne(new EntityWrapper<QiantaiEntity>().eq("qiantaizhanghao", qiantai.getQiantaizhanghao()));
		if(user!=null) {
			return R.error("用户已存在");
		}

		qiantai.setId(new Date().getTime());
        qiantaiService.insert(qiantai);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody QiantaiEntity qiantai, HttpServletRequest request){
    	qiantai.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(qiantai);
    	QiantaiEntity user = qiantaiService.selectOne(new EntityWrapper<QiantaiEntity>().eq("qiantaizhanghao", qiantai.getQiantaizhanghao()));
		if(user!=null) {
			return R.error("用户已存在");
		}

		qiantai.setId(new Date().getTime());
        qiantaiService.insert(qiantai);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody QiantaiEntity qiantai, HttpServletRequest request){
        //ValidatorUtils.validateEntity(qiantai);
        qiantaiService.updateById(qiantai);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        qiantaiService.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<QiantaiEntity> wrapper = new EntityWrapper<QiantaiEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = qiantaiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	


}
package com.controller;

import java.text.SimpleDateFormat;
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.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.ZhusuxinxiEntity;
import com.entity.view.ZhusuxinxiView;

import com.service.ZhusuxinxiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;


/**
 * 住宿信息
 * 后端接口
 * @author 
 * @email 
 * @date 2021-03-20 09:46:50
 */
@RestController
@RequestMapping("/zhusuxinxi")
public class ZhusuxinxiController {
    @Autowired
    private ZhusuxinxiService zhusuxinxiService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,ZhusuxinxiEntity zhusuxinxi, 
		HttpServletRequest request){

        EntityWrapper<ZhusuxinxiEntity> ew = new EntityWrapper<ZhusuxinxiEntity>();
		PageUtils page = zhusuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zhusuxinxi), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,ZhusuxinxiEntity zhusuxinxi, HttpServletRequest request){
        EntityWrapper<ZhusuxinxiEntity> ew = new EntityWrapper<ZhusuxinxiEntity>();
		PageUtils page = zhusuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zhusuxinxi), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( ZhusuxinxiEntity zhusuxinxi){
       	EntityWrapper<ZhusuxinxiEntity> ew = new EntityWrapper<ZhusuxinxiEntity>();
      	ew.allEq(MPUtil.allEQMapPre( zhusuxinxi, "zhusuxinxi")); 
        return R.ok().put("data", zhusuxinxiService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(ZhusuxinxiEntity zhusuxinxi){
        EntityWrapper< ZhusuxinxiEntity> ew = new EntityWrapper< ZhusuxinxiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( zhusuxinxi, "zhusuxinxi")); 
		ZhusuxinxiView zhusuxinxiView =  zhusuxinxiService.selectView(ew);
		return R.ok("查询住宿信息成功").put("data", zhusuxinxiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        ZhusuxinxiEntity zhusuxinxi = zhusuxinxiService.selectById(id);
		zhusuxinxi.setClicknum(zhusuxinxi.getClicknum()+1);
		zhusuxinxi.setClicktime(new Date());
		zhusuxinxiService.updateById(zhusuxinxi);
        return R.ok().put("data", zhusuxinxi);
    }

    /**
     * 前端详情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        ZhusuxinxiEntity zhusuxinxi = zhusuxinxiService.selectById(id);
		zhusuxinxi.setClicknum(zhusuxinxi.getClicknum()+1);
		zhusuxinxi.setClicktime(new Date());
		zhusuxinxiService.updateById(zhusuxinxi);
        return R.ok().put("data", zhusuxinxi);
    }
    


    /**
     * 赞或踩
     */
    @RequestMapping("/thumbsup/{id}")
    public R thumbsup(@PathVariable("id") String id,String type){
        ZhusuxinxiEntity zhusuxinxi = zhusuxinxiService.selectById(id);
        if(type.equals("1")) {
        	zhusuxinxi.setThumbsupnum(zhusuxinxi.getThumbsupnum()+1);
        } else {
        	zhusuxinxi.setCrazilynum(zhusuxinxi.getCrazilynum()+1);
        }
        zhusuxinxiService.updateById(zhusuxinxi);
        return R.ok();
    }

    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody ZhusuxinxiEntity zhusuxinxi, HttpServletRequest request){
    	zhusuxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(zhusuxinxi);

        zhusuxinxiService.insert(zhusuxinxi);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody ZhusuxinxiEntity zhusuxinxi, HttpServletRequest request){
    	zhusuxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(zhusuxinxi);

        zhusuxinxiService.insert(zhusuxinxi);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody ZhusuxinxiEntity zhusuxinxi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(zhusuxinxi);
        zhusuxinxiService.updateById(zhusuxinxi);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        zhusuxinxiService.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<ZhusuxinxiEntity> wrapper = new EntityWrapper<ZhusuxinxiEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = zhusuxinxiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	
	/**
     * 前端智能排序
     */
	@IgnoreAuth
    @RequestMapping("/autoSort")
    public R autoSort(@RequestParam Map<String, Object> params,ZhusuxinxiEntity zhusuxinxi, HttpServletRequest request,String pre){
        EntityWrapper<ZhusuxinxiEntity> ew = new EntityWrapper<ZhusuxinxiEntity>();
        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 = zhusuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zhusuxinxi), params), params));
        return R.ok().put("data", page);
    }


}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序猿毕业分享网

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值