Commit c1da865928fe3321a441854591e71efe20d302e0

Authored by liquanyu
1 parent 8b84b68342

孕妇学校

Showing 2 changed files with 46 additions and 28 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientCourseController.java View file @ c1da865
... ... @@ -94,66 +94,71 @@
94 94 }
95 95  
96 96  
  97 +
97 98 /**
98   - * 孕妇预约课程
99   - * @param courseId
100   - * @param patientId
101   - * @param hospitalId
102   - * @param orderType //预约类型 1 院内 2 小程序
  99 + * 孕妇签到
  100 + * @param patientCourseId
103 101 * @param request
104 102 * @return
105 103 */
106   - @RequestMapping(method = RequestMethod.GET, value = "/orderCourse")
  104 + @RequestMapping(method = RequestMethod.GET, value = "/signCourse")
107 105 @ResponseBody
108   - public BaseResponse orderCourse(
  106 + @TokenRequired
  107 + public BaseResponse signCourse(
  108 + @RequestParam(required = true) String patientCourseId,
109 109 @RequestParam(required = true) String courseId,
110   - @RequestParam(required = true) String patientId,
111   - @RequestParam(required = true) String hospitalId,
112   - @RequestParam(required = true) Integer orderType,
113 110 HttpServletRequest request) {
114 111  
115   - return patientCourseFacade.orderCourse(courseId, patientId, hospitalId, orderType);
  112 + return patientCourseFacade.signCourse(patientCourseId, courseId, getUserId(request));
116 113 }
117 114  
118 115  
  116 +
119 117 /**
120   - * 取消预约课程
121   - * @param id
  118 + * 院内系统和小程序孕妇预约课程
  119 + * @param courseId 课程id
  120 + * @param patientId 孕妇id
  121 + * @param hospitalId 医院id
  122 + * @param orderType 预约类型 1 院内 2 小程序
122 123 * @param request
123 124 * @return
124 125 */
125   - @RequestMapping(method = RequestMethod.GET, value = "/cancelOrderCourse")
  126 + @RequestMapping(method = RequestMethod.GET, value = "/orderCourse")
126 127 @ResponseBody
127   - public BaseResponse cancelOrderCourse(
128   - @RequestParam(required = true) String id,
  128 + public BaseResponse orderCourse(
  129 + @RequestParam(required = true) String courseId,
  130 + @RequestParam(required = true) String patientId,
  131 + @RequestParam(required = true) String hospitalId,
  132 + @RequestParam(required = true) Integer orderType,
129 133 HttpServletRequest request) {
130 134  
131   - return patientCourseFacade.cancelOrderCourse(id);
  135 + return patientCourseFacade.orderCourse(courseId, patientId, hospitalId, orderType);
132 136 }
133 137  
134 138  
135 139 /**
136   - * 孕妇签到
137   - * @param patientCourseId
  140 + * 取消预约课程
  141 + * @param patientId 孕妇id
  142 + * @param courseId 课程id
138 143 * @param request
139 144 * @return
140 145 */
141   - @RequestMapping(method = RequestMethod.GET, value = "/signCourse")
  146 + @RequestMapping(method = RequestMethod.GET, value = "/cancelOrderCourse")
142 147 @ResponseBody
143   - @TokenRequired
144   - public BaseResponse signCourse(
145   - @RequestParam(required = true) String patientCourseId,
  148 + public BaseResponse cancelOrderCourse(
  149 + @RequestParam(required = true) String patientId,
146 150 @RequestParam(required = true) String courseId,
147 151 HttpServletRequest request) {
148 152  
149   - return patientCourseFacade.signCourse(patientCourseId, courseId, getUserId(request));
  153 + return patientCourseFacade.cancelOrderCourse(patientId, courseId);
150 154 }
151 155  
152 156  
  157 +
153 158 /**
154 159 * 获取小程序的孕妇学校列表
155   - * @param hospitalIds 医院id
156   - * @param patientId 患者id
  160 + * @param hospitalIds 医院id 例:213,132
  161 + * @param patientId 孕妇id
157 162 * @param keyword 查询关键字
158 163 * @param status 2 最新课程 3 历史课程
159 164 * @param page
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientCourseFacade.java View file @ c1da865
... ... @@ -443,6 +443,9 @@
443 443 for (CourseModel model : courseModels)
444 444 {
445 445 Map<String,String> result = new HashMap<>();
  446 + //课程id
  447 + result.put("courseId",model.getId());
  448 +
446 449 //课程名称
447 450 result.put("courseName",model.getCourseName());
448 451 //课程描述
... ... @@ -507,8 +510,18 @@
507 510 return objectResponse;
508 511 }
509 512  
510   - public BaseResponse cancelOrderCourse(String id) {
511   - patientCourseService.deletePatientCourse(id);
  513 + public BaseResponse cancelOrderCourse(String patientId,String courseId) {
  514 +
  515 + PatientCourseQuery patientCourseQuery = new PatientCourseQuery();
  516 + patientCourseQuery.setYn(YnEnums.YES.getId());
  517 + patientCourseQuery.setPatientId(patientId);
  518 + patientCourseQuery.setCourseId(courseId);
  519 + List<PatientCourseModel> patientCourseModels = patientCourseService.queryPatientCourseList(patientCourseQuery);
  520 + if (CollectionUtils.isNotEmpty(patientCourseModels))
  521 + {
  522 + String id = patientCourseModels.get(0).getId();
  523 + patientCourseService.deletePatientCourse(id);
  524 + }
512 525 BaseResponse objectResponse = new BaseResponse();
513 526 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
514 527 objectResponse.setErrormsg("成功");