作者:计算机学长阿伟
开发技术:SpringBoot、SSM、Vue、MySQL、ElementUI等,“文末源码”。
开发运行环境
- 开发语言:Java
- 数据库:MySQL
- 技术:SpringBoot、Vue、Mybaits Plus、ELementUI
- 工具:IDEA/Ecilpse、Navicat、Maven
源码下载地址:
https://download.csdn.net/download/weixin_53180424/89909218
一、项目简介
医患档案管理系统是一个专为医疗机构设计的综合管理系统,旨在提高医患管理的效率和便捷性。该系统界面简洁明了,易于操作。用户可以通过点击顶部的“首页”链接进入系统主页,快速访问所需功能。系统提供了“个人中心”、“修改密码”和“个人信息”等个性化服务选项,方便用户管理自己的账户和资料。此外,系统还支持多种角色的用户进行不同的操作,如“患者管理”、“医生管理”、“诊疗信息管理”、“病历信息管理”和“处方信息管理”等,满足了医疗机构日常管理的多样化需求。整个系统设计科学、功能全面,为医疗机构提供了高效、便捷的医患档案管理服务。
二、系统项目部分截图
2.1后台系统部分页面效果
三、部分核心代码
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.transaction.annotation.Transactional;
import org.springframework.format.annotation.DateTimeFormat;
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.HuanzheEntity;
import com.entity.view.HuanzheView;
import com.service.HuanzheService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
/**
* 患者
* 后端接口
*/
@RestController
@RequestMapping("/huanzhe")
public class HuanzheController {
@Autowired
private HuanzheService huanzheService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
HuanzheEntity user = huanzheService.selectOne(new EntityWrapper<HuanzheEntity>().eq("huanzhezhanghao", username));
if(user==null || !user.getMima().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(), username,"huanzhe", "患者" );
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@RequestMapping("/register")
public R register(@RequestBody HuanzheEntity huanzhe){
//ValidatorUtils.validateEntity(huanzhe);
HuanzheEntity user = huanzheService.selectOne(new EntityWrapper<HuanzheEntity>().eq("huanzhezhanghao", huanzhe.getHuanzhezhanghao()));
if(user!=null) {
return R.error("注册用户已存在");
}
Long uId = new Date().getTime();
huanzhe.setId(uId);
huanzheService.insert(huanzhe);
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");
HuanzheEntity user = huanzheService.selectById(id);
return R.ok().put("data", user);
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
HuanzheEntity user = huanzheService.selectOne(new EntityWrapper<HuanzheEntity>().eq("huanzhezhanghao", username));
if(user==null) {
return R.error("账号不存在");
}
user.setMima("123456");
huanzheService.updateById(user);
return R.ok("密码已重置为:123456");
}
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,HuanzheEntity huanzhe,
HttpServletRequest request){
EntityWrapper<HuanzheEntity> ew = new EntityWrapper<HuanzheEntity>();
PageUtils page = huanzheService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, huanzhe), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,HuanzheEntity huanzhe,
HttpServletRequest request){
EntityWrapper<HuanzheEntity> ew = new EntityWrapper<HuanzheEntity>();
PageUtils page = huanzheService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, huanzhe), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( HuanzheEntity huanzhe){
EntityWrapper<HuanzheEntity> ew = new EntityWrapper<HuanzheEntity>();
ew.allEq(MPUtil.allEQMapPre( huanzhe, "huanzhe"));
return R.ok().put("data", huanzheService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(HuanzheEntity huanzhe){
EntityWrapper< HuanzheEntity> ew = new EntityWrapper< HuanzheEntity>();
ew.allEq(MPUtil.allEQMapPre( huanzhe, "huanzhe"));
HuanzheView huanzheView = huanzheService.selectView(ew);
return R.ok("查询患者成功").put("data", huanzheView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
HuanzheEntity huanzhe = huanzheService.selectById(id);
return R.ok().put("data", huanzhe);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
HuanzheEntity huanzhe = huanzheService.selectById(id);
return R.ok().put("data", huanzhe);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody HuanzheEntity huanzhe, HttpServletRequest request){
huanzhe.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(huanzhe);
HuanzheEntity user = huanzheService.selectOne(new EntityWrapper<HuanzheEntity>().eq("huanzhezhanghao", huanzhe.getHuanzhezhanghao()));
if(user!=null) {
return R.error("用户已存在");
}
huanzhe.setId(new Date().getTime());
huanzheService.insert(huanzhe);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody HuanzheEntity huanzhe, HttpServletRequest request){
huanzhe.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(huanzhe);
HuanzheEntity user = huanzheService.selectOne(new EntityWrapper<HuanzheEntity>().eq("huanzhezhanghao", huanzhe.getHuanzhezhanghao()));
if(user!=null) {
return R.error("用户已存在");
}
huanzhe.setId(new Date().getTime());
huanzheService.insert(huanzhe);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody HuanzheEntity huanzhe, HttpServletRequest request){
//ValidatorUtils.validateEntity(huanzhe);
huanzheService.updateById(huanzhe);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
huanzheService.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<HuanzheEntity> wrapper = new EntityWrapper<HuanzheEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = huanzheService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
获取源码或文档
如需对应的论文或文档,以及其他定制需求,也可以下方添加联系我。