Commit f994227607cc446366b1e9361d869cf758ab36b8

Authored by liquanyu
1 parent 3ebf653bdc

体重管理

Showing 5 changed files with 220 additions and 136 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java View file @ f994227
... ... @@ -38,6 +38,7 @@
38 38 import org.springframework.context.support.ClassPathXmlApplicationContext;
39 39  
40 40 import org.springframework.data.mongodb.core.MongoTemplate;
  41 +import org.springframework.data.mongodb.core.query.Criteria;
41 42 import org.springframework.data.mongodb.core.query.Query;
42 43 import org.springframework.data.mongodb.core.query.Update;
43 44  
... ... @@ -797,9 +798,7 @@
797 798 Workbook wb = null;
798 799 try {
799 800 wb = Workbook.getWorkbook(file);
800   - Sheet[] sheets = wb.getSheets();
801   -
802   - for(Sheet s : sheets){
  801 + Sheet s = wb.getSheet(0);
803 802 System.out.println(s.getName() + " : ");
804 803 int rows = s.getRows();
805 804 if(rows > 0){
806 805  
... ... @@ -830,15 +829,8 @@
830 829 case 7:
831 830 model.setDinnerAdd(str);
832 831 case 8:
833   - model.setVegetable(str);
834   - case 9 :
835   - model.setFoodMaterial(str);
836   - case 10:
837   - List<String> list = Arrays.asList(str.split("\n"));
838   - model.setMakeMethod(list);
839   - case 11:
840 832 model.setWeightType(str);
841   - case 12:
  833 + case 9:
842 834 List<String> list1 = Arrays.asList(str.split("\n"));
843 835 model.setSuggests(list1);
844 836 }
845 837  
... ... @@ -847,14 +839,13 @@
847 839 }
848 840 }
849 841 }
850   - }
851 842 ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml");
852 843 MongoTemplate mongoTemplate
853 844 = (MongoTemplate) applicationContext.getBean("mongoTemplate");
854 845 mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray());
855 846  
856 847 mongoTemplate.save(model);
857   - System.out.println(model);
  848 +
858 849 } catch (IOException e) {
859 850 e.printStackTrace();
860 851 } catch (BiffException e) {
861 852  
... ... @@ -863,8 +854,83 @@
863 854  
864 855 }
865 856  
  857 +
  858 + public static void weightFood(String fileName)
  859 + {
  860 + File file = new File(fileName);
  861 + Workbook wb = null;
  862 + try {
  863 + wb = Workbook.getWorkbook(file);
  864 + ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml");
  865 + MongoTemplate mongoTemplate
  866 + = (MongoTemplate) applicationContext.getBean("mongoTemplate");
  867 + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray());
  868 +
  869 + Sheet s1 = wb.getSheet(1);
  870 + int rows1 = s1.getRows();
  871 + if(rows1 > 0){
  872 + //遍历每行
  873 + for(int i = 1 ;i < rows1 ; i++){
  874 + WeightManageConfigModel.Cookbook cookbook = new WeightManageConfigModel.Cookbook();
  875 + Cell[] cells = s1.getRow(i);
  876 + if(cells.length > 0){
  877 + //遍历每行中的每列
  878 + for (int j = 0 ; j < cells.length ; j ++)
  879 + {
  880 +
  881 + String str = cells[j].getContents().trim();
  882 + switch (j)
  883 + {
  884 + case 0:
  885 + cookbook.setWeek(str);
  886 + case 1:
  887 + cookbook.setVegetable(str);
  888 + case 2:
  889 + cookbook.setFoodMaterial(str);
  890 + case 3:
  891 + List<String> list1 = Arrays.asList(str.split("\n"));
  892 + cookbook.setMakeMethod(list1);
  893 + case 4:
  894 + cookbook.setWeightType(str);
  895 +
  896 + }
  897 +
  898 +
  899 + }
  900 +
  901 + WeightManageConfigModel weightManageConfigModel = mongoTemplate.findOne(Query.query(Criteria.where("week").is(cookbook.getWeek()).and("weightType").is(cookbook.getWeightType())),
  902 + WeightManageConfigModel.class);
  903 +
  904 + List<WeightManageConfigModel.Cookbook> cookbooks = weightManageConfigModel.getCookbooks();
  905 + if (cookbooks == null)
  906 + {
  907 + cookbooks = new ArrayList<>();
  908 + }
  909 + cookbooks.add(cookbook);
  910 + weightManageConfigModel.setCookbooks(cookbooks);
  911 +
  912 + Update update = MongoConvertHelper
  913 + .convertToNativeUpdate(ReflectionUtils.getUpdateField(weightManageConfigModel));
  914 +
  915 + mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(weightManageConfigModel.getId())),update,
  916 + WeightManageConfigModel.class);
  917 +
  918 + }
  919 + }
  920 + }
  921 +
  922 + } catch (IOException e) {
  923 + e.printStackTrace();
  924 + } catch (BiffException e) {
  925 + e.printStackTrace();
  926 + }
  927 +
  928 + }
  929 +
  930 +
866 931 public static void main(String[] args) {
867   - weightMange("F:\\1.xls");
  932 + weightMange("F:\\体重营养配置模板.xls");
  933 + weightFood("F:\\体重营养配置模板.xls");
868 934 }
869 935  
870 936 public static void addBaby(ApplicationContext applicationContext) {
platform-dal/src/main/java/com/lyms/platform/beans/SerialIdEnum.java View file @ f994227
... ... @@ -15,6 +15,7 @@
15 15 BabyCheckModel("BabyCheckModel", 97531000070L),
16 16 BabyModel("BabyModel", 97531000080L),
17 17 Baby("Baby", 97531000081L),
  18 + Cookbook("Cookbook", 97231020081L),
18 19 BabyVisitModel("BabyVisitModel", 97531000090L),
19 20 BasicConfig("BasicConfig", 97531000100L),
20 21 BCInventoryModel("BCInventoryModel", 97531000110L),
platform-dal/src/main/java/com/lyms/platform/pojo/WeightManageConfigModel.java View file @ f994227
... ... @@ -4,6 +4,7 @@
4 4 import com.lyms.platform.common.result.BaseModel;
5 5 import org.springframework.data.mongodb.core.mapping.Document;
6 6  
  7 +import java.io.Serializable;
7 8 import java.util.Date;
8 9 import java.util.LinkedHashMap;
9 10 import java.util.List;
... ... @@ -27,9 +28,9 @@
27 28 private String dinner;//晚餐
28 29 private String dinnerAdd;//晚加餐
29 30  
30   - private String vegetable;//菜名称
31   - private String foodMaterial; //食材
32   - private List<String> makeMethod;//制作方法
  31 + //食谱
  32 + private List<Cookbook> cookbooks;
  33 +
33 34 private String weightType;//体重类型
34 35 private List<String> suggests;//建议
35 36  
... ... @@ -81,6 +82,14 @@
81 82 this.lunch = lunch;
82 83 }
83 84  
  85 + public List<Cookbook> getCookbooks() {
  86 + return cookbooks;
  87 + }
  88 +
  89 + public void setCookbooks(List<Cookbook> cookbooks) {
  90 + this.cookbooks = cookbooks;
  91 + }
  92 +
84 93 public String getLunchAdd() {
85 94 return lunchAdd;
86 95 }
87 96  
... ... @@ -105,30 +114,7 @@
105 114 this.dinnerAdd = dinnerAdd;
106 115 }
107 116  
108   - public String getVegetable() {
109   - return vegetable;
110   - }
111 117  
112   - public void setVegetable(String vegetable) {
113   - this.vegetable = vegetable;
114   - }
115   -
116   - public String getFoodMaterial() {
117   - return foodMaterial;
118   - }
119   -
120   - public void setFoodMaterial(String foodMaterial) {
121   - this.foodMaterial = foodMaterial;
122   - }
123   -
124   - public List<String> getMakeMethod() {
125   - return makeMethod;
126   - }
127   -
128   - public void setMakeMethod(List<String> makeMethod) {
129   - this.makeMethod = makeMethod;
130   - }
131   -
132 118 public String getWeightType() {
133 119 return weightType;
134 120 }
... ... @@ -145,6 +131,8 @@
145 131 this.suggests = suggests;
146 132 }
147 133  
  134 +
  135 +
148 136 @Override
149 137 public String toString() {
150 138 return "WeightManageConfigModel{" +
151 139  
... ... @@ -157,12 +145,58 @@
157 145 ", lunchAdd='" + lunchAdd + '\'' +
158 146 ", dinner='" + dinner + '\'' +
159 147 ", dinnerAdd='" + dinnerAdd + '\'' +
160   - ", vegetable='" + vegetable + '\'' +
161   - ", foodMaterial=" + foodMaterial +
162   - ", makeMethod=" + makeMethod +
163 148 ", weightType='" + weightType + '\'' +
164 149 ", suggests='" + suggests + '\'' +
165 150 '}';
  151 + }
  152 +
  153 + public static class Cookbook implements Serializable {
  154 + private static final long serialVersionUID = SerialIdEnum.Cookbook.getCid();
  155 + private String vegetable;//菜名称
  156 + private String foodMaterial; //食材
  157 + private List<String> makeMethod;//制作方法
  158 + private String weightType;//体重类型
  159 + private String week;
  160 +
  161 + public String getWeightType() {
  162 + return weightType;
  163 + }
  164 +
  165 + public void setWeightType(String weightType) {
  166 + this.weightType = weightType;
  167 + }
  168 +
  169 + public String getWeek() {
  170 + return week;
  171 + }
  172 +
  173 + public void setWeek(String week) {
  174 + this.week = week;
  175 + }
  176 +
  177 + public String getVegetable() {
  178 + return vegetable;
  179 + }
  180 +
  181 + public void setVegetable(String vegetable) {
  182 + this.vegetable = vegetable;
  183 + }
  184 +
  185 + public String getFoodMaterial() {
  186 + return foodMaterial;
  187 + }
  188 +
  189 + public void setFoodMaterial(String foodMaterial) {
  190 + this.foodMaterial = foodMaterial;
  191 + }
  192 +
  193 + public List<String> getMakeMethod() {
  194 + return makeMethod;
  195 + }
  196 +
  197 + public void setMakeMethod(List<String> makeMethod) {
  198 + this.makeMethod = makeMethod;
  199 + }
166 200 }
167 201 }
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java View file @ f994227
... ... @@ -861,17 +861,17 @@
861 861 try {
862 862 FmPatInfo patInfo = null;
863 863  
864   - List<FmPatInfo> list = queryRunner.query(conn, "SELECT syxh,hzxm as name,sfzh as cardNo,sex as sex,birth,lxrdh as phone, blh FROM THIS4_BASY WHERE lxrdh <> '' and hzxm is not null and hzxm <> '' and len(lxrdh) = 11 and syxh = '"+syxh+"'", new BeanListHandler<FmPatInfo>(FmPatInfo.class));
  864 + List<FmPatInfo> list = queryRunner.query(conn, "SELECT syxh,hzxm as name,sfzh as cardNo,sex as sex,birth,lxrdh as phone, blh FROM THIS4_BASY WHERE syxh = '"+syxh+"'", new BeanListHandler<FmPatInfo>(FmPatInfo.class));
865 865 if (CollectionUtils.isNotEmpty(list)) {
866 866 patInfo = list.get(0);
867 867 }
868   - else
869   - {
870   - List<FmPatInfo> list1 = queryRunner.query(conn, "SELECT SYXH as syxh, BRXM as name,'' as cardNo,BRXB as sex,'' as birth,LXDH as phone,ZYHM as blh FROM JHMK_BASY WHERE len(LXDH) = 11 and SYXH = '"+syxh+"'", new BeanListHandler<FmPatInfo>(FmPatInfo.class));
871   - if (CollectionUtils.isNotEmpty(list1)) {
872   - patInfo = list1.get(0);
873   - }
874   - }
  868 +// else
  869 +// {
  870 +// List<FmPatInfo> list1 = queryRunner.query(conn, "SELECT SYXH as syxh, BRXM as name,'' as cardNo,BRXB as sex,'' as birth,LXDH as phone,ZYHM as blh FROM JHMK_BASY WHERE len(LXDH) = 11 and SYXH = '"+syxh+"'", new BeanListHandler<FmPatInfo>(FmPatInfo.class));
  871 +// if (CollectionUtils.isNotEmpty(list1)) {
  872 +// patInfo = list1.get(0);
  873 +// }
  874 +// }
875 875 return patInfo;
876 876  
877 877 }catch (SQLException e) {
... ... @@ -895,7 +895,7 @@
895 895 try {
896 896 FmPatInfo patInfo = null;
897 897  
898   - List<FmPatInfo> list = queryRunner.query(conn, "SELECT syxh,hzxm as name,sfzh as cardNo,sex as sex,birth,lxrdh as phone, blh FROM THIS4_BASY WHERE hzxm is not null and hzxm <> '' and sfzh = '"+cardNo+"'", new BeanListHandler<FmPatInfo>(FmPatInfo.class));
  898 + List<FmPatInfo> list = queryRunner.query(conn, "SELECT syxh,hzxm as name,sfzh as cardNo,sex as sex,birth,lxrdh as phone, blh FROM THIS4_BASY WHERE sfzh = '"+cardNo+"'", new BeanListHandler<FmPatInfo>(FmPatInfo.class));
899 899 if (CollectionUtils.isNotEmpty(list)) {
900 900 patInfo = list.get(0);
901 901 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ f994227
... ... @@ -22,6 +22,7 @@
22 22 import com.lyms.platform.pojo.DoctorUserMap;
23 23 import com.lyms.platform.pojo.PatientWeight;
24 24 import com.lyms.platform.pojo.Patients;
  25 +import com.lyms.platform.pojo.WeightManageConfigModel;
25 26 import net.sf.json.JSONArray;
26 27 import net.sf.json.JSONObject;
27 28 import org.apache.commons.collections.MapUtils;
... ... @@ -170,8 +171,7 @@
170 171 patientWeight.setOperaterId(userId.toString());
171 172 patientWeight.setCreated(new Date());
172 173 if(StringUtils.isNotBlank(patientWeight.getNowWeight()) && patientWeight.getBeforeHeight() != null) {
173   - patientWeight.setBmi(getBmi(patientWeight.getNowWeight(), patientWeight.getBeforeHeight()));
174   - //patientWeight.setBmi(getBmi(patientWeight.getBeforeWeight(), patientWeight.getBeforeHeight()));
  174 + patientWeight.setBmi(getBmi(patientWeight.getBeforeWeight(), patientWeight.getBeforeHeight()));
175 175 }
176 176 patientWeight.setYn("1");
177 177 // mongoTemplate.save(patientWeight);
178 178  
179 179  
... ... @@ -404,10 +404,35 @@
404 404 pregnancy.replaceAll("\\+0天", "");
405 405 }
406 406 map.put("pregnancy", pregnancy);
407   - if(week != null) {
  407 + if(week != null && StringUtils.isNotEmpty(patientWeight.getBmi())) {
  408 + String weightType = "";
  409 +
  410 + //体重正常 过轻 过重 是依据孕妇BMI指数来的。
  411 + //BMI计算方式:BMI=孕前体重(kg)/【身高(m)×身高(m)】
  412 + //对应范围:BMI<18.5对应体重过轻 BMI=18.5-24.9对应正常体重 BMI>25对应体重过重
  413 +
  414 + double bmi = Double.parseDouble(patientWeight.getBmi());
  415 + if (bmi < 18.5)
  416 + {
  417 + weightType = "过轻";
  418 + }
  419 + else if (bmi >= 18.5 && bmi <= 24.9)
  420 + {
  421 + weightType = "正常";
  422 + }
  423 + else if (bmi > 25)
  424 + {
  425 + weightType = "过重";
  426 + }
  427 + week = 12;
  428 + weightType = "正常";
  429 +
  430 + WeightManageConfigModel configModel = getWeightConfig(String.valueOf(week),weightType);
408 431 setInfo(week, map); // 设置孕期相关营养信息
409   - setRecipe(week, map); // 设置食谱
  432 + setRecipe(map, configModel); // 设置食谱
410 433 setGuide(week, map); // 设置指南
  434 + setSuggest(map, configModel); // 设置建议
  435 + setCookbook(map, configModel); // 设置菜谱
411 436 }
412 437  
413 438 Map<String, String> dayWeights = patientWeight.getDayWeights();
414 439  
415 440  
416 441  
... ... @@ -696,97 +721,39 @@
696 721 }
697 722 }
698 723  
699   - private void setRecipe(Integer week, Map<String, Object> map) {
700   - String recipeTitle1 = "";
701   - String recipeTitle2 = "";
  724 + private void setRecipe(Map<String, Object> map,WeightManageConfigModel configModel) {
702 725 Map<String, Object> breakfast = new LinkedHashMap<>(); // 早餐
703 726 Map<String, Object> breakfast2 = new LinkedHashMap<>(); // 上午加餐
704 727 Map<String, Object> lunch = new LinkedHashMap<>(); // 午餐
705 728 Map<String, Object> lunch2 = new LinkedHashMap<>(); // 下午加餐
706 729 Map<String, Object> dinner = new LinkedHashMap<>(); // 晚餐
707 730 Map<String, Object> dinner2 = new LinkedHashMap<>(); // 晚加餐
708   - if(week <= 12) {
709   - setData(breakfast, "早餐", "(谷类80克,蔬菜70克,蛋类50克,坚果18克,油脂5克)\n" +
710   - "面包(30克);小米绿豆粥(小米25克,绿豆25克);\n" +
711   - "水煮鸡蛋(白皮鸡蛋50克);\n" +
712   - "芝麻拌海带(黑芝麻18克,水发海带70克,芝麻油5克)。");
713   - setData(breakfast2, "上午加餐", "(水果100克)\n" +
714   - "苹果(100克)");
715   - setData(lunch, "午餐", "(谷类125克,蔬菜245克,畜禽肉25克,鱼虾类100克,油脂7克)\n" +
716   - "米饭(粳米125克);\n" +
717   - "清蒸鲤鱼(鲤鱼100克,葱25克、姜15克,花生油2克);\n" +
718   - "清炒荷兰豆(荷兰豆50克,花生油2克);\n" +
719   - "鲜蘑炒肉(鲜蘑菇55克,瘦畜肉20克,花生油2克);\n" +
720   - "菠菜炖肝汤(菠菜100克,畜禽肝5克,花生油1克)。");
721   - setData(lunch2, "下午加餐", "(水果110克)\n" +
722   - "葡萄(110克)");
723   - setData(dinner, "晚餐", "(谷类100克,蔬菜158克,畜禽肉25克,鱼虾类50克,大豆制品70克,油脂7克)\n" +
724   - "肉包子(面粉100克,瘦畜肉25克,芸豆30克,大葱18克,花生油3克);\n" +
725   - "芹菜炒香干(豆腐干70克,嫩芹菜茎55克,花生油2克);\n" +
726   - "虾仁汤(虾仁50克,黄瓜55克,花生油2克)。");
727   - setData(dinner2, "晚加餐", "(乳制品250克)\n" +
728   - "牛奶(250克)");
729 731  
730   - recipeTitle1 = "孕早期营养食谱举例";
731   - recipeTitle2 = "以身高1.60m轻度体力劳动、中等身材的女性为例,孕早期一天所需能量约为1925千卡";
732   - } else if(week <= 28) {
733   - setData(breakfast, "早餐", "(谷类75克,蔬菜70克,蛋类50克,坚果15克,油脂5克)\n" +
734   - "全麦面包(全麦粉25克);小米粥(小米25克,大米25克);\n" +
735   - "煮鸡蛋(鸡蛋50克);\n" +
736   - "莴笋拌花生米(莴笋70克,花生米15克,芝麻油5克)。");
737   - setData(breakfast2, "上午加餐", "(水果110克,乳制品125克)\n" +
738   - "水蜜桃(110克);\n" +
739   - "酸奶(125克)。");
740   - setData(lunch, "午餐", "(谷类125克,蔬菜220克,畜禽肉25克,鱼虾类56克,油脂7克)\n" +
741   - "米饭(粳米125克);\n" +
742   - "青椒肉丝(鸡胸脯肉25克,青甜椒55克,花生油2克);\n" +
743   - "芹菜鱿鱼(芹菜茎55克,鲜鱿鱼40克,花生油2克);\n" +
744   - "清炒木耳菜(木耳菜55克,花生油2克);\n" +
745   - "西红柿菠菜汤(西红柿30克,菠菜25克,虾仁16克,芝麻油1克)。");
746   - setData(lunch2, "下午加餐", "(水果100克,乳制品125克)\n" +
747   - "桔子(100克);\n" +
748   - "酸奶(125克)。");
749   - setData(dinner, "晚餐", "(谷类125克,蔬菜165克,畜禽肉25克,鱼虾类44克,大豆制品180克,油脂8克)\n" +
750   - "米饭(大米125克);\n" +
751   - "红烧鲅鱼(鲜鲅鱼44克,花生油4克);\n" +
752   - "豆腐烩多蔬(南豆腐180克,鲜蘑菇30克,胡萝卜20克,竹笋30克,芸豆25克,花生油3克);\n" +
753   - "海带肉丝汤(水发海带35克,瘦畜肉25克,菠菜25克,花生油1克)。");
754   - setData(dinner2, "晚加餐", "(水果100克,乳制品250克)\n" +
755   - "苹果(100克);\n" +
756   - "酸奶(250克)。");
757   - recipeTitle1 = "孕中期营养食谱举例";
758   - recipeTitle2 = "以身高1.60m轻度体力劳动、中等身材的女性为例,孕中期一天所需能量约为2125千卡";
759   - } else {
760   - setData(breakfast, "早餐", "(谷类75克,蔬菜55克,蛋类50克,坚果15克,油脂5克)\n" +
761   - "鸡蛋发糕(面粉50克,鸡蛋50克,花生油2克);麦片粥(麦片25克);\n" +
762   - "芹菜拌花生米(芹菜茎55克,花生米15克,芝麻油3克)。");
763   - setData(breakfast2, "上午加餐", "(水果100克,乳制品125克)\n" +
764   - "苹果(100克);\n" +
765   - "酸奶(125克)。");
766   - setData(lunch, "午餐", "(谷类125克,蔬菜245克,畜禽肉50克,鱼虾类100克,油脂7克)\n" +
767   - "青菜面(挂面125克,嫩油菜50克,花生油1克);\n" +
768   - "木耳炒鸡片(鸡胸脯肉50克,水发木耳55克,花生油2克);\n" +
769   - "清蒸鲤鱼(鲤鱼100克,葱25克、姜15克,花生油2克);\n" +
770   - "清炒菠菜(菠菜100克,花生油2克)。");
771   - setData(lunch2, "下午加餐", "(水果110克,乳制品125克)\n" +
772   - "葡萄(110克);\n" +
773   - "酸奶(125克)。");
774   - setData(dinner, "晚餐", "(谷类128克,蔬菜106克,畜禽肉50克,鱼虾类15克,大豆制品70克,油脂8克)\n" +
775   - "红豆饭(红豆28克,大米100克);\n" +
776   - "四季豆炒肉丝(芸豆/四季豆50克,瘦畜肉50克,花生油3克);\n" +
777   - "韭菜炒香干(香干70克,韭菜50克,花生油3克);\n" +
778   - "紫菜虾皮汤(干紫菜6克,干虾皮15克,花生油2克)。");
779   - setData(dinner2, "晚加餐", "(水果60克,乳制品250克)\n" +
780   - "鲜枣(60克);\n" +
781   - "酸奶(250克)。");
782   - recipeTitle1 = "孕晚期营养食谱举例";
783   - recipeTitle2 = "以身高1.60m轻度体力劳动、中等身材的女性为例,孕晚期一天所需能量约为2125千卡";
784   - }
  732 + setData(breakfast, "早餐",configModel.getBreakfast());
  733 + setData(breakfast2, "上午加餐", configModel.getBreakfastAdd());
  734 + setData(lunch, "午餐", configModel.getLunch());
  735 + setData(lunch2, "下午加餐", configModel.getLunchAdd());
  736 + setData(dinner, "晚餐", configModel.getDinner());
  737 + setData(dinner2, "晚加餐", configModel.getDinnerAdd());
  738 + String recipeTitle1 = "孕晚期营养食谱举例";
  739 + String recipeTitle2 = configModel.getExample();
785 740 map.put("recipeTitle1", recipeTitle1);
786 741 map.put("recipeTitle2", recipeTitle2);
787 742 map.put("food", Arrays.asList(breakfast, breakfast2, lunch, lunch2, dinner, dinner2));
788 743 }
789 744  
  745 +
  746 + private void setSuggest(Map<String, Object> map,WeightManageConfigModel configModel) {
  747 + List<String> suggests = configModel.getSuggests();
  748 + map.put("suggest", suggests);
  749 + }
  750 +
  751 + private void setCookbook(Map<String, Object> map,WeightManageConfigModel configModel) {
  752 + List<WeightManageConfigModel.Cookbook> cookbooks = configModel.getCookbooks();
  753 + map.put("cookbooks", cookbooks);
  754 + map.put("cookbookTitle", "推荐菜谱");
  755 + }
  756 +
790 757 private void setData(Map<String, Object> map, String key, String value) {
791 758 map.put("id", key);
792 759 map.put("name", value);
... ... @@ -1242,6 +1209,20 @@
1242 1209 Double b = Double.parseDouble(before);
1243 1210 Double n = Double.parseDouble(now);
1244 1211 return MathUtil.doubleFormat2(n - b);
  1212 + }
  1213 +
  1214 +
  1215 + /**
  1216 + * 获取体重配置
  1217 + * @param week 孕周
  1218 + * @param weightType
  1219 + * @return
  1220 + */
  1221 + private WeightManageConfigModel getWeightConfig(String week,String weightType)
  1222 + {
  1223 + WeightManageConfigModel weightManageConfigModel = mongoTemplate.findOne(Query.query(Criteria.where("week").is(week).and("weightType").is(weightType)),
  1224 + WeightManageConfigModel.class);
  1225 + return weightManageConfigModel;
1245 1226 }
1246 1227 }