Commit 95b1d95a78b1068ec7d9b72f196e72eb7ded9ac0

Authored by liquanyu
1 parent 874a978025

code update

Showing 2 changed files with 62 additions and 3 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java View file @ 95b1d95
... ... @@ -52,8 +52,8 @@
52 52 public BaseResponse addOrUpdateYunBuild(@RequestBody YunBookbuildingAddRequest yunBookbuildingAddRequest) {
53 53 if (yunBookbuildingAddRequest != null && !StringUtils.isEmpty(yunBookbuildingAddRequest.getId()) )
54 54 {
55   - bookbuildingFacade.updatePregnantById(yunBookbuildingAddRequest.getId(), yunBookbuildingAddRequest);
56   - return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  55 + return bookbuildingFacade.updatePregnantById(yunBookbuildingAddRequest.getId(), yunBookbuildingAddRequest);
  56 +
57 57 }
58 58 BaseObjectResponse p = bookbuildingFacade.addPregnantBookbuilding(yunBookbuildingAddRequest);
59 59 return p;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java View file @ 95b1d95
... ... @@ -116,6 +116,10 @@
116 116 //就诊卡号判断
117 117 if (StringUtils.isNotEmpty(yunRequest.getVcCardNo()))
118 118 {
  119 + patientsQuery.setCardNo(null);
  120 + patientsQuery.setBuildTypeEq(null);
  121 + patientsQuery.setDueStatus(null);
  122 + patientsQuery.setPhone(null);
119 123 patientsQuery.setVcCardNo(yunRequest.getVcCardNo());
120 124 patientsQuery.setHospitalId(yunRequest.getHospitalId());
121 125 List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
122 126  
... ... @@ -345,8 +349,61 @@
345 349 * @param id
346 350 * @param yunRequest
347 351 */
348   - public void updatePregnantById(String id, YunBookbuildingAddRequest yunRequest) {
  352 + public BaseResponse updatePregnantById(String id, YunBookbuildingAddRequest yunRequest) {
349 353  
  354 +
  355 + BaseResponse br = new BaseResponse();
  356 + PatientsQuery patientsQuery = new PatientsQuery();
  357 + patientsQuery.setYn(YnEnums.YES.getId());
  358 + patientsQuery.setType(1);
  359 + patientsQuery.setHospitalId(yunRequest.getHospitalId());
  360 + patientsQuery.setBuildTypeEq(0);
  361 + patientsQuery.setDueStatus(0);
  362 +
  363 + if (yunRequest.getPregnantCertificateNum() != null)
  364 + {
  365 + patientsQuery.setCardNo(yunRequest.getPregnantCertificateNum());
  366 + //判断该身份证号码是否有孕妇建档 在该医院
  367 + List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
  368 + if (CollectionUtils.isNotEmpty(patients))
  369 + {
  370 + br.setErrorcode(ErrorCodeConstants.DATA_EXIST);
  371 + br.setErrormsg("该身份证在医院已经建档");
  372 + return br;
  373 + }
  374 + }
  375 + if (yunRequest.getPregnantPhone() != null)
  376 + {
  377 + patientsQuery.setCardNo(null);
  378 + patientsQuery.setPhone(yunRequest.getPregnantPhone());
  379 + //判断该手机号码在 孕期内有没有建档
  380 + List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
  381 + if (CollectionUtils.isNotEmpty(patients))
  382 + {
  383 + br.setErrorcode(ErrorCodeConstants.DATA_EXIST);
  384 + br.setErrormsg("该手机号码已经建档");
  385 + return br;
  386 + }
  387 + }
  388 +
  389 + //就诊卡号判断
  390 + if (StringUtils.isNotEmpty(yunRequest.getVcCardNo()))
  391 + {
  392 + patientsQuery.setCardNo(null);
  393 + patientsQuery.setBuildTypeEq(null);
  394 + patientsQuery.setDueStatus(null);
  395 + patientsQuery.setPhone(null);
  396 + patientsQuery.setVcCardNo(yunRequest.getVcCardNo());
  397 + patientsQuery.setHospitalId(yunRequest.getHospitalId());
  398 + List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
  399 + if (CollectionUtils.isNotEmpty(patients))
  400 + {
  401 + br.setErrorcode(ErrorCodeConstants.DATA_EXIST);
  402 + br.setErrormsg("该就诊卡号在该医院已经建档");
  403 + return br;
  404 + }
  405 + }
  406 +
350 407 Patients patient = getPatientsData(yunRequest);
351 408 patient.setModified(new Date());
352 409  
... ... @@ -365,6 +422,8 @@
365 422 //加入产筛
366 423 patientsService.validata(patient);
367 424 yunBookbuildingService.updatePregnant(patient, id);
  425 +
  426 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
368 427 }
369 428  
370 429 /**