Commit ddeb637896c0b6dcc4cb84338eef30ecc4ec1ce3
1 parent
a820e0c937
Exists in
master
and in
6 other branches
update
Showing 6 changed files with 322 additions and 15 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
- platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
- platform-dal/src/main/java/com/lyms/platform/pojo/BabyDietReportModel.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/Test.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MongoSyncController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionFacade.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
View file @
ddeb637
... | ... | @@ -4221,7 +4221,7 @@ |
4221 | 4221 | for (int i = 1; i < rows; i++) { |
4222 | 4222 | System.out.println("rows=" + i); |
4223 | 4223 | QhdWeightConfigModel qhd = new QhdWeightConfigModel(); |
4224 | - qhd.setIsHighRisk("0"); | |
4224 | + | |
4225 | 4225 | Cell[] cells = s.getRow(i); |
4226 | 4226 | if (cells.length > 0) { |
4227 | 4227 | //遍历每行中的每列 |
... | ... | @@ -4263,7 +4263,7 @@ |
4263 | 4263 | for (int i = 1; i < rows1; i++) { |
4264 | 4264 | System.out.println("rows=" + i); |
4265 | 4265 | QhdWeightConfigModel qhd = new QhdWeightConfigModel(); |
4266 | - qhd.setIsHighRisk("0"); | |
4266 | + | |
4267 | 4267 | Cell[] cells = s1.getRow(i); |
4268 | 4268 | if (cells.length > 0) { |
4269 | 4269 | //遍历每行中的每列 |
... | ... | @@ -4946,7 +4946,6 @@ |
4946 | 4946 | continue; |
4947 | 4947 | } |
4948 | 4948 | } |
4949 | - | |
4950 | 4949 | } |
4951 | 4950 | mongoTemplate.save(babyDiet); |
4952 | 4951 | } |
... | ... | @@ -5028,6 +5027,175 @@ |
5028 | 5027 | |
5029 | 5028 | } |
5030 | 5029 | |
5030 | + | |
5031 | + | |
5032 | + public static void baby35Report(String fileName) { | |
5033 | + ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml"); | |
5034 | + MongoTemplate mongoTemplate | |
5035 | + = (MongoTemplate) applicationContext.getBean("mongoTemplate"); | |
5036 | + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray()); | |
5037 | + File file = new File(fileName); | |
5038 | + Workbook wb = null; | |
5039 | + try { | |
5040 | + wb = Workbook.getWorkbook(file); | |
5041 | + | |
5042 | + Sheet s = wb.getSheet(0); | |
5043 | + System.out.println(s.getName() + " : "); | |
5044 | + int rows = s.getRows(); | |
5045 | + if (rows > 0) { | |
5046 | + //遍历每行 | |
5047 | + for (int i = 1; i < rows; i++) { | |
5048 | + System.out.println("rows=" + i); | |
5049 | + BabyDietReportModel babyDiet = new BabyDietReportModel(); | |
5050 | + babyDiet.setType(1); | |
5051 | + Cell[] cells = s.getRow(i); | |
5052 | + if (cells.length > 0) { | |
5053 | + //遍历每行中的每列 | |
5054 | + for (int j = 0; j < cells.length; j++) { | |
5055 | + String str = cells[j].getContents().trim(); | |
5056 | + switch (j) { | |
5057 | + case 0: | |
5058 | + babyDiet.setStartMonthAge(Integer.parseInt(str)); | |
5059 | + continue; | |
5060 | + case 1: | |
5061 | + babyDiet.setEndMonthAge(Integer.parseInt(str)); | |
5062 | + continue; | |
5063 | + case 2: | |
5064 | + babyDiet.setShape(Integer.parseInt(str)); | |
5065 | + continue; | |
5066 | + case 3: | |
5067 | + List<String> list2 = Arrays.asList(str.split("\n")); | |
5068 | + babyDiet.setFeedingGuide(list2); | |
5069 | + continue; | |
5070 | + } | |
5071 | + } | |
5072 | + } | |
5073 | + mongoTemplate.save(babyDiet); | |
5074 | + } | |
5075 | + } | |
5076 | + | |
5077 | + | |
5078 | + | |
5079 | + Sheet s1 = wb.getSheet(1); | |
5080 | + System.out.println(s1.getName() + " : "); | |
5081 | + int rows1 = s1.getRows(); | |
5082 | + if (rows1 > 0) { | |
5083 | + //遍历每行 | |
5084 | + for (int i = 1; i < rows1; i++) { | |
5085 | + System.out.println("rows=" + i); | |
5086 | + BabyDietReportModel babyDiet = new BabyDietReportModel(); | |
5087 | + babyDiet.setType(1); | |
5088 | + Cell[] cells = s1.getRow(i); | |
5089 | + if (cells.length > 0) { | |
5090 | + //遍历每行中的每列 | |
5091 | + for (int j = 0; j < cells.length; j++) { | |
5092 | + String str = cells[j].getContents().trim(); | |
5093 | + switch (j) { | |
5094 | + case 0: | |
5095 | + babyDiet.setKcal(Integer.parseInt(str)); | |
5096 | + continue; | |
5097 | + case 1: | |
5098 | + List<String> list2 = Arrays.asList(str.split("\n")); | |
5099 | + babyDiet.setDietStructure(list2); | |
5100 | + continue; | |
5101 | + } | |
5102 | + } | |
5103 | + } | |
5104 | + mongoTemplate.save(babyDiet); | |
5105 | + } | |
5106 | + } | |
5107 | + | |
5108 | + | |
5109 | + Sheet s2 = wb.getSheet(2); | |
5110 | + System.out.println(s2.getName() + " : "); | |
5111 | + int rows2 = s2.getRows(); | |
5112 | + if (rows2 > 0) { | |
5113 | + //遍历每行 | |
5114 | + for (int i = 1; i < rows2; i++) { | |
5115 | + System.out.println("rows=" + i); | |
5116 | + BabyDietReportModel babyDiet = new BabyDietReportModel(); | |
5117 | + babyDiet.setType(1); | |
5118 | + Cell[] cells = s2.getRow(i); | |
5119 | + if (cells.length > 0) { | |
5120 | + //遍历每行中的每列 | |
5121 | + for (int j = 0; j < cells.length; j++) { | |
5122 | + String str = cells[j].getContents().trim(); | |
5123 | + switch (j) { | |
5124 | + case 0: | |
5125 | + babyDiet.setKcal(Integer.parseInt(str)); | |
5126 | + continue; | |
5127 | + case 1: | |
5128 | + List<String> list1 = Arrays.asList(str.split("\n")); | |
5129 | + babyDiet.setBreakfast(list1); | |
5130 | + continue; | |
5131 | + case 2: | |
5132 | + List<String> list2 = Arrays.asList(str.split("\n")); | |
5133 | + babyDiet.setBreakfastAdd(list2); | |
5134 | + continue; | |
5135 | + case 3: | |
5136 | + List<String> list3 = Arrays.asList(str.split("\n")); | |
5137 | + babyDiet.setLunch(list3); | |
5138 | + continue; | |
5139 | + case 4: | |
5140 | + List<String> list4 = Arrays.asList(str.split("\n")); | |
5141 | + babyDiet.setLunchAdd(list4); | |
5142 | + continue; | |
5143 | + case 5: | |
5144 | + List<String> list5 = Arrays.asList(str.split("\n")); | |
5145 | + babyDiet.setDinner(list5); | |
5146 | + continue; | |
5147 | + case 6: | |
5148 | + List<String> list6 = Arrays.asList(str.split("\n")); | |
5149 | + babyDiet.setDinnerAdd(list6); | |
5150 | + continue; | |
5151 | + } | |
5152 | + } | |
5153 | + } | |
5154 | + mongoTemplate.save(babyDiet); | |
5155 | + } | |
5156 | + } | |
5157 | + | |
5158 | + | |
5159 | + | |
5160 | + Sheet s3 = wb.getSheet(3); | |
5161 | + System.out.println(s3.getName() + " : "); | |
5162 | + int rows3 = s3.getRows(); | |
5163 | + if (rows3 > 0) { | |
5164 | + //遍历每行 | |
5165 | + for (int i = 1; i < rows3; i++) { | |
5166 | + System.out.println("rows=" + i); | |
5167 | + BabyDietReportModel babyDiet = new BabyDietReportModel(); | |
5168 | + babyDiet.setType(1); | |
5169 | + Cell[] cells = s3.getRow(i); | |
5170 | + if (cells.length > 0) { | |
5171 | + //遍历每行中的每列 | |
5172 | + for (int j = 0; j < cells.length; j++) { | |
5173 | + String str = cells[j].getContents().trim(); | |
5174 | + switch (j) { | |
5175 | + case 0: | |
5176 | + babyDiet.setKcal(Integer.parseInt(str)); | |
5177 | + continue; | |
5178 | + case 1: | |
5179 | + List<String> list2 = Arrays.asList(str.split("\n")); | |
5180 | + babyDiet.setRecommendRecipes(list2); | |
5181 | + continue; | |
5182 | + } | |
5183 | + } | |
5184 | + } | |
5185 | + mongoTemplate.save(babyDiet); | |
5186 | + } | |
5187 | + } | |
5188 | + | |
5189 | + | |
5190 | + } catch (IOException e) { | |
5191 | + e.printStackTrace(); | |
5192 | + } catch (BiffException e) { | |
5193 | + e.printStackTrace(); | |
5194 | + } | |
5195 | + | |
5196 | + } | |
5197 | + | |
5198 | + | |
5031 | 5199 | /** |
5032 | 5200 | * 儿童量表 1 |
5033 | 5201 | * |
5034 | 5202 | |
5035 | 5203 | |
5036 | 5204 | |
... | ... | @@ -5198,15 +5366,10 @@ |
5198 | 5366 | // weightMange("F:\\体重与营养管理\\体重与营养管理第三版(北方)改标红“、冰淇淋”-晓萌.xls"); |
5199 | 5367 | // weightFood("F:\\体重与营养管理\\体重与营养管理第三版(北方)改标红“、冰淇淋”-晓萌.xls"); |
5200 | 5368 | // bloodSugar("F:\\血糖报告\\血糖报告\\血糖报告基础数据格式(2).xls"); |
5201 | - | |
5202 | 5369 | // zcet("D:\\doc\\高血压报告20180813模板.xls"); |
5203 | 5370 | // zcet("D:\\doc\\1.xls",false); |
5204 | - | |
5205 | 5371 | // addBabyBmiHealthConfig("F:\\儿童营养报告\\婴幼儿bmi.xls"); |
5206 | - | |
5207 | 5372 | // babyConfig("F:\\儿童营养报告\\儿童营养报告模板.xls"); |
5208 | - | |
5209 | - | |
5210 | 5373 | //babyNutritionConfig("F:\\儿童营养报告\\婴幼儿体重与营养管理报告内容及规则\\儿童膳食报告文章2.xls"); |
5211 | 5374 | //xyPresentation("E:\\血压报告.xls"); |
5212 | 5375 | //weightReport("E:\\体重营养报告10.xls"); |
5213 | 5376 | |
... | ... | @@ -5226,9 +5389,11 @@ |
5226 | 5389 | |
5227 | 5390 | //saveEvaluationCriterionModel("D:\\user\\workspace\\产品中心\\区域平台\\需求资料\\儿童量表码表.xls"); |
5228 | 5391 | //saveEvaluationCriterionModel2("D:\\user\\workspace\\产品中心\\区域平台\\需求资料\\儿童智能等级.xls"); |
5229 | - // saveEvaluationCriterionModel3("D:\user\workspace\产品中心\区域平台\需求资料\儿童神经心理发育情况.xls"); | |
5392 | +// saveEvaluationCriterionModel3("D:\user\workspace\产品中心\区域平台\需求资料\儿童神经心理发育情况.xls"); | |
5230 | 5393 | //saveQhdWeight("F:\\text.xls"); |
5231 | - saveQhdGaoWeiWeight("F:\\秦皇岛高危版体重报告.xls"); | |
5394 | +// saveQhdGaoWeiWeight("F:\\秦皇岛高危版体重报告.xls"); | |
5395 | +// saveQhdWeight("F:\\text.xls"); | |
5396 | + baby35Report("C:\\Users\\Administrator\\Desktop\\doc\\秦皇岛3-5月龄膳食报告\\3-5月龄儿童膳食报告内容.xls"); | |
5232 | 5397 | } |
5233 | 5398 | |
5234 | 5399 | } |
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
ddeb637
platform-dal/src/main/java/com/lyms/platform/pojo/BabyDietReportModel.java
View file @
ddeb637
... | ... | @@ -49,6 +49,72 @@ |
49 | 49 | //周日 |
50 | 50 | private List<String> sunday; |
51 | 51 | |
52 | + //3-5月龄内容为 1 | |
53 | + private Integer type; | |
54 | + | |
55 | + | |
56 | + private List<String> breakfast;//早餐 | |
57 | + private List<String> breakfastAdd;//上午加餐 | |
58 | + private List<String> lunch;//午餐 | |
59 | + private List<String> lunchAdd;//下午加餐 | |
60 | + private List<String> dinner;//晚餐 | |
61 | + private List<String> dinnerAdd;//晚加餐 | |
62 | + | |
63 | + public List<String> getBreakfast() { | |
64 | + return breakfast; | |
65 | + } | |
66 | + | |
67 | + public void setBreakfast(List<String> breakfast) { | |
68 | + this.breakfast = breakfast; | |
69 | + } | |
70 | + | |
71 | + public List<String> getBreakfastAdd() { | |
72 | + return breakfastAdd; | |
73 | + } | |
74 | + | |
75 | + public void setBreakfastAdd(List<String> breakfastAdd) { | |
76 | + this.breakfastAdd = breakfastAdd; | |
77 | + } | |
78 | + | |
79 | + public List<String> getLunch() { | |
80 | + return lunch; | |
81 | + } | |
82 | + | |
83 | + public void setLunch(List<String> lunch) { | |
84 | + this.lunch = lunch; | |
85 | + } | |
86 | + | |
87 | + public List<String> getLunchAdd() { | |
88 | + return lunchAdd; | |
89 | + } | |
90 | + | |
91 | + public void setLunchAdd(List<String> lunchAdd) { | |
92 | + this.lunchAdd = lunchAdd; | |
93 | + } | |
94 | + | |
95 | + public List<String> getDinner() { | |
96 | + return dinner; | |
97 | + } | |
98 | + | |
99 | + public void setDinner(List<String> dinner) { | |
100 | + this.dinner = dinner; | |
101 | + } | |
102 | + | |
103 | + public List<String> getDinnerAdd() { | |
104 | + return dinnerAdd; | |
105 | + } | |
106 | + | |
107 | + public void setDinnerAdd(List<String> dinnerAdd) { | |
108 | + this.dinnerAdd = dinnerAdd; | |
109 | + } | |
110 | + | |
111 | + public Integer getType() { | |
112 | + return type; | |
113 | + } | |
114 | + | |
115 | + public void setType(Integer type) { | |
116 | + this.type = type; | |
117 | + } | |
52 | 118 | |
53 | 119 | public List<String> getMonday() { |
54 | 120 | return monday; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/Test.java
View file @
ddeb637
... | ... | @@ -15,7 +15,10 @@ |
15 | 15 | |
16 | 16 | private static org.apache.log4j.Logger log = Logger.getLogger("HTTP-INVOKE"); |
17 | 17 | public static void main(String[] args) throws Exception { |
18 | - | |
18 | + double result = 44 * 13.2 / 0.6; | |
19 | + int a = ((int)result/100)*100; | |
20 | + System.out.println(result); | |
21 | + System.out.println(a); | |
19 | 22 | } |
20 | 23 | |
21 | 24 | public static Integer getLevel(Integer total) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MongoSyncController.java
View file @
ddeb637
... | ... | @@ -38,6 +38,12 @@ |
38 | 38 | if(StringUtils.isEmpty(jsonData)){ |
39 | 39 | return "success"; |
40 | 40 | } |
41 | + //TODO | |
42 | + if ("26EB0301C4A2410E90985A3E55856E4BC90B764322A576155B201AFB0BC8C94FFAB29197A8B86F592DD2ABABF896EB89".equals(className)) | |
43 | + { | |
44 | + return "success"; | |
45 | + } | |
46 | + | |
41 | 47 | boolean boo = mongoSyncService.syncData(action,id, className, jsonData); |
42 | 48 | if (boo) { |
43 | 49 | return "success"; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionFacade.java
View file @
ddeb637
... | ... | @@ -1309,13 +1309,13 @@ |
1309 | 1309 | map.put("hospitalName", org.getName()); |
1310 | 1310 | map.put("reportMonthAge", StringUtils.emptyDeal(DateUtil.getBabyMonthAge(baby.getBirth(), model.getNutritiTime()))); |
1311 | 1311 | //体重评价 |
1312 | - String weightEvaluate = babyCheckFacade.getGrowthValue(DateUtil.getyyyy_MM_dd(baby.getBirth()), model.getWeight(), baby.getSex(), null, null, DateUtil.getyyyy_MM_dd(baby.getCreated())); | |
1312 | + String weightEvaluate = babyCheckFacade.getGrowthValue(DateUtil.getyyyy_MM_dd(baby.getBirth()), model.getWeight(), baby.getSex(), null, null, DateUtil.getyyyy_MM_dd(model.getNutritiTime())); | |
1313 | 1313 | map.put("weightEvaluate", weightEvaluate); |
1314 | 1314 | //身高评价 |
1315 | - String heightEvaluate = babyCheckFacade.getGrowthValue1(DateUtil.getyyyy_MM_dd(baby.getBirth()), model.getHeight(), baby.getSex(), 1, null, DateUtil.getyyyy_MM_dd(baby.getCreated())); | |
1315 | + String heightEvaluate = babyCheckFacade.getGrowthValue1(DateUtil.getyyyy_MM_dd(baby.getBirth()), model.getHeight(), baby.getSex(), 1, null, DateUtil.getyyyy_MM_dd(model.getNutritiTime())); | |
1316 | 1316 | map.put("heightEvaluate", heightEvaluate); |
1317 | 1317 | int month = DateUtil.getMonth(baby.getBirth(), model.getNutritiTime()); |
1318 | - if (month > 36) { | |
1318 | + if (month > 60) { | |
1319 | 1319 | return new BaseObjectResponse().setData(data).setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("月龄范围没有报告"); |
1320 | 1320 | } |
1321 | 1321 | //获取bmi值 |
... | ... | @@ -1456,6 +1456,50 @@ |
1456 | 1456 | } |
1457 | 1457 | } |
1458 | 1458 | } |
1459 | + | |
1460 | + if (month > 36 && month <= 60) | |
1461 | + { | |
1462 | + | |
1463 | + int kcal = getThreeAfterKcal(model.getWeight()); | |
1464 | + | |
1465 | + map.put("kaul", String.format("%.2f", 44 * model.getWeight() / 0.6) + "kacl"); | |
1466 | + | |
1467 | + int shape = kaupEvaluate.equals("超重") ? 2 : (kaupEvaluate.equals("消瘦") ? 1 : 0); | |
1468 | + List<BabyDietReportModel> babyDietReportList1 = mongoTemplate.find(Query.query(Criteria.where("shape").is(shape).and("type").is(1)), BabyDietReportModel.class); | |
1469 | + | |
1470 | + for (BabyDietReportModel babyDietReportModel : babyDietReportList1) | |
1471 | + { | |
1472 | + if (babyDietReportModel.getStartMonthAge() <= month && month < babyDietReportModel.getEndMonthAge()) | |
1473 | + { | |
1474 | + data.put("feedingGuide", babyDietReportModel.getFeedingGuide()); | |
1475 | + } | |
1476 | + } | |
1477 | + | |
1478 | + | |
1479 | + List<BabyDietReportModel> babyDietReportList = mongoTemplate.find(Query.query(Criteria.where("kcal").is(kcal).and("type").is(1)), BabyDietReportModel.class); | |
1480 | + for (BabyDietReportModel babyDietReportModel : babyDietReportList) | |
1481 | + { | |
1482 | + if (CollectionUtils.isNotEmpty(babyDietReportModel.getDietStructure())) | |
1483 | + { | |
1484 | + data.put("dietStructure", babyDietReportModel.getDietStructure()); | |
1485 | + } | |
1486 | + if (CollectionUtils.isNotEmpty(babyDietReportModel.getBreakfast())) | |
1487 | + { | |
1488 | + data.put("breakfast", babyDietReportModel.getBreakfast()); | |
1489 | + data.put("breakfastAdd", babyDietReportModel.getBreakfastAdd()); | |
1490 | + data.put("lunch", babyDietReportModel.getLunch()); | |
1491 | + data.put("lunchAdd", babyDietReportModel.getLunchAdd()); | |
1492 | + data.put("dinner", babyDietReportModel.getDinner()); | |
1493 | + data.put("dinnerAdd", babyDietReportModel.getDinnerAdd()); | |
1494 | + } | |
1495 | + if (CollectionUtils.isNotEmpty(babyDietReportModel.getRecommendRecipes())) | |
1496 | + { | |
1497 | + data.put("recommendRecipes", babyDietReportModel.getRecommendRecipes()); | |
1498 | + } | |
1499 | + } | |
1500 | + } | |
1501 | + | |
1502 | + | |
1459 | 1503 | healthChargeFacade.addHealthCharge(hospitalId, 5, baby.getId(), null, null, |
1460 | 1504 | userId, model.getInterpretDoctorId(), true, model.getId()); |
1461 | 1505 | } |
... | ... | @@ -1463,6 +1507,29 @@ |
1463 | 1507 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
1464 | 1508 | objectResponse.setErrormsg("成功"); |
1465 | 1509 | return objectResponse; |
1510 | + } | |
1511 | + | |
1512 | + | |
1513 | + /** | |
1514 | + * 3-5岁热量计算 | |
1515 | + * | |
1516 | + * 3-5岁儿童能量计算规则 | |
1517 | + 每日能量=44×体重÷60% | |
1518 | + * @return | |
1519 | + */ | |
1520 | + private int getThreeAfterKcal(double weight) | |
1521 | + { | |
1522 | + double result = 44 * weight / 0.6; | |
1523 | + int kcal = ((int)result/100)*100; | |
1524 | + if (kcal < 800) | |
1525 | + { | |
1526 | + kcal = 800; | |
1527 | + } | |
1528 | + else if (kcal > 2100) | |
1529 | + { | |
1530 | + kcal = 2100; | |
1531 | + } | |
1532 | + return kcal; | |
1466 | 1533 | } |
1467 | 1534 | |
1468 | 1535 | //秦皇岛精简版算法 |