基于SSM的罪犯信息管理系统

news2024/9/30 19:35:20

末尾获取源码
开发语言:Java
Java开发工具:JDK1.8
后端框架:SSM
前端:Vue
数据库:MySQL5.7和Navicat管理工具结合
服务器:Tomcat8.5
开发软件:IDEA / Eclipse
是否Maven项目:是


目录

一、项目简介

二、系统功能

三、系统项目截图

管理员模块的实现

 嫌疑人信息管理

嫌疑人信息新增

嫌疑人改造管理

犯罪类型管理

四、核心代码

登录相关

文件上传

封装


一、项目简介

随着信息技术在管理上越来越深入而广泛的应用,管理信息系统的实施在技术上已逐步成熟。本文介绍了罪犯信息管理系统的开发全过程。通过分析罪犯信息管理系统管理的不足,创建了一个计算机管理罪犯信息管理系统的方案。文章介绍了罪犯信息管理系统的系统分析部分,包括可行性分析等,系统设计部分主要介绍了系统功能设计和数据库设计。

本罪犯信息管理系管理员功能有个人中心,嫌疑人信息管理,嫌疑人改造管理,犯罪类型管理。因而具有一定的实用性。本站是一个B/S模式系统,采用SSM框架,MYSQL数据库设计开发,充分保证系统的稳定性。系统具有界面清晰、操作简单,功能齐全的特点,使得罪犯信息管理系统管理工作系统化、规范化。

本系统的使用使管理人员从繁重的工作中解脱出来,实现无纸化办公,能够有效的提高罪犯信息管理系统管理效率。


二、系统功能

本系统是基于B/S架构的网站系统,设计的管理员功能结构图如下图所示:



三、系统项目截图

管理员模块的实现

 嫌疑人信息管理

罪犯信息管理系统的系统管理员可以管理嫌疑人,可以对嫌疑人信息添加修改删除以及查询操作。

 

嫌疑人信息新增

系统管理员可以查看对嫌疑人信息进行添加。

嫌疑人改造管理

教师可以对嫌疑人改造信息进行添加,修改,删除以及查询操作。

 

犯罪类型管理

教师可以对犯罪类型信息进行添加修改删除操作,还可以对犯罪类型信息进行查询。


四、核心代码

登录相关


package com.controller;


import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;

/**
 * 登录相关
 */
@RequestMapping("users")
@RestController
public class UserController{
	
	@Autowired
	private UserService userService;
	
	@Autowired
	private TokenService tokenService;

	/**
	 * 登录
	 */
	@IgnoreAuth
	@PostMapping(value = "/login")
	public R login(String username, String password, String captcha, HttpServletRequest request) {
		UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
		if(user==null || !user.getPassword().equals(password)) {
			return R.error("账号或密码不正确");
		}
		String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
		return R.ok().put("token", token);
	}
	
	/**
	 * 注册
	 */
	@IgnoreAuth
	@PostMapping(value = "/register")
	public R register(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);
    	if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
    		return R.error("用户已存在");
    	}
        userService.insert(user);
        return R.ok();
    }

	/**
	 * 退出
	 */
	@GetMapping(value = "logout")
	public R logout(HttpServletRequest request) {
		request.getSession().invalidate();
		return R.ok("退出成功");
	}
	
	/**
     * 密码重置
     */
    @IgnoreAuth
	@RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
    	UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
    	if(user==null) {
    		return R.error("账号不存在");
    	}
    	user.setPassword("123456");
        userService.update(user,null);
        return R.ok("密码已重置为:123456");
    }
	
	/**
     * 列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,UserEntity user){
        EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
    	PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/list")
    public R list( UserEntity user){
       	EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
      	ew.allEq(MPUtil.allEQMapPre( user, "user")); 
        return R.ok().put("data", userService.selectListView(ew));
    }

    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * 获取用户的session用户信息
     */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
    	Long id = (Long)request.getSession().getAttribute("userId");
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }

    /**
     * 保存
     */
    @PostMapping("/save")
    public R save(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);
    	if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
    		return R.error("用户已存在");
    	}
        userService.insert(user);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);
        userService.updateById(user);//全部更新
        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        userService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
}

文件上传

package com.controller;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;

/**
 * 上传文件映射表
 */
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{
	@Autowired
    private ConfigService configService;
	/**
	 * 上传文件
	 */
	@RequestMapping("/upload")
	public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
		if (file.isEmpty()) {
			throw new EIException("上传文件不能为空");
		}
		String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
		File path = new File(ResourceUtils.getURL("classpath:static").getPath());
		if(!path.exists()) {
		    path = new File("");
		}
		File upload = new File(path.getAbsolutePath(),"/upload/");
		if(!upload.exists()) {
		    upload.mkdirs();
		}
		String fileName = new Date().getTime()+"."+fileExt;
		File dest = new File(upload.getAbsolutePath()+"/"+fileName);
		file.transferTo(dest);
		FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload"+"/"+fileName));
		if(StringUtils.isNotBlank(type) && type.equals("1")) {
			ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
			if(configEntity==null) {
				configEntity = new ConfigEntity();
				configEntity.setName("faceFile");
				configEntity.setValue(fileName);
			} else {
				configEntity.setValue(fileName);
			}
			configService.insertOrUpdate(configEntity);
		}
		return R.ok().put("file", fileName);
	}
	
	/**
	 * 下载文件
	 */
	@IgnoreAuth
	@RequestMapping("/download")
	public ResponseEntity<byte[]> download(@RequestParam String fileName) {
		try {
			File path = new File(ResourceUtils.getURL("classpath:static").getPath());
			if(!path.exists()) {
			    path = new File("");
			}
			File upload = new File(path.getAbsolutePath(),"/upload/");
			if(!upload.exists()) {
			    upload.mkdirs();
			}
			File file = new File(upload.getAbsolutePath()+"/"+fileName);
			if(file.exists()){
				/*if(!fileService.canRead(file, SessionManager.getSessionUser())){
					getResponse().sendError(403);
				}*/
				HttpHeaders headers = new HttpHeaders();
			    headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);    
			    headers.setContentDispositionFormData("attachment", fileName);    
			    return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
	}
	
}

封装

package com.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * 返回数据
 */
public class R extends HashMap<String, Object> {
	private static final long serialVersionUID = 1L;
	
	public R() {
		put("code", 0);
	}
	
	public static R error() {
		return error(500, "未知异常,请联系管理员");
	}
	
	public static R error(String msg) {
		return error(500, msg);
	}
	
	public static R error(int code, String msg) {
		R r = new R();
		r.put("code", code);
		r.put("msg", msg);
		return r;
	}

	public static R ok(String msg) {
		R r = new R();
		r.put("msg", msg);
		return r;
	}
	
	public static R ok(Map<String, Object> map) {
		R r = new R();
		r.putAll(map);
		return r;
	}
	
	public static R ok() {
		return new R();
	}

	public R put(String key, Object value) {
		super.put(key, value);
		return this;
	}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1139847.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

数字化工厂:连接、集成与数据融合

随着科技的不断发展&#xff0c;数字化工厂管理系统逐渐成为制造业的重要趋势。数字化工厂的核心在于连接、集成与数据融合&#xff0c;通过这些技术手段&#xff0c;实现对设备、生产线、工厂、供应商、产品、客户等各个环节的全面优化&#xff0c;提升企业的生产效率和产品质…

字符串中的assert和strcat

assert&#xff1a;函数原型是&#xff1a;void assert( int expression );其作用是现计算表达式 expression &#xff0c;如果其值为假(即为0)&#xff0c;那么它先 stderr 打印一条出信息,然后通过调用 abort 来终止程序运行。使用assert 的缺点是&#xff0c;频繁的调用会影…

GoLong的学习之路(十二)语法之标准库 flag的使用

上回书说到&#xff0c;fmt的标准库的一些常用的使用函数。这次说flag的使用&#xff0c;以下这些库要去做了解。不然GG&#xff0c;Go语言内置的flag包实现了命令行参数的解析&#xff0c;flag包使得开发命令行工具更为简单。 文章目录 os.Argsflag包flag.Type()flag.TypeVar(…

AI口语APP的实现

AI口语应用程序是一种借助人工智能技术&#xff0c;旨在帮助用户提高口语能力、练习语言技能以及进行交流和学习语言的应用程序。这类应用通常提供以下主要功能&#xff0c;希望对大家有所帮助。北京木奇移动技术有限公司&#xff0c;专业的软件外包开发公司&#xff0c;欢迎交…

Ansys Speos | SPEOS 在HUD杂光分析中的应用

概述 随着汽车智能座舱的普及&#xff0c;HUD的装车率也随之增加&#xff0c;未来也可能会成为车内座舱的标配。而HUD是一个由光学&#xff0c;机械&#xff0c;电子&#xff0c;软件组成的复杂的高科技产品&#xff0c;其所在的汽车座舱是很复杂的环境。我们需要对HUD进行诸如…

2023年05月 Python(一级)真题解析#中国电子学会#全国青少年软件编程等级考试

Python等级考试&#xff08;1~6级&#xff09;全部真题・点这里 一、单选题&#xff08;共25题&#xff0c;每题2分&#xff0c;共50分&#xff09; 第1题 可以对Python代码进行多行注释的是&#xff1f;&#xff08; &#xff09; A: # B: " " C: ‘’’ ‘’’…

Java关于实例对象调用静态变量和静态方法问题

直接去看原文 原文链接:Java关于实例对象调用静态变量和静态方法问题_java对象可以调用static方法吗_骑个小蜗牛的博客-CSDN博客 --------------------------------------------------------------------------------------------------------------------------------- 实例…

2.13每日一题(根号下的定积分及去绝对值的定积分)

1、用三角函数的公式化1及二倍角公式将sinx化掉&#xff0c;构成完全平方公式 2、去根号&#xff0c;注意去根号要加绝对值&#xff0c; 3、通过区间比较sinx、cosx的大小去绝对值

vscode 保存 “index.tsx“失败: 权限不足。选择 “以超级用户身份重试“ 以超级用户身份重试。

vscode 保存 "index.tsx"失败: 权限不足。选择 “以超级用户身份重试” 以超级用户身份重试。 操作&#xff1a;mac在文件夹中创建文件&#xff0c;sudo 创建umiJs项目 解决&#xff1a;修改文件夹权限 右键文件夹

浮点数的表示与运算

一、浮点数的表示 1、规格化浮点数的特点 2、浮点数表示

C#上位机序列10: 批量读写+点对点更新+数据类型处理

一、源码结构 二、运行效果 三、源码解析 PLC批量读写点对点更新数据类型处理 优点&#xff1a;根据数据类型&#xff0c;判定监听的地址范围&#xff08;40120_int 监听两个word&#xff1a;40120 40121&#xff1b;40130_long 监听四个word&#xff1a;40130 40131 40132 4…

运营商光纤资源管理:管理工具的力量

随着通信信息化水平发展&#xff0c;光纤资源已成为现代通信网络的核心要素之一。然而&#xff0c;管理却面临诸多挑战&#xff0c;尤其对于电信运营商而言&#xff0c;面对庞大而复杂的光纤网络资源&#xff0c;怎样做到既不浪费现有资源&#xff0c;又能满足未来业务需求&…

18亿欧元大动作,法国瞄准实现量子飞跃

Quobly 正在开发一种容错量子处理器&#xff08;图片来源&#xff1a;网络&#xff09; 2021年1月&#xff0c;马克龙总统宣布了法国国家量子计算计划&#xff0c;并将为该技术投入高达18亿欧元。 “量子战略至关重要&#xff0c;”马克龙在量子研究中心巴黎萨克雷大学宣布该…

概念解析 | 功率放大器与低噪声放大器:一场关于信号放大的对比

注1:本文系“概念解析”系列之一,致力于简洁清晰地解释、辨析复杂而专业的概念。本次辨析的概念是:功率放大器(PA)与低噪声放大器(LNA)。 功率放大器与低噪声放大器:一场关于信号放大的对比 一、背景介绍 在现代的通信系统中,功率放大器 (Power Amplifier, PA)与低噪声放…

集卡实习总结

规则控制面板 &#xff08;1&#xff09;什么是低代码&#xff1f; 低代码 是借助低代码工具的情况下&#xff0c;开发人员编写少量代码快速开发出企业级应用系统&#xff0c;并帮助企业团队进行数字化转型。低码开发平台借助一整套功能组件&#xff0c;功能分类包括&#xff…

如何查看员工电脑操作记录

作为企业管理者&#xff0c;查看员工电脑操作记录可以帮助了解员工的工作情况和电脑使用情况&#xff0c;以便更好地进行管理。以下是一些查看员工电脑操作记录的方法&#xff1a; 一、电脑监控软件系统 这些软件系统可以实时监控员工电脑的操作情况&#xff0c;包括网页浏览、…

DeOldify 接口化改造 集成 Flask

类似的图片修复项目 GFPGAN 的改造见我另一篇文 https://blog.csdn.net/weixin_43074462/article/details/132497146 DeOldify 是一款开源软件&#xff0c;用于给黑白照片或视频上色&#xff0c;效果还不错。 安装部署教程请参考别的文章&#xff0c;本文基于你给项目跑通&…

极米科技H6 Pro 4K、H6 4K高亮定焦版——开启家用投影4K普及时代

智能投影产业经过几年发展&#xff0c;市场规模正在快速扩大。洛图数据显示&#xff0c;预计今年中国投影出货量有望超700万台&#xff0c;2027年达950万台&#xff0c;可见智能投影产业规模将逐渐壮大&#xff0c;未来可期。2023年&#xff0c;投影行业呈现出全新面貌&#xf…

Linux部署Redis Cluster高可用集群(附带集群节点添加删除以及槽位分配操作详解)

目录 一、前言二、下载安装Redis2.1、选择需要安装的Redis版本2.2、下载并解压Redis2.3、编译安装Redis 三、部署Redis Cluster高可用集群3.1、准备配置文件3.2、启动Redis服务3.3、创建Redis集群3.4、查看集群关系3.5、连接集群Redis进行数据读写以及重定向测试3.6、故障转移和…

数据库设计原则

一、前言 在平时的web系统开发中&#xff0c;数据库是必不可少的一部分&#xff0c;没有了数据库&#xff0c;程序处理的数据就不知如何更好安放。然而数据库没有很好的设计&#xff0c;使用起来也是很不好用的。本节就介绍一下数据库得到基础知识和设计原则。 二、为什么需要…