作者主页:源码空间站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
package net.dqsy.manager.controller;
import net.dqsy.manager.pojo.Account;
import net.dqsy.manager.service.IAccountService;
import net.dqsy.manager.web.util.IpUtil;
import net.dqsy.manager.web.util.LocalizationUtil;
import net.dqsy.manager.web.util.MD5Util;
import net.dqsy.manager.web.util.PageUtil;
import net.dqsy.manager.web.util.ParamUtils;
import net.dqsy.manager.web.util.ResultUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@Controller
@RequestMapping("account")
public class AccountController{
@Autowired
private IAccountService accountService;
@RequestMapping(value = "list")
public ModelAndView list(HttpServletRequest request, HttpServletResponse response){
Account account = (Account) request.getSession().getAttribute("currentAccount");
int start = ParamUtils.getIntParameter(request, "page", 1);
int limit = ParamUtils.getIntParameter(request, "limit", 10);
String userName = ParamUtils.getParameter(request, "s_userName");
if(StringUtils.isBlank(userName) || "null".equals(userName)){
userName = null;
}
int totalCount = accountService.getTotalCount(Arrays.asList(Account.ACCOUNT_MANAGER, Account.ACCOUNT_STUDENT), userName);
List<Account> accountList = accountService.findAccountList(Arrays.asList(Account.ACCOUNT_MANAGER, Account.ACCOUNT_STUDENT), userName, start, limit);
String pagation = PageUtil.getPagation("/account/list&s_userName=" + userName, totalCount, start, limit);
ModelAndView mav = new ModelAndView("account/list");
mav.getModel().put("accountList", accountList);
mav.getModel().put("pageCode", pagation);
return mav;
}
@RequestMapping(value = "add")
public void add(HttpServletRequest request, HttpServletResponse response){
Long account_id = ParamUtils.getLongParameter(request, "account_id", 0L);
String username = ParamUtils.getParameter(request, "username");
int sex = ParamUtils.getIntParameter(request, "sex", 1);
String mobile = ParamUtils.getParameter(request, "mobile");
String email = ParamUtils.getParameter(request, "email", "");
String screenName = ParamUtils.getParameter(request, "screenName", "");
if(account_id == 0L || StringUtils.isBlank(username)){
ResultUtil.fail(LocalizationUtil.getClientString("Account_22", request), response);
return;
}
Account oldAccount = accountService.findAccountById(account_id);
if(oldAccount != null){
oldAccount.setId(account_id);
oldAccount.setUsername(username);
oldAccount.setMobile(mobile);
oldAccount.setSex(sex);
oldAccount.setEmail(email);
oldAccount.setScreenName(screenName);
accountService.update(oldAccount);
}else{
Account account = new Account();
account.setId(account_id);
account.setUsername(username);
account.setMobile(mobile);
account.setSex(sex);
account.setCreateTime(new Date());
account.setActivated(true);
account.setEnabled(true);
account.setRegisterIp(IpUtil.getIpStr(request));
account.setPassword(MD5Util.getMD5("123456".getBytes()));
account.setScreenName(username);
account.setLocale(request.getLocale().getLanguage() +"_"+request.getLocale().getCountry());
account.setRegisterTime(new Date());
account.setCreateTime(new Date());
account.setType(Account.ACCOUNT_STUDENT);
accountService.save(account);
}
ResultUtil.success(response);
}
@RequestMapping(value = "detail")
public void detail(HttpServletRequest request, HttpServletResponse response){
Long account_id = ParamUtils.getLongParameter(request, "account_id", 0L);
if(account_id == 0L){
ResultUtil.fail(LocalizationUtil.getClientString("Account_22", request), response);
return;
}
Account account = accountService.findAccountById(account_id);
ResultUtil.success(account, response);
}
@RequestMapping(value = "delete")
public void delete(HttpServletRequest request, HttpServletResponse response){
Long account_id = ParamUtils.getLongParameter(request, "account_id", 0L);
if(account_id == 0L){
ResultUtil.fail(LocalizationUtil.getClientString("Account_22", request), response);
return;
}
accountService.deteleById(account_id);
Account account = accountService.findAccountById(account_id);
ResultUtil.success(account, response);
}
}
如果也想学习本系统,下面领取。关注并回复:066ssm