栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

SpringMVC+Vue项目预约挂号系统

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

SpringMVC+Vue项目预约挂号系统

末获取源码 

开发语言:Java

开发工具:IDEA /Eclipse

数据库:MYSQL5.7

应用服务:Tomcat7/Tomcat8

使用框架ssm+vue

JDK版本:jdk1.8

目录

前言介绍  

系统详细设计

前台首页功能模块 

首页

医生信息 

挂号记录

取消挂号

​编辑在线问诊

管理员功能模块 

用户管理 

医生信息管理 

科室信息管理

挂号记录管理

在线问诊管理

医生功能模块

挂号记录管理

机构功能模块

医院信息管理


前言介绍  

本系统是基于Mysql数据库,在SSM程序设计的基础上实现的,本系统主要实现的功能是:前台页面:首页,医生信息,挂号记录,取消挂号,在线问诊,评价与投诉,名医讲堂,个人中心,后台管理。管理员:个人中心,用户管理,医生管理,机构管理,医生信息管理,科室分类管理,科室信息管理,医生信息管理,挂号记录管理,取消挂号管理,失信名单管理,在线问诊管理,评价与投诉管理,系统管理。医生:个人中心,医生信息管理,挂号记录管理,取消挂号管理,在线问诊管理,评价投诉管理。机构:医生信息管理,科室分类管理,科室信息管理,医生信息管理,挂号记录管理,取消挂号管理,失信名单管理,在线问诊管理,评价与投诉管理
 

系统详细设计

前台首页功能模块 

首页

医生信息 

挂号记录

取消挂号

在线问诊

管理员功能模块 

管理员登录,通过填写用户名、密码、角色等信息,输入完成后选择登录即可进入预约挂号系统,如图

管理员登录进入个人健康信息管理可以查看个人中心,用户管理,医生管理,机构管理,医生信息管理,科室分类管理,科室信息管理,医生信息管理,挂号记录管理,取消挂号管理,失信名单管理,在线问诊管理,评价与投诉管理,系统管理等内容,如图

用户管理 

医生信息管理 

科室信息管理

挂号记录管理

在线问诊管理

医生功能模块

挂号记录管理

机构功能模块

医院信息管理

部分核心代码:

controller层

**
 * 挂号记录
 * 后端接口
 * @author 
 * @email 
 * @date 2021-04-19 22:20:39
 */
@RestController
@RequestMapping("/guahaojilu")
public class GuahaojiluController {
    @Autowired
    private GuahaojiluService guahaojiluService;
    


    
    @RequestMapping("/page")
    public R page(@RequestParam Map params,GuahaojiluEntity guahaojilu, 
                @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) Date yuyueshijianstart,
                @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) Date yuyueshijianend,
		HttpServletRequest request){

		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("yisheng")) {
			guahaojilu.setYishenggonghao((String)request.getSession().getAttribute("username"));
		}
		if(tableName.equals("yonghu")) {
			guahaojilu.setYonghuming((String)request.getSession().getAttribute("username"));
		}
        EntityWrapper ew = new EntityWrapper();
                if(yuyueshijianstart!=null) ew.ge("yuyueshijian", yuyueshijianstart);
                if(yuyueshijianend!=null) ew.le("yuyueshijian", yuyueshijianend);
		PageUtils page = guahaojiluService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, guahaojilu), params), params));
        return R.ok().put("data", page);
    }
    
    
    @RequestMapping("/list")
    public R list(@RequestParam Map params,GuahaojiluEntity guahaojilu, HttpServletRequest request){

		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("yisheng")) {
			guahaojilu.setYishenggonghao((String)request.getSession().getAttribute("username"));
		}
		if(tableName.equals("yonghu")) {
			guahaojilu.setYonghuming((String)request.getSession().getAttribute("username"));
		}
        EntityWrapper ew = new EntityWrapper();
		PageUtils page = guahaojiluService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, guahaojilu), params), params));
        return R.ok().put("data", page);
    }

	
    @RequestMapping("/lists")
    public R list( GuahaojiluEntity guahaojilu){
       	EntityWrapper ew = new EntityWrapper();
      	ew.allEq(MPUtil.allEQMapPre( guahaojilu, "guahaojilu")); 
        return R.ok().put("data", guahaojiluService.selectListView(ew));
    }

	 
    @RequestMapping("/query")
    public R query(GuahaojiluEntity guahaojilu){
        EntityWrapper< GuahaojiluEntity> ew = new EntityWrapper< GuahaojiluEntity>();
 		ew.allEq(MPUtil.allEQMapPre( guahaojilu, "guahaojilu")); 
		GuahaojiluView guahaojiluView =  guahaojiluService.selectView(ew);
		return R.ok("查询挂号记录成功").put("data", guahaojiluView);
    }
	
    
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        GuahaojiluEntity guahaojilu = guahaojiluService.selectById(id);
        return R.ok().put("data", guahaojilu);
    }

    
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        GuahaojiluEntity guahaojilu = guahaojiluService.selectById(id);
        return R.ok().put("data", guahaojilu);
    }
    



    
    @RequestMapping("/save")
    public R save(@RequestBody GuahaojiluEntity guahaojilu, HttpServletRequest request){
    	guahaojilu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(guahaojilu);

        guahaojiluService.insert(guahaojilu);
        return R.ok();
    }
    
    
    @RequestMapping("/add")
    public R add(@RequestBody GuahaojiluEntity guahaojilu, HttpServletRequest request){
    	guahaojilu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(guahaojilu);
    	guahaojilu.setUserid((Long)request.getSession().getAttribute("userId"));

        guahaojiluService.insert(guahaojilu);
        return R.ok();
    }

    
    @RequestMapping("/update")
    public R update(@RequestBody GuahaojiluEntity guahaojilu, HttpServletRequest request){
        //ValidatorUtils.validateEntity(guahaojilu);
        guahaojiluService.updateById(guahaojilu);//全部更新
        return R.ok();
    }
    

    
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        guahaojiluService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper wrapper = new EntityWrapper();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}

		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("yisheng")) {
			wrapper.eq("yishenggonghao", (String)request.getSession().getAttribute("username"));
		}
		if(tableName.equals("yonghu")) {
			wrapper.eq("yonghuming", (String)request.getSession().getAttribute("username"));
		}

		int count = guahaojiluService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	


}

登陆拦截功能实现 

@Component
public class AuthorizationInterceptor implements HandlerInterceptor {
 
    public static final String LOGIN_TOKEN_KEY = "Token";
 
    @Autowired
    private TokenService tokenService;
    
	@Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
 
        //支持跨域请求
        response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
        response.setHeader("Access-Control-Max-Age", "3600");
        response.setHeader("Access-Control-Allow-Credentials", "true");
        response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization");
        response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
 
        IgnoreAuth annotation;
        if (handler instanceof HandlerMethod) {
            annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class);
        } else {
            return true;
        }
 
        //从header中获取token
        String token = request.getHeader(LOGIN_TOKEN_KEY);
        
        
        if(annotation!=null) {
        	return true;
        }
        
        TokenEntity tokenEntity = null;
        if(StringUtils.isNotBlank(token)) {
        	tokenEntity = tokenService.getTokenEntity(token);
        }
        
        if(tokenEntity != null) {
        	request.getSession().setAttribute("userId", tokenEntity.getUserid());
        	request.getSession().setAttribute("role", tokenEntity.getRole());
        	request.getSession().setAttribute("tableName", tokenEntity.getTablename());
        	request.getSession().setAttribute("username", tokenEntity.getUsername());
        	return true;
        }
        
		PrintWriter writer = null;
		response.setCharacterEncoding("UTF-8");
		response.setContentType("application/json; charset=utf-8");
		try {
		    writer = response.getWriter();
		    writer.print(JSONObject.toJSONString(R.error(401, "请先登录")));
		} finally {
		    if(writer != null){
		        writer.close();
		    }
		}
//				throw new EIException("请先登录", 401);
		return false;
    }
}

  文件上传功能

@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{
	@Autowired
    private ConfigService configService;
	
	@RequestMapping("/upload")
	public R upload(@RequestParam("file") MultipartFile file, String type,HttpServletRequest request) throws Exception {
		if (file.isEmpty()) {
			throw new EIException("上传文件不能为空");
		}
		String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
		String fileName = new Date().getTime()+"."+fileExt;
		File dest = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);
		file.transferTo(dest);
		if(StringUtils.isNotBlank(type) && type.equals("1")) {
			ConfigEntity configEntity = configService.selectOne(new EntityWrapper().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 void download(@RequestParam String fileName, HttpServletRequest request, HttpServletResponse response) {
		try {
			File file = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);
			if (file.exists()) {
				response.reset();
				response.setHeader("Content-Disposition", "attachment; filename="" + fileName+""");
				response.setHeader("Cache-Control", "no-cache");
				response.setHeader("Access-Control-Allow-Credentials", "true");
				response.setContentType("application/octet-stream; charset=UTF-8");
				IOUtils.write(FileUtils.readFileToByteArray(file), response.getOutputStream());
			}
 
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
}

 entity层

package com.entity;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;



@TableName("discusszaixianwenzhen")
public class DiscusszaixianwenzhenEntity implements Serializable {
	private static final long serialVersionUID = 1L;


	public DiscusszaixianwenzhenEntity() {
		
	}
	
	public DiscusszaixianwenzhenEntity(T t) {
		try {
			BeanUtils.copyProperties(this, t);
		} catch (IllegalAccessException | InvocationTargetException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	
	@TableId
	private Long id;
	
					
	private Long refid;
	
	
					
	private Long userid;
	
	
					
	private String nickname;
	
	
					
	private String content;
	
	
					
	private String reply;
	
	
	@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat
	private Date addtime;

	public Date getAddtime() {
		return addtime;
	}
	public void setAddtime(Date addtime) {
		this.addtime = addtime;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	public void setRefid(Long refid) {
		this.refid = refid;
	}
	
	public Long getRefid() {
		return refid;
	}
	
	public void setUserid(Long userid) {
		this.userid = userid;
	}
	
	public Long getUserid() {
		return userid;
	}
	
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}
	
	public String getNickname() {
		return nickname;
	}
	
	public void setContent(String content) {
		this.content = content;
	}
	
	public String getContent() {
		return content;
	}
	
	public void setReply(String reply) {
		this.reply = reply;
	}
	
	public String getReply() {
		return reply;
	}

}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/966842.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号