chenweida 8 лет назад
Родитель
Сommit
e7ae56099b

+ 17 - 17
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentDayAllQuotaJob.java

@ -148,8 +148,8 @@ public class CurrentDayAllQuotaJob implements Job {
        quartzJobLog.setJobStartTime(new Date());
        allContent = new StringBuffer();
        //找出今天的签约信息 yesterday,now
        String sql = " select id,code,idcard,hospital,admin_team_code,expenses_status,patient,server_type from wlyy_sign_family a where  a.type =2 and status in (1,2) and  a.expenses_time< '" + tomorrow + "' and a.expenses_time >'"+Constant.getStartTimeByDate(tomorrow)+"' and a.expenses_status=1 ";
        String sqlCount = " select count(id) from wlyy_sign_family a where  a.type =2 and status in (1,2) and  a.expenses_time< '" + tomorrow + "' and a.expenses_time >'"+Constant.getStartTimeByDate(tomorrow)+"' and a.expenses_status=1 ";
        String sql = " select id,code,idcard,hospital,admin_team_code,expenses_status,patient,server_type from wlyy_sign_family a where  a.type =2 and status in (1,2) and  a.expenses_time< '" + tomorrow + "' and a.expenses_time >'"+Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last+"' and a.expenses_status=1 ";
        String sqlCount = " select count(id) from wlyy_sign_family a where  a.type =2 and status in (1,2) and  a.expenses_time< '" + tomorrow + "' and a.expenses_time >'"+Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last+"' and a.expenses_status=1 ";
        //抽取數據
        List<SignFamily> signFamilies = SpringUtil.getBean(DBExtract.class).extractByPage(SignFamily.class, sql, sqlCount, true);
@ -282,7 +282,7 @@ public class CurrentDayAllQuotaJob implements Job {
                }
                if ((1 + 1) % 100 == 0) {
                    //每隔100统计一次
                    String sql = "select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow) + "' and a.consult in (" + sb.toString() + ")";
                    String sql = "select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last + "' and a.consult in (" + sb.toString() + ")";
                    //抽取數據
                    List<ConsultTeam> consultTeamsTemp = SpringUtil.getBean(DBExtract.class).extract(ConsultTeam.class, sql);
                    consultTeams.addAll(consultTeamsTemp);
@ -290,7 +290,7 @@ public class CurrentDayAllQuotaJob implements Job {
                } else {
                    //判断是不是最后的一段
                    if (consultIdMaps.size() == (i + 1)) {
                        String sql = "select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow) + "'and a.consult in (" + sb.toString() + ")";
                        String sql = "select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last + "'and a.consult in (" + sb.toString() + ")";
                        //抽取數據
                        List<ConsultTeam> consultTeamsTemp = SpringUtil.getBean(DBExtract.class).extract(ConsultTeam.class, sql);
                        consultTeams.addAll(consultTeamsTemp);
@ -299,9 +299,9 @@ public class CurrentDayAllQuotaJob implements Job {
            }
            String sql = "";
            if (consultIdMaps.size() > 0) {
                sql = " select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow) + "'and a.consult in (" + sb.toString() + ")";
                sql = " select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last + "'and a.consult in (" + sb.toString() + ")";
            } else {
                sql = " select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow) + "'and a.consult ='noRey' ";
                sql = " select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last + "'and a.consult ='noRey' ";
            }
            System.out.println("consultTeams num:" + consultTeams.size());
@ -334,7 +334,7 @@ public class CurrentDayAllQuotaJob implements Job {
                }
                if ((1 + 1) % 100 == 0) {
                    //每隔100统计一次
                    String sql = "select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow) + "' and a.consult in (" + sb.toString() + ")";
                    String sql = "select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last + "' and a.consult in (" + sb.toString() + ")";
                    //抽取數據
                    List<ConsultTeam> consultTeamsTemp = SpringUtil.getBean(DBExtract.class).extract(ConsultTeam.class, sql);
                    consultTeams.addAll(consultTeamsTemp);
@ -342,7 +342,7 @@ public class CurrentDayAllQuotaJob implements Job {
                } else {
                    //判断是不是最后的一段
                    if (consultIdMaps.size() == (i + 1)) {
                        String sql = "select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow) + "' and a.consult in (" + sb.toString() + ")";
                        String sql = "select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow) +Constant.quota_date_last+ "' and a.consult in (" + sb.toString() + ")";
                        //抽取數據
                        List<ConsultTeam> consultTeamsTemp = SpringUtil.getBean(DBExtract.class).extract(ConsultTeam.class, sql);
                        consultTeams.addAll(consultTeamsTemp);
@ -396,7 +396,7 @@ public class CurrentDayAllQuotaJob implements Job {
                }
                if ((1 + 1) % 100 == 0) {
                    //每隔100统计一次
                    String sql = "select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow) + "' and a.consult in (" + sb.toString() + ")";
                    String sql = "select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last + "' and a.consult in (" + sb.toString() + ")";
                    //抽取數據
                    List<ConsultTeam> consultTeamsTemp = SpringUtil.getBean(DBExtract.class).extract(ConsultTeam.class, sql);
                    consultTeams.addAll(consultTeamsTemp);
@ -404,7 +404,7 @@ public class CurrentDayAllQuotaJob implements Job {
                } else {
                    //判断是不是最后的一段
                    if (consultIdMaps.size() == (i + 1)) {
                        String sql = "select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow) + "'and a.consult in (" + sb.toString() + ")";
                        String sql = "select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last + "'and a.consult in (" + sb.toString() + ")";
                        //抽取數據
                        List<ConsultTeam> consultTeamsTemp = SpringUtil.getBean(DBExtract.class).extract(ConsultTeam.class, sql);
                        consultTeams.addAll(consultTeamsTemp);
@ -414,9 +414,9 @@ public class CurrentDayAllQuotaJob implements Job {
            String sql = "";
            //找出今天的咨询信息
            if (consultIdMaps.size() > 0) {
                sql = "select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow) + "'and a.consult in (" + sb.toString() + ")";
                sql = "select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last + "'and a.consult in (" + sb.toString() + ")";
            } else {
                sql = "select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow) + "' and a.consult ='Rey' ";
                sql = "select admin_team_code,id,consult from wlyy_consult_team a where  a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last + "' and a.consult ='Rey' ";
            } //抽取數據
            List<ConsultTeamDto> consultTeamDtos = getConsultTeams(ims, consultTeams);
@ -827,7 +827,7 @@ public class CurrentDayAllQuotaJob implements Job {
        String quotaId = "2";
        try {
            //找出今天的解约信息
            String sql = " select id,code,idcard,hospital,admin_team_code,expenses_status from wlyy_sign_family a where  a.type =2 and a.status in(-3,-4) and  a.apply_unsign_date< '" + tomorrow + "' and a.apply_unsign_date >'"+Constant.getStartTimeByDate(tomorrow)+"' ";
            String sql = " select id,code,idcard,hospital,admin_team_code,expenses_status from wlyy_sign_family a where  a.type =2 and a.status in(-3,-4) and  a.apply_unsign_date< '" + tomorrow + "' and a.apply_unsign_date >'"+Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last+"' ";
            //抽取數據
            List<SignFamily> signFamilies = SpringUtil.getBean(DBExtract.class).extract(SignFamily.class, sql);
            //清洗數據
@ -979,7 +979,7 @@ public class CurrentDayAllQuotaJob implements Job {
    private void computequota_9() throws ParseException {
        String quotaId = "9";
        //找出今天的待签约信息
        String sql = " select id,code,idcard,hospital,admin_team_code,doctor,doctor_health from wlyy_sign_family a where   a.type =2  and a.status=0 and  a.patient_apply_date< '" + tomorrow + "' and a.patient_apply_date >'"+Constant.getStartTimeByDate(tomorrow)+"'  ";
        String sql = " select id,code,idcard,hospital,admin_team_code,doctor,doctor_health from wlyy_sign_family a where   a.type =2  and a.status=0 and  a.patient_apply_date< '" + tomorrow + "' and a.patient_apply_date >'"+Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last+"'  ";
        try {
            //抽取數據
            List<SignFamily> signFamilies = SpringUtil.getBean(DBExtract.class).extract(SignFamily.class, sql);
@ -1001,7 +1001,7 @@ public class CurrentDayAllQuotaJob implements Job {
        String quotaId = "10";
        try {
            //找出今天的已改簽信息
            String sql = " select id,code,idcard,hospital,admin_team_code from wlyy_sign_family a where  a.type =2 and a.status =100 and   a.patient_apply_date< '" + tomorrow + "' and a.patient_apply_date >'"+Constant.getStartTimeByDate(tomorrow)+"' and a.expenses_status=1 ";
            String sql = " select id,code,idcard,hospital,admin_team_code from wlyy_sign_family a where  a.type =2 and a.status =100 and   a.patient_apply_date< '" + tomorrow + "' and a.patient_apply_date >'"+Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last+"' and a.expenses_status=1 ";
            //抽取數據
            List<SignFamily> signFamilies = SpringUtil.getBean(DBExtract.class).extract(SignFamily.class, sql);
            //清洗數據
@ -1022,7 +1022,7 @@ public class CurrentDayAllQuotaJob implements Job {
        String quotaId = "25";
        try {
            //找出总的咨询信息
            String sql = " select * from wlyy_consult_team a where a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow) + "'";
            String sql = " select * from wlyy_consult_team a where a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last + "'";
            //抽取數據
            List<ConsultTeam> consultTeams = SpringUtil.getBean(DBExtract.class).extract(ConsultTeam.class, sql);
            //過濾數據
@ -1043,7 +1043,7 @@ public class CurrentDayAllQuotaJob implements Job {
        String quotaId = "26";
        try {
            //找出今天统计未缴费签约总数
            String sql = "select code,idcard,hospital,admin_team_code from wlyy_sign_family a where  a.type =2 and  a.status>0  and  a.apply_date< '" + tomorrow + "' and  a.apply_date> '" + Constant.getStartTimeByDate(tomorrow) + "'  and a.expenses_status=0 ";
            String sql = "select code,idcard,hospital,admin_team_code from wlyy_sign_family a where  a.type =2 and  a.status>0  and  a.apply_date< '" + tomorrow + "' and  a.apply_date> '" + Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last + "'  and a.expenses_status=0 ";
            //抽取數據
            List<SignFamily> signFamilies = SpringUtil.getBean(DBExtract.class).extract(SignFamily.class, sql);
            //清洗數據

+ 15 - 6
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -46,6 +46,7 @@ public class StatisticsController extends BaseController {
        try {
            return write(200, "查询成功", "data", statisticsService.getStatisticsTime());
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
@ -84,6 +85,7 @@ public class StatisticsController extends BaseController {
            return write(200, "查询成功!", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, tag + "查询失败!");
        }
    }
@ -151,6 +153,7 @@ public class StatisticsController extends BaseController {
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
@ -223,6 +226,7 @@ public class StatisticsController extends BaseController {
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
@ -305,9 +309,7 @@ public class StatisticsController extends BaseController {
            }
            result.put("index_" + indexes[0], returnJa);
            return write(200, "查询成功", "data", result);
        } catch (
                Exception e
                )
        } catch (Exception e)
        {
            e.printStackTrace();
@ -369,23 +371,24 @@ 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.getNowYear());
             //   JSONObject jo = statisticsService.getRenewPercentAndChangePercent(level + "", area, Constant.getNowYear());
                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%
              //  result.put("renew", jo.get("thisYearRenew") + "/" + jo.get("yesterYearSign"));//去年的签约量
               // result.put("renewRange", jo.get("renewRange"));//续签率  50.00%
            } else {
                result = statisticsAllService.getGroupInfo(endDate, lowCode, area, level);
            }
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
@ -468,6 +471,7 @@ public class StatisticsController extends BaseController {
            return write(200, "查询成功!", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败!");
        }
    }
@ -556,6 +560,7 @@ public class StatisticsController extends BaseController {
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
@ -602,6 +607,7 @@ public class StatisticsController extends BaseController {
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
@ -725,6 +731,7 @@ public class StatisticsController extends BaseController {
                return write(200, "查询成功", "data", statisticsService.getCoutListByTimeYear(level, area, year));
            }
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
@ -742,6 +749,7 @@ public class StatisticsController extends BaseController {
        try {
            return write(200, "查询成功", "data", statisticsService.getBindingRate());
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
@ -759,6 +767,7 @@ public class StatisticsController extends BaseController {
        try {
            return write(200, "查询成功", "data", statisticsService.getAVGSocre(level, area));
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }