Commit f48e549e753a1539c25c19ed668c2f27bd916c91
1 parent
29525a0fb2
Exists in
master
and in
6 other branches
改app的曲线返回
Showing 1 changed file with 26 additions and 3 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
f48e549
... | ... | @@ -686,9 +686,12 @@ |
686 | 686 | |
687 | 687 | Map<String, Object> reportModel = new HashMap<>(); |
688 | 688 | Map<String, Object> series = new HashMap<>(); |
689 | - series.put("lowData", MathUtil.doubleFormat2(CollectionUtils.getValList(lowMap))); | |
690 | - series.put("highData", MathUtil.doubleFormat2(CollectionUtils.getValList(highMap))); | |
691 | - series.put("normalData", MathUtil.doubleFormat2(CollectionUtils.getValList(normalMap))); | |
689 | +// series.put("lowData", MathUtil.doubleFormat2(CollectionUtils.getValList(lowMap))); | |
690 | +// series.put("highData", MathUtil.doubleFormat2(CollectionUtils.getValList(highMap))); | |
691 | +// series.put("normalData", MathUtil.doubleFormat2(CollectionUtils.getValList(normalMap))); | |
692 | + series.put("lowData", delOtherPort(CollectionUtils.getValList(lowMap))); | |
693 | + series.put("highData", delOtherPort(CollectionUtils.getValList(highMap))); | |
694 | + series.put("normalData", delOtherPort(CollectionUtils.getValList(normalMap))); | |
692 | 695 | |
693 | 696 | series.put("dayWeights", restList); |
694 | 697 | |
... | ... | @@ -721,6 +724,26 @@ |
721 | 724 | } |
722 | 725 | series.put("portData", list); |
723 | 726 | restMap.put("reportModel", reportModel); |
727 | + } | |
728 | + | |
729 | + /** | |
730 | + * 只保留3个点 app和小程序需要 | |
731 | + */ | |
732 | + public static List<Double> delOtherPort(List<Double> list) { | |
733 | + List<Double> restList = new ArrayList<>(); | |
734 | + for (int i = 0; i < list.size(); i++) { | |
735 | + | |
736 | + } | |
737 | + if(CollectionUtils.isNotEmpty(list)) { | |
738 | + for (int i = 0; i < list.size(); i++) { | |
739 | + if(i != 0 || i != 13 || i != 40) { | |
740 | + restList.add(0D); | |
741 | + } else { | |
742 | + restList.add(MathUtil.doubleFormat2(list.get(i))); | |
743 | + } | |
744 | + } | |
745 | + } | |
746 | + return restList; | |
724 | 747 | } |
725 | 748 | |
726 | 749 | public void setReport(Map<String, Object> restMap, Map<Integer, String> weights, String beforeWeight, String bmi, Map<String, String> dayWeights) { |