基于java+springboot+vue的地方区域管理系统

项目介绍

信息数据从传统到当代,是一直在变革当中,突如其来的互联网让传统的信息管理看到了革命性的曙光,因为传统信息管理从时效性,还是安全性,还是可操作性等各个方面来讲,遇到了互联网时代才发现能补上自古以来的短板,有效的提升管理的效率和业务水平。传统的管理模式,时间越久管理的内容越多,也需要更多的人来对数据进行整理,并且数据的汇总查询方面效率也是极其的低下,并且数据安全方面永远不会保证安全性能。结合数据内容管理的种种缺点,在互联网时代都可以得到有效的补充。结合先进的互联网技术,开发符合需求的软件,让数据内容管理不管是从录入的及时性,查看的及时性还是汇总分析的及时性,都能让正确率达到最高,管理更加的科学和便捷。本次开发的政府管理系统实现了字典管理、公告管理、公文管理、会议室管理、会议室预约管理、来访登记管理、信访督办管理、用户管理、管理员管理等功能。系统用到了关系型数据库中王者MySql作为系统的数据库,有效的对数据进行安全的存储,有效的备份,对数据可靠性方面得到了保证。并且程序也具备程序需求的所有功能,使得操作性还是安全性都大大提高,让政府管理系统更能从理念走到现实,确确实实的让人们提升信息处理效率。

在这里插入图片描述

开发环境

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

系统实现

5.1管理员功能实现
5.1.1 来访登记管理
此页面让管理员管理来访登记的数据,来访登记管理页面见下图。此页面主要实现来访登记的增加、修改、删除、查看的功能。
在这里插入图片描述

图5-1 来访登记管理页面

5.1.2 公告信息管理
公告信息管理页面提供的功能操作有:新增公告,修改公告,删除公告操作。下图就是公告信息管理页面。
在这里插入图片描述

图5.3 公告信息管理页面

5.1.3公告类型管理
公告类型管理页面显示所有公告类型,在此页面既可以让管理员添加新的公告信息类型,也能对已有的公告类型信息执行编辑更新,失效的公告类型信息也能让管理员快速删除。下图就是公告类型管理页面。
在这里插入图片描述

图5.4 公告类型列表页面

核心代码

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

    @Autowired
    private HuiyishiYuyueService huiyishiYuyueService;


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

    //级联表service
    @Autowired
    private HuiyishiService huiyishiService;
    @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 = huiyishiYuyueService.queryPage(params);

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

                //级联表
                HuiyishiEntity huiyishi = huiyishiService.selectById(huiyishiYuyue.getHuiyishiId());
                if(huiyishi != null){
                    BeanUtils.copyProperties( huiyishi , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setHuiyishiId(huiyishi.getId());
                }
                //级联表
                YonghuEntity yonghu = yonghuService.selectById(huiyishiYuyue.getYonghuId());
                if(yonghu != null){
                    BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setYonghuId(yonghu.getId());
                }
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

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

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永远不会进入");
        else if("用户".equals(role))
            huiyishiYuyue.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));

        Wrapper<HuiyishiYuyueEntity> queryWrapper = new EntityWrapper<HuiyishiYuyueEntity>()
            .eq("yonghu_id", huiyishiYuyue.getYonghuId())
            .eq("huiyishi_id", huiyishiYuyue.getHuiyishiId())
            .eq("huiyishi_yuyue_uuid_number", huiyishiYuyue.getHuiyishiYuyueUuidNumber())
            .eq("huiyishi_yuyue_mingcheng", huiyishiYuyue.getHuiyishiYuyueMingcheng())
            .eq("huiyishi_yuyue_types", huiyishiYuyue.getHuiyishiYuyueTypes())
            .eq("huiyishi_yuyue_yesno_types", huiyishiYuyue.getHuiyishiYuyueYesnoTypes())
            .eq("huiyishi_yuyue_yesno_text", huiyishiYuyue.getHuiyishiYuyueYesnoText())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        HuiyishiYuyueEntity huiyishiYuyueEntity = huiyishiYuyueService.selectOne(queryWrapper);
        if(huiyishiYuyueEntity==null){
            huiyishiYuyue.setInsertTime(new Date());
            huiyishiYuyue.setHuiyishiYuyueYesnoTypes(1);
            huiyishiYuyue.setCreateTime(new Date());
            huiyishiYuyueService.insert(huiyishiYuyue);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

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

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
//        else if("用户".equals(role))
//            huiyishiYuyue.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
        //根据字段查询是否有相同数据
        Wrapper<HuiyishiYuyueEntity> queryWrapper = new EntityWrapper<HuiyishiYuyueEntity>()
            .notIn("id",huiyishiYuyue.getId())
            .andNew()
            .eq("yonghu_id", huiyishiYuyue.getYonghuId())
            .eq("huiyishi_id", huiyishiYuyue.getHuiyishiId())
            .eq("huiyishi_yuyue_uuid_number", huiyishiYuyue.getHuiyishiYuyueUuidNumber())
            .eq("huiyishi_yuyue_mingcheng", huiyishiYuyue.getHuiyishiYuyueMingcheng())
            .eq("huiyishi_yuyue_types", huiyishiYuyue.getHuiyishiYuyueTypes())
            .eq("insert_time", huiyishiYuyue.getInsertTime())
            .eq("shiyong_kaishi_time", huiyishiYuyue.getShiyongKaishiTime())
            .eq("shiyong_jieshu_time", huiyishiYuyue.getShiyongJieshuTime())
            .eq("huiyishi_yuyue_yesno_types", huiyishiYuyue.getHuiyishiYuyueYesnoTypes())
            .eq("huiyishi_yuyue_yesno_text", huiyishiYuyue.getHuiyishiYuyueYesnoText())
            .eq("huiyishi_yuyue_shenhe_time", huiyishiYuyue.getHuiyishiYuyueShenheTime())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        HuiyishiYuyueEntity huiyishiYuyueEntity = huiyishiYuyueService.selectOne(queryWrapper);
        if(huiyishiYuyueEntity==null){
            huiyishiYuyueService.updateById(huiyishiYuyue);//根据id更新
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }


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

//        if(huiyishiYuyue.getHuiyishiYuyueYesnoTypes() == 2){//通过
//            huiyishiYuyue.setHuiyishiYuyueTypes();
//        }else if(huiyishiYuyue.getHuiyishiYuyueYesnoTypes() == 3){//拒绝
//            huiyishiYuyue.setHuiyishiYuyueTypes();
//        }
        huiyishiYuyue.setHuiyishiYuyueShenheTime(new Date());//审核时间
        huiyishiYuyueService.updateById(huiyishiYuyue);//审核
        return R.ok();
    }

    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        huiyishiYuyueService.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<HuiyishiYuyueEntity> huiyishiYuyueList = 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){
                            //循环
                            HuiyishiYuyueEntity huiyishiYuyueEntity = new HuiyishiYuyueEntity();
//                            huiyishiYuyueEntity.setYonghuId(Integer.valueOf(data.get(0)));   //用户 要改的
//                            huiyishiYuyueEntity.setHuiyishiId(Integer.valueOf(data.get(0)));   //会议室 要改的
//                            huiyishiYuyueEntity.setHuiyishiYuyueUuidNumber(data.get(0));                    //会议室预约编号 要改的
//                            huiyishiYuyueEntity.setHuiyishiYuyueMingcheng(data.get(0));                    //会议室预约名称 要改的
//                            huiyishiYuyueEntity.setHuiyishiYuyueTypes(Integer.valueOf(data.get(0)));   //会议室预约类型 要改的
//                            huiyishiYuyueEntity.setHuiyishiYuyueContent("");//详情和图片
//                            huiyishiYuyueEntity.setInsertTime(date);//时间
//                            huiyishiYuyueEntity.setShiyongKaishiTime(sdf.parse(data.get(0)));          //使用开始时间 要改的
//                            huiyishiYuyueEntity.setShiyongJieshuTime(sdf.parse(data.get(0)));          //使用结束时间 要改的
//                            huiyishiYuyueEntity.setHuiyishiYuyueYesnoTypes(Integer.valueOf(data.get(0)));   //审核状态 要改的
//                            huiyishiYuyueEntity.setHuiyishiYuyueYesnoText(data.get(0));                    //审核意见 要改的
//                            huiyishiYuyueEntity.setHuiyishiYuyueShenheTime(sdf.parse(data.get(0)));          //审核时间 要改的
//                            huiyishiYuyueEntity.setCreateTime(date);//时间
                            huiyishiYuyueList.add(huiyishiYuyueEntity);


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

                        //查询是否重复
                         //会议室预约编号
                        List<HuiyishiYuyueEntity> huiyishiYuyueEntities_huiyishiYuyueUuidNumber = huiyishiYuyueService.selectList(new EntityWrapper<HuiyishiYuyueEntity>().in("huiyishi_yuyue_uuid_number", seachFields.get("huiyishiYuyueUuidNumber")));
                        if(huiyishiYuyueEntities_huiyishiYuyueUuidNumber.size() >0 ){
                            ArrayList<String> repeatFields = new ArrayList<>();
                            for(HuiyishiYuyueEntity s:huiyishiYuyueEntities_huiyishiYuyueUuidNumber){
                                repeatFields.add(s.getHuiyishiYuyueUuidNumber());
                            }
                            return R.error(511,"数据库的该表中的 [会议室预约编号] 字段已经存在 存在数据为:"+repeatFields.toString());
                        }
                        huiyishiYuyueService.insertBatch(huiyishiYuyueList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }






}

论文参考

在这里插入图片描述

目 录
摘 要 I
目 录 III
第1章 绪论 1
1.1 研究背景 1
1.2目的和意义 1
1.3 论文研究内容 1
第2章 程序开发技术 3
2.1 Mysql数据库 3
2.2 Java语言 4
第3章 系统分析 5
3.1可行性分析 5
3.1.1技术可行性分析 5
3.1.2经济可行性分析 5
3.1.3操作可行性分析 6
3.2系统运行环境 6
3.3系统流程分析 6
第4章 系统设计 10
4.1 系统设计的原则 10
4.2 系统结构设计 10
4.3功能结构设计 11
4.4数据库设计 12
4.4.1 数据库E-R图 12
4.4.2 数据库表结构 13
第5章 系统实现 17
5.1管理员功能实现 17
5.1.1 来访登记管理 17
5.1.2 公告信息管理 17
5.1.3公告类型管理 18
第6章 系统测试 19
6.1系统测试方法 19
6.2 系统功能测试 20
6.2.1 用户登录测试 20
6.2.2 添加账户功能测试 20
6.3 系统测试分析 20
结 论 21
致 谢 23
参考文献 24

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

q_2781179521

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

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

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

打赏作者

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

抵扣说明:

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

余额充值