项目编号:L-BS-YY-01
一,环境介绍
语言环境:Java: jdk1.8
数据库:Mysql: mysql5.7
应用服务器:Tomcat: tomcat8.5.31
开发工具:IDEA或eclipse
二,项目简介
SpringBoot+SpringSecurity+MyBatis-Plus 框架的前后端电影项目,前端使用vue+element ui,后端SpringBoot。 前台主要有根据类型和地区进行电影的筛选、电影的搜索、热门榜单、活动的发布、留言的发布、电影的购票、电影的在线选座位、我的购物车、我的订单等功能。 后台主要有影片的增删查改、电影的拍片、海报的管理、用户和员工的管理等等功能。
- api 目录下为Spring boot项目代码
- vue-admin 目录下为网站管理后台代码
- vue-app 目录下为网站前台代码
- vue-worker 目录下为网站客服代码
三,系统展示
3.1 Admin管理员
3.2 用户端
四,核心代码展示
4.1 OrderServiceImpl
@Service @CacheConfig(cacheNames = "order") public class OrderServiceImpl implements OrderService { @Resource private OrderMapper orderMapper; @Resource private ArrangementService arrangementService; @Resource private UserMapper userMapper; @Resource private FilmMapper filmMapper; @Override public Order create(Cart cart) throws Exception { List<Integer> seats = arrangementService.getSeatsHaveSelected(cart.getAid()); String[] split = cart.getSeats().split("号"); for (String s : split) { if (seats.contains(Integer.parseInt(s))) throw new Exception("影片在购物车中躺了太长时间了,座位已被其他用户预订并支付了"); } Order order = new Order(); //生成订单id order.setId(UUID.randomUUID().toString()); //写入用户id order.setUid(cart.getUid()); //写入用户电话 order.setPhone(cart.getPhone()); //写入场次id order.setAid(cart.getAid()); //写入座位信息 order.setStatus(cart.getStatus()); order.setSeats(cart.getSeats()); if (cart.getStatus() == 2) order.setPayAt(DataTimeUtil.getNowTimeString()); order.setPrice(cart.getPrice()); order.setCreateAt(DataTimeUtil.getNowTimeString()); orderMapper.insert(order); //订了几个座位就添加多少热度 Film film = filmMapper.selectById(arrangementService.findById(cart.getAid()).getFid()); film.setHot(film.getHot() + split.length); filmMapper.updateById(film); return order; } @Override public Order pay(String id) throws Exception { Order order = orderMapper.selectById(id); if (order == null) throw new Exception("不存在的订单id"); if (DataTimeUtil.parseTimeStamp(order.getCreateAt()) + OrderStatus.EXPIRATION_TIME < System.currentTimeMillis()) { order.setStatus(OrderStatus.PAYMENT_FAILED); orderMapper.updateById(order); throw new Exception("订单支付超时"); } order.setStatus(OrderStatus.PAYMENT_SUCCESSFUL); order.setPayAt(DataTimeUtil.getNowTimeString()); orderMapper.updateById(order); return order; } @Override public void update(Order order) { orderMapper.updateById(order); } @Override public List<OrderVO> findAll() { return findByWrapper(new QueryWrapper<>()); } @Override public List<OrderVO> findByUser(String uid) { QueryWrapper<Order> wrapper = new QueryWrapper<>(); wrapper.in("uid", uid); return findByWrapper(wrapper); } private List<OrderVO> findByWrapper(QueryWrapper<Order> wrapper) { List<Order> orders = orderMapper.selectList(wrapper); List<OrderVO> result = new ArrayList<>(); for (Order o : orders) { OrderVO orderVO = new OrderVO(); orderVO.setOrder(o); orderVO.setUser(userMapper.selectById(o.getUid())); Arrangement arrangement = arrangementService.findById(o.getAid()); orderVO.setArrangement(arrangement); orderVO.setFilm(filmMapper.selectById(arrangement.getFid())); result.add(orderVO); } return result; } }
4.2 FilmEvaluateServiceImpl
@Service @CacheConfig(cacheNames = "filmEvaluate") public class FilmEvaluateServiceImpl implements FilmEvaluateService { @Resource private FilmEvaluateMapper filmEvaluateMapper; @Resource private FilmMapper filmMapper; @Resource private UserMapper userMapper; @Override public void save(FilmEvaluate filmEvaluate) throws Exception { QueryWrapper<FilmEvaluate> wrapper = new QueryWrapper<>(); wrapper.in("fid", filmEvaluate.getFid()); wrapper.in("uid", filmEvaluate.getUid()); FilmEvaluate one = filmEvaluateMapper.selectOne(wrapper); if (one != null) { throw new Exception("感谢您的参与,但是您已评分请不要重复操作!"); } filmEvaluate.setCreateAt(DataTimeUtil.getNowTimeString()); filmEvaluateMapper.insert(filmEvaluate); //为电影添加热度 Film film = filmMapper.selectById(filmEvaluate.getFid()); film.setHot(film.getHot() + 1); filmMapper.updateById(film); } @Override public List<FilmEvaluateVO> findAllByFilmId(String fid) { List<FilmEvaluateVO> result = new ArrayList<>(); List<FilmEvaluate> filmEvaluates = filmEvaluateMapper.selectList(new QueryWrapper<FilmEvaluate>().in("fid", fid)); for (FilmEvaluate f : filmEvaluates) { FilmEvaluateVO filmEvaluateVO = new FilmEvaluateVO(); filmEvaluateVO.setUser(userMapper.selectById(f.getUid())); filmEvaluateVO.setFilmEvaluate(f); filmEvaluateVO.setId(f.getId()); result.add(filmEvaluateVO); } return result; } @Override public void deleteAllByFilmId(String fid) { filmEvaluateMapper.delete(new QueryWrapper<FilmEvaluate>().in("fid", fid)); } @Override public void deleteById(String id) { filmEvaluateMapper.deleteById(id); } }
五,相关作品展示
基于Java开发、Python开发、PHP开发、C#开发等相关语言开发的实战项目
基于Nodejs、Vue等前端技术开发的前端实战项目
基于微信小程序和安卓APP应用开发的相关作品
基于51单片机等嵌入式物联网开发应用
基于各类算法实现的AI智能应用
基于大数据实现的各类数据管理和推荐系统