Java项目:302SSM的电影管理系统

作者主页:夜未央5788

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

角色:管理员、用户

用户登陆后,主要模块包括首页,电影信息,电影资讯,个人中心,选座,播放电影,后台管理等功能

管理员登陆后,主要模块包括个人中心,电影信息管理,电影类型管理,系统管理,订单管理等功能

环境需要

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.是否Maven项目: 否;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 

6.数据库:MySql 5.7/8.0等版本均可;

技术栈

后端:SSM(Spring+SpringMVC+Mybatis)

前端:JSP+CSS+JS+JQUERY+Layui

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;

2. 使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;

运行截图

论文

前台界面

后管界面

相关代码

SysMoviesController

package com.zxl.controller.sys;


import com.github.pagehelper.PageInfo;
import com.zxl.entity.TMovie;
import com.zxl.entity.TMoviehall;
import com.zxl.entity.TSchedule;
import com.zxl.entity.TSort;
import com.zxl.service.TMovieService;
import com.zxl.service.TMoviehallService;
import com.zxl.service.TScheduleService;
import com.zxl.service.TSortService;
import com.zxl.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.util.List;


@Controller
@RequestMapping("/sysMovies")
public class SysMoviesController {
    @Autowired
    private TMovieService tMovieService;
    @Autowired
    private TSortService tSortService;
    @Autowired
    private TScheduleService tScheduleService;
    @Autowired
    private TMoviehallService tMoviehallService;

    @RequestMapping("/findAll")
    public String findAll(Integer page,Integer pageSize,ModelMap modelMap){
        List<TMovie> findall = tMovieService.findall(page, pageSize);
        PageInfo<TMovie> pageInfo=new PageInfo<>(findall);
        Integer count = tMovieService.findCount();
        Page page1=new Page(pageSize,page,count);

        List<TMoviehall> all = tMoviehallService.findAll(null);
        modelMap.addAttribute("movies",pageInfo);
        modelMap.addAttribute("pages",page1);
        modelMap.addAttribute("halls",all);
        return "sysmovie";
    }
    @RequestMapping("/delete")
    public String delete(Integer id){
        tMovieService.deleteById(id);
        return "redirect:/sysMovies/findAll?page=1&pageSize=10";
    }
    @RequestMapping("/toAdd")
    public String toAdd(ModelMap modelMap){
        List<TSort> all = tSortService.findAll(null);
        modelMap.addAttribute("sorts",all);
        return "movie_add";
    }

    @RequestMapping("/add")
    public String add(HttpServletRequest request,MultipartFile photo,TMovie tMovie) throws IOException {
        String path = request.getSession().getServletContext().getRealPath("/");

        path=path+"/static/image";
        String filename=photo.getOriginalFilename();
        String movieP="/static/image/"+filename;
        tMovie.setMoviephoto(movieP);
        System.out.println(tMovie);
        tMovieService.insert(tMovie);
        photo.transferTo(new File(path,filename));
        return "redirect:/sysMovies/findAll?page=1&pageSize=10";
    }
    @RequestMapping("/toEdit")
    public String toEdit(Integer id,ModelMap modelMap){
        TMovie tMovie = tMovieService.queryById(id);
        List<TSort> notByMid = tSortService.findNotByMid(id);
        modelMap.addAttribute("movie",tMovie);
        modelMap.addAttribute("sorts",notByMid);
        return "movie_edit";
    }
    @RequestMapping("/edit")
    public String edit(TMovie tMovie){
        tMovieService.updateMs(tMovie);
        return "redirect:/sysMovies/findAll?page=1&pageSize=10";
    }
    @RequestMapping("/putShelf")
    public String putShelf(TSchedule tSchedule){
        tScheduleService.insert(tSchedule);
        return "redirect:/sysSchedule/findAll?page=1&pageSize=8";
    }
    @RequestMapping("/show")
    public @ResponseBody
            List<TMovie> show(){
        List<TMovie> findall = tMovieService.findall();

        return findall;
    }
    @RequestMapping("/sortHit")
    public @ResponseBody
    List<TSort> sortHit(){
        List<TSort> tSorts = tMovieService.countHit();
        return tSorts;
    }

    @RequestMapping("/findSome")
    public String findSome(TMovie tMovie,ModelMap modelMap,Integer page,Integer pageSize){
        List<TMovie> movies=tMovieService.findSome(tMovie,page,pageSize);
        PageInfo<TMovie> pageInfo=new PageInfo<>(movies);
        modelMap.addAttribute("movies",pageInfo);
        return "sysmovie";
    }

}

SysSortcontroller

package com.zxl.controller.sys;

import com.github.pagehelper.PageInfo;
import com.zxl.entity.TSort;
import com.zxl.entity.TUserinfo;
import com.zxl.service.TSortService;
import com.zxl.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/sysSort")
public class SysSortcontroller {
    @Autowired
    private TSortService tSortService;

    @RequestMapping("findAll")
    public String findALl(Integer page , Integer pageSize, ModelMap modelMap){
        List<TSort> all = tSortService.findAll(page,pageSize, null);
        Integer count = tSortService.count();
        PageInfo<TSort> pageInfo=new PageInfo<>(all);
        Page page1=new Page(pageSize,page,count);
        modelMap.addAttribute("sorts",pageInfo);
        modelMap.addAttribute("pages",page1);
        return "sysSort";
    }
    @RequestMapping("/add")
    public String add(TSort tSort){
        tSortService.insert(tSort);
        return "redirect:/sysSort/findAll?page=1&pageSize=5";
    }
    @RequestMapping("/delete")
    public String delete(Integer id){
        tSortService.deleteById(id);

        return "redirect:/sysSort/findAll?page=1&pageSize=5";
    }
    @RequestMapping("/toedit")
    public String toedit(Integer id,String sorts,ModelMap modelMap){
        TSort sort = new TSort();
        sort.setId(id);
        sort.setSorts(sorts);
        modelMap.addAttribute("sort",sort);
        return "sysSort_edit";
    }

    @RequestMapping("/edit")
    public String edit(TSort tSort){
        tSortService.update(tSort);
        return "redirect:/sysSort/findAll?page=1&pageSize=5";
    }
}

如果也想学习本系统,下面领取。关注并回复:302ssm

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜未央5788

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值