Java项目:医院管理系统(java+SSM+JSP+bootstrap+jQuery+mysql)

news/2024/7/10 23:39:40 标签: bootstrap, java, jquery, ssm, mysql

源码获取:博客首页 "资源" 里下载!

项目介绍

医院管理系统,主要分为管理员与普通员工两种角色;
管理员主要功能包括:
通知管理、员工管理、请假管理、考勤管理、招聘管理、部门管理、工资管理、系统管理:角色管理、用户管理、菜单管理;
普通员工主要功能包括:
通知管理、请假管理、考勤管理;


环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.是否Maven项目: 否;查看源码目录中是否包含pom.xml;
若包含,则为maven项目,否则为非maven项目 
6.数据库:MySql 5.7版本;


技术栈

1. 后端:Spring SpringMVC MyBatis
2. 前端:JSP+bootstrap+jQuery


使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行;
3. 将项目中applicationContext.xml配置文件中的数据库配置改为自己的配置;
4. 运行项目,输入localhost:8080/yygl 登录 注:tomcat中配置的路径必须为/yygl,否则会引起错误;

 

 

 

 

 

 

医生管理控制层:

@Controller
public class DoctorController {
    @Autowired
    DoctorService doctorService;
    @Autowired
    AppointmentService appointmentService;
    @Autowired
    PatientService patientService;
    @Autowired
    DrugsService drugsService;
    @Autowired
    HospitalizationService hospitalizationService;
    @Autowired
    MedicalhistoryService medicalhistoryService;
    @RequestMapping("/admin/doctorManage")
    public String doctorManage(HttpServletRequest request,@RequestParam(value="name",required = false) String name,@RequestParam(value="certId",required = false) String certId){
        request.setAttribute("doctors",doctorService.getAllDoctor(name,certId));
        return "admin/doctorManage";
    }
    @RequestMapping(value = "/admin/doctor/{id}",method = RequestMethod.DELETE)
    @ResponseBody
    public JSONObject delDoctor(@PathVariable Integer id){
        JSONObject json=new JSONObject();
        json.put("message",doctorService.delDoctor(id));
        return json;
    }
    @RequestMapping(value = "/admin/doctor/{id}",method = RequestMethod.GET)
    public String doctorInfo(@PathVariable Integer id,HttpServletRequest request){
        request.setAttribute("doctor",doctorService.getDoctor(id));
        return "admin/info/doctorinfo";
    }
    @RequestMapping(value = "/admin/doctor",method = RequestMethod.POST)
    @ResponseBody
    public JSONObject AddDoctor(@RequestBody Doctor doctor){
        JSONObject json=new JSONObject();
        json.put("message",doctorService.addDoctor(doctor));
        return json;
    }
    @RequestMapping(value = "/admin/doctor",method = RequestMethod.PUT)
    @ResponseBody
    public JSONObject updateDoctor(@RequestBody Doctor doctor){
        JSONObject json=new JSONObject();
        json.put("message",doctorService.upDoctor(doctor));
        return json;
    }
    @RequestMapping("/admin/doctorAdd")
    public String doctorAddPage(){
        return "admin/add/doctoradd";
    }

    @RequestMapping("/doctor/seekMedicalAdvice")
    public String seekMedicalAdvice(HttpServletRequest request, HttpSession session,@RequestParam(value = "patientname",required = false)String patientname,@RequestParam(value = "time",required = false)String time){
        Login login=(Login)session.getAttribute("login");
        Doctor doctor=doctorService.getDoctorByLoginId(login.getId());
        request.setAttribute("appointments" ,appointmentService.selectByDoctorId(doctor.getId(),patientname,time));
        return "doctor/seekMedicalAdvice";
    }
    @RequestMapping("/doctor/seek/{id}")
    public String seek(@PathVariable Integer id,HttpServletRequest request){
        request.setAttribute("patient",patientService.getPatient(id));
        request.setAttribute("drugs",drugsService.getAllDrugs());
        return "doctor/seek";
    }
    @RequestMapping(value = "/doctor/drug",method = RequestMethod.PUT)
    @ResponseBody
    public JSONObject drug(@RequestBody Map map){
        JSONObject json=new JSONObject();
        Patient patient=new Patient();
        System.out.println(map);
        patient.setDrugsids(DrugsUtils.vaild(map));
        patient.setId(Integer.parseInt((String)map.get("patientid")));
        json.put("message",patientService.seek(patient));
        return json;
    }
    @RequestMapping(value = "/doctor/zation",method = RequestMethod.POST)
    @ResponseBody
    public JSONObject zation(@RequestBody Hospitalization hospitalization){
        JSONObject json=new JSONObject();
        json.put("message",hospitalizationService.AddHospitalization(hospitalization));
        return json;
    }
    @RequestMapping(value = "/doctor/medicalhistory/{id}")
    public String medicalhistory(@PathVariable Integer id,HttpServletRequest request){
        request.setAttribute("medicalhistorys",medicalhistoryService.getMedicalhistoryByPatientId(id));
        return "doctor/medicalhistory";
    }

    @RequestMapping( value = "/doctor/{department}",method = RequestMethod.GET)
    @ResponseBody
    public JSONObject getDoctorByDepartment(@PathVariable String department){
        JSONObject json=new JSONObject();
        json.put("doctors",doctorService.getDoctorByDepartment(department));
        return json;
    }

}

住院治疗管理控制层: 

@Controller
public class HospitalizationController {
    @Autowired
    HospitalizationService hospitalizationService;
    @Autowired
    PatientService patientService;
    @RequestMapping("/admin/hospitalizationManage")
    public String hospitalizationManage(HttpServletRequest request,@RequestParam(value = "patientname",required = false)String patientname,@RequestParam(value = "intime",required = false)String intime){
        request.setAttribute("hospitalizations",hospitalizationService.getAllHospitalizations(patientname,intime));
        return "admin/hospitalizationManage";
    }
    @RequestMapping("/admin/hospitalizationAdd")
    public String hospitalizationAddPage(HttpServletRequest request){
        request.setAttribute("patients",patientService.getAllPatients());
        return"admin/add/hospitalizationadd";
    }
    @RequestMapping(value = "/admin/hospitalization",method = RequestMethod.POST)
    @ResponseBody
    public JSONObject hospitalizationAdd(@RequestBody Hospitalization hospitalization){
        JSONObject json=new JSONObject();
        json.put("message",hospitalizationService.AddHospitalization(hospitalization));
        return json;
    }
    @RequestMapping(value = "/admin/hospitalization/{id}",method = RequestMethod.DELETE)
    @ResponseBody
    public JSONObject delHospitalization(@PathVariable Integer id){
        JSONObject json=new JSONObject();
        json.put("message",hospitalizationService.deleteHospitalization(id));
        return json;
    }
    @RequestMapping(value = "/admin/hospitalization/{id}",method = RequestMethod.GET)
    public String hospitalizationInfo(HttpServletRequest request,@PathVariable Integer id){
        request.setAttribute("h",hospitalizationService.getHospitalization(id));
        request.setAttribute("patients",patientService.getAllPatients());
        return"admin/info/hospitalizationinfo";
    }
    @RequestMapping(value = "/admin/hospitalization",method = RequestMethod.PUT)
    @ResponseBody
    public JSONObject delHospitalization(@RequestBody Hospitalization hospitalization){
        JSONObject json=new JSONObject();
        json.put("message",hospitalizationService.updateHospitalization(hospitalization));
        return json;
    }
    //生成user表excel
    @GetMapping(value = "/admin/getHospitalization")
    public String getUser(HttpServletResponse response) throws Exception{
        HSSFWorkbook workbook = new HSSFWorkbook();
        HSSFSheet sheet = workbook.createSheet("统计表");
        ExcelUtils.createTitle(workbook,sheet);
        List<Hospitalization> rows = hospitalizationService.getAllHospitalizations();

        //设置日期格式
        HSSFCellStyle style = workbook.createCellStyle();
        style.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy h:mm"));

        //新增数据行,并且设置单元格数据
        int rowNum=1;
        for(Hospitalization hospitalization:rows){
            HSSFRow row = sheet.createRow(rowNum);
            row.createCell(0).setCellValue(rowNum);
            row.createCell(1).setCellValue(hospitalization.getFloor());
            row.createCell(2).setCellValue(hospitalization.getBed());
            row.createCell(3).setCellValue(hospitalization.getDoor());
            row.createCell(4).setCellValue(hospitalization.getMedicalname());
            row.createCell(5).setCellValue(hospitalization.getPatientname());
            HSSFCell cell1 = row.createCell(6);
            HSSFCell cell2 = row.createCell(7);
            cell1.setCellValue(hospitalization.getIntime());
            cell2.setCellValue(hospitalization.getOuttime());
            cell1.setCellStyle(style);
            cell2.setCellStyle(style);
            rowNum++;
        }

        String fileName = "住院信息.xls";

        //生成excel文件
        //ExcelUtils.buildExcelFile(fileName, workbook);

        //浏览器下载excel
        ExcelUtils.buildExcelDocument(fileName,workbook,response);

        return "download excel";
    }
}

药品管理控制层:

@Controller
public class DrugsController {
    @Autowired
    DrugsService drugsService;
    @RequestMapping("admin/drugsManage")
    public String drugsManage(HttpServletRequest request,@RequestParam(value="name",required = false) String name,@RequestParam(value="type",required = false) Integer type){
        Drugs drugs=new Drugs();
        drugs.setName(name);
        drugs.setType(type);
        request.setAttribute("drugs",drugsService.getAllDrugs(drugs));
        return "/admin/drugsManage";
    }
    @RequestMapping(value = "/admin/drug/{id}",method = RequestMethod.DELETE)
    @ResponseBody
    public JSONObject delDrug(@PathVariable Integer id){
        JSONObject json=new JSONObject();
        json.put("message",drugsService.delDrug(id));
        return json;
    }
    @RequestMapping(value = "/admin/drug",method = RequestMethod.POST)
    @ResponseBody
    public JSONObject addDrug(@RequestBody Drugs drugs){
        JSONObject json=new JSONObject();
        json.put("message",drugsService.addDrug(drugs));
        return json;
    }
    @RequestMapping("/admin/drugAdd")
    public String drugAddPage(){
        return  "/admin/add/drugadd";
    }
    @RequestMapping(value = "/admin/drug/{id}",method = RequestMethod.GET)
    public String drugInfo(HttpServletRequest request,@PathVariable Integer id) {
        request.setAttribute("drug",drugsService.getDrug(id));
        return  "/admin/info/drugsinfo";
    }
    @RequestMapping(value = "/admin/drug",method = RequestMethod.PUT)
    @ResponseBody
    public JSONObject updateDrug(@RequestBody Drugs drugs) {
        JSONObject json=new JSONObject();
        json.put("message",drugsService.updateDrug(drugs));
        return  json;
    }
}

 源码获取:博客首页 "资源" 里下载!


http://www.niftyadmin.cn/n/1553975.html

相关文章

dockerfile如何运行镜像内的脚本_.NET CORE IN DOCKER 在容器内编译并发布

Docker可以说是现在微服务&#xff0c;DevOps的基础&#xff0c;咱们.Net Core自然也得上Docker。.Net Core发布到Docker容器的教程网上也有不少&#xff0c;但是今天还是想来写一写。 你搜.Net core程序发布到Docker网上一般常见的有两种方案&#xff1a;1、在本地编译成Dll文…

Java项目:茶叶溯源系统(java+SSM+JSP+bootstrap+layUI+mysql)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 项目介绍 茶叶溯源系统&#xff0c;分为前台与后台。普通用户可在前台通过18位的编码查询茶叶的出售历史。 后台分为两种角色&#xff0c;管理员与经销商&#xff1b; 管理员主要功能包括&#xff1a; 主界…

服务器群集 虚拟化,Server Clustering on Virtualization一种虚拟化的服务器集群模型

摘要&#xff1a;With the rapid development of the economic and electronic commerce, the exchanging times between the enterprises and users is increasing as geometric series. However, the utilization rate of enterprise servers is only 15% to 30%. This paper…

Java项目:美食论坛系统(java+SSM+JSP+jQuery+LayUI+mysql)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 项目介绍 该项目主要分为前台与后台&#xff1b; 前台主要功能包括&#xff1a; 登录、注册&#xff1b;首页、我发表的贴子、意见建议&#xff1b;版块列表、帖子查看、发贴回贴等&#xff1b; 普通用户登…

分类超参数 详解_施工小白搞不定钢筋?钢筋工程基础培训及图集详解,图文逐步对照...

施工小白搞不定钢筋&#xff1f;钢筋工程基础培训及图集详解&#xff0c;图文逐步对照在一个建筑工程项目中&#xff0c;钢筋工程是基础而又重要的组成部分。但在施工过程中&#xff0c;钢筋作用大&#xff0c;涉及到的内容复杂多样&#xff0c;应用方法也各不相同。对于施工经…

Java项目:校园二手交易平台(java+SSM+Thymeleaf+Html+jQuery+mysql)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 项目介绍 本次设计的是一个校园二手交易平台&#xff08;C2C&#xff09;&#xff0c;C2C指个人与个人之间的电子商务&#xff0c;买家可以查看所有卖家发布的商品&#xff0c;并且根据分类进行商品过滤&am…

虚拟手游服务器,自己搭建手机游戏服务器

自己搭建手机游戏服务器 内容精选换一换本文介绍了云手机CPH产品新特性和对应的文档动态&#xff0c;新特性将在各个区域(Region)陆续发布&#xff0c;欢迎体验。部署游戏应用前&#xff0c;您需要准备硬件以及华为云的环境&#xff0c;主要包括以下内容&#xff1a;硬件环境&a…

r包调用legend函数_R语言pec包深度验证Cox模型

01研究背景在cox回归中&#xff0c;如何利用已经构建好的预测模型预测单个患者的生存概率呢&#xff1f;R中的pec包中predictSurvProb()函数可以利用cph()拟合的模型计算验证集中患者在不同时间节点的生存概率。其次该包还能在验证集中计算不同时间点C-index指数&#xff0c;绘…