(免费分享)基于javaweb,ssm旅游信息系统

发布于:2022-11-06 ⋅ 阅读:(390) ⋅ 点赞:(0)

源码获取:关注文末gongzhonghao,输入003领取下载链接

IDEA开发工具,数据库:mysql,Tomcat8

采用:springmvc+spring+mybatis框架

(1)用户信息管理模块

用户信息管理模块分为后台管理员信息的维护模块和前台注册用户的维护模块,并提供对各类用户的权限分配功能。

用户信息维护模块又分为注册用户信息维护和管理员信息维护子功能。注册用户信息维护可完成对前台系统注册的游客信息的检索和操纵处理功能,而管理员信息维护可在后台进行管理员的添加、以及后续的修改、删除等维护功能,而其中对用户信息的修改,一般是指对用户密码的修改。

(2)旅游景点信息维护模块

系统中的旅游景点信息维护可以对本地景点信息进行维护,可在前台实现景点信息的检索和浏览,在后台具有:景点信息查询、景点信息添加、景点信息修改和删除功能。景点信息检索或查询:可以按本地景点的名称或景点所属类型查询目标景点,也可以列出本地全部的景点。当选中某一景点后,可查看该景点的介绍,包括地理位置、到达的公交车的信息等。景点信息添加:可增加新的景点的相关信息,录入信息包括:景点的名称、位置、介绍、特点、可达公交车等。

景点信息修改:当选中某一个已经录入的景点后,可打开修改页面,对该景点信息进行修改,除景点名称外,其他信息均可进行修改。

景点信息删除:删除选中的景点信息,可删除一个景点,也可同时选中的多个景点。

旅游景点信息维护模块的应用意义在于当管理在进行旅游景点信息维护时,能够快捷地将景点信息添加到系统中,同时对景点的相关信息进行维护,并与后点的旅游信息数据库连接,将景点信息及时存放到旅游信息数据库中。而访问前台系统的用户能对后台管理员所添加、更新的景点信息进行及时、方便地浏览。

(3)酒店信息维护模块

本维护模块实现本地主要酒店的信息维护功能。具体来说,包括当时酒店信息查询模块、酒店信息添加模块、酒店信息修改模块和酒店信息删除模块。在进行酒店信息查询时,可根据酒店的名称、级别进行查询,也可显示系统全部酒店信息,并可根据入住的酒店信息查询到就近的景点信息。

系统管理员可通过酒店信息添加模块向系统数据库增加新的酒店信息,在新增酒店信息时,需要维护该酒店的名称、级别、就近景点信息、所提供房型等相关信息。另外,系统还提供了对酒店信息进行修改和删除的功能。
在这里插入图片描述
前台截图:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

后台截图:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

package com.daowen.controller;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.daowen.entity.Comment;
import com.daowen.service.CommentService;
import com.daowen.ssm.simplecrud.SimpleController;
import com.daowen.webcontrol.PagerMetal;
@Controller
public class CommentController extends SimpleController {

	@Autowired
	private CommentService commentSrv=null;
	@Override
	@RequestMapping("/admin/commentmanager.do")
	public void mapping(HttpServletRequest request, HttpServletResponse response) {
		mappingMethod(request,response);
	}
	
	/********************************************************
	 ****************** 信息注销监听支持*****************************
	 *********************************************************/
	public void delete() {
		String id = request.getParameter("id");
		commentSrv.delete(" where id=" + id);
		get();
	}

	/*************************************************************
	 **************** 保存动作监听支持******************************
	 **************************************************************/
	public void save() {
		String photo = request.getParameter("photo");

		String commentren = request.getParameter("currenthy");
		String commentcontent = request.getParameter("commentcontent");
		String xtype = request.getParameter("xtype");
		String belongid = request.getParameter("belongid");
		String istopic=request.getParameter("istopic");
	    String topicid=request.getParameter("topicid");
		Comment comment = new Comment();
		comment.setPhoto(photo);
		comment.setCommenttime(new Date());

		comment.setCommentren(commentren == null ? "" : commentren);
		comment.setCommentcontent(commentcontent == null ? "" : commentcontent);
		comment.setXtype(xtype == null ? "" : xtype);
		comment.setBelongid(belongid == null ? "" : belongid);
		
		if(istopic!=null)
        	comment.setTopicid(new Integer(topicid));
        else 
        	comment.setTopicid(0);
        if(topicid!=null)
        	comment.setIstopic(new Integer(istopic));
        else
        	comment.setTopicid(0);
		commentSrv.save(comment);

		String forwardurl = request.getParameter("forwardurl");
		redirect(forwardurl);

	}

	

	/******************************************************
	 *********************** 加载内部支持*********************
	 *******************************************************/
	public void load() {
		//
		String id = request.getParameter("id");
		String actiontype = "save";
		if (id != null) {
			Comment comment = commentSrv.load( "where id="+ id);
			if (comment != null) {
				request.setAttribute("comment", comment);
			}
			actiontype = "update";
		}
		request.setAttribute("id", id);
		request.setAttribute("actiontype", actiontype);
		try {
			request.getRequestDispatcher("commentadd.jsp").forward(request,
					response);
		} catch (ServletException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	/******************************************************
	 *********************** 数据绑定内部支持*********************
	 *******************************************************/
	public void get() {
		String filter = "";
		//
		String commentren = request.getParameter("commentren");
		if (commentren != null)
			filter = "  where commentren like '%" + commentren + "%'  ";
		int pageindex = 1;
		int pagesize = 10;
		// 获取当前分页
		String currentpageindex = request.getParameter("currentpageindex");
		// 当前页面尺寸
		String currentpagesize = request.getParameter("pagesize");
		// 设置当前页
		if (currentpageindex != null)
			pageindex = new Integer(currentpageindex);
		// 设置当前页尺寸
		if (currentpagesize != null)
			pagesize = new Integer(currentpagesize);
		List<Comment> listcomment = commentSrv.getPageEntitys(filter,pageindex, pagesize);
		int recordscount =  commentSrv.getRecordCount(filter == null ? "" : filter);
		request.setAttribute("listcomment", listcomment);
		PagerMetal pm = new PagerMetal(recordscount);
		// 设置尺寸
		pm.setPagesize(pagesize);
		// 设置当前显示页
		pm.setCurpageindex(pageindex);
		// 设置分页信息
		request.setAttribute("pagermetal", pm);
		// 分发请求参数
		dispatchParams(request, response);
		try {
			request.getRequestDispatcher("/admin/commentmanager.jsp").forward(
					request, response);
		} catch (ServletException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}


网站公告

今日签到

点亮在社区的每一天
去签到