From b7045361655baeb66f57209ca3e44455196fd2d6 Mon Sep 17 00:00:00 2001 From: liquanyu Date: Mon, 26 Feb 2018 16:12:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=95=E5=A6=87=E5=AD=A6=E6=A0=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/PatientCourseController.java | 6 +++++- .../operate/web/facade/PatientCourseFacade.java | 22 +++++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientCourseController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientCourseController.java index d0fc878..501e91f 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientCourseController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientCourseController.java @@ -151,8 +151,12 @@ public class PatientCourseController extends BaseController { /** * 获取小程序的孕妇学校列表 - * @param hospitalIds 相关医院id + * @param hospitalIds 医院id * @param patientId 患者id + * @param keyword 查询关键字 + * @param status 2 最新课程 3 历史课程 + * @param page + * @param limit * @param request * @return */ diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientCourseFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientCourseFacade.java index 8e5c018..ba9e471 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientCourseFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientCourseFacade.java @@ -368,6 +368,10 @@ public class PatientCourseFacade { query.setKeyword(keyword); List courseModels = courseService.queryCourseList(query); + + PatientCourseQuery patientCourseQuery = new PatientCourseQuery(); + patientCourseQuery.setYn(YnEnums.YES.getId()); + List results = new ArrayList<>(); CourseTypeQuery courseTypeQuery = new CourseTypeQuery(); query.setYn(YnEnums.YES.getId()); @@ -413,10 +417,22 @@ public class PatientCourseFacade { //课程上限人数 - result.put("limitNum",model.getLimitNum() == null ? "0" : String.valueOf(model.getLimitNum())); + result.put("limitNum", model.getLimitNum() == null ? "0" : String.valueOf(model.getLimitNum())); + + + patientCourseQuery.setCourseId(model.getId()); + patientCourseQuery.setPatientId(patientId); + + + Integer patientStatus = 0; + List patientCourseModels = patientCourseService.queryPatientCourseList(patientCourseQuery); + if (CollectionUtils.isNotEmpty(patientCourseModels)) + { + patientStatus = patientCourseModels.get(0).getStatus(); + } - //孕妇与课程的状态 - result.put("status",""); + //孕妇与课程的状态 0未预约 1预约,2签到 + result.put("patientCourseStatus",String.valueOf(patientStatus)); results.add(result); } -- 1.8.3.1