基于java+springboot+vue的医疗报销系统

本文介绍了一个医疗报销系统,该系统采用B/S三层结构,使用MySQL数据库和Vue技术。系统分为管理员和用户两个权限级别,管理员可管理用户信息、公告和交互,用户则能查看报销单和公告。系统解决了传统手工处理报销单的效率问题,提供数据查询和管理的便利性,具有高性价比。
摘要由CSDN通过智能技术生成

项目介绍

传统信息的管理大部分依赖于管理人员的手工登记与管理,然而,随着近些年信息技术的迅猛发展,让许多比较老套的信息管理模式进行了更新迭代,报销单信息因为其管理内容繁杂,管理数量繁多导致手工进行处理不能满足广大用户的需求,因此就应运而生出相应的医疗报销系统。

本医疗报销系统分为管理员还有用户两个权限,管理员可以管理用户的基本信息内容,可以管理公告信息以及公告的租赁信息,能够与用户进行相互交流等操作,用户可以查看报销单信息,可以查看公告以及查看管理员回复信息等操作。

该医疗报销系统采用的是WEB应用程序开发中最受欢迎的B/S三层结构模式,使用占用空间小但功能齐全的MySQL数据库进行数据的存储操作,系统开发技术使用到了Vue技术。该医疗报销系统能够解决许多传统手工操作的难题,比如数据查询耽误时间长,数据管理步骤繁琐等问题。总的来说,医疗报销系统性能稳定,功能较全,投入运行使用性价比很高。

在这里插入图片描述

开发环境

编程语言:Java
数据库 :Mysql
系统架构:B/S
后端框架:SpringBoot
编译工具:idea或者eclipse,jdk1.8,maven
支持定做:java/php/python/android/小程序vue/爬虫/c#/asp.net

系统实现

5.1 管理员功能模块的实现
5.1.1 报销单列表
如图5.1显示的就是报销单列表页面,此页面提供给管理员的功能有:查看报销单、新增报销单、修改报销单、删除报销单等。
在这里插入图片描述

图5.1 报销单列表页面

5.1.2 公告信息管理
管理员可以对前台的注册用户的基本信息进行管理,可以设置注册用户的账号为冻结或者是在用状态,管理员也能选择很多个已经失效的注册用户的信息进行批量删除操作。注册用户管理界面如图5.2所示。
在这里插入图片描述

图5.2 公告信息管理页面

5.1.3 公告类型管理
公告类型管理页面显示所有公告类型,在此页面既可以让管理员添加新的公告信息类型,也能对已有的公告类型信息执行编辑更新,失效的公告类型信息也能让管理员快速删除。下图就是公告类型管理页面。公告类型管理界面如图5.3所示。
在这里插入图片描述

图5.3公告类型管理界面

核心代码

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);

    @Autowired
    private LingdaoService lingdaoService;


    @Autowired
    private TokenService tokenService;
    @Autowired
    private DictionaryService dictionaryService;

    //级联表service

    @Autowired
    private CaikuaiService caikuaiService;
    @Autowired
    private 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转view
            LingdaoView 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转view
            LingdaoView 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("退出成功");
    }





}

论文参考

在这里插入图片描述

目 录
摘 要 I
Abstract II
目 录 III
第一章 课题背景及研究内容 1
1.1 课题背景 1
1.2 开发目的和意义 1
1.3 论文研究内容 1
第二章 相关技术 3
2.1 B/S结构 3
2.2 MySQL数据库 3
第三章 系统分析 5
3.1可行性分析 5
3.1.1时间可行性 5
3.1.2 经济可行性 5
3.1.3 操作可行性 5
3.1.4 技术可行性 5
3.1.5 法律可行性 5
3.2系统流程分析 6
3.3系统功能需求分析 7
3.4 系统非功能需求分析 7
第四章 系统设计 9
4.1 总体功能 9
4.2 系统模块设计 9
4.3 数据库设计 10
4.3.1 数据库设计 10
4.3.2 数据库E-R 图 10
4.3.3 数据库表设计 11
第五章 系统实现 12
5.1 管理员功能模块的实现 12
5.1.1 报销单列表 12
5.1.2 公告信息管理 12
5.1.3 公告类型管理 12
第六章 系统测试 14
6.1软件测试 14
6.2测试环境 14
6.3 测试用例 14
6.3.1 用户登录测试 14
6.4.2 添加公告类别测试 15
6.5测试结果 15
结 论 16
参考文献 17
致 谢 18

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值