基于javaweb的SSM博物馆售票管理系统(java+ssm+jsp+jquery+ajax+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

460023332402

470023332402

480023332402

490023332402

500023332402

510023332402

基于javaweb的SSM博物馆售票管理系统(java+ssm+jsp+jquery+ajax+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项目:否;

技术栈

  1. 后端:Spring+SpringMVC+Mybatis 2. 前端:JSP+css+javascript+jQuery+Ajax

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中springmvc-servlet.xml配置文件中的数据库配置改为自己的配置; 4. 运行项目,在浏览器中输入http://localhost:8080/ssm_bwgsp_sys 登录

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
	if (cond != null) {
if ("usersid".equals(cond)) {
rebbs.setUsersid(name);
}
if ("bbsid".equals(cond)) {
rebbs.setBbsid(name);
}
if ("contents".equals(cond)) {
rebbs.setContents(name);
}
if ("addtime".equals(cond)) {
rebbs.setAddtime(name);
}
}

List<String> nameList = new ArrayList<String>();
List<String> valueList = new ArrayList<String>();
nameList.add(cond);
valueList.add(name);
PageHelper.getPage(this.rebbsService.getRebbsByLike(rebbs), "rebbs", nameList, valueList, 10, number, this.getRequest(), "query");
name = null;
cond = null;
return "admin/queryrebbs";
}

// 按主键查询数据
@RequestMapping("getRebbsById.action")
public String getRebbsById(String id) {
Rebbs rebbs = this.rebbsService.getRebbsById(id);
this.getRequest().setAttribute("rebbs", rebbs);
List<Users> usersList = this.usersService.getAllUsers();
this.getRequest().setAttribute("usersList", usersList);
List<Bbs> bbsList = this.bbsService.getAllBbs();
this.getRequest().setAttribute("bbsList", bbsList);
return "admin/editrebbs";
}

public RebbsService getRebbsService() {
return rebbsService;
}

public void setRebbsService(RebbsService rebbsService) {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
if (number == null) {
number = "0";
}
int start = Integer.parseInt(number) * 10;
int over = (Integer.parseInt(number) + 1) * 10;
int count = pageNumber - over;
if (count <= 0) {
over = pageNumber;
}
for (int i = start; i < over; i++) {
Object obj = list.get(i);
objList.add(obj);
}
buffer.append("&nbsp;&nbsp;共为");
buffer.append(maxPage);
buffer.append("页&nbsp; 共有");
buffer.append(pageNumber);
buffer.append("条&nbsp; 当前为第");
buffer.append((Integer.parseInt(number) + 1));
buffer.append("页 &nbsp;");
if ((Integer.parseInt(number) + 1) == 1) {
buffer.append("首页");
} else {
buffer.append("<a href=\"" + name + "/" + action + "?number=0\">首页</a>");
}
buffer.append("&nbsp;&nbsp;");
if ((Integer.parseInt(number) + 1) == 1) {
buffer.append("上一页");
} else {
buffer.append("<a href=\"" + name + "/" + action + "?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>");
}
buffer.append("&nbsp;&nbsp;");
if (maxPage <= (Integer.parseInt(number) + 1)) {
buffer.append("下一页");
} else {
buffer.append("<a href=\"" + name + "/" + action + "?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>");
}
buffer.append("&nbsp;&nbsp;");
if (maxPage <= (Integer.parseInt(number) + 1)) {
buffer.append("尾页");
} else {
buffer.append("<a href=\"" + name + "/" + action + "?number=" + (maxPage - 1) + "\">尾页</a>");
}
String html = buffer.toString();
request.setAttribute("html", html);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

List<String> nameList = new ArrayList<String>();
List<String> valueList = new ArrayList<String>();
nameList.add(cond);
valueList.add(name);
PageHelper.getPage(this.itemsService.getItemsByLike(items), "items", nameList, valueList, 10, number, this.getRequest(), "query");
name = null;
cond = null;
return "admin/queryitems";
}

// 按主键查询数据
@RequestMapping("getItemsById.action")
public String getItemsById(String id) {
Items items = this.itemsService.getItemsById(id);
this.getRequest().setAttribute("items", items);
List<Venue> venueList = this.venueService.getAllVenue();
this.getRequest().setAttribute("venueList", venueList);
List<Ticket> ticketList = this.ticketService.getAllTicket();
this.getRequest().setAttribute("ticketList", ticketList);
return "admin/edititems";
}

public ItemsService getItemsService() {
return itemsService;
}

public void setItemsService(ItemsService itemsService) {
this.itemsService = itemsService;
}

}
package com.action;


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
@Autowired
@Resource
private ItemsService itemsService;
@Autowired
@Resource
private VenueService venueService;
@Autowired
@Resource
private TicketService ticketService;

// 准备添加数据
@RequestMapping("createItems.action")
public String createItems() {
List<Venue> venueList = this.venueService.getAllVenue();
this.getRequest().setAttribute("venueList", venueList);
List<Ticket> ticketList = this.ticketService.getAllTicket();
this.getRequest().setAttribute("ticketList", ticketList);
return "admin/additems";
}

// 添加数据
@RequestMapping("addItems.action")
public String addItems(Items items) {
this.itemsService.insertItems(items);
return "redirect:/items/createItems.action";
}

// 通过主键删除数据
@RequestMapping("deleteItems.action")
public String deleteItems(String id) {
this.itemsService.deleteItems(id);
return "redirect:/items/getAllItems.action";
}

// 批量删除数据
@RequestMapping("deleteItemsByIds.action")
public String deleteItemsByIds() {
String[] ids = this.getRequest().getParameterValues("itemsid");
for (String itemsid : ids) {
this.itemsService.deleteItems(itemsid);
}
return "redirect:/items/getAllItems.action";
}

// 更新数据
@RequestMapping("updateItems.action")
public String updateItems(Items items) {
this.itemsService.updateItems(items);
return "redirect:/items/getAllItems.action";
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38


//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/admin", produces = "text/plain;charset=utf-8")
public class AdminAction extends BaseAction {
// 注入Service 由于标签的存在 所以不需要getter setter
@Autowired
@Resource
private AdminService adminService;

// 管理员登录 1 验证用户名是否存在 2 验证密码是否正确
@RequestMapping("login.action")
public String login() {
String username = this.getRequest().getParameter("username");
String password = this.getRequest().getParameter("password");
Admin adminEntity = new Admin();
adminEntity.setUsername(username);
List<Admin> adminlist = this.adminService.getAdminByCond(adminEntity);
if (adminlist.size() == 0) {
this.getRequest().setAttribute("message", "用户名不存在");
return "admin/index";
} else {
Admin admin = adminlist.get(0);
if (password.equals(admin.getPassword())) {
this.getSession().setAttribute("adminid", admin.getAdminid());
this.getSession().setAttribute("adminname", admin.getUsername());
this.getSession().setAttribute("realname", admin.getRealname());
this.getSession().setAttribute("role", admin.getRole());
} else {
this.getRequest().setAttribute("message", "密码错误");
return "admin/index";
}
}
return "admin/main";
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

// 按主键查询数据
@RequestMapping("getUsersById.action")
public String getUsersById(String id) {
Users users = this.usersService.getUsersById(id);
this.getRequest().setAttribute("users", users);
return "admin/editusers";
}

public UsersService getUsersService() {
return usersService;
}

public void setUsersService(UsersService usersService) {
this.usersService = usersService;
}

}
package com.action;



//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/article", produces = "text/plain;charset=utf-8")
public class ArticleAction extends BaseAction {
// 注入Service 由于标签的存在 所以不需要getter setter
@Autowired
@Resource
private ArticleService articleService;

// 准备添加数据
@RequestMapping("createArticle.action")
public String createArticle() {
return "admin/addarticle";
}

// 添加数据
@RequestMapping("addArticle.action")
public String addArticle(Article article) {
article.setAddtime(VeDate.getStringDateShort());
article.setHits("0");
this.articleService.insertArticle(article);


项目链接:
https://javayms.github.io?id=061422312105200ho
https://javayms.pages.dev?id=061422312105200ho