作者主页:夜未央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 add(@RequestBody YonghuxinxiVo yonghuxinxi) {
yonghuxinxiService.add(yonghuxinxi);
return Result.success(yonghuxinxi);
}
@PostMapping("/deleteList")
public Result 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 detail(@PathVariable Integer id) {
Yonghuxinxi yonghuxinxi = yonghuxinxiService.findById(id);
return Result.success(yonghuxinxi);
}
@GetMapping
public Result> all() {
return Result.success(yonghuxinxiService.list());
}
@PostMapping("/page")
public Result 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 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 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 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 detail(@PathVariable Integer id) {
Renkoujibenxinxi renkoujibenxinxi = renkoujibenxinxiService.findById(id);
return Result.success(renkoujibenxinxi);
}
@GetMapping
public Result> all() {
return Result.success(renkoujibenxinxiService.list());
}
@PostMapping("/page")
public Result 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 add(@RequestBody GuanliyuanVo guanliyuan) {
guanliyuanService.add(guanliyuan);
return Result.success(guanliyuan);
}
@PostMapping("/deleteList")
public Result 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 detail(@PathVariable Integer id) {
Guanliyuan guanliyuan = guanliyuanService.findById(id);
return Result.success(guanliyuan);
}
@GetMapping
public Result> all() {
return Result.success(guanliyuanService.list());
}
@PostMapping("/page")
public Result 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 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