基于javaweb的SSM+Maven电影院购票系统(java+ssm+jsp+bootstrap+layui+echarts+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

410023392402

420023392402

430023392402

440023392402

450023392402

470023392402

480023392402

490023392402

220023522402

基于javaweb的SSM+Maven电影院购票系统(java+ssm+jsp+bootstrap+layui+echarts+mysql)

项目介绍

影院购票系统,本项目分为前台和后台,用户有普通用户和管理员,普通用户只可访问前台页面,管理员可以访问后台; 前台主要功能: 电影分类、电影排行、电影详细介绍、选座购票、评论等功能;

后台主要功能: 用户管理、电影管理、订单管理、评论管理、标签管理、放映厅管理、场次安排等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 8.x,9.x版本均可 注:不可使用tomcat7.0,会造成图片显示异常等问题; 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目  6.数据库:MySql 5.7版本;

技术栈

  1. 后端:spring + spring mvc + mybatis + spring security  2. 前端:JSP+jQuery+bootstrap+layui+echarts

使用说明

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

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
        modelMap.addAttribute("pages",page1);
}
modelMap.addAttribute("sortid",sid);
modelMap.addAttribute("sorts",all);
return "movies_more";
}
/**
*
* @param id 分类ID
* @param modelMap 视图
* @return 
*/
@RequestMapping("/findBySort")
public String findBySort(@RequestParam(value = "sid", required = true) Integer id, ModelMap modelMap) {
List<TSort> all = tSortService.findAll(null);
List<TMovie> bySortID = tMovieService.findBySortID(id);
PageInfo pageInfo = new PageInfo(bySortID);
modelMap.addAttribute("movies", pageInfo);
modelMap.addAttribute("sorts", all);
return "movie_list";
}

/**
* @param id 电影ID
* @param modelMap 视图
* @return 点击的电影显示电影内容和评论信息
*/
@RequestMapping("/findById")
public String findById(@RequestParam(value = "id", required = true) Integer id, ModelMap modelMap) {
TMovie tMovie = tMovieService.queryById(id);
tMovie.setHit(tMovie.getHit() + 1);
tMovieService.update(tMovie);
TComment t = new TComment();
t.setMovieobj(id);
List<TComment> findall = tCommentService.findall(t);
modelMap.addAttribute("movie", tMovie);
modelMap.addAttribute("comments", findall);
return "movie_detils";
}

/**
* 电影名字模糊查询
*/
@RequestMapping("/findByname")
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
    @RequestMapping("/registered")
public String registered(TUserinfo tUserinfo){
System.out.println(tUserinfo);
tUserinfoService.registered(tUserinfo);
return "redirect:/login";
}
}
package com.zxl.controller.sys;



@Controller
@RequestMapping("/sysSchedule")
public class SysScheduleController {
@Autowired
private TScheduleService tScheduleService;


@RequestMapping("/findAll")
public String findAll(Integer page,Integer pageSize,ModelMap modelMap){
List<TSchedule> all = tScheduleService.findAll(page,pageSize);
Integer count = tScheduleService.count();
Page page1 =new Page(pageSize,page,count);
PageInfo<TSchedule> pageInfo=new PageInfo<>(all);
modelMap.addAttribute("schedules",pageInfo);
modelMap.addAttribute("pages",page1);
return "sysSchedule";
}
@RequestMapping("/delete")
public String add(Integer id){
tScheduleService.deleteById(id);
return "redirect:/sysSchedule/findAll?page=1&pageSize=8";
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
package com.zxl.controller;



@Controller
public class CaptchaController {
@RequestMapping("/captcha")
public void getCaptcha(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.setContentType("image/jpeg");
//定义图形验证码大小
LineCaptcha lineCaptcha = CaptchaUtil.createLineCaptcha(150, 50);
ByteArrayInputStream imageStream = new ByteArrayInputStream(lineCaptcha.getImageBytes());
HttpSession session = request.getSession();
session.setAttribute("captcha", lineCaptcha.getCode());
ServletOutputStream outputStream = response.getOutputStream();
lineCaptcha.write(outputStream);
}
}
package com.zxl.controller;



@Controller
@RequestMapping("comment")
public class CommentController {
@Autowired
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

@RequestMapping("/buy")
public String buy(Msm msm){
tMovieorderService.insert(msm);
System.out.println(msm);
return "redirect:/userorder/findorder?page=1&pagesize=2";
}

@RequestMapping("/findorder")
public String findByusername(int page,int pagesize,ModelMap modelMap){
String name = SecurityContextHolder.getContext().getAuthentication().getName();
TUserinfo userByname = tUserinfoService.findUserByname(name);
Integer count = tMovieorderService.count(name);
Page pagein=new Page();
pagein.setPageSize(pagesize);
pagein.setPage(page);
pagein.setCount(count);
List<TMovieorder> byUsername = tMovieorderService.findByUsername(name,page,pagesize);
PageInfo pageInfo=new PageInfo(byUsername);
modelMap.addAttribute("orders",pageInfo);
modelMap.addAttribute("pages",pagein);
modelMap.addAttribute("me",userByname);
return "user_order";
}

@RequestMapping("/cancel")
public String cancel(Integer orderid){
TMovieorder t=new TMovieorder();
t.setOrderid(orderid);
t.setStatus(3);
tMovieorderService.update(t);
return "redirect:/userorder/findorder?page=1&pagesize=2";
}
}
package com.zxl.controller.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

@Controller
public class PayController {
@Autowired
private TMovieorderService tMovieorderService;

private static String out_trade_no;

@RequestMapping("/success")
public String success(){
//修改订单状态
TMovieorder t=new TMovieorder();
t.setOrderid(Integer.parseInt(out_trade_no));
t.setStatus(1);
tMovieorderService.update(t);
return "redirect:/userorder/findorder?page=1&pagesize=2";
}

@RequestMapping("/pay")
public void payController(HttpServletRequest request, HttpServletResponse response) throws IOException {

request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");

//获得初始化的AlipayClient
AlipayClient alipayClient = new DefaultAlipayClient(AlipayConfig.gatewayUrl, AlipayConfig.app_id, AlipayConfig.merchant_private_key, "json", AlipayConfig.charset, AlipayConfig.alipay_public_key, AlipayConfig.sign_type);

//设置请求参数
AlipayTradePagePayRequest alipayRequest = new AlipayTradePagePayRequest();
alipayRequest.setReturnUrl(AlipayConfig.return_url);
alipayRequest.setNotifyUrl(AlipayConfig.notify_url);


//商户订单号,商户网站订单系统中唯一订单号,必填
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

@RequestMapping("/registered")
public String registered(TUserinfo tUserinfo){
System.out.println(tUserinfo);
tUserinfoService.registered(tUserinfo);
return "redirect:/login";
}
}
package com.zxl.controller.sys;



@Controller
@RequestMapping("/sysSchedule")
public class SysScheduleController {
@Autowired
private TScheduleService tScheduleService;


@RequestMapping("/findAll")
public String findAll(Integer page,Integer pageSize,ModelMap modelMap){
List<TSchedule> all = tScheduleService.findAll(page,pageSize);
Integer count = tScheduleService.count();
Page page1 =new Page(pageSize,page,count);
PageInfo<TSchedule> pageInfo=new PageInfo<>(all);
modelMap.addAttribute("schedules",pageInfo);
modelMap.addAttribute("pages",page1);
return "sysSchedule";
}
@RequestMapping("/delete")
public String add(Integer id){


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