基于java SpringBoot的医院门诊管理系统源码和论文

 

随着社会的发展,在各行各业中,计算机的应用显得非常重要。在飞速发展的过程中,人类的生活水平得到进一步的改善。当然,人类生活水平得到改善也离不开医疗等方面。就当下的新冠肺炎病毒而言,医疗方面的管理越来越得到国家的重视,政府在医疗方面投入了巨大的人力、财力和物力。因此,各个医院也产生巨大的信息,各个医院要处理好这些信息,单靠手工管理是很难管理的。各个医院也逐步借助计算机来管理这些信息。

首先,对医院门诊管理系统进行研究和分析。然后,采用SpringBoot框架、Bootstrap框架、MyBatis框架、Jquery等方面的技术开发系统的后端和前端。在数据存储方面,采用了MySQL数据库技术。并采用UML面向对象分析和设计技术来完成了系统的建模。最后,开发一个基于SpringBoot的医院门诊管理系统的设计与实现的系统,该系统能帮助医院处理好巨大的信息,同时也方便患者看病,也让医院工作人员的办事效率得到进一步的提高。

关键词:门诊管理系统  SpringBoot  Bootstrap  MyBatis   HTML

【506】基于java SpringBoot的医院门诊管理系统源码

ABSTRACT

With the development of society, the application of computers is very important in all walks of life. In the process of rapid development, human living standards have been further improved. Of course, improving human living standards is also inseparable from medical treatment. As far as the current new Pneumococcal pneumonia virus is concerned, the management of medical treatment has received more and more attention from the state. The government has invested huge human, financial and material resources in medical treatment. Therefore, each hospital also generates huge information. It is difficult for each hospital to manage this information by manual management alone. Various hospitals are gradually using computers to manage this information.

First, research and analyze the outpatient management of the Second Hospital of Zhanjiang Nongken, Guangdong Province. Then, adopt the technology of SpringBoot framework, MyBatis framework, Bootstrap framework, Jquery and other aspects to develop the back-end and front-end of the system. In terms of data storage, MySQL database technology is used. And using UML object-oriented analysis and design technology to complete the system modeling. Finally, develop a system based on SpringBoot for the design and implementation of the outpatient management system of the Second Hospital of Zhanjiang Agricultural Reclamation in Guangdong Province. Further improvement.

Keywords:Outpatient Management System  SpringBoot  Bootstrap  MyBatis  

package com.zws.mzglxt.controller.ghsfc;
import com.baidu.aip.ocr.AipOcr;
import com.zws.mzglxt.po.Count;
import com.zws.mzglxt.po.JiBieAndGuaHaoFei;
import com.zws.mzglxt.po.KeShi;
import com.zws.mzglxt.po.YongHu;
import com.zws.mzglxt.po.ghsfc.BingLi;
import com.zws.mzglxt.po.ghsfc.BingRenAndYongHu;
import com.zws.mzglxt.po.ghsfc.BingRenAndYongHu2;
import com.zws.mzglxt.po.ghsfc.KeShiAndYiShengYH;
import com.zws.mzglxt.service.ghsfc.PtmzghService;
import com.zws.mzglxt.utils.*;
import org.json.JSONObject;
import org.springframework.data.relational.core.sql.In;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.*;

//普通门诊挂号查询
@Controller
public class PtmzghController {
    @Resource
    PtmzghService ptmzghService;
//    病人查询
    @RequestMapping("/ghsfc/ptmzghs")
    public String findAllBingRenAndYongHu(@RequestParam(defaultValue = "1")Integer page, @RequestParam(defaultValue = "10")Integer rows, Model model){
        PageResult<BingRenAndYongHu> result=ptmzghService.findAllBingRenAndYongHu(page,rows);
        model.addAttribute("result",result);
        return "ghsfc/ptmzgh/ptmzgh";
    }
//    按条件查询病人
    @PostMapping("/check/ghsfc/ptmzgh/xmanddhhmandsfzh")
    @ResponseBody
    public PageResult<BingRenAndYongHu2> findBingRenAndYongHu2ByXmAndDhhmAndSfzh(@RequestBody BingRenAndYongHu2 bingRenAndYongHu2, @RequestParam(defaultValue = "10")Integer rows){
        System.out.println(bingRenAndYongHu2);
        PageResult<BingRenAndYongHu2> result=ptmzghService.findBingRenAndYongHu2ByXmAndDhhmAndSfzh(bingRenAndYongHu2,bingRenAndYongHu2.getPage(),rows);
        System.out.println(result);
        return result;
    }

//  来到添加普通门诊的界面
    @GetMapping("/ghsfc/ptmzgh")
    public String toAddKeShi(){
        return "ghsfc/ptmzgh/addptmzgh";
    }
//   身份证识别
    @RequestMapping(value = "/idCard",method = RequestMethod.POST)
    @ResponseBody
    public Map<String,Object> idCard(@RequestParam("file_idcard") MultipartFile[] fileArr) throws Exception{
        String key = "pk";
        MultipartFile mf1 = fileArr[0];
        MultipartFile mf2 = fileArr[1];
        byte[] by1 = mf1.getBytes();
        byte[] by2 = mf2.getBytes();
        AipOcr client1 = new AipOcr("19619286","3CjnxiIUZeS6cV7qhBywIlc1","WDCRQ4a780FkESPGoNVyWs2o9dodXZmI");
        JSONObject jo_fr = client1.idcard(by1,"front",new HashMap<>());    //正面
        System.out.println("正面:" + jo_fr);
        AipOcr client2 = new AipOcr("19619286","3CjnxiIUZeS6cV7qhBywIlc1","WDCRQ4a780FkESPGoNVyWs2o9dodXZmI");
        JSONObject jo_ba = client2.idcard(by2,"back",new HashMap<>());     //背面
        System.out.println("背面:" + jo_ba);
        Map<String,Object> map = new HashMap<>();
        map.put("front", JSONChange.json2map(jo_fr.toString()));
        map.put("back",JSONChange.json2map(jo_ba.toString()));
        System.out.println(map.toString());
        return map;
    }
//  检查用户名和身份证号是否存在
    @PostMapping("/check/ghsfc/ptmzgh/dhhmandsfzh")
    @ResponseBody
    public List<String> findYhmAndSfzh(@RequestBody Map<String,String> map){
        List<String> list=new ArrayList<String>();
        YongHu yongHu=ptmzghService.checkYongHuByYhm(map);
        BingRenAndYongHu bingRenAndYongHu=ptmzghService.checkBingRenBySfzh(map);
        if(yongHu!=null){
            list.add("1");
        }else {
            list.add("0");
        }
        if(bingRenAndYongHu!=null){
            list.add("1");
        }else {
            list.add("0");
        }
        return list;
    }
//添加病人操作
    @PostMapping("/ghsfc/ptmzgh")
    @Transactional
    public String addPtmzgh(BingRenAndYongHu bingRenAndYongHu, Model model){
        try {
            int flag = ptmzghService.addYongHu(bingRenAndYongHu);
            int flag1 = ptmzghService.addBingRen(bingRenAndYongHu);
//            启动短信功能
           // SendMessageUtil.send("135246张伟森","d41d8cd98f00b204e980",""+bingRenAndYongHu.getDhhm(),"注册的用户名:"+bingRenAndYongHu.getDhhm()+",密码:123456");
        }catch (Exception e){
            e.printStackTrace();
            model.addAttribute("msg","操作失败,请重新操作!");
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            return "ghsfc/ptmzgh/addptmzgh";
        }
        /*int flag=keShiService.addKeShi(keShi);
        System.out.println(flag);
        if(flag==0){
            model.addAttribute("msg","科室编号"+keShi.getKsbh()+":添加失败!");
        }else{
            model.addAttribute("msg","科室编号"+keShi.getKsbh()+":添加成功!");
        }*/
        return "ghsfc/ptmzgh/addptmzgh";
    }


// 来到添加病历的界面
    @GetMapping("/ghsfc/ptmzgh/{id}")
    public String toAddBingLi(@PathVariable("id") Integer id,Model model){
        List<KeShi> keShis=ptmzghService.findAllKeShi();
        String dateTime=MyDate.getDateTime();
        String mzbh;
        String[] str=dateTime.split("-");
        Count count=ptmzghService.countBingLiByTjsj(dateTime.substring(0,10));
        count.setCount(count.getCount()+1);
        if((count.getCount()+"").length()==1){
            model.addAttribute("mzbh",str[0]+str[1]+str[2].substring(0,2)+"000"+count.getCount());
        }else if((count.getCount()+"").length()==2){
            model.addAttribute("mzbh",str[0]+str[1]+str[2].substring(0,2)+"00"+count.getCount());
        }else if((count.getCount()+"").length()==3){
            model.addAttribute("mzbh",str[0]+str[1]+str[2].substring(0,2)+"0"+count.getCount());
        }else if((count.getCount()+"").length()==4){
            model.addAttribute("mzbh",str[0]+str[1]+str[2].substring(0,2)+count.getCount());
        }
        model.addAttribute("id",id);
        model.addAttribute("tjsj",dateTime);
        model.addAttribute("keShis",keShis);
        return "ghsfc/ptmzgh/addbingli";
    }
//    不断刷新门诊编号
    @PostMapping("/check/ghsfc/smzbh")
    @ResponseBody
    public String checkMzbh(){
        String dateTime=MyDate.getDateTime();
        String mzbh="还没获取门诊编号";
        String[] str=dateTime.split("-");
        Count count=ptmzghService.countBingLiByTjsj(dateTime.substring(0,10));
        count.setCount(count.getCount()+1);
        if((count.getCount()+"").length()==1){
            mzbh=str[0]+str[1]+str[2].substring(0,2)+"000"+count.getCount();
        }else if((count.getCount()+"").length()==2){
            mzbh=str[0]+str[1]+str[2].substring(0,2)+"00"+count.getCount();
        }else if((count.getCount()+"").length()==3){
            mzbh=str[0]+str[1]+str[2].substring(0,2)+"0"+count.getCount();
        }else if((count.getCount()+"").length()==4){
            mzbh=str[0]+str[1]+str[2].substring(0,2)+count.getCount();
        }
        return mzbh;
    }
//    查看与科室名称相关的医生
    @PostMapping("/check/ghsfc/sksmc/{ksmc}")
    @ResponseBody
    public KeShiAndYiShengYH checkKeShiAndYiShengYHByKsmc(@PathVariable("ksmc") String ksmc){
        Count count=ptmzghService.countKeShiAndYiShengYHByKsmc(ksmc);
        Integer count1= MyRandom.getRandom(count.getCount());
        List<KeShiAndYiShengYH> keShiAndYiShengYHS=ptmzghService.checkKeShiAndYiShengYHByKsmc(ksmc);
        KeShiAndYiShengYH keShiAndYiShengYH=keShiAndYiShengYHS.get(count1);
        return keShiAndYiShengYH;
    }
//    添加病历
    @PutMapping("/ghsfc/ptmzgh")
    public String addBingLi(BingLi bingLi, Model model){
        List<KeShi> keShis=ptmzghService.findAllKeShi();
        String dateTime=MyDate.getDateTime();
        try {
            int flag=ptmzghService.addBingLi(bingLi);
            System.out.println(bingLi);
        }catch (Exception e){
            model.addAttribute("tjsj",dateTime);
            model.addAttribute("id",bingLi.getBingren_id());
            model.addAttribute("keShis",keShis);
            model.addAttribute("msg","操作失败,请重新操作!");
            return "ghsfc/ptmzgh/addbingli";
        }
        return "redirect:/ghsfc/ptmzghs";
    }

}

 

package com.zws.mzglxt.controller.ghsfc;

import com.baidu.aip.ocr.AipOcr;
import com.zws.mzglxt.po.Count;
import com.zws.mzglxt.po.KeShi;
import com.zws.mzglxt.po.YongHu;
import com.zws.mzglxt.po.ghsfc.BingLi;
import com.zws.mzglxt.po.ghsfc.BingRenAndYongHu;
import com.zws.mzglxt.po.ghsfc.BingRenAndYongHu2;
import com.zws.mzglxt.po.ghsfc.KeShiAndYiShengYH;
import com.zws.mzglxt.service.ghsfc.ZjmzghService;
import com.zws.mzglxt.utils.*;
import org.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

//专家门诊挂号
@Controller
public class ZjmzghController {
    @Resource
    ZjmzghService zjmzghService;
    //    病人查询
    @RequestMapping("/ghsfc/zjmzghs")
    public String findAllBingRenAndYongHu(@RequestParam(defaultValue = "1")Integer page, @RequestParam(defaultValue = "10")Integer rows, Model model){
        PageResult<BingRenAndYongHu> result=zjmzghService.findAllBingRenAndYongHu(page,rows);
        model.addAttribute("result",result);
        return "ghsfc/zjmzgh/zjmzgh";
    }

// 按条件查询病人
    @PostMapping("/check/ghsfc/zjmzgh/xmanddhhmandsfzh")
    @ResponseBody
    public PageResult<BingRenAndYongHu2> findBingRenAndYongHu2ByXmAndDhhmAndSfzh(@RequestBody BingRenAndYongHu2 bingRenAndYongHu2, @RequestParam(defaultValue = "10")Integer rows){
        PageResult<BingRenAndYongHu2> result=zjmzghService.findBingRenAndYongHu2ByXmAndDhhmAndSfzh(bingRenAndYongHu2,bingRenAndYongHu2.getPage(),rows);
        System.out.println(result);
        return result;
    }
//      来到添加专家门诊的界面
    @GetMapping("/ghsfc/zjmzgh")
    public String toAddKeShi(){
        return "ghsfc/zjmzgh/addzjmzgh";
    }
// 身份证识别
    @RequestMapping(value = "/zjidCard",method = RequestMethod.POST)
    @ResponseBody
    public Map<String,Object> idCard(@RequestParam("file_idcard") MultipartFile[] fileArr) throws Exception{
        String key = "pk";
        MultipartFile mf1 = fileArr[0];
        MultipartFile mf2 = fileArr[1];
        byte[] by1 = mf1.getBytes();
        byte[] by2 = mf2.getBytes();
        AipOcr client1 = new AipOcr("19619286","3CjnxiIUZeS6cV7qhBywIlc1","WDCRQ4a780FkESPGoNVyWs2o9dodXZmI");
        JSONObject jo_fr = client1.idcard(by1,"front",new HashMap<>());    //正面
        System.out.println("正面:" + jo_fr);
        AipOcr client2 = new AipOcr("19619286","3CjnxiIUZeS6cV7qhBywIlc1","WDCRQ4a780FkESPGoNVyWs2o9dodXZmI");
        JSONObject jo_ba = client2.idcard(by2,"back",new HashMap<>());     //背面
        System.out.println("背面:" + jo_ba);
        Map<String,Object> map = new HashMap<>();
        map.put("front", JSONChange.json2map(jo_fr.toString()));
        map.put("back",JSONChange.json2map(jo_ba.toString()));
        System.out.println(map.toString());
        return map;
    }
// 检查用户名和身份证号是否存在
    @PostMapping("/check/ghsfc/zjmzgh/dhhmandsfzh")
    @ResponseBody
    public List<String> findYhmAndSfzh(@RequestBody Map<String,String> map){
        List<String> list=new ArrayList<String>();
        YongHu yongHu=zjmzghService.checkYongHuByYhm(map);
        BingRenAndYongHu bingRenAndYongHu=zjmzghService.checkBingRenBySfzh(map);
        if(yongHu!=null){
            list.add("1");
        }else {
            list.add("0");
        }
        if(bingRenAndYongHu!=null){
            list.add("1");
        }else {
            list.add("0");
        }
        return list;
    }
//    添加病人操作
    @PostMapping("/ghsfc/zjmzgh")
    @Transactional
    public String addPtmzgh(BingRenAndYongHu bingRenAndYongHu, Model model){
        try {
            int flag = zjmzghService.addYongHu(bingRenAndYongHu);
            int flag1 = zjmzghService.addBingRen(bingRenAndYongHu);
//            启动短信功能
            SendMessageUtil.send("135246张伟森","d41d8cd98f00b204e980",""+bingRenAndYongHu.getDhhm(),"注册的用户名:"+bingRenAndYongHu.getDhhm()+",密码:123456");
        }catch (Exception e){
            model.addAttribute("msg","操作失败,请重新操作!");
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            return "ghsfc/zjmzgh/addzjmzgh";
        }
        /*int flag=keShiService.addKeShi(keShi);
        System.out.println(flag);
        if(flag==0){
            model.addAttribute("msg","科室编号"+keShi.getKsbh()+":添加失败!");
        }else{
            model.addAttribute("msg","科室编号"+keShi.getKsbh()+":添加成功!");
        }*/
        return "ghsfc/zjmzgh/addzjmzgh";
    }


    // 来到添加病历的界面
    @GetMapping("/ghsfc/zjmzgh/{id}")
    public String toAddBingLi(@PathVariable("id") Integer id,Model model){
        List<KeShi> keShis=zjmzghService.findAllKeShi();
        String dateTime= MyDate.getDateTime();
        String mzbh;
        String[] str=dateTime.split("-");
        Count count=zjmzghService.countBingLiByTjsj(dateTime.substring(0,10));
        count.setCount(count.getCount()+1);
        if((count.getCount()+"").length()==1){
            model.addAttribute("mzbh",str[0]+str[1]+str[2].substring(0,2)+"000"+count.getCount());
        }else if((count.getCount()+"").length()==2){
            model.addAttribute("mzbh",str[0]+str[1]+str[2].substring(0,2)+"00"+count.getCount());
        }else if((count.getCount()+"").length()==3){
            model.addAttribute("mzbh",str[0]+str[1]+str[2].substring(0,2)+"0"+count.getCount());
        }else if((count.getCount()+"").length()==4){
            model.addAttribute("mzbh",str[0]+str[1]+str[2].substring(0,2)+count.getCount());
        }
        model.addAttribute("id",id);
        model.addAttribute("tjsj",dateTime);
        model.addAttribute("keShis",keShis);
        return "ghsfc/zjmzgh/addbingli";
    }
//  不断刷新门诊编号
    @PostMapping("/check/ghsfc/szjmzbh")
    @ResponseBody
    public String checkMzbh(){
        String dateTime=MyDate.getDateTime();
        String mzbh="还没获取门诊编号";
        String[] str=dateTime.split("-");
        Count count=zjmzghService.countBingLiByTjsj(dateTime.substring(0,10));
        count.setCount(count.getCount()+1);
        if((count.getCount()+"").length()==1){
            mzbh=str[0]+str[1]+str[2].substring(0,2)+"000"+count.getCount();
        }else if((count.getCount()+"").length()==2){
            mzbh=str[0]+str[1]+str[2].substring(0,2)+"00"+count.getCount();
        }else if((count.getCount()+"").length()==3){
            mzbh=str[0]+str[1]+str[2].substring(0,2)+"0"+count.getCount();
        }else if((count.getCount()+"").length()==4){
            mzbh=str[0]+str[1]+str[2].substring(0,2)+count.getCount();
        }
        return mzbh;
    }
//  查看与科室名称相关的医生
    @PostMapping("/check/ghsfc/szjksmc/{ksmc}")
    @ResponseBody
    public KeShiAndYiShengYH checkKeShiAndYiShengYHByKsmc(@PathVariable("ksmc") String ksmc){
        Count count=zjmzghService.countKeShiAndYiShengYHByKsmc(ksmc);
        Integer count1= MyRandom.getRandom(count.getCount());
        List<KeShiAndYiShengYH> keShiAndYiShengYHS=zjmzghService.checkKeShiAndYiShengYHByKsmc(ksmc);
        KeShiAndYiShengYH keShiAndYiShengYH=keShiAndYiShengYHS.get(count1);
        return keShiAndYiShengYH;
    }
//  添加病历
    @PutMapping("/ghsfc/zjmzgh")
    public String addBingLi(BingLi bingLi, Model model){
        List<KeShi> keShis=zjmzghService.findAllKeShi();
        String dateTime=MyDate.getDateTime();
        try {
            int flag=zjmzghService.addBingLi(bingLi);
            System.out.println(bingLi);
        }catch (Exception e){
            model.addAttribute("tjsj",dateTime);
            model.addAttribute("id",bingLi.getBingren_id());
            model.addAttribute("keShis",keShis);
            model.addAttribute("msg","操作失败,请重新操作!");
            return "ghsfc/zjmzgh/addbingli";
        }
        return "redirect:/ghsfc/zjmzghs";
    }
}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序猿毕业分享网

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值