博主主页:一季春秋
博主简介:专注Java技术领域和毕业设计项目实战、Java、微信小程序、安卓等技术开发,远程调试部署、代码讲解、文档指导、ppt制作等技术指导。
主要内容:毕业设计(Java项目、小程序等)、简历模板、学习资料、面试题库、技术咨询。🍅文末获取联系🍅
精彩专栏推荐订阅👇🏻👇🏻 不然下次找不到哟
SpringBoot+Vue项目持续更新中
目录
本系统采用的数据库是Mysql,使用SpringBoot框架开发,idea是本系统的开发平台。主要的模块包括管理员;系统首页、个人中心、用户管理、电影类型管理、影院信息管理、影厅信息管理、影片信息管理、影院评分管理、影片评分管理、系统管理、订单管理,用户;首页、影院信息、影厅信息、影片信息、公告资讯、后台管理、个人中心等功能。
- 开发语言:Java
-
- 使用框架:spring boot
-
- 前端技术:JavaScript、Vue 、css3
-
- 开发工具:IDEA/MyEclipse/Eclipse、Visual Studio Code
-
- 数据库:MySQL 5.7/8.0
-
- 数据库管理工具:phpstudy/Navicat
-
- JDK版本:jdk1.8
-
- Maven: apache-maven 3.8.1-bin
使用电影在线订票系统分为管理员和用户两个角色的权限子模块。
管理员所能使用的功能主要有:系统首页、个人中心、用户管理、电影类型管理、影院信息管理、影厅信息管理、影片信息管理、影院评分管理、影片评分管理、系统管理、订单管理等。
用户可以实现首页、影院信息、影厅信息、影片信息、公告资讯、后台管理、个人中心等。
管理员用例
管理员登录后可进行系统首页、个人中心、用户管理、电影类型管理、影院信息管理、影厅信息管理、影片信息管理、影院评分管理、影片评分管理、系统管理、订单管理,管理员的用例如图所示。

用户用例
用户注册登录后可进行首页、影院信息、影厅信息、影片信息、公告资讯、后台管理、个人中心等 ,采购员用例如图所示。



影院信息

影院信息详情

影片信息

影片预订

我的订单

影院信息管理

影厅信息管理

影片信息管理

订单管理

- /**
- * 协同算法(按用户购买推荐)
- */
- @RequestMapping("/autoSort2")
- public R autoSort2(@RequestParam Map
params,YingpianxinxiEntity yingpianxinxi, HttpServletRequest request) { - String userId = request.getSession().getAttribute("userId").toString();
- String goodtypeColumn = "dianyingleixing";
- List
orders = ordersService.selectList(new EntityWrapper().eq("userid", userId).eq("tablename", "yingpianxinxi").orderBy("addtime", false)); - List
goodtypes = new ArrayList(); - Integer limit = params.get("limit")==null?10:Integer.parseInt(params.get("limit").toString());
- List
yingpianxinxiList = new ArrayList(); - //去重
- List
ordersDist = new ArrayList(); - for(OrdersEntity o1 : orders) {
- boolean addFlag = true;
- for(OrdersEntity o2 : ordersDist) {
- if(o1.getGoodid()==o2.getGoodid() || o1.getGoodtype().equals(o2.getGoodtype())) {
- addFlag = false;
- break;
- }
- }
- if(addFlag) ordersDist.add(o1);
- }
- if(ordersDist!=null && ordersDist.size()>0) {
- for(OrdersEntity o : ordersDist) {
- yingpianxinxiList.addAll(yingpianxinxiService.selectList(new EntityWrapper
().eq(goodtypeColumn, o.getGoodtype()))); - }
- }
- EntityWrapper
ew = new EntityWrapper(); - params.put("sort", "id");
- params.put("order", "desc");
- PageUtils page = yingpianxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yingpianxinxi), params), params));
- List
pageList = (List)page.getList(); - if(yingpianxinxiList.size()
- int toAddNum = (limit-yingpianxinxiList.size())<=pageList.size()?(limit-yingpianxinxiList.size()):pageList.size();
- for(YingpianxinxiEntity o1 : pageList) {
- boolean addFlag = true;
- for(YingpianxinxiEntity o2 : yingpianxinxiList) {
- if(o1.getId().intValue()==o2.getId().intValue()) {
- addFlag = false;
- break;
- }
- }
- if(addFlag) {
- yingpianxinxiList.add(o1);
- if(--toAddNum==0) break;
- }
- }
- } else if(yingpianxinxiList.size()>limit) {
- yingpianxinxiList = yingpianxinxiList.subList(0, limit);
- }
- page.setList(yingpianxinxiList);
- return R.ok().put("data", page);
- }
5.2 影片信息关键代码
- /**
- * 影片信息
- * 后端接口
- * @author
- * @email
- * @date 2023-03-07 19:07:52
- */
- @RestController
- @RequestMapping("/yingpianxinxi")
- public class YingpianxinxiController {
- @Autowired
- private YingpianxinxiService yingpianxinxiService;
-
- @Autowired
- private StoreupService storeupService;
-
- @Autowired
- private OrdersService ordersService;
-
-
-
- /**
- * 后端列表
- */
- @RequestMapping("/page")
- public R page(@RequestParam Map
params,YingpianxinxiEntity yingpianxinxi, - @RequestParam(required = false) Double pricestart,
- @RequestParam(required = false) Double priceend,
- HttpServletRequest request){
- EntityWrapper
ew = new EntityWrapper(); - if(pricestart!=null) ew.ge("price", pricestart);
- if(priceend!=null) ew.le("price", priceend);
-
- PageUtils page = yingpianxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yingpianxinxi), params), params));
-
- return R.ok().put("data", page);
- }
-
- /**
- * 前端列表
- */
- @IgnoreAuth
- @RequestMapping("/list")
- public R list(@RequestParam Map
params,YingpianxinxiEntity yingpianxinxi, - @RequestParam(required = false) Double pricestart,
- @RequestParam(required = false) Double priceend,
- HttpServletRequest request){
- EntityWrapper
ew = new EntityWrapper(); - if(pricestart!=null) ew.ge("price", pricestart);
- if(priceend!=null) ew.le("price", priceend);
-
- PageUtils page = yingpianxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yingpianxinxi), params), params));
- return R.ok().put("data", page);
- }
-
- /**
- * 列表
- */
- @RequestMapping("/lists")
- public R list( YingpianxinxiEntity yingpianxinxi){
- EntityWrapper
ew = new EntityWrapper(); - ew.allEq(MPUtil.allEQMapPre( yingpianxinxi, "yingpianxinxi"));
- return R.ok().put("data", yingpianxinxiService.selectListView(ew));
- }
-
- /**
- * 查询
- */
- @RequestMapping("/query")
- public R query(YingpianxinxiEntity yingpianxinxi){
- EntityWrapper< YingpianxinxiEntity> ew = new EntityWrapper< YingpianxinxiEntity>();
- ew.allEq(MPUtil.allEQMapPre( yingpianxinxi, "yingpianxinxi"));
- YingpianxinxiView yingpianxinxiView = yingpianxinxiService.selectView(ew);
- return R.ok("查询影片信息成功").put("data", yingpianxinxiView);
- }
-
- /**
- * 后端详情
- */
- @RequestMapping("/info/{id}")
- public R info(@PathVariable("id") Long id){
- YingpianxinxiEntity yingpianxinxi = yingpianxinxiService.selectById(id);
- yingpianxinxi.setClicknum(yingpianxinxi.getClicknum()+1);
- yingpianxinxi.setClicktime(new Date());
- yingpianxinxiService.updateById(yingpianxinxi);
- return R.ok().put("data", yingpianxinxi);
- }
-
- /**
- * 前端详情
- */
- @IgnoreAuth
- @RequestMapping("/detail/{id}")
- public R detail(@PathVariable("id") Long id){
- YingpianxinxiEntity yingpianxinxi = yingpianxinxiService.selectById(id);
- yingpianxinxi.setClicknum(yingpianxinxi.getClicknum()+1);
- yingpianxinxi.setClicktime(new Date());
- yingpianxinxiService.updateById(yingpianxinxi);
- return R.ok().put("data", yingpianxinxi);
- }
-
-
-
-
- /**
- * 后端保存
- */
- @RequestMapping("/save")
- public R save(@RequestBody YingpianxinxiEntity yingpianxinxi, HttpServletRequest request){
- yingpianxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
- //ValidatorUtils.validateEntity(yingpianxinxi);
- yingpianxinxiService.insert(yingpianxinxi);
- return R.ok();
- }
-
- /**
- * 前端保存
- */
- @RequestMapping("/add")
- public R add(@RequestBody YingpianxinxiEntity yingpianxinxi, HttpServletRequest request){
- yingpianxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
- //ValidatorUtils.validateEntity(yingpianxinxi);
- yingpianxinxiService.insert(yingpianxinxi);
- return R.ok();
- }
-
-
-
- /**
- * 修改
- */
- @RequestMapping("/update")
- @Transactional
- public R update(@RequestBody YingpianxinxiEntity yingpianxinxi, HttpServletRequest request){
- //ValidatorUtils.validateEntity(yingpianxinxi);
- yingpianxinxiService.updateById(yingpianxinxi);//全部更新
- return R.ok();
- }
-
-
-
-
- /**
- * 删除
- */
- @RequestMapping("/delete")
- public R delete(@RequestBody Long[] ids){
- yingpianxinxiService.deleteBatchIds(Arrays.asList(ids));
- return R.ok();
- }
-
- /**
- * 提醒接口
- */
- @RequestMapping("/remind/{columnName}/{type}")
- public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
- @PathVariable("type") String type,@RequestParam Map
map) { - map.put("column", columnName);
- map.put("type", type);
-
- if(type.equals("2")) {
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
- Calendar c = Calendar.getInstance();
- Date remindStartDate = null;
- Date remindEndDate = null;
- if(map.get("remindstart")!=null) {
- Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
- c.setTime(new Date());
- c.add(Calendar.DAY_OF_MONTH,remindStart);
- remindStartDate = c.getTime();
- map.put("remindstart", sdf.format(remindStartDate));
- }
- if(map.get("remindend")!=null) {
- Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
- c.setTime(new Date());
- c.add(Calendar.DAY_OF_MONTH,remindEnd);
- remindEndDate = c.getTime();
- map.put("remindend", sdf.format(remindEndDate));
- }
- }
-
- Wrapper
wrapper = new EntityWrapper(); - if(map.get("remindstart")!=null) {
- wrapper.ge(columnName, map.get("remindstart"));
- }
- if(map.get("remindend")!=null) {
- wrapper.le(columnName, map.get("remindend"));
- }
-
-
- int count = yingpianxinxiService.selectCount(wrapper);
- return R.ok().put("count", count);
- }
-
- /**
- * 前端智能排序
- */
- @IgnoreAuth
- @RequestMapping("/autoSort")
- public R autoSort(@RequestParam Map
params,YingpianxinxiEntity yingpianxinxi, HttpServletRequest request,String pre) { - EntityWrapper
ew = new EntityWrapper(); - Map
newMap = new HashMap(); - Map
param = new HashMap(); - Iterator
> it = param.entrySet().iterator(); - while (it.hasNext()) {
- Map.Entry
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 = yingpianxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yingpianxinxi), params), params));
- return R.ok().put("data", page);
- }