Commit e05fe8049a32835ac0cbfdcbff03fe3a3c5c16a1
1 parent
19d3348a81
Exists in
master
and in
6 other branches
儿童营养
Showing 1 changed file with 9 additions and 6 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionFacade.java
View file @
e05fe80
| ... | ... | @@ -339,16 +339,19 @@ |
| 339 | 339 | { |
| 340 | 340 | //根据喂养方式获取 合理喂养 |
| 341 | 341 | Criteria ca = Criteria.where("monthAge").is(month).and("type").is(0).and("status").is(kaupEvaluate); |
| 342 | - if (month < 7) | |
| 342 | + if (month < 7 && StringUtils.isNotEmpty(model.getFeedType())) | |
| 343 | 343 | { |
| 344 | 344 | String feedType = WyTypeEnums.getNameById(Integer.parseInt(model.getFeedType())); |
| 345 | 345 | ca.and("feedType").is(feedType); |
| 346 | + | |
| 347 | + BabyNutritionConfigModel babyNutritionConfig = mongoTemplate.findOne(Query.query(ca), | |
| 348 | + BabyNutritionConfigModel.class); | |
| 349 | + | |
| 350 | + //合理喂养 | |
| 351 | + data.put("hlFeed", babyNutritionConfig.getContentOne()); | |
| 352 | + | |
| 346 | 353 | } |
| 347 | - BabyNutritionConfigModel babyNutritionConfig = mongoTemplate.findOne(Query.query(ca), | |
| 348 | - BabyNutritionConfigModel.class); | |
| 349 | 354 | |
| 350 | - //合理喂养 | |
| 351 | - data.put("hlFeed",babyNutritionConfig.getContentOne()); | |
| 352 | 355 | |
| 353 | 356 | |
| 354 | 357 | BabyNutritionConfigModel babyNutritionConfig1 = mongoTemplate.findOne( |
| ... | ... | @@ -390,7 +393,7 @@ |
| 390 | 393 | Map<String,Object> map1 = new HashMap<>(); |
| 391 | 394 | map1.put("title",configModel.getTitle()); |
| 392 | 395 | map1.put("contents",configModel.getContentOne()); |
| 393 | - list.add(map); | |
| 396 | + list.add(map1); | |
| 394 | 397 | } |
| 395 | 398 | //热量计算 |
| 396 | 399 | data.put("foods",list); |