liuwenbin 7 years ago
parent
commit
a9a4adb30f

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

@ -32,7 +32,6 @@ import com.yihu.wlyy.service.third.jw.JwArchivesService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.task.SignUploadTask;
import com.yihu.wlyy.task.SignUploadTask;
import com.yihu.wlyy.util.*;
import com.yihu.wlyy.util.*;
import com.yihu.wlyy.web.third.jkedu.vo.PatientModel;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.collections.map.HashedMap;

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

@ -188,7 +188,7 @@ public class StatisticsESService {
    public long getIntervalIncrement(String startDate, String endDate, String area, int level, String index) throws Exception {
    public long getIntervalIncrement(String startDate, String endDate, String area, int level, String index) throws Exception {
        // 截止日期包含当天,则获取最新的更新时间
        // 截止日期包含当天,则获取最新的更新时间
        if (endDate.compareTo(new SimpleDateFormat("yyyy-MM-dd").format(new Date())) >= 0) {
        if (endDate.compareTo(dateFormat.format(new Date())) >= 0) {
            endDate = elasticsearchUtil.getQuotaTime();
            endDate = elasticsearchUtil.getQuotaTime();
        }
        }
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,area,level,index,"1");
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,area,level,index,"1");
@ -635,7 +635,8 @@ public class StatisticsESService {
     * @return
     * @return
     */
     */
    public JSONArray getSixFiveStatistics(String endDate, String area, int level) throws Exception{
    public JSONArray getSixFiveStatistics(String endDate, String area, int level) throws Exception{
        List<SaveModel> list = elasticsearchUtil.findDateQuotaLevel2(endDate,endDate,area,level,"12","2","6",null,null,null);
        List<SaveModel> list = elasticsearchUtil.findOneDateQuotaLevel2(endDate,area,level,"12","2","6");
        List<Map<String, Object>> resultList = new ArrayList<>();
        List<Map<String, Object>> resultList = new ArrayList<>();
        for (int i = 0; i < list.size(); i++) {
        for (int i = 0; i < list.size(); i++) {
            Map<String, Object> data = new HashMap<>();
            Map<String, Object> data = new HashMap<>();
@ -702,12 +703,12 @@ public class StatisticsESService {
     * @return
     * @return
     */
     */
    public long getSixFiveTotal(String endDate, String area, int level) throws Exception{
    public long getSixFiveTotal(String endDate, String area, int level) throws Exception{
        List<SaveModel> list = elasticsearchUtil.findDateQuotaLevel1(endDate,endDate,area,level,"8","2","6",null,null);
        if(list.size()>0){
            return list.get(0).getResult2();
        // 截止日期包含当天,则获取最新的更新时间
        if (endDate.compareTo(dateFormat.format(new Date())) >= 0) {
            endDate = elasticsearchUtil.getQuotaTime();
        }
        }
        return 0;
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel1(endDate,area,level,"8","2","6");
        return saveModel.getResult2();
    }
    }
    /**
    /**
@ -1610,4 +1611,334 @@ public class StatisticsESService {
            return new JSONArray();
            return new JSONArray();
        }
        }
    }
    }
    /**
     * 获取三师转签或高危人群签约
     *
     * @param endDate
     * @param area
     * @param level
     * @param index
     * @return
     */
    public JSONObject getSszqAndGwrq(String endDate, String area, int level, String index) {
        JSONObject json = new JSONObject();
        // 查询语句
        String sql = " select " +
                "     ifnull(result,'0') amount" +
                " from  " +
                "     wlyy_quota_result " +
                " where " +
                "     quato_code = ? " +
                "   and level1_type = ? and del = '1'";
        if (level == 4) {
            // 市级别
            sql += " and city = ? ";
        } else if (level == 3) {
            // 区、城镇级别
            sql += " and town = ? ";
        } else if (level == 2) {
            // 机构级别
            sql += " and org_code = ? ";
        } else if (level == 1) {
            sql += " and qkdoctor_code = ?";
        }
        sql += "   order by quota_date DESC " +
                "   limit 0,1";
        List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, index, level, area);
        if (result != null && result.size() > 0) {
            String total = (result.get(0).get("amount") != null ? result.get(0).get("amount").toString() : "0");
            if (total.equals("0")) {
                json.put("amount", 0L);
                json.put("num", 0L);
                json.put("rate", 0.0000D);
            } else {
                DecimalFormat df = new DecimalFormat("0.0000");
                String[] args = total.split("/");
                json.put("amount", Long.valueOf(args[0]));
                json.put("num", Long.valueOf(args[1]));
                json.put("rate", df.format(Long.valueOf(args[0]) * 1.0000 / Long.valueOf(args[1]) * 100));
            }
        } else {
            json.put("amount", 0L);
            json.put("num", 0L);
            json.put("rate", 0.0000D);
        }
        return json;
    }
    /**
     * 统计回复和未回复
     *
     * @param level
     * @return
     * @throws Exception
     */
    public JSONObject getConsultingStatisticsList(int level, String area, String lowLevel,String year) throws Exception {
        JSONObject result = new JSONObject();
        //最新更新时间
        String timeKey = elasticsearchUtil.getQuotaTime();
        if(StringUtils.isNotEmpty(year)){
            Integer coutYear = Integer.parseInt(year) + 1;
            timeKey = coutYear+"-06-30";
        }
        //及时回复数
        List<SaveModel> relyVal = elasticsearchUtil.findListDateQuotaLevel0(timeKey,area,level,"23","2",lowLevel);
        //咨询总数
        List<SaveModel> relyTotal = elasticsearchUtil.findListDateQuotaLevel0(timeKey,area,level,"25","2",lowLevel);
        //未回复数
        List<SaveModel> noRelyTotal = elasticsearchUtil.findListDateQuotaLevel0(timeKey,area,level,"22","2",lowLevel);
        JSONArray rely = new JSONArray(relyVal);
        JSONArray total = new JSONArray(relyTotal);
        JSONArray noRely = new JSONArray(noRelyTotal);
        result.put("resultList", getCoutList(level,rely, total, noRely));
        return result;
    }
    /**
     * 统计
     * 根据总数,未回复数,回复数统计,合并结果集及排序
     *
     * @param rely
     * @param total
     * @param onRely
     * @return
     */
    public List<Map<String, Object>> getCoutList(Integer level,JSONArray rely, JSONArray total, JSONArray onRely) {
        Map<String, Object> relyMap = new HashMap<>();
        Map<String, Object> totalMap = new HashMap<>();
        Map<String, Object> onRelyMap = new HashMap<>();
        JSONObject result = new JSONObject();
        //将List转换为Map,Key为要比较的CODE,降低循环层数
        String area = "";
        if(level==4){
            area = "city";
        }else if(level==3){
            area = "town";
        }else if(level==2){
            area = "hospital";
        }
        //转换回复数
        Iterator iterator = rely.iterator();
        while (iterator.hasNext()) {
            JSONObject jsonObject = (JSONObject) iterator.next();
            relyMap.put(jsonObject.get(area).toString(), jsonObject);
        }
        //转换总咨询数
        Iterator iterator2 = total.iterator();
        while (iterator2.hasNext()) {
            JSONObject jsonObject = (JSONObject) iterator2.next();
            totalMap.put(jsonObject.get(area).toString(), jsonObject);
        }
        //转换总咨询数
        Iterator iterator3 = onRely.iterator();
        while (iterator3.hasNext()) {
            JSONObject jsonObject = (JSONObject) iterator3.next();
            onRelyMap.put(jsonObject.get(area).toString(), jsonObject);
        }
        List<Map<String, Object>> resultMaps = new ArrayList<>();
        for (String key : totalMap.keySet()) {
            Map<String, Object> rs = new HashMap<>();
            JSONObject relyRs = (JSONObject) relyMap.get(key);
            JSONObject totalRs = (JSONObject) totalMap.get(key);
            JSONObject onRelyRs = (JSONObject) onRelyMap.get(key);
            if(relyRs==null||totalRs==null||onRelyRs==null){
                continue;
            }
            //合并结果集
            Integer totalNm = totalRs.getInt("result2");
            Integer relyNm = relyRs.getInt("result2");
            Integer noRelyNm = onRelyRs.getInt("result2");
            rs.put("name", relyRs.get(area+"Name"));
            rs.put("noRelyCount", noRelyNm);
            rs.put("relyCount", relyNm);
            rs.put("total", totalNm);
            rs.put("code", key);
            if (totalNm != null && totalNm != 0) {
                if (relyNm != null && relyNm != 0) {
                    double rr = (double) relyNm / totalNm * 100;
                    DecimalFormat df = new DecimalFormat("0.00");
                    rs.put("relyRate", df.format(rr) + "%");
                    rs.put("relyDoubleRate", rr);
                } else {
                    rs.put("relyRate", "0.00%");
                    rs.put("relyDoubleRate", 0.0);
                }
                if (noRelyNm != null && noRelyNm != 0) {
                    double rr = (double) noRelyNm / totalNm * 100;
                    DecimalFormat df = new DecimalFormat("0.00");
                    rs.put("noRelyRate", df.format(rr) + "%");
                    rs.put("noRelyDoubleRate", rr);
                } else {
                    rs.put("noRelyRate", "0.00%");
                    rs.put("noRelyDoubleRate", 0.0);
                }
            } else {
                rs.put("relyRate", "0.00%");
                rs.put("relyDoubleRate", 0.0);
                rs.put("noRelyRate", "0.00%");
                rs.put("noRelyDoubleRate", 0.0);
            }
            resultMaps.add(rs);
        }
        if(level==2){
            Map<Integer, Map<String, Object>> leaders = getAllTeamLeaders();
            if (resultMaps != null && resultMaps.size() > 0) {
                for (Map<String, Object> r : resultMaps) {
                    String id = (String) r.get("code");
                    String name = getTeamLeaderNameByTeamCode(leaders, Integer.parseInt(id));
                    if (org.apache.commons.lang3.StringUtils.isNotBlank(name)) {
                        r.put("name", name);
                    }
                }
            }
        }
        //根据为回复数排序
        Collections.sort(resultMaps, new Comparator<Map<String, Object>>() {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                return (double) o1.get("noRelyDoubleRate") < (double) o2.get("noRelyDoubleRate") ? 1 : ((double) o1.get("noRelyDoubleRate") == (double) o2.get("noRelyDoubleRate") ? 0 : -1);
            }
        });
        return resultMaps;
    }
    /**
     * 获取及时回复的时间分布
     *
     * @param level
     * @param area
     * @return
     */
    public JSONObject getCoutListByTime(String level, String area,String year) throws Exception {
        JSONObject result = new JSONObject();
        String quotaTime = elasticsearchUtil.getQuotaTime();
        if(StringUtils.isNotEmpty(year)){
            quotaTime = year+"-6-30";
        }
        List<SaveModel> list = elasticsearchUtil.findOneDateQuotaLevel1(quotaTime,area,Integer.parseInt(level),"24","2");
        JSONArray array = new JSONArray(list);
        result.put("resultList", array);
        return result;
    }
    /**
     * 统计当前级别下数据
     *
     * @param level
     * @param area
     * @return
     */
    public JSONObject getConsultingTitle(int level, String area,String year) throws Exception{
        JSONObject result = new JSONObject();
        String quotaDate = elasticsearchUtil.getQuotaTime();
        if(StringUtils.isNotEmpty(year)){
            quotaDate = year+"-06-30";
        }
        List<SaveModel> relyVal = elasticsearchUtil.findOneDateQuotaLevel1(quotaDate,area,level,"23","2");
        List<SaveModel> relyTotal = elasticsearchUtil.findOneDateQuotaLevel1(quotaDate,area,level,"25","2");
        List<SaveModel> onRelyTotal = elasticsearchUtil.findOneDateQuotaLevel1(quotaDate,area,level,"22","2");
        JSONObject relyObject = new JSONObject(relyVal);
        JSONObject totalObject = new JSONObject(relyTotal);
        JSONObject onRelyObject = new JSONObject(onRelyTotal);
        JSONArray rely = new JSONArray();
        rely.put(relyObject);
        JSONArray total = new JSONArray();
        total.put(totalObject);
        JSONArray onRely = new JSONArray();
        onRely.put(onRelyObject);
        result.put("result", getCoutListTitle(level,rely, total, onRely));
        return result;
    }
    public List<Map<String, Object>> getCoutListTitle(Integer level,JSONArray rely, JSONArray total, JSONArray onRely) {
        Map<String, Object> relyMap = new HashMap<>();
        Map<String, Object> totalMap = new HashMap<>();
        Map<String, Object> onRelyMap = new HashMap<>();
        JSONObject result = new JSONObject();
        //将List转换为Map,Key为要比较的CODE,降低循环层数
        String area = "";
        if (level == 4) {
            area = "city";
        } else if (level == 3) {
            area = "town";
        } else if (level == 2) {
            area = "hospital";
        }
        //转换回复数
        Iterator iterator = rely.iterator();
        while (iterator.hasNext()) {
            JSONObject jsonObject = (JSONObject) iterator.next();
            relyMap.put(jsonObject.get(area).toString(), jsonObject);
        }
        //转换总咨询数
        Iterator iterator2 = total.iterator();
        while (iterator2.hasNext()) {
            JSONObject jsonObject = (JSONObject) iterator2.next();
            totalMap.put(jsonObject.get(area).toString(), jsonObject);
        }
        //转换总咨询数
        Iterator iterator3 = onRely.iterator();
        while (iterator3.hasNext()) {
            JSONObject jsonObject = (JSONObject) iterator3.next();
            onRelyMap.put(jsonObject.get(area).toString(), jsonObject);
        }
        List<Map<String, Object>> resultMaps = new ArrayList<>();
        for (String key : totalMap.keySet()) {
            Map<String, Object> rs = new HashMap<>();
            JSONObject relyRs = (JSONObject) relyMap.get(key);
            JSONObject totalRs = (JSONObject) totalMap.get(key);
            JSONObject onRelyRs = (JSONObject) onRelyMap.get(key);
            if (relyRs == null || totalRs == null || onRelyRs == null) {
                continue;
            }
            //合并结果集
            Integer totalNm = totalRs.getInt("result2");
            Integer relyNm = relyRs.getInt("result2");
            Integer noRelyNm = onRelyRs.getInt("result2");
            rs.put("name", relyRs.get(area + "Name"));
            rs.put("noRelyCount", noRelyNm);
            rs.put("relyCount", relyNm);
            rs.put("total", totalNm);
            rs.put("code", key);
            if (totalNm != null && totalNm != 0) {
                if (relyNm != null && relyNm != 0) {
                    double rr = (double) relyNm / totalNm * 100;
                    DecimalFormat df = new DecimalFormat("0.00");
                    rs.put("relyRate", df.format(rr) + "%");
                    rs.put("relyDoubleRate", rr);
                } else {
                    rs.put("relyRate", "0.00%");
                    rs.put("relyDoubleRate", 0.0);
                }
                if (noRelyNm != null && noRelyNm != 0) {
                    double rr = (double) noRelyNm / totalNm * 100;
                    DecimalFormat df = new DecimalFormat("0.00");
                    rs.put("noRelyRate", df.format(rr) + "%");
                    rs.put("noRelyDoubleRate", rr);
                } else {
                    rs.put("noRelyRate", "0.00%");
                    rs.put("noRelyDoubleRate", 0.0);
                }
            } else {
                rs.put("relyRate", "0.00%");
                rs.put("relyDoubleRate", 0.0);
                rs.put("noRelyRate", "0.00%");
                rs.put("noRelyDoubleRate", 0.0);
            }
            resultMaps.add(rs);
        }
        return resultMaps;
    }
    public JSONObject getRenewPercentAndChangePercent(String renewIndex, String level, String code, String year, String lowCode) {
        return null;
    }
}
}

+ 6 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ElasticsearchUtil.java

@ -244,9 +244,9 @@ public class ElasticsearchUtil {
        }
        }
        if (StringUtils.isNotEmpty(endDate)) {
        if (StringUtils.isNotEmpty(endDate)) {
            if(startDate.length()>10){
            if(startDate.length()>10){
                startDate = changeTime(startDate);
                startDate = changeTime(endDate);
            }else{
            }else{
                startDate = changeDate(startDate);
                startDate = changeDate(endDate);
            }
            }
        }
        }
        StringBuffer sql = new StringBuffer();
        StringBuffer sql = new StringBuffer();
@ -335,9 +335,9 @@ public class ElasticsearchUtil {
        }
        }
        if (StringUtils.isNotEmpty(endDate)) {
        if (StringUtils.isNotEmpty(endDate)) {
            if(startDate.length()>10){
            if(startDate.length()>10){
                startDate = changeTime(startDate);
                startDate = changeTime(endDate);
            }else{
            }else{
                startDate = changeDate(startDate);
                startDate = changeDate(endDate);
            }
            }
        }
        }
        StringBuffer sql = new StringBuffer();
        StringBuffer sql = new StringBuffer();
@ -426,9 +426,9 @@ public class ElasticsearchUtil {
        }
        }
        if (StringUtils.isNotEmpty(endDate)) {
        if (StringUtils.isNotEmpty(endDate)) {
            if(startDate.length()>10){
            if(startDate.length()>10){
                startDate = changeTime(startDate);
                startDate = changeTime(endDate);
            }else{
            }else{
                startDate = changeDate(startDate);
                startDate = changeDate(endDate);
            }
            }
        }
        }
        StringBuffer sql = new StringBuffer();
        StringBuffer sql = new StringBuffer();

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

@ -401,6 +401,22 @@ public class EsStatisticsController extends BaseController {
     * @param level
     * @param level
     * @return
     * @return
     */
     */
    @RequestMapping(value = "/sixfive_statistics")
    @ResponseBody
    public String getSixFiveStatistics(@RequestParam(required = false) String startDate,
                                       @RequestParam(required = true) String endDate,
                                       @RequestParam(required = true) String area,
                                       int level,
                                       @RequestParam(required = false) String year) {
        try {
            JSONArray result = statisticsESService.getSixFiveStatistics(endDate, area, level);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
@ -507,4 +523,874 @@ public class EsStatisticsController extends BaseController {
            return error(-1, "查询失败");
            return error(-1, "查询失败");
        }
        }
    }
    }
    /**
     * 获取三师转签或高危人群
     *
     * @param endDate
     * @param area
     * @param level
     * @return
     */
    @RequestMapping(value = "/sszq_qwrq_info")
    @ResponseBody
    public String getSszqAndGwrq(@RequestParam(required = true) String endDate,
                                 @RequestParam(required = true) String area,
                                 @RequestParam(required = true) int level) {
        try {
            JSONObject result = new JSONObject();
            JSONObject sszq = statisticsESService.getSszqAndGwrq(endDate, area, level, "18");
            JSONObject gwrq = statisticsESService.getSszqAndGwrq(endDate, area, level, "19");
            result.put("sszq", sszq);
            result.put("gwrq", gwrq);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 指标截止日期  到达量
     *
     * @param endDate
     * @param area
     * @param level
     * @param index
     * @return
     */
    @RequestMapping("/index_all")
    @ResponseBody
    public String getIndexAll(@RequestParam(required = true) String endDate,
                              @RequestParam(required = true) String area,
                              @RequestParam(required = true) int level,
                              @RequestParam(required = true) String index,
                              @RequestParam(required = false) String year) {
        try {
            String[] indexes = index.split(",");
            JSONObject result = new JSONObject();
            for (String idx : indexes) {
                Long total = statisticsESService.getIndexTotal(endDate, area, level, idx,"2");
                result.put("index_" + idx, total);
            }
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 咨询统计
     * 咨询分析页面具体交互与业务分析内一致,即按市、区、社区、机构有不同展示,可一级级进入查看
     * ①回复及时率------医生首次回复24小时内比例
     * ②未回复数(数、率)----------当前未回复咨询数、以及相应比例
     * ③处理咨询回复时间分布---------全部咨询的首次回复咨询时间分布
     *
     * @param level 查询的等级,按市、区、机构
     * @param area  查询的等级对应Code
     * @return
     */
    @RequestMapping("/Consulting_Stat")
    @ResponseBody
    public String getConsultingStatistics(@RequestParam(required = true) Integer level,
                                          @RequestParam(required = true) String area) {
        try {
            return write(200, "查询成功", "data", statisticsService.getConsultingStatistics(level, area));
        } catch (Exception e) {
            return error(-1, "查询失败");
        }
    }
    /**
     * 咨询统计
     * 咨询分析页面具体交互与业务分析内一致,即按市、区、社区、机构有不同展示,可一级级进入查看
     * ①回复及时率------医生首次回复24小时内比例
     * ②未回复数(数、率)----------当前未回复咨询数、以及相应比例
     * ③处理咨询回复时间分布---------全部咨询的首次回复咨询时间分布
     *
     * @param level 查询的等级,按市、区、机构
     * @return
     */
    @RequestMapping("/Consulting_StatList")
    @ResponseBody
    public String getConsultingStatisticsList(@RequestParam(required = true) Integer level,
                                              @RequestParam(required = true) String area,
                                              @RequestParam(required = false) String lowlevel,
                                              @RequestParam(required = false) String year) {
        try {
            JSONObject data = null;
            if (Constant.getNowYear().equals(year)) {
                data = statisticsESService.getConsultingStatisticsList(level, area, lowlevel,null);
            } else if (org.springframework.util.StringUtils.isEmpty(year)) {
                data = statisticsESService.getConsultingStatisticsList(level, area, lowlevel,null);
//                data = statisticsService.getConsultingStatisticsListAll(level, area, lowlevel, year);
            } else {
                data = statisticsESService.getConsultingStatisticsList(level, area, lowlevel, year);
            }
            if (data != null) {
                return write(200, "查询成功", "data", data);
            } else {
                return error(-1, "查询失败");
            }
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 咨询统计
     * 咨询分析页面具体交互与业务分析内一致,即按市、区、社区、机构有不同展示,可一级级进入查看
     * ①回复及时率------医生首次回复24小时内比例
     * ②未回复数(数、率)----------当前未回复咨询数、以及相应比例
     * ③处理咨询回复时间分布---------全部咨询的首次回复咨询时间分布
     *
     * @param level 查询的等级,按市、区、机构
     * @return
     */
    @RequestMapping("/Consulting_Title")
    @ResponseBody
    public String getConsultingTitle(@RequestParam(required = true) Integer level,
                                     @RequestParam(required = true) String area,
                                     @RequestParam(required = false) String year) {
        try {
            JSONObject data = null;
//            if (Constant.getNowYear().equals(year)) {
//                //查今年的查找redis即可
//                data = statisticsService.getConsultingTitle(level, area);
//            } else if (org.springframework.util.StringUtils.isEmpty(year)) {
//                //为空默认查询全部
//                //查找redis的然后再添加去年年度的
//                data = statisticsService.getConsultingTitleAll(level, area, year);
//            } else {
//                //去数据库查找年份
//                data = statisticsService.getConsultingTitleWithYear(level, area, year);
//            }
            data = statisticsESService.getConsultingTitle(level, area,year);
            if (data != null) {
                return write(200, "查询成功", "data", data);
            } else {
                return error(-1, "查询失败");
            }
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取回复数时间分布数
     *
     * @param level
     * @param area
     * @return
     */
    @RequestMapping("/getCoutListByTime")
    @ResponseBody
    public String getCoutListByTime(
            @RequestParam(required = true) String level,
            @RequestParam(required = true) String area,
            @RequestParam(required = false) String year) {
        try {
//            if (Constant.getNowYear().equals(year)) {
//                return write(200, "查询成功", "data", statisticsService.getCoutListByTime(level, area));
//            } else if (org.springframework.util.StringUtils.isEmpty(year)) {
//                return write(200, "查询成功", "data", statisticsService.getCoutListByTimeAll(level, area));
//            } else {
//                return write(200, "查询成功", "data", statisticsService.getCoutListByTimeYear(level, area, year));
//            }
            return write(200, "查询成功", "data", statisticsESService.getCoutListByTime(level,area,year));
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取绑定率
     * 1、选定绑定微信指标,下面排行内,在绑定微信数后新增:"绑定率:xx.22%"
     * 2、绑定率=绑定数/已签约数
     *
     * @return
     */
    @RequestMapping("/bindingRate_stat")
    @ResponseBody
    public String getBindingRate() {
        try {
            return write(200, "查询成功", "data", statisticsService.getBindingRate());
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取得分平均数
     *
     * @param level
     * @param area
     * @return
     */
    @RequestMapping("/getAVGSocre")
    @ResponseBody
    public String getAVGSocre(@RequestParam(required = true) String level, @RequestParam(required = true) String area) {
        try {
            return write(200, "查询成功", "data", statisticsService.getAVGSocre(level, area));
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取得分平均数按月份
     *
     * @return
     */
    @RequestMapping("/getAVGSocreByMonth")
    @ResponseBody
    public String getAVGSocreByMonth(@RequestParam(required = true) String level,
                                     @RequestParam(required = true) String area,
                                     @RequestParam(required = true) String statDate,
                                     @RequestParam(required = true) String endDate) {
        try {
            return write(200, "查询成功", "data", statisticsService.getAVGSocreByMonth(level, area, statDate, endDate));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 统计当前团队,签约人数,服务次数,平均满意度
     *
     * @return
     */
    @RequestMapping("/getStatTitleInfo")
    @ResponseBody
    public String getStatTitleInfo(@RequestParam(required = true) String startDate,
                                   @RequestParam(required = true) String endDate) {
        try {
            return write(200, "查询成功", "data", statisticsService.getStatTitleInfo(getUID(), startDate, endDate));
            //return write(200, "查询成功", "data", statisticsService.getStatTitleInfo("zbqD201703150228",startDate,endDate));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取签约折线图
     *
     * @param startDate
     * @param endDate
     * @param signType  0 签约,1 续签
     * @param type      0 按周,1 按月
     * @return
     */
    @RequestMapping("/getSignCountLineByType")
    @ResponseBody
    public String getSignCountLineByType(@RequestParam(required = true) String startDate,
                                         @RequestParam(required = true) String endDate,
                                         @RequestParam(required = true) String signType,
                                         @RequestParam(required = true) String type) {
        try {
            //判断是签约还是续签
            if ("0".equals(signType)) {
                return write(200, "查询成功", "data", statisticsService.getSignCountLineByType(getUID(), type, startDate, endDate));
                //return write(200, "查询成功", "data", statisticsService.getSignCountLineByType("xh1D201703150222",type,startDate,endDate));
            } else {
                return write(200, "查询成功", "data", statisticsService.getRenewCountLineByType(getUID(), type, startDate, endDate));
                //return write(200, "查询成功", "data", statisticsService.getRenewCountLineByType("xh1D201703150222",type,startDate,endDate));
            }
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取咨询数和未回复数
     *
     * @param startDate
     * @param endDate
     * @param isNow     1 为当前;2为非当前
     * @return
     */
    @RequestMapping("/getReyStatbyTeam")
    @ResponseBody
    public String getReyStatbyTeam(@RequestParam(required = true) String startDate,
                                   @RequestParam(required = true) String endDate,
                                   @RequestParam(required = true) String isNow) {
        try {
            return write(200, "查询成功", "data", statisticsService.getReyStatbyTeamNow(getUID(), startDate, endDate, isNow));
            //return write(200, "查询成功", "data", statisticsService.getReyStatbyTeamNow("zbqD201703150228",startDate,endDate,isNow));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取机构内服务排行
     *
     * @param startDate
     * @param endDate
     * @return
     */
    @RequestMapping("/getServiceRankingList")
    @ResponseBody
    public String getServiceRankingList(@RequestParam(required = true) String startDate,
                                        @RequestParam(required = true) String endDate) {
        try {
            return write(200, "查询成功", "data", statisticsService.getServiceRankingList(getUID(), startDate, endDate));
            //return write(200, "查询成功", "data", statisticsService.getServiceRankingList("xh1D201703150222",startDate,endDate));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取平均值统计折线图
     *
     * @param startDate
     * @param endDate
     * @param type      0周,1月
     * @return
     */
    @RequestMapping("/getAvgLine")
    @ResponseBody
    public String getAvgLine(@RequestParam(required = true) String startDate,
                             @RequestParam(required = true) String endDate,
                             @RequestParam(required = true) String type) {
        try {
            return write(200, "查询成功", "data", statisticsService.getAvgLine(getUID(), startDate, endDate, type));
            // return write(200, "查询成功", "data", statisticsService.getAvgLine("xh1D201703150222",startDate,endDate,type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 判断团队是否是团队长
     *
     * @return
     */
    @RequestMapping("/checkDoctorIsTeamLeder")
    @ResponseBody
    public String checkDoctorIsTeamLeder() {
        try {
            return write(200, "查询成功", "data", statisticsService.checkDoctorIsTeamleader(getUID()));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取团队月或周咨询未回复和总数折线图
     *
     * @param teamCode  团队id
     * @param startDate
     * @param endDate
     * @param type      0周,1月
     * @return
     */
    @RequestMapping("/getTeamConsultCount")
    @ResponseBody
    public String getTeamConsultCount(@RequestParam(required = true) String teamCode,
                                      @RequestParam(required = true) String startDate,
                                      @RequestParam(required = true) String endDate,
                                      @RequestParam(required = true) String type) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamConsultCount(teamCode, startDate, endDate, type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 计算团队医生月或周咨询未回复和总数折线图
     *
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param type      0周,1月
     * @param doctor
     * @return
     */
    @RequestMapping("/getTeamDoctorConsultCount")
    @ResponseBody
    public String getTeamDoctorConsultCount(@RequestParam(required = true) String teamCode,
                                            @RequestParam(required = true) String startDate,
                                            @RequestParam(required = true) String endDate,
                                            @RequestParam(required = true) String type,
                                            @RequestParam(required = true) String doctor) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamDoctorConsultCount(teamCode, startDate, endDate, type, doctor));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取团队内这成员,未回复数,总数,结束咨询数
     *
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param sort      0降序,1升序
     * @return
     */
    @RequestMapping("/getMemberConsultList")
    @ResponseBody
    public String getMemberConsultList(@RequestParam(required = true) String teamCode,
                                       @RequestParam(required = true) String startDate,
                                       @RequestParam(required = true) String endDate,
                                       @RequestParam(required = true) String sort,
                                       @RequestParam(required = true) String sortType) {
        try {
            return write(200, "查询成功", "data", statisticsService.getMemberConsultList(teamCode, startDate, endDate, sort, sortType));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取Doctor咨询结果
     *
     * @param doctor
     * @param teamCode
     * @param startDate
     * @param endDate
     * @return
     */
    @RequestMapping("/getDoctorConsultTitle")
    @ResponseBody
    public String getDoctorConsultTitle(@RequestParam(required = true) String doctor,
                                        @RequestParam(required = true) String teamCode,
                                        @RequestParam(required = true) String startDate,
                                        @RequestParam(required = true) String endDate) {
        try {
            return write(200, "查询成功", "data", statisticsService.getDoctorConsultTitle(doctor, teamCode, startDate, endDate));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取团队随访量折线统计图
     *
     * @param type
     * @param teamCode
     * @param startDate
     * @param endDate
     * @return
     */
    @RequestMapping("/getTeamFollowupLine")
    @ResponseBody
    public String getTeamFollowupLine(@RequestParam(required = true) String type,
                                      @RequestParam(required = true) String teamCode,
                                      @RequestParam(required = true) String startDate,
                                      @RequestParam(required = true) String endDate) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamFollowupLine(teamCode, startDate, endDate, type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    @RequestMapping("/getTeamDoctorFollowupLine")
    @ResponseBody
    public String getTeamDoctorFollowupLine(@RequestParam(required = true) String type,
                                            @RequestParam(required = true) String teamCode,
                                            @RequestParam(required = true) String startDate,
                                            @RequestParam(required = true) String endDate,
                                            @RequestParam(required = true) String doctor) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamDoctorFollowupLine(teamCode, startDate, endDate, type, doctor));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 根据团队获取团队底下用户列表
     *
     * @param sort      0为降序,1为升序
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param sortType  0为总数排序,1为增量排序,2为计划中排序
     * @return
     */
    @RequestMapping("/getDoctorTeamFolList")
    @ResponseBody
    public String getDoctorTeamFolList(@RequestParam(required = true) String sort,
                                       @RequestParam(required = true) String teamCode,
                                       @RequestParam(required = true) String startDate,
                                       @RequestParam(required = true) String endDate,
                                       @RequestParam(required = true) String sortType) {
        try {
            return write(200, "查询成功", "data", statisticsService.getDoctorTeamFolList(startDate, endDate, teamCode, sort, sortType));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取医生随访头信息
     *
     * @param teamCode
     * @param doctor
     * @param startDate
     * @param endDate
     * @return
     */
    @RequestMapping("/getTeamDoctorFolTitle")
    @ResponseBody
    public String getTeamDoctorFolTitle(@RequestParam(required = true) String teamCode,
                                        @RequestParam(required = true) String doctor,
                                        @RequestParam(required = true) String startDate,
                                        @RequestParam(required = true) String endDate) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamDoctorFolTitle(teamCode, doctor, startDate, endDate));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取待预约量团队统计则线图
     *
     * @param teamCode
     * @param type
     * @param startDate
     * @param endDate
     * @return
     */
    @RequestMapping("/getTeamResLine")
    @ResponseBody
    public String getTeamResLine(@RequestParam(required = true) String teamCode,
                                 @RequestParam(required = true) String type,
                                 @RequestParam(required = true) String startDate,
                                 @RequestParam(required = true) String endDate) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamResLine(teamCode, startDate, endDate, type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取团队医生预约量团队统计则线图
     *
     * @param teamCode
     * @param type
     * @param startDate
     * @param endDate
     * @param doctor
     * @return
     */
    @RequestMapping("/getTeamDoctorResLine")
    @ResponseBody
    public String getTeamDoctorResLine(@RequestParam(required = true) String teamCode,
                                       @RequestParam(required = true) String type,
                                       @RequestParam(required = true) String startDate,
                                       @RequestParam(required = true) String endDate,
                                       @RequestParam(required = true) String doctor) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamDoctorResLine(teamCode, startDate, endDate, type, doctor));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取团队待预约量医生列表信息
     *
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param sort      0为降序,1为升序
     * @param sortType  0为按总数,1为按增数
     * @return
     */
    @RequestMapping("/getTeamDoctorResList")
    @ResponseBody
    public String getTeamDoctorResList(@RequestParam(required = true) String teamCode,
                                       @RequestParam(required = true) String startDate,
                                       @RequestParam(required = true) String endDate,
                                       @RequestParam(required = true) String sort,
                                       @RequestParam(required = true) String sortType) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamDoctorResList(teamCode, startDate, endDate, sort, sortType));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取团队医生待预信息
     *
     * @param teamCode
     * @param doctor
     * @param startDate
     * @param endDate
     * @return
     */
    @RequestMapping("/getTeamDoctorResTitle")
    @ResponseBody
    public String getTeamDoctorResTitle(@RequestParam(required = true) String teamCode,
                                        @RequestParam(required = true) String doctor,
                                        @RequestParam(required = true) String startDate,
                                        @RequestParam(required = true) String endDate) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamDoctorResTitle(teamCode, doctor, startDate, endDate));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取团队健康指导折线图
     *
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param type      0周,1月
     * @return
     */
    @RequestMapping("/getTeamGuidLine")
    @ResponseBody
    public String getTeamGuidLine(@RequestParam(required = true) String teamCode,
                                  @RequestParam(required = true) String startDate,
                                  @RequestParam(required = true) String endDate,
                                  @RequestParam(required = true) String type) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamGuidLine(teamCode, startDate, endDate, type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取团队医生则线图
     *
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param type
     * @param doctor
     * @return
     */
    @RequestMapping("/getTeamDoctorGuidLine")
    @ResponseBody
    public String getTeamDoctorGuidLine(@RequestParam(required = true) String teamCode,
                                        @RequestParam(required = true) String startDate,
                                        @RequestParam(required = true) String endDate,
                                        @RequestParam(required = true) String type,
                                        @RequestParam(required = true) String doctor) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamDoctorGuidLine(teamCode, startDate, endDate, type, doctor));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取团队指导总数List
     *
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param sort
     * @param sortType
     * @return
     */
    @RequestMapping("/getTeamGuidList")
    @ResponseBody
    public String getTeamGuidList(@RequestParam(required = true) String teamCode,
                                  @RequestParam(required = true) String startDate,
                                  @RequestParam(required = true) String endDate,
                                  @RequestParam(required = true) String sort,
                                  @RequestParam(required = true) String sortType) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamGuidList(teamCode, startDate, endDate, sort, sortType));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取医生健康指导头部信息
     *
     * @param teamCode
     * @param doctor
     * @param startDate
     * @param endDate
     * @return
     */
    @RequestMapping("/getTeamDoctorGuiTitle")
    @ResponseBody
    public String getTeamDoctorGuiTitle(@RequestParam(required = true) String teamCode,
                                        @RequestParam(required = true) String doctor,
                                        @RequestParam(required = true) String startDate,
                                        @RequestParam(required = true) String endDate) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamDoctorGuiTitle(teamCode, doctor, startDate, endDate));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取团队健康教育折线统计
     *
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param type      0按周 1按月
     * @return
     */
    @RequestMapping("/getTeamEduLine")
    @ResponseBody
    public String getTeamEduLine(@RequestParam(required = true) String teamCode,
                                 @RequestParam(required = true) String startDate,
                                 @RequestParam(required = true) String endDate,
                                 @RequestParam(required = true) String type) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamEduLine(teamCode, startDate, endDate, type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取团队健康
     *
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param type
     * @return
     */
    @RequestMapping("/getTeamDoctorEduLine")
    @ResponseBody
    public String getTeamDoctorEduLine(@RequestParam(required = true) String teamCode,
                                       @RequestParam(required = true) String startDate,
                                       @RequestParam(required = true) String endDate,
                                       @RequestParam(required = true) String type,
                                       @RequestParam(required = true) String doctor) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamDoctorEduLine(teamCode, startDate, endDate, type, doctor));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取团队成员健康教育列表
     *
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param sort
     * @param sortType
     * @return
     */
    @RequestMapping("/getTeamEduList")
    @ResponseBody
    public String getTeamEduList(@RequestParam(required = true) String teamCode,
                                 @RequestParam(required = true) String startDate,
                                 @RequestParam(required = true) String endDate,
                                 @RequestParam(required = true) String sort,
                                 @RequestParam(required = true) String sortType) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamEduList(teamCode, startDate, endDate, sort, sortType));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    @RequestMapping("/getTeamDoctorEduTitle")
    @ResponseBody
    public String getTeamDoctorEduTitle(@RequestParam(required = true) String teamCode,
                                        @RequestParam(required = true) String startDate,
                                        @RequestParam(required = true) String endDate,
                                        @RequestParam(required = true) String doctor) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamDoctorEduTitle(teamCode, startDate, endDate, doctor));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    @RequestMapping("/getDotorInfo")
    @ResponseBody
    public String getDotorInfo(String code) {
        try {
            return write(200, "查询成功", "data", statisticsService.getDoctorInfo(code));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    @RequestMapping("/getTeamRenewChangeLine")
    @ResponseBody
    public String getTeamRenewChangeLine(@RequestParam(required = true) String teamCode,
                                         @RequestParam(required = true) String startDate,
                                         @RequestParam(required = true) String endDate,
                                         @RequestParam(required = true) String type) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamRenewChangeLine(teamCode, startDate, endDate, type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    @RequestMapping("/cleanDoctorScore")
    @ResponseBody
    public String cleanDoctorScore(){
        try{
            return write(200, "清洗完成", "data", statisticsAllService.cleanDoctorScore());
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取转签率和续签率
     * 前端:续签进展
     *
     * @param index 42,43,44 (52,53,54 服务类型维度)
     * @param level 等级  4 市  3区  2社区 1团队
     * @param code  市 默认是厦门市 350200  区 就是区的code  社区就是社区的code 团队就是团队的code
     * @param year  年份 非比传
     * @param lowCode 服务类型维度code(老年人3,高血压4,糖尿病5)
     * @return
     */
    @RequestMapping(value = "/getRenewPercentAndChangePercent", method = RequestMethod.GET)
    @ResponseBody
    public String getRenewPercentAndChangePercent(
            @RequestParam(required = true) String index,//续签index
            @RequestParam(required = true) String level,
            @RequestParam(required = true) String code,
            @RequestParam(required = false) String year,
            @RequestParam(required = false) String lowCode) {
        try {
            return write(200, "查询成功", "data", statisticsService.getRenewPercentAndChangePercent(index,level, code, year,lowCode));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
}
}

+ 39 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -450,6 +450,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping(value = "/sixfive_statistics")
    @RequestMapping(value = "/sixfive_statistics")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getSixFiveStatistics(@RequestParam(required = false) String startDate,
    public String getSixFiveStatistics(@RequestParam(required = false) String startDate,
                                       @RequestParam(required = true) String endDate,
                                       @RequestParam(required = true) String endDate,
                                       @RequestParam(required = true) String area,
                                       @RequestParam(required = true) String area,
@ -595,6 +596,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping(value = "/sszq_qwrq_info")
    @RequestMapping(value = "/sszq_qwrq_info")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getSszqAndGwrq(@RequestParam(required = true) String endDate,
    public String getSszqAndGwrq(@RequestParam(required = true) String endDate,
                                 @RequestParam(required = true) String area,
                                 @RequestParam(required = true) String area,
                                 @RequestParam(required = true) int level) {
                                 @RequestParam(required = true) int level) {
@ -625,6 +627,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/index_all")
    @RequestMapping("/index_all")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getIndexAll(@RequestParam(required = true) String endDate,
    public String getIndexAll(@RequestParam(required = true) String endDate,
                              @RequestParam(required = true) String area,
                              @RequestParam(required = true) String area,
                              @RequestParam(required = true) int level,
                              @RequestParam(required = true) int level,
@ -674,6 +677,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/Consulting_Stat")
    @RequestMapping("/Consulting_Stat")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getConsultingStatistics(@RequestParam(required = true) Integer level,
    public String getConsultingStatistics(@RequestParam(required = true) Integer level,
                                          @RequestParam(required = true) String area) {
                                          @RequestParam(required = true) String area) {
        try {
        try {
@ -695,6 +699,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/Consulting_StatList")
    @RequestMapping("/Consulting_StatList")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getConsultingStatisticsList(@RequestParam(required = true) Integer level,
    public String getConsultingStatisticsList(@RequestParam(required = true) Integer level,
                                              @RequestParam(required = true) String area,
                                              @RequestParam(required = true) String area,
                                              @RequestParam(required = false) String lowlevel,
                                              @RequestParam(required = false) String lowlevel,
@ -733,6 +738,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/Consulting_Title")
    @RequestMapping("/Consulting_Title")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getConsultingTitle(@RequestParam(required = true) Integer level,
    public String getConsultingTitle(@RequestParam(required = true) Integer level,
                                     @RequestParam(required = true) String area,
                                     @RequestParam(required = true) String area,
                                     @RequestParam(required = false) String year) {
                                     @RequestParam(required = false) String year) {
@ -769,6 +775,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getCoutListByTime")
    @RequestMapping("/getCoutListByTime")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getCoutListByTime(
    public String getCoutListByTime(
            @RequestParam(required = true) String level,
            @RequestParam(required = true) String level,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) String area,
@ -796,6 +803,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/bindingRate_stat")
    @RequestMapping("/bindingRate_stat")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getBindingRate() {
    public String getBindingRate() {
        try {
        try {
            return write(200, "查询成功", "data", statisticsService.getBindingRate());
            return write(200, "查询成功", "data", statisticsService.getBindingRate());
@ -814,6 +822,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getAVGSocre")
    @RequestMapping("/getAVGSocre")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getAVGSocre(@RequestParam(required = true) String level, @RequestParam(required = true) String area) {
    public String getAVGSocre(@RequestParam(required = true) String level, @RequestParam(required = true) String area) {
        try {
        try {
            return write(200, "查询成功", "data", statisticsService.getAVGSocre(level, area));
            return write(200, "查询成功", "data", statisticsService.getAVGSocre(level, area));
@ -831,6 +840,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getAVGSocreByMonth")
    @RequestMapping("/getAVGSocreByMonth")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getAVGSocreByMonth(@RequestParam(required = true) String level,
    public String getAVGSocreByMonth(@RequestParam(required = true) String level,
                                     @RequestParam(required = true) String area,
                                     @RequestParam(required = true) String area,
                                     @RequestParam(required = true) String statDate,
                                     @RequestParam(required = true) String statDate,
@ -850,6 +860,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getStatTitleInfo")
    @RequestMapping("/getStatTitleInfo")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getStatTitleInfo(@RequestParam(required = true) String startDate,
    public String getStatTitleInfo(@RequestParam(required = true) String startDate,
                                   @RequestParam(required = true) String endDate) {
                                   @RequestParam(required = true) String endDate) {
        try {
        try {
@ -874,6 +885,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getSignCountLineByType")
    @RequestMapping("/getSignCountLineByType")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getSignCountLineByType(@RequestParam(required = true) String startDate,
    public String getSignCountLineByType(@RequestParam(required = true) String startDate,
                                         @RequestParam(required = true) String endDate,
                                         @RequestParam(required = true) String endDate,
                                         @RequestParam(required = true) String signType,
                                         @RequestParam(required = true) String signType,
@ -903,6 +915,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getReyStatbyTeam")
    @RequestMapping("/getReyStatbyTeam")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getReyStatbyTeam(@RequestParam(required = true) String startDate,
    public String getReyStatbyTeam(@RequestParam(required = true) String startDate,
                                   @RequestParam(required = true) String endDate,
                                   @RequestParam(required = true) String endDate,
                                   @RequestParam(required = true) String isNow) {
                                   @RequestParam(required = true) String isNow) {
@ -924,6 +937,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getServiceRankingList")
    @RequestMapping("/getServiceRankingList")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getServiceRankingList(@RequestParam(required = true) String startDate,
    public String getServiceRankingList(@RequestParam(required = true) String startDate,
                                        @RequestParam(required = true) String endDate) {
                                        @RequestParam(required = true) String endDate) {
        try {
        try {
@ -945,6 +959,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getAvgLine")
    @RequestMapping("/getAvgLine")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getAvgLine(@RequestParam(required = true) String startDate,
    public String getAvgLine(@RequestParam(required = true) String startDate,
                             @RequestParam(required = true) String endDate,
                             @RequestParam(required = true) String endDate,
                             @RequestParam(required = true) String type) {
                             @RequestParam(required = true) String type) {
@ -964,6 +979,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/checkDoctorIsTeamLeder")
    @RequestMapping("/checkDoctorIsTeamLeder")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String checkDoctorIsTeamLeder() {
    public String checkDoctorIsTeamLeder() {
        try {
        try {
            return write(200, "查询成功", "data", statisticsService.checkDoctorIsTeamleader(getUID()));
            return write(200, "查询成功", "data", statisticsService.checkDoctorIsTeamleader(getUID()));
@ -984,6 +1000,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getTeamConsultCount")
    @RequestMapping("/getTeamConsultCount")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamConsultCount(@RequestParam(required = true) String teamCode,
    public String getTeamConsultCount(@RequestParam(required = true) String teamCode,
                                      @RequestParam(required = true) String startDate,
                                      @RequestParam(required = true) String startDate,
                                      @RequestParam(required = true) String endDate,
                                      @RequestParam(required = true) String endDate,
@ -1008,6 +1025,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getTeamDoctorConsultCount")
    @RequestMapping("/getTeamDoctorConsultCount")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamDoctorConsultCount(@RequestParam(required = true) String teamCode,
    public String getTeamDoctorConsultCount(@RequestParam(required = true) String teamCode,
                                            @RequestParam(required = true) String startDate,
                                            @RequestParam(required = true) String startDate,
                                            @RequestParam(required = true) String endDate,
                                            @RequestParam(required = true) String endDate,
@ -1032,6 +1050,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getMemberConsultList")
    @RequestMapping("/getMemberConsultList")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getMemberConsultList(@RequestParam(required = true) String teamCode,
    public String getMemberConsultList(@RequestParam(required = true) String teamCode,
                                       @RequestParam(required = true) String startDate,
                                       @RequestParam(required = true) String startDate,
                                       @RequestParam(required = true) String endDate,
                                       @RequestParam(required = true) String endDate,
@ -1056,6 +1075,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getDoctorConsultTitle")
    @RequestMapping("/getDoctorConsultTitle")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getDoctorConsultTitle(@RequestParam(required = true) String doctor,
    public String getDoctorConsultTitle(@RequestParam(required = true) String doctor,
                                        @RequestParam(required = true) String teamCode,
                                        @RequestParam(required = true) String teamCode,
                                        @RequestParam(required = true) String startDate,
                                        @RequestParam(required = true) String startDate,
@ -1079,6 +1099,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getTeamFollowupLine")
    @RequestMapping("/getTeamFollowupLine")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamFollowupLine(@RequestParam(required = true) String type,
    public String getTeamFollowupLine(@RequestParam(required = true) String type,
                                      @RequestParam(required = true) String teamCode,
                                      @RequestParam(required = true) String teamCode,
                                      @RequestParam(required = true) String startDate,
                                      @RequestParam(required = true) String startDate,
@ -1093,6 +1114,7 @@ public class StatisticsController extends BaseController {
    @RequestMapping("/getTeamDoctorFollowupLine")
    @RequestMapping("/getTeamDoctorFollowupLine")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamDoctorFollowupLine(@RequestParam(required = true) String type,
    public String getTeamDoctorFollowupLine(@RequestParam(required = true) String type,
                                            @RequestParam(required = true) String teamCode,
                                            @RequestParam(required = true) String teamCode,
                                            @RequestParam(required = true) String startDate,
                                            @RequestParam(required = true) String startDate,
@ -1118,6 +1140,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getDoctorTeamFolList")
    @RequestMapping("/getDoctorTeamFolList")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getDoctorTeamFolList(@RequestParam(required = true) String sort,
    public String getDoctorTeamFolList(@RequestParam(required = true) String sort,
                                       @RequestParam(required = true) String teamCode,
                                       @RequestParam(required = true) String teamCode,
                                       @RequestParam(required = true) String startDate,
                                       @RequestParam(required = true) String startDate,
@ -1142,6 +1165,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getTeamDoctorFolTitle")
    @RequestMapping("/getTeamDoctorFolTitle")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamDoctorFolTitle(@RequestParam(required = true) String teamCode,
    public String getTeamDoctorFolTitle(@RequestParam(required = true) String teamCode,
                                        @RequestParam(required = true) String doctor,
                                        @RequestParam(required = true) String doctor,
                                        @RequestParam(required = true) String startDate,
                                        @RequestParam(required = true) String startDate,
@ -1165,6 +1189,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getTeamResLine")
    @RequestMapping("/getTeamResLine")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamResLine(@RequestParam(required = true) String teamCode,
    public String getTeamResLine(@RequestParam(required = true) String teamCode,
                                 @RequestParam(required = true) String type,
                                 @RequestParam(required = true) String type,
                                 @RequestParam(required = true) String startDate,
                                 @RequestParam(required = true) String startDate,
@ -1189,6 +1214,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getTeamDoctorResLine")
    @RequestMapping("/getTeamDoctorResLine")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamDoctorResLine(@RequestParam(required = true) String teamCode,
    public String getTeamDoctorResLine(@RequestParam(required = true) String teamCode,
                                       @RequestParam(required = true) String type,
                                       @RequestParam(required = true) String type,
                                       @RequestParam(required = true) String startDate,
                                       @RequestParam(required = true) String startDate,
@ -1214,6 +1240,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getTeamDoctorResList")
    @RequestMapping("/getTeamDoctorResList")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamDoctorResList(@RequestParam(required = true) String teamCode,
    public String getTeamDoctorResList(@RequestParam(required = true) String teamCode,
                                       @RequestParam(required = true) String startDate,
                                       @RequestParam(required = true) String startDate,
                                       @RequestParam(required = true) String endDate,
                                       @RequestParam(required = true) String endDate,
@ -1238,6 +1265,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getTeamDoctorResTitle")
    @RequestMapping("/getTeamDoctorResTitle")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamDoctorResTitle(@RequestParam(required = true) String teamCode,
    public String getTeamDoctorResTitle(@RequestParam(required = true) String teamCode,
                                        @RequestParam(required = true) String doctor,
                                        @RequestParam(required = true) String doctor,
                                        @RequestParam(required = true) String startDate,
                                        @RequestParam(required = true) String startDate,
@ -1261,6 +1289,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getTeamGuidLine")
    @RequestMapping("/getTeamGuidLine")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamGuidLine(@RequestParam(required = true) String teamCode,
    public String getTeamGuidLine(@RequestParam(required = true) String teamCode,
                                  @RequestParam(required = true) String startDate,
                                  @RequestParam(required = true) String startDate,
                                  @RequestParam(required = true) String endDate,
                                  @RequestParam(required = true) String endDate,
@ -1285,6 +1314,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getTeamDoctorGuidLine")
    @RequestMapping("/getTeamDoctorGuidLine")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamDoctorGuidLine(@RequestParam(required = true) String teamCode,
    public String getTeamDoctorGuidLine(@RequestParam(required = true) String teamCode,
                                        @RequestParam(required = true) String startDate,
                                        @RequestParam(required = true) String startDate,
                                        @RequestParam(required = true) String endDate,
                                        @RequestParam(required = true) String endDate,
@ -1310,6 +1340,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getTeamGuidList")
    @RequestMapping("/getTeamGuidList")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamGuidList(@RequestParam(required = true) String teamCode,
    public String getTeamGuidList(@RequestParam(required = true) String teamCode,
                                  @RequestParam(required = true) String startDate,
                                  @RequestParam(required = true) String startDate,
                                  @RequestParam(required = true) String endDate,
                                  @RequestParam(required = true) String endDate,
@ -1334,6 +1365,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getTeamDoctorGuiTitle")
    @RequestMapping("/getTeamDoctorGuiTitle")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamDoctorGuiTitle(@RequestParam(required = true) String teamCode,
    public String getTeamDoctorGuiTitle(@RequestParam(required = true) String teamCode,
                                        @RequestParam(required = true) String doctor,
                                        @RequestParam(required = true) String doctor,
                                        @RequestParam(required = true) String startDate,
                                        @RequestParam(required = true) String startDate,
@ -1357,6 +1389,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getTeamEduLine")
    @RequestMapping("/getTeamEduLine")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamEduLine(@RequestParam(required = true) String teamCode,
    public String getTeamEduLine(@RequestParam(required = true) String teamCode,
                                 @RequestParam(required = true) String startDate,
                                 @RequestParam(required = true) String startDate,
                                 @RequestParam(required = true) String endDate,
                                 @RequestParam(required = true) String endDate,
@ -1380,6 +1413,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getTeamDoctorEduLine")
    @RequestMapping("/getTeamDoctorEduLine")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamDoctorEduLine(@RequestParam(required = true) String teamCode,
    public String getTeamDoctorEduLine(@RequestParam(required = true) String teamCode,
                                       @RequestParam(required = true) String startDate,
                                       @RequestParam(required = true) String startDate,
                                       @RequestParam(required = true) String endDate,
                                       @RequestParam(required = true) String endDate,
@ -1405,6 +1439,7 @@ public class StatisticsController extends BaseController {
     */
     */
    @RequestMapping("/getTeamEduList")
    @RequestMapping("/getTeamEduList")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamEduList(@RequestParam(required = true) String teamCode,
    public String getTeamEduList(@RequestParam(required = true) String teamCode,
                                 @RequestParam(required = true) String startDate,
                                 @RequestParam(required = true) String startDate,
                                 @RequestParam(required = true) String endDate,
                                 @RequestParam(required = true) String endDate,
@ -1420,6 +1455,7 @@ public class StatisticsController extends BaseController {
    @RequestMapping("/getTeamDoctorEduTitle")
    @RequestMapping("/getTeamDoctorEduTitle")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamDoctorEduTitle(@RequestParam(required = true) String teamCode,
    public String getTeamDoctorEduTitle(@RequestParam(required = true) String teamCode,
                                        @RequestParam(required = true) String startDate,
                                        @RequestParam(required = true) String startDate,
                                        @RequestParam(required = true) String endDate,
                                        @RequestParam(required = true) String endDate,
@ -1434,6 +1470,7 @@ public class StatisticsController extends BaseController {
    @RequestMapping("/getDotorInfo")
    @RequestMapping("/getDotorInfo")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getDotorInfo(String code) {
    public String getDotorInfo(String code) {
        try {
        try {
            return write(200, "查询成功", "data", statisticsService.getDoctorInfo(code));
            return write(200, "查询成功", "data", statisticsService.getDoctorInfo(code));
@ -1527,6 +1564,7 @@ public class StatisticsController extends BaseController {
    @RequestMapping("/getTeamRenewChangeLine")
    @RequestMapping("/getTeamRenewChangeLine")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String getTeamRenewChangeLine(@RequestParam(required = true) String teamCode,
    public String getTeamRenewChangeLine(@RequestParam(required = true) String teamCode,
                                         @RequestParam(required = true) String startDate,
                                         @RequestParam(required = true) String startDate,
                                         @RequestParam(required = true) String endDate,
                                         @RequestParam(required = true) String endDate,
@ -1586,6 +1624,7 @@ public class StatisticsController extends BaseController {
    @RequestMapping("/cleanDoctorScore")
    @RequestMapping("/cleanDoctorScore")
    @ResponseBody
    @ResponseBody
    @Deprecated
    public String cleanDoctorScore(){
    public String cleanDoctorScore(){
        try{
        try{
            return write(200, "清洗完成", "data", statisticsAllService.cleanDoctorScore());
            return write(200, "清洗完成", "data", statisticsAllService.cleanDoctorScore());