chenweida 7 سال پیش
والد
کامیت
11299346cb

+ 50 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -1330,7 +1330,20 @@ public class StatisticsESService {
        }
        }
        return rs;
        return rs;
    }
    }
    public List translateTeamLeaderNameListMap(List<Map<String,Object>> rs) {
        Map<Integer, Map<String, Object>> leaders = getAllTeamLeaders();
        if (rs != null) {
            for (int i = 0; i < rs.size(); i++) {
                Map<String,Object> r = rs.get(i);
                Integer id = Integer.valueOf(r.get("code").toString());
                String name = getTeamLeaderNameByTeamCode(leaders, id);
                if (org.apache.commons.lang3.StringUtils.isNotBlank(name)) {
                    r.put("name", name);
                }
            }
        }
        return rs;
    }
    public JSONArray translateTeamLeaderNameByCode(JSONArray rs) {
    public JSONArray translateTeamLeaderNameByCode(JSONArray rs) {
        Map<Integer, Map<String, Object>> leaders = getAllTeamLeaders();
        Map<Integer, Map<String, Object>> leaders = getAllTeamLeaders();
        if (rs != null) {
        if (rs != null) {
@ -3679,7 +3692,7 @@ public class StatisticsESService {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
            String date = sdf.format(dd.getTime());
            String date = sdf.format(dd.getTime());
            mc.put("month", date);
            mc.put("month", date);
            mc.put("count", 0);
            mc.put("count", 0.0D);
            dd.add(Calendar.MONTH, -1);
            dd.add(Calendar.MONTH, -1);
            rs.add(mc);
            rs.add(mc);
        }
        }
@ -3689,9 +3702,9 @@ public class StatisticsESService {
        List<SaveModel> resultList = new ArrayList<>();
        List<SaveModel> resultList = new ArrayList<>();
        if (StringUtils.isNotBlank(disease)) {
        if (StringUtils.isNotBlank(disease)) {
            resultList = elasticsearchUtil.findLineChartDateQuotaLevel2(startTime, endTime, area, level, index62, SaveModel.timeLevel_DDL, SaveModel.interval_month, disease, type);
            resultList = elasticsearchUtil.findLineChartDateQuotaLevel2(startTime, endTime, area, level, index62, SaveModel.timeLevel_ZL, SaveModel.interval_month, disease, type);
        } else {
        } else {
            resultList = elasticsearchUtil.findLineChartDateQuotaLevel1(startTime, endTime, area, level, index67, SaveModel.timeLevel_DDL, SaveModel.interval_month, type);
            resultList = elasticsearchUtil.findLineChartDateQuotaLevel1(startTime, endTime, area, level, index67, SaveModel.timeLevel_ZL, SaveModel.interval_month, type);
        }
        }
        for (Map<String, Object> m : rs) {
        for (Map<String, Object> m : rs) {
@ -3707,6 +3720,20 @@ public class StatisticsESService {
                }
                }
            }
            }
        }
        }
        Collections.sort(rs, new Comparator<Map<String, Object>>() {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                Double map1value = Double.valueOf(String.valueOf(o1.get("count")));
                Double map2value = Double.valueOf(String.valueOf(o2.get("count")));
                if (map1value - map2value > 0) {
                    return -1;
                } else if (map1value - map2value < 0) {
                    return 1;
                } else {
                    return 0;
                }
            }
        });
        return rs;
        return rs;
    }
    }
@ -3796,6 +3823,20 @@ public class StatisticsESService {
                }
                }
            }
            }
        }
        }
        Collections.sort(rs, new Comparator<Map<String, Object>>() {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                Long map1value = Long.valueOf(String.valueOf(o1.get("val")));
                Long map2value = Long.valueOf(String.valueOf(o2.get("val")));
                if (map1value - map2value > 0) {
                    return -1;
                } else if (map1value - map2value < 0) {
                    return 1;
                } else {
                    return 0;
                }
            }
        });
        return rs;
        return rs;
    }
    }
@ -3871,6 +3912,10 @@ public class StatisticsESService {
                countList.add(map);
                countList.add(map);
            }
            }
        }
        }
        if(SaveModel.teamLevel.equals(lowlevel)){
            translateTeamLeaderNameListMap(countList);;
        }
        Collections.sort(countList, new Comparator<Map<String, Object>>() {
        Collections.sort(countList, new Comparator<Map<String, Object>>() {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                Double map1value = Double.valueOf(String.valueOf(o1.get("val")));
                Double map1value = Double.valueOf(String.valueOf(o1.get("val")));
@ -3929,7 +3974,7 @@ public class StatisticsESService {
            if (one.getResult2()!=0) {
            if (one.getResult2()!=0) {
                avg = decimalFormat.format(one.getResult1() / (one.getResult2()*100));
                avg = decimalFormat.format(one.getResult1() / (one.getResult2()*100));
            }
            }
            map.put("val", avg);
            map.put("avg",avg);
            map.put("date", key);
            map.put("date", key);
            countList.add(map);
            countList.add(map);