Commit a396785ba74a9cba826789bf9fed79135451c99f

Authored by liquanyu
1 parent 05bab0aaf7

孕妇学校

Showing 1 changed file with 21 additions and 4 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientCourseFacade.java View file @ a396785
... ... @@ -305,10 +305,27 @@
305 305 List<PatientCourseModel> patientCourseModels = patientCourseService.queryPatientCourseList(patientCourseQuery);
306 306 if (CollectionUtils.isNotEmpty(patientCourseModels))
307 307 {
308   - BaseResponse objectResponse = new BaseResponse();
309   - objectResponse.setErrorcode(ErrorCodeConstants.DATA_EXIST);
310   - objectResponse.setErrormsg("孕妇已经预约,确认是否签到?");
311   - return objectResponse;
  308 + PatientsQuery patientsQuery = new PatientsQuery();
  309 + patientsQuery.setYn(YnEnums.YES.getId());
  310 + patientsQuery.setId(patientCourseModels.get(0).getPatientId());
  311 + List<Patients> patientses = patientsService.queryPatient(patientsQuery);
  312 + if (CollectionUtils.isNotEmpty(patientses)) {
  313 + Patients patients = patientses.get(0);
  314 + PatientCourseResult result = new PatientCourseResult();
  315 + if (patients != null) {
  316 + result.setAge(DateUtil.getAge(patients.getBirth(), new Date()));
  317 + result.setCardNo(patients.getCardNo());
  318 + result.setUserName(patients.getUsername());
  319 + result.setPhone(patients.getPhone());
  320 + result.setVcCardNo(patients.getVcCardNo());
  321 + result.setPatientId(patients.getId());
  322 + }
  323 + BaseObjectResponse objectResponse = new BaseObjectResponse();
  324 + objectResponse.setData(result);
  325 + objectResponse.setErrorcode(ErrorCodeConstants.DATA_EXIST);
  326 + objectResponse.setErrormsg("孕妇已经预约,确认是否签到?");
  327 + return objectResponse;
  328 + }
312 329 }
313 330 else
314 331 {