基于SSM和VUE的留守儿童信息管理系统

news2024/9/23 13:28:51

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


目录

一、项目简介

二、系统功能

三、系统项目截图

管理员模块的实现

用户信息管理

留守儿童管理

医院信息管理

医疗服务管理

用户模块的实现

留守儿童信息

爱心捐赠管理

医疗服务管理

四、核心代码

登录相关

文件上传

封装


一、项目简介

随着信息技术在管理上越来越深入而广泛的应用,管理信息系统的实施在技术上已逐步成熟。本文介绍了葛溪乡留守儿童信息管理系统的开发全过程。通过分析高校学生综合素质评价管理方面的不足,创建了一个计算机管理葛溪乡留守儿童信息管理系统的方案。文章介绍了葛溪乡留守儿童信息管理系统的系统分析部分,包括可行性分析等,系统设计部分主要介绍了系统功能设计和数据库设计。

本葛溪乡留守儿童信息管理系统有管理员和用户两个角色。管理员功能有个人中心,用户管理,留守儿童管理,医院信息管理,医疗服务管理,爱心捐赠管理,留言板管理,系统管理。用户可以注册登录,查看留守儿童信息,对留守儿童信息进行联系医生和爱心捐赠。因而具有一定的实用性。

本站是一个B/S模式系统,后台采用SSM框架,前台采用VUE和layui框架,数据库采用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/1143762.html

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

相关文章

数据链路层和DNS之间的那些事~

数据链路层&#xff0c;考虑的是两个节点之间的传输。这里面的典型协议也很多&#xff0c;最知名的就是“以太网”。我们本篇主要介绍的就是以太网协议。这个协议规定了数据链路层&#xff0c;也规定了物理层的内容。 目录 以太网帧格式 帧头 载荷 帧尾 DNS 从输入URL到…

中软国际:战略携手三大伙伴,三线出击收割AI红利

【科技明说 &#xff5c; 重磅专题】 2023年&#xff0c;当我看到中软国际成立AIGC研究院的消息后&#xff0c;认为基于解放号平台全面能力&#xff0c;去推进政企数智化服务&#xff0c;在很大程度上还是需要生态伙伴的技术力量。 为什么呢&#xff1f;这里简单说一下中软国际…

【Bug—eNSP】华为eNsp路由器设备启动一直是0解决方案!

问题描述 在上机实验时&#xff0c;打开ensp软件&#xff0c;添加AR设备时启动异常&#xff0c;最开始错误代码是40&#xff0c;最后通过重新安装&#xff0c;又出现了新的问题&#xff0c;启动AR设备一直是0&#xff0c;而且界面卡住。 解决方法 打开VirtualBox&#xff0c;将…

LeetCode刷题:88. 合并两个有序数组

文章目录 写在前面⭐️88. 合并两个有序数组⭐️&#x1f510;题目描述&#x1f4a1;解题思路&#x1f511;代码 写在前面 本题的题解代码是用C语言编写的。 &#x1f4d2;博客主页&#xff1a;2023Fighting的博客主页 &#x1f389;欢迎关注&#x1f50e;点赞&#x1f44d;收…

C#开发DLL,CAPL调用(CAPL>> .NET DLL)

文章目录 展示说明新建类库工程C# 代码生成dllCAPL脚本调用dll,输出结果展示 ret为dll里函数返回的值。 说明 新建类库工程 在visual studio中建立。 C# 代码 using

ruoyi中xxl-job配置使用

xxl-job配置使用目录 前言必须了解的概念1、调度中心2、执行器 环境搭建一、xxl-job环境搭建测试1、下载xxl-job源码2、执行SQL文件&#xff0c;生成对应表结构3、修改xxl-job-admin服务的 application.properties数据库地址可直接启动至此调度中心服务配置&#xff0c;启动完成…

软通动力:打造AI第二增长曲线,图谋新发展

【科技明说 &#xff5c; 重磅专题】 软通动力对于AI的想法还是比较久了&#xff0c;之前在与业内朋友聊到软通动力之时&#xff0c;曾提到软通动力的根基还是在于其多年来的软件服务能力&#xff0c;目前借助AI技术创新的机遇将软件服务能力进一步放大&#xff0c;扩展到更多行…

【C++初探:简单易懂的入门指南】一

【C初探&#xff1a;简单易懂的入门指南】一 1. 命名空间1.1 命名空间的定义1.2 命名空间的使用方法 2. C的输入、输出2.1 为什么使用输入、输出要引用一个<iostream>的头文件&#xff1f;2.2 为什么代码里面开放了一个叫std的命名空间2.3 代码中出现的<<和>>…

C++ 重载

C 允许在同一作用域中的某个函数和运算符指定多个定义&#xff0c;分别称为函数重载和运算符重载。 重载声明 是指一个与之前已经在该作用域内声明过的函数或方法具有相同名称的声明&#xff0c;但是它们的参数列表和定义&#xff08;实现&#xff09;不相同。 重载声明 当…

基于Spring AOP和CGLIB代理实现引介增强(Introduction Advice)示例

一、Spring AOP相关概念 1. Spring AOP与AspectJ区别 Spring AOP提供跨Spring IOC的简单AOP实现&#xff0c;以解决程序员面临的最常见问题。它并不打算作为一个完整的AOP解决方案——它只能应用于由Spring容器管理的bean。 AspectJ是最初的AOP技术&#xff0c;提供完整的AO…

Linux系统编程_网络编程:字节序、socket、serverclient、ftp 云盘

1. 网络编程概述&#xff08;444.1&#xff09; TCP/UDP对比 TCP 面向连接&#xff08;如打电话要先拨号建立连接&#xff09;&#xff1b;UDP 是无连接的&#xff0c;即发送数据之前不需要建立连接TCP 提供可靠的服务。也就是说&#xff0c;通过 TCP 连接传送的数据&#xf…

可以用商城源码做什么?

商城源码是一个基于电子商务流程的现代化的商城网站程序。它提供了一个完整的电子商务解决方案&#xff0c;包括产品目录、购物车、结账、订单和付款等功能。商城源码可以用于创建各种类型的电子商务网站&#xff0c; 在这篇文章中&#xff0c;我将介绍商城源码可能带来的各种…

【Python3】【力扣题】202. 快乐数

【力扣题】题目描述&#xff1a; 【Python3】代码&#xff1a; 1、解题思路&#xff1a;用哈希集合检测循环。设置集合记录每次结果&#xff0c;判断结果是否为1。若计算结果已在集合中则进入循环&#xff0c;结果一定不为1。 &#xff08;1-1&#xff09;知识点&#xff1a;…

day53--动态规划12

309.最佳买卖股票时机含冷冻期 714.买卖股票的最佳时机含手续费 第一题&#xff1a;.最佳买卖股票时机含冷冻期 给定一个整数数组&#xff0c;其中第 i 个元素代表了第 i 天的股票价格 。 设计一个算法计算出最大利润。在满足以下约束条件下&#xff0c;你可以尽可能地完…

电感基础复盘

1、在高速电路中&#xff0c;我们通常选用SMD贴片电阻&#xff0c;有薄膜和厚膜之分。 2、电容的性质主要为“充放电”和”隔直通交“。获得电荷为充电&#xff0c;反之为放电。隔离直流电不能通过电容器&#xff0c;⽽交流电能通过电容器。充电时直流电相当于导通&#xff0c;…

Java学习 5.习题2.

练习题1&#xff1a;判断一个数字是偶数还是奇数 int num110;if(num1%20) {System.out.println("num1是一个偶数");}else{System.out.println("num1是一个奇数");} 练习题2&#xff1a;判断一个数是正数还是负数还是0 int num2-5;if(num2>0) {System.ou…

【Apache Flink】基于时间和窗口的算子-配置时间特性

文章目录 前言配置时间特性将时间特性设置为事件时间时间戳分配器周期性水位线分配器创建一个实现AssignerWithPeriodicWatermarks接口的类&#xff0c;目的是为了周期性生成watermark 定点水位线分配器示例 参考文档 前言 Apache Flink 它提供了多种类型的时间和窗口概念&…

mysql的医院信息管理系统,数据库增删改查。

基于前端网页和后端服务的&#xff0c;mysql医院信息管理系统。 功能有&#xff1a;登录注册、首页、科室管理、科室列表、医院管理、医生列表、病人管理、护士管理、病房管理、文件管理等等。 并且引入了Echarts图标&#xff0c;可视化查看数据。 源码下载地址 支持&#xff…

Power BI 傻瓜入门 15. DAX功能带来乐趣

本章的内容包括&#xff1a; 了解DAX中的功能使用DAX函数制作定义明确的公式发现哪些DAX函数可以帮助解决复杂的数据计算或操作需求 在第14章中&#xff0c;我将讨论函数如何成为计算表达式中命名公式的一部分。作为提出计算表达式的人&#xff0c;您是为函数提供特定参数的人…

计算机算法分析与设计(21)---回溯法(图着色问题)

文章目录 一、背景知识二、问题转换与描述三、算法讲解3.1 思路分析3.2 状态空间生成树3.3 代码编写 一、背景知识 1. 为地图或其他由不同区域组成的图形着色时&#xff0c;相邻国家/地区不能使用相同的颜色。 我们可能还想使用尽可能少的不同颜色进行填涂。一些简单的“地图”…