Commit 0b944cc9b70403c86c9aa5f2c22d3486632e1579
1 parent
8ec5ec1d03
Exists in
master
and in
6 other branches
秦皇岛高危生重 本周注意添加
Showing 3 changed files with 139 additions and 11 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
View file @
0b944cc
... | ... | @@ -6110,6 +6110,111 @@ |
6110 | 6110 | } |
6111 | 6111 | } |
6112 | 6112 | |
6113 | + | |
6114 | + public static void becareful(String fileName) { | |
6115 | + ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml"); | |
6116 | + MongoTemplate mongoTemplate | |
6117 | + = (MongoTemplate) applicationContext.getBean("mongoTemplate"); | |
6118 | + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray()); | |
6119 | + File file = new File(fileName); | |
6120 | + Workbook wb = null; | |
6121 | + try { | |
6122 | + wb = Workbook.getWorkbook(file); | |
6123 | + | |
6124 | + | |
6125 | + Sheet s = wb.getSheet(0); | |
6126 | + System.out.println(s.getName() + " : "); | |
6127 | + int rows = s.getRows(); | |
6128 | + if (rows > 0) { | |
6129 | + //遍历每行 | |
6130 | + for (int i = 1; i < rows; i++) { | |
6131 | + System.out.println("rows=" + i); | |
6132 | + QhdWeightConfigModel weightConfigModel = new QhdWeightConfigModel(); | |
6133 | + weightConfigModel.setIsHighRisk("1"); | |
6134 | + weightConfigModel.setHighRiskIlness("0"); | |
6135 | + Cell[] cells = s.getRow(i); | |
6136 | + if (cells.length > 0) { | |
6137 | + for (int j = 0; j < cells.length; j++) { | |
6138 | + String str = cells[j].getContents().trim(); | |
6139 | + switch (j) { | |
6140 | + case 0: | |
6141 | + weightConfigModel.setWeek(Integer.parseInt(str)); | |
6142 | + continue; | |
6143 | + case 1: | |
6144 | + List<String> list2 = Arrays.asList(str.split("\n")); | |
6145 | + weightConfigModel.setBreakfast(list2); | |
6146 | + continue; | |
6147 | + } | |
6148 | + } | |
6149 | + } | |
6150 | + mongoTemplate.save(weightConfigModel); | |
6151 | + } | |
6152 | + } | |
6153 | + Sheet s1 = wb.getSheet(1); | |
6154 | + System.out.println(s1.getName() + " : "); | |
6155 | + int rows1 = s1.getRows(); | |
6156 | + if (rows1 > 0) { | |
6157 | + //遍历每行 | |
6158 | + for (int i = 1; i < rows1; i++) { | |
6159 | + System.out.println("rows=" + i); | |
6160 | + QhdWeightConfigModel weightConfigModel = new QhdWeightConfigModel(); | |
6161 | + weightConfigModel.setIsHighRisk("1"); | |
6162 | + weightConfigModel.setHighRiskIlness("1"); | |
6163 | + Cell[] cells = s1.getRow(i); | |
6164 | + if (cells.length > 0) { | |
6165 | + for (int j = 0; j < cells.length; j++) { | |
6166 | + String str = cells[j].getContents().trim(); | |
6167 | + switch (j) { | |
6168 | + case 0: | |
6169 | + weightConfigModel.setWeek(Integer.parseInt(str)); | |
6170 | + continue; | |
6171 | + case 1: | |
6172 | + List<String> list2 = Arrays.asList(str.split("\n")); | |
6173 | + weightConfigModel.setBreakfast(list2); | |
6174 | + continue; | |
6175 | + } | |
6176 | + } | |
6177 | + } | |
6178 | + mongoTemplate.save(weightConfigModel); | |
6179 | + } | |
6180 | + } | |
6181 | + | |
6182 | + Sheet s2 = wb.getSheet(2); | |
6183 | + System.out.println(s2.getName() + " : "); | |
6184 | + int rows2 = s2.getRows(); | |
6185 | + if (rows2 > 0) { | |
6186 | + //遍历每行 | |
6187 | + for (int i = 1; i < rows2; i++) { | |
6188 | + System.out.println("rows=" + i); | |
6189 | + QhdWeightConfigModel weightConfigModel = new QhdWeightConfigModel(); | |
6190 | + weightConfigModel.setIsHighRisk("1"); | |
6191 | + weightConfigModel.setHighRiskIlness("2"); | |
6192 | + Cell[] cells = s2.getRow(i); | |
6193 | + if (cells.length > 0) { | |
6194 | + for (int j = 0; j < cells.length; j++) { | |
6195 | + String str = cells[j].getContents().trim(); | |
6196 | + switch (j) { | |
6197 | + case 0: | |
6198 | + weightConfigModel.setWeek(Integer.parseInt(str)); | |
6199 | + continue; | |
6200 | + case 1: | |
6201 | + List<String> list2 = Arrays.asList(str.split("\n")); | |
6202 | + weightConfigModel.setBreakfast(list2); | |
6203 | + continue; | |
6204 | + } | |
6205 | + } | |
6206 | + } | |
6207 | + mongoTemplate.save(weightConfigModel); | |
6208 | + } | |
6209 | + } | |
6210 | + | |
6211 | + | |
6212 | + } catch (Exception e) { | |
6213 | + e.printStackTrace(); | |
6214 | + } | |
6215 | + } | |
6216 | + | |
6217 | + | |
6113 | 6218 | public static void main(String[] args) { |
6114 | 6219 | //weightWeek("F:\\体重与营养管理\\体重与营养管理第三版(北方)改标红“、冰淇淋”-晓萌.xls"); |
6115 | 6220 | // weightMange("F:\\体重与营养管理\\体重与营养管理第三版(北方)改标红“、冰淇淋”-晓萌.xls"); |
... | ... | @@ -6134,7 +6239,7 @@ |
6134 | 6239 | |
6135 | 6240 | //dietaryIntake("F:\\膳食摄入量推荐.xls"); |
6136 | 6241 | |
6137 | - zdyinshu("F:\诊断因素.xls"); | |
6242 | + //zdyinshu("F:\诊断因素.xls"); | |
6138 | 6243 | //saveQhdbabyDiaginose("F:\\承德工位\\秦皇岛儿童诊断 - 副本.xls"); |
6139 | 6244 | |
6140 | 6245 | |
6141 | 6246 | |
... | ... | @@ -6142,12 +6247,12 @@ |
6142 | 6247 | //saveEvaluationCriterionModel2("D:\\user\\workspace\\产品中心\\区域平台\\需求资料\\儿童智能等级.xls"); |
6143 | 6248 | // saveEvaluationCriterionModel3("D:\\user\\workspace\\产品中心\\区域平台\\需求资料\\儿童神经心理发育情况.xls"); |
6144 | 6249 | //saveQhdWeight("F:\\text.xls"); |
6145 | - //saveQhdGaoWeiWeight("F:\秦皇岛高危报告内容.xls"); | |
6250 | + // saveQhdGaoWeiWeight("F:\秦皇岛高危报告内容.xls"); | |
6146 | 6251 | // saveQhdWeight("F:\\text.xls"); |
6147 | 6252 | // baby35Report("C:\\Users\\Administrator\\Desktop\\doc\\秦皇岛3-5月龄膳食报告\\3-5月龄儿童膳食报告内容.xls"); |
6148 | 6253 | // baby35Report("C:\\Users\\Administrator\\Desktop\\doc\\秦皇岛3-5月龄膳食报告\\3-5月龄儿童膳食报告内容.xls"); |
6149 | - saveWeight("F:\\体成分分析报告内容.xls"); | |
6150 | - | |
6254 | + //saveWeight("F:\\体成分分析报告内容.xls"); | |
6255 | + becareful("F:\\秦皇岛生重本周注意.xls"); | |
6151 | 6256 | } |
6152 | 6257 | |
6153 | 6258 |
platform-dal/src/main/java/com/lyms/platform/pojo/QhdWeightConfigModel.java
View file @
0b944cc
... | ... | @@ -32,7 +32,26 @@ |
32 | 32 | private Integer pregnancy; //孕期 |
33 | 33 | |
34 | 34 | private Integer kcal; //整值卡路里 |
35 | + //本周注意 | |
36 | + private List<String> becareful; | |
35 | 37 | |
38 | + private Integer week; | |
39 | + | |
40 | + public Integer getWeek() { | |
41 | + return week; | |
42 | + } | |
43 | + | |
44 | + public void setWeek(Integer week) { | |
45 | + this.week = week; | |
46 | + } | |
47 | + | |
48 | + public List<String> getBecareful() { | |
49 | + return becareful; | |
50 | + } | |
51 | + | |
52 | + public void setBecareful(List<String> becareful) { | |
53 | + this.becareful = becareful; | |
54 | + } | |
36 | 55 | |
37 | 56 | public String getHighRiskIlness() { |
38 | 57 | return highRiskIlness; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
0b944cc
... | ... | @@ -2438,20 +2438,21 @@ |
2438 | 2438 | Map<String, Object> data3 = new HashMap<>(); |
2439 | 2439 | List<String> reiskFactor = patients.getRiskFactorId(); |
2440 | 2440 | for (String reis : reiskFactor) { |
2441 | - | |
2442 | 2441 | //糖尿病 |
2443 | 2442 | if (this.initReport("0").contains(reis)) { |
2444 | 2443 | List<QhdWeightConfigModel> diabetes = mongoTemplate.find(Query.query(Criteria.where("kcal").is(diabetesKcal).and("isHighRisk").is("1").and("highRiskIlness").is("2")), QhdWeightConfigModel.class); |
2445 | - datas.put("1", this.getQhdInfo(weights, data3, diabetes, patientWeight, patients, bmiD, week)); | |
2444 | + QhdWeightConfigModel qhdWeightConfigModel = mongoTemplate.findOne(Query.query(Criteria.where("week").is(week).and("isHighRisk").is("1").and("highRiskIlness").is("2")), QhdWeightConfigModel.class); | |
2445 | + datas.put("1", this.getQhdInfo(weights, data3, diabetes, patientWeight, patients, bmiD, week, qhdWeightConfigModel)); | |
2446 | 2446 | } else if (this.initReport("1").contains(reis)) { |
2447 | 2447 | //高血压 |
2448 | 2448 | List<QhdWeightConfigModel> feritin = mongoTemplate.find(Query.query(Criteria.where("kcal").is(gxyKcal).and("isHighRisk").is("1").and("highRiskIlness").is("0")), QhdWeightConfigModel.class); |
2449 | - System.out.println(feritin.size()); | |
2450 | - datas.put("2", this.getQhdInfo(weights, data2, feritin, patientWeight, patients, bmiD, week)); | |
2449 | + QhdWeightConfigModel qhdWeightConfigModel = mongoTemplate.findOne(Query.query(Criteria.where("week").is(week).and("isHighRisk").is("1").and("highRiskIlness").is("0")), QhdWeightConfigModel.class); | |
2450 | + datas.put("2", this.getQhdInfo(weights, data2, feritin, patientWeight, patients, bmiD, week, qhdWeightConfigModel)); | |
2451 | 2451 | } else if (this.initReport("2").contains(reis)) { |
2452 | + QhdWeightConfigModel qhdWeightConfigModel = mongoTemplate.findOne(Query.query(Criteria.where("week").is(week).and("isHighRisk").is("1").and("highRiskIlness").is("1")), QhdWeightConfigModel.class); | |
2452 | 2453 | //贫血 |
2453 | 2454 | List<QhdWeightConfigModel> anemia = mongoTemplate.find(Query.query(Criteria.where("kcal").is(gxyKcal).and("isHighRisk").is("1").and("highRiskIlness").is("1")), QhdWeightConfigModel.class); |
2454 | - datas.put("3", this.getQhdInfo(weights, data0, anemia, patientWeight, patients, bmiD, week)); | |
2455 | + datas.put("3", this.getQhdInfo(weights, data0, anemia, patientWeight, patients, bmiD, week, qhdWeightConfigModel)); | |
2455 | 2456 | } |
2456 | 2457 | } |
2457 | 2458 | } |
2458 | 2459 | |
... | ... | @@ -2628,9 +2629,12 @@ |
2628 | 2629 | /** |
2629 | 2630 | * 秦皇岛定制 |
2630 | 2631 | **/ |
2631 | - public Map getQhdInfo(Map<Integer, String> weights, Map<String, Object> data, List<QhdWeightConfigModel> weightReportModel, PatientWeight patientWeight, Patients patients, double bmi, int week) { | |
2632 | + public Map getQhdInfo(Map<Integer, String> weights, Map<String, Object> data, | |
2633 | + List<QhdWeightConfigModel> weightReportModel, PatientWeight patientWeight, | |
2634 | + Patients patients, double bmi, int week, QhdWeightConfigModel qhdWeightConfigModel) { | |
2632 | 2635 | setReport(data, weights, patientWeight.getBeforeWeight(), patientWeight.getBmi(), patientWeight.getDayWeights(), patientWeight.getBregmatic()); |
2633 | 2636 | Map userMap = new HashMap(); |
2637 | + | |
2634 | 2638 | userMap.put("userName", patients.getUsername()); |
2635 | 2639 | userMap.put("age", patients.getAge() + "岁"); |
2636 | 2640 | userMap.put("height", patientWeight.getBeforeHeight() + "cm"); |
... | ... | @@ -2696,7 +2700,7 @@ |
2696 | 2700 | map1.put("proposalInfo", qhd.getLaterSuggests()); |
2697 | 2701 | } |
2698 | 2702 | } |
2699 | - | |
2703 | + data.put("becareful", CollectionUtils.isNotEmpty(qhdWeightConfigModel.getBreakfast()) ? qhdWeightConfigModel.getBreakfast() : null); | |
2700 | 2704 | data.put("recipes", map1); |
2701 | 2705 | data.put("dietaryRules", map3); |
2702 | 2706 |