Commit 294226efafa755be06d825fa7cd75630dd00bb94
1 parent
245e14ec7f
Exists in
master
and in
6 other branches
隐藏建档
Showing 1 changed file with 3 additions and 9 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/NewbornServiceImpl.java
View file @
294226e
| ... | ... | @@ -136,22 +136,16 @@ |
| 136 | 136 | // 如果本院已有记录 直接走正常流程 |
| 137 | 137 | BabyModel baby = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(pid).and("hospitalId").is(hospitalId)).with(new Sort(Sort.Direction.DESC, "created")), BabyModel.class); |
| 138 | 138 | if(baby != null) { |
| 139 | - babyId = baby.getId(); | |
| 140 | 139 | return true; |
| 141 | 140 | } |
| 142 | 141 | |
| 143 | - DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); | |
| 144 | - dataPermissionsModelQuery.setUserId(userId); | |
| 145 | - List<DataPermissionsModel> permissionsModels = dataPermissionService.queryPermission(dataPermissionsModelQuery); | |
| 146 | - if (CollectionUtils.isNotEmpty(permissionsModels)) { | |
| 147 | - Set<String> set = permissionsModels.get(0).getData().keySet(); | |
| 148 | - Iterator<String> it = set.iterator(); | |
| 149 | - BabyModel babyModel = mongoTemplate.findOne(Query.query(Criteria.where("hospitalId").in(it) | |
| 142 | + List<String> hospitalIds = organizationGroupsFacade.findGroupHospital(userId, true); | |
| 143 | + if (CollectionUtils.isNotEmpty(hospitalIds)) { | |
| 144 | + BabyModel babyModel = mongoTemplate.findOne(Query.query(Criteria.where("hospitalId").in(hospitalIds) | |
| 150 | 145 | .and("pid").is(pid)).with(new Sort(Sort.Direction.DESC, "created")), BabyModel.class); |
| 151 | 146 | if(babyModel == null) { |
| 152 | 147 | return false; // 需 要建档 |
| 153 | 148 | } |
| 154 | - babyId = UUID.randomUUID().toString().replace("-", ""); | |
| 155 | 149 | babyModel.setId(babyId); |
| 156 | 150 | babyModel.setHospitalId(hospitalId); |
| 157 | 151 | babyModel.setEnable("2"); |