影票在线预订系统
电子商务带领传统行业进入了新的发展时代,“互联网+”模式使传统的电影 院焕发了新的生命力。电影票在线预订系统是电子商务与传统影院销售模式的一 种融合,将票务销售和影院管理转移到网络上进行,方便用户及时方便的查询和 预定票务信息。与传统的影院人工购票不同,电影票在线销售系统能够提供高效, 稳定,方便的购票体验。不仅减少了人工统计出错和低效的问题,而且可以通过 大量的数据统计获取用户对于影片的喜好程度,影院可以根据这些信息进行更合 理的排片计划。
本文探讨和设计了一个电影票在线销售系统,整个系统的设计大体可以分为 三个部分,用户功能,客服功能和管理员管理的功能。用户部分涉及到用户的注册登录,选购 影院,影片和座位以及在线支付的功能。后台管理部分为管理员管理的功能,主 要包括对普通管理员的权限分配,影片、影厅、购票管理,统计影片信息,用户 信息管理等功能。系统充分实现了一个普通用户购买映票的整个过程,其中包括 了支付等环节,以及其相对应的可能涉及到的退款等操作。
本系统在设计上使用了目前较为流行的 JAVAWEB 技术,综合了SSM bootstrap等框架进行设计,通过 Maven 项目管理工具对项目进行 构建,使用开源免费的MySQL数据库作为持久化存储,并使用了 JDBC开源框架作为数据库的连接池,前台采用了目前较为流行的bootstrap框架进快速开发,系统开发的集成开发环境选取 了目前较为流行的Java开发环境Intellij IDEA。整个系统采用分层设计的思 想,每层独立其功能和设计,通过Spring管理各个层之间的依赖和注入关系等。 在设计上使用了 MVC的设计模式,将逻辑层与展示层进行分离,通过控制层来实现逻辑的映射关系。
本文讲述了影票预订系统目前的发展现状以及国内外的情况,在此基础上对 系统进行需求分析和设计。侧重于对系统的分析与设计,在分析基础之上对系统 的模块进行了划分,并按照需求设计进行了要求进行了网上的设计。
关键字:影票预订,JAVAWEB,电子商务,SSM框架
【582】基于ssm电影购票系统源码和论文
Abstract
Movie ticket online booking System
E-commerce has led the traditional industry into a new development era. The "Internet +" mode has given new vitality to the traditional cinema. The online booking system for movie tickets is a combination of e-commerce and traditional cinema sales mode. It transfers ticket sales and Cinema Management to the network, and facilitates users to query and book ticket information in a timely and convenient manner. Unlike the traditional manual ticket purchase in cinemas, the online ticket sales system can provide an efficient, stable and convenient ticket purchase experience. It not only reduces the error and inefficiency of manual statistics, but also can obtain the user's preference for movies through a large number of data statistics, and the cinema can make a more reasonable film arrangement plan according to this information.
This paper discusses and designs a movie ticket online sales system. The design of the whole system can be divided into three parts: user function, customer service function and administrator management function. The user part involves the registration and login of users, the purchase of cinemas, movies and seats, and the online payment function. The background management part is the function of administrator management, mainly including the authority allocation to ordinary administrators, film, cinema, ticket purchase management, statistical film information, user information management and other functions. The system fully realizes the entire process of an ordinary user's purchase of movie tickets, including payment and other links, as well as the corresponding possible refund and other operations.
In the design of this system, the current popular JavaWeb technology is used, the SSM bootstrap and other frameworks are integrated for design, the project is built by Maven project management tool, the open source and free MySQL database is used as the persistent storage, and the JDBC open source framework is used as the connection pool of the database. The foreground uses the current popular bootstrap framework for rapid development, The integrated development environment for system development is IntelliJ idea, which is a popular java development environment. The whole system adopts the idea of layered design, each layer is independent of its function and design, and the dependency and injection relationship between each layer are managed through spring. The MVC design pattern is used in the design, which separates the logic layer from the display layer, and realizes the logical mapping relationship through the control layer.
This paper describes the current development of the movie ticket reservation system and the situation at home and abroad, and on this basis, the system needs analysis and design. It focuses on the analysis and design of the system. On the basis of the analysis, the modules of the system are divided, and the online design is carried out according to the requirements of the demand design.
Keywords: movie ticket booking, JavaWeb, e-commerce, SSM framework
package com.mecol.film.controller;
import com.alibaba.fastjson.JSON;
import com.mecol.film.entity.Film;
import com.mecol.film.entity.Play;
import com.mecol.film.entity.Ticket;
import com.mecol.film.entity.Users;
import com.mecol.film.mapper.TestDao;
import com.mecol.film.pojo.Tic;
import com.mecol.film.pojo.UserPojo;
import com.mecol.film.service.FilmService;
import com.mecol.film.service.PlayService;
import com.mecol.film.service.TicketService;
import com.mecol.film.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
public class ReceptionController {
@Autowired
private UserService userService;
@Autowired
private FilmService filmService;
@Autowired
private PlayService playService;
@Autowired
private TicketService ticketService;
//首页 8080/film 打开电影首页
@RequestMapping("/")
public String index(@ModelAttribute Users user, HttpServletRequest request, Model model){
HttpSession session=request.getSession();
user= (Users) session.getAttribute("user");
Map<String,Object> map =filmService.list(1,8);
model.addAttribute("map",map);
/// System.out.println(user);
if (user!=null){
model.addAttribute("user",user);
}
/*
else {
Users u = new Users();
u.setUserName("1");
model.addAttribute("userb", u);
}*/
return "user/home";
}
@RequestMapping("/list")
public ModelAndView List(){
ModelAndView modelAndView=new ModelAndView("user/listfilm");
//每页显示8部电影
Map<String,Object> map= filmService.list(1,8);
modelAndView.addObject("map",map);
return modelAndView;
}
@RequestMapping("/filmlist")
public ModelAndView filmList(Integer page){
ModelAndView modelAndView=new ModelAndView("user/listfilm");
//从第page开始 再选出8个 如果有的话
Map<String,Object> map= filmService.list(page,8);
modelAndView.addObject("map",map);
return modelAndView;
}
//电影详情
@RequestMapping("/filma")
public String film(Integer filmId,Users user,HttpServletRequest request,Model model){
HttpSession session=request.getSession();
user= (Users) session.getAttribute("user");
model.addAttribute("user",user);
Film film=filmService.film(filmId);
model.addAttribute("film",film);
// System.out.println(film);
return "user/film";
}
/**
* 购票界面
*/
@RequestMapping("/goupiao")
public String goupiao(Integer filmId,Users user,
HttpServletRequest request,
Model model){
HttpSession session=request.getSession();
user= (Users) session.getAttribute("user");
model.addAttribute("user",user);
List<Play> list=playService.filmById(filmId);
if (list.size()!=0) {
model.addAttribute("list", list);
Play play = playService.playById(list.get(0).getPlayId());
// System.out.println("a"+play);
model.addAttribute("play", play);
return "user/goupiao";
}
else {
Film film=filmService.film(filmId);
model.addAttribute("film",film);
return "user/noPlay"; //没有档期 没有排档期
}
}
/**
* 跟换排期
*/
@RequestMapping("/goupiao2")
public String goupiao2(Integer playId,Users user,HttpServletRequest request,Model model){
HttpSession session=request.getSession();
user= (Users) session.getAttribute("user");
model.addAttribute("user",user);
Play play=playService.playById(playId);
model.addAttribute("play",play);
List<Play> list=playService.filmById(play.getFilm().getFilmId());
model.addAttribute("list",list);
model.addAttribute("index",playId);
return "user/goupiao";
}
/**
* 登录
*/
@RequestMapping("/login")
@ResponseBody
public Users login(Users users, HttpServletRequest request){
Users user= null;
user = userService.login(users,request);
// System.out.println(user);
if (user!=null){
HttpSession session=request.getSession();
session.setAttribute("user",user);
// System.out.println(session.getAttribute("user"));
return user;
}else{
Users users1=new Users();
users1.setUserId(0); //创造一个假的 说明数据库中没有这个 前端用
return users1;
}
}
/**
* 用户退出
*/
@RequestMapping("/tui")
@ResponseBody
public String tui(HttpServletRequest request){
HttpSession session=request.getSession();
session.removeAttribute("user");
return "";
}
/**
* 购买电影票
*/
@RequestMapping(value = "/goumai",method = RequestMethod.POST)
@ResponseBody
public Integer goumai(Tic tic, HttpServletRequest request){
HttpSession session=request.getSession();
Users user= (Users) session.getAttribute("user");
tic.setUserId(user.getUserId());
// System.out.println(tic);
int a=ticketService.add(tic,user);
return a;
}
/**
* 影城介绍
*/
@RequestMapping("/we")
public String we(@ModelAttribute Users user, HttpServletRequest request,Model model){
HttpSession session=request.getSession();
user= (Users) session.getAttribute("user");
System.out.println(user);
if (user!=null){
model.addAttribute("user",user);
}else {
Users u = new Users();
u.setUserName("1");
model.addAttribute("userb", u);
}
return "user/jies";
}
@RequestMapping("/mohu")
public String mohu(String name,Integer page,Model model){
Map map=filmService.mohu(name,page);
model.addAttribute("map",map);
return "user/listfilm";
}
@RequestMapping("/personal")
public String personal(Integer page,HttpServletRequest request,Model model){
Users users=new Users();
HttpSession session=request.getSession();
users= (Users) session.getAttribute("user");
//System.out.println(users);
if (page==null){
page=1;
}
if (users!=null){
/*修改完后时实更新*/
Map<String,Object> map=ticketService.userList(page,users.getUserId());
model.addAttribute("map",map);
/*model.addAttribute("user",users);*/
Users u=userService.upLogin(users,request);
session.setAttribute("user",u);
model.addAttribute("user",session.getAttribute("user"));
}else{
Map<String,Object> map=new HashMap<String, Object>();
map.put("pages",0);
map.put("pageNum",0);
model.addAttribute("map",map);
}
return "user/personal";
}
@RequestMapping(value = "/update",method = RequestMethod.POST)
public String update(UserPojo userPojo, HttpServletRequest request){
Users users=new Users();
HttpSession session=request.getSession();
users= (Users) session.getAttribute("user");
userPojo.setUserId(users.getUserId());
userService.update(userPojo,request);
return "redirect:/personal";
}
@RequestMapping(value = "/updateMoney",method = RequestMethod.POST)
public String updateMoney(UserPojo userPojo, HttpServletRequest request){
Users users=new Users();
HttpSession session=request.getSession();
users= (Users) session.getAttribute("user");
userPojo.setUserId(users.getUserId());
userService.updateMoney(userPojo,request);
return "redirect:/personal";
}
/**
*已被购买的
*/
@RequestMapping("/mai")
@ResponseBody
public String mai(Integer playId, Users user){
// System.out.println(playId);
List<Ticket> list=ticketService.playById(playId);
// System.out.println(list);
/* model.addAttribute("ticket",list);*/
Map<String,Object> map=new HashMap<String,Object>();
map.put("ticket",list);
String a= JSON.toJSONString(map);
return a;
}
@RequestMapping("/zhu")
@ResponseBody
public Integer zhu(Users users){
return userService.add(users);
}
}
package com.mecol.film.controller;
import com.mecol.film.entity.Admin;
import com.mecol.film.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.io.UnsupportedEncodingException;
@Controller
public class ViewController {
@Autowired
private AdminService adminService;
/**
* 登录界面
* @return
*/
@RequestMapping("/adminlogin")
public String adminLogin(){
return "admin/login";
}
@RequestMapping("/loginadmin")
@ResponseBody
public String admin(Admin admin, HttpServletRequest request, Model model){
Admin a= null;
try {
a = adminService.login(admin);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
System.out.println(a);
if (a!=null){
HttpSession session=request.getSession();
session.setAttribute("admin",a);
model.addAttribute("admin",a);
return "ok";
}
return "redirect:/root/admin";
}
}