医疗报销|基于springboot的医疗报销系统设计与实现(附项目源码+论文+数据库)
私信或留言即免费送开题报告和任务书(可指定任意题目)
目录
一、摘要
二、相关技术
三、系统设计
四、数据库设计
五、核心代码
六、论文参考
七、源码获取
一、摘要
传统信息的管理大部分依赖于管理人员的手工登记与管理,然而,随着近些年信息技术的迅猛发展,让许多比较老套的信息管理模式进行了更新迭代,报销单信息因为其管理内容繁杂,管理数量繁多导致手工进行处理不能满足广大用户的需求,因此就应运而生出相应的医疗报销系统。
本医疗报销系统分为管理员还有用户两个权限,管理员可以管理用户的基本信息内容,可以管理公告信息以及公告的租赁信息,能够与用户进行相互交流等操作,用户可以查看报销单信息,可以查看公告以及查看管理员回复信息等操作。
该医疗报销系统采用的是WEB应用程序开发中最受欢迎的B/S三层结构模式,使用占用空间小但功能齐全的MySQL数据库进行数据的存储操作,系统开发技术使用到了JSP技术。该医疗报销系统能够解决许多传统手工操作的难题,比如数据查询耽误时间长,数据管理步骤繁琐等问题。总的来说,医疗报销系统性能稳定,功能较全,投入运行使用性价比很高。
关键词:医疗报销系统;MySQL数据库;SSM技术
二、相关技术
java、tomcat、mysql、spring、springBoot、mybatis、query、vue
三、系统设计
3.1 整体功能设计图
医疗报销系统系统在进行系统中功能模块的划分时,采用层次图来进行表示。层次图具有树形结构,它能使用矩形框来描绘数据信息。顶层代表的数据结构很完整,顶层下面的矩形框表示的数据就是子集数据,当然处于最下面的矩形框就是不能再进行细分的数据元素了,使用层次方框图描述系统功能能让用户一目了然,能够明白系统的功能,以及对应功能板块下面的子功能都可以清楚领会。医疗报销系统分为管理员和用户两部分操作角色,下面将对他们的功能进行阐述。
管理员可以管理用户的基本信息,可以管理等功能。管理员功能结构图如下:
3.2 功能具体细节设计
1、管理员功能模块的实现
报销单列表
如图5.1显示的就是报销单列表页面,此页面提供给管理员的功能有:查看报销单、新增报销单、修改报销单、删除报销单等。
公告信息管理
管理员可以对前台的注册用户的基本信息进行管理,可以设置注册用户的账号为冻结或者是在用状态,管理员也能选择很多个已经失效的注册用户的信息进行批量删除操作。注册用户管理界面如图5.2所示。
公告类型管理
公告类型管理页面显示所有公告类型,在此页面既可以让管理员添加新的公告信息类型,也能对已有的公告类型信息执行编辑更新,失效的公告类型信息也能让管理员快速删除。下图就是公告类型管理页面。公告类型管理界面如图5.3所示。
四、数据库设计
数据库里面的数据表存放的就是各种数据记录,我们在进行系统增删改查操作时,其实也是在对应数据表里面进行的增删改查操作,一个好的数据库能够缩短信息处理时间,所以说数据库的设计工作不容小觑,数据库里面设置哪些表,表里面的字段设计以及字段类型和字段长度等信息都要考虑周到才行,比如时间这个字段,它的数据类型就不能是int型,不然在系统操作中就会弹出输入数据格式不符合要求的报错提示。下面简单介绍医疗报销系统的一些数据表。
五、核心代码
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("/lingdao")
public class LingdaoController {private static final Logger logger = LoggerFactory.getLogger(LingdaoController.class);@Autowiredprivate LingdaoService lingdaoService;@Autowiredprivate TokenService tokenService;@Autowiredprivate DictionaryService dictionaryService;//级联表service@Autowiredprivate CaikuaiService caikuaiService;@Autowiredprivate YonghuService yonghuService;/*** 后端列表*/@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("caikuaiId",request.getSession().getAttribute("userId"));else if("领导".equals(role))params.put("lingdaoId",request.getSession().getAttribute("userId"));else if("用户".equals(role))params.put("yonghuId",request.getSession().getAttribute("userId"));if(params.get("orderBy")==null || params.get("orderBy")==""){params.put("orderBy","id");}PageUtils page = lingdaoService.queryPage(params);//字典表数据转换List<LingdaoView> list =(List<LingdaoView>)page.getList();for(LingdaoView 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);LingdaoEntity lingdao = lingdaoService.selectById(id);if(lingdao !=null){//entity转viewLingdaoView view = new LingdaoView();BeanUtils.copyProperties( lingdao , view );//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody LingdaoEntity lingdao, HttpServletRequest request){logger.debug("save方法:,,Controller:{},,lingdao:{}",this.getClass().getName(),lingdao.toString());String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永远不会进入");Wrapper<LingdaoEntity> queryWrapper = new EntityWrapper<LingdaoEntity>().eq("username", lingdao.getUsername()).or().eq("lingdao_phone", lingdao.getLingdaoPhone());logger.info("sql语句:"+queryWrapper.getSqlSegment());LingdaoEntity lingdaoEntity = lingdaoService.selectOne(queryWrapper);if(lingdaoEntity==null){lingdao.setCreateTime(new Date());lingdao.setPassword("123456");lingdaoService.insert(lingdao);return R.ok();}else {return R.error(511,"账户或者领导手机号已经被使用");}}/*** 后端修改*/@RequestMapping("/update")public R update(@RequestBody LingdaoEntity lingdao, HttpServletRequest request){logger.debug("update方法:,,Controller:{},,lingdao:{}",this.getClass().getName(),lingdao.toString());String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");//根据字段查询是否有相同数据Wrapper<LingdaoEntity> queryWrapper = new EntityWrapper<LingdaoEntity>().notIn("id",lingdao.getId()).andNew().eq("username", lingdao.getUsername()).or().eq("lingdao_phone", lingdao.getLingdaoPhone());logger.info("sql语句:"+queryWrapper.getSqlSegment());LingdaoEntity lingdaoEntity = lingdaoService.selectOne(queryWrapper);if("".equals(lingdao.getLingdaoPhoto()) || "null".equals(lingdao.getLingdaoPhoto())){lingdao.setLingdaoPhoto(null);}if(lingdaoEntity==null){lingdaoService.updateById(lingdao);//根据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());lingdaoService.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<LingdaoEntity> lingdaoList = 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("static/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){//循环LingdaoEntity lingdaoEntity = new LingdaoEntity();
// lingdaoEntity.setUsername(data.get(0)); //账户 要改的
// //lingdaoEntity.setPassword("123456");//密码
// lingdaoEntity.setLingdaoName(data.get(0)); //领导姓名 要改的
// lingdaoEntity.setLingdaoPhone(data.get(0)); //领导手机号 要改的
// lingdaoEntity.setLingdaoPhoto("");//详情和图片
// lingdaoEntity.setSexTypes(Integer.valueOf(data.get(0))); //性别 要改的
// lingdaoEntity.setLingdaoEmail(data.get(0)); //电子邮箱 要改的
// lingdaoEntity.setCreateTime(date);//时间lingdaoList.add(lingdaoEntity);//把要查询是否重复的字段放入map中//账户if(seachFields.containsKey("username")){List<String> username = seachFields.get("username");username.add(data.get(0));//要改的}else{List<String> username = new ArrayList<>();username.add(data.get(0));//要改的seachFields.put("username",username);}//领导手机号if(seachFields.containsKey("lingdaoPhone")){List<String> lingdaoPhone = seachFields.get("lingdaoPhone");lingdaoPhone.add(data.get(0));//要改的}else{List<String> lingdaoPhone = new ArrayList<>();lingdaoPhone.add(data.get(0));//要改的seachFields.put("lingdaoPhone",lingdaoPhone);}}//查询是否重复//账户List<LingdaoEntity> lingdaoEntities_username = lingdaoService.selectList(new EntityWrapper<LingdaoEntity>().in("username", seachFields.get("username")));if(lingdaoEntities_username.size() >0 ){ArrayList<String> repeatFields = new ArrayList<>();for(LingdaoEntity s:lingdaoEntities_username){repeatFields.add(s.getUsername());}return R.error(511,"数据库的该表中的 [账户] 字段已经存在 存在数据为:"+repeatFields.toString());}//领导手机号List<LingdaoEntity> lingdaoEntities_lingdaoPhone = lingdaoService.selectList(new EntityWrapper<LingdaoEntity>().in("lingdao_phone", seachFields.get("lingdaoPhone")));if(lingdaoEntities_lingdaoPhone.size() >0 ){ArrayList<String> repeatFields = new ArrayList<>();for(LingdaoEntity s:lingdaoEntities_lingdaoPhone){repeatFields.add(s.getLingdaoPhone());}return R.error(511,"数据库的该表中的 [领导手机号] 字段已经存在 存在数据为:"+repeatFields.toString());}lingdaoService.insertBatch(lingdaoList);return R.ok();}}}}catch (Exception e){e.printStackTrace();return R.error(511,"批量插入数据异常,请联系管理员");}}/*** 登录*/@IgnoreAuth@RequestMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {LingdaoEntity lingdao = lingdaoService.selectOne(new EntityWrapper<LingdaoEntity>().eq("username", username));if(lingdao==null || !lingdao.getPassword().equals(password))return R.error("账号或密码不正确");// // 获取监听器中的字典表// ServletContext servletContext = ContextLoader.getCurrentWebApplicationContext().getServletContext();// Map<String, Map<Integer, String>> dictionaryMap= (Map<String, Map<Integer, String>>) servletContext.getAttribute("dictionaryMap");// Map<Integer, String> role_types = dictionaryMap.get("role_types");// role_types.get(.getRoleTypes());String token = tokenService.generateToken(lingdao.getId(),username, "lingdao", "领导");R r = R.ok();r.put("token", token);r.put("role","领导");r.put("username",lingdao.getLingdaoName());r.put("tableName","lingdao");r.put("userId",lingdao.getId());return r;}/*** 注册*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody LingdaoEntity lingdao){
// ValidatorUtils.validateEntity(user);Wrapper<LingdaoEntity> queryWrapper = new EntityWrapper<LingdaoEntity>().eq("username", lingdao.getUsername()).or().eq("lingdao_phone", lingdao.getLingdaoPhone());LingdaoEntity lingdaoEntity = lingdaoService.selectOne(queryWrapper);if(lingdaoEntity != null)return R.error("账户或者领导手机号已经被使用");lingdao.setCreateTime(new Date());lingdaoService.insert(lingdao);return R.ok();}/*** 重置密码*/@GetMapping(value = "/resetPassword")public R resetPassword(Integer id){LingdaoEntity lingdao = new LingdaoEntity();lingdao.setPassword("123456");lingdao.setId(id);lingdaoService.updateById(lingdao);return R.ok();}/*** 忘记密码*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request) {LingdaoEntity lingdao = lingdaoService.selectOne(new EntityWrapper<LingdaoEntity>().eq("username", username));if(lingdao!=null){lingdao.setPassword("123456");boolean b = lingdaoService.updateById(lingdao);if(!b){return R.error();}}else{return R.error("账号不存在");}return R.ok();}/*** 获取用户的session用户信息*/@RequestMapping("/session")public R getCurrLingdao(HttpServletRequest request){Integer id = (Integer)request.getSession().getAttribute("userId");LingdaoEntity lingdao = lingdaoService.selectById(id);if(lingdao !=null){//entity转viewLingdaoView view = new LingdaoView();BeanUtils.copyProperties( lingdao , view );//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}}
六、论文参考
七、源码获取
点赞、收藏、关注、评论啦。
联系即送开题报告和任务书,欢迎咨询