Commit 86752f01920294d56120703ea020b072cffe60c2
1 parent
1cbd252992
Exists in
master
and in
6 other branches
医生端血糖修改
Showing 1 changed file with 42 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java
View file @
86752f0
... | ... | @@ -1595,12 +1595,53 @@ |
1595 | 1595 | |
1596 | 1596 | @Override |
1597 | 1597 | public BaseResponse getDoctorWx(String patientId) { |
1598 | + | |
1599 | + | |
1600 | + | |
1598 | 1601 | Patients pat = patientsService.findOnePatientById(patientId); |
1602 | + | |
1603 | + List<DiabetesRecordModel> recordModels = mongoTemplate.find(Query.query(Criteria.where("pid").is(pat.getPid())), DiabetesRecordModel | |
1604 | + .class); | |
1605 | + | |
1599 | 1606 | List<BloodSugar> bloodSugars = mongoTemplate.find(Query.query(Criteria.where("pid").is(pat.getPid()).and("yn").is(1)).with(new Sort(Sort.Direction.DESC, "created")), BloodSugar.class); |
1600 | - List<Map<String, Object>> restList = new ArrayList<>(); | |
1607 | + List<Map<String, Object>> restList = new LinkedList<>(); | |
1601 | 1608 | if(CollectionUtils.isNotEmpty(bloodSugars)) { |
1602 | 1609 | for (BloodSugar bloodSugar : bloodSugars) { |
1603 | 1610 | Map<String, Object> temp = new HashMap<>(); |
1611 | + String content = ""; | |
1612 | + if (CollectionUtils.isNotEmpty(recordModels)) | |
1613 | + { | |
1614 | + for (DiabetesRecordModel diabetesRecordModel : recordModels) | |
1615 | + { | |
1616 | + if (bloodSugar.getCreatYmdDate() != null && bloodSugar.getCreatYmdDate().equals(DateUtil.getyyyy_MM_dd(diabetesRecordModel.getCreated())) ) | |
1617 | + { | |
1618 | + switch (bloodSugar.getBloodSugarType()) | |
1619 | + { | |
1620 | + //A(1, "空腹"), C(3, "早餐后"), D(4, "午餐前"), E(5, "午餐后"), F(6, "晚餐前"), G(7, "晚餐后") | |
1621 | + case 1: | |
1622 | + content = diabetesRecordModel.getBreakfast(); | |
1623 | + break; | |
1624 | + case 3: | |
1625 | + content = diabetesRecordModel.getBreakfastAdd(); | |
1626 | + break; | |
1627 | + case 4: | |
1628 | + content = diabetesRecordModel.getLunch(); | |
1629 | + break; | |
1630 | + case 5: | |
1631 | + content = diabetesRecordModel.getLunchAdd(); | |
1632 | + break; | |
1633 | + case 6: | |
1634 | + content = diabetesRecordModel.getDinner(); | |
1635 | + break; | |
1636 | + case 7: | |
1637 | + content = diabetesRecordModel.getDinnerAdd(); | |
1638 | + break; | |
1639 | + } | |
1640 | + } | |
1641 | + } | |
1642 | + | |
1643 | + } | |
1644 | + temp.put("content", content); | |
1604 | 1645 | temp.put("createTime", bloodSugar.getCreatYmdDate()); |
1605 | 1646 | temp.put("bloodSugar", bloodSugar.getBloodSugar()); |
1606 | 1647 | temp.put("bloodSugarType", BloodSugarEnums.getName(bloodSugar.getBloodSugarType())); |