基于java+ssm+vue的公交车信息管理系统

项目介绍

当下,正处于信息化的时代,许多行业顺应时代的变化,结合使用计算机技术向数字化、信息化建设迈进。以前相关行业对于公交车信息的管理和控制,采用人工登记的方式保存相关数据,这种以人力为主的管理模式已然落后。本人结合使用主流的程序开发技术,设计了一款基于SSM的公交车信息管理系统,可以较大地减少人力、财力的损耗,方便相关人员及时更新和保存信息。本系统主要以B/S模式进行实现,在idea集成平台上,运用Java语言编写相关代码,设计相关的系统功能模块,MySQL数据库存放数据资源,管理和控制相关的系统信息,SSM框架设计和开发系统功能架构,最后通过使用Tomcat服务器,在浏览器中发布设计的系统,并且完成系统与数据库的交互工作。本文对系统进行实现的可行性分析,设计的功能及数据库规划,以及设计的主要功能模块测试等内容做了较为详细的介绍,并且在本文中也展示了系统主要的功能模块设计界面和操作界面,并对其做出了必要的解释说明,方便用户对系统进行操作和使用,以及后期的相关人员对系统进行更新和维护。本系统的实现可以极大地提高相关行业的工作效率,提升用户的使用体验,因此在现实生活中运用本系统具有很大的使用价值。

3.2 系统的总体设计
系统的总体功能设计,是需求分析的下个阶段,是系统实现的上个阶段,它是系统详细功能设计的一个大方向,也就是说系统的各类子功能模块的设计,都是以总体功能设计为目标而进行的。通过对系统进行需求分析可知,可以大致了解系统具体所需要的相关的主要功能模块。本系统主要的功能需求包括车辆信息管理、公交线路管理等模块。系统总体功能设计图如图3-1所示。
在这里插入图片描述

开发环境

编程语言:Java
数据库 :Mysql
系统架构:B/S
后端框架:SSM
编译工具:idea或者eclipse,jdk1.8,maven
支持定做:java/php/python/android/小程序/vue/爬虫/c#/asp.net

系统实现

3.5.1 个人中心
通过设计的个人中心功能模块,用户可以选择修改账号密码,查看个人资料信息,通过不定期的对个人账户密码进行更新,保障个人信息安全,修改密码界面设计如图3-12所示,个人信息界面设计如图3-13所示。
在这里插入图片描述

图3-12 修改密码界面
在这里插入图片描述

图3-13 个人信息界面

3.5.2 管理员管理
通过设计的管理员管理功能模块,管理用户可以管理相关的管理员用户信息资料,比如进行查看管理员的用户名信息,更新管理员的密码信息,删除已经注销的管理员用户信息记录等操作,管理员管理界面设计如图3-14所示。
在这里插入图片描述

图3-14 管理员管理界面

3.5.3 司机管理
通过设计的司机管理功能模块,管理用户可以管理相关的司机用户信息资料,比如进行查看司机用户的详细资料,修改司机的手机号码,删除已经注销的司机用户信息记录等操作,司机管理界面设计如图3-15所示。
在这里插入图片描述

图3-15 司机管理界面

3.5.4 用户管理
通过设计的用户管理功能模块,管理用户可以管理相关的用户信息资料,比如进行查看用户的详细资料,修改用户的电子邮箱,删除已经注销的用户信息记录等操作,用户管理界面设计如图3-16所示。
在这里插入图片描述

图3-16 用户管理界面

3.5.5 位置信息管理
通过设计的位置信息管理功能模块,管理用户可以管理相关的公交车位置信息记录,比如进行查看位置信息的详细内容,修改车辆的大致位置,删除已经失效的位置信息记录等操作,位置信息管理界面设计如图3-17所示。
在这里插入图片描述

图3-17 位置信息管理界面

3.5.6 基础数据管理
通过设计的基础数据管理功能模块,管理用户可以管理相关的车辆类型、线路类型、公告类型信息记录,比如进行查看车辆类型、线路类型、公告类型信息的详细内容,修改车辆类型、线路类型、公告类型的名称信息,删除失效的车辆类型、线路类型、公告类型信息记录等操作,车辆类型管理界面设计如图3-18所示,线路类型管理界面设计如图3-19所示,公告类型管理界面设计如图3-20所示。
在这里插入图片描述

图3-18 车辆类型管理界面
在这里插入图片描述

图3-19 线路类型管理界面
在这里插入图片描述

图3-20 公告类型管理界面

3.5.7 车辆信息管理
通过设计的车辆信息管理功能模块,管理用户可以管理相关的车辆信息记录,比如进行查看车辆信息的详细内容,修改车辆类型信息,删除失效的车辆信息记录等操作,车辆信息管理界面设计如图3-21所示。
在这里插入图片描述

图3-21 车辆信息管理界面

3.5.8 公交线路管理
通过设计的公交线路管理功能模块,管理用户可以管理相关的公交线路信息资料,比如进行查看公交线路信息的详细内容,修改公交线路名称信息,删除已经失效的公交线路信息记录等操作,公交线路管理界面设计如图3-22所示。
在这里插入图片描述

图3-22 公交线路管理界面

3.5.9 公告信息管理
通过设计的公告信息管理功能模块,用户可以管理相关的公告信息记录,比如进行查看公告信息的详细内容,修改公告图片信息,删除失效的公告信息记录等操作,公告信息管理界面设计如图3-23所示。
在这里插入图片描述

图3-23 公告信息管理界面

3.5.10 排班信息管理
通过设计的排班信息管理功能模块,用户可以管理相关的排班信息记录,比如进行查看排班信息的详细内容,修改排班开始时间和结束时间信息,删除失效的排班信息记录等操作,排班信息管理界面设计如图3-24所示。
在这里插入图片描述

图3-24 排班信息管理界面

核心代码

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("/cheliangweizhi")
public class CheliangweizhiController {
    private static final Logger logger = LoggerFactory.getLogger(CheliangweizhiController.class);

    @Autowired
    private CheliangweizhiService cheliangweizhiService;


    @Autowired
    private TokenService tokenService;
    @Autowired
    private DictionaryService dictionaryService;

    //级联表service
    @Autowired
    private GongjiaocheService gongjiaocheService;

    @Autowired
    private YonghuService yonghuService;


    /**
    * 后端列表
    */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
        logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永不会进入");
        else if("用户".equals(role))
            params.put("yonghuId",request.getSession().getAttribute("userId"));
        if(params.get("orderBy")==null || params.get("orderBy")==""){
            params.put("orderBy","id");
        }
        PageUtils page = cheliangweizhiService.queryPage(params);

        //字典表数据转换
        List<CheliangweizhiView> list =(List<CheliangweizhiView>)page.getList();
        for(CheliangweizhiView 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);
        CheliangweizhiEntity cheliangweizhi = cheliangweizhiService.selectById(id);
        if(cheliangweizhi !=null){
            //entity转view
            CheliangweizhiView view = new CheliangweizhiView();
            BeanUtils.copyProperties( cheliangweizhi , view );//把实体数据重构到view中

                //级联表
                GongjiaocheEntity gongjiaoche = gongjiaocheService.selectById(cheliangweizhi.getGongjiaocheId());
                if(gongjiaoche != null){
                    BeanUtils.copyProperties( gongjiaoche , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setGongjiaocheId(gongjiaoche.getId());
                }
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

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

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永远不会进入");

        Wrapper<CheliangweizhiEntity> queryWrapper = new EntityWrapper<CheliangweizhiEntity>()
            .eq("gongjiaoche_id", cheliangweizhi.getGongjiaocheId())
            .eq("cheliangweizhi_dati", cheliangweizhi.getCheliangweizhiDati())
            .eq("cheliangweizhi_fangxiang", cheliangweizhi.getCheliangweizhiFangxiang())
            .eq("cheliangweizhi_mingcheng", cheliangweizhi.getCheliangweizhiMingcheng())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        CheliangweizhiEntity cheliangweizhiEntity = cheliangweizhiService.selectOne(queryWrapper);
        if(cheliangweizhiEntity==null){
            cheliangweizhi.setCreateTime(new Date());
            cheliangweizhiService.insert(cheliangweizhi);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

    /**
    * 后端修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody CheliangweizhiEntity cheliangweizhi, HttpServletRequest request){
        logger.debug("update方法:,,Controller:{},,cheliangweizhi:{}",this.getClass().getName(),cheliangweizhi.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
        //根据字段查询是否有相同数据
        Wrapper<CheliangweizhiEntity> queryWrapper = new EntityWrapper<CheliangweizhiEntity>()
            .notIn("id",cheliangweizhi.getId())
            .andNew()
            .eq("gongjiaoche_id", cheliangweizhi.getGongjiaocheId())
            .eq("cheliangweizhi_dati", cheliangweizhi.getCheliangweizhiDati())
            .eq("cheliangweizhi_fangxiang", cheliangweizhi.getCheliangweizhiFangxiang())
            .eq("cheliangweizhi_mingcheng", cheliangweizhi.getCheliangweizhiMingcheng())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        CheliangweizhiEntity cheliangweizhiEntity = cheliangweizhiService.selectOne(queryWrapper);
        if(cheliangweizhiEntity==null){
            cheliangweizhiService.updateById(cheliangweizhi);//根据id更新
            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());
        cheliangweizhiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }


    /**
     * 批量上传
     */
    @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<CheliangweizhiEntity> cheliangweizhiList = 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("../../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){
                            //循环
                            CheliangweizhiEntity cheliangweizhiEntity = new CheliangweizhiEntity();
//                            cheliangweizhiEntity.setGongjiaocheId(Integer.valueOf(data.get(0)));   //车辆 要改的
//                            cheliangweizhiEntity.setCheliangweizhiDati(data.get(0));                    //大体位置 要改的
//                            cheliangweizhiEntity.setCheliangweizhiFangxiang(data.get(0));                    //行驶方向 要改的
//                            cheliangweizhiEntity.setCheliangweizhiMingcheng(data.get(0));                    //下一站名称 要改的
//                            cheliangweizhiEntity.setCheliangweizhiContent("");//详情和图片
//                            cheliangweizhiEntity.setCreateTime(date);//时间
                            cheliangweizhiList.add(cheliangweizhiEntity);


                            //把要查询是否重复的字段放入map中
                        }

                        //查询是否重复
                        cheliangweizhiService.insertBatch(cheliangweizhiList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }






}

论文参考

在这里插入图片描述

目 录
摘要 I
Abstract II
第1章 绪 论 1
1.1 研究背景 1
1.2 研究意义 1
1.3 国内外研究现状 2
1.3.1国外研究现状 2
1.3.2国内研究现状 2
1.4 研究思路 3
1.4.1研究内容 3
1.4.2论文组织 3
1.5本人所作工作 4
第2章 系统分析 5
2.1概述 5
2.2需求分析 5
2.3可行性分析 7
2.3.1经济可行性 7
2.3.2技术可行性 7
2.3.3操作可行性 7
2.4系统流程分析 8
2.4.1开发流程 8
2.4.2登录流程 8
2.4.3注册流程 9
2.4.4添加信息流程 9
2.5建立数据字典 10
第3章 系统设计 14
3.1 概述 14
3.2 系统的总体设计 14
3.3 数据库设计 15
3.3.1 概念设计 15
3.3.2 逻辑设计 19
3.5界面设计 22
3.5.1 个人中心 22
3.5.2 管理员管理 22
3.5.3 司机管理 22
3.5.4 用户管理 23
3.5.5 位置信息管理 23
3.5.6 基础数据管理 24
3.5.7 车辆信息管理 25
3.5.8 公交线路管理 25
3.5.9 公告信息管理 26
3.5.10 排班信息管理 26
第四章 系统实施 28
4.1程序设计 28
4.2开发工具介绍 28
4.2.1 B/S结构 28
4.2.2 Java语言 28
4.2.3 SSM框架 29
4.2.4 MySQL数据库 29
4.3系统测试 30
4.3.1系统测试目的和内容 30
4.3.2系统测试用例和结果 30
结论 33
参考文献 34
致谢 35

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值