基于javaweb+mysql的springboot电影售票系统设计和实现(java+springboot+ssm+mysql+jsp+maven)
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SpringBoot电影售票系统设计和实现(java+springboot+ssm+mysql+jsp+maven)
一、项目简述
Java电影院系统功能:
登陆注册模块 :
普通用户可以直接访问影院主界面进行电影浏览、查询等 功能,但是当用户操作需要读取用户信息时就要求用户进 行登录了。普通用户可以直接访问登录页面或者通过页面 的登录选项进行登录,当用户不拥有账号时,即可通过注 册链接进行账号注册,注册完毕后自动返回登录页面,方 便用户登录。
电影查询浏览模块 :
电影浏览查询模块作为本系统最重要的模块之一,面向普 通用户。其意指通过不同方式向用户展示电影并提供电影 详情链接,其主要包括以下子模块:(1) 电影类型查询:用 户可以根据个人类型喜好对影片进行筛选。(2) 电影放映 厅类型查询:用户可以根据个人对放映厅要求对影片进行 筛选。(3) 电影中间字查询:用户可以根据电影名中间字 对电影进行模糊查询。(4) 最新电影:用户向用户展示系 统最新添加的电影。(5) 热门电影:基于评论和心愿单功 能计算电影热度值,并向用户展示高热度的电影。(6) 最 新评论电影:基于评论功能,向用户展示最新评论下的电 影。
电影信息管理模块 :
电影信营:管理模块的面向对象是管理员用户,管理员在电 影信息管理页面对电影信息查询、修改、添加,需要注意 的是对电影海报的操作类型取决于新旧电影。 放映厅管理模块 放映厅管理模块的主要面向对象同样是管理员用户,管理员管理着电影与放映厅间的关联关系,普通用户只在具体 电影选择上才会展现其关系
场次管理模块 :
场次管理模块是放映厅管理模块的系统功能延伸,其主要 面向对象仍是管理员用户,管理员在电影与放映厅关系存 在的情况下对场次信息进行管理,反之操作条件不成立, 普通用户只在具体电影选择上才会展现其关联信息。需要 注意的是,不允许管理员对已售出票的场次进行场次取 消,直到普通用户全部退票。
票务管理模块 :
章务管理底块又是场次管理模块的系统功能延伸,其作为本系统最重要的模块之一,主要面向对象为普通用户。其普通用户在登录情况下选择场次进行选座购票,购票完毕 后可在个人票务管理页面对个人购票信息进行查询、退票。管理员在票务总览页面对所有票务进行查询,不允许对任何票务进行修改。
二项目运行 、
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: JSP +Springboot+ SpringMVC + MyBatis + ThymeLeaf + HTML+ JavaScript + JQuery + Ajax + maven等等
public ResponseVO deleteBatchOfSchedule(@RequestBody ScheduleBatchDeleteForm scheduleBatchDeleteForm){
return scheduleService.deleteBatchOfSchedule(scheduleBatchDeleteForm);
}
@RequestMapping(value = "/schedule/{id}", method = RequestMethod.GET)
public ResponseVO getScheduleById(@PathVariable int id){
return scheduleService.getScheduleById(id);
}
}
/**
*/
@RestController()
public class AccountController {
private final static String ACCOUNT_INFO_ERROR="用户名或密码错误";
@Autowired
private AccountServiceImpl accountService;
@PostMapping("/login")
public ResponseVO login(@RequestBody UserForm userForm, HttpSession session){
UserVO user = accountService.login(userForm);
if(user==null){
return ResponseVO.buildFailure(ACCOUNT_INFO_ERROR);
}
//注册session
session.setAttribute(InterceptorConfiguration.SESSION_KEY,userForm);
public ResponseVO unlikeMovie(@PathVariable int movieId,@RequestParam int userId){
return movieLikeService.unLikeMovie(userId,movieId);
}
@RequestMapping(value = "/movie/{movieId}/like/count", method = RequestMethod.GET)
public ResponseVO getMovieLikeCounts(@PathVariable int movieId){
return movieLikeService.getCountOfLikes(movieId);
}
@RequestMapping(value = "/movie/{movieId}/like/date", method = RequestMethod.GET)
public ResponseVO getMovieLikeCountByDate(@PathVariable int movieId){
return movieLikeService.getLikeNumsGroupByDate(movieId);
}
@RequestMapping(value = "/movie/search",method = RequestMethod.GET)
public ResponseVO getMovieByKeyword(@RequestParam String keyword){
return movieService.getMovieByKeyword(keyword);
}
@RequestMapping(value = "/movie/off/batch",method = RequestMethod.POST)
public ResponseVO pullOfBatchOfMovie(@RequestBody MovieBatchOffForm movieBatchOffForm){
return movieService.pullOfBatchOfMovie(movieBatchOffForm);
}
@RequestMapping(value = "/movie/update",method = RequestMethod.POST)
public ResponseVO updateMovie(@RequestBody MovieForm updateMovieForm){
return movieService.updateMovie(updateMovieForm);
}
}
/**
*/
@Controller
public class ViewController {
@RequestMapping(value = "/index")
public String getIndex() {
return "index";
}
@RequestMapping(value = "/signUp")
public String getSignUp() {
}
@RequestMapping(value = "/admin/cinema/statistic")
public String getAdminCinemaStatistic() {
return "adminCinemaStatistic";
}
@RequestMapping(value = "/admin/movieDetail")
public String getAdminMovieDetail(@RequestParam int id) { return "adminMovieDetail"; }
@RequestMapping(value = "/user/home")
public String getUserHome() {
return "userHome";
}
@RequestMapping(value = "/user/buy")
public String getUserBuy() {
return "userBuy";
}
@RequestMapping(value = "/user/movieDetail")
public String getUserMovieDetail(@RequestParam int id) {
return "userMovieDetail";
}
@RequestMapping(value = "/user/movieDetail/buy")
public String getUserMovieBuy(@RequestParam int id) {
return "userMovieBuy";
}
@RequestMapping(value = "/user/cost")
public String getUserCost() {
return "userCost";
}
@RequestMapping(value = "/user/movie")
public String getUserMovie() {
return "userMovie";
}
@RequestMapping(value = "/user/member")
public String getUserMember() {
return "userMember";
}
@RequestMapping(value = "/admin/vip/manage")
public String getAdminVipManage() { return "adminVipManage"; }
/**排片管理
*/
@RestController
public class ScheduleController {
@Autowired
private ScheduleService scheduleService;
@RequestMapping(value = "/schedule/add", method = RequestMethod.POST)
public ResponseVO addSchedule(@RequestBody ScheduleForm scheduleForm){
return scheduleService.addSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/update", method = RequestMethod.POST)
public ResponseVO updateSchedule(@RequestBody ScheduleForm scheduleForm){
return scheduleService.updateSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/search", method = RequestMethod.GET)
public ResponseVO searchSchedule(@RequestParam int hallId, @RequestParam Date startDate){
return scheduleService.searchScheduleSevenDays(hallId, startDate);
}
@RequestMapping(value = "/schedule/search/audience", method = RequestMethod.GET)
public ResponseVO searchAudienceSchedule(@RequestParam int movieId){
return scheduleService.searchAudienceSchedule(movieId);
}
@RequestMapping(value = "/schedule/view/set", method = RequestMethod.POST)
public ResponseVO setScheduleView(@RequestBody ScheduleViewForm scheduleViewForm){
return scheduleService.setScheduleView(scheduleViewForm);
}
@RequestMapping(value = "/schedule/view", method = RequestMethod.GET)
public ResponseVO getScheduleView(){
return scheduleService.getScheduleView();
}
}
@RequestMapping(value = "/schedule/view/set", method = RequestMethod.POST)
public ResponseVO setScheduleView(@RequestBody ScheduleViewForm scheduleViewForm){
return scheduleService.setScheduleView(scheduleViewForm);
}
@RequestMapping(value = "/schedule/view", method = RequestMethod.GET)
public ResponseVO getScheduleView(){
return scheduleService.getScheduleView();
}
@RequestMapping(value = "/schedule/delete/batch", method = RequestMethod.DELETE)
public ResponseVO deleteBatchOfSchedule(@RequestBody ScheduleBatchDeleteForm scheduleBatchDeleteForm){
return scheduleService.deleteBatchOfSchedule(scheduleBatchDeleteForm);
}
@RequestMapping(value = "/schedule/{id}", method = RequestMethod.GET)
public ResponseVO getScheduleById(@PathVariable int id){
return scheduleService.getScheduleById(id);
}
}
/**
*/
@RestController()
public class AccountController {
private final static String ACCOUNT_INFO_ERROR="用户名或密码错误";
@Autowired
private AccountServiceImpl accountService;
@PostMapping("/login")
public ResponseVO login(@RequestBody UserForm userForm, HttpSession session){
/**排片管理
*/
@RestController
public class ScheduleController {
@Autowired
private ScheduleService scheduleService;
@RequestMapping(value = "/schedule/add", method = RequestMethod.POST)
public ResponseVO addSchedule(@RequestBody ScheduleForm scheduleForm){
return scheduleService.addSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/update", method = RequestMethod.POST)
public ResponseVO updateSchedule(@RequestBody ScheduleForm scheduleForm){
return scheduleService.updateSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/search", method = RequestMethod.GET)
public ResponseVO searchSchedule(@RequestParam int hallId, @RequestParam Date startDate){
return scheduleService.searchScheduleSevenDays(hallId, startDate);
}
@RequestMapping(value = "/schedule/search/audience", method = RequestMethod.GET)
public ResponseVO searchAudienceSchedule(@RequestParam int movieId){
return scheduleService.searchAudienceSchedule(movieId);
}
@RequestMapping(value = "/schedule/view/set", method = RequestMethod.POST)
public ResponseVO setScheduleView(@RequestBody ScheduleViewForm scheduleViewForm){
return scheduleService.setScheduleView(scheduleViewForm);
}
@RequestMapping(value = "/schedule/view", method = RequestMethod.GET)
public ResponseVO getScheduleView(){
return scheduleService.getScheduleView();
}
if(null!=session && null!=session.getAttribute(InterceptorConfiguration.SESSION_KEY)){
return true;
}
httpServletResponse.sendRedirect("/index");
return false;
}
}
/**
*/
@RestController
@RequestMapping("/coupon")
public class CouponController {
@Autowired
CouponService couponService;
@GetMapping("{userId}/get")
public ResponseVO getCoupons(@PathVariable int userId){
return couponService.getCouponsByUser(userId);
}
@GetMapping("/get/all")
public ResponseVO getAllCoupon(){return couponService.getAllCoupon();}
@PostMapping("/send")
public ResponseVO sendCoupon(@RequestParam int couponId,@RequestParam int[] userId){return couponService.sendCoupon(couponId,userId);}
}
/**
return scheduleService.getScheduleById(id);
}
}
/**
*/
@RestController()
public class AccountController {
private final static String ACCOUNT_INFO_ERROR="用户名或密码错误";
@Autowired
private AccountServiceImpl accountService;
@PostMapping("/login")
public ResponseVO login(@RequestBody UserForm userForm, HttpSession session){
UserVO user = accountService.login(userForm);
if(user==null){
return ResponseVO.buildFailure(ACCOUNT_INFO_ERROR);
}
//注册session
session.setAttribute(InterceptorConfiguration.SESSION_KEY,userForm);
return ResponseVO.buildSuccess(user);
}
@PostMapping("/register")
public ResponseVO registerAccount(@RequestBody UserForm userForm){
return accountService.registerAccount(userForm);
}
@PostMapping("/logout")
public String logOut(HttpSession session){
session.removeAttribute(InterceptorConfiguration.SESSION_KEY);
return "index";
}
/**
*/
@RestController
public class StatisticsController {
@Autowired
private StatisticsService statisticsService;
@RequestMapping(value = "statistics/scheduleRate", method = RequestMethod.GET)
public ResponseVO getScheduleRateByDate(@RequestParam(required = false) Date date){
//此处date为非必填参数,若不填则默认为当天
return statisticsService.getScheduleRateByDate(date);
}
@RequestMapping(value = "statistics/boxOffice/total", method = RequestMethod.GET)
public ResponseVO getTotalBoxOffice(){
return statisticsService.getTotalBoxOffice();
}
@RequestMapping(value = "statistics/audience/price", method = RequestMethod.GET)
public ResponseVO getAudiencePrice(){
return statisticsService.getAudiencePriceSevenDays();
}
@RequestMapping(value = "statistics/PlacingRate", method = RequestMethod.GET)
public ResponseVO getMoviePlacingRateByDate(@RequestParam Date date){
return statisticsService.getMoviePlacingRateByDate(date);
}
@RequestMapping(value = "statistics/popular/movie", method = RequestMethod.GET)
@PostMapping("/update/strategy")
public ResponseVO updateStrategy(@RequestParam int id,int chargeLimit ,int giftAmount)
{return vipService.changeVIP_Strategy(id,chargeLimit,giftAmount);}
@PostMapping("delete/strategy")
public ResponseVO deleteStrategy(@RequestParam int id){return vipService.deleteVIP_Strategy(id);}
@PostMapping("insert/history")
public ResponseVO insertHistory(@RequestBody historyItem history){return accountService.insertHistory(history); }
@GetMapping("get/by/money")
public ResponseVO getByMoney(@RequestParam int target){return vipService.getVipByMoney(target);}
}
/**
*/
@RestController
@RequestMapping("/ticket")
public class TicketController {
@Autowired
TicketService ticketService;
@Autowired
AccountService accountService;
@PostMapping("/vip/buy")
public ResponseVO buyTicketByVIPCard(@RequestParam List<Integer> ticketId, @RequestParam int couponId){
return ticketService.completeByVIPCard(ticketId,couponId);
}
@PostMapping("/lockSeat")
public ResponseVO lockSeat(@RequestBody TicketForm ticketForm){
return ticketService.addTicket(ticketForm);
}
@PostMapping("/buy")
public ResponseVO buyTicket(@RequestParam List<Integer> ticketId,@RequestParam int couponId){
return ticketService.completeTicket(ticketId,couponId);
}
@GetMapping("/get/{userId}")
public ResponseVO getTicketByUserId(@PathVariable int userId){
return ticketService.getTicketByUser(userId);
public String getBossManage(){return "bossManage";}
}
/**排片管理
*/
@RestController
public class ScheduleController {
@Autowired
private ScheduleService scheduleService;
@RequestMapping(value = "/schedule/add", method = RequestMethod.POST)
public ResponseVO addSchedule(@RequestBody ScheduleForm scheduleForm){
return scheduleService.addSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/update", method = RequestMethod.POST)
public ResponseVO updateSchedule(@RequestBody ScheduleForm scheduleForm){
return scheduleService.updateSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/search", method = RequestMethod.GET)
public ResponseVO searchSchedule(@RequestParam int hallId, @RequestParam Date startDate){
return scheduleService.searchScheduleSevenDays(hallId, startDate);
}
@RequestMapping(value = "/schedule/search/audience", method = RequestMethod.GET)
public ResponseVO searchAudienceSchedule(@RequestParam int movieId){
return scheduleService.searchAudienceSchedule(movieId);
}
}
/**
*/
@RestController
public class RefundController {
@Autowired
RefundService refundService;
@PostMapping("/refund")
public ResponseVO refundTicket(@RequestParam int ticketId){//System.out.println("refundController ticketId:"+ticketId);
return refundService.refundTicket(ticketId);
}
@GetMapping("/get/all/refund")
public ResponseVO getAllPolicy(){
return refundService.getAllPolicy();
}
@PostMapping("/add/refund")
public ResponseVO addRefundPolicy(@RequestBody RefundPolicy policy){
return refundService.addRefundPolicy(policy);
}
@PostMapping("/update/refund")
public ResponseVO updateRefundPolicy(@RequestBody RefundPolicy policy){
@RequestMapping(value="/user/info")
public String getUserInfo(){return "userInfo";}
@RequestMapping(value="/boss/manage")
public String getBossManage(){return "bossManage";}
}
/**排片管理
*/
@RestController
public class ScheduleController {
@Autowired
private ScheduleService scheduleService;
@RequestMapping(value = "/schedule/add", method = RequestMethod.POST)
public ResponseVO addSchedule(@RequestBody ScheduleForm scheduleForm){
return scheduleService.addSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/update", method = RequestMethod.POST)
public ResponseVO updateSchedule(@RequestBody ScheduleForm scheduleForm){
return scheduleService.updateSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/search", method = RequestMethod.GET)
public ResponseVO searchSchedule(@RequestParam int hallId, @RequestParam Date startDate){
return scheduleService.searchScheduleSevenDays(hallId, startDate);
}
@RequestMapping(value = "/schedule/search/audience", method = RequestMethod.GET)
public ResponseVO searchAudienceSchedule(@RequestParam int movieId){
return scheduleService.searchAudienceSchedule(movieId);
}
@RequestMapping(value = "/schedule/view/set", method = RequestMethod.POST)
public ResponseVO setScheduleView(@RequestBody ScheduleViewForm scheduleViewForm){
}
@RequestMapping(value = "/movie/off/batch",method = RequestMethod.POST)
public ResponseVO pullOfBatchOfMovie(@RequestBody MovieBatchOffForm movieBatchOffForm){
return movieService.pullOfBatchOfMovie(movieBatchOffForm);
}
@RequestMapping(value = "/movie/update",method = RequestMethod.POST)
public ResponseVO updateMovie(@RequestBody MovieForm updateMovieForm){
return movieService.updateMovie(updateMovieForm);
}
}
/**
*/
@Controller
public class ViewController {
@RequestMapping(value = "/index")
public String getIndex() {
return "index";
}
@RequestMapping(value = "/signUp")
public String getSignUp() {
return "signUp";
}
@RequestMapping(value = "/admin/movie/manage")
public String getAdminMovieManage() {
return "adminMovieManage";
}
@RequestMapping(value = "/admin/session/manage")
public String getAdminSessionManage() {
return "adminScheduleManage";
}
@RequestMapping(value = "/admin/cinema/manage")
public String getAdminCinemaManage() {
return "adminCinemaManage";
}
@RequestMapping(value = "/admin/promotion/manage")
@RequestMapping(value = "/movie/{movieId}/unlike", method = RequestMethod.POST)
public ResponseVO unlikeMovie(@PathVariable int movieId,@RequestParam int userId){
return movieLikeService.unLikeMovie(userId,movieId);
}
@RequestMapping(value = "/movie/{movieId}/like/count", method = RequestMethod.GET)
public ResponseVO getMovieLikeCounts(@PathVariable int movieId){
return movieLikeService.getCountOfLikes(movieId);
}
@RequestMapping(value = "/movie/{movieId}/like/date", method = RequestMethod.GET)
public ResponseVO getMovieLikeCountByDate(@PathVariable int movieId){
return movieLikeService.getLikeNumsGroupByDate(movieId);
}
@RequestMapping(value = "/movie/search",method = RequestMethod.GET)
public ResponseVO getMovieByKeyword(@RequestParam String keyword){
return movieService.getMovieByKeyword(keyword);
}
@RequestMapping(value = "/movie/off/batch",method = RequestMethod.POST)
public ResponseVO pullOfBatchOfMovie(@RequestBody MovieBatchOffForm movieBatchOffForm){
return movieService.pullOfBatchOfMovie(movieBatchOffForm);
}
@RequestMapping(value = "/movie/update",method = RequestMethod.POST)
public ResponseVO updateMovie(@RequestBody MovieForm updateMovieForm){
return movieService.updateMovie(updateMovieForm);
}
}
/**
*/
@Controller
public class ViewController {
@RequestMapping(value = "/index")
public ResponseVO addMovie(@RequestBody MovieForm addMovieForm){
return movieService.addMovie(addMovieForm);
}
@RequestMapping(value = "/movie/{id}/{userId}", method = RequestMethod.GET)
public ResponseVO searchOneMovieByIdAndUserId(@PathVariable int id, @PathVariable int userId){
return movieService.searchOneMovieByIdAndUserId(id, userId);
}
@RequestMapping(value = "/movie/all", method = RequestMethod.GET)
public ResponseVO searchAllMovie(){
//返回结果中包括已经下架的电影
return movieService.searchAllMovie();
}
@RequestMapping(value = "/movie/all/exclude/off", method = RequestMethod.GET)
public ResponseVO searchOtherMoviesExcludeOff(){
//返回结果中不包括已经下架的电影
return movieService.searchOtherMoviesExcludeOff();
}
@RequestMapping(value = "/movie/{movieId}/like", method = RequestMethod.POST)
public ResponseVO likeMovie(@PathVariable int movieId,@RequestParam int userId){
return movieLikeService.likeMovie(userId,movieId);
}
@RequestMapping(value = "/movie/{movieId}/unlike", method = RequestMethod.POST)
public ResponseVO unlikeMovie(@PathVariable int movieId,@RequestParam int userId){
return movieLikeService.unLikeMovie(userId,movieId);
}
@RequestMapping(value = "/movie/{movieId}/like/count", method = RequestMethod.GET)
public ResponseVO getMovieLikeCounts(@PathVariable int movieId){
return movieLikeService.getCountOfLikes(movieId);
}
@RequestMapping(value = "/movie/{movieId}/like/date", method = RequestMethod.GET)
public ResponseVO getMovieLikeCountByDate(@PathVariable int movieId){
return movieLikeService.getLikeNumsGroupByDate(movieId);
}
@RequestMapping(value = "/movie/search",method = RequestMethod.GET)
public ResponseVO getMovieByKeyword(@RequestParam String keyword){
return movieService.getMovieByKeyword(keyword);
/**排片管理
*/
@RestController
public class ScheduleController {
@Autowired
private ScheduleService scheduleService;
@RequestMapping(value = "/schedule/add", method = RequestMethod.POST)
public ResponseVO addSchedule(@RequestBody ScheduleForm scheduleForm){
return scheduleService.addSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/update", method = RequestMethod.POST)
public ResponseVO updateSchedule(@RequestBody ScheduleForm scheduleForm){
return scheduleService.updateSchedule(scheduleForm);
}
@RequestMapping(value = "/schedule/search", method = RequestMethod.GET)
public ResponseVO searchSchedule(@RequestParam int hallId, @RequestParam Date startDate){
return scheduleService.searchScheduleSevenDays(hallId, startDate);
}
@RequestMapping(value = "/schedule/search/audience", method = RequestMethod.GET)
public ResponseVO searchAudienceSchedule(@RequestParam int movieId){
return scheduleService.searchAudienceSchedule(movieId);
}
@RequestMapping(value = "/schedule/view/set", method = RequestMethod.POST)
public ResponseVO setScheduleView(@RequestBody ScheduleViewForm scheduleViewForm){
return scheduleService.setScheduleView(scheduleViewForm);
}
@RequestMapping(value = "/schedule/view", method = RequestMethod.GET)
public ResponseVO getScheduleView(){
return scheduleService.getScheduleView();
}
@RequestMapping(value = "/schedule/delete/batch", method = RequestMethod.DELETE)
public ResponseVO deleteBatchOfSchedule(@RequestBody ScheduleBatchDeleteForm scheduleBatchDeleteForm){
return scheduleService.deleteBatchOfSchedule(scheduleBatchDeleteForm);