Commit 27b1cf108e24274642c4e462be0c04562c0de3b3

Authored by baohanddd
1 parent 1f0edb2d1d

add statistics(map) common index (area data)

Showing 1 changed file with 47 additions and 48 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/StatisticsController.java View file @ 27b1cf1
... ... @@ -685,55 +685,54 @@
685 685 groupRiskSeriesList.add(groupRiskSeries);
686 686 groupRiskOption.setSeries(groupRiskSeriesList);
687 687  
688   -// for (String areaName:subMapsData.keySet()) {
689   -// try {
690   -// Option subGroupRiskOption = new Option();
691   -// BeanUtils.copyProperties(groupRiskOption, subGroupRiskOption);
692   -// groupRiskOptionMap.put(areaName, subGroupRiskOption);
693   -// subGroupRiskOption.getTitle().setText(areaName + subGroupRiskOption.getTitle().getText());
694   -// subGroupRiskOption.getyAxis().getData().clear();
695   -// // 按MAP的value排序
696   -// List<Map.Entry<String, Integer>> subListData = new ArrayList<Map.Entry<String, Integer>>(subMapsData.get(areaName).entrySet());
697   -// Collections.sort(subListData, new Comparator<Map.Entry<String, Integer>>() {
698   -// public int compare(Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2) {
699   -// if (o2.getValue() != null && o1.getValue() != null && o2.getValue().compareTo(o1.getValue()) > 0) {
700   -// return -1;
701   -// } else {
702   -// return 1;
703   -// }
704   -// }
705   -// });
706   -//
707   -// List<Object> subGroupRiskDataList = new ArrayList<>();
708   -// n = listData.size();
709   -// for (Map.Entry<String, Integer> entry:subListData) {
710   -// n--;
711   -// if (n>28) {
712   -// continue;
713   -// }
714   -// subGroupRiskOption.getyAxis().getData().add(entry.getKey());
715   -// if (riskColorMap.containsKey(entry.getKey())) {
716   -// Data data = new Data();
717   -// data.setValue(entry.getValue());
718   -// data.setItemStyle(new ItemStyle(new Normal(true,riskColorMap.get(entry.getKey())),null));
719   -// subGroupRiskDataList.add(data);
720   -// } else {
721   -// subGroupRiskDataList.add(entry.getValue());
722   -// }
723   -// }
724   -//
725   -// Series subgroupRiskSeries = new Series();
726   -// subgroupRiskSeries.setName("高危人数");
727   -// subgroupRiskSeries.setType("bar");
728   -// subgroupRiskSeries.setData(subGroupRiskDataList);
729   -// subGroupRiskOption.getSeries().clear();
730   -// subGroupRiskOption.getSeries().add(subgroupRiskSeries);
731   -// } catch (Exception e) {
732   -// e.printStackTrace();
733   -// }
734   -// }
  688 + for (String areaName:subMapsData.keySet()) {
  689 + try {
  690 + Option subGroupRiskOption = new Option();
  691 + groupRiskOption.getTooltip().setShow(true);
  692 + List<Object> subGroupRiskSeriesList = new ArrayList<>();
  693 + Series subGroupRiskSeries = new Series();
  694 + subGroupRiskSeries.setName("高危人数");
  695 + subGroupRiskSeries.setType("bar");
  696 + // 按MAP的value排序
  697 + List<Map.Entry<String, Integer>> subListData = new ArrayList<Map.Entry<String, Integer>>(subMapsData.get(areaName).entrySet());
  698 + Collections.sort(subListData, new Comparator<Map.Entry<String, Integer>>() {
  699 + public int compare(Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2) {
  700 + if (o2.getValue() != null && o1.getValue() != null && o2.getValue().compareTo(o1.getValue()) > 0) {
  701 + return -1;
  702 + } else {
  703 + return 1;
  704 + }
  705 + }
  706 + });
735 707  
  708 + List<Object> subGroupRiskDataList = new ArrayList<>();
  709 + n = subListData.size();
  710 + for (Map.Entry<String, Integer> entry:subListData) {
  711 + n--;
  712 + if (n>28) {
  713 + continue;
  714 + }
  715 + subGroupRiskOption.getyAxis().getData().add(entry.getKey());
  716 + if (riskColorMap.containsKey(entry.getKey())) {
  717 + Data data = new Data();
  718 + data.setValue(entry.getValue());
  719 + data.setItemStyle(new ItemStyle(new Normal(true,riskColorMap.get(entry.getKey())),null));
  720 + subGroupRiskDataList.add(data);
  721 + } else {
  722 + subGroupRiskDataList.add(entry.getValue());
  723 + }
  724 + }
736 725  
  726 + subGroupRiskSeries.setData(subGroupRiskDataList);
  727 + subGroupRiskSeriesList.add(subGroupRiskSeries);
  728 + subGroupRiskOption.setSeries(subGroupRiskSeriesList);
  729 + groupRiskOptionMap.put(areaName, subGroupRiskOption);
  730 + } catch (Exception e) {
  731 + e.printStackTrace();
  732 + }
  733 + }
  734 +
  735 +
737 736 Map<String, Map<String, Integer>> patientMonthMap = new HashMap<>();
738 737 Map<String, Map<String, Map<String, Integer>>> subPatientMonthMap = new HashMap<>();
739 738 // 6. 按省或市或地区查询区域内近12个自然月每月产检中历史高危人数(按颜色分组)
... ... @@ -896,7 +895,7 @@
896 895 Option groupRiskMonthOption = buildxBarOption("高危历史人数", null, groupRiskMonthMap, buildDefaultMonth(6), colormap);
897 896  
898 897 for (String areaName:subGroupRiskMonthMap.keySet()) {
899   - groupRiskMonthOptionMap.put(areaName, buildLineOption(areaName + "高危历史人数", null, subGroupRiskMonthMap.get(areaName), buildDefaultMonth(12)));
  898 + groupRiskMonthOptionMap.put(areaName, buildxBarOption(areaName + "高危历史人数", null, subGroupRiskMonthMap.get(areaName), buildDefaultMonth(6), colormap));
900 899 }
901 900  
902 901