Bläddra i källkod

sign_info方法修改

chenweida 8 år sedan
förälder
incheckning
0d9006f511

+ 44 - 39
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

@ -4075,14 +4075,17 @@ public class StatisticsService extends BaseService {
        String date = year + "-06-30";
        String index = "1";
        WlyyQuotaResult wlyyQuotaResult = findOneQuotaResult(date, Integer.valueOf(level), index, code);
        int signNum = Integer.valueOf(wlyyQuotaResult.getResult());
        int signNum = 0;
        if (wlyyQuotaResult != null) {
            signNum = Integer.valueOf(wlyyQuotaResult.getResult());
        }
        //从redis中获取最新的转签数据  指标是37
        int switchNum = getLevel1NumForRedis("37", level, code, timeKey);
        jo.put("yesterYearSign", signNum);//去年的签约量
        jo.put("thisYearRenew", renewNum);//今年的续签量
        jo.put("thisYearSwithch", switchNum);//今年的转签量
        jo.put("renewRange", getRange(renewNum, signNum, 2));//续签率  50.00%
        jo.put("renewRange", getRange(switchNum, renewNum, 2));//转签率
        jo.put("switchRange", getRange(switchNum, renewNum, 2));//转签率
        return jo;
    }
@ -4109,7 +4112,6 @@ public class StatisticsService extends BaseService {
        int changeTown = getLevel1NumForRedis("33", level, code, timeKey);//夸区的数目
        jo.put("inNum", inNum);//今年的签入量
        jo.put("outNum", outNum);//今年的签出量
        jo.put("thisYearSwithch", switchNum);//今年的转签量
@ -4162,6 +4164,9 @@ public class StatisticsService extends BaseService {
     * @return
     */
    public String getRange(int first, int second, int i) {
        if(second==0){
            return "100&";
        }
        float size = (float) (first * 100) / second;
        DecimalFormat df = new DecimalFormat("0.00");//格式化小数,不足的补0
        String filesize = df.format(size);
@ -4296,7 +4301,7 @@ public class StatisticsService extends BaseService {
                }
                JSONArray rely = new JSONArray(relyVal);
                //累加去年的数目
                getConsultingStatisticsListAllAdd(rely,"23",level,area,"3",year);
                getConsultingStatisticsListAllAdd(rely, "23", level, area, "3", year);
                //咨询总数
                String relyTotal = redisTemplate.opsForValue().get("quota:25:" + level + ":" + area + ":3:" + timeKey);
                if (StringUtils.isBlank(relyTotal)) {
@ -4415,64 +4420,64 @@ public class StatisticsService extends BaseService {
        return null;
    }
    public JSONObject getTeamRenewChangeLine(String teamCode,String startDate,String endDate,String type){
        startDate = startDate+" 00:00:00";
        endDate = endDate+" 23:59:59";
        String inSql ;
    public JSONObject getTeamRenewChangeLine(String teamCode, String startDate, String endDate, String type) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 23:59:59";
        String inSql;
        String outSql;
        if("0".equals(type)){
            inSql ="SELECT left(r.apply_date,10) AS dateNo,COUNT(1) AS inCount FROM wlyy_sign_family_renew_log r  " +
                    " WHERE r.admin_team_id ='"+teamCode+"' " +
                    " AND r.apply_date >= '"+startDate+"' " +
                    " AND r.apply_date <='"+endDate+"' " +
        if ("0".equals(type)) {
            inSql = "SELECT left(r.apply_date,10) AS dateNo,COUNT(1) AS inCount FROM wlyy_sign_family_renew_log r  " +
                    " WHERE r.admin_team_id ='" + teamCode + "' " +
                    " AND r.apply_date >= '" + startDate + "' " +
                    " AND r.apply_date <='" + endDate + "' " +
                    " AND r.old_admin_team_id <> r.admin_team_id " +
                    " GROUP BY dateNo ";
            outSql ="SELECT left(r.apply_date,10) AS dateNo,COUNT(1) AS inCount FROM wlyy_sign_family_renew_log r  " +
                    " WHERE r.old_admin_team_id ='"+teamCode+"' " +
                    " AND r.apply_date >= '"+startDate+"' " +
                    " AND r.apply_date <='"+endDate+"' " +
            outSql = "SELECT left(r.apply_date,10) AS dateNo,COUNT(1) AS inCount FROM wlyy_sign_family_renew_log r  " +
                    " WHERE r.old_admin_team_id ='" + teamCode + "' " +
                    " AND r.apply_date >= '" + startDate + "' " +
                    " AND r.apply_date <='" + endDate + "' " +
                    " AND r.old_admin_team_id <> r.admin_team_id " +
                    " GROUP BY dateNo ";
        }else{
            inSql ="SELECT ( " +
        } else {
            inSql = "SELECT ( " +
                    "  DATE_FORMAT(r.apply_date, '%v') - DATE_FORMAT('2017-06-01', '%v') + 1 " +
                    " ) AS weekOfMonth,COUNT(1) AS outCount FROM wlyy_sign_family_renew_log r  " +
                    " WHERE r.admin_team_id ='"+teamCode+"'  " +
                    " AND r.apply_date >= '"+startDate+"'  " +
                    " AND r.apply_date <='"+endDate+"'  " +
                    " WHERE r.admin_team_id ='" + teamCode + "'  " +
                    " AND r.apply_date >= '" + startDate + "'  " +
                    " AND r.apply_date <='" + endDate + "'  " +
                    " AND r.old_admin_team_id <> r.admin_team_id " +
                    " GROUP BY weekOfMonth ";
            outSql ="SELECT ( " +
            outSql = "SELECT ( " +
                    "  DATE_FORMAT(r.apply_date, '%v') - DATE_FORMAT('2017-06-01', '%v') + 1 " +
                    " ) AS weekOfMonth,COUNT(1) AS outCount FROM wlyy_sign_family_renew_log r  " +
                    " WHERE r.old_admin_team_id ='"+teamCode+"'  " +
                    " AND r.apply_date >= '"+startDate+"'  " +
                    " AND r.apply_date <='"+endDate+"'  " +
                    " WHERE r.old_admin_team_id ='" + teamCode + "'  " +
                    " AND r.apply_date >= '" + startDate + "'  " +
                    " AND r.apply_date <='" + endDate + "'  " +
                    " AND r.old_admin_team_id <> r.admin_team_id " +
                    " GROUP BY weekOfMonth ";
        }
        JSONObject rs = new JSONObject();
        List<Map<String,Object>> inList = jdbcTemplate.queryForList(inSql);
        rs.put("inLine",inList);
        List<Map<String,Object>> outList =jdbcTemplate.queryForList(outSql);
        rs.put("outLine",outList);
        List<Map<String, Object>> inList = jdbcTemplate.queryForList(inSql);
        rs.put("inLine", inList);
        List<Map<String, Object>> outList = jdbcTemplate.queryForList(outSql);
        rs.put("outLine", outList);
        return rs ;
        return rs;
    }
    //-----------------------------------通用方法-------------------------------
    /**
     *
     * @param rely 从redis查询出来的列表
     * @param index 指标code
     * @param level 父level
     * @param area 父code
     * @param rely     从redis查询出来的列表
     * @param index    指标code
     * @param level    父level
     * @param area     父code
     * @param children 子level
     * @param year 年份
     * @param year     年份
     */
    public void getConsultingStatisticsListAllAdd(JSONArray rely,String index,Integer level,String area,String children,String year){
        String sql="";
    public void getConsultingStatisticsListAllAdd(JSONArray rely, String index, Integer level, String area, String children, String year) {
        String sql = "";
    }
    /**
     * 得到某个指标的之前全部的数目
     *

+ 5 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -357,8 +357,7 @@ public class StatisticsController extends BaseController {
    public String getAreaSignInfo(@RequestParam(required = true) String endDate,
                                  @RequestParam(required = true) String area,
                                  @RequestParam(required = true) int level,
                                  @RequestParam(required = false) String lowCode,
                                  @RequestParam(required = false) String year
                                  @RequestParam(required = false) String lowCode
    ) {
        try {
            JSONObject result = new JSONObject();
@ -366,13 +365,17 @@ public class StatisticsController extends BaseController {
            if (StringUtils.isEmpty(lowCode)) {
                long sign = statisticsAllService.getIndexTotal(endDate, area, level, "13");
                long weiJf = statisticsAllService.getWeiJiaoFei(endDate, area, level);
                JSONObject jo= statisticsService.getRenewPercentAndChangePercent(level+"", area, Constant.getStartYear());
                JSONObject signRate = statisticsAllService.getSignRate(endDate, area, level);
                JSONObject signTaskRate = statisticsAllService.getSignTaskRate(endDate, area, level);
                result.put("sign", sign);
                result.put("expenses", weiJf);
                result.put("renew", jo.get("thisYearRenew")+"/"+jo.get("yesterYearSign"));//去年的签约量
                result.put("signRate", signRate);
                result.put("signTaskRate", signTaskRate);
                result.put("renewRange", jo.get("renewRange"));//续签率  50.00%
            } else {
                result = statisticsAllService.getGroupInfo(endDate, lowCode, area, level);
            }