基于java+ssm+jsp的园区停车管理系统

项目介绍

网络技术和计算机技术发展至今,已经拥有了深厚的理论基础,并在现实中进行了充分运用,尤其是基于计算机运行的软件更是受到各界的关注。加上现在人们已经步入信息时代,所以对于信息的宣传和管理就很关键。因此园区停车信息的管理计算机化,系统化是必要的。设计开发园区停车管理系统不仅会节约人力和管理成本,还会安全保存庞大的数据量,对于园区停车信息的维护和检索也不需要花费很多时间,非常的便利。

园区停车管理系统是在MySQL中建立数据表保存信息,运用SSM框架和Java语言编写。并按照软件设计开发流程进行设计实现。系统具备友好性且功能完善。管理员登录进入本人后台之后,管理员工和车主,管理车位,根据车牌号进行泊车或取车,查看停车数据的年份报表或月份报表信息。员工查询车辆记录和车主,管理车位,对车辆进行泊车或取车。

园区停车管理系统在让园区停车信息规范化的同时,也能及时通过数据输入的有效性规则检测出错误数据,让数据的录入达到准确性的目的,进而提升园区停车管理系统提供的数据的可靠性,让系统数据的错误率降至最低。

4.2功能结构设计
前面所做的功能分析,只是本系统的一个大概功能,这部分需要在此基础上进行各个模块的详细设计。
设计的管理员的详细功能见下图,管理员登录进入本人后台之后,管理员工和车主,管理车位,根据车牌号进行泊车或取车,查看停车数据的年份报表或月份报表信息。
在这里插入图片描述
设计的员工的详细功能见下图,员工查询车辆记录和车主,管理车位,对车辆进行泊车或取车。
在这里插入图片描述

开发环境

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

系统实现

5 系统实现
在此部分内容中,主要通过系统功能的运行效果图展示前面设计的最终结果。系统实现对编制人员的技术能力有较高要求,因为需要他们使用编程的方式去实现系统设计的方案。
5.1 管理员功能实现
5.1.1 员工管理
管理员权限中的员工管理,其运行效果见下图。管理员维护员工资料,能修改与删除。也能登记本页面没有的员工资料。
在这里插入图片描述

图5.1 员工管理页面

5.1.2 车主管理
管理员权限中的车主管理,其运行效果见下图。管理员查询车主,可以根据车主姓名,也能根据车主的身份证号,手机号或者车牌号查询车主,同时,管理员能够修改,删除本页面显示的车主资料。
在这里插入图片描述

图5.2 车主管理页面

5.1.3 车位管理
管理员权限中的车位管理,其运行效果见下图。管理员增删改查车位,根据车牌号对车辆进行泊车或取车操作。
在这里插入图片描述

图5.3 车位管理页面

5.1.4 车辆记录管理
管理员权限中的车辆记录管理,其运行效果见下图。管理员查看车辆停车信息,查看车辆停车的月份报表或年份报表。
在这里插入图片描述

图5.4 车辆记录管理页面

5.2 员工功能实现
5.2.1 车位管理
员工权限中的车位管理,其运行效果见下图。员工在本页面可以操作的功能比较多,可以添加车位,修改或查询车位,对车辆进行泊车或取车操作。
在这里插入图片描述

图5.5 车位管理页面

5.2.2 车辆记录
员工权限中的车辆记录,其运行效果见下图。员工根据车位名字,车牌号或者停车的时间区间筛选车辆停车记录。
在这里插入图片描述

图5.6 车辆记录页面

5.2.3 车主信息
员工权限中的车主信息,其运行效果见下图。员工只能查询或查看车主信息。
在这里插入图片描述

图5.7 车主信息页面

核心代码

package com.controller;


import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;

import com.entity.CheliangjiluEntity;
import com.service.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;

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

import com.entity.view.CheweiView;
import com.entity.ChezhuEntity;
import com.utils.PageUtils;
import com.utils.R;

/**
 * 车位
 * 后端接口
 * @author
 * @email
*/
@RestController
@Controller
@RequestMapping("ewei")
public class CheweiController {
    private static final Logger logger = LoggerFactory.getLogger(CheweiController.class);

    @Autowired
    private CheweiService cheweiService;


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


    //级联表service
    @Autowired
    private ChezhuService chezhuService;
    @Autowired
    private CheliangjiluService cheliangjiluService;


    /**
    * 后端列表
    */
    @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(StringUtil.isNotEmpty(role) && "用户".equals(role)){
            params.put("yonghuId",request.getSession().getAttribute("userId"));
        }
        PageUtils page = cheweiService.queryPage(params);

        //字典表数据转换
        List<CheweiView> list =(List<CheweiView>)page.getList();
        for(CheweiView c:list){
            //修改对应字典表字段
            dictionaryService.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);
        CheweiEntity chewei = cheweiService.selectById(id);
        if(chewei !=null){
            //entity转view
            CheweiView view = new CheweiView();
            BeanUtils.copyProperties( chewei , view );//把实体数据重构到view中

            //级联表
            ChezhuEntity chezhu = chezhuService.selectById(chewei.getChezhuId());
            if(chezhu != null){
                BeanUtils.copyProperties( chezhu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                view.setChezhuId(chezhu.getId());
            }
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("ve")
    public R save(@RequestBody CheweiEntity chewei, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,chewei:{}",this.getClass().getName(),chewei.toString());
        Wrapper<CheweiEntity> queryWrapper = new EntityWrapper<CheweiEntity>()
            .eq("chewei_name", chewei.getCheweiName());
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        CheweiEntity cheweiEntity = cheweiService.selectOne(queryWrapper);
        if(cheweiEntity==null){
            chewei.setCheweiTypes(3);
            cheweiService.insert(chewei);
            return R.ok();
        }else {
            return R.error(511,"车位已被使用");
        }
    }

    /**
    * 修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody CheweiEntity chewei, HttpServletRequest request){
        logger.debug("update方法:,,Controller:{},,chewei:{}",this.getClass().getName(),chewei.toString());
        //根据字段查询是否有相同数据
        Wrapper<CheweiEntity> queryWrapper = new EntityWrapper<CheweiEntity>()
            .notIn("id",chewei.getId())
            .andNew()
            .eq("chewei_name", chewei.getCheweiName());
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        CheweiEntity cheweiEntity = cheweiService.selectOne(queryWrapper);
        if(cheweiEntity==null){
            cheweiService.updateById(chewei);//根据id更新
            return R.ok();
        }else {
            return R.error(511,"车位已被使用");
        }
    }



    /**
     * 泊车
     */
    @RequestMapping("/boche")
    public R boche(@RequestParam String chepaihao, HttpServletRequest request){
        logger.debug("boche方法:,,Controller:{},,chepaihao:{}",this.getClass().getName(),chepaihao);

        List<CheweiEntity> lists = cheweiService.selectList(new EntityWrapper<CheweiEntity>().eq("chewei_types", 3));
        if(lists == null || lists.size()==0){
            return R.error(511,"没有空余车位");
        }else{
            CheweiEntity one = cheweiService.selectOne(new EntityWrapper<CheweiEntity>().eq("chepai_number", chepaihao));
            if(one != null){
                return R.error(511,"该车辆已经在园区内停车");
            }
            ChezhuEntity chezhu_chepai_number = chezhuService.selectOne(new EntityWrapper<ChezhuEntity>().eq("chezhu_chepai_number", chepaihao));
            CheweiEntity cheweiEntity = lists.get(0);
            if(chezhu_chepai_number != null){
                //园区车
                cheweiEntity.setChezhuId(chezhu_chepai_number.getId());
                cheweiEntity.setCheweiTypes(1);
            }else{
                //外来车
                cheweiEntity.setCheweiTypes(2);
            }
            cheweiEntity.setChepaiNumber(chepaihao);
            cheweiService.updateById(cheweiEntity);

            Date date = new Date();
            CheliangjiluEntity cheliangjiluEntity = new CheliangjiluEntity();
            cheliangjiluEntity.setCreateTime(date);
            cheliangjiluEntity.setInsertTime(date);
            cheliangjiluEntity.setChepaiNumber(chepaihao);
            cheliangjiluEntity.setCheweiId(cheweiEntity.getId());
            cheliangjiluEntity.setCheliangjiluTypes(1);
            cheliangjiluService.insert(cheliangjiluEntity);
            return R.ok();
        }
    }


    /**
     * 取车
     */
    @RequestMapping("/quche")
    public R quche(@RequestParam String chepaihao, HttpServletRequest request){
        logger.debug("quche方法:,,Controller:{},,chepaihao:{}",this.getClass().getName(),chepaihao);
        CheweiEntity cheweiEntity = cheweiService.selectOne(new EntityWrapper<CheweiEntity>().eq("chepai_number", chepaihao));
        if(cheweiEntity == null){
            return R.error(511,"您在本园区中没有停车");
        }else{
            CheliangjiluEntity cheliangjiluEntity = cheliangjiluService.selectOne(new EntityWrapper<CheliangjiluEntity>().eq("chepai_number", chepaihao).eq("cheliangjilu_types", 1));
            if(cheliangjiluEntity != null){
                Date date = new Date();
                Date insertTime = cheliangjiluEntity.getInsertTime();
                if(insertTime == null){
                    return R.error(511,"泊车时间为空");
                }
                long l = date.getTime() - insertTime.getTime();
                if(l<0){
                    return R.error(511,"取车时间不能小于泊车时间");
                }

                // 更新停车记录
                cheliangjiluEntity.setUpdateTime(date);
                cheliangjiluEntity.setCheliangjiluTypes(2);
                Integer xiaoshi = Integer.valueOf(String.valueOf(l / 1000 / 60 / 60))+1;
                cheliangjiluEntity.setXiaoshi(xiaoshi);
                cheliangjiluEntity.setMonery(xiaoshi*5);
                cheliangjiluService.updateById(cheliangjiluEntity);

                // 更新车位
                cheweiEntity.setCheweiTypes(3);
                cheweiEntity.setChepaiNumber(null);
                cheweiEntity.setChezhuId(null);
                cheweiService.updateAllColumnById(cheweiEntity);
                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());
        cheweiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }


}

论文参考

在这里插入图片描述

目 录
1 绪论 1
1.1 选题背景 1
1.2 选题意义 1
1.3 研究内容 2
2 系统开发技术 3
2.1 Java语言 3
2.2 SSM框架 3
2.3 MYSQL数据库 4
3 系统分析 5
3.1可行性研究 5
3.1.1经济可行性 5
3.1.2时间可行性 5
3.1.3操作可行性 5
3.2系统性能分析 6
3.2.1系统易用性 6
3.2.2系统健壮性 6
3.2.3系统安全性 6
3.3 系统流程分析 6
3.4系统功能分析 9
4 系统设计 12
4.1系统目标 12
4.2功能结构设计 13
4.3数据库设计 14
4.3.1数据库E-R图 14
4.3.2 数据库表结构 17
5 系统实现 20
5.1 管理员功能实现 20
5.1.1 员工管理 20
5.1.2 车主管理 20
5.1.3 车位管理 21
5.1.4 车辆记录管理 21
5.2 员工功能实现 22
5.2.1 车位管理 22
5.2.2 车辆记录 22
5.2.3 车主信息 23
6系统测试 24
6.1 系统测试的类型 24
6.2 功能测试 25
6.3 可用性测试 25
6.4 测试结果分析 25
结 论 26
参考文献 28
致 谢 29

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

q_2781179521

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值