Explorar o código

es代码修改bug

zd_123 %!s(int64=7) %!d(string=hai) anos
pai
achega
d5461f8e47

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsAllService.java

@ -2823,6 +2823,7 @@ public class StatisticsAllService extends BaseService {
                            num = peopleNum.getTnbNum();
                            taskNum = peopleNum.getTnbTaskNum();
                        }
                        map.put("rate", df.format(((long) map.get("amount") * 1.0000) / num * 100));
                        map.put("taskRate", df.format(((long) map.get("amount") * 1.0000) / taskNum * 100));
                        map.put("targetRate", df.format(taskNum * 1.0000 / num * 100));

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

@ -269,7 +269,7 @@ public class StatisticsESService {
                }
                PopulationBase peopleNum = getPopulationBase(area, year);
                if (peopleNum != null) {
                    map.put("rate", df.format((saveModel.getResult2() * 1.0000) / peopleNum.getNum() * 100));
                    map.put("rate", (peopleNum.getNum() > 0 ? df.format((saveModel.getResult2() * 1.0000) / peopleNum.getNum() * 100) : 0));
                    map.put("rateString", saveModel.getResult2().longValue() + "/" + peopleNum.getNum());
                }
            }
@ -406,7 +406,7 @@ public class StatisticsESService {
                SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, area, level, "1", "2");
                Long num = saveModel.getResult2().longValue();
                for (Map<String, Object> map : resultList) {
                    double rateG = (total > 0 ? ((long) map.get("amount")) * 1.0000 / num * 100 : 0);
                    double rateG = (num > 0 ? ((long) map.get("amount")) * 1.0000 / num * 100 : 0);
                    map.put("rate", df.format(rateG));
                    map.put("rateString", ((long) map.get("amount")) + "/" + num);
                }
@ -447,7 +447,7 @@ public class StatisticsESService {
     */
    public JSONArray getPayPremiums(String endDate, String area, int level) throws Exception {
        //已缴费
        SaveModel paidSaveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, "1", "2");
        SaveModel paidSaveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, "1", SaveModel.timeLevel_DDL);
        //未交费
        SaveModel noPaySaveModel =null;
        //因为14的指标 16年度是分为 已缴费 未交费 已退费  17年度过后就只有未交费  所以16年度用1级指标 17年度用0级指标
@ -1243,7 +1243,7 @@ public class StatisticsESService {
                map.put("signTaskNum", signTaskNum);//目标量
                map.put("signRegulationNum", signRegulationNum);//调控量
                if (!low_level.equals("5")) {
                    PopulationBase peopleNum = getPopulationBase(map.get("code").toString(), year);
                    PopulationBase peopleNum = getPopulationBase(String.valueOf(map.get("code")), year);
                    if (peopleNum != null) {
                        int num = 0;
                        int taskNum = 0;
@ -1258,9 +1258,9 @@ public class StatisticsESService {
                            num = peopleNum.getTnbNum();
                            taskNum = peopleNum.getTnbTaskNum();
                        }
                        map.put("rate", df.format(((long) map.get("amount") * 1.0000) / num * 100));
                        map.put("taskRate", df.format(((long) map.get("amount") * 1.0000) / taskNum * 100));
                        map.put("targetRate", df.format(taskNum * 1.0000 / num * 100));
                        map.put("rate", (num > 0 ? df.format(((long) map.get("amount") * 1.0000) / num * 100) : 0));
                        map.put("taskRate", (taskNum > 0 ? df.format(((long) map.get("amount") * 1.0000) / taskNum * 100) : 0));
                        map.put("targetRate", (num > 0 ? df.format(taskNum * 1.0000 / num * 100) : 0));
                        map.put("rateString", map.get("amount") + "/" + num);
                        map.put("taskRateString", map.get("amount") + "/" + taskNum);
                        map.put("targetRateString", taskNum + "/" + num);
@ -2830,9 +2830,6 @@ public class StatisticsESService {
        //3.平均满意度
        SaveModel saveModel2 = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, admin.getId() + "", Integer.parseInt(SaveModel.teamLevel), "28", SaveModel.timeLevel_ZL);
//        String sql = "SELECT count(1) as num FROM wlyy_consult_team d WHERE d.czrq>= ? and d.czrq<=? and d.admin_team_code =? ";
//        Map<String, Object> map = jdbcTemplate.queryForMap(sql, startDate, endDate,admin.getId());
        //SaveModel saveModel21 = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, admin.getId() + "", Integer.parseInt(SaveModel.teamLevel), "3", SaveModel.timeLevel_ZL);
        Double avgCout = 0.0;
        String avgCoutStr="";
        DecimalFormat df = new DecimalFormat("#.0");
@ -2840,10 +2837,6 @@ public class StatisticsESService {
            avgCout = saveModel2.getResult1()/saveModel2.getResult2();
            avgCoutStr=df.format(avgCout);
        }
//        if (saveModel21.getResult2().intValue()!=0){
//            avgCout = saveModel2.getResult1() / saveModel21.getResult2();
//            avgCoutStr = df.format(avgCout);
//        }
        Map<String, Object> avgScore = new HashMap<>();
        avgScore.put("avgScore", avgCoutStr);
        rs.put(avgScore);
@ -3003,6 +2996,7 @@ public class StatisticsESService {
        //咨询总数
        List<SaveModel> list2 = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, teamCode, Integer.parseInt(SaveModel.teamLevel), "3", SaveModel.timeLevel_ZL, interval + "");
        Map<String, Object> map = null;
        //遍历未回复集合
        List<Map<String, Object>> noReyList = new ArrayList<>();
        for (SaveModel one : list) {
            if (one.getResult2().intValue()!=0){
@ -3053,25 +3047,29 @@ public class StatisticsESService {
        Map<String, Object> map = null;
        List<Map<String, Object>> totalList = new ArrayList<>();
        for (SaveModel one : list1) {
            map = new HashMap<>();
            if ("0".equals(type)) {
                map.put("dateNo", dateFormat.format(one.getQuotaDate()));
            } else {
                map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
            if(one.getResult2().intValue()!=0){
                map = new HashMap<>();
                if ("0".equals(type)) {
                    map.put("dateNo", dateFormat.format(one.getQuotaDate()));
                } else {
                    map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                }
                map.put("followupCount", one.getResult2().longValue());
                totalList.add(map);
            }
            map.put("followupCount", one.getResult2().longValue());
            totalList.add(map);
        }
        List<Map<String, Object>> planList = new ArrayList<>();
        for (SaveModel one : list2) {
            map = new HashMap<>();
            if ("0".equals(type)) {
                map.put("dateNo", dateFormat.format(one.getQuotaDate()));
            } else {
                map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
            if (one.getResult2().intValue()!=0){
                map = new HashMap<>();
                if ("0".equals(type)) {
                    map.put("dateNo", dateFormat.format(one.getQuotaDate()));
                } else {
                    map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                }
                map.put("planCount", one.getResult2().longValue());
                planList.add(map);
            }
            map.put("planCount", one.getResult2().longValue());
            planList.add(map);
        }
        JSONObject result = new JSONObject();
        result.put("planList", planList);

+ 25 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -64,6 +64,9 @@ public class EsStatisticsController extends BaseController {
     * 指标按间隔统计  增量
     * 按年度统计是根据前端传的 startDate
     *
     * 备注:注解为Deprecated是因为前端代码全局搜索没有,并且本地代码没有调用该方法
     * 视为无效(2017-11-21)
     *
     * @param startDate 起始日期
     * @param endDate   结束时间
     * @param interval  时间间隔
@ -74,6 +77,7 @@ public class EsStatisticsController extends BaseController {
     */
    @RequestMapping(value = "/interval")
    @ResponseBody
    @Deprecated
    public String indexInterval(@RequestParam(required = true) String startDate,
                                @RequestParam(required = true) String endDate,
                                @RequestParam(required = true) String interval,
@ -104,6 +108,9 @@ public class EsStatisticsController extends BaseController {
    /**
     * 指标期间 增长量
     *
     * 备注:注解为Deprecated是因为前端代码全局搜索没有,并且本地代码没有调用该方法
     * 视为无效(2017-11-21)
     *
     * @param startDate
     * @param endDate
     * @param area
@ -113,6 +120,7 @@ public class EsStatisticsController extends BaseController {
     */
    @RequestMapping("/increment")
    @ResponseBody
    @Deprecated
    public String getIndexIncrement(@RequestParam(required = true) String startDate,
                                    @RequestParam(required = true) String endDate,
                                    @RequestParam(required = true) String area,
@ -140,6 +148,9 @@ public class EsStatisticsController extends BaseController {
    /**
     * 指标截止日期累积量  增量的累加接口
     *
     * 备注:注解为Deprecated是因为前端代码全局搜索没有,并且本地代码没有调用该方法
     * 视为无效(2017-11-21)
     *
     * @param startDate   开始时间
     * @param endDate     结束时间 1
     * @param area        父code
@ -150,6 +161,7 @@ public class EsStatisticsController extends BaseController {
     */
    @RequestMapping("/total")
    @ResponseBody
    @Deprecated
    public String getIndexTotal(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
@ -650,12 +662,16 @@ public class EsStatisticsController extends BaseController {
     * ②未回复数(数、率)----------当前未回复咨询数、以及相应比例
     * ③处理咨询回复时间分布---------全部咨询的首次回复咨询时间分布
     *
     * 备注:注解为Deprecated是因为前端代码全局搜索没有,并且本地代码没有调用该方法
     * 视为无效(2017-11-21)
     *
     * @param level 查询的等级,按市、区、机构
     * @param area  查询的等级对应Code
     * @return
     */
    @RequestMapping("/Consulting_Stat")
    @ResponseBody
    @Deprecated
    public String getConsultingStatistics(@RequestParam(required = true) Integer level,
                                          @RequestParam(required = true) String area) {
@ -766,11 +782,13 @@ public class EsStatisticsController extends BaseController {
     * 获取绑定率
     * 1、选定绑定微信指标,下面排行内,在绑定微信数后新增:"绑定率:xx.22%"
     * 2、绑定率=绑定数/已签约数
     *
     *备注:注解为Deprecated是因为前端代码全局搜索没有,并且本地代码没有调用该方法
     * 视为无效(2017-11-21)
     * @return
     */
    @RequestMapping("/bindingRate_stat")
    @ResponseBody
    @Deprecated
    public String getBindingRate() {
        try {
            return write(200, "查询成功", "data", statisticsESService.getBindingRate());
@ -1446,8 +1464,14 @@ public class EsStatisticsController extends BaseController {
        }
    }
    /**
     * 备注:注解为Deprecated是因为前端代码全局搜索没有,并且本地代码没有调用该方法
     * 视为无效(2017-11-21)
     * @return
     */
    @RequestMapping("/cleanDoctorScore")
    @ResponseBody
    @Deprecated
    public String cleanDoctorScore() {
        try {
            return write(200, "清洗完成", "data", statisticsAllService.cleanDoctorScore());