Commit e42a14bf15b56d595d4aadbee7605a055d5cf7a9
1 parent
24300f3662
Exists in
master
and in
8 other branches
增加配置
Showing 6 changed files with 15 additions and 11 deletions
- platform-biz-patient-service/pom.xml
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PuerperaService.java
- platform-dal/src/main/java/com/lyms/platform/query/PuerperaModelQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/inteceptor/TokenValidateInteceptor.java
- platform-resource/resources/config-dev.properties
platform-biz-patient-service/pom.xml
View file @
e42a14b
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PuerperaService.java
View file @
e42a14b
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | import java.util.List; |
4 | 4 | |
5 | +import org.apache.commons.collections.CollectionUtils; | |
5 | 6 | import org.apache.commons.lang.StringUtils; |
6 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
7 | 8 | import org.springframework.data.domain.Sort.Direction; |
... | ... | @@ -45,8 +46,11 @@ |
45 | 46 | * @return |
46 | 47 | */ |
47 | 48 | public PuerperaModel findOnePuerperaByCardNo(PuerperaModelQuery puerperaQuery) { |
48 | - | |
49 | - return iPuerperaDao.queryPuerpera(puerperaQuery.convertToQuery()).get(0); | |
49 | + List<PuerperaModel> result = iPuerperaDao.queryPuerpera(puerperaQuery.convertToQuery()); | |
50 | + if(CollectionUtils.isEmpty(result)){ | |
51 | + return result.get(0); | |
52 | + } | |
53 | + return null; | |
50 | 54 | } |
51 | 55 | |
52 | 56 | public PuerperaModel findOnePuerperaById(String id) { |
platform-dal/src/main/java/com/lyms/platform/query/PuerperaModelQuery.java
View file @
e42a14b
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | import java.util.Date; |
4 | 4 | |
5 | +import org.bson.types.ObjectId; | |
5 | 6 | import org.springframework.data.mongodb.core.query.Criteria; |
6 | 7 | |
7 | 8 | import com.lyms.platform.common.base.IConvertToNativeQuery; |
... | ... | @@ -154,7 +155,7 @@ |
154 | 155 | condition= condition.and("communityId", communityId, MongoOper.IS); |
155 | 156 | } |
156 | 157 | if(null!=id){ |
157 | - condition= condition.and("id", id, MongoOper.IS); | |
158 | + condition= condition.and("id", new ObjectId(id), MongoOper.IS); | |
158 | 159 | } |
159 | 160 | if(null!=cardNo){ |
160 | 161 | condition=condition.and("cardno", cardNo, MongoOper.IS); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java
View file @
e42a14b
... | ... | @@ -69,7 +69,11 @@ |
69 | 69 | * @return |
70 | 70 | */ |
71 | 71 | public BaseObjectResponse findOneByCardNo(String cardNo) { |
72 | - return doBiz(findOnePuerperaByCardNo(cardNo)); | |
72 | + PuerperaModel puerperaModel= findOnePuerperaByCardNo(cardNo); | |
73 | + if (null == puerperaModel) { | |
74 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.DEPT_NOT_EXISTS).setErrormsg("产妇信息不存在"); | |
75 | + } | |
76 | + return doBiz(puerperaModel); | |
73 | 77 | } |
74 | 78 | |
75 | 79 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/inteceptor/TokenValidateInteceptor.java
View file @
e42a14b