Commit 361799c983fb53077c9ca248b85cbc07e61504a4
1 parent
28d8bd5b1d
Exists in
master
and in
4 other branches
孤独症初筛相关接口
Showing 2 changed files with 22 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PrimaryScreeningController.java
View file @
361799c
| ... | ... | @@ -11,6 +11,7 @@ |
| 11 | 11 | import org.slf4j.Logger; |
| 12 | 12 | import org.slf4j.LoggerFactory; |
| 13 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | +import org.springframework.data.domain.PageRequest; | |
| 14 | 15 | import org.springframework.stereotype.Controller; |
| 15 | 16 | import org.springframework.web.bind.annotation.RequestBody; |
| 16 | 17 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -176,5 +177,12 @@ |
| 176 | 177 | return primaryScreeningFacade.queryUpDate(id); |
| 177 | 178 | } |
| 178 | 179 | |
| 180 | + @ResponseBody | |
| 181 | + @TokenRequired | |
| 182 | + @RequestMapping(value = "/queryDateListPage",method = RequestMethod.GET) | |
| 183 | + public BaseResponse queryDateListPage(BabyAutismPrimaryScreening babyAutismPrimaryScreening, PageRequest pageRequest, HttpServletRequest request) { | |
| 184 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 185 | + return primaryScreeningFacade.queryDateListPage(babyAutismPrimaryScreening,pageRequest,loginState.getId()); | |
| 186 | + } | |
| 179 | 187 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PrimaryScreeningFacade.java
View file @
361799c
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.common.base.PageInfo; | |
| 3 | 4 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 4 | 5 | import com.lyms.platform.common.enums.EyeCheckMonthEnums; |
| 5 | 6 | import com.lyms.platform.common.enums.SexEnum; |
| ... | ... | @@ -17,6 +18,8 @@ |
| 17 | 18 | import com.lyms.platform.pojo.BabyAutismPrimaryScreening; |
| 18 | 19 | import com.lyms.platform.pojo.BabyModel; |
| 19 | 20 | import org.springframework.beans.factory.annotation.Autowired; |
| 21 | +import org.springframework.data.domain.Page; | |
| 22 | +import org.springframework.data.domain.PageRequest; | |
| 20 | 23 | import org.springframework.data.mongodb.core.MongoTemplate; |
| 21 | 24 | import org.springframework.stereotype.Component; |
| 22 | 25 | |
| ... | ... | @@ -148,6 +151,17 @@ |
| 148 | 151 | BaseObjectResponse br = new BaseObjectResponse(); |
| 149 | 152 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 150 | 153 | br.setData(primaryScreening); |
| 154 | + br.setErrormsg("成功"); | |
| 155 | + return br; | |
| 156 | + } | |
| 157 | + | |
| 158 | + public BaseResponse queryDateListPage(BabyAutismPrimaryScreening babyAutismPrimaryScreening, PageRequest pageRequest, Integer id) { | |
| 159 | + Page<BabyAutismPrimaryScreening> primaryScreeningPage = babyAutismPrimaryScreeningService.queryByPage(babyAutismPrimaryScreening, pageRequest); | |
| 160 | + BaseObjectResponse br = new BaseObjectResponse(); | |
| 161 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 162 | + br.setData(primaryScreeningPage.getContent()); | |
| 163 | + PageInfo pageInfo = new PageInfo(primaryScreeningPage.getNumber(), primaryScreeningPage.getTotalPages(), Long.valueOf(primaryScreeningPage.getTotalElements()).intValue(), pageRequest.getPageSize()); | |
| 164 | + br.setPageInfo(pageInfo); | |
| 151 | 165 | br.setErrormsg("成功"); |
| 152 | 166 | return br; |
| 153 | 167 | } |