基于javaweb+mysql的ssm旅游综合服务管理系统(java+ssm+jsp+bootstrap+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM旅游综合服务管理系统(java+ssm+jsp+bootstrap+mysql)
项目介绍
本项目分为管理员与用户两种角色; 管理员角色包含以下功能: 管理员登录,发布资讯,资讯管理,添加景点,景点管理,查看会员信息,添加酒店,酒店管理,添加路线,路线管理,管理网站信息,路线预定管理,酒店预定管理等功能。
用户角色包含以下功能: 查看首页,修改个人信息,查看首页,查看旅游景点,预定酒店,修改用户信息,修改密码,预定客房,查看旅游攻略,查看旅游资讯等功能。
环境需要
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项目:否;
技术栈
- 后端:Spring+SpringMVC+Mbytes 2. 前端:JSP+css+javascript+bootstrap+jQuery
使用说明
- 使用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
}
String result = new JSONObject(map).toString();
ResponseUtil.write(response, result);
return null;
}
}
@Controller
@RequestMapping("/jin")
public class JinController {
private JinService jinService;
public JinService getJinService() {
return jinService;
}
@Autowired
public void setJinService(JinService jinService) {
this.jinService = jinService;
}
@Autowired
private ClientService clientService;
@Autowired
private JinPingService jinpingService;
@Autowired
private HttpServletRequest request;
@Controller
@RequestMapping("/roomding")
public class RoomDingController {
private RoomDingService roomdingService;
public RoomDingService getRoomDingService() {
return roomdingService;
}
@Autowired
private RoomService roomService;
@Autowired
private HotelService hotelService;
@Autowired
if(r>0)
{
map.put("mgf", "删除成功");
map.put("success", true);
}
else
{
map.put("mgf", "删除失败");
map.put("success", false);
}
} 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("client");
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;
}
}
@Controller
@RequestMapping("/client")
public class ClientController {
private ClientService clientService;
public ClientService getClientService() {
return clientService;
}
@Autowired
public void setClientService(ClientService clientService) {
this.clientService = clientService;
}
@Autowired
private HttpServletRequest request;
@Autowired
private HttpServletResponse response;
@SuppressWarnings("finally")
@RequestMapping("/reg")
public String add() {
return "reg";
}
@SuppressWarnings("finally")
@RequestMapping("/pwd")
public String pwd() {
Client c=(Client)request.getSession().getAttribute("client");
request.setAttribute("client", c);
return "editpass";
}
@SuppressWarnings("finally")
else
html="<a style='' href='"+pagename+"startindex=0'>首页</a><a style='' href='"+pagename+"startindex="+Integer.toString(startindex-1)+"'>上一页</a>";
if(sumcount-1==startindex)//判断是否是最后一页
html+="<a style=''>下一页</a><a style=''>尾页</a>";
else
html+="<a style='' href='"+pagename+"startindex="+Integer.toString(startindex+1)+"'>下一页</a><a style='' href='"+pagename+"startindex="+Integer.toString(sumcount-1)+"'>尾页</a>";
return html;
}
}
/**
* 一些公用的方法
*
*
*/
public class CommonUtils {
/**
* 获得32位的UUID
*
* @return
*/
public static String getUUID() {
String uuid = UUID.randomUUID().toString().replace("-", "");
return uuid;
}
/**
* 获得当前时间返回字符串
*
*/
public static String getNowTime() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return df.format(new Date()).toString();
}
}
Client c=clientService.GetByID(list.get(i).getClinetId());
Jin jin=jinService.GetByID(list.get(i).getJinId());
list.get(i).setClient(c);
list.get(i).setJin(jin);
}
m.addAttribute("jin_list",list);
return "jinshow";
} catch (Exception e) {
return null;
}
}
@SuppressWarnings("finally")
@RequestMapping(value="/jin_del", method = RequestMethod.POST)
public String Del(@RequestParam(value = "id") int id) {
Map<String,Object> map = new HashMap<String,Object>();
try {
System.out.println("================================");
System.out.println(id);
int r = jinService.Del(id);
if(r>0)
{
map.put("mgf", "删除成功");
map.put("success", true);
}
else
{
map.put("mgf", "删除失败");
map.put("success", false);
}
} catch (Exception e) {
map.put("mgf", "错误:"+e.getMessage());
map.put("success", false);
}
String result = new JSONObject(map).toString();
ResponseUtil.write(response, result);
return null;
}
}
public class QiuTypeController {
private QiuTypeService qiutypeService;
public QiuTypeService getQiuTypeService() {
return qiutypeService;
}
@Autowired
public void setQiuTypeService(QiuTypeService qiutypeService) {
this.qiutypeService = qiutypeService;
}
@Autowired
private HttpServletRequest request;
@Autowired
private HttpServletResponse response;
@SuppressWarnings("finally")
@RequestMapping("/add")
public String add() {
return "admin/addqiutype";
}
@SuppressWarnings("finally")
@RequestMapping("/qiutype_add")
public String add(QiuType q) {
Map<String,Object> map = new HashMap<String,Object>();
try {
System.out.println(q);
String id=request.getParameter("id").trim().length()==0?"0":request.getParameter("id");
q.setId(Integer.parseInt(id));
int count=0;
if(q.getId()==0)
count = qiutypeService.Add(q);
else
count=qiutypeService.Edit(q);
if(count>0)
{
map.put("mgf", "操作成功");
map.put("success", true);
}
else
{
map.put("mgf", "操作失败");
map.put("success", false);
}
} catch (Exception e) {
map.put("mgf", "错误:"+e.getMessage());
map.put("success", false);
}
String result = new JSONObject(map).toString();
@RequestMapping("/web_list")
public String Get2(Hotel h) {
//分页参数设置
Pages p=new Pages();
p.setPagesize(10);//每页显示数量
int startindex=request.getParameter("startindex")==null?0:Integer.parseInt(request.getParameter("startindex"));//起始页,默认从第1页开始读
p.setStartindex(startindex);
h.setPage(p);
try {
List<Hotel> list = hotelService.Get(h);
System.out.println(list);
request.setAttribute("list", list);
//分页
request.setAttribute("pages", PageList.Page(request,"hotel/hotel_list.do", hotelService.GetCount(h),
p.getPagesize(), p.getStartindex(),request.getQueryString()));
return "hotel";
} catch (Exception e) {
return null;
}
}
@RequestMapping("/hotel_messhow")
public String GetByID() {
try {
int id=Integer.parseInt(request.getParameter("id"));
Hotel h = hotelService.GetByID(id);
request.setAttribute("hotel", h);
return "admin/addhotel";
} catch (Exception e) {
return null;
}
}
@SuppressWarnings("finally")
@RequestMapping(value="/hotel_del", method = RequestMethod.POST)
public String Del(@RequestParam(value = "id") int id) {
Map<String,Object> map = new HashMap<String,Object>();
try {
System.out.println("================================");
}
}
@Controller
@RequestMapping("/introduce")
public class IntroduceController {
private IntroduceService introduceService;
public IntroduceService getIntroduceService() {
return introduceService;
}
@Autowired
public void setIntroduceService(IntroduceService introduceService) {
this.introduceService = introduceService;
}
@Autowired
private HttpServletRequest request;
@Autowired
private HttpServletResponse response;
@SuppressWarnings("finally")
@RequestMapping("/introduce_add")
public String add(Introduce intr) {
Map<String,Object> map = new HashMap<String,Object>();
try {
System.out.println(request.getParameter("login"));
intr.setContent(request.getParameter("content"));
String id=request.getParameter("id").trim().length()==0?"0":request.getParameter("id");
intr.setId(Integer.parseInt(id));
public LineService getLineService() {
return lineService;
}
@Autowired
public void setLineService(LineService lineService) {
this.lineService = lineService;
}
@Autowired
private HttpServletRequest request;
@Autowired
private HttpServletResponse response;
@SuppressWarnings("finally")
@RequestMapping("/add")
public String add() {
return "admin/addline";
}
@SuppressWarnings("finally")
@RequestMapping("/line_add")
public String add(Line l) {
Map<String,Object> map = new HashMap<String,Object>();
try {
System.out.println(l);
String id=request.getParameter("id").trim().length()==0?"0":request.getParameter("id");
l.setId(Integer.parseInt(id));
l.setLine(request.getParameter("line"));//使用编辑器只能原始获取
int count=0;
if(l.getId()==0)
count = lineService.Add(l);
else
count=lineService.Edit(l);
if(count>0)
{
map.put("mgf", "操作成功");
map.put("success", true);
}
else
{
map.put("mgf", "操作失败");
map.put("success", false);
@SuppressWarnings("finally")
@RequestMapping(value="/jinping_add", method = RequestMethod.POST)
public String add(JinPing jp) {
Map<String,Object> map = new HashMap<String,Object>();
try {
if(request.getSession().getAttribute("client")==null)
{
map.put("mgf", "您尚未登陆");
map.put("success", false);
String result = new JSONObject(map).toString();
ResponseUtil.write(response, result);
return null;
}
System.out.println(jp.getContent());
Client c=(Client)request.getSession().getAttribute("client");
jp.setClinetId(c.getId());
jp.setContent(request.getParameter("content"));
jp.setJinId(Integer.parseInt(request.getParameter("id")));
int count = jinpingService.Add(jp);
if(count>0)
{
map.put("mgf", "点评成功");
map.put("success", true);
}
else
{
map.put("mgf", "点评失败");
map.put("success", false);
}
} 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("/my_list")
public String GetByClientID() {
try {
Client c=(Client)request.getSession().getAttribute("client");
System.out.println("================================");
System.out.println(id);
//int id=Integer.parseInt(request.getParameter("id"));
int r = jinpingService.Del(id);
if(r>0)
{
map.put("mgf", "删除成功");
map.put("success", true);
}
else
{
map.put("mgf", "删除失败");
map.put("success", false);
}
} catch (Exception e) {
map.put("mgf", "错误:"+e.getMessage());
map.put("success", false);
}
String result = new JSONObject(map).toString();
ResponseUtil.write(response, result);
return null;
}
}
@SuppressWarnings("finally")
@RequestMapping(value="/jin_del", method = RequestMethod.POST)
public String Del(@RequestParam(value = "id") int id) {
Map<String,Object> map = new HashMap<String,Object>();
try {
System.out.println("================================");
System.out.println(id);
int r = jinService.Del(id);
if(r>0)
{
map.put("mgf", "删除成功");
map.put("success", true);
}
else
{
map.put("mgf", "删除失败");
map.put("success", false);
}
} catch (Exception e) {
map.put("mgf", "错误:"+e.getMessage());
map.put("success", false);
}
String result = new JSONObject(map).toString();
ResponseUtil.write(response, result);
return null;
}
}
Map<String,Object> map = new HashMap<String,Object>();
try {
Client c=(Client)request.getSession().getAttribute("client");
c.setPwd(request.getParameter("pwd"));
int r=clientService.EditPass(c);
if(r>0)
{
map.put("mgf", "密码修改成功,下次请用新密码登陆");
map.put("success", true);
request.getSession().setAttribute("client", c);
}
else
{
map.put("mgf", "密码修改失败");
map.put("success", false);
}
} 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("/client_list")
public String Get(Client c) {
//分页参数设置
Pages p=new Pages();
p.setPagesize(10);//每页显示数量
int startindex=request.getParameter("startindex")==null?0:Integer.parseInt(request.getParameter("startindex"));//起始页,默认从第1页开始读
p.setStartindex(startindex);
c.setPage(p);
try {
List<Client> list = clientService.Get(c);
System.out.println(list);
request.setAttribute("list", list);
//分页
request.setAttribute("pages", PageList.Page(request,"client/client_list.do", clientService.GetCount(c),
p.getPagesize(), p.getStartindex(),request.getQueryString()));
return "admin/client";
} catch (Exception e) {
return null;
}
}
@RequestMapping("/showmes")
public String GetByID() {
try {
int id=Integer.parseInt(request.getParameter("id"));
Client c = clientService.GetByID(id);
request.setAttribute("client", c);
Map<String,Object> map = new HashMap<String,Object>();
try {
System.out.println("================================");
System.out.println(id);
//int id=Integer.parseInt(request.getParameter("id"));
int r = hotelService.Del(id);
if(r>0)
{
map.put("mgf", "删除成功");
map.put("success", true);
}
else
{
map.put("mgf", "删除失败");
map.put("success", false);
}
} catch (Exception e) {
map.put("mgf", "错误:"+e.getMessage());
map.put("success", false);
}
String result = new JSONObject(map).toString();
ResponseUtil.write(response, result);
return null;
}
}
}
} 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("/qiutype_list")
public String Get() {
try {
List<QiuType> list = qiutypeService.Get();
System.out.println(list);
request.setAttribute("list", list);
return "admin/qiutype";
} catch (Exception e) {
return null;
}
}
@RequestMapping("/web_list")
public String Get2() {
try {
List<QiuType> list = qiutypeService.Get();
System.out.println(list);
request.setAttribute("list", list);
return "qiutype";
} catch (Exception e) {
return null;
}
}
@RequestMapping("/qiutype_messhow")
public String GetByID() {
try {
int id=Integer.parseInt(request.getParameter("id"));
QiuType q = qiutypeService.GetByID(id);
request.setAttribute("qiutype", q);
return "admin/addqiutype";
} catch (Exception e) {
return null;
}
}
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("client");
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;
}
}