项目介绍

随着我国交通事业的发展,我国的火车和高铁水平已经位列世界前端位置,很多国人在出行的时候大多也会选择火车或者高铁,所以为了能够更加方便游客们的出行,我们通过java语言,后端springboot框架,数据库mysql,前端vue技术开发了本次的火车高铁购票系统,通过本系统用户可以更加方便的对列车信息进行查询,并可以对所需的车票进行在线购买。

开发环境

开发语言:Java
数据库 :MySQL
系统架构:B/S
后端框架:SpringBoot
前端框架:Vue
开发工具:IDEA或者Eclipse,JDK1.8,Maven

系统截图










部分代码

package com.controller;import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
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.format.annotation.DateTimeFormat;
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.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;import com.entity.NewsEntity;
import com.entity.view.NewsView;import com.service.NewsService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;/*** 公告信息* 后端接口*/
@RestController
@RequestMapping("/news")
public class NewsController {@Autowiredprivate NewsService newsService;/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,NewsEntity news,HttpServletRequest request){EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));return R.ok().put("data", page);}/*** 前端列表*/@IgnoreAuth@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,NewsEntity news, HttpServletRequest request){EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( NewsEntity news){EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();ew.allEq(MPUtil.allEQMapPre( news, "news"));return R.ok().put("data", newsService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(NewsEntity news){EntityWrapper< NewsEntity> ew = new EntityWrapper< NewsEntity>();ew.allEq(MPUtil.allEQMapPre( news, "news"));NewsView newsView =  newsService.selectView(ew);return R.ok("查询汉服资讯成功").put("data", newsView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){NewsEntity news = newsService.selectById(id);return R.ok().put("data", news);}/*** 前端详情*/@IgnoreAuth@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id){NewsEntity news = newsService.selectById(id);return R.ok().put("data", news);}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody NewsEntity news, HttpServletRequest request){news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(news);newsService.insert(news);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody NewsEntity news, HttpServletRequest request){news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(news);newsService.insert(news);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody NewsEntity news, HttpServletRequest request){//ValidatorUtils.validateEntity(news);newsService.updateById(news);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){newsService.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<String, Object> 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<NewsEntity> wrapper = new EntityWrapper<NewsEntity>();if(map.get("remindstart")!=null) {wrapper.ge(columnName, map.get("remindstart"));}if(map.get("remindend")!=null) {wrapper.le(columnName, map.get("remindend"));}int count = newsService.selectCount(wrapper);return R.ok().put("count", count);}}

基于java+springboot+mybatis+vue+elementui的火车高铁购票系统相关推荐

  1. 基于java+springboot+mybatis+vue+elementui的高铁订票管理系统

    项目介绍 随着我国交通事业的发展,我国的火车和高铁水平已经位列世界前端位置,很多国人在出行的时候大多也会选择火车或者高铁,所以为了能够更加方便游客们的出行,我们通过java语言开发了本次的火车高铁购票 ...

  2. 基于java+springboot+mybatis+vue+elementui的B2C购物电商平台设计与实现

    项目介绍 随着信息科技的发展,电子商务已经存在了我们生活的每一个角落,通过网络购物可以给人们的生活带来极大的便利,人们只需通过PC或者手机下单自己所需的商品,物流就会将购买的商品送到客户的手上,这极大 ...

  3. 基于java+springboot+mybatis+vue+elementui的灯具购物商城网站

    项目介绍 近年来,随着Internet的迅速崛起,互联网技术得到前所未有的发展,成为收集.提供信息的最佳渠道,并逐步进入传统的流通领域.电子商铺也悄然兴起,它的出现及发展,不仅是市场经济以及相应技术发 ...

  4. 基于java+springboot+mybatis+vue+elementui的农机机械设备租赁平台

    项目介绍 我国是一个农业大国,全国有大部分人是农民,作为农民最需要是的就是掌握最新的农业资讯,通过网络和世界同步,让自己在辛苦劳作的同时能够更好的创收,从而提高全国国名经济. 现如今,农机租赁平台是当 ...

  5. 基于java+springboot+mybatis+vue+elementui的小区停车位租赁网站

    项目介绍 自从改革开放以来,我国的经济建设的步伐和科学发展水平在不停的提高,与此同时人们的生活水平也在飞速的提升.相比15年前,现在的家庭私家车的保有量可以说是翻了几倍,私家车的大量普及也带来了许许多 ...

  6. 基于java+springboot+mybatis+vue+elementui的网上书籍购买商城

    项目介绍 网上书籍购买商城可以实现人们远程逛逛书店和购买图书的愿望.本系统主的功能是帮助经营实物书店的人们扩大市场和增加知名度.基本功能包括用户注册会员.登录.图书展示.图书查询.在线浏览图书.远程购 ...

  7. 基于java+springboot+mybatis+vue+elementui的古玩玉器交易系统

    项目介绍 随着中国互联网的发展.上网的网民越来越多.拥有网络购物习惯的网民也越来越多.网上购物平台纷拥而出.如淘宝网.京东商城.拉手网等众多购物平台. 古玩玉器行业龙头公司也纷纷踏足网络购物平台.利用 ...

  8. 基于java+springboot+mybatis+vue+elementui的准妈妈孕期交流平台

    项目介绍 随着科学技术的飞速发展,社会的方方面面.各行各业都在努力与现代的先进技术接轨,通过科技手段来提高自身的优势,准妈妈孕期交流平台当然也不能排除在外.准妈妈孕期交流平台是以实际运用为开发背景,运 ...

  9. 基于java+springboot+mybatis+vue+elementui的旧物置换网站

    项目介绍 随着时代的不进步,旧物也成人们的烦恼,许多平台网站都在推广自已的产品像天猫.咸鱼.京东.拼多多.所以开发出一套关于旧物置换网站非常有必要.旧物置换网站主要是借助计算机,通过对用户进行管理.为 ...

最新文章

  1. 人脸识别遇难题,平台先行破局
  2. 网站服务器蜘蛛日志怎么看,如何查看百度蜘蛛,google蜘蛛爬取记录?《网站日志分析篇》...
  3. linux多线程信号总结
  4. Android 开发(一)项目概况
  5. mui 与jquery 同时使用,$冲突解决办法。
  6. luogu2320 鬼谷子的钱袋
  7. 计算机视觉农作物检测,基于计算机视觉的农作物病害检测系统的研究
  8. python 实现对象去重
  9. 连接和关闭资源工具类
  10. 哥德尔 艾舍尔 巴赫--集异璧之大成
  11. 2020年“深圳杯”数学建模挑战赛C题-无线可充电传感器网络充电路线规划
  12. MySQL登录命令详解
  13. week15-字符串
  14. ASA入门实验之NAT
  15. 计算机科学的刊物卷号,期刊的卷号和期号怎么看
  16. 联想RS550服务器安装Ubuntu16.04
  17. 登陆和登录,login
  18. 海量大数据地图可视化
  19. 使用itext将HTML 生成PDF文件
  20. 逆向思维--魔兽世界封包分析

热门文章

  1. 小红书专业号认证申请服务商【邀请码】
  2. 老罗的获奖感言及经验转载
  3. 注意!2023年你必须要了解的IT各行业趋势
  4. 区块链时代正开启 中原精英探讨区块链未来 ----2018华中首届区块链论坛郑州开幕
  5. 存在哪些生物信息学子领域?
  6. mmdetection multi_apply
  7. drupal7安装与删除
  8. WebRTC实践视频聊天室
  9. python所有组合_Python 生成所有组合
  10. HGOI20190811 省常中互测4