//
//
//
package com.action;
import com.entity.Topic;
import com.entity.Orders;
import com.entity.Details;
import com.entity.City;
import com.entity.Cart;
import com.util.VeDate;
import com.entity.Users;
import com.entity.Article;
import java.util.Iterator;
import java.util.ArrayList;
import com.entity.Film;
import com.entity.Cate;
import java.util.List;
import com.service.TopicService;
import com.service.DetailsService;
import com.service.OrdersService;
import com.service.CartService;
import com.service.FilmService;
import com.service.CinemaService;
import com.service.CityService;
import com.service.CateService;
import com.service.ArticleService;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import com.service.UsersService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
@Controller
@RequestMapping({ "/index" })
public class IndexAction extends BaseAction
{
@Autowired
@Resource
private UsersService usersService;
@Autowired
@Resource
private ArticleService articleService;
@Autowired
@Resource
private CateService cateService;
@Autowired
@Resource
private CityService cityService;
@Autowired
@Resource
private CinemaService cinemaService;
@Autowired
@Resource
private FilmService filmService;
@Autowired
@Resource
private CartService cartService;
@Autowired
@Resource
private OrdersService ordersService;
@Autowired
@Resource
private DetailsService detailsService;
@Autowired
@Resource
private TopicService topicService;
private void front() {
this.getRequest().setAttribute("title", (Object)"\u5728\u7ebf\u7535\u5f71\u8ba2\u7968\u7cfb\u7edf");
final List<Cate> cateList = this.cateService.getAllCate();
this.getRequest().setAttribute("cateList", (Object)cateList);
final List<Film> hotList = this.filmService.getFilmByHot();
this.getRequest().setAttribute("hotList", (Object)hotList);
}
@RequestMapping({ "index.action" })
public String index() {
this.front();
final List<Cate> cateList = this.cateService.getCateFront();
final List<Cate> frontList = new ArrayList<Cate>();
for (final Cate cate : cateList) {
final List<Film> flimList = this.filmService.getFilmByCate(cate.getCateid());
cate.setFlimList(flimList);
frontList.add(cate);
}
this.getRequest().setAttribute("frontList", (Object)frontList);
return "users/index";
}
@RequestMapping({ "article.action" })
public String article(String number) {
this.front();
final List<Article> articleList = new ArrayList<Article>();
final List<Article> tempList = this.articleService.getAllArticle();
int maxPage;
final int pageNumber = maxPage = tempList.size();
if (maxPage % 12 == 0) {
maxPage /= 12;
}
else {
maxPage = maxPage / 12 + 1;
}
if (number == null) {
number = "0";
}
final int start = Integer.parseInt(number) * 12;
int over = (Integer.parseInt(number) + 1) * 12;
final int count = pageNumber - over;
if (count <= 0) {
over = pageNumber;
}
for (int i = start; i < over; ++i) {
final Article x = tempList.get(i);
articleList.add(x);
}
String html = "";
final StringBuffer buffer = new StringBuffer();
buffer.append(" \u5171\u4e3a");
buffer.append(maxPage);
buffer.append("\u9875 \u5171\u6709");
buffer.append(pageNumber);
buffer.append("\u6761 \u5f53\u524d\u4e3a\u7b2c");
buffer.append(Integer.parseInt(number) + 1);
buffer.append("\u9875 ");
if (Integer.parseInt(number) + 1 == 1) {
buffer.append("\u9996\u9875");
}
else {
buffer.append("<a href=\"index/article.action?number=0\">\u9996\u9875</a>");
}
buffer.append(" ");
if (Integer.parseInt(number) + 1 == 1) {
buffer.append("\u4e0a\u4e00\u9875");
}
else {
buffer.append("<a href=\"index/article.action?number=" + (Integer.parseInt(number) - 1) + "\">\u4e0a\u4e00\u9875</a>");
}
buffer.append(" ");
if (maxPage <= Integer.parseInt(number) + 1) {
buffer.append("\u4e0b\u4e00\u9875");
}
else {
buffer.append("<a href=\"index/article.action?number=" + (Integer.parseInt(number) + 1) + "\">\u4e0b\u4e00\u9875</a>");
}
buffer.append(" ");
if (maxPage <= Integer.parseInt(number) + 1) {
buffer.append("\u5c3e\u9875");
}
else {
buffer.append("<a href=\"index/article.action?number=" + (maxPage - 1) + "\">\u5c3e\u9875</a>");
}
html = buffer.toString();
this.getRequest().setAttribute("html", (Object)html);
this.getRequest().setAttribute("articleList", (Object)articleList);
return "users/article";
}
@RequestMapping({ "read.action" })
public String read(final String id) {
this.front();
final Article article = this.articleService.getArticleById(id);
article.setHits(new StringBuilder().append(Integer.parseInt(article.getHits()) + 1).toString());
this.articleService.updateArticle(article);
this.getRequest().setAttribute("article", (Object)article);
return "users/read";
}
@RequestMapping({ "preLogin.action" })
public String prelogin() {
this.front();
return "users/login";
}
@RequestMapping({ "login.action" })
public String login() {
this.front();
final String username = this.getRequest().getParameter("username");
final String password = this.getRequest().getParameter("password");
final Users u = new Users();
u.setUsername(username);
final List<Users> usersList = this.usersService.getUsersByCond(u);
if (usersList.size() == 0) {
this.getSession().setAttribute("message", (Object)"\u7528\u6237\u540d\u4e0d\u5b58\u5728");
return "redirect:/index/preLogin.action";
}
final Users users = usersList.get(0);
if (password.equals(users.getPassword())) {
this.getSession().setAttribute("userid", (Object)users.getUsersid());
this.getSession().setAttribute("username", (Object)users.getUsername());
this.getSession().setAttribute("users", (Object)users);
return "redirect:/index/index.action";
}
this.getSession().setAttribute("message", (Object)"\u5bc6\u7801\u9519\u8bef");
return "redirect:/index/preLogin.action";
}
@RequestMapping({ "preReg.action" })
public String preReg() {
this.front();
return "users/register";
}
@RequestMapping({ "register.action" })
public String register(final Users users) {
this.front();
final Users u = new Users();
u.setUsername(users.getUsername());
final List<Users> usersList = this.usersService.getUsersByCond(u);
if (usersList.size() == 0) {
users.setRegdate(VeDate.getStringDateShort());
this.usersService.insertUsers(users);
return "redirect:/index/preLogin.action";
}
this.getSession().setAttribute("message", (Object)"\u7528\u6237\u540d\u5df2\u5b58\u5728");
return "redirect:/index/preReg.action";
}
@RequestMapping({ "exit.action" })
public String exit() {
this.front();
this.getSession().removeAttribute("userid");
this.getSession().removeAttribute("username");
this.getSession().removeAttribute("user
没有合适的资源?快使用搜索试试~ 我知道了~
基于SSM电影售票管理系统+sql数据库(毕设源码).zip
共2000个文件
png:1270个
js:267个
gif:219个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 87 浏览量
2023-06-12
14:06:40
上传
评论 4
收藏 25.94MB ZIP 举报
温馨提示
【资源说明】 该项目是个人毕设项目源码,综合评分达到95分,经过严格调试,确保可以运行!放心下载使用。 该项目资源主要针对计算机、自动化等相关专业的学生或从业者下载使用,也可作为期末课程设计、课程大作业、毕业设计等。 具有较高的学习借鉴价值!基础能力强的可以在此基础上修改调整,以实现类似其他功能。 ## 主要功能说明: 管理员角色包含以下功能:管理员登陆,管理员用户管理,新闻公告增删改查,电影类型增删改查,影院信息增删改查,电影信息增删改查,订单查询,电影评价管理等功能。 用户角色包含以下功能:用户首页,用户登录,查看电影详情,加入购物车,下单电影票,查看我的订单,用户中心,评价电影等功能。 ## 运行环境:jdk1.8/jdk1.9 ## IDE环境: Eclipse,Myeclipse,IDEA都可以 ## tomcat环境: Tomcat8.x/9.x ## 技术框架: HTML+CSS+JavaScript+jsp+mysql+Spring+mybatis 用户账号/密码: ysj/123456 管理员账号/密码:admin/admin
资源推荐
资源详情
资源评论
收起资源包目录
基于SSM电影售票管理系统+sql数据库(毕设源码).zip (2000个子文件)
IndexAction.class 20KB
VeDate.class 10KB
AdminAction.class 6KB
DetailsAction.class 5KB
TopicAction.class 5KB
FilmAction.class 5KB
CartAction.class 5KB
OrdersAction.class 5KB
CinemaAction.class 5KB
UsersAction.class 4KB
ArticleAction.class 4KB
CateAction.class 4KB
CityAction.class 4KB
PageHelper.class 4KB
UploadAction.class 3KB
Film.class 3KB
BaseAction.class 3KB
Details.class 3KB
AjaxAction.class 2KB
Excel.class 2KB
Users.class 2KB
Topic.class 2KB
FilmServiceImpl.class 2KB
Cart.class 2KB
Cinema.class 2KB
Orders.class 2KB
Cate.class 2KB
CateServiceImpl.class 2KB
ArticleServiceImpl.class 2KB
DetailsServiceImpl.class 2KB
CinemaServiceImpl.class 2KB
OrdersServiceImpl.class 2KB
Admin.class 2KB
Article.class 2KB
AdminServiceImpl.class 2KB
TopicServiceImpl.class 2KB
UsersServiceImpl.class 2KB
CityServiceImpl.class 2KB
CartServiceImpl.class 2KB
MD5.class 1KB
City.class 918B
FilmService.class 850B
FilmDAO.class 837B
DetailsService.class 706B
ArticleService.class 706B
DetailsDAO.class 693B
ArticleDAO.class 693B
CinemaService.class 690B
OrdersService.class 690B
CateService.class 689B
CinemaDAO.class 677B
OrdersDAO.class 677B
CateDAO.class 676B
AdminService.class 674B
TopicService.class 674B
UsersService.class 674B
TopicDAO.class 661B
AdminDAO.class 661B
UsersDAO.class 661B
CityService.class 658B
CartService.class 658B
CityDAO.class 645B
CartDAO.class 645B
.classpath 841B
org.eclipse.wst.common.component 482B
org.eclipse.wst.jsdt.ui.superType.container 49B
style.css 102KB
main.css 95KB
editor_ie7.css 48KB
editor_iequirks.css 47KB
editor_ie8.css 46KB
editor_ie.css 46KB
editor_gecko.css 45KB
editor.css 45KB
ui_custom.css 34KB
prettyPhoto.css 19KB
elfinder.css 18KB
dialog_ie7.css 17KB
dialog_ie8.css 16KB
dialog_iequirks.css 16KB
dialog_ie.css 16KB
dialog.css 15KB
fullcalendar.css 8KB
datatable.css 8KB
datepicker.css 4KB
datepicker.css 4KB
reset.css 3KB
style.css 3KB
contents.css 2KB
templates.css 2KB
toolbar.css 1KB
wsc.css 1KB
WdatePicker.css 192B
logos.gif 52KB
bg.gif 18KB
loader7.gif 9KB
service.gif 8KB
salesTitBg.gif 6KB
loader.gif 6KB
loader11.gif 5KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
z同学的编程之路
- 粉丝: 2481
- 资源: 2135
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功