Commit 703bfcb3aba240963280c9f662ff289ae96335a8

Authored by jiangjiazhi

Merge remote-tracking branch 'origin/master'

Showing 2 changed files

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ 703bfcb
... ... @@ -153,6 +153,39 @@
153 153 personService.updatePerson(pmodel, request.getPid());
154 154 }
155 155  
  156 + //查询儿童母亲身份证号码下面的产妇
  157 + PatientsQuery patientsQuery = new PatientsQuery();
  158 + patientsQuery.setYn(YnEnums.YES.getId());
  159 + patientsQuery.setPid(request.getMommyCertificateNum());
  160 + patientsQuery.setDueStatus(0);
  161 + List<Patients> pats = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
  162 + if (CollectionUtils.isNotEmpty(pats))
  163 + {
  164 + for(Patients pat : pats)
  165 + {
  166 + if (pat == null)
  167 + {
  168 + continue;
  169 + }
  170 + if (pat.getType() != null && pat.getType() == 3) {
  171 +
  172 + //判断在儿童建档的时候,是否设置到这个儿童对应的孕妇 设置成产妇
  173 + //计算规则 儿童生日 >= 孕妇末次月经 + 24周
  174 + Date lastMenses = pat.getLastMenses();
  175 + if (lastMenses != null && request.getBabyBirthday() != null) {
  176 + Date brith = DateUtil.parseYMD(request.getBabyBirthday());
  177 + Date tempDate = DateUtil.addWeek(lastMenses, 24);
  178 + if (brith.getTime() >= tempDate.getTime()) {
  179 + //设置孕妇分娩日期
  180 + Patients patientUpdate = new Patients();
  181 + patientUpdate.setYn(YnEnums.YES.getId());
  182 + patientUpdate.setFmDate(StringUtils.isEmpty(request.getDueDate()) ? DateUtil.parseYMD(request.getBabyBirthday()) : DateUtil.parseYMD(request.getDueDate()));
  183 + patientsService.updatePatient(patientUpdate);
  184 + }
  185 + }
  186 + }
  187 + }
  188 + }
156 189  
157 190 babyBookbuildingService.updateBabyBuild(model, request.getId());
158 191 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java View file @ 703bfcb
... ... @@ -65,6 +65,24 @@
65 65 StopPregModel model = getStopPregModel(request);
66 66 model.setModified(new Date());
67 67  
  68 +
  69 + PatientsQuery patientsQuery = new PatientsQuery();
  70 + patientsQuery.setYn(YnEnums.YES.getId());
  71 + patientsQuery.setType(3);
  72 + patientsQuery.setPid(request.getPid());
  73 + patientsQuery.setDueStatus(1);
  74 +
  75 + List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
  76 + if (CollectionUtils.isNotEmpty(patients)) {
  77 +
  78 + for (Patients patient : patients) {
  79 + if (patient != null) {
  80 + patient.setFmDate(DateUtil.parseYMD(request.getStopDate()));
  81 + yunBookbuildingService.updatePregnant(patient, patient.getId());
  82 + }
  83 + }
  84 + }
  85 +
68 86 stopPregnancyService.updateStopPreg(model, request.getId());
69 87 BaseResponse objectResponse = new BaseResponse();
70 88 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);