Commit 260d7ff09d90169833e2585d516facaf9a7fcc6f
1 parent
c29dbe7395
Exists in
master
and in
6 other branches
中医指导:儿童小程序接口-文章查询优化update
Showing 1 changed file with 10 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MedicineArticleFacade.java
View file @
260d7ff
| ... | ... | @@ -13,8 +13,10 @@ |
| 13 | 13 | import com.lyms.platform.common.utils.StringUtils; |
| 14 | 14 | import com.lyms.platform.permission.dao.master.CouponMapper; |
| 15 | 15 | import com.lyms.platform.pojo.BabyCheckModel; |
| 16 | +import com.lyms.platform.pojo.BabyModel; | |
| 16 | 17 | import com.lyms.platform.pojo.MedicineArticleModel; |
| 17 | 18 | import com.lyms.platform.query.BabyCheckModelQuery; |
| 19 | +import com.lyms.platform.query.BabyModelQuery; | |
| 18 | 20 | import com.lyms.platform.query.MedicineArticleQuery; |
| 19 | 21 | import org.apache.commons.collections.CollectionUtils; |
| 20 | 22 | import org.springframework.beans.factory.annotation.Autowired; |
| 21 | 23 | |
| ... | ... | @@ -132,9 +134,16 @@ |
| 132 | 134 | if(StringUtils.isEmpty(id)){ |
| 133 | 135 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("参数错误"); |
| 134 | 136 | } |
| 137 | + BabyModelQuery babyModelQuery=new BabyModelQuery(); | |
| 138 | + babyModelQuery.setYn(YnEnums.YES.getId()); | |
| 139 | + babyModelQuery.setPid(id); | |
| 140 | + List<BabyModel> babyModelList = babyBookbuildingService.queryBabyBuildByCond(babyModelQuery, "created", Sort.Direction.DESC); | |
| 141 | + if(CollectionUtils.isEmpty(babyModelList)){ | |
| 142 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("儿童档案不存在"); | |
| 143 | + } | |
| 135 | 144 | BabyCheckModelQuery query = new BabyCheckModelQuery(); |
| 136 | 145 | query.setYn(YnEnums.YES.getId()); |
| 137 | - query.setBuildId(id); | |
| 146 | + query.setBuildId(babyModelList.get(0).getId()); | |
| 138 | 147 | List <BabyCheckModel> checkModels = babyCheckService.queryBabyCheckRecord(query, "checkDate,created", Sort.Direction.DESC); |
| 139 | 148 | List<MedicineArticleModel> resultList=new ArrayList<>(); |
| 140 | 149 | if(CollectionUtils.isNotEmpty(checkModels) && |