Commit 53ec7e977be74ed49bf659fd0aeeeb9eeae04462

Authored by liquanyu
1 parent be797c186d

儿童营养报告

Showing 3 changed files with 53 additions and 7 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java View file @ 53ec7e9
... ... @@ -1551,7 +1551,7 @@
1551 1551 for(int i = 1 ;i < rows ; i++){
1552 1552 System.out.println("rows="+i);
1553 1553 BabyConfigModel model = new BabyConfigModel();
1554   - //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-36月热量计算
  1554 + //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-35月热量计算 4.12--36喂养指南 5. 36月热量计算
1555 1555 model.setType(0);
1556 1556 Cell[] cells = s.getRow(i);
1557 1557 if(cells.length > 0){
... ... @@ -1604,7 +1604,7 @@
1604 1604 for(int i = 1 ;i < rows1 ; i++){
1605 1605 System.out.println("rows="+i);
1606 1606 BabyConfigModel model = new BabyConfigModel();
1607   - //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-36月热量计算
  1607 + //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-35月热量计算 4.12--36喂养指南 5. 36月热量计算
1608 1608 model.setType(1);
1609 1609 Cell[] cells = s1.getRow(i);
1610 1610 if(cells.length > 0){
... ... @@ -1647,7 +1647,7 @@
1647 1647 for(int i = 1 ;i < rows2 ; i++){
1648 1648 System.out.println("rows="+i);
1649 1649 BabyConfigModel model = new BabyConfigModel();
1650   - //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-36月热量计算
  1650 + //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-35月热量计算 4.12--36喂养指南 5. 36月热量计算
1651 1651 model.setType(2);
1652 1652 Cell[] cells = s2.getRow(i);
1653 1653 if(cells.length > 0){
... ... @@ -1688,7 +1688,7 @@
1688 1688 for(int i = 1 ;i < rows3 ; i++){
1689 1689 System.out.println("rows="+i);
1690 1690 BabyConfigModel model = new BabyConfigModel();
1691   - //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-36月热量计算
  1691 + //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-35月热量计算 4.12--36喂养指南 5. 36月热量计算
1692 1692 model.setType(3);
1693 1693 Cell[] cells = s3.getRow(i);
1694 1694 if(cells.length > 0){
... ... @@ -1731,7 +1731,7 @@
1731 1731 for(int i = 1 ;i < rows4 ; i++){
1732 1732 System.out.println("rows="+i);
1733 1733 BabyConfigModel model = new BabyConfigModel();
1734   - //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-36月热量计算 4.12--36喂养指南
  1734 + //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-35月热量计算 4.12--36喂养指南 5. 36月热量计算
1735 1735 model.setType(4);
1736 1736 Cell[] cells = s4.getRow(i);
1737 1737 if(cells.length > 0){
... ... @@ -1765,6 +1765,50 @@
1765 1765 }
1766 1766 }
1767 1767  
  1768 +
  1769 +
  1770 +
  1771 + Sheet s5 = wb.getSheet(5);
  1772 + System.out.println(s5.getName() + " : ");
  1773 + int rows5 = s5.getRows();
  1774 + if(rows5 > 0){
  1775 + //遍历每行
  1776 + for(int i = 1 ;i < rows5 ; i++){
  1777 + System.out.println("rows="+i);
  1778 + BabyConfigModel model = new BabyConfigModel();
  1779 + //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-35月热量计算 4.12--36喂养指南 5. 36月热量计算
  1780 + model.setType(5);
  1781 + Cell[] cells = s5.getRow(i);
  1782 + if(cells.length > 0){
  1783 + //遍历每行中的每列
  1784 + for (int j = 0 ; j < cells.length ; j ++)
  1785 + {
  1786 + String str = cells[j].getContents().trim();
  1787 + if (!com.lyms.platform.common.utils.StringUtils.isNotEmpty(str))
  1788 + {
  1789 + continue;
  1790 + }
  1791 + switch (j)
  1792 + {
  1793 + case 0:
  1794 + model.setKcal(Double.parseDouble(str));
  1795 + continue;
  1796 + case 1:
  1797 + model.setTitle(str);
  1798 + continue;
  1799 + case 2:
  1800 + List<String> list2 = Arrays.asList(str.split("\n"));
  1801 + model.setContentOne(list2);
  1802 + continue;
  1803 + case 3:
  1804 + model.setStatus(str);
  1805 + continue;
  1806 + }
  1807 + }
  1808 + }
  1809 + mongoTemplate.save(model);
  1810 + }
  1811 + }
1768 1812  
1769 1813 } catch (IOException e) {
1770 1814 e.printStackTrace();
platform-dal/src/main/java/com/lyms/platform/pojo/BabyConfigModel.java View file @ 53ec7e9
... ... @@ -19,7 +19,7 @@
19 19 private List<String> contentThree;//
20 20 private List<String> contentFour;//
21 21 private Double kcal; //热量
22   - private Integer type; //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-36月热量计算 4.12--36喂养指南
  22 + private Integer type; //0 0-11月龄 1 0-11月热量计算 2 12-36月龄 3 12-35月热量计算 4.12--36喂养指南 5. 36月热量计算
23 23  
24 24 private String status; // 消瘦、正常、超重
25 25  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java View file @ 53ec7e9
... ... @@ -2204,12 +2204,14 @@
2204 2204 {
2205 2205 List<Map<String,Object>> list = new ArrayList<>();
2206 2206 double kcal = 0;
  2207 + int type = 3;
2207 2208 if (month < 36)
2208 2209 {
2209 2210 kcal = 89 * Double.parseDouble(checkModel.getWeight()) - 100 + 20;
2210 2211 }
2211 2212 else
2212 2213 {
  2214 + type = 5;
2213 2215 //男童:88.5-61.9×年龄(岁)+PA[26.7×体重(kg)+903×身长(m)]+20kcal/day
2214 2216 // PA=1.26
2215 2217 //女童:135.3-30.8×年龄(岁)+PA[10×体重(kg)+934×身长(m)]+20kcal/day
... ... @@ -2223,7 +2225,7 @@
2223 2225 }
2224 2226 }
2225 2227 kcal = getKaul(kcal);
2226   - List<BabyConfigModel> configModels = mongoTemplate.find(Query.query(Criteria.where("kcal").is(kcal).and("status").is(kaupEvaluate).and("type").is(3)), BabyConfigModel.class);
  2228 + List<BabyConfigModel> configModels = mongoTemplate.find(Query.query(Criteria.where("kcal").is(kcal).and("status").is(kaupEvaluate).and("type").is(type)), BabyConfigModel.class);
2227 2229 if (CollectionUtils.isNotEmpty(configModels) && configModels.size() == 3)
2228 2230 {
2229 2231 for (BabyConfigModel configModel : configModels)