基于微信小程序的医院挂号预约系统

news2024/7/2 3:35:32

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


目录

一、项目简介

二、系统功能

三、系统项目截图

3.1小程序端

3.2后台管理

四、核心代码

4.1登录相关

4.2文件上传

4.3封装


一、项目简介

现代经济快节奏发展以及不断完善升级的信息化技术,让传统数据信息的管理升级为软件存储,归纳,集中处理数据信息的管理方式。本微信小程序医院挂号预约系统就是在这样的大环境下诞生,其可以帮助管理者在短时间内处理完毕庞大的数据信息,使用这种软件工具可以帮助管理人员提高事务处理效率,达到事半功倍的效果。此微信小程序医院挂号预约系统利用当下成熟完善的SSM框架,使用跨平台的可开发大型商业网站的Java语言,以及最受欢迎的RDBMS应用软件之一的MySQL数据库进行程序开发。微信小程序医院挂号预约系统有管理员,用户两个角色。管理员功能有个人中心,用户管理,医生信息管理,医院信息管理,科室信息管理,预约信息管理,预约取消管理,留言板,系统管理。微信小程序用户可以注册登录,查看医院信息,查看医生信息,查看公告资讯,在科室信息里面进行预约,也可以取消预约。微信小程序医院挂号预约系统的开发根据操作人员需要设计的界面简洁美观,在功能模块布局上跟同类型网站保持一致,程序在实现基本要求功能时,也为数据信息面临的安全问题提供了一些实用的解决方案。可以说该程序在帮助管理者高效率地处理工作事务的同时,也实现了数据信息的整体化,规范化与自动化。


二、系统功能

基于微信小程序的医院挂号预约系统主要包括两大功能模块,即用户功能模块和管理员功能模块、用户模块。

(1)管理员模块:系统中的核心用户是管理员,管理员登录后,通过管理员来管理后台系统。主要功能有:用户管理,医生信息管理,医院信息管理,科室信息管理,预约信息管理,预约取消管理,留言板,系统管理

(2)用户:查看医院信息,查看医生信息,查看公告资讯,在科室信息里面进行预约,也可以取消预约。



三、系统项目截图

3.1小程序端

如图5.4显示的就是小程序首页页面,用户可以看到公告资讯信息以及下面的导航栏。

如图5.4显示的就是科室预约页面,用户点击科室信息可以进行预约操作。

 如图5.4显示的就是我的页面,我的里面可以查看订单和收藏,点击小齿轮还可以退出当前用户。

 

3.2后台管理

如图5.1显示的就是用户管理页面,此页面提供给管理员的功能有:对用户信息进行查询,添加,删除以及批量删除操作。

如图5.2显示的就是医院管理页面,管理员可以对医院信息进行添加,修改,删除,查询操作。

如图5.3显示的就是医生管理页面,管理员可以对医生信息进行添加,修改,删除,查询操作。

如图5.4显示的就是公告资讯管理页面,管理员可以对公告资讯进行添加修改删除查询操作。

如图5.4显示的就是科室信息管理页面,教师可以对科室信息进行添加修改删除查询操作。

如图5.4显示的就是预约信息页面,管理员可以查看和审核用户预约信息。


 

四、核心代码

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

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

相关文章

react学习2

props基本用法&#xff0c;把属性自动保存到props里 简写&#xff1a;三点展开&#xff0c;展开运算符无法展开对象&#xff0c;但是三点外侧包裹花括号可以复制对象{...P} 对props的属性进行限制 首先需要引入prop-types.js包 之后再去进行限制 props是只读的&#xff0c;只…

Vue之数据代理(getter、setter)

文章目录 前言一、数据代理1.Object.defineProperty()2.数据代理讲解 总结 前言 Object.defineProperty 数据代理 一、数据代理 1.Object.defineProperty() &#xff08;1&#xff09;实例对象可以通过Object.defineProperty()方法来添加属性&#xff0c;但是添加的属性默认…

进击的Mini LED:群雄逐“屏”,谁主沉浮

前不久&#xff0c;素有家电产业“风向标”之称的中国家电及消费电子博览会AWE在上海圆满闭幕。作为全球三大顶级家电与消费电子展会之一&#xff0c;每年各家企业都会携各自尖端技术亮剑上海滩&#xff0c;舞台中央的面孔也会逐年有些许不同&#xff0c;而从C位的演变中&#…

基于Spring Boot的秒杀系统设计与实现

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

陌生交友发布动态圈子单聊打招呼群聊app开发

陌生交友发布动态圈子单聊打招呼群聊app开发 功能有&#xff0c;发布圈子&#xff0c;发布动态&#xff0c;查看附近的人&#xff0c;发布活动&#xff0c;实人认证&#xff0c;个人主页&#xff0c;相册查看,单聊&#xff0c;群聊。 即时通讯第三方goeasy接口。 好的&#x…

017+图解C语言中函数栈帧的创建与销毁(VS2022环境)

0.前言 您好&#xff0c;这里是limou3434的一篇个人博文&#xff0c;感兴趣的话您也可以看看我的其他文章。本次我将和您一起学习在C语言中函数栈帧的概念。 1.学习函数栈帧的意义 局部变量是怎么穿创建的&#xff1f;为什么局部变量的值是随机的函数是怎么传参的&#xff1…

满分Spring全家桶笔记:Spring+Spring Boot+Spring Cloud+Spring MVC

最近小编整理了一下一线架构师的Spring全家桶笔记&#xff1a;SpringSpring BootSpring CloudSpring MVC&#xff0c;分享给大家一起学习一下~ 01 Spring Spring是一个轻量级控制反转(IoC)和面向切面(AOP)的容器框架。Spring框架是由于软件开发的复杂性而创建的。Spring使用的…

nacos+frp穿透实现局域网调用

简介&#xff1a;首先你要有外网服务器。在外网服务器上安装frp服务端。然后在你想要调用的局域网电脑上安装frp客户端 frp下载链接 Releases fatedier/frp GitHub 外网服务器上我用的是docker安装的。你也可以直接下载并启动。这里我就不描述了。 首先我们先创建某个目录…

ESP32 ADC测量电压 arduino

ADC ADCESP32的ADC通道衰减倍数代码实现精度问题 ADC ADC&#xff08;模拟-数字转换器&#xff09;&#xff0c;首先了解模拟信号和数字信号之间的差异。模拟信号是连续的&#xff0c;可以在其范围内取无限个离散值&#xff0c;例如声音、光线等。 数字信号则是离散的&#xf…

Redis(三)常用配置解析

文章目录 度量单位引入其他配置文件启动时加载模块网路配置GENERAL 通用配置REPLICATION 主从复制相关配置安全配置AOF配置 提示&#xff1a;Redis 6.2.6版本 度量单位 注意&#xff1a;g和gb有区别&#xff0c;不区分大小写&#xff0c;1gb 1GB都是一样的。引入其他配置文件…

Qt编程基础 | 第三章-控件 | 3.3、对话框

一、QDialog 1.1、定义 对话框&#xff1a;在主窗口中操作&#xff0c;有可能触发某一个行为动作&#xff0c;会弹出一个新的对话窗口&#xff0c;解决一个临时性的会话&#xff0c;在对话窗口中执行某一个功能。QDialog可以作为自定义对话框的基类&#xff0c;同时Qt也提供了…

Hadoop部署本地模式

​ 本地模式&#xff0c;即运行在单台机器上。没有分布式的思想&#xff0c;使用的是本地文件系统。使用本地模式主要是用于对MapReduce的程序的逻辑进行调试&#xff0c;确保程序的正确性。由于在本地模式下测试和调试MapReduce程序较为方便&#xff0c;因此&#xff0c;这种模…

java实现大气质量插值图及六项污染物插值图图片导出

软件导出成果图效果 一、技术实现应用背景 大气污染是当今世界面临的一个严重问题。它不仅对人类健康造成了危害&#xff0c;还对环境和生态系统产生了负面影响。在许多地区&#xff0c;大气污染已经成为了日常生活中不可忽视的问题。 虽然大气污染的问题是复杂的&#xff0c;…

关于如何使用 python 下载CSV格式数据

本章节内容节自《python 编程从入门到实践》第十六章&#xff0c;我们将从网络上下载数据&#xff0c;并对数据进行可视化。就可以对其进行分析甚至观察其规律和关联。 学习目标 我们将访问并可视化以下两种常见格式存储的数据&#xff1a; CSV 使用 Python 模块 CSV 来处理以…

测试2年,26岁大龄程序员面试13家公司,拿下25K,差点被面试官KO了···

前言 我大概面试了13家公司&#xff0c;简历包装的是两年半测试经验&#xff0c;因为我的年纪已经是26岁&#xff0c;所以必须进行包装&#xff0c;这也并不是我想欺骗别人&#xff0c;而是现在无论干什么工作都需要有工作经验的&#xff0c;就连找个销售都要有工作经验的&…

Vue绑定class样式与style样式

1&#xff0c;回顾HTML的class属性 答&#xff1a;任何一个HTML标签都能够具有class属性&#xff0c;这个属性可能只有一个值&#xff0c;如class"happs"&#xff0c;也有可能存在多个属性值&#xff0c;如class"happs good blue"&#xff0c;js的原生DOM针…

STM32开发踩坑——芯片写保护解除

成立这个专栏的目的是&#xff0c;记录自己嵌入式开发遇到的问题&#xff0c;与成功的解决方法&#xff0c;方便自己回顾。 具体参考链接&#xff1a;STM32的Flash写了保护怎么办&#xff1f; 解决方法&#xff1a;在STLink连接目标板的情况下打开程序烧写软件ST-Link Utilit…

低代码开发迎来设备管理新时代:智能制造加速升级

随着智能制造时代的到来&#xff0c;制造业正在经历一场前所未有的变革。在这场变革中&#xff0c;设备管理平台和低代码开发已经成为了制造业的不二利器&#xff0c;帮助企业实现数字化转型&#xff0c;提高生产效率&#xff0c;降低成本&#xff0c;增强竞争力。 一、设备管…

OptaPlanner 中的hello world项目实战

实际操作步骤&#xff1a; 1.代码下载 下载下来的文件目录 2.使用编辑器打开hello-world项目 3.进行配置 配置JDK &#xff0c;File——》Settings File——》Project Structure 配置maven 说明&#xff1a;不用下载新的maven&#xff0c;用工具自带的&#xff0c;需要将sett…

旋翼无人机常用仿真工具

四旋翼常用仿真工具 rviz&#xff1a; 简单的质点&#xff08;也可以加上动力学姿态&#xff09;&#xff0c;用urdf模型在rviz中显示无人机和飞行轨迹、地图等。配合ROS代码使用&#xff0c;轻量化适合多机。典型的比如浙大ego-planner的仿真&#xff1a; https://github.c…