作者主页:夜未央5788

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

本项目分为管理员与用户两种角色;
管理员角色包含以下功能:
管理员登录,发布资讯,资讯管理,添加景点,景点管理,查看会员信息,添加酒店,酒店管理,添加路线,路线管理,管理网站信息,路线预定管理,酒店预定管理等功能。

用户角色包含以下功能:
查看首页,修改个人信息,查看首页,查看旅游景点,预定酒店,修改用户信息,修改密码,预定客房,查看旅游攻略,查看旅游资讯等功能。

环境需要

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

技术栈

1. 后端:Spring+SpringMVC+Mbytes
2. 前端:JSP+css+javascript+bootstrap+jQuery

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中config-jdbc.properties配置文件中的数据库配置改为自己的配置;
4. 运行项目,在浏览器中输入localhost:8080/ssm_lvyou_fuwu
用户账号/密码: user/123456
管理员账号/密码:admin/admin

运行截图

用户角色


 

 

 

 

 

 

管理员角色 

 

 

 

 

 

 

相关代码 

 管理员管理Controller类

@Controller
public class AdminController {
	private AdminService adminService;
	@Autowired
	private IntroduceService introduceService;
	@Autowired
	private JinService jinService;
	@Autowired
	private LineService lineService;
	@Autowired
	private QiuTypeService qiutypeService;
 

	public AdminService getAdminService() {
		return adminService;
	}

	@Autowired
	public void setAdminService(AdminService adminService) {
		this.adminService = adminService;
	}

	@Autowired
	private HttpServletRequest request;
	@Autowired
	private HttpServletResponse response;
	

	
	
	@RequestMapping("login")
	public String Login(Admin admin) {
		Map<String,Object> map = new HashMap<String,Object>();
		try {
			Admin a = adminService.Login(admin.getLogin());
			System.out.println(admin);
			if(a==null)
			{
				map.put("mgf", "用户不存在");
				map.put("success", false);
			}
			else if(!a.getPwd().equals(admin.getPwd()))
			{
				map.put("mgf", "密码错误");
				map.put("success", false);
			}
			else
			{
				request.getSession().setAttribute("admin", a);
				map.put("mgf", "验证通过!");
				map.put("success", true);
			}
		} catch (Exception e) {
			map.put("mgf", "错误:"+e.getMessage());
			map.put("success", false);
		} 
		String result = new JSONObject(map).toString();
		ResponseUtil.write(response, result);
		return null;
	}

	
	@RequestMapping("/exit")
	public String Exit() {
		Map<String,Object> map = new HashMap<String,Object>();
		try {
			request.getSession().removeAttribute("admin");
			map.put("mgf", "已安全退出!");
			map.put("success", true);
		} catch (Exception e) {
			map.put("mgf", "错误:"+e.getMessage());
			map.put("success", false);
		} 
		String result = new JSONObject(map).toString();
		ResponseUtil.write(response, result);
		return null;
	}
	
	@RequestMapping("/tui")
	public String tui(Model model) {
		Pages p=new Pages();
		p.setPagesize(6);
		Jin j=new Jin();
		j.setPage(p);
		Line l=new Line();
		l.setPage(p);
		List<Jin> jin = jinService.Get(j);
		Introduce intr = introduceService.GetByID(1);
		List<Line> ls = lineService.Get(l);
		model.addAttribute("jin", jin);
		model.addAttribute("intr", intr);
		request.getSession().setAttribute("left_line", ls);
		request.getSession().setAttribute("top_qiutype", qiutypeService.Get());
		return "index";
	}
}

源码获取

如果也想学习本系统,下面领取。回复:226ssm

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐