五、核心代码
5.1 查询医生
@RequestMapping(value = "/getByPage", method = RequestMethod.GET) @ApiOperation(value = "查询医生") public Result<IPage<Doctor>> getByPage(@ModelAttribute Doctor doctor,@ModelAttribute PageVo page){ QueryWrapper<Doctor> qw = new QueryWrapper<>(); if(!ZwzNullUtils.isNull(doctor.getDoctorName())) { qw.like("doctor_name",doctor.getDoctorName()); } if(!ZwzNullUtils.isNull(doctor.getPostLevel())) { qw.eq("post_level",doctor.getPostLevel()); } if(!ZwzNullUtils.isNull(doctor.getSubjectId())) { qw.eq("subject_id",doctor.getSubjectId()); } if(!ZwzNullUtils.isNull(doctor.getNoeDate()) && Objects.equals(doctor.getNoeDate(),"是")) { qw.inSql("id","SELECT id FROM t_doctor WHERE id IN(SELECT DISTINCT doctor_id FROM t_doctor_scheduling WHERE DATE = '" + DateUtil.today() + "')"); } return new ResultUtil<IPage<Doctor>>().setData(iDoctorService.page(PageUtil.initMpPage(page),qw)); }
5.2 医生放号
@RequestMapping(value = "/addNumber", method = RequestMethod.POST) @ApiOperation(value = "医生放号") public Result<Object> addNumber(@RequestParam String doctorId,@RequestParam String date,@RequestParam int step,@RequestParam int number){ Doctor doctor = iDoctorService.getById(doctorId); if(doctor == null) { return ResultUtil.error("医生不存在"); } if(number < 1) { return ResultUtil.error("放号数必须大于0"); } for(int i = 1 ; i <= number; i ++) { DoctorScheduling ds = new DoctorScheduling(); ds.setDoctorId(doctor.getId()); ds.setDoctorName(doctor.getDoctorName()); ds.setNumber(i + ""); ds.setStep(step + ""); ds.setDate(date); ds.setOrderFlag(0); iDoctorSchedulingService.saveOrUpdate(ds); } return ResultUtil.success("放号成功"); }
5.3 置顶医院新闻
@RequestMapping(value = "/set_top_by_id", method = RequestMethod.POST) @ApiOperation(value = "置顶医院新闻") public Result<Boolean> setTopById(@RequestParam String id){ HospitalNews appDynamicNew=iHospitalNewsService.getById(id); if(appDynamicNew==null) { return ResultUtil.error("该动态信息不存在"); } if(appDynamicNew.getIsTop().equals("yes")) { appDynamicNew.setIsTop("no"); } else { appDynamicNew.setIsTop("yes"); } if(!iHospitalNewsService.saveOrUpdate(appDynamicNew)) { return ResultUtil.error("设置失败"); } return ResultUtil.success("设置成功"); }
5.4 查询我的挂号数据
@RequestMapping(value = "/getMyOrderList", method = RequestMethod.POST) @ApiOperation(value = "查询我的挂号") public Result<IPage<HospitalOrder>> getMyOrderList(@ModelAttribute HospitalOrder order,@ModelAttribute PageVo page){ User currUser = securityUtil.getCurrUser(); QueryWrapper<HospitalOrder> qw = new QueryWrapper<>(); qw.eq("user_id",currUser.getId()); qw.orderByDesc("create_time"); if(!ZwzNullUtils.isNull(order.getDateTime())) { qw.eq("date_time",order.getDateTime()); } if(!ZwzNullUtils.isNull(order.getDoctorName())) { qw.like("doctor_name",order.getDoctorName()); } return new ResultUtil<IPage<HospitalOrder>>().setData(iHospitalOrderService.page(PageUtil.initMpPage(page),qw)); }
5.5 预约挂号
@RequestMapping(value = "/addOrder", method = RequestMethod.POST) @ApiOperation(value = "新增挂号") public Result<Object> addOrder(@RequestParam String orderId){ User currUser = securityUtil.getCurrUser(); DoctorScheduling ds = iDoctorSchedulingService.getById(orderId); if(ds == null) { return ResultUtil.error("号源不存在"); } if(ds.getOrderFlag() > 0) { return ResultUtil.error("您手慢拉,该号已被别人预约!"); } Doctor doctor = iDoctorService.getById(ds.getDoctorId()); if(doctor == null) { return ResultUtil.error("医生不存在"); } ds.setOrderFlag(1); iDoctorSchedulingService.saveOrUpdate(ds); HospitalOrder ho = new HospitalOrder(); ho.setUserId(currUser.getId()); ho.setUserName(currUser.getNickname()); ho.setOrderId(ds.getId()); ho.setNumber(ds.getNumber()); ho.setStep(ds.getStep()); ho.setDateTime(ds.getDate()); ho.setDoctorId(ds.getDoctorId()); ho.setDoctorName(ds.getDoctorName()); ho.setMoneyData(doctor.getOrderMoney()); iHospitalOrderService.saveOrUpdate(ho); return ResultUtil.success("预约成功!"); }
六、免责说明
- 本项目仅供个人学习使用,商用授权请联系博主,否则后果自负。
- 博主拥有本软件构建后的应用系统全部内容所有权及独立的知识产权,拥有最终解释权。
- 如有问题,欢迎在仓库 Issue 留言,看到后会第一时间回复,相关意见会酌情考虑,但没有一定被采纳的承诺或保证。
下载本系统代码或使用本系统的用户,必须同意以下内容,否则请勿下载!
- 出于自愿而使用/开发本软件,了解使用本软件的风险,且同意自己承担使用本软件的风险。
- 利用本软件构建的网站的任何信息内容以及导致的任何版权纠纷和法律争议及后果和博主无关,博主对此不承担任何责任。
- 在任何情况下,对于因使用或无法使用本软件而导致的任何难以合理预估的损失(包括但不仅限于商业利润损失、业务中断与业务信息丢失),博主概不承担任何责任。
- 必须了解使用本软件的风险,博主不承诺提供一对一的技术支持、使用担保,也不承担任何因本软件而产生的难以预料的问题的相关责任。