计算机毕业设计 SpringBoot的停车场管理系统 Javaweb项目 Java实战项目 前后端分离 文档报告 代码讲解 安装调试

🍊作者:计算机编程-吉哥
🍊简介:专业从事JavaWeb程序开发,微信小程序开发,定制化项目、 源码、代码讲解、文档撰写、ppt制作。做自己喜欢的事,生活就是快乐的。
🍊心愿:点赞 👍 收藏 ⭐评论 📝
🍅 文末获取源码联系

👇🏻 精彩专栏推荐订阅 👇🏻 不然下次找不到哟~
Java毕业设计项目~热门选题推荐《1000套》

目录

1.技术选型

2.数据库表结构

3.开发工具

4.功能

4.1【角色】

4.2【前台功能模块】

4.3【后台功能模块】

5.项目演示截图

5.1 首页

5.2  立即预订

5.3 预约详情

5.4 个人中心

5.5 车位管理

5.6 车位预订管理

5.7 违规管理

5.8 员工管理

5.9 车辆管理

5.10 基础数据管理

6.数据库文件设计

7.核心代码 

7.1 车位预订Controller

7.2 车位预订Service

7.3 车位预订ServiceImpl

7.4 车位预订DAO

8.参考文档


1.技术选型

springboot、mybatisplus、vue、elementui、html、css、js、mysql、jdk1.8

2.数据库表结构

11张 

3.开发工具

idea、navicat、vscode

4.功能

4.1【角色】

超级管理员、管理员、用户

4.2【前台功能模块】

  • 登录注册
  • 首页
  • 车位
  • 公告
  • 个人中心(个人中心、车辆、车位预定、违规)

4.3【后台功能模块】

  • 登录
  • 首页
  • 个人中心
  • 管理员管理
  • 员工管理
  • 用户管理
  • 车辆管理
  • 车位管理
  • 车位预订管理
  • 公告管理
  • 违规管理
  • 基础数据管理
  • 轮播图管理

5.项目演示截图


5.1 首页

5.2  立即预订

5.3 预约详情

 

5.4 个人中心

 

5.5 车位管理

 

5.6 车位预订管理

 

5.7 违规管理

 

5.8 员工管理

 

5.9 车辆管理

 

5.10 基础数据管理

 

6.数据库文件设计

CREATE TABLE `cheliang` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
  `yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
  `cheliang_name` varchar(200) DEFAULT NULL COMMENT '车辆名称  Search111 ',
  `cheliang_uuid_number` varchar(200) DEFAULT NULL COMMENT '车辆编号',
  `cheliang_photo` varchar(200) DEFAULT NULL COMMENT '车辆照片',
  `cheliang_paizhao` varchar(200) DEFAULT NULL COMMENT '车辆牌照',
  `cheliang_file` varchar(200) DEFAULT NULL COMMENT '车牌',
  `cheliang_types` int(11) DEFAULT NULL COMMENT '车辆类型 Search111',
  `cheliang_content` longtext COMMENT '车辆介绍 ',
  `cheliang_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间  show3 listShow',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='车辆';


CREATE TABLE `chewei` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
  `chewei_name` varchar(200) DEFAULT NULL COMMENT '车位名称  Search111 ',
  `chewei_uuid_number` varchar(200) DEFAULT NULL COMMENT '车位编号',
  `chewei_photo` varchar(200) DEFAULT NULL COMMENT '车位照片',
  `chewei_address` varchar(200) DEFAULT NULL COMMENT '车位地点',
  `chewei_tingchefei` decimal(10,2) DEFAULT NULL COMMENT '金额/小时 ',
  `chewei_types` int(11) DEFAULT NULL COMMENT '车位类型 Search111',
  `chewei_content` longtext COMMENT '车位介绍 ',
  `shangxia_types` int(11) DEFAULT NULL COMMENT '是否上架 ',
  `chewei_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间  show1 show2 photoShow',
  PRIMARY KEY (`id`)
)


CREATE TABLE `config` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(100) NOT NULL COMMENT '配置参数名称',
  `value` varchar(100) DEFAULT NULL COMMENT '配置参数值',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='配置文件';


CREATE TABLE `dictionary` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `dic_code` varchar(200) DEFAULT NULL COMMENT '字段',
  `dic_name` varchar(200) DEFAULT NULL COMMENT '字段名',
  `code_index` int(11) DEFAULT NULL COMMENT '编码',
  `index_name` varchar(200) DEFAULT NULL COMMENT '编码名字  Search111 ',
  `super_id` int(11) DEFAULT NULL COMMENT '父字段id',
  `beizhu` varchar(200) DEFAULT NULL COMMENT '备注',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8 COMMENT='字典';


CREATE TABLE `gonggao` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
  `gonggao_name` varchar(200) DEFAULT NULL COMMENT '公告名称 Search111  ',
  `gonggao_photo` varchar(200) DEFAULT NULL COMMENT '公告图片 ',
  `gonggao_types` int(11) NOT NULL COMMENT '公告类型 Search111 ',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '发布时间',
  `gonggao_content` longtext COMMENT '公告详情 ',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 nameShow',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='公告';


CREATE TABLE `token` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `userid` bigint(20) NOT NULL COMMENT '儿童id',
  `username` varchar(100) NOT NULL COMMENT '儿童名',
  `tablename` varchar(100) DEFAULT NULL COMMENT '表名',
  `role` varchar(100) DEFAULT NULL COMMENT '角色',
  `token` varchar(200) NOT NULL COMMENT '密码',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
  `expiratedtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '过期时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='token表';


CREATE TABLE `users` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `username` varchar(100) NOT NULL COMMENT '儿童名',
  `password` varchar(100) NOT NULL COMMENT '密码',
  `role` varchar(100) DEFAULT '管理员' COMMENT '角色',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='管理员';


CREATE TABLE `weigui` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
  `cheliang_id` int(11) DEFAULT NULL COMMENT '车辆',
  `weigui_name` varchar(200) DEFAULT NULL COMMENT '违规名称  Search111 ',
  `weigui_uuid_number` varchar(200) DEFAULT NULL COMMENT '违规编号',
  `weigui_photo` varchar(200) DEFAULT NULL COMMENT '违规照片',
  `weigui_address` varchar(200) DEFAULT NULL COMMENT '违规地点',
  `weigui_types` int(11) DEFAULT NULL COMMENT '违规类型 Search111',
  `weigui_content` longtext COMMENT '违规介绍 ',
  `weigui_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',
  `insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间  show3 listShow',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='违规';


CREATE TABLE `yonghu` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `username` varchar(200) DEFAULT NULL COMMENT '账户',
  `password` varchar(200) DEFAULT NULL COMMENT '密码',
  `yonghu_uuid_number` varchar(200) DEFAULT NULL COMMENT '用户编号 Search111 ',
  `yonghu_name` varchar(200) DEFAULT NULL COMMENT '用户姓名 Search111 ',
  `yonghu_phone` varchar(200) DEFAULT NULL COMMENT '用户手机号',
  `yonghu_id_number` varchar(200) DEFAULT NULL COMMENT '用户身份证号',
  `yonghu_photo` varchar(200) DEFAULT NULL COMMENT '用户头像',
  `sex_types` int(11) DEFAULT NULL COMMENT '性别',
  `yonghu_email` varchar(200) DEFAULT NULL COMMENT '用户邮箱',
  `new_money` decimal(10,2) DEFAULT NULL COMMENT '余额 ',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='用户';


CREATE TABLE `yuangong` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `username` varchar(200) DEFAULT NULL COMMENT '账户',
  `password` varchar(200) DEFAULT NULL COMMENT '密码',
  `yuangong_uuid_number` varchar(200) DEFAULT NULL COMMENT '员工编号 Search111 ',
  `yuangong_name` varchar(200) DEFAULT NULL COMMENT '员工姓名 Search111 ',
  `yuangong_phone` varchar(200) DEFAULT NULL COMMENT '员工手机号',
  `yuangong_id_number` varchar(200) DEFAULT NULL COMMENT '员工身份证号',
  `yuangong_photo` varchar(200) DEFAULT NULL COMMENT '员工头像',
  `sex_types` int(11) DEFAULT NULL COMMENT '性别',
  `yuangong_email` varchar(200) DEFAULT NULL COMMENT '员工邮箱',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 ',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='员工';

7.核心代码 

7.1 车位预订Controller


package com.controller;

/**
 * 车位预订
 * 后端接口
 * @author 计算机编程-吉哥
 * @email
*/
@RestController
@Controller
@RequestMapping("/cheweiYuyue")
public class CheweiYuyueController {
    private static final Logger logger = LoggerFactory.getLogger(CheweiYuyueController.class);

    private static final String TABLE_NAME = "cheweiYuyue";

    @Autowired
    private CheweiYuyueService cheweiYuyueService;


    @Autowired
    private TokenService tokenService;

    @Autowired
    private CheliangService cheliangService;//车辆
    @Autowired
    private CheweiService cheweiService;//车位
    @Autowired
    private DictionaryService dictionaryService;//字典
    @Autowired
    private GonggaoService gonggaoService;//公告
    @Autowired
    private WeiguiService weiguiService;//违规
    @Autowired
    private YonghuService yonghuService;//用户
    @Autowired
    private YuangongService yuangongService;//员工
    @Autowired
    private UsersService usersService;//管理员


    /**
    * 后端列表
    */
    @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"));
        else if("员工".equals(role))
            params.put("yuangongId",request.getSession().getAttribute("userId"));
        CommonUtil.checkMap(params);
        PageUtils page = cheweiYuyueService.queryPage(params);

        //字典表数据转换
        List<CheweiYuyueView> list =(List<CheweiYuyueView>)page.getList();
        for(CheweiYuyueView 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);
        CheweiYuyueEntity cheweiYuyue = cheweiYuyueService.selectById(id);
        if(cheweiYuyue !=null){
            //entity转view
            CheweiYuyueView view = new CheweiYuyueView();
            BeanUtils.copyProperties( cheweiYuyue , view );//把实体数据重构到view中
            //级联表 车位
            //级联表
            CheweiEntity chewei = cheweiService.selectById(cheweiYuyue.getCheweiId());
            if(chewei != null){
            BeanUtils.copyProperties( chewei , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
            view.setCheweiId(chewei.getId());
            }
            //级联表 车辆
            //级联表
            CheliangEntity cheliang = cheliangService.selectById(cheweiYuyue.getCheliangId());
            if(cheliang != null){
            BeanUtils.copyProperties( cheliang , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
            view.setCheliangId(cheliang.getId());
            }
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

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

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

        Wrapper<CheweiYuyueEntity> queryWrapper = new EntityWrapper<CheweiYuyueEntity>()
            .eq("chewei_id", cheweiYuyue.getCheweiId())
            .eq("cheliang_id", cheweiYuyue.getCheliangId())
            .eq("chewei_yuyue_shichang", cheweiYuyue.getCheweiYuyueShichang())
            .in("chewei_yuyue_yesno_types", new Integer[]{1,2})
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        CheweiYuyueEntity cheweiYuyueEntity = cheweiYuyueService.selectOne(queryWrapper);
        if(cheweiYuyueEntity==null){
            cheweiYuyue.setInsertTime(new Date());
            cheweiYuyue.setCheweiYuyueYesnoTypes(1);
            cheweiYuyue.setCreateTime(new Date());
            cheweiYuyueService.insert(cheweiYuyue);
            return R.ok();
        }else {
            if(cheweiYuyueEntity.getCheweiYuyueYesnoTypes()==1)
                return R.error(511,"有相同的待审核的数据");
            else if(cheweiYuyueEntity.getCheweiYuyueYesnoTypes()==2)
                return R.error(511,"有相同的审核通过的数据");
            else
                return R.error(511,"表中有相同数据");
        }
    }

    /**
    * 后端修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody CheweiYuyueEntity cheweiYuyue, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
        logger.debug("update方法:,,Controller:{},,cheweiYuyue:{}",this.getClass().getName(),cheweiYuyue.toString());
        CheweiYuyueEntity oldCheweiYuyueEntity = cheweiYuyueService.selectById(cheweiYuyue.getId());//查询原先数据

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
        if("".equals(cheweiYuyue.getCheweiYuyueText()) || "null".equals(cheweiYuyue.getCheweiYuyueText())){
                cheweiYuyue.setCheweiYuyueText(null);
        }
        if("".equals(cheweiYuyue.getCheweiYuyueFile()) || "null".equals(cheweiYuyue.getCheweiYuyueFile())){
                cheweiYuyue.setCheweiYuyueFile(null);
        }
        if("".equals(cheweiYuyue.getCheweiYuyueYesnoText()) || "null".equals(cheweiYuyue.getCheweiYuyueYesnoText())){
                cheweiYuyue.setCheweiYuyueYesnoText(null);
        }

            cheweiYuyueService.updateById(cheweiYuyue);//根据id更新
            return R.ok();
    }


    /**
    * 审核
    */
    @RequestMapping("/shenhe")
    public R shenhe(@RequestBody CheweiYuyueEntity cheweiYuyueEntity, HttpServletRequest request){
        logger.debug("shenhe方法:,,Controller:{},,cheweiYuyueEntity:{}",this.getClass().getName(),cheweiYuyueEntity.toString());

        CheweiYuyueEntity oldCheweiYuyue = cheweiYuyueService.selectById(cheweiYuyueEntity.getId());//查询原先数据
        CheweiEntity cheweiEntity = cheweiService.selectById(oldCheweiYuyue.getCheweiId());
        if(cheweiYuyueEntity.getCheweiYuyueYesnoTypes() == 2){//通过
            cheweiEntity.setShangxiaTypes(2);
            cheweiService.updateById(cheweiEntity);
        cheweiYuyueEntity.setCheweiYuyueShenheTime(new Date());//审核时间
        cheweiYuyueService.updateById(cheweiYuyueEntity);//审核

        return R.ok();
    }

    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        List<CheweiYuyueEntity> oldCheweiYuyueList =cheweiYuyueService.selectBatchIds(Arrays.asList(ids));//要删除的数据
        cheweiYuyueService.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");
        //.eq("time", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))
        try {
            List<CheweiYuyueEntity> cheweiYuyueList = 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("static/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){
                            //循环
                            CheweiYuyueEntity cheweiYuyueEntity = new CheweiYuyueEntity();

                            //把要查询是否重复的字段放入map中
                                //报名编号
                                if(seachFields.containsKey("cheweiYuyueUuidNumber")){
                                    List<String> cheweiYuyueUuidNumber = seachFields.get("cheweiYuyueUuidNumber");
                                    cheweiYuyueUuidNumber.add(data.get(0));//要改的
                                }else{
                                    List<String> cheweiYuyueUuidNumber = new ArrayList<>();
                                    cheweiYuyueUuidNumber.add(data.get(0));//要改的
                                    seachFields.put("cheweiYuyueUuidNumber",cheweiYuyueUuidNumber);
                                }
                        }

                        //查询是否重复
                         //报名编号
                        List<CheweiYuyueEntity> cheweiYuyueEntities_cheweiYuyueUuidNumber = cheweiYuyueService.selectList(new EntityWrapper<CheweiYuyueEntity>().in("chewei_yuyue_uuid_number", seachFields.get("cheweiYuyueUuidNumber")));
                        if(cheweiYuyueEntities_cheweiYuyueUuidNumber.size() >0 ){
                            ArrayList<String> repeatFields = new ArrayList<>();
                            for(CheweiYuyueEntity s:cheweiYuyueEntities_cheweiYuyueUuidNumber){
                                repeatFields.add(s.getCheweiYuyueUuidNumber());
                            }
                            return R.error(511,"数据库的该表中的 [报名编号] 字段已经存在 存在数据为:"+repeatFields.toString());
                        }
                        cheweiYuyueService.insertBatch(cheweiYuyueList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }




    /**
    * 前端列表
    */
    @IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
        logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));

        CommonUtil.checkMap(params);
        PageUtils page = cheweiYuyueService.queryPage(params);

        //字典表数据转换
        List<CheweiYuyueView> list =(List<CheweiYuyueView>)page.getList();
        for(CheweiYuyueView c:list)
            dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段

        return R.ok().put("data", page);
    }

    /**
    * 前端详情
    */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Integer id, HttpServletRequest request){
        logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        CheweiYuyueEntity cheweiYuyue = cheweiYuyueService.selectById(id);
            if(cheweiYuyue !=null){


                //entity转view
                CheweiYuyueView view = new CheweiYuyueView();
                BeanUtils.copyProperties( cheweiYuyue , view );//把实体数据重构到view中

                //级联表
                    CheweiEntity chewei = cheweiService.selectById(cheweiYuyue.getCheweiId());
                if(chewei != null){
                    BeanUtils.copyProperties( chewei , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setCheweiId(chewei.getId());
                }
                //级联表
                    CheliangEntity cheliang = cheliangService.selectById(cheweiYuyue.getCheliangId());
                if(cheliang != null){
                    BeanUtils.copyProperties( cheliang , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setCheliangId(cheliang.getId());
                }
                //修改对应字典表字段
                dictionaryService.dictionaryConvert(view, request);
                return R.ok().put("data", view);
            }else {
                return R.error(511,"查不到数据");
            }
    }


    /**
    * 前端保存
    */
    @RequestMapping("/add")
    public R add(@RequestBody CheweiYuyueEntity cheweiYuyue, HttpServletRequest request){
        logger.debug("add方法:,,Controller:{},,cheweiYuyue:{}",this.getClass().getName(),cheweiYuyue.toString());
        Wrapper<CheweiYuyueEntity> queryWrapper = new EntityWrapper<CheweiYuyueEntity>()
            .eq("chewei_yuyue_uuid_number", cheweiYuyue.getCheweiYuyueUuidNumber())
            .eq("chewei_id", cheweiYuyue.getCheweiId())
            .eq("cheliang_id", cheweiYuyue.getCheliangId())
            .eq("chewei_yuyue_text", cheweiYuyue.getCheweiYuyueText())
            .eq("chewei_yuyue_shichang", cheweiYuyue.getCheweiYuyueShichang())
            .in("chewei_yuyue_yesno_types", new Integer[]{1,2})
            .eq("chewei_yuyue_yesno_text", cheweiYuyue.getCheweiYuyueYesnoText())
            cheweiYuyue.setInsertTime(new Date());
            cheweiYuyue.setCheweiYuyueYesnoTypes(1);
            cheweiYuyue.setCreateTime(new Date());
        cheweiYuyueService.insert(cheweiYuyue);

            return R.ok();
    }

    /**
     * 入库
     */
    @RequestMapping("/ruku")
    public R ruku(Integer id , HttpServletRequest request){
        logger.debug("refund:,,Controller:{},,ids:{}",this.getClass().getName(),id.toString());
        CheweiYuyueEntity cheweiYuyueEntity = cheweiYuyueService.selectById(id);
        cheweiYuyueEntity.setCheweiYuyueYesnoTypes(4);
        cheweiYuyueService.updateById(cheweiYuyueEntity);
        return R.ok();
    }
    /**
     * 出库
     */
    @RequestMapping("/chuku")
    public R chuku(Integer id , HttpServletRequest request){
        logger.debug("refund:,,Controller:{},,ids:{}",this.getClass().getName(),id.toString());
        CheweiYuyueEntity cheweiYuyueEntity = cheweiYuyueService.selectById(id);
        cheweiYuyueEntity.setCheweiYuyueYesnoTypes(5);
        cheweiYuyueService.updateById(cheweiYuyueEntity);
        return R.ok();
    }

    /**
     * 缴费
     */
    @RequestMapping("/jiaofei")
    public R jiaofei(Integer id , HttpServletRequest request){
        logger.debug("refund:,,Controller:{},,ids:{}",this.getClass().getName(),id.toString());
        CheweiYuyueEntity cheweiYuyueEntity = cheweiYuyueService.selectById(id);
        CheweiEntity cheweiEntity = cheweiService.selectById(cheweiYuyueEntity.getCheweiId());
        CheliangEntity cheliangEntity = cheliangService.selectById(cheweiYuyueEntity.getCheliangId());
        YonghuEntity yonghuEntity = yonghuService.selectById(cheliangEntity.getYonghuId());
        Double newMoney = yonghuEntity.getNewMoney();
        Integer cheweiYuyueShichang = cheweiYuyueEntity.getCheweiYuyueShichang();
        Double cheweiTingchefei = cheweiEntity.getCheweiTingchefei();
        double v = cheweiTingchefei * cheweiYuyueShichang;
        if(newMoney<v)
            return R.error("用户余额不足请充值后在缴费");
        yonghuEntity.setNewMoney(newMoney-v);
        cheweiYuyueEntity.setCheweiYuyueYesnoTypes(6);
        cheweiEntity.setShangxiaTypes(1);
        cheweiService.updateById(cheweiEntity);
        cheweiYuyueService.updateById(cheweiYuyueEntity);
        yonghuService.updateById(yonghuEntity);
        return R.ok();
    }


}

7.2 车位预订Service

package com.service;

import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.CheweiYuyueEntity;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.lang.Nullable;
import java.util.List;

/**
 * 车位预订 服务类
 */
public interface CheweiYuyueService extends IService<CheweiYuyueEntity> {

    /**
    * @param params 查询参数
    * @return 带分页的查询出来的数据
    */
     PageUtils queryPage(Map<String, Object> params);

}

7.3 车位预订ServiceImpl

package com.service.impl;


/**
 * 车位预订 服务实现类
 * author 计算机编程-吉哥
 */
@Service("cheweiYuyueService")
@Transactional
public class CheweiYuyueServiceImpl extends ServiceImpl<CheweiYuyueDao, CheweiYuyueEntity> implements CheweiYuyueService {

    @Override
    public PageUtils queryPage(Map<String,Object> params) {
        Page<CheweiYuyueView> page =new Query<CheweiYuyueView>(params).getPage();
        page.setRecords(baseMapper.selectListView(page,params));
        return new PageUtils(page);
    }


}

7.4 车位预订DAO

package com.dao;

import com.entity.CheweiYuyueEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;

import org.apache.ibatis.annotations.Param;
import com.entity.view.CheweiYuyueView;

/**
 * 车位预订 Dao 接口
 *
 * @author 
 */
public interface CheweiYuyueDao extends BaseMapper<CheweiYuyueEntity> {

   List<CheweiYuyueView> selectListView(Pagination page,@Param("params")Map<String,Object> params);

}

8.参考文档

 

 

你可能还有感兴趣的项目👇🏻👇🏻👇🏻

更多项目推荐:计算机毕业设计项目

如果大家有任何疑虑,请在下方咨询或评论

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/287178.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

逻辑回归算法到底能做什么

逻辑回归&#xff08;Logistic Regression&#xff09;是一种广义的线性回归分析模型&#xff0c;常用于数据挖掘、疾病自动诊断、经济预测等领域。它根据给定的自变量数据集来估计事件的发生概率。变量的范围在0和1之间&#xff0c;通常用于二分类问题&#xff0c;最终输出的预…

Opencv(C++)学习之cv::calcHist 任意bin数量进行直方图计算

**背景&#xff1a;**当前网上常见的直方图使用方法都是默认使用256的范围&#xff0c;而对于使用特定范围的直方图方法讲的不够清楚。仔细研究后总结如下&#xff1a; 1、常见使用方法&#xff0c;直接对灰度图按256个Bin进行计算。 Mat mHistUn; int channels[1] { 0 }; {…

键盘数字键打不出来怎么解锁?收藏好这4个简单方法!

“我在使用电脑进行办公时&#xff0c;突然发现我电脑键盘的数字键无法输入&#xff0c;这该怎么办呢&#xff1f;我应该如何解锁呢&#xff1f;请给我出出主意吧&#xff01;” 在日常使用电脑时&#xff0c;很多用户都需要使用键盘输入文字。但有时候部分用户也会遇到键盘数字…

你知道vue中key的原理吗?说说你对它的理解

一、Key是什么 开始之前&#xff0c;我们先还原两个实际工作场景 当我们在使用v-for时&#xff0c;需要给单元加上key <ul><li v-for"item in items" :key"item.id">...</li> </ul>用new Date()生成的时间戳作为key&#xff0c…

Docker 网络管理

一、Docker网络简介 Docker网络是容器化应用程序的重要组成部分&#xff0c;它使得容器之间可以互相通信和连接&#xff0c;同时也提供了容器与外部环境之间的隔离和连接。 二、Docker网络网络模式 Docker 提供了多种网络模式&#xff0c;可以通过docker network ls 命令查看…

springboot实现ChatGPT式调用(一次调用,持续返回)

下边实现了一个持续返回100以内随机数的接口&#xff0c;在接口超时之前会每隔1秒返回一个随机数 GetMapping(value "/getRandomNum", produces MediaType.TEXT_EVENT_STREAM_VALUE) public SseEmitter getRandomNum() {SseEmitter emitter new SseEmitter();Th…

五、Spring AOP面向切面编程(基于注解方式实现和细节)

本章概要 Spring AOP底层技术组成初步实现获取通知细节信息切点表达式语法重用&#xff08;提取&#xff09;切点表达式环绕通知切面优先级设置CGLib动态代理生效注解实现小结 5.5.1 Spring AOP 底层技术组成 动态代理&#xff08;InvocationHandler&#xff09;&#xff1a;…

SQL Server 权限管理

CSDN 成就一亿技术人&#xff01; 2024年 第一篇 难度指数&#xff1a;* * CSDN 成就一亿技术人&#xff01; 目录 1. 权限管理 什么是权限管理&#xff1f; SQL server的安全机制 服务器级角色 数据库级角色 对象级角色 2. 创建用户 赋予权限 最重要的一步骤 1. 权限…

文章解读与仿真程序复现思路——电网技术EI\CSCD\北大核心《计及源荷不确定性的综合能源系统日前-日内协调优化调度》

本专栏栏目提供文章与程序复现思路&#xff0c;具体已有的论文与论文源程序可翻阅本博主的专栏栏目《论文与完整程序》 这个标题指的是一个综合能源系统&#xff08;包括多种能源资源和负荷需求&#xff09;&#xff0c;在考虑到源&#xff08;能源供给&#xff09;和荷&#…

代码随想录算法训练营Day16 | 654.最大二叉树、617.合并二叉树、700.二叉搜索树中的搜索、98.验证二叉搜索树

LeetCode 654 最大二叉树 本题思路&#xff1a;我们可以看到每次其实这个找最大值&#xff0c;然后创建节点的过程就是一个二叉树的前序遍历的过程。所以&#xff0c;我们可以递归来完成它。 先创找到数组中&#xff0c;最大的值的下标&#xff0c;然后创建根节点然后根据下标…

【零基础入门TypeScript】TypeScript - 基本语法

目录 你的第一个 TypeScript 代码 编译并执行 TypeScript 程序 编译器标志 TypeScript 中的标识符 TypeScript ─ 关键字 空格和换行符 TypeScript 区分大小写 分号是可选的 TypeScript 中的注释 TypeScript 和面向对象 语法定义了一组编写程序的规则。每种语言规范都…

Linux系统:引导过程与服务控制

目录 一、linux系统引导过程 1、引导过程介绍 1.1 引导过程总览图 1.2 引导过程详解 1.3 系统初始化进程 1.4 Ststemd单元类型 1.5 运行级别所对应的Systemd目标 二、排除启动类故障 1、修复MBR扇区故障 1.1 故障原因 1.2 故障现象 1.3 解决思路 1.4 详细操作步骤…

密码学:带密钥的消息摘要算法一数字签名算法

文章目录 前言手写签名和数字签名前置知识点&#xff1a;消息摘要算法数字签名算法数字签名算法的由来数字签名算法在实际运用的过程附加&#xff1a;签名和摘要值的解释 数字签名算法的家谱数字签名算法的消息传递模型经典数字签名算法-RSA实现 数字签名标准算法-DSA实现 圆曲…

IPC之十二:使用libdbus在D-Bus上异步发送/接收信号的实例

IPC 是 Linux 编程中一个重要的概念&#xff0c;IPC 有多种方式&#xff0c;本 IPC 系列文章的前十篇介绍了几乎所有的常用的 IPC 方法&#xff0c;每种方法都给出了具体实例&#xff0c;前面的文章里介绍了 D-Bus 的基本概念以及调用远程方法的实例&#xff0c;本文介绍 D-Bus…

【VTK-Rendering::Core】第二期 vtkTextActor

很高兴在雪易的CSDN遇见你 VTK技术爱好者 QQ&#xff1a;870202403 前言 本文以vtkTextActor为起点&#xff0c;分享VTK中Text相关的内容&#xff0c;希望对各位小伙伴有所帮助&#xff01; 感谢各位小伙伴的点赞关注&#xff0c;小易会继续努力分享&#xff0c;一起进步&a…

提升三维模型数据的几何坐标纠正速度效率具体技术方法

提升三维模型数据的几何坐标纠正速度效率具体技术方法 根据搜索结果&#xff0c;以下是提升倾斜摄影三维模型数据的几何坐标纠正和三维重建速度的具体技术方法&#xff1a; 1、增加控制点&#xff1a;通过增加控制点数量可以提高几何坐标精度。控制点是已知地面坐标的点&#…

儿童可以戴骨传导耳机吗?骨传导耳机对儿童有危害吗?

儿童是可以佩戴骨传导耳机的&#xff0c;相比于传统的入耳式蓝牙耳机&#xff0c;佩戴骨传导耳机要更健康一些。 首先骨传导耳机通过人体骨骼来传递声音&#xff0c;不经过耳道和耳膜&#xff0c;所以对听力的损伤较小&#xff0c;而且由于儿童还处于发育期&#xff0c;耳道和耳…

【并发设计模式】聊聊等待唤醒机制的规范实现

在多线程编程中&#xff0c;其实就是分工、协作、互斥。在很多场景中&#xff0c;比如A执行的过程中需要同步等待另外一个线程处理的结果&#xff0c;这种方式下&#xff0c;就是一种等待唤醒的机制。本篇我们来讲述等待唤醒机制的三种实现&#xff0c;以及对应的应用场景。 G…

{“sn“:““,“error“:3,“desc“:“VAD is not available“,“sub_error“:3100}解决办法

目录 问题描述: 解决顺序: 问题描述: 这个问题是在使用百度语音识别时出现的问题,当一切都配置好之后,启动程序,点击录音,发现程序并没有执行onEvent方法,直接闪退了,当断点调试时发现程序并没有进入onEvent方法,抛出异常{"sn":"","erro…

从0搭建github.io网页

点击跳转到&#x1f517;我的博客文章目录 从0搭建github.io网页 文章目录 从0搭建github.io网页1.成果展示1.1 网址和源码1.2 页面展示 2.new对象2.1 创建仓库 3.github.io仓库的初始化3.1 千里之行&#xff0c;始于足下3.2 _config.yml3.3 一点杂活 4.PerCheung.github.io.p…
最新文章