原创

基于JAVA SpringBoot和Vue社区网格化管理服务平台毕业设计,附源码

摘要
本文旨在设计并实现一个基于Java SpringBoot和Vue技术的社区网格化管理服务平台。该平台主要包括用户功能和管理员功能两大部分,用户功能涵盖单位管理、问卷调查、论坛讨论、公告查看等;管理员功能则包括单位管理、基础数据维护、帖子和公告类型管理、人口状况管理等。通过前后端分离架构,利用SpringBoot框架在后端提供API接口,前端使用Vue.js进行数据交互,实现社区信息的数字化和智能化管理,提升社区管理效率和服务质量。


功能介绍
管理员和普通用户两种用户角色;

管理员:个人中心、管理员管理、基础数据管理、论坛管理、公告管理、意见征集管理、商业门店管理、单位管理、用户管理、问卷调查管理、试题管理、调查记录管理、轮播图管理等;

普通用户:个人中心、首页、论坛交流、问卷调查、意见征集、商业门店、单位、公告信息等。


技术介绍
后端:Java语言的Spring Boot框架、MySQL数据库、Maven依赖管理等;

前端:Vue、element-ui、axios等。


部分代码展示

@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"));
        CommonUtil.checkMap(params);
        PageUtils page = danweiService.queryPage(params);

        //字典表数据转换
        List<DanweiView> list =(List<DanweiView>)page.getList();
        for(DanweiView 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);
        DanweiEntity danwei = danweiService.selectById(id);
        if(danwei !=null){
            //entity转view
            DanweiView view = new DanweiView();
            BeanUtils.copyProperties( danwei , view );//把实体数据重构到view中
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

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

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

        Wrapper<DanweiEntity> queryWrapper = new EntityWrapper<DanweiEntity>()
            .eq("danwei_name", danwei.getDanweiName())
            .eq("danwei_address", danwei.getDanweiAddress())
            .eq("danwei_types", danwei.getDanweiTypes())
            ;

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

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

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
        if("".equals(danwei.getDanweiPhoto()) || "null".equals(danwei.getDanweiPhoto())){
                danwei.setDanweiPhoto(null);
        }

            danweiService.updateById(danwei);//根据id更新
            return R.ok();
    }

演示视频链接

源码展示链接

正文到此结束
本文目录