Java项目:168Springboot+vue户政电子档案管理平台

  作者主页:夜未央5788

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

Springboot户政电子档案管理平台系统为前后端分离的项目,
主要分为管理员、用户两种角色。
管理员角色主要功能如下:
首页
系统用户管理:管理员用户查询、添加、修改、删除;
单位管理:单位查询、添加、修改、删除;
部门管理:部门查询、添加、修改、删除;
岗位管理:岗位查询、添加、修改、删除;
用户管理:用户查询、添加、修改、删除;
案卷类别管理:案卷类别查询、添加、修改、删除;
案卷管理:案卷查询、添加、修改、删除;
案卷目录管理:案卷目录查询、添加、修改、删除;
人口基本管理:人口基本查询、添加、修改、删除;
案卷统计:按案卷类别统计;
人口基本统计:按户口类型统计;

用户主要功能如下:
首页;
个人资料管理:修改个人资料;
案卷类别管理:案卷类别查询;
案卷管理:案卷查询;
案卷目录管理:案卷目录查询;
人口基本管理:人口基本查询;

使用人群:
正在做毕设的学生,或者需要项目实战练习的Java学习者

由于本程序规模不大,可供课程设计,毕业设计学习演示之用

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 
4.数据库:MySql 5.7/8.0版本均可;

5.是否Maven项目:是;

技术栈

后端:SpringBoot+Mybaits

前端:Vue+axios

使用说明

后端项目运行 - houduan:
1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目houduan,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
4. 控制台提示运行成功后再运行前端项目;

前端项目运行 - houtai:
1.命令行cd进入 前端目录 houtai; 
2.执行命令 npm install  下载依赖; 
3.执行命令 npm run dev  启动; 
4.运行项目,在浏览器中输入地址:http://localhost:9999/ 
管理员账号、密码:hsg/hsg

用户账号、密码:666/001    其它用户的密码也均为001

运行截图

用户角色

管理员角色

相关代码

YonghuxinxiController

package com.example.controller;

import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import com.example.common.Result;
import com.example.common.ResultCode;
import com.example.entity.Yonghuxinxi;
import com.example.exception.CustomException;
import com.example.service.YonghuxinxiService;
import com.example.utils.MapWrapperUtils;
import com.example.utils.jwt.JwtUtil;
import com.example.vo.YonghuxinxiVo;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(value = "/yonghuxinxi")
public class YonghuxinxiController {

    @Resource
    private YonghuxinxiService yonghuxinxiService;

    @PostMapping
    public Result<Yonghuxinxi> add(@RequestBody YonghuxinxiVo yonghuxinxi) {
        yonghuxinxiService.add(yonghuxinxi);
        return Result.success(yonghuxinxi);
    }

    @PostMapping("/deleteList")
    public Result<Yonghuxinxi> deleteList(@RequestBody YonghuxinxiVo yonghuxinxi) {
        yonghuxinxiService.deleteList(yonghuxinxi.getList());
        return Result.success();
    }

    @DeleteMapping("/{id}")
    public Result delete(@PathVariable Long id) {
        yonghuxinxiService.delete(id);
        return Result.success();
    }

    @PutMapping
    public Result update(@RequestBody YonghuxinxiVo yonghuxinxi) {
        yonghuxinxiService.update(yonghuxinxi);
        return Result.success();
    }

    @GetMapping("/{id}")
    public Result<Yonghuxinxi> detail(@PathVariable Integer id) {
        Yonghuxinxi yonghuxinxi = yonghuxinxiService.findById(id);
        return Result.success(yonghuxinxi);
    }

    @GetMapping
    public Result<List<Yonghuxinxi>> all() {
        return Result.success(yonghuxinxiService.list());
    }

    @PostMapping("/page")
    public Result<YonghuxinxiVo> page(@RequestBody YonghuxinxiVo yonghuxinxiVo) {
        return Result.success(yonghuxinxiService.findPage(yonghuxinxiVo));
    }
    @PostMapping("/login")
    public Result login(@RequestBody Yonghuxinxi yonghuxinxi, HttpServletRequest request) {
        if (StrUtil.isBlank(yonghuxinxi.getZhanghao()) || StrUtil.isBlank(yonghuxinxi.getMima())) {
            throw new CustomException(ResultCode.PARAM_LOST_ERROR);
        }
        Yonghuxinxi login = yonghuxinxiService.login(yonghuxinxi);
//        if(!login.getStatus()){
//            return Result.error("1001","状态限制,无法登录系统");
//        }
        if(login != null) {
            HashMap hashMap = new HashMap();
            hashMap.put("user", login);
            Map<String, Object> map = MapWrapperUtils.builder(MapWrapperUtils.KEY_USER_ID,yonghuxinxi.getId());
            String token = JwtUtil.creatToken(map);
            hashMap.put("token", token);
            return Result.success(hashMap);
        }else {
            return Result.error();
        }
    }

    @PutMapping("/updatePassword")
    public Result updatePassword(@RequestBody Yonghuxinxi info, HttpServletRequest request) {
        Yonghuxinxi yonghuxinxi = yonghuxinxiService.findById(info.getId());
        String oldPassword = SecureUtil.md5(info.getMima());
        if (!oldPassword.equals(yonghuxinxi.getMima())) {
            return Result.error(ResultCode.PARAM_PASSWORD_ERROR.code, ResultCode.PARAM_PASSWORD_ERROR.msg);
        }
        info.setMima(SecureUtil.md5(info.getNewPassword()));
        Yonghuxinxi yonghuxinxi1 = new Yonghuxinxi();
        BeanUtils.copyProperties(info, yonghuxinxi1);
        yonghuxinxiService.update(yonghuxinxi1);
        return Result.success();
    }
}

RenkoujibenxinxiController

package com.example.controller;

import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import com.example.common.Result;
import com.example.common.ResultCode;
import com.example.entity.Renkoujibenxinxi;
import com.example.exception.CustomException;
import com.example.service.RenkoujibenxinxiService;
import com.example.utils.MapWrapperUtils;
import com.example.utils.jwt.JwtUtil;
import com.example.vo.RenkoujibenxinxiVo;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(value = "/renkoujibenxinxi")
public class RenkoujibenxinxiController {

    @Resource
    private RenkoujibenxinxiService renkoujibenxinxiService;

    @PostMapping
    public Result<Renkoujibenxinxi> add(@RequestBody RenkoujibenxinxiVo renkoujibenxinxi) {
        renkoujibenxinxiService.add(renkoujibenxinxi);
           return Result.success(renkoujibenxinxi);
    }
	
	@GetMapping("/renkoujibenxinxi_tj_hukouleixing")
    public Result renkoujibenxinxi_tj_hukouleixing() {
        return Result.success(renkoujibenxinxiService.renkoujibenxinxi_tj_hukouleixing());
    }
    

    @PostMapping("/deleteList")
    public Result<Renkoujibenxinxi> deleteList(@RequestBody RenkoujibenxinxiVo renkoujibenxinxi) {
        renkoujibenxinxiService.deleteList(renkoujibenxinxi.getList());
        return Result.success();
    }

    @DeleteMapping("/{id}")
    public Result delete(@PathVariable Long id) {
        renkoujibenxinxiService.delete(id);
        return Result.success();
    }

    @PutMapping
    public Result update(@RequestBody RenkoujibenxinxiVo renkoujibenxinxi) {
        renkoujibenxinxiService.update(renkoujibenxinxi);
        return Result.success();
    }

    @GetMapping("/{id}")
    public Result<Renkoujibenxinxi> detail(@PathVariable Integer id) {
        Renkoujibenxinxi renkoujibenxinxi = renkoujibenxinxiService.findById(id);
        return Result.success(renkoujibenxinxi);
    }

    @GetMapping
    public Result<List<Renkoujibenxinxi>> all() {
        return Result.success(renkoujibenxinxiService.list());
    }

    @PostMapping("/page")
    public Result<RenkoujibenxinxiVo> page(@RequestBody RenkoujibenxinxiVo renkoujibenxinxiVo) {
        return Result.success(renkoujibenxinxiService.findPage(renkoujibenxinxiVo));
    }
	//youupdt2login
}

GuanliyuanController

package com.example.controller;

import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import com.example.common.Result;
import com.example.common.ResultCode;
import com.example.entity.Guanliyuan;
import com.example.exception.CustomException;
import com.example.service.GuanliyuanService;
import com.example.utils.MapWrapperUtils;
import com.example.utils.jwt.JwtUtil;
import com.example.vo.GuanliyuanVo;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(value = "/guanliyuan")
public class GuanliyuanController {

    @Resource
    private GuanliyuanService guanliyuanService;

    @PostMapping
    public Result<Guanliyuan> add(@RequestBody GuanliyuanVo guanliyuan) {
        guanliyuanService.add(guanliyuan);
           return Result.success(guanliyuan);
    }

    @PostMapping("/deleteList")
    public Result<Guanliyuan> deleteList(@RequestBody GuanliyuanVo guanliyuan) {
        guanliyuanService.deleteList(guanliyuan.getList());
        return Result.success();
    }

    @DeleteMapping("/{id}")
    public Result delete(@PathVariable Long id) {
        guanliyuanService.delete(id);
        return Result.success();
    }

    @PutMapping
    public Result update(@RequestBody GuanliyuanVo guanliyuan) {
        guanliyuanService.update(guanliyuan);
        return Result.success();
    }

    @GetMapping("/{id}")
    public Result<Guanliyuan> detail(@PathVariable Integer id) {
        Guanliyuan guanliyuan = guanliyuanService.findById(id);
        return Result.success(guanliyuan);
    }

    @GetMapping
    public Result<List<Guanliyuan>> all() {
        return Result.success(guanliyuanService.list());
    }

    @PostMapping("/page")
    public Result<GuanliyuanVo> page(@RequestBody GuanliyuanVo guanliyuanVo) {
        return Result.success(guanliyuanService.findPage(guanliyuanVo));
    }
	    @PostMapping("/login")
    public Result login(@RequestBody Guanliyuan guanliyuan, HttpServletRequest request) {
        if (StrUtil.isBlank(guanliyuan.getYonghuming()) || StrUtil.isBlank(guanliyuan.getMima())) {
            throw new CustomException(ResultCode.PARAM_LOST_ERROR);
        }
        Guanliyuan login = guanliyuanService.login(guanliyuan);
//        if(!login.getStatus()){
//            return Result.error("1001","状态限制,无法登录系统");
//        }
        if(login != null) {
            HashMap hashMap = new HashMap();
            hashMap.put("user", login);
            Map<String, Object> map = MapWrapperUtils.builder(MapWrapperUtils.KEY_USER_ID,guanliyuan.getId());
            String token = JwtUtil.creatToken(map);
            hashMap.put("token", token);
            return Result.success(hashMap);
        }else {
            return Result.error();
        }
    }
    @PutMapping("/updatePassword")
    public Result updatePassword(@RequestBody Guanliyuan info, HttpServletRequest request) {
        Guanliyuan guanliyuan = guanliyuanService.findById(info.getId());
        String oldPassword = SecureUtil.md5(info.getMima());
        if (!oldPassword.equals(guanliyuan.getMima())) {
            return Result.error(ResultCode.PARAM_PASSWORD_ERROR.code, ResultCode.PARAM_PASSWORD_ERROR.msg);
        }
        info.setMima(SecureUtil.md5(info.getNewPassword()));
        Guanliyuan guanliyuan1 = new Guanliyuan();
        BeanUtils.copyProperties(info, guanliyuan1);
        guanliyuanService.update(guanliyuan1);
        return Result.success();
    }
}

如果也想学习本系统,下面领取。关注并回复:168springboot

  • 18
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

夜未央5788

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

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

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

打赏作者

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

抵扣说明:

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

余额充值