Commit bf5daf7ee194d28bc0448ba5719544e174883759
1 parent
b66c031db2
Exists in
master
and in
6 other branches
孕妇学校
Showing 1 changed file with 32 additions and 8 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientCourseFacade.java
View file @
bf5daf7
... | ... | @@ -21,14 +21,8 @@ |
21 | 21 | import com.lyms.platform.permission.model.Users; |
22 | 22 | import com.lyms.platform.permission.service.OrganizationService; |
23 | 23 | import com.lyms.platform.permission.service.UsersService; |
24 | -import com.lyms.platform.pojo.CourseModel; | |
25 | -import com.lyms.platform.pojo.CourseTypeModel; | |
26 | -import com.lyms.platform.pojo.PatientCourseModel; | |
27 | -import com.lyms.platform.pojo.Patients; | |
28 | -import com.lyms.platform.query.CourseQuery; | |
29 | -import com.lyms.platform.query.CourseTypeQuery; | |
30 | -import com.lyms.platform.query.PatientCourseQuery; | |
31 | -import com.lyms.platform.query.PatientsQuery; | |
24 | +import com.lyms.platform.pojo.*; | |
25 | +import com.lyms.platform.query.*; | |
32 | 26 | import org.apache.commons.collections.CollectionUtils; |
33 | 27 | import org.apache.commons.lang.StringUtils; |
34 | 28 | import org.springframework.beans.factory.annotation.Autowired; |
... | ... | @@ -163,6 +157,8 @@ |
163 | 157 | patientsQuery.setYn(YnEnums.YES.getId()); |
164 | 158 | patientsQuery.setPvc(queryNo); |
165 | 159 | patientsQuery.setHospitalId(hospitalId); |
160 | + patientsQuery.setDesc("true"); | |
161 | + patientsQuery.setSort("created"); | |
166 | 162 | List<Patients> patientses = patientsService.queryPatient(patientsQuery); |
167 | 163 | if (CollectionUtils.isNotEmpty(patientses)) |
168 | 164 | { |
... | ... | @@ -249,6 +245,34 @@ |
249 | 245 | objectResponse.setErrorcode(ErrorCodeConstants.DATA_EXPIRE); |
250 | 246 | objectResponse.setErrormsg("该课程预约人数已达上限,不能预约该课程了!"); |
251 | 247 | return objectResponse; |
248 | + } | |
249 | + } | |
250 | + else | |
251 | + { | |
252 | + objectResponse.setErrorcode(ErrorCodeConstants.NO_DATA); | |
253 | + objectResponse.setErrormsg("该课程不存在"); | |
254 | + return objectResponse; | |
255 | + } | |
256 | + | |
257 | + if (orderType == 2) | |
258 | + { | |
259 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
260 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
261 | + patientsQuery.setId(patientId); | |
262 | + List<Patients> patientses = patientsService.queryPatient(patientsQuery); | |
263 | + if (CollectionUtils.isNotEmpty(patientses)) { | |
264 | + | |
265 | + Patients patients = patientses.get(0); | |
266 | + patientsQuery.setId(null); | |
267 | + patientsQuery.setPid(patients.getPid()); | |
268 | + patientsQuery.setHospitalId(courseModels.get(0).getHospitalId()); | |
269 | + patientsQuery.setDesc("true"); | |
270 | + patientsQuery.setSort("created"); | |
271 | + patientses = patientsService.queryPatient(patientsQuery); | |
272 | + if (CollectionUtils.isNotEmpty(patientses)) | |
273 | + { | |
274 | + patientId = patientses.get(0).getId(); | |
275 | + } | |
252 | 276 | } |
253 | 277 | } |
254 | 278 |