diff --git a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java index 04b82e5..f6d1732 100644 --- a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java +++ b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java @@ -1551,7 +1551,7 @@ public class BasicConfigServiceTest { for(int i = 1 ;i < rows ; i++){ System.out.println("rows="+i); BabyConfigModel model = new BabyConfigModel(); - //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-36月热量计算 + //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-35月热量计算 4.12--36喂养指南 5. 36月热量计算 model.setType(0); Cell[] cells = s.getRow(i); if(cells.length > 0){ @@ -1604,7 +1604,7 @@ public class BasicConfigServiceTest { for(int i = 1 ;i < rows1 ; i++){ System.out.println("rows="+i); BabyConfigModel model = new BabyConfigModel(); - //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-36月热量计算 + //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-35月热量计算 4.12--36喂养指南 5. 36月热量计算 model.setType(1); Cell[] cells = s1.getRow(i); if(cells.length > 0){ @@ -1647,7 +1647,7 @@ public class BasicConfigServiceTest { for(int i = 1 ;i < rows2 ; i++){ System.out.println("rows="+i); BabyConfigModel model = new BabyConfigModel(); - //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-36月热量计算 + //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-35月热量计算 4.12--36喂养指南 5. 36月热量计算 model.setType(2); Cell[] cells = s2.getRow(i); if(cells.length > 0){ @@ -1688,7 +1688,7 @@ public class BasicConfigServiceTest { for(int i = 1 ;i < rows3 ; i++){ System.out.println("rows="+i); BabyConfigModel model = new BabyConfigModel(); - //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-36月热量计算 + //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-35月热量计算 4.12--36喂养指南 5. 36月热量计算 model.setType(3); Cell[] cells = s3.getRow(i); if(cells.length > 0){ @@ -1731,7 +1731,7 @@ public class BasicConfigServiceTest { for(int i = 1 ;i < rows4 ; i++){ System.out.println("rows="+i); BabyConfigModel model = new BabyConfigModel(); - //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-36月热量计算 4.12--36喂养指南 + //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-35月热量计算 4.12--36喂养指南 5. 36月热量计算 model.setType(4); Cell[] cells = s4.getRow(i); if(cells.length > 0){ @@ -1766,6 +1766,50 @@ public class BasicConfigServiceTest { } + + + Sheet s5 = wb.getSheet(5); + System.out.println(s5.getName() + " : "); + int rows5 = s5.getRows(); + if(rows5 > 0){ + //遍历每行 + for(int i = 1 ;i < rows5 ; i++){ + System.out.println("rows="+i); + BabyConfigModel model = new BabyConfigModel(); + //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-35月热量计算 4.12--36喂养指南 5. 36月热量计算 + model.setType(5); + Cell[] cells = s5.getRow(i); + if(cells.length > 0){ + //遍历每行中的每列 + for (int j = 0 ; j < cells.length ; j ++) + { + String str = cells[j].getContents().trim(); + if (!com.lyms.platform.common.utils.StringUtils.isNotEmpty(str)) + { + continue; + } + switch (j) + { + case 0: + model.setKcal(Double.parseDouble(str)); + continue; + case 1: + model.setTitle(str); + continue; + case 2: + List list2 = Arrays.asList(str.split("\n")); + model.setContentOne(list2); + continue; + case 3: + model.setStatus(str); + continue; + } + } + } + mongoTemplate.save(model); + } + } + } catch (IOException e) { e.printStackTrace(); } catch (BiffException e) { diff --git a/platform-dal/src/main/java/com/lyms/platform/pojo/BabyConfigModel.java b/platform-dal/src/main/java/com/lyms/platform/pojo/BabyConfigModel.java index 838a7d1..9f16565 100644 --- a/platform-dal/src/main/java/com/lyms/platform/pojo/BabyConfigModel.java +++ b/platform-dal/src/main/java/com/lyms/platform/pojo/BabyConfigModel.java @@ -19,7 +19,7 @@ public class BabyConfigModel { private List contentThree;// private List contentFour;// private Double kcal; //热量 - private Integer type; //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-36月热量计算 4.12--36喂养指南 + private Integer type; //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-35月热量计算 4.12--36喂养指南 5. 36月热量计算 private String status; // 消瘦、正常、超重 diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java index da2de25..c6ed24f 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java @@ -2204,12 +2204,14 @@ public class BabyCheckFacade { { List> list = new ArrayList<>(); double kcal = 0; + int type = 3; if (month < 36) { kcal = 89 * Double.parseDouble(checkModel.getWeight()) - 100 + 20; } else { + type = 5; //男童:88.5-61.9×年龄(岁)+PA[26.7×体重(kg)+903×身长(m)]+20kcal/day // PA=1.26 //女童:135.3-30.8×年龄(岁)+PA[10×体重(kg)+934×身长(m)]+20kcal/day @@ -2223,7 +2225,7 @@ public class BabyCheckFacade { } } kcal = getKaul(kcal); - List configModels = mongoTemplate.find(Query.query(Criteria.where("kcal").is(kcal).and("status").is(kaupEvaluate).and("type").is(3)), BabyConfigModel.class); + List configModels = mongoTemplate.find(Query.query(Criteria.where("kcal").is(kcal).and("status").is(kaupEvaluate).and("type").is(type)), BabyConfigModel.class); if (CollectionUtils.isNotEmpty(configModels) && configModels.size() == 3) { for (BabyConfigModel configModel : configModels)