Java项目:旅游管理系统(java+SpringBoot+VUE+ElementUI+JavaScript+Mysql)

源码获取:俺的博客首页 "资源" 里下载!

项目介绍

系统分为前台跟后台两个项目 前台: 展示旅游新闻、景区信息、美食信息、旅游线路、在线留言

后台管理员: 账号管理、地区管理、景点信息管理、地方美食管理、旅游线路管理、订单信息管理、新闻管理、系统管理 普通用户:旅游线路、订单信息


环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 
4.数据库:MySql 5.7/8.0版本均可;
5.是否Maven项目:是;


技术栈

后端框架:Springboot

前端技术:ElementUI、vue、css、JavaScript、axios


使用说明

项目运行:
1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
4. 运行项目,控制台提示运行成功后再去运行前端项目;
5. 管理员用户名密码:admin/admin
普通用户名密码:user/123456

文档介绍(项目研究背景、研究目的及意义、开发软件介绍、技术介绍、Mysql数据库、系统分析、可行性研究、经济上的可行性、技术上的可行性、操作上的可行性、开发结构分析、功能需求分析、数据流图、业务流程分析、数据字典、旅游网站总体设计、系统功能描述、系统界面设计、系统功能结构图、系统设计目标、系统实现的软硬件平台、数据库设计、数据库概念结构设计、数据库逻辑结构设计、系统详细设计):

 景点列表展示:

人情景点列表展示: 

旅游线路列表展示:

美食列表展示: 

 新闻信息列表展示:

登录管理展示页面: 

后台功能管理-地方没事查询展示:

旅游线路查询页面展示:

登录管理控制层:

@WebServlet("/Login")
public class LoginServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	BaseDao dao = new BaseDaoImpl();
	PrintWriter out = null;

	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		response.setContentType("text/html;charset=utf-8");
		// service
		// 方法类-----------------------------------------------------------------------------------------------------
		ObjectService service = new ObjectService();
		HttpSession session = request.getSession();
		UsersEntity use = service.setObject(request, UsersEntity.class);
		// 全局变量类----------------------------------------------------------------------------------------------------------
		String method = request.getParameter("method");
		System.out.println(method);
		out = response.getWriter();
		File[] files = File.listRoots();
		String rootpath = files[files.length - 1].getPath();
		if ("login".equals(method)) {// 登录
			Object[] params = { use.getUname(), use.getPassword() };
			System.out.println(use.getUname() + use.getPassword());
			JSONObject user = null;
			try {
				user = dao.findJSONObject("select * from users where uname = ? and password = ?", params);
				System.out.println(user);
				System.out.println(user.get("uname"));
				System.out.println(user.get("utype"));
				request.getSession().setAttribute("uname", user.get("uname"));
				request.getSession().setAttribute("utype", user.get("utype"));
			} catch (SQLException e) {
				e.printStackTrace();
			} finally {
				if (user.size() > 0) {
					out.write("1");
					out.flush();
					out.close();
				}
			}
		} else if ("exit".equals(method)) {// 退出登录
			request.getSession().removeAttribute("uname");
			request.getSession().removeAttribute("utype");
			request.getSession().removeAttribute("rootpath");
			response.sendRedirect("login.jsp");
		} else if ("index".equals(method)) {// 进入首页
			String uname = (String) session.getAttribute("uname");
			System.out.println(uname);
			String utype = "" + session.getAttribute("utype");
			request.getSession().setAttribute("rootpath", rootpath);
			System.out.println(utype);
			if (utype.equals("1")) {
				request.getRequestDispatcher("index.jsp").forward(request, response);
			} 
		} else if ("updateUsers".equals(method)) {// 修改密码
			String pwd = request.getParameter("pwd");
			String pwd1 = request.getParameter("pwd1");
			System.out.println(pwd);
			System.out.println(pwd1);
			String uname = (String) request.getSession().getAttribute("uname");
			Object[] params = { pwd1, uname };
			try {
				int m = (int) dao.getCount("select count(*) from users where password = ?", pwd);
				if (m > 0) {
					dao.update("update users set password = ? where uname = ?", params);
					out.write("1");
					out.flush();
					out.close();
				} else {
					out.write("2");
					out.flush();
					out.close();
				}
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if ("users".equals(method)) {// 管理员信息
			JSONArray records;
			try {
				records = dao.findJSONArray("select * from users where uname=?", use.getUname());
				request.setAttribute("records", records);
				request.getRequestDispatcher("admin-info.jsp").forward(request, response);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}

	}
}

美食管理控制层:

@WebServlet("/FoodServlet") // 用户类
@MultipartConfig
public class FoodServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	BaseDao dao = new BaseDaoImpl();
	PrintWriter out = null;

	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		response.setContentType("text/html;charset=utf-8");
		// service
		// 方法类-----------------------------------------------------------------------------------------------------
		ObjectService service = new ObjectService();
		FoodEntity foo = service.setObject(request, FoodEntity.class);
		out = response.getWriter();
		// 全局变量类----------------------------------------------------------------------------------------------------------
		String method = request.getParameter("method");
		System.out.println(method);

		if ("foodList".equals(method)) {// 列表
			try {
				JSONArray food = dao
						.findJSONArray("select s.sce_name,f.* from food f left join scenic s on s.sce_id=f.sce_id");
				request.setAttribute("food", food);
				request.getRequestDispatcher("admin-food.jsp").forward(request, response);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if ("searchFood".equals(method)) {// 查询
			try {
				System.out.println(foo.getFooName());
				JSONArray food = dao.findJSONArray(
						"select s.sce_name,f.* from food f left join scenic s on s.sce_id=f.sce_id where f.foo_name like '%"
								+ foo.getFooName() + "%'");
				String sceId = request.getParameter("sceId");
				System.out.println(sceId);
				if (sceId != null && sceId != "") {
					food = dao.findJSONArray(
							"select s.sce_name,f.* from food f left join scenic s on s.sce_id=f.sce_id where f.sce_id="
									+ sceId + " and f.foo_name like '%" + foo.getFooName() + "%'");
				}
				request.setAttribute("food", food);
				request.getRequestDispatcher("admin-food.jsp").forward(request, response);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if ("foodAdd".equals(method)) {// 增加
			Part part = request.getPart("Savatar");
			String heads_url = service.imagepath(part);
			String img_url = heads_url;
			Object[] params = { foo.getFooName(), img_url, foo.getAddress(), foo.getSceId(), foo.getDescription() };
			try {
				int i = dao.update("INSERT INTO food(foo_name,img_url,address,sce_id,description) VALUES(?,?,?,?,?)",
						params);
				if (i > 0) {
					response.sendRedirect("FoodServlet?method=foodList");
				}
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if ("deleteFood".equals(method)) {// 删除
			try {
				int i = dao.update("delete from food where foo_id=?", foo.getFooId());
				if (i > 0) {
					response.sendRedirect("FoodServlet?method=foodList");
				}
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if ("updateFood".equals(method)) {// 修改
			Object[] params = { foo.getFooId() };
			try {
				JSONObject food = dao.findJSONObject(
						"select s.sce_name,f.* from food f left join scenic s on s.sce_id=f.sce_id where f.foo_id = ?",
						params);
				request.setAttribute("food", food);
				request.getRequestDispatcher("admin-foodUpdate.jsp").forward(request, response);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if ("updateFood1".equals(method)) {// 完成修改
			String img_url = null;
			Part part1 = request.getPart("Savatar");
			if (part1.getSize() > 0) {
				String savepath = service.imagepath(part1);
				img_url = savepath;
			} else {
				img_url = foo.getImgUrl();
			}
			Object[] params = { foo.getFooName(), img_url, foo.getAddress(), foo.getSceId(), foo.getDescription(),
					foo.getFooId() };
			try {
				int i = dao.update(
						"update food set foo_name = ?,img_url=?,address=?,sce_id=?,description=? where foo_id=?",
						params);
				if (i > 0) {
					response.sendRedirect("FoodServlet?method=foodList");
				}
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if ("foodCllentList".equals(method)) {// 用户查看列表
			String ctel = (String) request.getSession().getAttribute("ctel");
			try {
				String sql = "select IF(ISNULL(c.ctel),'0','1') count,IF(ISNULL(fo.foo_id),'0',CONVERT( COUNT(*) USING UTF8)) num ,f.* "
						+ "from foo_collect fo " + "left join food f on fo.foo_id=f.foo_id "
						+ "left join cllent c on c.ctel=fo.ctel " + "and c.ctel=? where f.sce_id=? "
						+ "GROUP BY f.foo_id order by num desc";
				JSONArray food = dao.findJSONArray(sql, ctel, foo.getSceId());
				request.setAttribute("food", food);
				request.getRequestDispatcher("food-list.jsp").forward(request, response);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if ("foodCllentSearch".equals(method)) {// 用户搜索列表
			String ctel = (String) request.getSession().getAttribute("ctel");
			try {
				String sql = "select IF(ISNULL(c.ctel),'0','1') count,IF(ISNULL(fo.foo_id),'0',CONVERT( COUNT(*) USING UTF8)) num ,f.* "
						+ "from foo_collect fo " + "left join food f on fo.foo_id=f.foo_id "
						+ "left join cllent c on c.ctel=fo.ctel " + "and c.ctel=" + ctel + " where f.sce_id = "
						+ foo.getSceId() + " and f.foo_name like '%" + foo.getFooName() + "%' "
						+ "GROUP BY f.foo_id order by num desc";
				JSONArray food = dao.findJSONArray(sql);
				request.setAttribute("food", food);
				request.getRequestDispatcher("food-list.jsp").forward(request, response);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if ("detailFood".equals(method)) {// 美食详情
			try {
				JSONObject food = dao.findJSONObject("select * from food where foo_id=?", foo.getFooId());
				request.setAttribute("food", food);
				request.getRequestDispatcher("food-detail.jsp").forward(request, response);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
	}

}

个人信息管理控制层:

@WebServlet("/InforTwo")
@MultipartConfig
public class InformationTwoServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		request.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
		
		BaseDao dao = new BaseDaoImpl();
		ObjectService ob = new ObjectService();
		PrintWriter out = response.getWriter();
		CllentEntity cll = ob.setObject(request, CllentEntity.class);
		File[] files = File.listRoots();
		String rootpath = files[files.length - 1].getPath();
//======================================================================================
		String method = request.getParameter("method");
		System.out.println(method);

		if ("queryInfor".equals(method)) {//查询用户个人信息
			String ctel =""+request.getSession().getAttribute("ctel");
			System.out.println(ctel);
			try {
				String sql = "select * from cllent where ctel="+ctel;
				JSONObject cllent = dao.findJSONObject(sql);
//				System.out.println(cllent);
				request.setAttribute("cllent", cllent);
					request.getRequestDispatcher("information2.jsp").forward(request, response);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}else if ("updateInfor".equals(method)){//修改个人信息
			
			String ctel = ""+ request.getSession().getAttribute("ctel");
			System.out.println(ctel);
			try {
				Object[] params = { cll.getCllName(), cll.getCsex(), cll.getAge(),cll.getIdCode(), ctel };
				int i = dao.update( "update cllent set cll_name=?,csex=?,age=?,id_code=? where ctel=?",
						params);
				if(i>0){
					System.out.println("修改成功");
					String sql = "insert into log(ctel,time,message) values(?,?,?)";
					Object []params1 = {ctel,ob.getNowTime(),"用户["+ctel+"]修改了个人信息"};
					int j = dao.update(sql, params1);
					if(j>0){
						response.sendRedirect("InforTwo?method=queryInfor");
					}else{
					}
				}
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}else if("updatePwd".equals(method)){//修改密码
			String ctel = ""+request.getSession().getAttribute("ctel");
			System.out.println(ctel);
			
			try {
				String pwd = request.getParameter("pwd");
				String Cpwd = request.getParameter("Cpwd");
				String sql = "select * from cllent where ctel="+ctel;
				CllentEntity cllent = dao.findBean(CllentEntity.class,sql);
				if(pwd.equals(cllent.getPassword())){
					int i = dao.update("update cllent set password=? where ctel=?",Cpwd,ctel);
					if(i>0){
						System.out.println("修改密码成功");
						Object[] params1 = {ctel,ob.getNowTime(),"用户["+ctel+"]修改了密码"};
						i = dao.update( "insert into log(ctel,time,message) values(?,?,?)", params1);
						if(i>0){
							System.out.println("增加成功");
						}
					}else{
						System.out.println("修改密码失败");
					}
				}else {
					out.write("原密码错误!");
					out.flush();
					out.close();
				}
				
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
	}

}

景点收藏管理控制层:

@WebServlet("/CollectServlet") // 用户类
@MultipartConfig
public class CollectServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	BaseDao dao = new BaseDaoImpl();
	PrintWriter out = null;

	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		response.setContentType("text/html;charset=utf-8");
		// service
		// 方法类-----------------------------------------------------------------------------------------------------
		ObjectService service = new ObjectService();
		FoodEntity foo = service.setObject(request, FoodEntity.class);
		ScenicEntity sce = service.setObject(request, ScenicEntity.class);
		out = response.getWriter();
		// 全局变量类----------------------------------------------------------------------------------------------------------
		String method = request.getParameter("method");
		System.out.println(method);

		if ("sce_collect".equals(method)) {// 景点收藏
			try {
				String sce_collect = "select count(*) value,s.sce_name name from scenic s "
						+ "join sce_collect sc on s.sce_id = sc.sce_id join cllent c on sc.ctel = c.ctel "
						+ " GROUP BY s.sce_id ORDER BY  value DESC limit 0,15";
				JSONArray scenic = dao.findJSONArray(sce_collect);
				service.outWrite(out, JSON.toJSONString(scenic));
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if ("foo_collect".equals(method)) {// 美食收藏
			try {
				String foo_collect = "select count(*) value,f.foo_name name from food f "
						+ "join foo_collect fc on f.foo_id = fc.foo_id join cllent c on fc.ctel = c.ctel "
						+ "GROUP BY f.foo_id ORDER BY  value DESC limit 0,15";
				JSONArray food = dao.findJSONArray(foo_collect);
				service.outWrite(out, JSON.toJSONString(food));
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if ("deleteFoo".equals(method)) {// 取消美食收藏
			String ctel = (String) request.getSession().getAttribute("ctel");
			Object[] params = { foo.getFooId(), ctel };
			System.out.println(foo.getFooId() + " " + ctel);
			try {
				int a = dao.update("delete from foo_collect where foo_id=? and ctel=?", params);
				if (a > 0) {
					service.outWrite(out, "1");
				} else {
					service.outWrite(out, "2");
				}
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if ("addFoo".equals(method)) {// 美食收藏
			String ctel = (String) request.getSession().getAttribute("ctel");
			Object[] params = { foo.getFooId(), ctel };
			System.out.println(foo.getFooId() + " " + ctel);
			try {
				int a = dao.update("insert into foo_collect(foo_id,ctel) values(?,?)", params);
				if (a > 0) {
					service.outWrite(out, "1");
				} else {
					service.outWrite(out, "2");
				}
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if ("deleteSce".equals(method)) {// 取消美食收藏
			String ctel = (String) request.getSession().getAttribute("ctel");
			Object[] params = { sce.getSceId(), ctel };
			try {
				int a = dao.update("delete from sce_collect where sce_id=? and ctel=?", params);
				if (a > 0) {
					service.outWrite(out, "1");
				} else {
					service.outWrite(out, "2");
				}
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if ("addSce".equals(method)) {// 美食收藏
			String ctel = (String) request.getSession().getAttribute("ctel");
			Object[] params = { sce.getSceId(), ctel };
			try {
				int a = dao.update("insert into sce_collect(sce_id,ctel) values(?,?)", params);
				if (a > 0) {
					service.outWrite(out, "1");
				} else {
					service.outWrite(out, "2");
				}
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if ("collectSec".equals(method)) {// 用户查看景点收藏
			String ctel = (String) request.getSession().getAttribute("ctel");
			try {
				String sce_collect = "select s.* from scenic s join sce_collect sc on s.sce_id = sc.sce_id join cllent c on sc.ctel = c.ctel where sc.ctel=?";
				JSONArray scenic = dao.findJSONArray(sce_collect,ctel);
				request.setAttribute("collect", scenic);
				request.getRequestDispatcher("collectSce-list.jsp").forward(request, response);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if ("collectFoo".equals(method)) {// 美食收藏
			String ctel = (String) request.getSession().getAttribute("ctel");
			try {
				String foo_collect = "select f.* from food f join foo_collect fc on f.foo_id = fc.foo_id join cllent c on fc.ctel = c.ctel where fc.ctel=?";
				JSONArray food = dao.findJSONArray(foo_collect,ctel);
				request.setAttribute("collect", food);
				request.getRequestDispatcher("collectFoo-list.jsp").forward(request, response);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
	}

}

源码获取:俺的博客首页 "资源" 里下载!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
一、项目简介本课程演示的是一套基于SSM实现的旅游管理系统,主要针对计算机相关专业的正在做毕设的学生与需要项目实战练习的Java学习者。课程包含:1. 项目源码、项目文档、数据库脚本、软件工具等所有资料2. 带你从零开始部署运行本套系统3. 该项目附带的源码资料可作为毕设使用4. 提供技术答疑二、技术实现后台框架:SpringSpringMVC、MyBatisUI界面:JSP、jQuery 、BootStrap数据库:MySQL 三、系统功能本系统分为前台旅游界面和后台管理,包含三种角色:注册用户、旅游公司和管理员系统的功能模块如下: 1.登陆注册模块 管理员的登录模块:管理员登录系统对本系统其他管理模块进行管理。 用户的登录模块:用户登录本系统,对个人的信息等进行查询,操作可使用的功能。 用户注册模块:游客用户可以进行用户注册,系统会反馈是否注册成功。 添加管理员模块:向本系统中添加更多的管理人员,管理员包括普通管理员和超级管理员。 2.景点信息管理模块: 景点信息列表:将数据库的景点信息表以列表的形式呈现给管理员。 添加景点信息:实现管理员添加景点信息。 修改景点信息:实现管理员修改景点信息。 3.公告文章管理模块: 公告文章列表:将数据库的公告文章表以列表的形式呈现给管理员。 添加公告文章:实现管理员添加公告文章。 修改公告文章:实现管理员修改公告文章。 4.旅游线路管理模块: 旅游线路列表:显示系统的所有旅游线路,可以通过关键字查询。 旅游线路删除:对输入错误或过期的旅游线路删除。 5.变幻图管理模块: 变幻图列表:显示系统的所有变幻图,可以通过关键字查询。 变幻图删除:对输入错误或过期的变幻图删除。 6.用户模块: 资料管理:用户登录本系统。可以对自己的个人主页进行查看。 系统信息:用户可以查看自己的系统提示信息。 修改资料:用户可以修改自己的账号密码。 信息搜索:用户可以通过关键字搜索站内信息。 密码修改:用户可以修改个人登录密码。 7.系统管理模块 8.退出模块该系统功能完善、界面美观、操作简单、功能齐全、管理便捷,具有很高的实际应用价值。四、项目截图1)前台首页2)旅游景点详情3)旅游线路报名4)系统后台登陆5)后台管理界面  更多Java毕设项目请关注【毕设系列课程】https://edu.csdn.net/lecturer/2104   

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

OldWinePot

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

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

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

打赏作者

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

抵扣说明:

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

余额充值