Java项目:SSH电影订票管理系统 |
您所在的位置:网站首页 › java用户管理 › Java项目:SSH电影订票管理系统 |
作者主页:夜未央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.数据库:MySql 5.7版本; 6.是否Maven项目:否; 技术栈1. 后端:Spring+hibernate+struts 2 2. 前端:JSP+CSS+JavaScript+jquery 使用说明1.使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,在浏览器中输入http://localhost:8080/TianRen 登录 管理员:admin/admin 用户:[email protected] / 123456 运行截图 管理端页面 相关代码 用户管理控制器 @Controller @RequestMapping("/user") public class UserController { @Autowired private TUserinfoService tUserinfoService; @RequestMapping("/find") public String findme(ModelMap modelMap){ String name = SecurityContextHolder.getContext().getAuthentication().getName(); TUserinfo userByname = tUserinfoService.findUserByname(name); modelMap.addAttribute("me",userByname); return "user"; } @RequestMapping("/update") public String update(TUserinfo tUserinfo){ System.out.println(tUserinfo); tUserinfoService.update(tUserinfo); return "redirect:/user/find"; } @RequestMapping("/registered") public String registered(TUserinfo tUserinfo){ System.out.println(tUserinfo); tUserinfoService.registered(tUserinfo); return "redirect:/login"; } } 电影管理控制器 @Controller @RequestMapping("/movies") public class UserMovieController { @Autowired private TMovieService tMovieService; @Autowired private TSortService tSortService; @Autowired private TCommentService tCommentService; /** * 首页 */ @RequestMapping("/home") public String home(ModelMap modelMap) { List movieList = new ArrayList(); List movieList2 = new ArrayList(); List movieList3 = new ArrayList(); List movies = tMovieService.tMovieTop(); List bysort1 = tMovieService.findBysort(1); for (int i = 0; i < 4; i++) { TMovie tMovie = bysort1.get(i); movieList.add(tMovie); } List bysort2 = tMovieService.findBysort(2); for (int i = 0; i < 8; i++) { TMovie tMovie = bysort2.get(i); movieList2.add(tMovie); } List findall = tMovieService.findall(); for (int i = 0; i < 6; i++) { TMovie tMovie = findall.get(i); movieList3.add(tMovie); } List topBysortl = tMovieService.findTopBysort(1, 0, 5); List topBysortr = tMovieService.findTopBysort(1, 5, 5); List topBysortl1 = tMovieService.findTopBysort(2, 0, 5); List topBysortr1 = tMovieService.findTopBysort(2, 5, 5); modelMap.addAttribute("movies", movies); modelMap.addAttribute("comedy", movieList); modelMap.addAttribute("l", topBysortl); modelMap.addAttribute("r", topBysortr); modelMap.addAttribute("actions", movieList2); modelMap.addAttribute("l1", topBysortl1); modelMap.addAttribute("r1", topBysortr1); modelMap.addAttribute("all", movieList3); return "movies_home"; } /** * 分类查询 */ @RequestMapping("/findBys") public String findByS(Integer sid,Integer page,Integer pageSize,ModelMap modelMap){ List all = tSortService.findAll(null); if (sid==0){ List findall = tMovieService.findall(page, pageSize); PageInfo pageInfo=new PageInfo(findall); Integer count = tMovieService.findCount(); Page page1=new Page(pageSize,page,count); modelMap.addAttribute("movies",pageInfo); modelMap.addAttribute("pages",page1); }else { List bysort = tMovieService.findBysort(sid, page, pageSize); Integer integer = tMovieService.countSort(sid); PageInfo pageInfo=new PageInfo(bysort); Page page1=new Page(pageSize,page,integer); modelMap.addAttribute("movies",pageInfo); 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 all = tSortService.findAll(null); List 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 findall = tCommentService.findall(t); modelMap.addAttribute("movie", tMovie); modelMap.addAttribute("comments", findall); return "movie_detils"; } /** * 电影名字模糊查询 */ @RequestMapping("/findByname") public String findByname(String name, ModelMap modelMap, @RequestParam(value = "page", required = true) Integer page, @RequestParam(value = "pagesize", required = true) Integer pagesize) { List movies = tMovieService.findBYname(name, page, pagesize); PageInfo pageInfo = new PageInfo(movies); modelMap.addAttribute("movies", pageInfo); return "movies_more"; } }如果也想学习本系统,下面领取。关注并回复:044ssh |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |