Commit 36e299cfe31c9b1cb5b73bad7ff6e1d24a422882
1 parent
1f69b69d03
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 10 additions and 2 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
36e299c
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/DefectiveChildServiceImpl.java
View file @
36e299c
... | ... | @@ -68,8 +68,16 @@ |
68 | 68 | */ |
69 | 69 | @Override |
70 | 70 | public BaseResponse add(DefectiveChildRequest param,Integer userId) { |
71 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
72 | + List<DefectiveChildModel> defectiveChildModels = mongoTemplate.find(Query.query(Criteria.where("inHospitalNo").is(param.getInHospitalNo()). | |
73 | + and("hospitalId").is(hospitalId)), DefectiveChildModel.class); | |
74 | + if (CollectionUtils.isNotEmpty(defectiveChildModels)) | |
75 | + { | |
76 | + new BaseResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("住院号已经存在"); | |
77 | + } | |
78 | + | |
71 | 79 | DefectiveChildModel model = param; |
72 | - model.setHospitalId(autoMatchFacade.getHospitalId(userId)); | |
80 | + model.setHospitalId(hospitalId); | |
73 | 81 | mongoTemplate.insert(model); |
74 | 82 | return new BaseResponse(); |
75 | 83 | } |