Commit fd3801843ad7c3bd1545e43284fbdbaa5f42d284

Authored by liquanyu
1 parent 38b951eae3

血糖报告

Showing 2 changed files with 28 additions and 19 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java View file @ fd38018
... ... @@ -1300,7 +1300,7 @@
1300 1300 // weightWeek("F:\\体重与营养管理\\体重与营养管理第三版(北方)改标红“、冰淇淋”-晓萌.xls");
1301 1301 // weightMange("F:\\体重与营养管理\\体重与营养管理第三版(北方)改标红“、冰淇淋”-晓萌.xls");
1302 1302 // weightFood("F:\\体重与营养管理\\体重与营养管理第三版(北方)改标红“、冰淇淋”-晓萌.xls");
1303   - bloodSugar("F:\\血糖报告\\血糖报告\\血糖报告基础数据格式.xls");
  1303 + bloodSugar("F:\\血糖报告\\血糖报告\\血糖报告基础数据格式(2).xls");
1304 1304 }
1305 1305  
1306 1306 public static void addBaby(ApplicationContext applicationContext) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java View file @ fd38018
... ... @@ -497,6 +497,8 @@
497 497 return true;
498 498 }
499 499  
  500 +
  501 +
500 502 Map<String,Object> map = getFirstBloodSugarDate(pid);
501 503 if (map.size() != 0)
502 504 {
... ... @@ -575,6 +577,13 @@
575 577 }
576 578 }
577 579  
  580 + Patients patients = mongoTemplate.findById(one.getParentId(), Patients.class);
  581 + int week = DateUtil.getWeek2(patients.getLastMenses(), DateUtil.formatDate(one.getCreated()));
  582 + if (week < 6)
  583 + {
  584 + return false;
  585 + }
  586 +
578 587 one.setMonitorStatus(monitorStatus);
579 588 one.setReportDate(DateUtil.formatDate(one.getCreated()));
580 589 one.setStatus(1); //报告状态 1未查看 2查看
... ... @@ -661,8 +670,8 @@
661 670 if (blood.getType() != null && blood.getType() == 2)
662 671 {
663 672 BloodSugarConfigModel medicineModel = mongoTemplate.findOne(Query.query(Criteria.where("type").is(3).and("week").is(String.valueOf(week))), BloodSugarConfigModel.class);
664   - medicineData.put("medicineTitle",medicineModel.getTitle());
665   - medicineData.put("medicineList", medicineModel.getWeekContents());
  673 + medicineData.put("medicineList",medicineModel.getWeekContents());
  674 + medicineData.put("medicineList1", medicineModel.getWeekContentsTwo());
666 675 }
667 676 reusltMap.put("medicineData",medicineData);
668 677  
... ... @@ -686,7 +695,8 @@
686 695 BloodSugarConfigModel dietModel = null;
687 696 List<BloodSugarConfigModel> dietModels = getWeightConfigBykcal(kmap,ReportConfig.getNSArea(basicConfig.getName()));
688 697  
689   - if (blood.getStatus() == null || blood.getStatus() == 1)
  698 +
  699 + if (CollectionUtils.isNotEmpty(dietModels) && dietModels.size() == 2)
690 700 {
691 701 BloodSugarQuery query = new BloodSugarQuery();
692 702 query.setIsExistReportDate(true);
693 703  
694 704  
... ... @@ -715,20 +725,19 @@
715 725 //更新状态为查看
716 726 blood.setStatus(2);
717 727 bloodSugarService.update(blood);
718   - }
719 728  
720 729  
721   - Map<String,Object> dietModelData = new HashMap<>();
722   - dietModelData.put("breakfast",dietModel.getBreakfast());
723   - dietModelData.put("breakfastAdd",dietModel.getBreakfastAdd());
724   - dietModelData.put("lunch",dietModel.getLunch());
725   - dietModelData.put("lunchAdd",dietModel.getLunchAdd());
726   - dietModelData.put("dinner",dietModel.getDinner());
727   - dietModelData.put("dinnerAdd",dietModel.getDinnerAdd());
728   - dietModelData.put("suggests", dietModel.getSuggests());
729   - reusltMap.put("dietModelDataData",dietModelData);
  730 + Map<String,Object> dietModelData = new HashMap<>();
  731 + dietModelData.put("breakfast",dietModel.getBreakfast());
  732 + dietModelData.put("breakfastAdd",dietModel.getBreakfastAdd());
  733 + dietModelData.put("lunch",dietModel.getLunch());
  734 + dietModelData.put("lunchAdd",dietModel.getLunchAdd());
  735 + dietModelData.put("dinner",dietModel.getDinner());
  736 + dietModelData.put("dinnerAdd",dietModel.getDinnerAdd());
  737 + dietModelData.put("suggests", dietModel.getSuggests());
  738 + reusltMap.put("dietModelDataData",dietModelData);
  739 + }
730 740  
731   -
732 741 //不同孕周的营养指南
733 742 BloodSugarConfigModel nutritionModel = mongoTemplate.findOne(Query.query(Criteria.where("type").is(6).and("week").is(String.valueOf(week))), BloodSugarConfigModel.class);
734 743 Map<String,Object> nutritionModelData = new HashMap<>();
735 744  
736 745  
737 746  
... ... @@ -755,13 +764,13 @@
755 764 k1+=100;
756 765 }
757 766  
758   - if (k1 < 1000)
  767 + if (k1 < 1500)
759 768 {
760   - k1 = 1000;
  769 + k1 = 1500;
761 770 }
762   - else if (k1 > 3300)
  771 + else if (k1 > 2800)
763 772 {
764   - k1 = 3300;
  773 + k1 = 2800;
765 774 }
766 775 List<BloodSugarConfigModel> bloodSugarConfigModels = mongoTemplate.find(Query.query(Criteria.where("northSouth").is(northSouth).and("kcal").is(String.valueOf(k1)).and("type").is(5)),
767 776 BloodSugarConfigModel.class);