Commit da97d1289ee3cfa2469bab5349ba53bf795d392b
1 parent
90e8e2d5c0
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 55 additions and 5 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BreastController.java
View file @
da97d12
| ... | ... | @@ -10,6 +10,7 @@ | 
| 10 | 10 | import com.lyms.platform.operate.web.facade.BreastFacade; | 
| 11 | 11 | import com.lyms.platform.operate.web.request.BreastRequest; | 
| 12 | 12 | import com.lyms.platform.query.BreastModelQuery; | 
| 13 | +import com.lyms.platform.query.FamilyPlanningModelQuery; | |
| 13 | 14 | import org.springframework.beans.factory.annotation.Autowired; | 
| 14 | 15 | import org.springframework.stereotype.Controller; | 
| 15 | 16 | import org.springframework.web.bind.annotation.*; | 
| ... | ... | @@ -89,7 +90,17 @@ | 
| 89 | 90 | return breastFacade.queryByIdEdit(id); | 
| 90 | 91 | |
| 91 | 92 | } | 
| 92 | - | |
| 93 | + /** | |
| 94 | + * 查询单人所有记录 | |
| 95 | + * buildId | |
| 96 | + * @param | |
| 97 | + */ | |
| 98 | + @RequestMapping(value = "/queryOne", method = RequestMethod.GET) | |
| 99 | + @ResponseBody | |
| 100 | + @TokenRequired | |
| 101 | + public BaseResponse queryOne(BreastModelQuery breastModelQuery, HttpServletRequest request) { | |
| 102 | + return breastFacade.queryOne(breastModelQuery,getUserId(request)); | |
| 103 | + } | |
| 93 | 104 | |
| 94 | 105 | /** | 
| 95 | 106 | * 管理列表 | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BreastFacade.java
View file @
da97d12
| ... | ... | @@ -15,19 +15,18 @@ | 
| 15 | 15 | import com.lyms.platform.operate.web.request.BreastRequest; | 
| 16 | 16 | import com.lyms.platform.operate.web.result.BabyHighRiskBabyResult; | 
| 17 | 17 | import com.lyms.platform.operate.web.result.BreastResult; | 
| 18 | +import com.lyms.platform.operate.web.result.FamilyPlanningResult; | |
| 18 | 19 | import com.lyms.platform.operate.web.service.impl.BaseServiceImpl; | 
| 19 | 20 | import com.lyms.platform.operate.web.utils.CollectionUtils; | 
| 20 | 21 | import com.lyms.platform.operate.web.utils.CommonsHelper; | 
| 21 | 22 | import com.lyms.platform.permission.model.Users; | 
| 22 | 23 | import com.lyms.platform.permission.service.OrganizationService; | 
| 23 | 24 | import com.lyms.platform.permission.service.UsersService; | 
| 24 | -import com.lyms.platform.pojo.BabyHighRiskBabyModel; | |
| 25 | -import com.lyms.platform.pojo.BasicConfig; | |
| 26 | -import com.lyms.platform.pojo.BreastModel; | |
| 27 | -import com.lyms.platform.pojo.Patients; | |
| 25 | +import com.lyms.platform.pojo.*; | |
| 28 | 26 | import com.lyms.platform.query.BabyHighRiskBabyModelQuery; | 
| 29 | 27 | import com.lyms.platform.query.BasicConfigQuery; | 
| 30 | 28 | import com.lyms.platform.query.BreastModelQuery; | 
| 29 | +import com.lyms.platform.query.FamilyPlanningModelQuery; | |
| 31 | 30 | import org.apache.commons.lang.math.NumberUtils; | 
| 32 | 31 | import org.springframework.beans.factory.annotation.Autowired; | 
| 33 | 32 | import org.springframework.stereotype.Component; | 
| ... | ... | @@ -209,6 +208,46 @@ | 
| 209 | 208 | br.setErrormsg("成功"); | 
| 210 | 209 | } | 
| 211 | 210 | return br; | 
| 211 | + } | |
| 212 | + /** | |
| 213 | + * | |
| 214 | + 查询单人所有记录 | |
| 215 | + * @Author: 武涛涛 | |
| 216 | + * @Date: 2020/9/17 11:13 | |
| 217 | + */ | |
| 218 | + public BaseObjectResponse queryOne(BreastModelQuery babyQuery, Integer userId) { | |
| 219 | + | |
| 220 | + BaseObjectResponse br = new BaseObjectResponse(); | |
| 221 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 222 | + List <BreastResult> breastResultList = new ArrayList <>(); | |
| 223 | + | |
| 224 | + //单人多条专病记录 | |
| 225 | + List <BreastModel> breastModelList = new ArrayList <>(); | |
| 226 | + | |
| 227 | + if (StringUtils.isNotEmpty(babyQuery.getParentId())) { | |
| 228 | + babyQuery.setYn(YnEnums.YES.getId()); | |
| 229 | + babyQuery.setHospitalId(hospitalId); | |
| 230 | + babyQuery.setSort("checkDate"); | |
| 231 | + breastModelList = breastService.queryOne(babyQuery); | |
| 232 | + | |
| 233 | + } | |
| 234 | + for (int i = 0; i < breastModelList.size(); i++) { | |
| 235 | + BreastModel breastModel = breastModelList.get(i); | |
| 236 | + BreastResult breastResult = new BreastResult(); | |
| 237 | + if (breastModel != null) { | |
| 238 | + breastResult.convertToResult(breastModel); | |
| 239 | + if (StringUtils.isNotEmpty(breastModel.getHospitalId())) { | |
| 240 | + breastResult.setHospitalName(CommonsHelper.getHospitalName(breastModel.getHospitalId(), organizationService)); | |
| 241 | + } | |
| 242 | + breastResultList.add(breastResult); | |
| 243 | + } | |
| 244 | + } | |
| 245 | + br.setData(breastResultList); | |
| 246 | + br.setPageInfo(babyQuery.getPageInfo()); | |
| 247 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 248 | + br.setErrormsg("成功"); | |
| 249 | + return br; | |
| 250 | + | |
| 212 | 251 | } | 
| 213 | 252 | |
| 214 | 253 |