• 大学生做的停车场预约管理系统,java的技术栈SSM,jsp技术,使用idea开发


    基于SSM+JSP的停车场管理系统

    一、系统截图

    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

    二、系统架构

    系统架构:本系统使用Java作为主要的编程语言编程开发,后台以SSM框架作为主要的技术支撑,数据库采用采用MySQL,前端采用JSP同时配合JavaScript语言,同时引入百度的Ueditor编辑器丰富页面的内容。
    开发环境:JDK8+IDEA+MySQL8.0

    本系统是一个停车场管理系统,针对校园停车场的管理的需要,基于此开发出一个有教师,管理员等多角色的校园停车管理系统。
    本系统包括教师、管理员两种用户角色,具体功能如下:
    (1)教师:
    个人中心:修改个人的信息以及个人的密码信息。
    停车区域信息:查看校园不同的停车区域的信息,以及当前的车位的空闲数量,对有空闲区域的进行预约。
    停车车位信息:查看已经预约过的车位信息,对车位的状态进行查看。
    停车车位预约:查看已经预约过的车位信息,并且可以根据停车情况进行入校或者取消预约的操作,支持条件查询,分页查询。
    停车信息管理:已经入校之后的教师的车位信息,可以去对应的车位区域进行停车,停车登记车牌号,车型等信息,填写信息之后离校时,可以进行离校操作。
    新闻管理:查看管理员发布的新闻公告信息。
    (2)管理员的后台:
    个人信息管理:修改个人的信息以及个人的密码信息。
    管理员信息管理:可以添加,修改管理员的信息,按条件分页查询管理员信息,批量删除等。
    教师信息管理:可以添加,修改教师的信息,按条件分页查询教师信息,批量删除等。
    停车区域管理:管理停车的区域信息,包括位置,停车位的数量,支持新增,批量删除,修改,分页页询等。
    车位信息管理:管理车位的基本信息,包括车位所在的区域,车位的编号,详细信息等,支持新增,批量删除,修改,分页页询等。
    车位预约管理:管理车位的预约信息,包括某个车位的预约状态(未处理,已取消),批量删除,条件查询,分页页询等。
    停车信息管理:管理教师的入校的停车信息,包括停车的时间,车位的状态等,支持,批量删除,条件查询,分页页询等。
    新闻类型管理:管理校园的新闻类型信息,支持新增,批量删除,修改,分页页询等。
    新闻信息管理:管理发布的校园新闻信息,支持新增,批量删除,修改,分页页询等。

    三、下载链接

    点击下载

    更多关于项目的描述可以点击基于SSM+VUE的停车场预约管理系统

    四、核心代码

    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 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.TingcheEntity;import com.service.TingcheService;
    import com.entity.view.TingcheView;
    import com.service.TingchequyuService;
    import com.entity.TingchequyuEntity;
    import com.service.YonghuService;
    import com.entity.YonghuEntity;import com.utils.PageUtils;
    import com.utils.R;
    ​
    /**
     * 停车信息
     * 后端接口
     * @author
     * @email
     * @date 2021-05-05
    */
    @RestController
    @Controller
    @RequestMapping("/tingche")
    public class TingcheController {
        private static final Logger logger = LoggerFactory.getLogger(TingcheController.class);
    ​
        @Autowired
        private TingcheService tingcheService;
    ​
    ​
        @Autowired
        private TokenService tokenService;
        @Autowired
        private DictionaryService dictionaryService;
    ​
    ​
    ​
        //级联表service
        @Autowired
        private TingchequyuService tingchequyuService;
        @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(StringUtil.isNotEmpty(role) && "教师".equals(role)){
                params.put("yonghuId",request.getSession().getAttribute("userId"));
            }
            params.put("orderBy","id");
            PageUtils page = tingcheService.queryPage(params);
    ​
            //字典表数据转换
            List<TingcheView> list =(List<TingcheView>)page.getList();
            for(TingcheView 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);
            TingcheEntity tingche = tingcheService.selectById(id);
            if(tingche !=null){
                //entity转view
                TingcheView view = new TingcheView();
                BeanUtils.copyProperties( tingche , view );//把实体数据重构到view中
    ​
                //级联表
                TingchequyuEntity tingchequyu = tingchequyuService.selectById(tingche.getTingchequyuId());
                if(tingchequyu != null){
                    BeanUtils.copyProperties( tingchequyu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setTingchequyuId(tingchequyu.getId());
                }
                //级联表
                YonghuEntity yonghu = yonghuService.selectById(tingche.getYonghuId());
                if(yonghu != null){
                    BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setYonghuId(yonghu.getId());
                }
                //修改对应字典表字段
                dictionaryService.dictionaryConvert(view);
                return R.ok().put("data", view);
            }else {
                return R.error(511,"查不到数据");
            }}
    ​
        /**
        * 后端保存
        */
        @RequestMapping("/save")
        public R save(@RequestBody TingcheEntity tingche, HttpServletRequest request){
            logger.debug("save方法:,,Controller:{},,tingche:{}",this.getClass().getName(),tingche.toString());
            Wrapper<TingcheEntity> queryWrapper = new EntityWrapper<TingcheEntity>()
                .eq("yonghu_id", tingche.getYonghuId())
                .eq("tingchequyu_id", tingche.getTingchequyuId())
                .eq("tingche_paihao", tingche.getTingchePaihao())
                .eq("tingche_chexing", tingche.getTingcheChexing())
                ;
            logger.info("sql语句:"+queryWrapper.getSqlSegment());
            TingcheEntity tingcheEntity = tingcheService.selectOne(queryWrapper);
            if(tingcheEntity==null){
                tingche.setInsertTime(new Date());
                tingche.setCreateTime(new Date());
            //  String role = String.valueOf(request.getSession().getAttribute("role"));
            //  if("".equals(role)){
            //      tingche.set
            //  }
                tingcheService.insert(tingche);
                return R.ok();
            }else {
                return R.error(511,"表中有相同数据");
            }
        }
    ​
        /**
        * 后端修改
        */
        @RequestMapping("/update")
        public R update(@RequestBody TingcheEntity tingche, HttpServletRequest request){
            logger.debug("update方法:,,Controller:{},,tingche:{}",this.getClass().getName(),tingche.toString());
            //根据字段查询是否有相同数据
            Wrapper<TingcheEntity> queryWrapper = new EntityWrapper<TingcheEntity>()
                .notIn("id",tingche.getId())
                .andNew()
                .eq("yonghu_id", tingche.getYonghuId())
                .eq("tingchequyu_id", tingche.getTingchequyuId())
                .eq("tingche_paihao", tingche.getTingchePaihao())
                .eq("tingche_chexing", tingche.getTingcheChexing())
                ;
            logger.info("sql语句:"+queryWrapper.getSqlSegment());
            TingcheEntity tingcheEntity = tingcheService.selectOne(queryWrapper);
            if(tingcheEntity==null){
                //  String role = String.valueOf(request.getSession().getAttribute("role"));
                //  if("".equals(role)){
                //      tingche.set
                //  }
                tingcheService.updateById(tingche);//根据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());
            List<TingcheEntity> tingcheEntities = tingcheService.selectBatchIds(Arrays.asList(ids));
            if(tingcheEntities.size() <= 0){
                return R.error();
            }
            Boolean yanzheng = true;
            for (TingcheEntity t:tingcheEntities) {
                if(yanzheng){
                    TingchequyuEntity tingchequyu = tingchequyuService.selectById(t.getTingchequyuId());
                    if(tingchequyu == null){
                        return R.error();
                    }
                    if(t.getLixiaoTime() != null){
                        tingchequyu.setTingchequyuNumber(tingchequyu.getTingchequyuNumber()+1);
                        boolean b = tingchequyuService.updateById(tingchequyu);
                        yanzheng = b;
                    }
                    if(!yanzheng){
                        return R.error();
                    }
                }else{
                    return R.error();
                }
            }
            tingcheService.deleteBatchIds(Arrays.asList(ids));
            return R.ok();
        }
    ​
    ​
    ​
        /**
        * 前端列表
        */
        @RequestMapping("/list")
        public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
            logger.debug("list方法:,,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"));
            }
            // 没有指定排序字段就默认id倒序
            if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){
                params.put("orderBy","id");
            }
            PageUtils page = tingcheService.queryPage(params);
    ​
            //字典表数据转换
            List<TingcheView> list =(List<TingcheView>)page.getList();
            for(TingcheView c:list){
                //修改对应字典表字段
                dictionaryService.dictionaryConvert(c);
            }
            return R.ok().put("data", page);
        }
    ​
        /**
        * 前端详情
        */
        @RequestMapping("/detail/{id}")
        public R detail(@PathVariable("id") Long id){
            logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
            TingcheEntity tingche = tingcheService.selectById(id);
                if(tingche !=null){
                    //entity转view
            TingcheView view = new TingcheView();
                    BeanUtils.copyProperties( tingche , view );//把实体数据重构到view中
    ​
                    //级联表
                        TingchequyuEntity tingchequyu = tingchequyuService.selectById(tingche.getTingchequyuId());
                    if(tingchequyu != null){
                        BeanUtils.copyProperties( tingchequyu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                        view.setTingchequyuId(tingchequyu.getId());
                    }
                    //级联表
                        YonghuEntity yonghu = yonghuService.selectById(tingche.getYonghuId());
                    if(yonghu != null){
                        BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                        view.setYonghuId(yonghu.getId());
                    }
                    //修改对应字典表字段
                    dictionaryService.dictionaryConvert(view);
                    return R.ok().put("data", view);
                }else {
                    return R.error(511,"查不到数据");
                }
        }
    ​
    ​
        /**
        * 前端保存
        */
        @RequestMapping("/add")
        public R add(@RequestBody TingcheEntity tingche, HttpServletRequest request){
            logger.debug("add方法:,,Controller:{},,tingche:{}",this.getClass().getName(),tingche.toString());
            Wrapper<TingcheEntity> queryWrapper = new EntityWrapper<TingcheEntity>()
                .eq("yonghu_id", tingche.getYonghuId())
                .eq("tingchequyu_id", tingche.getTingchequyuId())
                .eq("tingche_paihao", tingche.getTingchePaihao())
                .eq("tingche_chexing", tingche.getTingcheChexing())
                ;
            logger.info("sql语句:"+queryWrapper.getSqlSegment());
        TingcheEntity tingcheEntity = tingcheService.selectOne(queryWrapper);
            if(tingcheEntity==null){
                tingche.setInsertTime(new Date());
                tingche.setCreateTime(new Date());
            //  String role = String.valueOf(request.getSession().getAttribute("role"));
            //  if("".equals(role)){
            //      tingche.set
            //  }
            tingcheService.insert(tingche);
                return R.ok();
            }else {
                return R.error(511,"表中有相同数据");
            }
        }
    ​
    ​
    ​
    ​
    ​
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246
    • 247
    • 248
    • 249
    • 250
    • 251
    • 252
    • 253
    • 254
    • 255
    • 256
    • 257
    • 258
    • 259
    • 260
    • 261
    • 262
    • 263
    • 264
    • 265
    • 266
    • 267
    • 268
    • 269
    • 270
    • 271
    • 272
    • 273
    • 274
    • 275
    • 276
    • 277
    • 278
    • 279
    • 280
    • 281
    • 282
    • 283
    • 284
    • 285
    • 286
    • 287
    • 288
    • 289
    • 290
    • 291
    • 292
    • 293
    • 294
    • 295
    • 296
    • 297
    • 298
    • 299
    • 300
    • 301
    • 302
    • 303
    • 304
    • 305
    • 306
    • 307
    • 308
    • 309
  • 相关阅读:
    LeetCode--287. 寻找重复数(C++描述)
    利用Linked SQL Server提权
    vs2013调试的时候我想查看某个变量的值的窗口被我删了,我需要找到那个查看局部变量的值的窗口
    MySQL基础3-约束
    【无标题】
    【Mysql】上号(连接数据库)操作一把——增删改查
    java毕业设计大众采编本微资讯发布平台(附源码、数据库)
    unidbg-补文件环境(二)
    机器学习-模型评估与选择(第2章)课后习题
    活动安排问题(贪心算法)
  • 原文地址:https://blog.csdn.net/cxy1024byte/article/details/126678601