Java毕业设计-基于SSM框架的汽车客运站管理系统项目实战(附源码+文档)

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

💞当前专栏:Java毕业设计

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

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

开发运行环境

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

源码下载地址:

https://download.csdn.net/download/m0_46388260/89082774

论文目录

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

一、项目简介

系统可以提供信息显示和相应服务,其管理员负责售票管理员和检票管理员的信息管理,对车辆,售票和车辆调度信息执行管理,并统计车辆的售票数据。售票管理员查看公告,登记车辆售票信息。检票管理员查看公告,查看售票信息,在线检票。

二、系统设计

2.1软件功能模块设计

在前面分析的管理员功能的基础上,进行接下来的设计工作,最终展示设计的管理员结构图(见下图)。管理员负责售票管理员和检票管理员的信息管理,对车辆,售票和车辆调度信息执行管理,并统计车辆的售票数据。
在这里插入图片描述
在前面分析的售票管理员功能的基础上,进行接下来的设计工作,最终展示设计的售票管理员结构图(见下图)。售票管理员查看公告,登记车辆售票信息。
在这里插入图片描述
在前面分析的检票管理员功能的基础上,进行接下来的设计工作,最终展示设计的检票管理员结构图(见下图)。检票管理员查看公告,查看售票信息,在线检票。
在这里插入图片描述

2.2数据库设计

(1)下图是车辆实体和其具备的属性。
在这里插入图片描述
(2)下图是车辆调度实体和其具备的属性。
在这里插入图片描述
(3)下图是售票实体和其具备的属性。
在这里插入图片描述
(5)下图为上述各实体间相互之间的关系。
在这里插入图片描述

三、系统项目部分截图

3.1管理员功能实现

管理员信息
管理员进入指定功能操作区之后可以管理管理员信息。其页面见下图。这里的管理员包括了售票管理员和检票管理员的信息,管理员主要是增删改查有关管理员的数据信息。
在这里插入图片描述
车辆管理
管理员进入指定功能操作区之后可以管理车辆信息。其页面见下图。管理员查询车辆有很多种方式,比如根据司机,根据车辆名字,根据车牌号或者是根据始发站以及终点站等都能查询车辆的信息,另外,管理员也能新增车辆,修改页面内的车辆数据。
在这里插入图片描述
车辆调度管理
管理员进入指定功能操作区之后可以管理车辆调度。其页面见下图。管理员修改车辆的排班信息,新增车辆调度信息,根据排班信息查询车辆调度信息。
在这里插入图片描述

3.2售票管理员功能实现

售票管理
售票管理员进入指定功能操作区之后可以管理售票信息。其页面见下图。售票管理员查看已售车票的售票状态,登记新的售票信息。
在这里插入图片描述

3.3检票管理员功能实现

车票检票
检票管理员进入指定功能操作区之后可以检票。其页面见下图。检票管理员检票时主要是核对车辆的始发站以及终点站等相关信息,信息正确即可检票。
在这里插入图片描述

四、部分核心代码

package com.controller;


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.StringUtil;
import java.lang.reflect.InvocationTargetException;

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.ShoupiaoEntity;

import com.service.ShoupiaoService;
import com.entity.view.ShoupiaoView;
import com.service.CarService;
import com.entity.CarEntity;
import com.utils.PageUtils;
import com.utils.R;

/**
 * 售票
 * 后端接口
 * @author
 * @email
 * @date 2021-02-24
*/
@RestController
@Controller
@RequestMapping("/shoupiao")
public class ShoupiaoController {
    private static final Logger logger = LoggerFactory.getLogger(ShoupiaoController.class);

    @Autowired
    private ShoupiaoService shoupiaoService;


    @Autowired
    private TokenService tokenService;


    //级联表service
    @Autowired
    private CarService carService;

    //字典表map
    Map<String, Map<Integer, String>> dictionaryMap;

    /**
    * 后端列表
    */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params){
        logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
        PageUtils page = shoupiaoService.queryPage(params);

        //字典表数据转换
        List<ShoupiaoView> list =(List<ShoupiaoView>)page.getList();
        ServletContext servletContext = ContextLoader.getCurrentWebApplicationContext().getServletContext();
        dictionaryMap = (Map<String, Map<Integer, String>>) servletContext.getAttribute("dictionaryMap");
        for(ShoupiaoView c:list){
            this.dictionaryConvert(c);
        }
        return R.ok().put("data", page);
    }
    /**
    * 后端详情
    */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        ShoupiaoEntity shoupiao = shoupiaoService.selectById(id);
        if(shoupiao !=null){
            //entity转view
            ShoupiaoView view = new ShoupiaoView();
            BeanUtils.copyProperties( shoupiao , view );//把实体数据重构到view中

            //级联表
            CarEntity car = carService.selectById(shoupiao.getCarId());
            if(car != null){
                BeanUtils.copyProperties( car , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
            }
            //字典表字典转换
            ServletContext servletContext = ContextLoader.getCurrentWebApplicationContext().getServletContext();
            dictionaryMap = (Map<String, Map<Integer, String>>) servletContext.getAttribute("dictionaryMap");
            this.dictionaryConvert(view);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("/save")
    public R save(@RequestBody ShoupiaoEntity shoupiao, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,shoupiao:{}",this.getClass().getName(),shoupiao.toString());

            String role = String.valueOf(request.getSession().getAttribute("role"));
            if("售票管理员".equals(role)){
                shoupiao.setShoupiaoTypes(1);
            }
            shoupiao.setCreateTime(new Date());
            shoupiaoService.insert(shoupiao);
            return R.ok();
    }

    /**
     * 后端保存
     */
    @RequestMapping("/graph")
    public R graph(){
        List<HashMap<String, String>> graph = shoupiaoService.graph();
        return R.ok().put("data", graph);
    }

    /**
    * 修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody ShoupiaoEntity shoupiao, HttpServletRequest request){
        logger.debug("update方法:,,Controller:{},,shoupiao:{}",this.getClass().getName(),shoupiao.toString());
            String role = String.valueOf(request.getSession().getAttribute("role"));
            if("检票管理员".equals(role)){
                shoupiao.setShoupiaoTypes(2);
            }
            shoupiaoService.updateById(shoupiao);//根据id更新
            return R.ok();
    }


    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        logger.debug("Controller:"+this.getClass().getName()+",delete");
        shoupiaoService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }

    /**
    *字典表数据转换
    */
    public void dictionaryConvert(ShoupiaoView shoupiaoView){
        //当前表的字典字段
        if(StringUtil.isNotEmpty(String.valueOf(shoupiaoView.getShoupiaoTypes()))){
            shoupiaoView.setShoupiaoValue(dictionaryMap.get("shoupiao_types").get(shoupiaoView.getShoupiaoTypes()));
        }

        //级联表的字典字段
        if(StringUtil.isNotEmpty(String.valueOf(shoupiaoView.getCarTypes()))){
            shoupiaoView.setCarValue(dictionaryMap.get("car_types").get(shoupiaoView.getCarTypes()));
        }
    }


}


获取源码或论文

如需对应的论文或源码,以及其他定制需求,也可以下方微信联系我。

  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值