Springboot+vue项目火车订票管理系统

文末获取源码

开发语言:Java

开发工具:IDEA /Eclipse

数据库:MYSQL5.7

应用服务:Tomcat7/Tomcat8

使用框架:springboot+vue

JDK版本:jdk1.8

火车订票管理系统的主要使用者分为管理员和用户,实现功能包括管理员:首页、个人中心、用户管理、车型信息管理、车次信息管理、购票订单管理、改签订单管理、退票订单管理、系统管理,用户:首页、个人中心、购票订单管理、改签订单管理、退票订单管理,前台首页;首页、车次信息、火车资讯、个人中心、后台管理等功能。

数据库设计

一个好的数据库可以关系到程序开发的优劣,数据库设计离不开表结构的设计,还有表与表之间的联系,以及系统开发需要设计的数据表内容等信息。在进行数据库设计期间,要结合实际情况来对数据库进行针对性的开发设计

 数据库E-R图设计

本火车订票管理系统采用的是MYSQL数据库,数据存储快,因为火车订票管理系统 ,主要的就是对信息的管理,信息内容比较多,这就需要好好的设计一个好的数据库,分类要清楚,不能添加信息的时候,造成信息太过混乱,设计好的数据库首先就需要先把各个实体之间的关系表达明确,系统的E-R图如下图所示:

1用户信息实体图如图

2、车次信息管理实体图如图 

3、车型信息管理实体图如图

 

系统详细设计 

前台首页功能模块

火车订票管理系统 ,在系统首页可以查看首页、车次信息、火车资讯、个人中心、后台管理等内容,如图 

登录、用户注册,在用户注册页面可以填写用户名、密码、姓名、性别、头像、身份证、手机等信息进行注册,如图 

车次信息,在车次信息页面通过填写车次名称、火车名称、车牌、图片、起点站、终点站、途经、日期、出发时间、时长、座位类型、价格、票数等信息。如图 

管理员功能模块

管理员登录界面图 

个人信息界面图

 

用户管理界面图

 

车型信息管理界面图

 

车次信息管理界面图

 

用户功能模块

个人中心界面图

 

 个人信息界面图

改签订单管理界面图

 

部分核心代码: 

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.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.ChecixinxiEntity;
import com.entity.view.ChecixinxiView;

import com.service.ChecixinxiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;


/**
 * 车次信息
 * 后端接口
 * @author 
 * @email 
 * @date 2021-02-27 11:45:54
 */
@RestController
@RequestMapping("/checixinxi")
public class ChecixinxiController {
    @Autowired
    private ChecixinxiService checixinxiService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,ChecixinxiEntity checixinxi, HttpServletRequest request){
        EntityWrapper<ChecixinxiEntity> ew = new EntityWrapper<ChecixinxiEntity>();
		PageUtils page = checixinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, checixinxi), params), params));

        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,ChecixinxiEntity checixinxi, HttpServletRequest request){
        EntityWrapper<ChecixinxiEntity> ew = new EntityWrapper<ChecixinxiEntity>();
		PageUtils page = checixinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, checixinxi), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( ChecixinxiEntity checixinxi){
       	EntityWrapper<ChecixinxiEntity> ew = new EntityWrapper<ChecixinxiEntity>();
      	ew.allEq(MPUtil.allEQMapPre( checixinxi, "checixinxi")); 
        return R.ok().put("data", checixinxiService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(ChecixinxiEntity checixinxi){
        EntityWrapper< ChecixinxiEntity> ew = new EntityWrapper< ChecixinxiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( checixinxi, "checixinxi")); 
		ChecixinxiView checixinxiView =  checixinxiService.selectView(ew);
		return R.ok("查询车次信息成功").put("data", checixinxiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        ChecixinxiEntity checixinxi = checixinxiService.selectById(id);
        return R.ok().put("data", checixinxi);
    }

    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        ChecixinxiEntity checixinxi = checixinxiService.selectById(id);
        return R.ok().put("data", checixinxi);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody ChecixinxiEntity checixinxi, HttpServletRequest request){
    	checixinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(checixinxi);
        checixinxiService.insert(checixinxi);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody ChecixinxiEntity checixinxi, HttpServletRequest request){
    	checixinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(checixinxi);
        checixinxiService.insert(checixinxi);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody ChecixinxiEntity checixinxi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(checixinxi);
        checixinxiService.updateById(checixinxi);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        checixinxiService.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<ChecixinxiEntity> wrapper = new EntityWrapper<ChecixinxiEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = checixinxiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	


}

猜你喜欢

转载自blog.csdn.net/m0_49113107/article/details/123810272