Commit 8b5513345fcef236bd969a8facd597e37ffaa76c

Authored by liquanyu
1 parent a15758d9eb

update

Showing 2 changed files with 63 additions and 10 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyNutritionController.java View file @ 8b55133
... ... @@ -73,8 +73,9 @@
73 73 @RequestParam(required = false) String recordTime,
74 74 @RequestParam(required = false) String interpretDoctorId,
75 75 @RequestParam(required = false) String settleStatus,
  76 + @RequestParam(required = false) String babyId,
76 77 HttpServletRequest request) {
77   - return babyNutritionFacade.queryBabyNutritionList(page, limit, queryNo, vcCardNo, babyName, getUserId(request), recordTime, interpretDoctorId, settleStatus);
  78 + return babyNutritionFacade.queryBabyNutritionList(babyId,page, limit, queryNo, vcCardNo, babyName, getUserId(request), recordTime, interpretDoctorId, settleStatus);
78 79 }
79 80  
80 81  
... ... @@ -161,6 +162,25 @@
161 162 ) {
162 163 return babyNutritionFacade.queryQhfyBabyDietReport(id, getUserId(request), doctorId, oid, rid);
163 164 }
  165 +
  166 +
  167 + /**
  168 + * 儿童小程序返回膳食报告详情
  169 + * @param id
  170 + * @param hospitalId
  171 + * @return
  172 + */
  173 + @RequestMapping(value = "/querybabyAppDiet/{id}", method = RequestMethod.GET)
  174 + @ResponseBody
  175 + public BaseObjectResponse querybabyAppDiet(@PathVariable("id") String id,@RequestParam(required = true)String hospitalId, HttpServletRequest request
  176 + ) {
  177 + if (!"216".equals(hospitalId))
  178 + {
  179 + return babyNutritionFacade.queryBabyDietReport(id, null, null);
  180 + }
  181 + return babyNutritionFacade.queryQhfyBabyDietReport(id, null, null,null,null);
  182 + }
  183 +
164 184  
165 185  
166 186 /**
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionFacade.java View file @ 8b55133
... ... @@ -243,7 +243,7 @@
243 243 * @param settleStatus 结算状态
244 244 * @return
245 245 */
246   - public BaseResponse queryBabyNutritionList(Integer page, Integer limit, String queryNo, String vcCardNo,
  246 + public BaseResponse queryBabyNutritionList(String babyId,Integer page, Integer limit, String queryNo, String vcCardNo,
247 247 String babyName, Integer userId, String recordTime, String interpretDoctorId, String settleStatus) {
248 248 String hospitalId = autoMatchFacade.getHospitalId(userId);
249 249 List<Map> list = new ArrayList<>();
... ... @@ -274,6 +274,10 @@
274 274 BabyNutritionQuery babyQuery = new BabyNutritionQuery();
275 275 babyQuery.setHospitalId(hospitalId);
276 276 babyQuery.setBabyIds(babyIds);
  277 + if (StringUtils.isNotEmpty(babyId))
  278 + {
  279 + babyQuery.setBabyId(babyId);
  280 + }
277 281 babyQuery.setLimit(limit);
278 282 babyQuery.setPage(page);
279 283  
... ... @@ -335,6 +339,7 @@
335 339  
336 340 BabyModel baby = babyBookbuildingService.queryBabyBuildById(model.getBabyId());
337 341 map.put("babyName", baby.getName());
  342 + map.put("hospitalId", baby.getHospitalId());
338 343 map.put("babySex", SexEnum.getTextById(baby.getSex()));
339 344 map.put("monthAge", StringUtils.emptyDeal(DateUtil.getBabyMonthAge(baby.getBirth(), model.getNutritiTime())));
340 345 map.put("motherName", baby.getMname());
... ... @@ -1415,8 +1420,13 @@
1415 1420 Map data = new HashMap();
1416 1421  
1417 1422 BabyNutritionQuery babyQuery = new BabyNutritionQuery();
1418   - String hospitalId = autoMatchFacade.getHospitalId(userId);
1419   - babyQuery.setHospitalId(hospitalId);
  1423 + String hospitalId = null;
  1424 + if (userId != null)
  1425 + {
  1426 + hospitalId = autoMatchFacade.getHospitalId(userId);
  1427 + babyQuery.setHospitalId(hospitalId);
  1428 + }
  1429 +
1420 1430 babyQuery.setId(id);
1421 1431  
1422 1432 List<BabyNutritionModel> models = babyNutritionService.queryBabyNutritions(babyQuery);
... ... @@ -1435,7 +1445,8 @@
1435 1445 map.put("vcCardNo", baby.getVcCardNo());
1436 1446 map.put("weight", model.getWeight());
1437 1447 map.put("height", model.getHeight());
1438   - Organization org = organizationService.getOrganization(Integer.parseInt(hospitalId));
  1448 + Organization org = organizationService.getOrganization(Integer.parseInt(baby.getHospitalId()));
  1449 + map.put("hospitalId", org.getId());
1439 1450 map.put("hospitalName", org.getName());
1440 1451 map.put("reportMonthAge", StringUtils.emptyDeal(DateUtil.getBabyMonthAge(baby.getBirth(), model.getNutritiTime())));
1441 1452 //体重评价
... ... @@ -1689,7 +1700,11 @@
1689 1700 data.put("doctorSuggests", dss);
1690 1701 }
1691 1702  
1692   - healthChargeFacade.addHealthCharge(hospitalId, 5, baby.getId(), null, null, userId, doctorId, true, model.getId());
  1703 + if (hospitalId != null)
  1704 + {
  1705 + healthChargeFacade.addHealthCharge(hospitalId, 5, baby.getId(), null, null, userId, doctorId, true, model.getId());
  1706 + }
  1707 +
1693 1708 }
1694 1709 objectResponse.setData(data);
1695 1710 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
... ... @@ -1872,8 +1887,13 @@
1872 1887 Map data = new HashMap();
1873 1888  
1874 1889 BabyNutritionQuery babyQuery = new BabyNutritionQuery();
1875   - String hospitalId = autoMatchFacade.getHospitalId(userId);
1876   - babyQuery.setHospitalId(hospitalId);
  1890 + String hospitalId = null;
  1891 + if (userId != null)
  1892 + {
  1893 + hospitalId = autoMatchFacade.getHospitalId(userId);
  1894 + babyQuery.setHospitalId(hospitalId);
  1895 + }
  1896 +
1877 1897 babyQuery.setId(id);
1878 1898  
1879 1899 List<BabyNutritionModel> models = babyNutritionService.queryBabyNutritions(babyQuery);
... ... @@ -1881,6 +1901,15 @@
1881 1901 BabyNutritionModel model = models.get(0);
1882 1902 BabyModel baby = babyBookbuildingService.queryBabyBuildById(model.getBabyId());
1883 1903  
  1904 + BabyQhdfyDietSelect dbSelect =
  1905 + mongoTemplate.findOne(Query.query(Criteria.where("dietId").is(model.getId())), BabyQhdfyDietSelect.class);
  1906 + if (dbSelect != null)
  1907 + {
  1908 + oid = dbSelect.getOid();
  1909 + rid = dbSelect.getRid();
  1910 + }
  1911 +
  1912 +
1884 1913 Map map = new HashMap();
1885 1914 map.put("id", model.getId());
1886 1915 map.put("babyId", model.getBabyId());
... ... @@ -1892,7 +1921,8 @@
1892 1921 map.put("vcCardNo", baby.getVcCardNo());
1893 1922 map.put("weight", model.getWeight());
1894 1923 map.put("height", model.getHeight());
1895   - Organization org = organizationService.getOrganization(Integer.parseInt(hospitalId));
  1924 + Organization org = organizationService.getOrganization(Integer.parseInt(model.getHospitalId()));
  1925 + map.put("hospitalId", org.getId());
1896 1926 map.put("hospitalName", org.getName());
1897 1927 map.put("reportMonthAge", StringUtils.emptyDeal(DateUtil.getBabyMonthAge(baby.getBirth(), model.getNutritiTime())));
1898 1928  
... ... @@ -2228,7 +2258,10 @@
2228 2258 data.put("doctorSuggests", dss);
2229 2259 }
2230 2260  
2231   - healthChargeFacade.addHealthCharge(hospitalId, 5, baby.getId(), null, null, userId, doctorId, true, model.getId());
  2261 + if (hospitalId != null)
  2262 + {
  2263 + healthChargeFacade.addHealthCharge(hospitalId, 5, baby.getId(), null, null, userId, doctorId, true, model.getId());
  2264 + }
2232 2265  
2233 2266 map.put("kaupEvaluate", getBabyStatus(month, baby.getSex(), model.getHeight(), model.getWeight(), bmi));
2234 2267 }