Commit 64486c8b4554319d2e2b2794ded4304ac40f0454

Authored by liquanyu
1 parent 74e06aaf2f

儿童营养报告

Showing 3 changed files with 77 additions and 0 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionFacade.java View file @ 64486c8
... ... @@ -10,6 +10,7 @@
10 10 import com.lyms.platform.operate.web.result.*;
11 11 import com.lyms.platform.operate.web.service.PatientWeightService;
12 12  
  13 +import com.lyms.platform.permission.model.Organization;
13 14 import com.lyms.platform.permission.service.MeasureDataInfoService;
14 15 import com.lyms.platform.permission.service.OrganizationService;
15 16 import com.lyms.platform.permission.service.UsersService;
16 17  
... ... @@ -42,7 +43,10 @@
42 43 @Autowired
43 44 private AutoMatchFacade autoMatchFacade;
44 45  
  46 + @Autowired
  47 + private OrganizationService organizationService;
45 48  
  49 +
46 50 public BaseObjectResponse queryBabyNutritionRecord(String babyId) {
47 51 Map<String, Object> resMap = new HashMap<>();
48 52 BabyBasicResult base = new BabyBasicResult();
... ... @@ -127,6 +131,8 @@
127 131 {
128 132 BabyNutritionResult result = new BabyNutritionResult();
129 133 result.convertToResult(models.get(0));
  134 + Organization org = organizationService.getOrganization(Integer.parseInt(result.getHospitalId()));
  135 + result.setHospitalName(org.getName());
130 136  
131 137 objectResponse.setData(result);
132 138 }
... ... @@ -144,6 +150,15 @@
144 150 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
145 151 objectResponse.setErrormsg("成功");
146 152 return objectResponse;
  153 + }
  154 +
  155 +
  156 + public List<FoodResult> getFoods(String ids) {
  157 + Map<String,String> map = new HashMap<String, String>();
  158 + map.put("ids",ids);
  159 + String data = HttpClientUtil.doGet(amsUrl + "/v1/getFoodsByIds", map, "utf-8", "3d19960bf3e81e7d816c4f26051c49ba");
  160 + List<FoodResult> results = JsonUtil.toList(data, FoodResult.class);
  161 + return results;
147 162 }
148 163 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyNutritionResult.java View file @ 64486c8
... ... @@ -22,6 +22,7 @@
22 22 private String babyId;
23 23  
24 24 private String hospitalId;
  25 + private String hospitalName;
25 26  
26 27 private String doctorId;
27 28  
... ... @@ -166,6 +167,14 @@
166 167 setVegXd(model.getVegXd());
167 168 setFruits(model.getFruits());
168 169 return this;
  170 + }
  171 +
  172 + public String getHospitalName() {
  173 + return hospitalName;
  174 + }
  175 +
  176 + public void setHospitalName(String hospitalName) {
  177 + this.hospitalName = hospitalName;
169 178 }
170 179  
171 180 public List<Map> getOilGg() {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/FoodResult.java View file @ 64486c8
  1 +package com.lyms.platform.operate.web.result;
  2 +
  3 +/**
  4 + * Created by Administrator on 2019-01-29.
  5 + */
  6 +public class FoodResult {
  7 +
  8 + private Integer id;
  9 + private Integer protein;
  10 + private Integer categoryId;
  11 + private Integer nutritionId;
  12 + private Integer unitId;
  13 +
  14 + public Integer getId() {
  15 + return id;
  16 + }
  17 +
  18 + public void setId(Integer id) {
  19 + this.id = id;
  20 + }
  21 +
  22 + public Integer getProtein() {
  23 + return protein;
  24 + }
  25 +
  26 + public void setProtein(Integer protein) {
  27 + this.protein = protein;
  28 + }
  29 +
  30 + public Integer getCategoryId() {
  31 + return categoryId;
  32 + }
  33 +
  34 + public void setCategoryId(Integer categoryId) {
  35 + this.categoryId = categoryId;
  36 + }
  37 +
  38 + public Integer getNutritionId() {
  39 + return nutritionId;
  40 + }
  41 +
  42 + public void setNutritionId(Integer nutritionId) {
  43 + this.nutritionId = nutritionId;
  44 + }
  45 +
  46 + public Integer getUnitId() {
  47 + return unitId;
  48 + }
  49 +
  50 + public void setUnitId(Integer unitId) {
  51 + this.unitId = unitId;
  52 + }
  53 +}