Browse Source

Merge branch 'dev' of liuwenbin/patient-co-management into dev

yeshijie 7 years ago
parent
commit
74d5ed3fb7

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

@ -321,15 +321,15 @@ public class StatisticsESService {
                map.put("code",saveModel.getTeam());
                map.put("name",saveModel.getCityName());
            }
            map.put("amount",saveModel.getResult2());
            map.put("amount",Long.parseLong(saveModel.getResult2()+""));
            map.put("rate",df.format((saveModel.getResult2() * 1.0000) / populationBase.getNum() * 100));
            map.put("rateString",saveModel.getResult2()+"/"+populationBase.getNum());
            resultList.add(map);
        }
        Collections.sort(resultList, new Comparator<Map<String, Object>>() {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                int map1value = (int) o1.get("amount");
                int map2value = (int) o2.get("amount");
                long map1value = (long) o1.get("amount");
                long map2value = (long) o2.get("amount");
                if (map1value - map2value > 0) {
                    return sort == 1 ? -1 : 1;
@ -359,7 +359,7 @@ public class StatisticsESService {
            Map<String, Object> map = new HashMap<>();
            map.put("code",saveModel.getSlaveKey1());
            map.put("name",saveModel.getSlaveKey1Name());
            map.put("amount", saveModel.getResult2());
            map.put("amount",Long.parseLong(saveModel.getResult2()+""));
            if (index.equals("7")) {
                // 分组指标总数算法
                String code = saveModel.getSlaveKey2();
@ -382,8 +382,8 @@ public class StatisticsESService {
                //获取最新的统计时间
                String updateTime = elasticsearchUtil.getQuotaTime();
                //如果是查询36的指标 那么除数是签约总数
                SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(updateTime,area,level,index,"2");
                Integer num = saveModel.getResult2();
                SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(updateTime,area,level,"1","2");
                Long num = Long.parseLong(saveModel.getResult2()+"");
                for (Map<String, Object> map:resultList) {
                    double rateG = (total > 0 ? ((long) map.get("amount")) * 1.0000 / num * 100 : 0);
                    map.put("rate", df.format(rateG));
@ -391,9 +391,9 @@ public class StatisticsESService {
                }
            }else{
                for (Map<String, Object> map:resultList) {
                    double rateG = (total > 0 ? ((int) map.get("amount")) * 1.0000 / total * 100 : 0);
                    double rateG = (total > 0 ? ((long) map.get("amount")) * 1.0000 / total * 100 : 0);
                    map.put("rate", df.format(rateG));
                    map.put("rateString", ((int) map.get("amount")) + "/" + total);
                    map.put("rateString", ((long) map.get("amount")) + "/" + total);
                }
            }
        }
@ -1487,7 +1487,7 @@ public class StatisticsESService {
        if (esModelList != null && esModelList.size() > 0) {
            for (SaveModel one : esModelList) {
                Map<String, Object> maps = new HashMap<String, Object>();
                maps.put("amount", one.getResult1());
                maps.put("amount", Long.parseLong(one.getResult2()+""));
                if (low_level.equals("3")) {
                    maps.put("code", one.getTown());
                    maps.put("name", one.getTownName());
@ -1512,7 +1512,7 @@ public class StatisticsESService {
                        Map<String, Object> obj = new HashMap<>();
                        obj.put("code", town.getCode());
                        obj.put("name", town.getName());
                        obj.put("amount", "0");
                        obj.put("amount", 0L);
                        obj.put("rate", Double.valueOf("0.0000"));
                        resultList.add(obj);
                    }
@ -1534,7 +1534,7 @@ public class StatisticsESService {
                            Map<String, Object> obj = new HashMap<>();
                            obj.put("code", hos.getCode());
                            obj.put("name", hos.getName());
                            obj.put("amount", "0");
                            obj.put("amount", 0L);
                            resultList.add(obj);
                        }
                    }
@ -1560,7 +1560,7 @@ public class StatisticsESService {
                            Map<String, Object> obj = new HashMap<>();
                            obj.put("code", String.valueOf(team.getId()));
                            obj.put("name", team.getName());
                            obj.put("amount", "0");
                            obj.put("amount", 0L);
                            resultList.add(obj);
                        }
                    }
@ -1572,8 +1572,8 @@ public class StatisticsESService {
            Collections.sort(resultList, new Comparator<Map<String, Object>>() {
                public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                    long map1value = (long) o1.get("amount");
                    long map2value = (long) o2.get("amount");
                    Long map1value = (Long) o1.get("amount");
                    Long map2value = (Long) o2.get("amount");
                    if (map1value - map2value > 0) {
                        return sort == 1 ? -1 : 1;

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -197,6 +197,7 @@ public class EsStatisticsController extends BaseController {
                                        @RequestParam(required = false) String level2_type,
                                        @RequestParam(required = false) String year) {
        try {
            lowLevel = String.valueOf(StringUtils.isEmpty(lowLevel) ? (level - 1) : lowLevel);
            //新版与旧版统计适配
            level = elasticsearchUtil.changeLevel(level);
            if(StringUtils.isNotEmpty(lowLevel)){
@ -237,6 +238,7 @@ public class EsStatisticsController extends BaseController {
                                            @RequestParam(required = false) String lowLevel,
                                            @RequestParam(required = false) String year) {
        try {
            lowLevel = String.valueOf(StringUtils.isEmpty(lowLevel) ? (level - 1) : lowLevel);
            //新版与旧版统计适配
            level = elasticsearchUtil.changeLevel(level);
            if(StringUtils.isNotEmpty(lowLevel)){