Commit 890003ac53ec663e56b5cc70a0165c139d88bd21
1 parent
e957eae280
Exists in
master
and in
6 other branches
听力诊断模块
Showing 1 changed file with 22 additions and 12 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyEarFacade.java
View file @
890003a
... | ... | @@ -100,16 +100,6 @@ |
100 | 100 | |
101 | 101 | //处理儿童person信息 |
102 | 102 | private PersonModel handBabyPerson(BabyModel baby) { |
103 | - //跟距母親的證件號查詢兒童person信息 | |
104 | - PersonModelQuery personModelQuery = new PersonModelQuery(); | |
105 | - personModelQuery.setYn(YnEnums.YES.getId()); | |
106 | - personModelQuery.setCardNo(baby.getMcertNo()); | |
107 | - personModelQuery.setType(2); | |
108 | - personModelQuery.setName(baby.getName()); | |
109 | - List<PersonModel> babyP = personService.queryPersons(personModelQuery); | |
110 | - if (CollectionUtils.isNotEmpty(babyP)) { | |
111 | - return babyP.get(0); | |
112 | - } | |
113 | 103 | PersonModel babyPerson = new PersonModel(); |
114 | 104 | babyPerson.setName(baby.getName()); |
115 | 105 | babyPerson.setBirth(baby.getBirth()); |
... | ... | @@ -379,8 +369,28 @@ |
379 | 369 | String hId = autoMatchFacade.getHospitalId(userId); |
380 | 370 | |
381 | 371 | if (null != baby) { |
382 | - //处理儿童person信息 | |
383 | - String pid = handBabyPerson(baby).getId(); | |
372 | + String pid = null; | |
373 | + if(StringUtils.isNotEmpty(baby.getId())){//修改儿童信息 | |
374 | + BabyModel babyModel = babyService.getOneBabyById(baby.getId()); | |
375 | + //跟距母親的證件號查詢兒童person信息 | |
376 | + PersonModelQuery personModelQuery = new PersonModelQuery(); | |
377 | + personModelQuery.setId(babyModel.getPid()); | |
378 | + List<PersonModel> babyP = personService.queryPersons(personModelQuery); | |
379 | + if (CollectionUtils.isNotEmpty(babyP)) { | |
380 | + PersonModel personModel = babyP.get(0); | |
381 | + personModel.setName(baby.getName()); | |
382 | + personModel.setBirth(baby.getBirth()); | |
383 | + personModel.setPhone(baby.getName()); | |
384 | + personModel.setCardNo(baby.getMcertNo()); | |
385 | + personModel.setModified(new Date()); | |
386 | + pid = personModel.getId(); | |
387 | + personService.updatePerson(personModel,personModel.getId()); | |
388 | + } | |
389 | + }else{//新增儿童信息 | |
390 | + //处理儿童person信息 | |
391 | + pid = handBabyPerson(baby).getId(); | |
392 | + } | |
393 | + | |
384 | 394 | babyEarAddResult.setpId(pid); |
385 | 395 | String babyPatientId = ""; |
386 | 396 |