• 【计算机毕业设计】基于SpringBoot+Vue电影在线订票系统的开发与实现


    博主主页:一季春秋
    博主简介:专注Java技术领域和毕业设计项目实战、Java、微信小程序、安卓等技术开发,远程调试部署、代码讲解、文档指导、ppt制作等技术指导。
    主要内容:毕业设计(Java项目、小程序等)、简历模板、学习资料、面试题库、技术咨询。

    🍅文末获取联系🍅

    精彩专栏推荐订阅👇🏻👇🏻 不然下次找不到哟

    SpringBoot+Vue项目持续更新中

    http://t.csdn.cn/1mgm8

    目录

    一、项目介绍 

    二、项目主要技术 

    三、系统分析

    3.1 系统功能分析和描述

    3.2 系统UML用例分析

    3.3 系统功能结构

    四、系统实现

    4.1 系统前台功能实现

    4.2 后台管理员模块实现

    五、实现代码 

    5.1 协同算法关键代码

    5.2 影片信息关键代码


    一、项目介绍 

    本系统采用的数据库是Mysql,使用SpringBoot框架开发,idea是本系统的开发平台。主要的模块包括管理员;系统首页、个人中心、用户管理、电影类型管理、影院信息管理、影厅信息管理、影片信息管理、影院评分管理、影片评分管理、系统管理、订单管理,用户;首页、影院信息、影厅信息、影片信息、公告资讯、后台管理、个人中心等功能。

    二、项目主要技术 

    1. 开发语言:Java
    2. 使用框架:spring boot
    3. 前端技术:JavaScript、Vue 、css3
    4. 开发工具:IDEA/MyEclipse/Eclipse、Visual Studio Code
    5. 数据库:MySQL 5.7/8.0
    6. 数据库管理工具:phpstudy/Navicat
    7. JDK版本:jdk1.8
    8. Maven: apache-maven 3.8.1-bin

    三、系统分析

    3.1 系统功能分析和描述

    使用电影在线订票系统分为管理员和用户两个角色的权限子模块。

    管理员所能使用的功能主要有:系统首页、个人中心、用户管理、电影类型管理、影院信息管理、影厅信息管理、影片信息管理、影院评分管理、影片评分管理、系统管理、订单管理等。

    用户可以实现首页、影院信息、影厅信息、影片信息、公告资讯、后台管理、个人中心等。

    3.2 系统UML用例分析

    管理员用例

    管理员登录后可进行系统首页、个人中心、用户管理、电影类型管理、影院信息管理、影厅信息管理、影片信息管理、影院评分管理、影片评分管理、系统管理、订单管理,管理员的用例如图所示。

    用户用例

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

    3.3 系统功能结构

    四、系统实现

    4.1 系统前台功能实现

    影院信息

    影院信息详情 

    影片信息

    影片预订

    我的订单

    4.2 后台管理员模块实现

    影院信息管理

    影厅信息管理 

    影片信息管理

    订单管理

    五、实现代码 

    5.1 协同算法关键代码

    1. /**
    2. * 协同算法(按用户购买推荐)
    3. */
    4. @RequestMapping("/autoSort2")
    5. public R autoSort2(@RequestParam Map params,YingpianxinxiEntity yingpianxinxi, HttpServletRequest request){
    6. String userId = request.getSession().getAttribute("userId").toString();
    7. String goodtypeColumn = "dianyingleixing";
    8. List orders = ordersService.selectList(new EntityWrapper().eq("userid", userId).eq("tablename", "yingpianxinxi").orderBy("addtime", false));
    9. List goodtypes = new ArrayList();
    10. Integer limit = params.get("limit")==null?10:Integer.parseInt(params.get("limit").toString());
    11. List yingpianxinxiList = new ArrayList();
    12. //去重
    13. List ordersDist = new ArrayList();
    14. for(OrdersEntity o1 : orders) {
    15. boolean addFlag = true;
    16. for(OrdersEntity o2 : ordersDist) {
    17. if(o1.getGoodid()==o2.getGoodid() || o1.getGoodtype().equals(o2.getGoodtype())) {
    18. addFlag = false;
    19. break;
    20. }
    21. }
    22. if(addFlag) ordersDist.add(o1);
    23. }
    24. if(ordersDist!=null && ordersDist.size()>0) {
    25. for(OrdersEntity o : ordersDist) {
    26. yingpianxinxiList.addAll(yingpianxinxiService.selectList(new EntityWrapper().eq(goodtypeColumn, o.getGoodtype())));
    27. }
    28. }
    29. EntityWrapper ew = new EntityWrapper();
    30. params.put("sort", "id");
    31. params.put("order", "desc");
    32. PageUtils page = yingpianxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yingpianxinxi), params), params));
    33. List pageList = (List)page.getList();
    34. if(yingpianxinxiList.size()
    35. int toAddNum = (limit-yingpianxinxiList.size())<=pageList.size()?(limit-yingpianxinxiList.size()):pageList.size();
    36. for(YingpianxinxiEntity o1 : pageList) {
    37. boolean addFlag = true;
    38. for(YingpianxinxiEntity o2 : yingpianxinxiList) {
    39. if(o1.getId().intValue()==o2.getId().intValue()) {
    40. addFlag = false;
    41. break;
    42. }
    43. }
    44. if(addFlag) {
    45. yingpianxinxiList.add(o1);
    46. if(--toAddNum==0) break;
    47. }
    48. }
    49. } else if(yingpianxinxiList.size()>limit) {
    50. yingpianxinxiList = yingpianxinxiList.subList(0, limit);
    51. }
    52. page.setList(yingpianxinxiList);
    53. return R.ok().put("data", page);
    54. }

    5.2 影片信息关键代码

    1. /**
    2. * 影片信息
    3. * 后端接口
    4. * @author
    5. * @email
    6. * @date 2023-03-07 19:07:52
    7. */
    8. @RestController
    9. @RequestMapping("/yingpianxinxi")
    10. public class YingpianxinxiController {
    11. @Autowired
    12. private YingpianxinxiService yingpianxinxiService;
    13. @Autowired
    14. private StoreupService storeupService;
    15. @Autowired
    16. private OrdersService ordersService;
    17. /**
    18. * 后端列表
    19. */
    20. @RequestMapping("/page")
    21. public R page(@RequestParam Map params,YingpianxinxiEntity yingpianxinxi,
    22. @RequestParam(required = false) Double pricestart,
    23. @RequestParam(required = false) Double priceend,
    24. HttpServletRequest request){
    25. EntityWrapper ew = new EntityWrapper();
    26. if(pricestart!=null) ew.ge("price", pricestart);
    27. if(priceend!=null) ew.le("price", priceend);
    28. PageUtils page = yingpianxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yingpianxinxi), params), params));
    29. return R.ok().put("data", page);
    30. }
    31. /**
    32. * 前端列表
    33. */
    34. @IgnoreAuth
    35. @RequestMapping("/list")
    36. public R list(@RequestParam Map params,YingpianxinxiEntity yingpianxinxi,
    37. @RequestParam(required = false) Double pricestart,
    38. @RequestParam(required = false) Double priceend,
    39. HttpServletRequest request){
    40. EntityWrapper ew = new EntityWrapper();
    41. if(pricestart!=null) ew.ge("price", pricestart);
    42. if(priceend!=null) ew.le("price", priceend);
    43. PageUtils page = yingpianxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yingpianxinxi), params), params));
    44. return R.ok().put("data", page);
    45. }
    46. /**
    47. * 列表
    48. */
    49. @RequestMapping("/lists")
    50. public R list( YingpianxinxiEntity yingpianxinxi){
    51. EntityWrapper ew = new EntityWrapper();
    52. ew.allEq(MPUtil.allEQMapPre( yingpianxinxi, "yingpianxinxi"));
    53. return R.ok().put("data", yingpianxinxiService.selectListView(ew));
    54. }
    55. /**
    56. * 查询
    57. */
    58. @RequestMapping("/query")
    59. public R query(YingpianxinxiEntity yingpianxinxi){
    60. EntityWrapper< YingpianxinxiEntity> ew = new EntityWrapper< YingpianxinxiEntity>();
    61. ew.allEq(MPUtil.allEQMapPre( yingpianxinxi, "yingpianxinxi"));
    62. YingpianxinxiView yingpianxinxiView = yingpianxinxiService.selectView(ew);
    63. return R.ok("查询影片信息成功").put("data", yingpianxinxiView);
    64. }
    65. /**
    66. * 后端详情
    67. */
    68. @RequestMapping("/info/{id}")
    69. public R info(@PathVariable("id") Long id){
    70. YingpianxinxiEntity yingpianxinxi = yingpianxinxiService.selectById(id);
    71. yingpianxinxi.setClicknum(yingpianxinxi.getClicknum()+1);
    72. yingpianxinxi.setClicktime(new Date());
    73. yingpianxinxiService.updateById(yingpianxinxi);
    74. return R.ok().put("data", yingpianxinxi);
    75. }
    76. /**
    77. * 前端详情
    78. */
    79. @IgnoreAuth
    80. @RequestMapping("/detail/{id}")
    81. public R detail(@PathVariable("id") Long id){
    82. YingpianxinxiEntity yingpianxinxi = yingpianxinxiService.selectById(id);
    83. yingpianxinxi.setClicknum(yingpianxinxi.getClicknum()+1);
    84. yingpianxinxi.setClicktime(new Date());
    85. yingpianxinxiService.updateById(yingpianxinxi);
    86. return R.ok().put("data", yingpianxinxi);
    87. }
    88. /**
    89. * 后端保存
    90. */
    91. @RequestMapping("/save")
    92. public R save(@RequestBody YingpianxinxiEntity yingpianxinxi, HttpServletRequest request){
    93. yingpianxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    94. //ValidatorUtils.validateEntity(yingpianxinxi);
    95. yingpianxinxiService.insert(yingpianxinxi);
    96. return R.ok();
    97. }
    98. /**
    99. * 前端保存
    100. */
    101. @RequestMapping("/add")
    102. public R add(@RequestBody YingpianxinxiEntity yingpianxinxi, HttpServletRequest request){
    103. yingpianxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    104. //ValidatorUtils.validateEntity(yingpianxinxi);
    105. yingpianxinxiService.insert(yingpianxinxi);
    106. return R.ok();
    107. }
    108. /**
    109. * 修改
    110. */
    111. @RequestMapping("/update")
    112. @Transactional
    113. public R update(@RequestBody YingpianxinxiEntity yingpianxinxi, HttpServletRequest request){
    114. //ValidatorUtils.validateEntity(yingpianxinxi);
    115. yingpianxinxiService.updateById(yingpianxinxi);//全部更新
    116. return R.ok();
    117. }
    118. /**
    119. * 删除
    120. */
    121. @RequestMapping("/delete")
    122. public R delete(@RequestBody Long[] ids){
    123. yingpianxinxiService.deleteBatchIds(Arrays.asList(ids));
    124. return R.ok();
    125. }
    126. /**
    127. * 提醒接口
    128. */
    129. @RequestMapping("/remind/{columnName}/{type}")
    130. public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
    131. @PathVariable("type") String type,@RequestParam Map map) {
    132. map.put("column", columnName);
    133. map.put("type", type);
    134. if(type.equals("2")) {
    135. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    136. Calendar c = Calendar.getInstance();
    137. Date remindStartDate = null;
    138. Date remindEndDate = null;
    139. if(map.get("remindstart")!=null) {
    140. Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
    141. c.setTime(new Date());
    142. c.add(Calendar.DAY_OF_MONTH,remindStart);
    143. remindStartDate = c.getTime();
    144. map.put("remindstart", sdf.format(remindStartDate));
    145. }
    146. if(map.get("remindend")!=null) {
    147. Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
    148. c.setTime(new Date());
    149. c.add(Calendar.DAY_OF_MONTH,remindEnd);
    150. remindEndDate = c.getTime();
    151. map.put("remindend", sdf.format(remindEndDate));
    152. }
    153. }
    154. Wrapper wrapper = new EntityWrapper();
    155. if(map.get("remindstart")!=null) {
    156. wrapper.ge(columnName, map.get("remindstart"));
    157. }
    158. if(map.get("remindend")!=null) {
    159. wrapper.le(columnName, map.get("remindend"));
    160. }
    161. int count = yingpianxinxiService.selectCount(wrapper);
    162. return R.ok().put("count", count);
    163. }
    164. /**
    165. * 前端智能排序
    166. */
    167. @IgnoreAuth
    168. @RequestMapping("/autoSort")
    169. public R autoSort(@RequestParam Map params,YingpianxinxiEntity yingpianxinxi, HttpServletRequest request,String pre){
    170. EntityWrapper ew = new EntityWrapper();
    171. Map newMap = new HashMap();
    172. Map param = new HashMap();
    173. Iterator> it = param.entrySet().iterator();
    174. while (it.hasNext()) {
    175. Map.Entry entry = it.next();
    176. String key = entry.getKey();
    177. String newKey = entry.getKey();
    178. if (pre.endsWith(".")) {
    179. newMap.put(pre + newKey, entry.getValue());
    180. } else if (StringUtils.isEmpty(pre)) {
    181. newMap.put(newKey, entry.getValue());
    182. } else {
    183. newMap.put(pre + "." + newKey, entry.getValue());
    184. }
    185. }
    186. params.put("sort", "clicknum");
    187. params.put("order", "desc");
    188. PageUtils page = yingpianxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yingpianxinxi), params), params));
    189. return R.ok().put("data", page);
    190. }
  • 相关阅读:
    【云原生之Docker实战】使用Docker部署calibre-web个人图书管理平台
    SPI机制
    WT2003H语音芯片在红绿灯上的运用,一款可远程更新的语音IC方案
    Linux 关闭对应端口号进程
    迭代器失效问题
    2022最新最全Java 进阶资料合集
    spark 读取本地文件
    2023深耕kotlin,谈谈前景
    Tomcat部署本地和服务器Springboot和Vue项目
    Cisco VXLAN配置
  • 原文地址:https://blog.csdn.net/m0_49113107/article/details/133187418