• Java项目:SSM电影售票管理系统


    作者主页:源码空间站2022

     简介: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+SpringMVC+Mybatis

    2. 前端:JSP+jQuery+Ajax

    使用说明

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

    2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;

    若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;

    3. 将项目中springmvc-servlet.xml配置文件中的数据库配置改为自己的配置;
    4. 运行项目,
    前台运行地址:输入localhost:8080/ssm_zxdydp/index/index.action 登录
    用户账号/密码: ls/lisi
    后台运行地址:localhost:8080/ssm_zxdydp/admin/index.jsp

    管理员账号/密码:admin/admin

    运行截图

    前台界面

    后台界面

     

    相关代码 

    AccountController

    1. package net.dqsy.manager.controller;
    2. import net.dqsy.manager.pojo.Account;
    3. import net.dqsy.manager.service.IAccountService;
    4. import net.dqsy.manager.web.util.IpUtil;
    5. import net.dqsy.manager.web.util.LocalizationUtil;
    6. import net.dqsy.manager.web.util.MD5Util;
    7. import net.dqsy.manager.web.util.PageUtil;
    8. import net.dqsy.manager.web.util.ParamUtils;
    9. import net.dqsy.manager.web.util.ResultUtil;
    10. import org.apache.commons.lang3.StringUtils;
    11. import org.springframework.beans.factory.annotation.Autowired;
    12. import org.springframework.stereotype.Controller;
    13. import org.springframework.web.bind.annotation.RequestMapping;
    14. import org.springframework.web.servlet.ModelAndView;
    15. import javax.servlet.http.HttpServletRequest;
    16. import javax.servlet.http.HttpServletResponse;
    17. import java.util.Arrays;
    18. import java.util.Date;
    19. import java.util.List;
    20. @Controller
    21. @RequestMapping("account")
    22. public class AccountController{
    23. @Autowired
    24. private IAccountService accountService;
    25. @RequestMapping(value = "list")
    26. public ModelAndView list(HttpServletRequest request, HttpServletResponse response){
    27. Account account = (Account) request.getSession().getAttribute("currentAccount");
    28. int start = ParamUtils.getIntParameter(request, "page", 1);
    29. int limit = ParamUtils.getIntParameter(request, "limit", 10);
    30. String userName = ParamUtils.getParameter(request, "s_userName");
    31. if(StringUtils.isBlank(userName) || "null".equals(userName)){
    32. userName = null;
    33. }
    34. int totalCount = accountService.getTotalCount(Arrays.asList(Account.ACCOUNT_MANAGER, Account.ACCOUNT_STUDENT), userName);
    35. List accountList = accountService.findAccountList(Arrays.asList(Account.ACCOUNT_MANAGER, Account.ACCOUNT_STUDENT), userName, start, limit);
    36. String pagation = PageUtil.getPagation("/account/list&s_userName=" + userName, totalCount, start, limit);
    37. ModelAndView mav = new ModelAndView("account/list");
    38. mav.getModel().put("accountList", accountList);
    39. mav.getModel().put("pageCode", pagation);
    40. return mav;
    41. }
    42. @RequestMapping(value = "add")
    43. public void add(HttpServletRequest request, HttpServletResponse response){
    44. Long account_id = ParamUtils.getLongParameter(request, "account_id", 0L);
    45. String username = ParamUtils.getParameter(request, "username");
    46. int sex = ParamUtils.getIntParameter(request, "sex", 1);
    47. String mobile = ParamUtils.getParameter(request, "mobile");
    48. String email = ParamUtils.getParameter(request, "email", "");
    49. String screenName = ParamUtils.getParameter(request, "screenName", "");
    50. if(account_id == 0L || StringUtils.isBlank(username)){
    51. ResultUtil.fail(LocalizationUtil.getClientString("Account_22", request), response);
    52. return;
    53. }
    54. Account oldAccount = accountService.findAccountById(account_id);
    55. if(oldAccount != null){
    56. oldAccount.setId(account_id);
    57. oldAccount.setUsername(username);
    58. oldAccount.setMobile(mobile);
    59. oldAccount.setSex(sex);
    60. oldAccount.setEmail(email);
    61. oldAccount.setScreenName(screenName);
    62. accountService.update(oldAccount);
    63. }else{
    64. Account account = new Account();
    65. account.setId(account_id);
    66. account.setUsername(username);
    67. account.setMobile(mobile);
    68. account.setSex(sex);
    69. account.setCreateTime(new Date());
    70. account.setActivated(true);
    71. account.setEnabled(true);
    72. account.setRegisterIp(IpUtil.getIpStr(request));
    73. account.setPassword(MD5Util.getMD5("123456".getBytes()));
    74. account.setScreenName(username);
    75. account.setLocale(request.getLocale().getLanguage() +"_"+request.getLocale().getCountry());
    76. account.setRegisterTime(new Date());
    77. account.setCreateTime(new Date());
    78. account.setType(Account.ACCOUNT_STUDENT);
    79. accountService.save(account);
    80. }
    81. ResultUtil.success(response);
    82. }
    83. @RequestMapping(value = "detail")
    84. public void detail(HttpServletRequest request, HttpServletResponse response){
    85. Long account_id = ParamUtils.getLongParameter(request, "account_id", 0L);
    86. if(account_id == 0L){
    87. ResultUtil.fail(LocalizationUtil.getClientString("Account_22", request), response);
    88. return;
    89. }
    90. Account account = accountService.findAccountById(account_id);
    91. ResultUtil.success(account, response);
    92. }
    93. @RequestMapping(value = "delete")
    94. public void delete(HttpServletRequest request, HttpServletResponse response){
    95. Long account_id = ParamUtils.getLongParameter(request, "account_id", 0L);
    96. if(account_id == 0L){
    97. ResultUtil.fail(LocalizationUtil.getClientString("Account_22", request), response);
    98. return;
    99. }
    100. accountService.deteleById(account_id);
    101. Account account = accountService.findAccountById(account_id);
    102. ResultUtil.success(account, response);
    103. }
    104. }

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

  • 相关阅读:
    Apache Storm 2.5.0 集群安装与配置
    java计算机毕业设计人才库构建研究源码+数据库+lw文档+系统
    Java-final
    安徽京准-NTP网络授时服务器助力助力甘南州公共资源交易
    script 标签中的 async 和 defer 属性
    数字孪生行业政策梳理--数字孪生能源领域相关政策(可下载)
    Github Fork仓库的冲突与同步管理
    【大学生痛苦版】
    「Python」面向对象封装案例3——士兵突击(需求分析、代码演练)
    无主复制系统(2)-读修复和反熵
  • 原文地址:https://blog.csdn.net/m0_74967853/article/details/128162249