大家好!我是程序员一帆,感谢您阅读本文,欢迎一键三连哦。
💞当前专栏:Java毕业设计
精彩专栏推荐👇🏻👇🏻👇🏻
开发环境
- 开发语言:Java
- 框架:ssm
- JDK版本:JDK1.8
- 服务器:tomcat7
- 数据库:mysql 5.7
- 数据库工具:Navicat12
- 开发软件:eclipse/myeclipse/idea
- Maven包:Maven3.3.9
- 浏览器:谷歌浏览器
源码下载地址:
https://download.csdn.net/download/2301_76953549/89298626
论文目录
【如需全文请按文末获取联系】
一、项目简介
病房管理系统运用的工具包括Eclipse,Tomcat以及Navicat等。该系统可以实现开方类型管理,科室管理,药品类型管理,医护职位管理,职位管理,患者管理,病床管理,病床使用管理,病例管理,开方管理,药品管理,医护人员管理,医生管理等功能。
二、系统设计
2.1软件功能模块设计
管理员具备的详细功能将参照最终的设计结果,即图4.1所示的管理员功能结构图。其中管理员对开方类型,药品类型,职位等基础数据进行管理,对病床,病床使用,患者,医护人员,药品,开方等信息进行管理。
医生具备的详细功能将参照最终的设计结果,即图4.2所示的医生功能结构图。其中医生增删改查病例,开方,药品信息,查看病床信息以及病床使用信息。
医护人员具备的详细功能将参照最终的设计结果,即图4.3所示的医护人员功能结构图。其中医护人员主要是查看患者,病例,开方信息以及药品信息,查看病床信息以及病床使用信息。
患者具备的详细功能将参照最终的设计结果,即图4.4所示的患者功能结构图。其中患者查看病例,查看开方信息,查看病床使用信息。
2.2数据库设计
(1)把患者具备的属性通过属性图进行展示,绘制的属性图见图4.4。
(2)把开方具备的属性通过属性图进行展示,绘制的属性图见图4.5。
(3)把医生具备的属性通过属性图进行展示,绘制的属性图见图4.6。
(4)把病例具备的属性通过属性图进行展示,绘制的属性图见图4.7。
(5)上述实体间关系见图4.8。
三、系统项目部分截图
3.1管理员功能实现
患者管理
实现患者管理功能,其界面运行的效果图见图5.1。患者信息有现住址,户籍地址,婚姻,患者照片,性别等信息,管理员可以修改有错误数据的患者信息,以及使用删除功能删除需要删除的患者信息等。
病床管理
实现病床管理功能,其界面运行的效果图见图5.2。病床信息有房间名,房间位置,床号,是否使用等信息,管理员修改有错误数据的病床信息,使用删除功能删除需要删除的病床信息,或者使用床号,房间名实现对病床信息的查询。
病床使用管理
实现病床使用管理功能,其界面运行的效果图见图5.3。病床使用信息也需要管理员登记,其中包括病床编号,患者手机号,患者入住时间,状态等信息,病床使用信息有错误,管理员需要修改,对于需要清理的病床使用信息,管理员使用删除功能即可删除。
3.2医生功能实现
病例管理
实现病例管理功能,其界面运行的效果图见图5.4。医生为患者看病之后,为患者添加病例信息,包括患者主诉,诊断结果,住院时间等信息,医生也能修改登记错误的病例信息,以及通过病例编号实现对患者病例的查询。
开方管理
实现开方管理功能,其界面运行的效果图见图5.5。医生针对患者病情的诊断结果开具处方,其中包括药方类型,开发类型,开方时间等信息,以及医生对开方信息进行修改,查询等。
药品管理
实现药品管理功能,其界面运行的效果图见图5.6。在该界面,医生负责添加药品,修改添加错误的药品信息,删除需要删除的药品信息,以及管理药品的库存,主要管理方式是增加药品的库存,或对药品库存进行减少等操作。
3.3医护人员功能实现
病床使用查看
实现病床使用查看功能,其界面运行的效果图见图5.7。医护人员查询病床使用信息,查询前,可以提供患者姓名,病床编号,状态等查询条件来查询病床使用信息。
病例查看
实现病例查看功能,其界面运行的效果图见图5.8。医护人员查询患者病例,查看病例的诊断结果,住院时间,患者主诉信息等。
3.4患者功能实现
病例查看
实现病例查看功能,其界面运行的效果图见图5.10。患者查询病例,查看诊断结果等详细信息。
开方查看
实现开方查看功能,其界面运行的效果图见图5.11。患者查询开方,查看药方名称,开方编号,开方类型等信息。
四、部分核心代码
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
* 药品
* 后端接口
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/yaopin")
public class YaopinController {
private static final Logger logger = LoggerFactory.getLogger(YaopinController.class);
@Autowired
private YaopinService yaopinService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
@Autowired
private HuanzheService huanzheService;
@Autowired
private YihurenyuanService yihurenyuanService;
@Autowired
private YishengService yishengService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永不会进入");
else if("患者".equals(role))
params.put("huanzheId",request.getSession().getAttribute("userId"));
else if("医护人员".equals(role))
params.put("yihurenyuanId",request.getSession().getAttribute("userId"));
else if("医生".equals(role))
params.put("yishengId",request.getSession().getAttribute("userId"));
if(params.get("orderBy")==null || params.get("orderBy")==""){
params.put("orderBy","id");
}
PageUtils page = yaopinService.queryPage(params);
//字典表数据转换
List<YaopinView> list =(List<YaopinView>)page.getList();
for(YaopinView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
YaopinEntity yaopin = yaopinService.selectById(id);
if(yaopin !=null){
//entity转view
YaopinView view = new YaopinView();
BeanUtils.copyProperties( yaopin , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody YaopinEntity yaopin, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,yaopin:{}",this.getClass().getName(),yaopin.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<YaopinEntity> queryWrapper = new EntityWrapper<YaopinEntity>()
.eq("yaopin_uuid_number", yaopin.getYaopinUuidNumber())
.eq("yaopin_name", yaopin.getYaopinName())
.eq("yaopin_types", yaopin.getYaopinTypes())
.eq("yaopin_kucun_number", yaopin.getYaopinKucunNumber())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YaopinEntity yaopinEntity = yaopinService.selectOne(queryWrapper);
if(yaopinEntity==null){
yaopin.setCreateTime(new Date());
yaopinService.insert(yaopin);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody YaopinEntity yaopin, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,yaopin:{}",this.getClass().getName(),yaopin.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<YaopinEntity> queryWrapper = new EntityWrapper<YaopinEntity>()
.notIn("id",yaopin.getId())
.andNew()
.eq("yaopin_uuid_number", yaopin.getYaopinUuidNumber())
.eq("yaopin_name", yaopin.getYaopinName())
.eq("yaopin_types", yaopin.getYaopinTypes())
.eq("yaopin_kucun_number", yaopin.getYaopinKucunNumber())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YaopinEntity yaopinEntity = yaopinService.selectOne(queryWrapper);
if("".equals(yaopin.getYaopinPhoto()) || "null".equals(yaopin.getYaopinPhoto())){
yaopin.setYaopinPhoto(null);
}
if(yaopinEntity==null){
yaopinService.updateById(yaopin);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
yaopinService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 批量上传
*/
@RequestMapping("/batchInsert")
public R save( String fileName, HttpServletRequest request){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
List<YaopinEntity> yaopinList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("../../upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
YaopinEntity yaopinEntity = new YaopinEntity();
// yaopinEntity.setYaopinUuidNumber(data.get(0)); //药品编号 要改的
// yaopinEntity.setYaopinName(data.get(0)); //药品名称 要改的
// yaopinEntity.setYaopinPhoto("");//详情和图片
// yaopinEntity.setYaopinTypes(Integer.valueOf(data.get(0))); //药品类型 要改的
// yaopinEntity.setYaopinKucunNumber(Integer.valueOf(data.get(0))); //库存数量 要改的
// yaopinEntity.setYaopinContent("");//详情和图片
// yaopinEntity.setCreateTime(date);//时间
yaopinList.add(yaopinEntity);
//把要查询是否重复的字段放入map中
//药品编号
if(seachFields.containsKey("yaopinUuidNumber")){
List<String> yaopinUuidNumber = seachFields.get("yaopinUuidNumber");
yaopinUuidNumber.add(data.get(0));//要改的
}else{
List<String> yaopinUuidNumber = new ArrayList<>();
yaopinUuidNumber.add(data.get(0));//要改的
seachFields.put("yaopinUuidNumber",yaopinUuidNumber);
}
}
//查询是否重复
//药品编号
List<YaopinEntity> yaopinEntities_yaopinUuidNumber = yaopinService.selectList(new EntityWrapper<YaopinEntity>().in("yaopin_uuid_number", seachFields.get("yaopinUuidNumber")));
if(yaopinEntities_yaopinUuidNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(YaopinEntity s:yaopinEntities_yaopinUuidNumber){
repeatFields.add(s.getYaopinUuidNumber());
}
return R.error(511,"数据库的该表中的 [药品编号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
yaopinService.insertBatch(yaopinList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
}
获取源码或论文
如需对应的论文或源码,以及其他定制需求,也可以下方微❤联系。