基于Springboot+Vue的Java项目-火车票订票系统开发实战(附演示视频+源码+LW)

news/2024/5/15 9:00:56

大家好!我是程序员一帆,感谢您阅读本文,欢迎一键三连哦。

💞当前专栏:Java毕业设计

精彩专栏推荐👇🏻👇🏻👇🏻

🎀 Python毕业设计
🌎微信小程序毕业设计

开发环境

开发语言:Java
框架:Springboot+Vue
JDK版本:JDK1.8
服务器:tomcat7
数据库:mysql 5.7
数据库工具:Navicat12
开发软件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
浏览器:谷歌浏览器

演示视频

springboot294火车票订票系统

原版高清演示视频-编号:294
https://pan.quark.cn/s/5cda95b17ee0

源码下载地址:

https://download.csdn.net/download/2301_76953549/89099795

LW目录

【如需全文请按文末获取联系】
在这里插入图片描述
在这里插入图片描述

目录

  • 开发环境
  • 演示视频
  • 源码下载地址:
  • LW目录
  • 一、项目简介
  • 二、系统设计
    • 2.1软件功能模块设计
    • 2.2数据库设计
  • 三、系统项目部分截图
    • 3.1会员信息管理
    • 3.2车次信息管理
    • 3.3订票订单管理
    • 3.4留言板管理
  • 四、部分核心代码
    • 4.1 用户部分
  • 获取源码或论文

一、项目简介

二、系统设计

2.1软件功能模块设计

在这里插入图片描述

2.2数据库设计

(1)下图是车次信息实体和其具备的属性。

在这里插入图片描述
(2)下图是字典表实体和其具备的属性。
在这里插入图片描述
(3)下图是会员实体和其具备的属性。
在这里插入图片描述
(4)下图是留言版实体和其具备的属性。
在这里插入图片描述
(5)下图是购票订单实体和其具备的属性。
在这里插入图片描述
(6)下图是用户表实体和其具备的属性。
在这里插入图片描述

三、系统项目部分截图

3.1会员信息管理

如图5.1显示的就是会员信息管理页面,此页面提供给管理员的功能有:会员信息的查询管理,可以删除会员信息、修改会员信息、新增会员信息,
还进行了对用户名称的模糊查询的条件
在这里插入图片描述

3.2车次信息管理

如图5.2显示的就是车次信息管理页面,此页面提供给管理员的功能有:查看已发布的车次信息数据,修改车次信息,车次信息作废,即可删除,还进行了对车次信息名称的模糊查询 车次信息信息的类型查询等等一些条件。
在这里插入图片描述

3.3订票订单管理

如图5.3显示的就是订票订单管理页面,此页面提供给管理员的功能有:根据订票订单进行条件查询,还可以对订票订单进行新增、修改、查询操作等等。
在这里插入图片描述

3.4留言板管理

如图5.4显示的就是留言板管理页面,此页面提供给管理员的功能有:根据留言板进行新增、修改、查询操作等等。
在这里插入图片描述

四、部分核心代码

4.1 用户部分


package com.controller;import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;/*** 字典表* 后端接口* @author* @email
*/
@RestController
@Controller
@RequestMapping("/dictionary")
public class DictionaryController {private static final Logger logger = LoggerFactory.getLogger(DictionaryController.class);@Autowiredprivate DictionaryService dictionaryService;@Autowiredprivate TokenService tokenService;//级联表service@Autowiredprivate YonghuService yonghuService;/*** 后端列表*/@RequestMapping("/page")@IgnoreAuthpublic R page(@RequestParam Map<String, Object> params, HttpServletRequest request){logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));if(params.get("orderBy")==null || params.get("orderBy")==""){params.put("orderBy","id");}PageUtils page = dictionaryService.queryPage(params);//字典表数据转换List<DictionaryView> list =(List<DictionaryView>)page.getList();for(DictionaryView c:list){//修改对应字典表字段dictionaryService.dictionaryConvert(c, request);}return R.ok().put("data", page);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id, HttpServletRequest request){logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);DictionaryEntity dictionary = dictionaryService.selectById(id);if(dictionary !=null){//entity转viewDictionaryView view = new DictionaryView();BeanUtils.copyProperties( dictionary , view );//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody DictionaryEntity dictionary, HttpServletRequest request){logger.debug("save方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永远不会进入");Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>().eq("dic_code", dictionary.getDicCode()).eq("index_name", dictionary.getIndexName());if(dictionary.getDicCode().contains("_erji_types")){queryWrapper.eq("super_id",dictionary.getSuperId());}logger.info("sql语句:"+queryWrapper.getSqlSegment());DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);if(dictionaryEntity==null){dictionary.setCreateTime(new Date());dictionaryService.insert(dictionary);//字典表新增数据,把数据再重新查出,放入监听器中List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());ServletContext servletContext = request.getServletContext();Map<String, Map<Integer,String>> map = new HashMap<>();for(DictionaryEntity d :dictionaryEntities){Map<Integer, String> m = map.get(d.getDicCode());if(m ==null || m.isEmpty()){m = new HashMap<>();}m.put(d.getCodeIndex(),d.getIndexName());map.put(d.getDicCode(),m);}servletContext.setAttribute("dictionaryMap",map);return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 后端修改*/@RequestMapping("/update")public R update(@RequestBody DictionaryEntity dictionary, HttpServletRequest request){logger.debug("update方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");//根据字段查询是否有相同数据Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>().notIn("id",dictionary.getId()).eq("dic_code", dictionary.getDicCode()).eq("index_name", dictionary.getIndexName());if(dictionary.getDicCode().contains("_erji_types")){queryWrapper.eq("super_id",dictionary.getSuperId());}logger.info("sql语句:"+queryWrapper.getSqlSegment());DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);if(dictionaryEntity==null){dictionaryService.updateById(dictionary);//根据id更新//如果字典表修改数据的话,把数据再重新查出,放入监听器中List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());ServletContext servletContext = request.getServletContext();Map<String, Map<Integer,String>> map = new HashMap<>();for(DictionaryEntity d :dictionaryEntities){Map<Integer, String> m = map.get(d.getDicCode());if(m ==null || m.isEmpty()){m = new HashMap<>();}m.put(d.getCodeIndex(),d.getIndexName());map.put(d.getDicCode(),m);}servletContext.setAttribute("dictionaryMap",map);return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Integer[] ids){logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());dictionaryService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 最大值*/@RequestMapping("/maxCodeIndex")public R maxCodeIndex(@RequestBody DictionaryEntity dictionary){logger.debug("maxCodeIndex:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());List<String> descs = new ArrayList<>();descs.add("code_index");Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>().eq("dic_code", dictionary.getDicCode()).orderDesc(descs);logger.info("sql语句:"+queryWrapper.getSqlSegment());List<DictionaryEntity> dictionaryEntityList = dictionaryService.selectList(queryWrapper);if(dictionaryEntityList != null ){return R.ok().put("maxCodeIndex",dictionaryEntityList.get(0).getCodeIndex()+1);}else{return R.ok().put("maxCodeIndex",1);}}/*** 批量上传*/@RequestMapping("/batchInsert")public R save( String fileName, HttpServletRequest request){logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");try {List<DictionaryEntity> dictionaryList = new ArrayList<>();//上传的东西Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段Date date = new Date();int lastIndexOf = fileName.lastIndexOf(".");if(lastIndexOf == -1){return R.error(511,"该文件没有后缀");}else{String suffix = fileName.substring(lastIndexOf);if(!".xls".equals(suffix)){return R.error(511,"只支持后缀为xls的excel文件");}else{URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径File file = new File(resource.getFile());if(!file.exists()){return R.error(511,"找不到上传文件,请联系管理员");}else{List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件dataList.remove(0);//删除第一行,因为第一行是提示for(List<String> data:dataList){//循环DictionaryEntity dictionaryEntity = new DictionaryEntity();
//                            dictionaryEntity.setDicCode(data.get(0));                    //字段 要改的
//                            dictionaryEntity.setDicName(data.get(0));                    //字段名 要改的
//                            dictionaryEntity.setCodeIndex(Integer.valueOf(data.get(0)));   //编码 要改的
//                            dictionaryEntity.setIndexName(data.get(0));                    //编码名字 要改的
//                            dictionaryEntity.setSuperId(Integer.valueOf(data.get(0)));   //父字段id 要改的
//                            dictionaryEntity.setBeizhu(data.get(0));                    //备注 要改的
//                            dictionaryEntity.setCreateTime(date);//时间dictionaryList.add(dictionaryEntity);//把要查询是否重复的字段放入map中}//查询是否重复dictionaryService.insertBatch(dictionaryList);return R.ok();}}}}catch (Exception e){e.printStackTrace();return R.error(511,"批量插入数据异常,请联系管理员");}}}

获取源码或论文

如需对应的LW或源码,以及其他定制需求,也可以点我头像查看个人简介联系。


http://www.mrgr.cn/p/54154567

相关文章

测试数据不再难,人工智能批量生成给你用!

简介 测试数据是指一组专注于为测试服务的数据,既可以作为功能的输入去验证输出,也可以去触发各类异常场景。 测试数据的设计尤为重要,等价类、边界值、正交法等测试用例设计方法都是为了更全面的设计对应的测试数据集。 实践演练 在批量生成测试数据中,我们需要明确数据的…

[转载]一些人士论文的学术指标[2017.4.26 from sina blog]

大连海事大学贾欣乐教授博文。原文地址:一些人士论文的学术指标作者:贾欣乐

26-代码随想录383赎金信

383. 赎金信 简单 相关标签 相关企业 给你两个字符串&#xff1a;ransomNote 和 magazine &#xff0c;判断 ransomNote 能不能由 magazine 里面的字符构成。 如果可以&#xff0c;返回 true &#xff1b;否则返回 false 。 magazine 中的每个字符只能在 ransomNote 中使用一…

IC设计数据传输 如何能保障安全高效?

IC(集成电路)设计数据,对于IC设计企业来说,其重要性不言而喻。所以IC设计数据传输过程中,其安全性和效率,也需要有保障。 首先我们来看看IC设计数据为什么重要,其重要性体现在多个方面,主要包括: 1、知识产权:IC设计数据包含了企业的核心技术和创新成果,是公司知识…

OpenSSL测试-SM4

0. 在openEuler(推荐)或Ubuntu或Windows(不推荐)中完成下面任务 1. 使用OpenSSL的命令对你的8位学号(数字)进行加密解密,密钥的前8个字节为你的8位学号,提交过程截图(5) 2. 使用OpenSSL编程对对"你的8位学号(数字)"进行加密解密,提交代码和运行结果截图。(1…

区间预测 | PSO-RF-KDE的粒子群优化随机森林结合核密度估计多变量回归区间预测(Matlab)

区间预测 | PSO-RF-KDE的粒子群优化随机森林结合核密度估计多变量回归区间预测&#xff08;Matlab&#xff09; 目录 区间预测 | PSO-RF-KDE的粒子群优化随机森林结合核密度估计多变量回归区间预测&#xff08;Matlab&#xff09;效果一览基本介绍程序设计参考资料 效果一览 基…

倾斜摄影三维模型数据在模型调色应用分析

三维工厂K3DMaker是一款三维模型浏览、分析、轻量化、顶层合并构建、几何校正、格式转换、调色裁切等功能专业处理软件。可以进行三维模型的网格简化、纹理压缩、层级优化等操作,从而实现三维模型轻量化。轻量化压缩比大,模型轻量化效率高,自动化处理能力高;采用多种算法对…

Qt Creator导入第三方so库和jar包——Qt For Android

前言 之前了解了在Android Studio下导入so库和jar包&#xff0c;现在实现如何在Qt上导入so库和jar包。 实现 下面是我安卓开发&#xff08;需调用安卓接口的代码&#xff09;的目录&#xff08;图1&#xff09;&#xff0c;此目录结构和原生态环境&#xff08;Android Studi…

把SPA的加载速度提升一倍,有没有搞头?

众所周知,纯前端渲染的单页应用(SPA)渲染比较慢,其中一个问题是:先加载公共js,再根据路由动态加载页面需要的js。如下图:commons.e7c0f857.js加载并解析完毕后(2.53s) 再发起对order.15cd187e.js的加载(2.24s)。本文以 VUE 项目为例。 为什么会出现串行加载的情况 诚然…

Ftrans文件外发系统 构建安全可控文件外发流程

文件外发系统是企业数据安全管理中的关键组成部分,它主要用于处理企业内部文件向外部传输的流程,确保数据在合法、安全、可控的前提下进行外发。 文件外发系统的主要作用包括: 1、防止数据泄露:通过严格的审批流程和安全策略,防止未经授权的文件外发,从而降低数据泄露风…

Asp .Net Core 系列:国际化多语言配置

目录概述术语本地化器IStringLocalizer在服务类中使用本地化IStringLocalizerFactoryIHtmlLocalizerIViewLocalizer资源文件区域性回退配置 CultureProvider内置的 RequestCultureProvider实现自定义 RequestCultureProvider使用 Json 资源文件设计原理IStringLocalizerFactory…

提升编码技能:学习如何使用 C# 和 Fizzler 获取特价机票

引言 五一假期作为中国的传统节日&#xff0c;也是旅游热门的时段之一&#xff0c;特价机票往往成为人们关注的焦点。在这个数字化时代&#xff0c;利用爬虫技术获取特价机票信息已成为一种常见的策略。通过结合C#和Fizzler库&#xff0c;我们可以更加高效地实现这一目标&…

免费实用在线小工具

免费在线工具 https://orcc.online/ pdf在线免费转word文档 https://orcc.online/pdf 时间戳转换 https://orcc.online/timestamp Base64 编码解码 https://orcc.online/base64 URL 编码解码 https://orcc.online/url Hash(MD5/SHA1/SHA256…) 计算 https://orcc.online/ha…

Linux内核之SPI协议

SPI(Serial Peripheral Interface,串行外设接口)是一种同步串行的行业标准,但是并没有像I2C那样有标准文档,它还有主从、可片选的特性。图源自Serial Peripheral Interface-wikipedia 时序图放个经典老图,来源未知。相位和极性决定了采样点,主从采样点一致时数据正确,不一…

java实现模板填充word,word转pdf,pdf转图片

Java实现Word转PDF及PDF转图片 在日常开发中&#xff0c;我们经常需要将文件操作&#xff0c;比如&#xff1a; 根据模板填充wordword文档中插入图片Word文档转换为PDF格式将PDF文件转换为图片。 这些转换可以帮助我们在不同的场景下展示或处理文档内容。下面&#xff0c;我将…

modbus怎么写多个保持寄存器

近期,在做项目的时候,用到了modbus协议,有一个校时功能,就是需要定时发送时间到相应的设备,给相应的设备校时,协议里给出了寄存器地址和数据格式,如下 这个在程序里就需要写多个连续的保持寄存器,报文格式如下: 串口modbus报文格式 11 10 13 27 00 04 08 18 04 1C 0F …

03.Kafka 基本使用

Kafka 提供了一系列脚本用于命令行来操作 kafka。 1 Topic 操作 1.1 创建 Topic 创建一个名为 oldersix-topic 的 topic&#xff0c;副本数设置为3&#xff0c;分区数设置为2&#xff1a; bin/kafka-topics.sh \ --create \ --zookeeper 192.168.31.162:2181 \ --replication…

MCU自动测量单元:自动化数据采集的未来

随着科技的飞速发展&#xff0c;自动化技术在各个领域中的应用日益广泛。其中&#xff0c;MCU(微控制器)自动测量单元以其高效、精准的特性&#xff0c;成为自动化数据采集领域的佼佼者&#xff0c;引领着未来数据采集技术的革新。本文将深入探讨MCU自动测量单元的原理、优势以…

2024.4 ~ 若眨眼一瞬 定能像星辰般飞向宇宙

2024.4.3 \(40+100+40=180\)。今天过了一题/开心 草了,T2 空间开大 MLE 了,实际上只过了 \(0\) 题,如果不算这个就登顶了 fibonacci 首先答案一定可以在 \(S_{31}\) 中找到。具体地,找到最大的 \(i\) 使得 \(S_{i-4}< 3|t|\),取 \(S_i\) 即可。 这是因为首先任意三个相…

24.4.28(板刷dp,拓扑判环,区间dp+容斥算回文串总数)

星期一&#xff1a; 昨晚cf又掉分&#xff0c;小掉不算掉 补ABC350 D atc传送门 思路&#xff1a;对每个连通块&#xff0c;使其成为一个完全图&#xff0c;完全图的边数为 n*(n-1)/2 , 答案加上每个连通块成为完全图后的…