当前位置: 首页 > news >正文

Java项目:112SSM在线电影订票系统

博主主页:Java旅途
简介:分享计算机知识、学习路线、系统源码及教程
文末获取源码

一、项目介绍

在线电影订票系统基于Spring+SpringMVC+Mybatis开发,系统分为前台和后台,前台主要用来用户浏览电影信息,订票,评价等操作,后台主要是用来管理电影,用户等。

前台功能如下:

  • 网站公告
  • 推荐电影
  • 全部电影
  • 电影订票
  • 电影评价
  • 我的订单
  • 购物车
  • 个人中心,

后台功能如下:

  • 管理员信息
  • 网站用户信息
  • 新闻公告信息
  • 电影类型信息
  • 城市信息
  • 影院信息
  • 电影信息
  • 订单信息
  • 电影评价信息等功能

二、技术框架

  • 后端:Spring,Springmvc,Mybatis
  • 前端:jquery,bootstrap

三、安装教程

  1. 用idea打开项目
  2. 在idea中配置jdk环境
  3. 配置tomcat8.0
  4. 新建数据库,导入数据库文件
  5. 在springmvc-servlet.xml文件中将数据库账号密码改成自己本地的
  6. 启动运行, 后台管理员账号密码 admin/123456,前台用户账号密码 xiaoli/123456

四、运行截图

image-20230712103609782

sy

tj

image-20230712103847027

image-20230712103936538

image-20230712103954221

image-20230712104013433

五、相关代码

FilmAction

package com.action;import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.entity.Film;
import com.service.FilmService;
import com.entity.Cate;
import com.service.CateService;
import com.util.PageHelper;//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/film", produces = "text/plain;charset=utf-8")
public class FilmAction extends BaseAction {// 注入Service 由于标签的存在 所以不需要getter setter@Autowired@Resourceprivate FilmService filmService;@Autowired@Resourceprivate CateService cateService;// 准备添加数据@RequestMapping("createFilm.action")public String createFilm() {List<Cate> cateList = this.cateService.getAllCate();this.getRequest().setAttribute("cateList", cateList);return "admin/addfilm";}// 添加数据//-------------------------请加作者QQ协助运行: 549710689-----------------------------//-------------------------请加作者QQ协助运行: 549710689-----------------------------@RequestMapping("addFilm.action")public String addFilm(Film film) {film.setHits("0");film.setSellnum("0");this.filmService.insertFilm(film);return "redirect:/film/createFilm.action";}// 通过主键删除数据@RequestMapping("deleteFilm.action")public String deleteFilm(String id) {this.filmService.deleteFilm(id);return "redirect:/film/getAllFilm.action";}// 批量删除数据@RequestMapping("deleteFilmByIds.action")public String deleteFilmByIds() {String[] ids = this.getRequest().getParameterValues("filmid");for (String filmid : ids) {this.filmService.deleteFilm(filmid);}return "redirect:/film/getAllFilm.action";}// 更新数据@RequestMapping("updateFilm.action")public String updateFilm(Film film) {this.filmService.updateFilm(film);return "redirect:/film/getAllFilm.action";}// 显示全部数据@RequestMapping("getAllFilm.action")public String getAllFilm(String number) {List<Film> filmList = this.filmService.getAllFilm();PageHelper.getPage(filmList, "film", null, null, 10, number, this.getRequest(), null);return "admin/listfilm";}// 按条件查询数据 (模糊查询)@RequestMapping("queryFilmByCond.action")public String queryFilmByCond(String cond, String name, String number) {Film film = new Film();if (cond != null) {if ("filmname".equals(cond)) {film.setFilmname(name);}if ("image".equals(cond)) {film.setImage(name);}if ("cateid".equals(cond)) {film.setCateid(name);}if ("price".equals(cond)) {film.setPrice(name);}if ("recommend".equals(cond)) {film.setRecommend(name);}if ("thestart".equals(cond)) {film.setThestart(name);}if ("theend".equals(cond)) {film.setTheend(name);}if ("hits".equals(cond)) {film.setHits(name);}if ("sellnum".equals(cond)) {film.setSellnum(name);}if ("contents".equals(cond)) {film.setContents(name);}}List<String> nameList = new ArrayList<String>();List<String> valueList = new ArrayList<String>();nameList.add(cond);valueList.add(name);PageHelper.getPage(this.filmService.getFilmByLike(film), "film", nameList, valueList, 10, number, this.getRequest(), "query");name = null;cond = null;return "admin/queryfilm";}// 按主键查询数据@RequestMapping("getFilmById.action")public String getFilmById(String id) {Film film = this.filmService.getFilmById(id);this.getRequest().setAttribute("film", film);List<Cate> cateList = this.cateService.getAllCate();this.getRequest().setAttribute("cateList", cateList);return "admin/editfilm";}public FilmService getFilmService() {return filmService;}public void setFilmService(FilmService filmService) {this.filmService = filmService;}}

IndexAction

package com.action;import java.util.ArrayList;
import java.util.List;import javax.annotation.Resource;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;import com.entity.Article;
import com.entity.Cart;
import com.entity.Cate;
import com.entity.City;
import com.entity.Details;
import com.entity.Film;
import com.entity.Orders;
import com.entity.Topic;
import com.entity.Users;
import com.service.ArticleService;
import com.service.CartService;
import com.service.CateService;
import com.service.CinemaService;
import com.service.CityService;
import com.service.DetailsService;
import com.service.FilmService;
import com.service.OrdersService;
import com.service.TopicService;
import com.service.UsersService;
import com.util.VeDate;//定义为控制器
@Controller
// 设置路径
@RequestMapping("/index")
public class IndexAction extends BaseAction {@Autowired@Resourceprivate UsersService usersService;@Autowired@Resourceprivate ArticleService articleService;@Autowired@Resourceprivate CateService cateService;@Autowired@Resourceprivate CityService cityService;@Autowired@Resourceprivate CinemaService cinemaService;@Autowired@Resourceprivate FilmService filmService;@Autowired@Resourceprivate CartService cartService;@Autowired@Resourceprivate OrdersService ordersService;@Autowired@Resourceprivate DetailsService detailsService;@Autowired@Resourceprivate TopicService topicService;// 公共方法 提供公共查询数据private void front() {this.getRequest().setAttribute("title", "在线电影订票系统");List<Cate> cateList = this.cateService.getAllCate();this.getRequest().setAttribute("cateList", cateList);List<Film> hotList = this.filmService.getFilmByHot();this.getRequest().setAttribute("hotList", hotList);}// 首页显示@RequestMapping("index.action")public String index() {this.front();List<Cate> cateList = this.cateService.getCateFront();List<Cate> frontList = new ArrayList<Cate>();for (Cate cate : cateList) {List<Film> flimList = this.filmService.getFilmByCate(cate.getCateid());cate.setFlimList(flimList);frontList.add(cate);}this.getRequest().setAttribute("frontList", frontList);return "users/index";}// 公告@RequestMapping("article.action")public String article(String number) {this.front();List<Article> articleList = new ArrayList<Article>();List<Article> tempList = this.articleService.getAllArticle();int pageNumber = tempList.size();int maxPage = pageNumber;if (maxPage % 12 == 0) {maxPage = maxPage / 12;} else {maxPage = maxPage / 12 + 1;}if (number == null) {number = "0";}int start = Integer.parseInt(number) * 12;int over = (Integer.parseInt(number) + 1) * 12;int count = pageNumber - over;if (count <= 0) {over = pageNumber;}for (int i = start; i < over; i++) {Article x = tempList.get(i);articleList.add(x);}String html = "";StringBuffer buffer = new StringBuffer();buffer.append("&nbsp;&nbsp;共为");buffer.append(maxPage);buffer.append("页&nbsp; 共有");buffer.append(pageNumber);buffer.append("条&nbsp; 当前为第");buffer.append((Integer.parseInt(number) + 1));buffer.append("页 &nbsp;");if ((Integer.parseInt(number) + 1) == 1) {buffer.append("首页");} else {buffer.append("<a href=\"index/article.action?number=0\">首页</a>");}buffer.append("&nbsp;&nbsp;");if ((Integer.parseInt(number) + 1) == 1) {buffer.append("上一页");} else {buffer.append("<a href=\"index/article.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>");}buffer.append("&nbsp;&nbsp;");if (maxPage <= (Integer.parseInt(number) + 1)) {buffer.append("下一页");} else {buffer.append("<a href=\"index/article.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>");}buffer.append("&nbsp;&nbsp;");if (maxPage <= (Integer.parseInt(number) + 1)) {buffer.append("尾页");} else {buffer.append("<a href=\"index/article.action?number=" + (maxPage - 1) + "\">尾页</a>");}html = buffer.toString();this.getRequest().setAttribute("html", html);this.getRequest().setAttribute("articleList", articleList);return "users/article";}// 阅读公告@RequestMapping("read.action")public String read(String id) {this.front();Article article = this.articleService.getArticleById(id);article.setHits("" + (Integer.parseInt(article.getHits()) + 1));this.articleService.updateArticle(article);this.getRequest().setAttribute("article", article);return "users/read";}// 准备登录@RequestMapping("preLogin.action")public String prelogin() {this.front();return "users/login";}// 用户登录@RequestMapping("login.action")public String login() {this.front();String username = this.getRequest().getParameter("username");String password = this.getRequest().getParameter("password");Users u = new Users();u.setUsername(username);List<Users> usersList = this.usersService.getUsersByCond(u);if (usersList.size() == 0) {this.getSession().setAttribute("message", "用户名不存在");return "redirect:/index/preLogin.action";} else {Users users = usersList.get(0);if (password.equals(users.getPassword())) {this.getSession().setAttribute("userid", users.getUsersid());this.getSession().setAttribute("username", users.getUsername());this.getSession().setAttribute("users", users);return "redirect:/index/index.action";} else {this.getSession().setAttribute("message", "密码错误");return "redirect:/index/preLogin.action";}}}// 准备注册@RequestMapping("preReg.action")public String preReg() {this.front();return "users/register";}// 用户注册@RequestMapping("register.action")public String register(Users users) {this.front();Users u = new Users();u.setUsername(users.getUsername());List<Users> usersList = this.usersService.getUsersByCond(u);if (usersList.size() == 0) {users.setRegdate(VeDate.getStringDateShort());this.usersService.insertUsers(users);} else {this.getSession().setAttribute("message", "用户名已存在");return "redirect:/index/preReg.action";}return "redirect:/index/preLogin.action";}// 退出登录@RequestMapping("exit.action")public String exit() {this.front();this.getSession().removeAttribute("userid");this.getSession().removeAttribute("username");this.getSession().removeAttribute("users");return "index";}// 准备修改密码@RequestMapping("prePwd.action")public String prePwd() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}return "users/editpwd";}// 修改密码@RequestMapping("editpwd.action")public String editpwd() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}String userid = (String) this.getSession().getAttribute("userid");String password = this.getRequest().getParameter("password");String repassword = this.getRequest().getParameter("repassword");Users users = this.usersService.getUsersById(userid);if (password.equals(users.getPassword())) {users.setPassword(repassword);this.usersService.updateUsers(users);} else {this.getSession().setAttribute("message", "旧密码错误");return "redirect:/index/prePwd.action";}return "redirect:/index/prePwd.action";}@RequestMapping("usercenter.action")public String usercenter() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}return "users/usercenter";}@RequestMapping("userinfo.action")public String userinfo() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}String userid = (String) this.getSession().getAttribute("userid");this.getSession().setAttribute("users", this.usersService.getUsersById(userid));return "users/userinfo";}@RequestMapping("personal.action")public String personal(Users users) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}this.usersService.updateUsers(users);return "redirect:/index/userinfo.action";}// 添加产品到购物车@RequestMapping("addcart.action")public String addcart() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}String userid = (String) this.getSession().getAttribute("userid");Cart cart = new Cart();cart.setFilmid(getRequest().getParameter("goodsid"));cart.setNum(getRequest().getParameter("num"));cart.setPrice(getRequest().getParameter("price"));cart.setUsersid(userid);this.cartService.insertCart(cart);return "redirect:/index/cart.action";}// 查看购物车@RequestMapping("cart.action")public String cart() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}String userid = (String) this.getSession().getAttribute("userid");Cart cart = new Cart();cart.setUsersid(userid);List<Cart> cartList = this.cartService.getCartByCond(cart);this.getRequest().setAttribute("cartList", cartList);return "users/cart";}// 删除购物车中的产品@RequestMapping("deletecart.action")public String deletecart(String id) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}this.cartService.deleteCart(id);return "redirect:/index/cart.action";}// 准备结算@RequestMapping("preCheckout.action")public String preCheckout() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}String userid = (String) this.getSession().getAttribute("userid");Cart cart = new Cart();cart.setUsersid(userid);List<Cart> cartList = this.cartService.getCartByCond(cart);if (cartList.size() == 0) {this.getSession().setAttribute("message", "请选购商品");return "redirect:/index/cart.action";}List<City> cityList = this.cityService.getAllCity();this.getRequest().setAttribute("cityList", cityList);return "users/checkout";}// 结算@RequestMapping("checkout.action")public String checkout() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}String userid = (String) this.getSession().getAttribute("userid");Cart cart1 = new Cart();cart1.setUsersid(userid);List<Cart> cartList = this.cartService.getCartByCond(cart1);if (cartList.size() == 0) {this.getRequest().setAttribute("message", "请选购商品");return "redirect:/index/cart.action";} else {// 获取一个1200-9999的随机数 防止同时提交String ordercode = "PD" + VeDate.getStringDatex();double total = 0;for (Cart cart : cartList) {Details details = new Details();details.setDetailsid(VeDate.getStringDatex() + (Math.random() * 9 + 1) * 1200);details.setFilmid(cart.getFilmid());details.setNum(cart.getNum());details.setOrdercode(ordercode);details.setPrice(cart.getPrice());details.setCinemaid(this.getRequest().getParameter("cinemaid"));details.setCityid(this.getRequest().getParameter("cityid"));details.setViewdate(this.getRequest().getParameter("viewdate"));this.detailsService.insertDetails(details);Film goods = this.filmService.getFilmById(cart.getFilmid());goods.setSellnum("" + (Integer.parseInt(goods.getSellnum()) + Integer.parseInt(cart.getNum())));this.filmService.updateFilm(goods);total += Double.parseDouble(cart.getPrice()) * Double.parseDouble(cart.getNum());this.cartService.deleteCart(cart.getCartid());}Orders orders = new Orders();orders.setAddtime(VeDate.getStringDateShort());orders.setOrdercode(ordercode);orders.setStatus("未付款");orders.setTotal("" + total);orders.setUsersid(userid);this.ordersService.insertOrders(orders);}return "redirect:/index/showOrders.action";}// 查看订购@RequestMapping("showOrders.action")public String showOrders(String number) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}String userid = (String) this.getSession().getAttribute("userid");Orders orders = new Orders();orders.setUsersid(userid);List<Orders> ordersList = new ArrayList<Orders>();List<Orders> tempList = this.ordersService.getOrdersByCond(orders);int pageNumber = tempList.size();int maxPage = pageNumber;if (maxPage % 12 == 0) {maxPage = maxPage / 12;} else {maxPage = maxPage / 12 + 1;}if (number == null) {number = "0";}int start = Integer.parseInt(number) * 12;int over = (Integer.parseInt(number) + 1) * 12;int count = pageNumber - over;if (count <= 0) {over = pageNumber;}for (int i = start; i < over; i++) {Orders o = tempList.get(i);ordersList.add(o);}String html = "";StringBuffer buffer = new StringBuffer();buffer.append("&nbsp;&nbsp;共为");buffer.append(maxPage);buffer.append("页&nbsp; 共有");buffer.append(pageNumber);buffer.append("条&nbsp; 当前为第");buffer.append((Integer.parseInt(number) + 1));buffer.append("页 &nbsp;");if ((Integer.parseInt(number) + 1) == 1) {buffer.append("首页");} else {buffer.append("<a href=\"index/showOrders.action?number=0\">首页</a>");}buffer.append("&nbsp;&nbsp;");if ((Integer.parseInt(number) + 1) == 1) {buffer.append("上一页");} else {buffer.append("<a href=\"index/showOrders.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>");}buffer.append("&nbsp;&nbsp;");if (maxPage <= (Integer.parseInt(number) + 1)) {buffer.append("下一页");} else {buffer.append("<a href=\"index/showOrders.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>");}buffer.append("&nbsp;&nbsp;");if (maxPage <= (Integer.parseInt(number) + 1)) {buffer.append("尾页");} else {buffer.append("<a href=\"index/showOrders.action?number=" + (maxPage - 1) + "\">尾页</a>");}html = buffer.toString();this.getRequest().setAttribute("html", html);this.getRequest().setAttribute("ordersList", ordersList);return "users/orderlist";}// 准备付款@RequestMapping("prePay.action")public String prePay(String id) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}this.getRequest().setAttribute("id", id);return "users/pay";}// 付款@RequestMapping("pay.action")public String pay(String id) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}Orders orders = this.ordersService.getOrdersById(this.getRequest().getParameter("id"));orders.setStatus("已付款");this.ordersService.updateOrders(orders);return "redirect:/index/showOrders.action";}// 确认收货@RequestMapping("over.action")public String over(String id) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}Orders orders = this.ordersService.getOrdersById(this.getRequest().getParameter("id"));orders.setStatus("已收货");this.ordersService.updateOrders(orders);return "redirect:/index/showOrders.action";}// 取消订单@RequestMapping("cancel.action")public String cancel(String id) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}Orders orders = this.ordersService.getOrdersById(this.getRequest().getParameter("id"));orders.setStatus("已取消");this.ordersService.updateOrders(orders);return "redirect:/index/showOrders.action";}// 订单明细@RequestMapping("orderdetail.action")public String orderdetail(String id) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}Details details = new Details();details.setOrdercode(id);List<Details> detailsList = this.detailsService.getDetailsByCond(details);this.getRequest().setAttribute("detailsList", detailsList);return "users/orderdetail";}// 按分类查询@RequestMapping("cate.action")public String cate(String id, String number) {this.front();Film goods = new Film();goods.setCateid(id);List<Film> flimList = new ArrayList<Film>();List<Film> tempList = this.filmService.getFilmByCond(goods);int pageNumber = tempList.size();int maxPage = pageNumber;if (maxPage % 12 == 0) {maxPage = maxPage / 12;} else {maxPage = maxPage / 12 + 1;}if (number == null) {number = "0";}int start = Integer.parseInt(number) * 12;int over = (Integer.parseInt(number) + 1) * 12;int count = pageNumber - over;if (count <= 0) {over = pageNumber;}for (int i = start; i < over; i++) {Film x = tempList.get(i);flimList.add(x);}String html = "";StringBuffer buffer = new StringBuffer();buffer.append("&nbsp;&nbsp;共为");buffer.append(maxPage);buffer.append("页&nbsp; 共有");buffer.append(pageNumber);buffer.append("条&nbsp; 当前为第");buffer.append((Integer.parseInt(number) + 1));buffer.append("页 &nbsp;");if ((Integer.parseInt(number) + 1) == 1) {buffer.append("首页");} else {buffer.append("<a href=\"index/cate.action?number=0&id=\" + id+ \"\">首页</a>");}buffer.append("&nbsp;&nbsp;");if ((Integer.parseInt(number) + 1) == 1) {buffer.append("上一页");} else {buffer.append("<a href=\"index/cate.action?number=" + (Integer.parseInt(number) - 1) + "&id=\" + id+ \"\">上一页</a>");}buffer.append("&nbsp;&nbsp;");if (maxPage <= (Integer.parseInt(number) + 1)) {buffer.append("下一页");} else {buffer.append("<a href=\"index/cate.action?number=" + (Integer.parseInt(number) + 1) + "&id=\" + id+ \"\">下一页</a>");}buffer.append("&nbsp;&nbsp;");if (maxPage <= (Integer.parseInt(number) + 1)) {buffer.append("尾页");} else {buffer.append("<a href=\"index/cate.action?number=" + (maxPage - 1) + "&id=\" + id+ \"\">尾页</a>");}html = buffer.toString();this.getRequest().setAttribute("html", html);this.getRequest().setAttribute("flimList", flimList);return "users/list";}// 推荐产品@RequestMapping("recommend.action")public String recommend(String number) {this.front();Film goods = new Film();goods.setRecommend("是");List<Film> flimList = new ArrayList<Film>();List<Film> tempList = this.filmService.getFilmByCond(goods);int pageNumber = tempList.size();int maxPage = pageNumber;if (maxPage % 12 == 0) {maxPage = maxPage / 12;} else {maxPage = maxPage / 12 + 1;}if (number == null) {number = "0";}int start = Integer.parseInt(number) * 12;int over = (Integer.parseInt(number) + 1) * 12;int count = pageNumber - over;if (count <= 0) {over = pageNumber;}for (int i = start; i < over; i++) {Film x = tempList.get(i);flimList.add(x);}String html = "";StringBuffer buffer = new StringBuffer();buffer.append("&nbsp;&nbsp;共为");buffer.append(maxPage);buffer.append("页&nbsp; 共有");buffer.append(pageNumber);buffer.append("条&nbsp; 当前为第");buffer.append((Integer.parseInt(number) + 1));buffer.append("页 &nbsp;");if ((Integer.parseInt(number) + 1) == 1) {buffer.append("首页");} else {buffer.append("<a href=\"index/recommend.action?number=0\">首页</a>");}buffer.append("&nbsp;&nbsp;");if ((Integer.parseInt(number) + 1) == 1) {buffer.append("上一页");} else {buffer.append("<a href=\"index/recommend.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>");}buffer.append("&nbsp;&nbsp;");if (maxPage <= (Integer.parseInt(number) + 1)) {buffer.append("下一页");} else {buffer.append("<a href=\"index/recommend.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>");}buffer.append("&nbsp;&nbsp;");if (maxPage <= (Integer.parseInt(number) + 1)) {buffer.append("尾页");} else {buffer.append("<a href=\"index/recommend.action?number=" + (maxPage - 1) + "\">尾页</a>");}html = buffer.toString();this.getRequest().setAttribute("html", html);this.getRequest().setAttribute("flimList", flimList);return "users/list";}// 全部产品@RequestMapping("all.action")public String all(String number) {this.front();List<Film> flimList = new ArrayList<Film>();List<Film> tempList = this.filmService.getAllFilm();int pageNumber = tempList.size();int maxPage = pageNumber;if (maxPage % 12 == 0) {maxPage = maxPage / 12;} else {maxPage = maxPage / 12 + 1;}if (number == null) {number = "0";}int start = Integer.parseInt(number) * 12;int over = (Integer.parseInt(number) + 1) * 12;int count = pageNumber - over;if (count <= 0) {over = pageNumber;}for (int i = start; i < over; i++) {Film x = tempList.get(i);flimList.add(x);}String html = "";StringBuffer buffer = new StringBuffer();buffer.append("&nbsp;&nbsp;共为");buffer.append(maxPage);buffer.append("页&nbsp; 共有");buffer.append(pageNumber);buffer.append("条&nbsp; 当前为第");buffer.append((Integer.parseInt(number) + 1));buffer.append("页 &nbsp;");if ((Integer.parseInt(number) + 1) == 1) {buffer.append("首页");} else {buffer.append("<a href=\"index/all.action?number=0\">首页</a>");}buffer.append("&nbsp;&nbsp;");if ((Integer.parseInt(number) + 1) == 1) {buffer.append("上一页");} else {buffer.append("<a href=\"index/all.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>");}buffer.append("&nbsp;&nbsp;");if (maxPage <= (Integer.parseInt(number) + 1)) {buffer.append("下一页");} else {buffer.append("<a href=\"index/all.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>");}buffer.append("&nbsp;&nbsp;");if (maxPage <= (Integer.parseInt(number) + 1)) {buffer.append("尾页");} else {buffer.append("<a href=\"index/all.action?number=" + (maxPage - 1) + "\">尾页</a>");}html = buffer.toString();this.getRequest().setAttribute("html", html);this.getRequest().setAttribute("flimList", flimList);return "users/list";}// 查询商品@RequestMapping("query.action")public String query(String name) {this.front();Film goods = new Film();goods.setFilmname(name);List<Film> flimList = this.filmService.getFilmByLike(goods);this.getRequest().setAttribute("flimList", flimList);return "users/list";}// 商品详情@RequestMapping("detail.action")public String detail(String id) {this.front();Film goods = this.filmService.getFilmById(id);goods.setHits("" + (Integer.parseInt(goods.getHits()) + 1));this.filmService.updateFilm(goods);this.getRequest().setAttribute("goods", goods);Topic topic = new Topic();topic.setFilmid(id);List<Topic> topicList = this.topicService.getTopicByCond(topic);this.getRequest().setAttribute("topicList", topicList);this.getRequest().setAttribute("tnum", topicList.size());return "users/detail";}@RequestMapping("addTopic.action")public String addTopic(Topic topic) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}String userid = (String) this.getSession().getAttribute("userid");topic.setAddtime(VeDate.getStringDateShort());topic.setContents(this.getRequest().getParameter("contents"));topic.setFilmid(this.getRequest().getParameter("goodsid"));topic.setNum(this.getRequest().getParameter("num"));topic.setUsersid(userid);this.topicService.insertTopic(topic);return "redirect:/index/detail.action?id=" + topic.getFilmid();}}

大家点赞、收藏、关注、评论啦 、👇🏻点开下方卡片👇🏻关注后回复 103

相关文章:

Java项目:112SSM在线电影订票系统

博主主页&#xff1a;Java旅途 简介&#xff1a;分享计算机知识、学习路线、系统源码及教程 文末获取源码 一、项目介绍 在线电影订票系统基于SpringSpringMVCMybatis开发&#xff0c;系统分为前台和后台&#xff0c;前台主要用来用户浏览电影信息&#xff0c;订票&#xff0c…...

Echarts——使用graphic组件在一个option内同时设置两个饼图的背景图

使用echarts的graphic原生图形元素组件&#xff0c;为两个饼图设置对应背景。 <template><div id"app"><div class"charts" ref"charts"></div></div> </template><script> import * as echarts from…...

编程笔记 html5cssjs 027 HTML输入属性(1/2)

[TOC](编程笔记 html5&css&js 027 HTML输入属性(1/2)) <input>元素除了type属性表示输入类型&#xff0c;后面还跟上其他属性&#xff0c;叫输入属性。 value 属性 value 属性规定输入字段的初始值&#xff1a; <form action"">First name:<…...

请求参数乱码问题

POST请求方式解决乱码问题 在web.xml里面设置编码过滤器 <filter><filter-name>CharacterEncodingFilter</filter-name><filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class><!-- 设置过滤器中的属性值 -…...

【leetcode】力扣热门之反转链表【简单难度】

题目描述 给你单链表的头节点 head &#xff0c;请你反转链表&#xff0c;并返回反转后的链表。 用例 输入&#xff1a;head [1,2,3,4,5] 输出&#xff1a;[5,4,3,2,1] 输入&#xff1a;head [1,2] 输出&#xff1a;[2,1] 输入&#xff1a;head [] 输出&#xff1a;[…...

【sgPasswordInput】自定义组件:带前端校验密码强度的密码输入框,能够提供密码强度颜色提示和文字提示

特性&#xff1a; 有密码强度颜色提示密码强度进度条提示支持设置默认输入提示和密码长度 sgPasswordInput源码 <template><div :class"$options.name" style"width: 100%"><el-inputstyle"width: 100%"ref"psw"type&…...

1599 - Ideal Path (UVA)

题目链接如下&#xff1a; https://onlinejudge.org/index.php?optioncom_onlinejudge&Itemid8&category448&pageshow_problem&problem4474 这道题也是看了刘汝佳的思路才写出来的.... 代码如下&#xff1a; #include <cstdio> #include <deque&…...

计算机网络(超级详细笔记)

使用教材计算机网络&#xff08;第8版&#xff09;&#xff08;谢希仁&#xff09; 第一章&#xff1a;概述 第二章&#xff1a;物理层 第三章&#xff1a;数据链路层 第四章&#xff1a;网络层 第五章&#xff1a;运输层 第六章&#xff1a;应用层 目…...

老杨说运维 | 年末大讲回顾:运维的尽头也是大模型吗?

哈喽~朋友们&#xff0c;这么快又见面啦。前阵子我们给CEO老杨安排了一场年末大讲&#xff0c;主要是跟大家聊聊智能运维的“智”与“能”以及剖析时下热点----运维大模型。后台收到了不少朋友的反馈&#xff0c;小编看了大受鼓舞并暗下决心----新的一年&#xff0c;希望能多安…...

Unity 利用UGUI之Scrollbar制作进度条

在Unity中除了用Slider、Image做进度条&#xff0c;其实用Scrollbar也可以做进度条。 首先&#xff0c;在场景中新建一个Scrollbar组件和一个Text组件&#xff1a; 其次&#xff0c;创建模拟进度的一个脚本&#xff0c;Scrollbar_Progressbar.cs: using System.Collections; …...

MySQL之导入、导出

文章目录 1.navicat导入导出2.mysqldump命令导入导出2.1导出2.2导入 3.load data infile命令导入导出4.远程备份5.思维导图 1.navicat导入导出 使用Navicat工具导入t_log 共耗时 55s 2.mysqldump命令导入导出 2.1导出 导出表数据和表结构 语法&#xff1a; mysqldump -u用…...

【unity小技巧】FPS游戏实现相机的偏移震动、武器射击后退和后坐力效果

最终效果 文章目录 最终效果前言相机偏移震动相机震动脚本换弹节点震动 武器射击后退效果武器后坐力效果完结 前言 关于后坐力之前其实已经分享了一个&#xff1a;FPS游戏后坐力制作思路 但是实现起来比较复杂&#xff0c;如果你只是想要简单的实现&#xff0c;可以看看这个&…...

MINCO+汽车

规划典型的解决方法: 如何准确的描述他的动力学,实际上是对这个物理对象进行建模.(规划等于开环的控制,控制等于闭环的规划),规划系统要做到是假设已知系统模型的情况下去计算一些可能会影响比较好的 未来运动的指令,做未来运动轨迹的推演.对自己建模的情况下还需对环境有个比较…...

大模型机器人发展史:从VoxPoser、RT2到斯坦福Mobile ALOHA、Google机器人

前言 23年7月&#xff0c;我在朋友圈评估Google的RT2说道&#xff1a; “大模型正在革新一切领域啊&#xff0c;超帅&#xff0c;通过大模型不仅能理解“人话”&#xff0c;还能对“人话”进行推理&#xff0c;并转变为机器人能理解的指令&#xff0c;从而分阶段完成任务。回…...

Ubunutu18.04 ROS melodic 无人机 XTDrone PX4 Vins-Fuison 运行配置

一、PX4飞控EKF配置 PX4默认使用的EKF配置为融合GPS的水平位置与气压计高度。如果我们想使用视觉定位&#xff0c;就需要把修改配置文件。让EKF融合来自mavros/vision_pose/pose的数据 1.1修改rcS配置文件 gedit ~/PX4_Firmware/ROMFS/px4fmu_common/init.d-posix/rcS 通过注…...

Linux 常见服务配置

笔记所以内容很多&#xff0c;建议选择性看看 SSH Secure Shell 用于与服务器建立安全的连接 对应服务 sshd 注意&#xff1a;配置文件 配制文件修改需要重启或重载sshd服务才能生效 systemctl sshd reload # 重载 sshd 配置文件 systemctl sshd restart # 重启 ssh…...

Flutter基础

一、关键字 class&#xff1a;用于定义一个新的类&#xff1b; extends: 用于指定一个类继承另一个类&#xff1b; mixin: 用于将一个类的代码片段添加到另一个类中&#xff0c;实现代码复用&#xff1b; abstract: 用于声明一个抽象类或抽象方法&#xff0c;不能直接实例化&a…...

MySQL-数据库概述

数据库相关概念&#xff1a; 数据库(DateBase)简称DB,就是一个存储数据的仓库&#xff0c;数据有组织的进行存储。 数据库分为关系型数据库简称RDBMS和非关系型数据库 关系型数据库简称RDBMS:建立在关系模型的基础上&#xff0c;由多张相互连接的二维表组成的数据库.简单来说…...

HTML---JQurey的基本使用

文章目录 前言一、pandas是什么&#xff1f;二、使用步骤 1.引入库2.读入数据总结 本章目标 &#xff08;1&#xff09;能够搭建jQuery开发环境 &#xff08;2&#xff09;使用ready( )方法加载页面、掌握jQuery语法 使用addClass( )方法和css( )方法为元素添加CSS样式使用n…...

搜索docker镜像

要查看Docker镜像库&#xff0c;可以使用docker search命令。 docker search <关键词>例如&#xff0c;如果你想要查找名为nginx的镜像&#xff0c;可以执行以下命令&#xff1a; docker search nginx命令执行后&#xff0c;将会列出所有与关键词nginx相关的Docker镜像…...

旋变检测AD2s1205手册学习笔记

旋变故障检测故障表 信号丢失检测 检测原理&#xff1a;任一旋变输入(正弦或余弦)降至指定的LOS正弦/余弦阈值 以下时&#xff0c;器件会检测到信号丢失(LOS)。AD2S1205通过将 监视信号与固定最小值进行比较检测此点 丢失的效果表现&#xff1a;LOS由DOS和LOT引脚均闩锁为逻辑…...

【温故而知新】JavaScript的防抖与节流

一、概念 JavaScript中的防抖&#xff08;debounce&#xff09;和节流&#xff08;throttle&#xff09;是用于控制函数执行频率的技术。 防抖&#xff1a;当一个事件连续触发时&#xff0c;防抖技术将只执行最后一次触发事件的函数调用。换句话说&#xff0c;只有在停止触发…...

C++模板——(3)类模板

归纳编程学习的感悟&#xff0c; 记录奋斗路上的点滴&#xff0c; 希望能帮到一样刻苦的你&#xff01; 如有不足欢迎指正&#xff01; 共同学习交流&#xff01; &#x1f30e;欢迎各位→点赞 &#x1f44d; 收藏⭐ 留言​&#x1f4dd; 勤奋&#xff0c;机会&#xff0c;乐观…...

深度学习中Epoch和Batch Size的关系

在深度学习中&#xff0c;Epoch&#xff08;周期&#xff09;和 Batch Size&#xff08;批大小&#xff09;是训练神经网络时经常使用的两个重要的超参数。它们之间的关系是通过以下方式连接的&#xff1a; Epoch&#xff08;周期&#xff09;&#xff1a; Epoch 表示整个训练…...

Python采集微博评论做词云图

嗨喽~大家好呀&#xff0c;这里是魔王呐 ❤ ~! python更多源码/资料/解答/教程等 点击此处跳转文末名片免费获取 环境使用: Python 3.10 Pycharm 第三方模块使用: import requests >>> pip install requests import wordcloud >>> pip install wordclou…...

一文详解VScode 的远程开发

VS code登录服务器后进行编码和调试&#xff0c;VS code上的所有功能都可以使用&#xff0c;和在本地开发基本无区别。 一、配置免密远程登录 因为是要远程登录&#xff0c;那么需要通过使用ssh进行密钥对登录&#xff0c;这样每次登录服务器就可以不用输入密码了。 先来一句官…...

捕捉“五彩斑斓的黑”:锗基短波红外相机的多种成像应用

红外处于人眼可观察范围以外&#xff0c;为我们了解未知领域提供了新的途径。红外又可以根据波段范围&#xff0c;分为短波红外、中波红外与长波红外。较短的SWIR波长——大约900nm-1700nm——与可见光范围内的光子表现相似。虽然在SWIR中目标的光谱含量不同&#xff0c;但所产…...

解读 Sobit v2:铭文资产跨链更注重安全、易用性

铭文市场的发展正在从早期的“无序”进入到“有序”阶段&#xff0c;我们看到从 12 月份以来&#xff0c;比特币生态内的多个应用纷纷宣布获得融资。这表明&#xff0c;目前仍旧有大量的资金有意向铭文领域&#xff0c;同样铭文赛道新一轮浪潮或许正在酝酿。 另一方面&#xff…...

[开源]万界星空开源MES系统,支持低代码大屏设计

一、开源系统概述&#xff1a; 万界星空科技免费MES、开源MES、商业开源MES、商业开源低代码MES、市面上最好的开源MES、MES源代码、免费MES、免费智能制造系统、免费排产系统、免费排班系统、免费质检系统、免费生产计划系统、精美的数据大屏。 二、开源协议&#xff1a; 使…...

开源软件运维安全防护的六个手段

开源&#xff0c;顾名思义&#xff0c;即开放软件源代码。代码贡献者可将自己编写的程序提交到开源社区的公开平台上&#xff0c;其他代码开发者如有类似的功能需求可以不必再自己动脑动手编写代码&#xff0c;而是直接集成、修改或应用贡献者公开的代码。 开源软件是通过特定…...

收录批量查询/seo网站关键词优化软件

1、温度转换 while True:a int(input("摄氏度转换为华氏度请按1\n华氏度转换为摄氏度请按2\n"))if a 1:celsius float(input("请输入摄氏度&#xff1a;"))# 计算华氏温度fahrenheit (celsius 1.8) 32 # f c9/532print({:.2f}摄氏度转换为华氏度为…...

佛山网站建设的首选公司/百度上传自己个人简介

5.1 整数的进制输出 print(%s%hello world) >hello world print(%o%20) # 八进制输出 >24 print(%d%20) # 十进制输出 >20 print(%x%20) # 十六进制输出 >145.2 浮点数输出 print(%.3f % 3.1415926) # 保留3位小数位 >3.142 print(%.3e % …...

建网站公司销售/优量汇广告平台

偶然在网上看到的编程题&#xff0c;感觉挺有意思的。但是没有在网上找到对应的题目和解析&#xff0c;所以没法测试算法的正确性&#xff0c;下面写一下思路&#xff0c;供大家参考&#xff0c;如果有纰漏之处还望指出。关于不曾下降过的序列递增应该由如下方式组成&#xff1…...

征集二级网站建设意见 通知/线上营销推广

之前我发布过一篇对urp的内置shader lit的结构解析&#xff0c;发现自己说的也不完善&#xff0c;这次直接对源码进行一个解析&#xff0c;并提升一下自己的记忆。 如果你找不到这个shader&#xff0c;那么就有可能你不是urp渲染管线。自己搜索。 在前向渲染pass里面&#xf…...

做网站需要具备什么/网站模板中心

HttpWatch是功能强大的网页数据分析工具&#xff0c;集成在IE工具栏&#xff0c;主要功能有网页摘要、cookies管理、缓存管理、消息头发送/接收&#xff0c;字符查询、POST数据、目录管理功能和报告输出。HttpWatch是一款能够收集并显示深层信息的软件&#xff0c;它不用代理服…...

郑州网站推广技术/学历提升

导读&#xff1a;AIoT产业是多种技术融合&#xff0c;赋能各行业的产业&#xff0c;整体市场潜在空间超十万亿元。根据IDC的数据与预测&#xff0c;2019年全球AIoT市场规模达到2264亿美元&#xff0c;预计到2022年达到4820亿美元&#xff0c;2019-2022年复合增长率为28.65%。AI…...