Java电影票购买管理系统,Maven管理工具,MyBatis数据库操作,idea平台开发,后台的前端为Vue,前台客户端为小程序,功能丰富,还有电影周边购买功能,请在最下方二维码处联系我即可,调试,讲解均可有偿获取,项目保证质量。
功能:
1.个人信息管理
2.用户管理
3.电影分裂管理
4.电影信息管理
5.电影院管理
6.周边商品管理
7.留言管理
8.系统管理(公告,系统简介,轮播图)
10.订单管理
图示:
数据库示例:
表名:discussdianyingxinxi
功能:电影信息评论表
字段名称 | 类型 | 长度 | 字段说明 | 主键 | 默认值 |
id | bigint | 主键 | 主键 | ||
addtime | timestamp | 创建时间 | CURRENT_TIMESTAMP | ||
refid | bigint | 关联表id | |||
userid | bigint | 用户id | |||
avatarurl | longtext | 4294967295 | 头像 | ||
nickname | varchar | 200 | 用户名 | ||
content | longtext | 4294967295 | 评论内容 | ||
reply | longtext | 4294967295 | 回复内容 |
表名:dianyingyuan
功能:电影院
字段名称 | 类型 | 长度 | 字段说明 | 主键 | 默认值 |
id | bigint | 主键 | 主键 | ||
addtime | timestamp | 创建时间 | CURRENT_TIMESTAMP | ||
biaoti | varchar | 200 | 标题 | ||
jianjie | longtext | 4294967295 | 简介 | ||
fengmian | longtext | 4294967295 | 封面 | ||
fabushijian | datetime | 发布时间 | |||
neirong | longtext | 4294967295 | 内容 | ||
clicktime | datetime | 最近点击时间 | |||
clicknum | int | 点击次数 | 0 |
表名:dianyingxinxi
功能:电影信息
字段名称 | 类型 | 长度 | 字段说明 | 主键 | 默认值 |
id | bigint | 主键 | 主键 | ||
addtime | timestamp | 创建时间 | CURRENT_TIMESTAMP | ||
dianyingmingcheng | varchar | 200 | 电影名称 | ||
dianyingfenlei | varchar | 200 | 电影分类 | ||
dianyinghaibao | longtext | 4294967295 | 电影海报 | ||
dianyingpianduan | longtext | 4294967295 | 电影片段 | ||
daoyan | varchar | 200 | 导演 | ||
yanyuan | varchar | 200 | 演员 | ||
shangyingriqi | date | 上映日期 | |||
diqu | varchar | 200 | 地区 | ||
niandai | varchar | 200 | 年代 | ||
fangyingchangci | varchar | 200 | 放映场次 | ||
fangyingshijian | varchar | 200 | 放映时间 | ||
fangyingting | varchar | 200 | 放映厅 | ||
yingyuanmingcheng | varchar | 200 | 影院名称 | ||
yingyuandizhi | varchar | 200 | 影院地址 | ||
dianyingjieshao | longtext | 4294967295 | 电影介绍 | ||
thumbsupnum | int | 赞 | 0 | ||
crazilynum | int | 踩 | 0 | ||
clicktime | datetime | 最近点击时间 | |||
clicknum | int | 点击次数 | 0 | ||
price | double | 价格 | |||
number | int | 座位总数 | |||
selected | longtext | 4294967295 | 已选座位[用,号隔开] |
代码示例:
package com.controller;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.annotation.IgnoreAuth;
import com.entity.DianyingxinxiEntity;
import com.entity.view.DianyingxinxiView;
import com.service.DianyingxinxiService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
/**
* 电影信息
* 后端接口
*/
@RestController
@RequestMapping("/dianyingxinxi")
public class DianyingxinxiController {
@Autowired
private DianyingxinxiService dianyingxinxiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, DianyingxinxiEntity dianyingxinxi,
HttpServletRequest request) {
EntityWrapper<DianyingxinxiEntity> ew = new EntityWrapper<DianyingxinxiEntity>();
PageUtils page = dianyingxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, dianyingxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, DianyingxinxiEntity dianyingxinxi,
HttpServletRequest request) {
EntityWrapper<DianyingxinxiEntity> ew = new EntityWrapper<DianyingxinxiEntity>();
PageUtils page = dianyingxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, dianyingxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list(DianyingxinxiEntity dianyingxinxi) {
EntityWrapper<DianyingxinxiEntity> ew = new EntityWrapper<DianyingxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre(dianyingxinxi, "dianyingxinxi"));
return R.ok().put("data", dianyingxinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(DianyingxinxiEntity dianyingxinxi) {
EntityWrapper<DianyingxinxiEntity> ew = new EntityWrapper<DianyingxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre(dianyingxinxi, "dianyingxinxi"));
DianyingxinxiView dianyingxinxiView = dianyingxinxiService.selectView(ew);
return R.ok("查询电影信息成功").put("data", dianyingxinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id) {
DianyingxinxiEntity dianyingxinxi = dianyingxinxiService.selectById(id);
dianyingxinxi.setClicknum(dianyingxinxi.getClicknum() + 1);
dianyingxinxi.setClicktime(new Date());
dianyingxinxiService.updateById(dianyingxinxi);
return R.ok().put("data", dianyingxinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id) {
DianyingxinxiEntity dianyingxinxi = dianyingxinxiService.selectById(id);
dianyingxinxi.setClicknum(dianyingxinxi.getClicknum() + 1);
dianyingxinxi.setClicktime(new Date());
dianyingxinxiService.updateById(dianyingxinxi);
return R.ok().put("data", dianyingxinxi);
}
/**
* 赞或踩
*/
@RequestMapping("/thumbsup/{id}")
public R vote(@PathVariable("id") String id, String type) {
DianyingxinxiEntity dianyingxinxi = dianyingxinxiService.selectById(id);
if (type.equals("1")) {
dianyingxinxi.setThumbsupnum(dianyingxinxi.getThumbsupnum() + 1);
} else {
dianyingxinxi.setCrazilynum(dianyingxinxi.getCrazilynum() + 1);
}
dianyingxinxiService.updateById(dianyingxinxi);
return R.ok("投票成功");
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody DianyingxinxiEntity dianyingxinxi, HttpServletRequest request) {
dianyingxinxi.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
//ValidatorUtils.validateEntity(dianyingxinxi);
dianyingxinxiService.insert(dianyingxinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody DianyingxinxiEntity dianyingxinxi, HttpServletRequest request) {
dianyingxinxi.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
dianyingxinxiService.insert(dianyingxinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody DianyingxinxiEntity dianyingxinxi, HttpServletRequest request) {
dianyingxinxiService.updateById(dianyingxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids) {
dianyingxinxiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params, DianyingxinxiEntity dianyingxinxi, HttpServletRequest request, String pre) {
EntityWrapper<DianyingxinxiEntity> ew = new EntityWrapper<DianyingxinxiEntity>();
Map<String, Object> newMap = new HashMap<String, Object>();
Map<String, Object> param = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
String newKey = entry.getKey();
if (pre.endsWith(".")) {
newMap.put(pre + newKey, entry.getValue());
} else if (StringUtils.isEmpty(pre)) {
newMap.put(newKey, entry.getValue());
} else {
newMap.put(pre + "." + newKey, entry.getValue());
}
}
params.put("sort", "clicknum");
params.put("order", "desc");
PageUtils page = dianyingxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, dianyingxinxi), params), params));
return R.ok().put("data", page);
}
}
电影信息实体类:
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
* 电影信息
* 手机端接口返回实体辅助类
*/
public class DianyingxinxiVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 电影分类
*/
private String dianyingfenlei;
/**
* 电影海报
*/
private String dianyinghaibao;
/**
* 电影片段
*/
private String dianyingpianduan;
/**
* 导演
*/
private String daoyan;
/**
* 演员
*/
private String yanyuan;
/**
* 上映日期
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date shangyingriqi;
/**
* 地区
*/
private String diqu;
/**
* 年代
*/
private String niandai;
/**
* 放映场次
*/
private String fangyingchangci;
/**
* 放映时间
*/
private String fangyingshijian;
/**
* 放映厅
*/
private String fangyingting;
/**
* 影院名称
*/
private String yingyuanmingcheng;
/**
* 影院地址
*/
private String yingyuandizhi;
/**
* 电影介绍
*/
private String dianyingjieshao;
/**
* 赞
*/
private Integer thumbsupnum;
/**
* 踩
*/
private Integer crazilynum;
/**
* 最近点击时间
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date clicktime;
/**
* 点击次数
*/
private Integer clicknum;
/**
* 价格
*/
private Double price;
/**
* 座位总数
*/
private Integer number;
/**
* 已选座位[用,号隔开]
*/
private String selected;
}