基于java的贫困认定管理平台【源码+文档+PPT】

精彩专栏推荐订阅:在下方主页👇🏻👇🏻👇🏻👇🏻

💖🔥作者主页计算机毕设木哥🔥 💖

一、项目介绍

使用旧方法对贫困认定管理平台的信息进行系统化管理已经不再让人们信赖了,把现在的网络信息技术运用在贫困认定管理平台的管理上面可以解决许多信息管理上面的难题,比如处理数据时间很长,数据存在错误不能及时纠正等问题。这次开发的贫困认定管理平台对用户管理、二级单位审核管理、三级单位审核管理、一级单位审核管理、字典管理、二级单位管理、公告管理、留言管理、贫困申请管理、三级单位管理、一级单位管理、管理员管理等进行集中化处理。经过前面自己查阅的网络知识,加上自己在学校课堂上学习的知识,决定开发系统选择B/S模式这种高效率的模式完成系统功能开发。这种模式让操作员基于浏览器的方式进行网站访问,采用的主流的Java语言这种面向对象的语言进行贫困认定管理平台程序的开发,在数据库的选择上面,选择功能强大的Mysql数据库进行数据的存放操作。贫困认定管理平台的开发让用户查看贫困申请信息变得容易,让管理员高效管理贫困申请信息。

二、开发环境

  • 开发语言:Java
  • 数据库:MySQL
  • 系统架构:B/S
  • 后端:springboot
  • 前端:vue
  • 工具:IDEA或者Eclipse、JDK1.8、Maven

三、系统展示

登录模块:

在这里插入图片描述

管理模块展示:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

四、代码展示

@RestController
@Controller
@RequestMapping("/cailiao")
public class CailiaoController {
    private static final Logger logger = LoggerFactory.getLogger(CailiaoController.class);

    @Autowired
    private CailiaoService cailiaoService;


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

    //级联表service

    @Autowired
    private YonghuService yonghuService;
    @Autowired
    private WeixiuyuanService weixiuyuanService;


    /**
    * 后端列表
    */
    @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.isEmpty(role))
            return R.error(511,"权限为空");
        else if("员工".equals(role))
            params.put("yonghuId",request.getSession().getAttribute("userId"));
        else if("维修员".equals(role))
            params.put("weixiuyuanId",request.getSession().getAttribute("userId"));
        if(params.get("orderBy")==null || params.get("orderBy")==""){
            params.put("orderBy","id");
        }
        PageUtils page = cailiaoService.queryPage(params);

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

            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

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

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(StringUtil.isEmpty(role))
            return R.error(511,"权限为空");

        Wrapper<CailiaoEntity> queryWrapper = new EntityWrapper<CailiaoEntity>()
            .eq("cailiao_uuid_unmber", cailiao.getCailiaoUuidUnmber())
            .eq("cailiao_name", cailiao.getCailiaoName())
            .eq("cailiao_types", cailiao.getCailiaoTypes())
            .eq("cailiao_kucun_number", cailiao.getCailiaoKucunNumber())
            .eq("cailiao_danwei", cailiao.getCailiaoDanwei())
            ;

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

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

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(StringUtil.isEmpty(role))
//            return R.error(511,"权限为空");
        //根据字段查询是否有相同数据
        Wrapper<CailiaoEntity> queryWrapper = new EntityWrapper<CailiaoEntity>()
            .notIn("id",cailiao.getId())
            .andNew()
            .eq("cailiao_uuid_unmber", cailiao.getCailiaoUuidUnmber())
            .eq("cailiao_name", cailiao.getCailiaoName())
            .eq("cailiao_types", cailiao.getCailiaoTypes())
            .eq("cailiao_kucun_number", cailiao.getCailiaoKucunNumber())
            .eq("cailiao_danwei", cailiao.getCailiaoDanwei())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        CailiaoEntity cailiaoEntity = cailiaoService.selectOne(queryWrapper);
        if(cailiaoEntity==null){
            cailiaoService.updateById(cailiao);//根据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());
        cailiaoService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }


    /**
     * 批量上传
     */
    @RequestMapping("/batchInsert")
    public R save( String fileName){
        logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
        try {
            List<CailiaoEntity> cailiaoList = 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){
                            //循环
                            CailiaoEntity cailiaoEntity = new CailiaoEntity();
//                            cailiaoEntity.setCailiaoUuidUnmber(data.get(0));                    //材料编号 要改的
//                            cailiaoEntity.setCailiaoName(data.get(0));                    //材料名称 要改的
//                            cailiaoEntity.setCailiaoTypes(Integer.valueOf(data.get(0)));   //材料类型 要改的
//                            cailiaoEntity.setCailiaoKucunNumber(Integer.valueOf(data.get(0)));   //材料数量 要改的
//                            cailiaoEntity.setCailiaoDanwei(data.get(0));                    //单位 要改的
//                            cailiaoEntity.setCreateTime(date);//时间
                            cailiaoList.add(cailiaoEntity);


                            //把要查询是否重复的字段放入map中
                        }

                        //查询是否重复
                        cailiaoService.insertBatch(cailiaoList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }

五、项目文档展示

在这里插入图片描述

大家可以帮忙点赞、收藏、关注、评论啦 👇🏻

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值