Commit cf85496cdb53898cede2afab0d3925d69beccecb
1 parent
5864bcd914
Exists in
master
and in
6 other branches
儿童膳食添加
Showing 2 changed files with 78 additions and 0 deletions
platform-dal/src/main/java/com/lyms/platform/pojo/BabySSReportModel.java
View file @
cf85496
| 1 | +package com.lyms.platform.pojo; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.result.BaseModel; | |
| 4 | +import org.springframework.data.mongodb.core.mapping.Document; | |
| 5 | + | |
| 6 | +import java.util.List; | |
| 7 | + | |
| 8 | +@Document(collection = "lyms_baby_ss_report") | |
| 9 | +public class BabySSReportModel extends BaseModel { | |
| 10 | + private String id; | |
| 11 | + | |
| 12 | + | |
| 13 | + //进食行为建议 | |
| 14 | + private List<String> suggests; | |
| 15 | + | |
| 16 | + | |
| 17 | + //喂养常见问题及处理 | |
| 18 | + private List<String> handles; | |
| 19 | + | |
| 20 | + private Integer startMonthAge; | |
| 21 | + | |
| 22 | + private Integer endMonthAge; | |
| 23 | + | |
| 24 | + | |
| 25 | + public String getId() { | |
| 26 | + return id; | |
| 27 | + } | |
| 28 | + | |
| 29 | + public void setId(String id) { | |
| 30 | + this.id = id; | |
| 31 | + } | |
| 32 | + | |
| 33 | + public List<String> getSuggests() { | |
| 34 | + return suggests; | |
| 35 | + } | |
| 36 | + | |
| 37 | + public void setSuggests(List<String> suggests) { | |
| 38 | + this.suggests = suggests; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public List<String> getHandles() { | |
| 42 | + return handles; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public void setHandles(List<String> handles) { | |
| 46 | + this.handles = handles; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public Integer getStartMonthAge() { | |
| 50 | + return startMonthAge; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public void setStartMonthAge(Integer startMonthAge) { | |
| 54 | + this.startMonthAge = startMonthAge; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public Integer getEndMonthAge() { | |
| 58 | + return endMonthAge; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public void setEndMonthAge(Integer endMonthAge) { | |
| 62 | + this.endMonthAge = endMonthAge; | |
| 63 | + } | |
| 64 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionFacade.java
View file @
cf85496
| ... | ... | @@ -1368,6 +1368,20 @@ |
| 1368 | 1368 | //获取热量值 体重在正常范围内的不计算热量值 |
| 1369 | 1369 | double kaul = getKcal(month, model.getWeight(), model.getHeight(), baby.getSex(), kaupEvaluate); |
| 1370 | 1370 | |
| 1371 | + | |
| 1372 | + List<BabySSReportModel> ss = mongoTemplate.find(Query.query(Criteria.where("startMonthAge").lte(month).and("endMonthAge").gte(month)), | |
| 1373 | + BabySSReportModel.class); | |
| 1374 | + if (CollectionUtils.isNotEmpty(ss)) | |
| 1375 | + { | |
| 1376 | + BabySSReportModel ssReportModel = ss.get(0); | |
| 1377 | + | |
| 1378 | + //进食行为建议 | |
| 1379 | + data.put("feedSuggest", ssReportModel.getSuggests()); | |
| 1380 | + //喂养常见问题及处理 | |
| 1381 | + data.put("feedHandle", ssReportModel.getHandles()); | |
| 1382 | + } | |
| 1383 | + | |
| 1384 | + | |
| 1371 | 1385 | double kauls = getBasicKaul(month, model.getWeight(), model.getHeight(), baby.getSex()); |
| 1372 | 1386 | if (month >= 0 && month <= 5) { |
| 1373 | 1387 | List<BabyDietReportModel> babyDietReport = mongoTemplate.find(Query.query(Criteria.where("monthAge").is(month).and("feedingPattern").is(Integer.valueOf(model.getFeedType()))), BabyDietReportModel.class); |