千家信息网

医疗挂号系统web开发的方法

发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,今天小编给大家分享一下医疗挂号系统web开发的方法的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来
千家信息网最后更新 2026年11月02日医疗挂号系统web开发的方法

今天小编给大家分享一下医疗挂号系统web开发的方法的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。

一、医院接口

本文开发分布式医疗挂号系统,进入到医院信息、科室、排版接口的开发,内容比较枯燥。

查询医院接口

Controller层:

 @PostMapping("hospital/show")    public Result getHospital(HttpServletRequest request) {        // 1.将从医院管理表传递过来的医院信息转换为Object类型        Map requestMap = request.getParameterMap();        Map paramMap = HttpRequestHelper.switchMap(requestMap);        // 2.获取医院管理表中的密钥(已经使用MD5加密好了)        String hospSign = (String) paramMap.get("sign");        // 3.获取医院设置表中的密钥并进行MD5加密        String hoscode = (String) paramMap.get("hoscode");        String signKey = hospitalSetService.getSignKey(hoscode);        String signKeyMd5 = MD5.encrypt(signKey);        // 4.密钥不匹配就抛出错误        if (!hospSign.equals(signKeyMd5)) {            throw new YyghException(ResultCodeEnum.SIGN_ERROR);        }        // 5.执行查询操作        Hospital hospital = hospitalService.getByHoscode(hoscode);        return Result.ok(hospital);    }

Service接口:

Hospital getByHoscode(String hoscode);

Service实现类:

    @Override    public Hospital getByHoscode(String hoscode) {        Hospital hospital = hospitalRepository.getHospitalByHoscode(hoscode);        return hospital;    }

Repository层:

@Repositorypublic interface HospitalRepository extends MongoRepository {    /**     * 根据HosCode获得记录     * @param hoscode     * @return     */    Hospital getHospitalByHoscode(String hoscode);}

二、科室接口

(1)上传科室功能

上传科室Controller层:

 @PostMapping("saveDepartment")    public Result saveDepartment(HttpServletRequest request) {        // 1.将传递过来的数组类型转换为Object类型        Map requestMap = request.getParameterMap();        Map paramMap = HttpRequestHelper.switchMap(requestMap);        // 2.获取医院管理表中的密钥(已经使用MD5加密好了)        String hospSign = (String) paramMap.get("sign");        // 3.获取医院设置表中的密钥并进行MD5加密        String hoscode = (String) paramMap.get("hoscode");        String signKey = hospitalSetService.getSignKey(hoscode);        String signKeyMd5 = MD5.encrypt(signKey);        // 4.密钥不匹配就抛出错误        if (!hospSign.equals(signKeyMd5)) {            throw new YyghException(ResultCodeEnum.SIGN_ERROR);        }        // 5.执行上传科室操作        departmentService.save(paramMap);        return Result.ok();    }

上传科室Service接口:

void save(Map paramMap);

上传科室Service实现类:

    @Override    public void save(Map paramMap) {        // 1.把paramMap集合转换为Department对象(借助JSONObject工具)        String paramMapString = JSONObject.toJSONString(paramMap);        Department department = JSONObject.parseObject(paramMapString, Department.class);        // 2.根据医院编号和科室编号查询科室信息        Department departmentExist = departmentRepository                .getDepartmentByHoscodeAndDepcode(department.getHoscode(), department.getDepcode());        // 3.如果有就执行更新,没有就执行保存        if (null != departmentExist) {// 更新            departmentExist.setUpdateTime(new Date());            departmentExist.setIsDeleted(0);            departmentRepository.save(departmentExist);        } else {// 保存            department.setCreateTime(new Date());            department.setUpdateTime(new Date());            department.setIsDeleted(0);            departmentRepository.save(department);        }    }

Repositroy层交由Spring Data去自动完成。

(2)查询科室功能

查询科室Controller层:

 @PostMapping("department/list")    public Result findDepartment(HttpServletRequest request) {        // 1.将传递过来的科室转换为Object类型        Map requestMap = request.getParameterMap();        Map paramMap = HttpRequestHelper.switchMap(requestMap);        // 3.获取医院编号        String hoscode = (String) paramMap.get("hoscode");        // 2.获取医院管理表中的密钥(已经使用MD5加密好了)        String hospSign = (String) paramMap.get("sign");        // 当前页和每页记录数        int page = StringUtils.isEmpty(paramMap.get("page")) ? 1 : Integer.parseInt((String) paramMap.get("page"));        int limit = StringUtils.isEmpty(paramMap.get("limit")) ? 1 : Integer.parseInt((String) paramMap.get("limit"));        String signKey = hospitalSetService.getSignKey(hoscode);        String signKeyMd5 = MD5.encrypt(signKey);        // 4.密钥不匹配就抛出错误        if (!hospSign.equals(signKeyMd5)) {            throw new YyghException(ResultCodeEnum.SIGN_ERROR);        }        DepartmentQueryVo departmentQueryVo = new DepartmentQueryVo();        departmentQueryVo.setHoscode(hoscode);        // 执行查询科室操作        Page pageModel = departmentService.findPageDepartment(page, limit, departmentQueryVo);        return Result.ok(pageModel);    }

查询科室Service接口:

   Page findPageDepartment(int page, int limit, DepartmentQueryVo departmentQueryVo);

查询科室Service实现类:

    @Override    public Page findPageDepartment(int page, int limit, DepartmentQueryVo departmentQueryVo) {        // 创建Pageable对象,设置当前页和每页记录数        PageRequest pageable = PageRequest.of(page - 1, limit);        // 创建Example对象        Department department = new Department();        BeanUtils.copyProperties(departmentQueryVo, department);        department.setIsDeleted(0);        ExampleMatcher matcher = ExampleMatcher.matching()                .withStringMatcher(ExampleMatcher.StringMatcher.CONTAINING)                .withIgnoreCase(true);        Example example = Example.of(department, matcher);        Page all = departmentRepository.findAll(example, pageable);        return all;    }

Repositroy层交由Spring Data去自动完成。

(3)删除科室功能

删除科室Controller层:

 @PostMapping("department/remove")    public Result removeDepartment(HttpServletRequest request) {        // 1.将传递过来的科室转换为Object类型        Map requestMap = request.getParameterMap();        Map paramMap = HttpRequestHelper.switchMap(requestMap);        // 获取科室编号 和 医院编号        String depcode = (String) paramMap.get("depcode");        String hoscode = (String) paramMap.get("hoscode");        // 2.获取医院管理表中的密钥(已经使用MD5加密好了)        String hospSign = (String) paramMap.get("sign");        // 3.获取医院设置表中的密钥并进行MD5加密        String signKey = hospitalSetService.getSignKey(hoscode);        String signKeyMd5 = MD5.encrypt(signKey);        // 4.密钥不匹配就抛出错误        if (!hospSign.equals(signKeyMd5)) {            throw new YyghException(ResultCodeEnum.SIGN_ERROR);        }        departmentService.remove(hoscode, depcode);        return Result.ok();    }

删除科室Service接口:

@PostMapping("department/remove")    public Result removeDepartment(HttpServletRequest request) {        // 1.将传递过来的科室转换为Object类型        Map requestMap = request.getParameterMap();        Map paramMap = HttpRequestHelper.switchMap(requestMap);        // 获取科室编号 和 医院编号        String depcode = (String) paramMap.get("depcode");        String hoscode = (String) paramMap.get("hoscode");        // 2.获取医院管理表中的密钥(已经使用MD5加密好了)        String hospSign = (String) paramMap.get("sign");        // 3.获取医院设置表中的密钥并进行MD5加密        String signKey = hospitalSetService.getSignKey(hoscode);        String signKeyMd5 = MD5.encrypt(signKey);        // 4.密钥不匹配就抛出错误        if (!hospSign.equals(signKeyMd5)) {            throw new YyghException(ResultCodeEnum.SIGN_ERROR);        }        departmentService.remove(hoscode, depcode);        return Result.ok();    }

删除科室Service接口:

void remove(String hoscode, String depcode);

删除科室Service实现类:

    @Override    public void remove(String hoscode, String depcode) {        // 1.根据 医院编号 和 科室编号 查询科室信息        Department department = departmentRepository.getDepartmentByHoscodeAndDepcode(hoscode, depcode);        if (null != department) {            // 执行删除方法            departmentRepository.deleteById(department.getId());        }    }

Repositroy层交由Spring Data去自动完成。

三、排班接口

(1)上传排班功能

上传排班Controller层:

@PostMapping("saveSchedule")    public Result saveSchedule(HttpServletRequest request) {        Map requestMap = request.getParameterMap();        Map paramMap = HttpRequestHelper.switchMap(requestMap);        // 获取科室编号 和 医院编号        String hoscode = (String) paramMap.get("hoscode");        // 2.获取医院管理表中的密钥(已经使用MD5加密好了)        String hospSign = (String) paramMap.get("sign");        // 3.获取医院设置表中的密钥并进行MD5加密        String signKey = hospitalSetService.getSignKey(hoscode);        String signKeyMd5 = MD5.encrypt(signKey);        // 4.密钥不匹配就抛出错误        if (!hospSign.equals(signKeyMd5)) {            throw new YyghException(ResultCodeEnum.SIGN_ERROR);        }        // 执行上传操作        scheduleService.save(paramMap);        return Result.ok();    }

上传排班Service接口:

void save(Map paramMap);

上传排班Service实现类:

    @Override    public void save(Map paramMap) {        // 1.把paramMap集合转换为Department对象(借助JSONObject工具)        String paramMapString = JSONObject.toJSONString(paramMap);        Schedule schedule = JSONObject.parseObject(paramMapString, Schedule.class);        // 2.根据 医院编号 和 排班编号 查询科室信息        Schedule scheduleExist = scheduleRepository                .getScheduleByHoscodeAndHosScheduleId(schedule.getHoscode(), schedule.getHosScheduleId());        // 3.如果有就执行更新,没有就执行保存        if (null != scheduleExist) {// 更新            scheduleExist.setUpdateTime(new Date());            scheduleExist.setIsDeleted(0);            scheduleExist.setStatus(1);            scheduleRepository.save(scheduleExist);        } else {// 保存            schedule.setCreateTime(new Date());            schedule.setUpdateTime(new Date());            schedule.setIsDeleted(0);            schedule.setStatus(1);            scheduleRepository.save(schedule);        }    }

Repositroy层交由Spring Data去自动完成。

(2)查询排班功能

查询排班Controller层:

 @PostMapping("schedule/list")    public Result findSchedule(HttpServletRequest request) {        Map requestMap = request.getParameterMap();        Map paramMap = HttpRequestHelper.switchMap(requestMap);        // 3.获取医院编号,科室编号        String hoscode = (String) paramMap.get("hoscode");        String depcode = (String) paramMap.get("depcode");        // 2.获取医院管理表中的密钥(已经使用MD5加密好了)        String hospSign = (String) paramMap.get("sign");        // 当前页和每页记录数        int page = StringUtils.isEmpty(paramMap.get("page")) ? 1 : Integer.parseInt((String) paramMap.get("page"));        int limit = StringUtils.isEmpty(paramMap.get("limit")) ? 1 : Integer.parseInt((String) paramMap.get("limit"));        String signKey = hospitalSetService.getSignKey(hoscode);        String signKeyMd5 = MD5.encrypt(signKey);        // 4.密钥不匹配就抛出错误        if (!hospSign.equals(signKeyMd5)) {            throw new YyghException(ResultCodeEnum.SIGN_ERROR);        }        ScheduleQueryVo scheduleQueryVo = new ScheduleQueryVo();        scheduleQueryVo.setHoscode(hoscode);        scheduleQueryVo.setHoscode(depcode);        // 执行查询科室操作        Page pageModel = scheduleService.findPageSchedule(page, limit, scheduleQueryVo);        return Result.ok(pageModel);    }

查询排班Service接口:

   Page findPageSchedule(int page, int limit, ScheduleQueryVo scheduleQueryVo);

查询排班Service实现类:

 @Override    public Page findPageSchedule(int page, int limit, ScheduleQueryVo scheduleQueryVo) {        // 创建Pageable对象,设置当前页和每页记录数        PageRequest pageable = PageRequest.of(page - 1, limit);        // 创建Example对象        Schedule schedule = new Schedule();        BeanUtils.copyProperties(scheduleQueryVo, schedule);        schedule.setIsDeleted(0);        schedule.setStatus(1);        ExampleMatcher matcher = ExampleMatcher.matching()                .withStringMatcher(ExampleMatcher.StringMatcher.CONTAINING)                .withIgnoreCase(true);        Example example = Example.of(schedule, matcher);        Page all = scheduleRepository.findAll(example, pageable);        return all;    }

Repositroy层交由Spring Data去自动完成。

(3)删除排班功能

删除排班Controller层:

@PostMapping("schedule/remove")    public Result removeSchedule(HttpServletRequest request){        Map requestMap = request.getParameterMap();        Map paramMap = HttpRequestHelper.switchMap(requestMap);        // 获取医院编号和排班编号        String hoscode = (String) paramMap.get("hoscode");        String hosScheduleId = (String) paramMap.get("hosScheduleId");        // 2.获取医院管理表中的密钥(已经使用MD5加密好了)        String hospSign = (String) paramMap.get("sign");        // 3.获取医院设置表中的密钥并进行MD5加密        String signKey = hospitalSetService.getSignKey(hoscode);        String signKeyMd5 = MD5.encrypt(signKey);        // 4.密钥不匹配就抛出错误        if (!hospSign.equals(signKeyMd5)) {            throw new YyghException(ResultCodeEnum.SIGN_ERROR);        }        scheduleService.removeSchedule(hoscode, hosScheduleId);        return Result.ok();    }

删除排班Service接口:

void removeSchedule(String hoscode, String hosScheduleId);

删除排班Service实现类:

@PostMapping("schedule/remove")    public Result removeSchedule(HttpServletRequest request){        Map requestMap = request.getParameterMap();        Map paramMap = HttpRequestHelper.switchMap(requestMap);        // 获取医院编号和排班编号        String hoscode = (String) paramMap.get("hoscode");        String hosScheduleId = (String) paramMap.get("hosScheduleId");        // 2.获取医院管理表中的密钥(已经使用MD5加密好了)        String hospSign = (String) paramMap.get("sign");        // 3.获取医院设置表中的密钥并进行MD5加密        String signKey = hospitalSetService.getSignKey(hoscode);        String signKeyMd5 = MD5.encrypt(signKey);        // 4.密钥不匹配就抛出错误        if (!hospSign.equals(signKeyMd5)) {            throw new YyghException(ResultCodeEnum.SIGN_ERROR);        }        scheduleService.removeSchedule(hoscode, hosScheduleId);        return Result.ok();    }

Repositroy层交由Spring Data去自动完成。

以上就是"医疗挂号系统web开发的方法"这篇文章的所有内容,感谢各位的阅读!相信大家阅读完这篇文章都有很大的收获,小编每天都会为大家更新不同的知识,如果还想学习更多的知识,请关注行业资讯频道。

医院 科室 密钥 加密 查询 接口 管理 医院管理 错误 功能 对象 类型 信息 更新 开发 知识 篇文章 医疗 方法 系统 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 互联网科技企业 中智农互联网科技 重生之互联网科技帝国 智能科技公司是互联网公司吗 浩特互联网科技 互联网科技上市公司 友谊互联网络科技 广州紫鲸互联网科技 剑昆互联网络科技有限公司临桂 知域互联网科技有限公司大骗子 企晟互联网信息科技有限公司 世界互联网领先科技成果获奖 济南有互联网科技公司吗 徐州市互联网科技有限公司 华中科技大学互联网的牛人 互联网方面的科技前沿 广州有谷有贝互联网科技有限公司 互联网硬科技公司 陕西九四连强互联网科技有限公司 现代科技的标志之一的互联网 南京欣网互联网络科技有限公司 腾讯阿里互联网科技 合肥互联网科技公司 互联网科技热点资讯 福建科技产业互联网发展 西安小鹰速贷互联网科技有限公司 科技大学互联网 电子商务与互联网科技的关系 互联网领先科技成果宣传视频 颐高云石互联网科技
0