ssm网上医院预约挂号系统源码和论文051
开发工具:idea
数据库mysql5.7+
数据库链接工具:navcat,小海豚等
技术:ssm
摘 要
如今的信息时代,对信息的共享性,信息的流通性有着较高要求,因此传统管理方式就不适合。为了让医院预约挂号信息的管理模式进行升级,也为了更好的维护医院预约挂号信息,网上医院预约挂号系统的开发运用就显得很有必要。并且通过开发网上医院预约挂号系统,不仅可以让所学的SSM框架得到实际运用,也可以掌握MySQL的使用方法,对自身编程能力也有一个检验和提升的过程。尤其是通过实践,可以对系统的开发流程加深印象,无论是前期的分析与设计,还是后期的编码测试等环节,都可以有一个深刻的了解。
网上医院预约挂号系统根据调研,确定管理员除了管理医生,科室和用户外,也能管理用户预约挂号信息,下载用户病例,发布健康资讯,管理客服聊天信息。医生管理本人的坐诊信息,审核预约挂号,管理用户就诊病例。用户在前台查看医生坐诊,对医生预约挂号,评价并收藏医生,查看健康资讯,联系客服,用户在后台支付挂号价格,下载病例。
借助于网上医院预约挂号系统这样的工具,让信息系统化,流程化,规范化是最终的发展结果,让其遵循实际操作流程的情况下,对医院预约挂号信息实施规范化处理,让医院预约挂号信息通过电子的方式进行保存,无论是管理人员检索医院预约挂号信息,维护医院预约挂号信息都可以便利化操作,真正缩短信息处理时间,节省人力和信息管理的成本。
关键字:预约挂号,联系客服,下载病例
package com.controller;import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
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 com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;import com.entity.YishengEntity;
import com.entity.view.YishengView;import com.service.YishengService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
import com.utils.CommonUtil;/*** 医生* 后端接口* @author * @email * @date 2020-12-24 11:35:16*/
@RestController
@RequestMapping("/yisheng")
public class YishengController {@Autowiredprivate YishengService yishengService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@RequestMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {YishengEntity user = yishengService.selectOne(new EntityWrapper<YishengEntity>().eq("yishenggonghao", username));if(user==null || !user.getMima().equals(password)) {return R.error("账号或密码不正确");}String token = tokenService.generateToken(user.getId(), username,"yisheng", "医生" );return R.ok().put("token", token);}/*** 注册*/@IgnoreAuth@RequestMapping("/register")public R register(@RequestBody YishengEntity yisheng){//ValidatorUtils.validateEntity(yisheng);YishengEntity user = yishengService.selectOne(new EntityWrapper<YishengEntity>().eq("yishenggonghao", yisheng.getYishenggonghao()));if(user!=null) {return R.error("注册用户已存在");}Long uId = new Date().getTime();yisheng.setId(uId);yishengService.insert(yisheng);return R.ok();}/*** 退出*/@RequestMapping("/logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 获取用户的session用户信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Long id = (Long)request.getSession().getAttribute("userId");YishengEntity user = yishengService.selectById(id);return R.ok().put("data", user);}/*** 密码重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){YishengEntity user = yishengService.selectOne(new EntityWrapper<YishengEntity>().eq("yishenggonghao", username));if(user==null) {return R.error("账号不存在");}user.setMima("123456");yishengService.updateById(user);return R.ok("密码已重置为:123456");}/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,YishengEntity yisheng, HttpServletRequest request){EntityWrapper<YishengEntity> ew = new EntityWrapper<YishengEntity>();PageUtils page = yishengService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yisheng), params), params));request.setAttribute("data", page);return R.ok().put("data", page);}/*** 前端列表*/@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,YishengEntity yisheng, HttpServletRequest request){EntityWrapper<YishengEntity> ew = new EntityWrapper<YishengEntity>();PageUtils page = yishengService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yisheng), params), params));request.setAttribute("data", page);return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( YishengEntity yisheng){EntityWrapper<YishengEntity> ew = new EntityWrapper<YishengEntity>();ew.allEq(MPUtil.allEQMapPre( yisheng, "yisheng")); return R.ok().put("data", yishengService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(YishengEntity yisheng){EntityWrapper< YishengEntity> ew = new EntityWrapper< YishengEntity>();ew.allEq(MPUtil.allEQMapPre( yisheng, "yisheng")); YishengView yishengView = yishengService.selectView(ew);return R.ok("查询医生成功").put("data", yishengView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") String id){YishengEntity yisheng = yishengService.selectById(id);return R.ok().put("data", yisheng);}/*** 前端详情*/@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") String id){YishengEntity yisheng = yishengService.selectById(id);return R.ok().put("data", yisheng);}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody YishengEntity yisheng, HttpServletRequest request){yisheng.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(yisheng);YishengEntity user = yishengService.selectOne(new EntityWrapper<YishengEntity>().eq("yishenggonghao", yisheng.getYishenggonghao()));if(user!=null) {return R.error("用户已存在");}yisheng.setId(new Date().getTime());yishengService.insert(yisheng);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody YishengEntity yisheng, HttpServletRequest request){yisheng.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(yisheng);YishengEntity user = yishengService.selectOne(new EntityWrapper<YishengEntity>().eq("yishenggonghao", yisheng.getYishenggonghao()));if(user!=null) {return R.error("用户已存在");}yisheng.setId(new Date().getTime());yishengService.insert(yisheng);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody YishengEntity yisheng, HttpServletRequest request){//ValidatorUtils.validateEntity(yisheng);yishengService.updateById(yisheng);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){yishengService.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<String, Object> 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<YishengEntity> wrapper = new EntityWrapper<YishengEntity>();if(map.get("remindstart")!=null) {wrapper.ge(columnName, map.get("remindstart"));}if(map.get("remindend")!=null) {wrapper.le(columnName, map.get("remindend"));}int count = yishengService.selectCount(wrapper);return R.ok().put("count", count);}}