基于SSM的疫苗接种平台

news2024/10/7 20:31:26

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


目录

一、项目简介

二、系统功能

三、系统项目截图

3.1前台首页

3.2后台管理

四、核心代码

4.1登录相关

4.2文件上传

4.3封装


一、项目简介

该毕业设计作品是一款疫苗接种平台,旨在为广大用户提供一个便捷的疫苗接种服务。该平台包括用户管理、医护人员管理、疫苗信息管理、疫苗种类管理、疫苗接种点管理、疫苗预约管理、接种信息管理、解疑中心、系统管理等功能,具有良好的可扩展性、易用性和安全性。

在用户管理方面,该平台支持用户注册、登录、信息维护等功能,用户可以通过该平台查看自己的接种记录、疫苗价格等信息。在医护人员管理方面,该平台支持医护人员注册、登录、信息维护等功能,医护人员可以通过该平台管理自己的接种点、接种信息等信息。

疫苗信息管理方面,该平台支持疫苗信息的维护、查询等功能,用户可以在该平台上查看各种疫苗的详细信息,包括疫苗名称、厂商、价格等。在疫苗种类管理方面,该平台支持对不同种类的疫苗进行管理,包括新增、修改、删除等操作。

在疫苗接种点管理方面,该平台支持对不同接种点进行管理,包括新增、修改、删除等操作。在疫苗预约管理方面,该平台支持用户在线预约疫苗接种,医护人员可以在后台审核、确认预约信息。

在接种信息管理方面,该平台支持对用户接种信息的维护、查询等操作,用户可以在该平台上查看自己的接种记录、接种记录详情等信息。在解疑中心方面,该平台提供疫苗使用相关问题的解答,帮助用户解决疑惑。在系统管理方面,该平台支持后台管理员对系统进行维护管理等操作。

该平台采用分层架构设计,具有较高的可扩展性和可维护性,配合良好的图形化界面,用户和医护人员易于操作。同时,系统采用HTTPS协议进行数据加密和安全传输,保障用户和系统的安全性。本论文将对该平台的实现细节和性能分析进行详细介绍,旨在为相关领域的研究者提供参考和启示。


二、系统功能

基于SSM的疫苗接种平台有以下角色:

(1)管理员主要功能有:用户管理、医护人员管理、疫苗信息管理、疫苗种类管理、疫苗接种点管理、疫苗预约管理、接种信息管理、解疑中心、系统管理等功能

(2)医护人员:疫苗信息管理、疫苗接种点管理、疫苗预约管理、接种信息管理。

(3)用户:疫苗信息管理、疫苗接种点管理、疫苗预约管理、接种信息管理。



三、系统项目截图

3.1前台首页

前台医护人员和用户的登录页面。

 登录以后可以在前台首页查看疫苗信息、疫苗预约、接种信息等信息。

 登录以后可以在前台查看自己要打的疫苗信息选择预约。

3.2后台管理

 后台管理登录页面,管理员可以在后台进行登录。

管理员进入系统可以看到有用户管理、医护人员管理、疫苗信息管理、疫苗种类管理、疫苗接种点管理、疫苗预约管理、接种信息管理、解疑中心、系统管理等功能。

在用户管理中,管理员可以管理用户信息。

在医护人员管理中,管理员可以对医护人员进行管理。

在疫苗信息中,可以看到有疫苗编号、疫苗名称等信息情况,管理员可以对疫苗信息进行修改删除等操作。

管理员可以发布新的疫苗种类或者删除旧的种类。

接种点管理页面。

在疫苗预约中,管理员可以看到用户预约的信息。

在接种信息中,管理员可以查看用户已经接种的信息。


四、核心代码

4.1登录相关


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();
    }
}

4.2文件上传

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);
	}
	
}

4.3封装

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/597983.html

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

相关文章

抢先看!文档控件aspose.words 新版本23.05 有哪些亮点?

Aspose.Words是一种高级Word文档处理API&#xff0c;用于执行各种文档管理和操作任务。API支持生成&#xff0c;修改&#xff0c;转换&#xff0c;呈现和打印文档&#xff0c;而无需在跨平台应用程序中直接使用Microsoft Word。 Aspose API支持流行文件格式处理&#xff0c;并…

Flutter-布局(Layout)原理

1、约束、尺寸、位置 overrideWidget build(BuildContext context) {return Scaffold(body: LayoutBuilder(builder: (context, constraints) {print("body约束:" constraints.toString());return Container(color: Colors.black,width: 300,height: 300,child: L…

计算机中丢失vcomp140.dll解决方案,可以使用这个3种方法修复

vcomp140.dll是一个动态连接库文件&#xff0c;它是Microsoft Visual Studio 2015应用程序所必需的运行库文件之一。它在Visual C Redistributable for Visual Studio 2015包中提供&#xff0c;是用于支持Microsoft C/C OpenMP Runtime的库文件。计算机中丢失vcomp140.dll无法打…

LNMP网站框架搭建(编译安装)

目录 一、Nginx的工作原理 工作进程&#xff1a; 二、Nginx编译安装安装 三、mysql的编译安装 四、php的编译安装 验证PHP与nginx的是否连接 验证lnmp的是否搭建成功 五、部署 Discuz&#xff01;社区论坛 六、fpm参数优化 一、Nginx的工作原理 php-fpm.conf …

Redis数据类型之String——字符串、数值、bitmap

Redis数据类型之String——字符串、数值、bitmap 注意索引位置一般从左到右 0开始&#xff0c;叫正向索引。从右到左-1开始叫反向索引 字符串 字符串有很多操作set、get、append、setrange、getrange等&#xff0c;每个都有自己对应的用处 SET SET key value 设置指定 key …

单元测试系列:一、了解spring boot单元测试

一、java 单元测试框架 java当前主流的测试框架有两个&#xff1a;JUnit、TestNG。 1、两者相同点 使用annotation&#xff0c;且大部分annotation相同。都可以进行单元测试&#xff08;Unit test&#xff09;。都是针对Java测试的工具。 2、两者不同点 JUnit只能进行单元…

【Axure教程】大小图动态轮播

大小图动态轮播常用于展示多张图片&#xff0c;其中包含两种不同尺寸的图片。这种类型的轮播通常用于网站首页、产品展示、广告宣传等场景&#xff0c;提供更丰富的展示方式&#xff0c;吸引用户的注意力并提供更多信息。通过切换不同的图片&#xff0c;可以有效地传达多个内容…

采购异常支出怎么造成的?如何控制?

采购管理中的"异常支出 "是指在企业预定的支出规则之外进行的交易。虽然大多数大型采购都是与知名供应商合作&#xff0c;并直接通过采购团队的合同进行&#xff0c;但并不是所有的采购都是这样正式进行的&#xff0c;这可能会导致支出不明的问题。 什么原因造成异常…

15-创建Vue3.0工程

目录 1.使用 vue-cli 创建2.使用 vite 创建 1.使用 vue-cli 创建 官方文档&#xff1a;https://cli.vuejs.org/zh/guide/creating-a-project.html#vue-create ## 查看vue/cli版本&#xff0c;确保vue/cli版本在4.5.0以上 vue --version ## 安装或者升级你的vue/cli npm insta…

创建孔、缩放、复制和粘贴

创建孔 项目概况&#xff1a; 在本项目中&#xff0c;您将学习如何使用孔特征从另一个形状中去除材料。 在Tinkercad上查看整个项目 指示 将蓝色多边形形状拖动到工作平面上&#xff0c;并将其放置在以橙色勾勒的区域。 提示&#xff1a; 您可能需要向下滚动形状列表才能找到…

kendoUI中的Observable详解

kendoUI中的Observable方法 一、前言 Kendo UI是一个基于JavaScript的开源UI框架&#xff0c;它提供了一系列的UI组件和工具&#xff0c;包括表格、图表、表单、对话框等。Kendo UI中的Observable是一个非常重要的概念&#xff0c;它可以帮助我们更好地理解和使用Kendo UI。 …

如何把握住数字化时代的浪潮,数据要素是关键

随着美国、欧洲的数字、数据战略相继出现&#xff0c;这意味着数据在未来的价值已经不是什么秘密&#xff0c;而是对未来世界发展的共识。IDC曾经预测过到2025年中国产生的数据总量将会达到48.6ZB&#xff0c;占全球的27.8%。这就是在未来发展数据战略的底气&#xff0c;也标志…

二叉树详解:带你掌握二叉树

目录 前言1. 树型结构1. 1 树的概念1.2 树的特点1.3 树的相关术语 2. 二叉树&#xff08;binary tree&#xff09;2.1 二叉树的概念2.2 二叉树中的特殊树2.2.1 满二叉树2.2.2 完全二叉树 2.3 二叉树的性质 3. 二叉树的遍历3.1 前序遍历3.2 中序遍历3.3 后序遍历3.4 层序遍历 总…

基于matlab使用蒙特卡罗模拟生成雷达系统的接收机工作特性 (ROC) 曲线

一、前言 此示例说明如何使用蒙特卡罗模拟生成雷达系统的接收机工作特性 &#xff08;ROC&#xff09; 曲线。接收器工作特性决定了系统在目标不存在&#xff08;误报&#xff09;时抑制大杂散信号值时检测目标的能力。检测系统将通过将接收到的信号值与预设阈值进行比较来声明…

Angular学习笔记:environment.ts文件

本文是自己的学习笔记&#xff0c;主要参考资料如下。 - B站《Angular全套实战教程》&#xff0c;达内官方账号制作&#xff0c;https://www.bilibili.com/video/BV1i741157Fj?https://www.bilibili.com/video/BV1R54y1J75g/?p32&vd_sourceab2511a81f5c634b6416d4cc1067…

网络监控工具

网络监控是一项重要的 IT 操作&#xff0c;可控制网络中的危险信号&#xff0c;并有助于避免潜在的业务问题。网络监控工具提供有关网络可用性和运行状况的见解&#xff0c;并跟踪 CPU 使用率、延迟和数据包丢失等关键性能指标&#xff0c;使管理员能够全面了解网络。 为什么网…

Kafka Schema-Registry

一、为什么需要Schema-Registry 1.1、注册表 无论是 使用传统的Avro API自定义序列化类和反序列化类 还是 使用Twitter的Bijection类库实现Avro的序列化与反序列化&#xff0c;这两种方法都有一个缺点&#xff1a;在每条Kafka记录里都嵌入了schema&#xff0c;这会让记录的大…

持续集成部署-微前端 镜像可以有多小?

微前端 镜像可以有多小&#xff1f; 1. 需求2. 开整 1. 需求 目前项目前端的镜像大小基本在 150M 左右&#xff0c;试下能不能缩小到 20M&#xff1f; 看了下前端打包后的压缩包只有 几 兆&#xff1b; 想着有空调试下&#xff0c;第一反应应该是使用 alpine 镜像&#xff0…

Delving into Shape-aware Zero-shot Semantic Segmentation(CVPR2023)

文章目录 摘要本文方法Pixel-wise Vision-Language AlignmentShape ConstraintSelf-supervised Spectral Decomposition推理 实验结果 摘要 由于大规模视觉语言预处理取得了令人瞩目的进展&#xff0c;最近的识别模型可以以零样本和开放集的方式对任意对象进行分类&#xff0c…

WIKIBON:大模型炒作中,有哪些云与AI的新趋势?

进入2023年以来&#xff0c;以ChatGPT为代表的大模型喧嚣引发了AI的新一轮炒作热潮&#xff0c;堪比当年的加密货币。不同的是&#xff0c;以微软、NVIDIA、AWS、Google等为代表的云与芯片大厂纷纷实质性入局大模型&#xff0c;为大模型AI注入持续的生命力。因此ChatGPT可类比于…