瀏覽代碼

代码提交

chenweida 8 年之前
父節點
當前提交
205ae4b897

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

@ -148,7 +148,7 @@ 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 from wlyy_sign_family a where  a.type =2 and status in (1,2) and  a.expenses_time< '" + tomorrow + "' and a.expenses_time >'"+Constant.getStartTime()+"' 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.getStartTime()+"' 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.getStartTime()+"' and a.expenses_status=1 ";
        //抽取數據
@ -1153,11 +1153,11 @@ public class CurrentDayAllQuotaJob implements Job {
    private void computequota_30() {
        String quotaId = "30";
        try {
            String sql="select fr.sign_code code,fr.hospital,fr.admin_team_id from wlyy_sign_family_renew_log fr where fr.`status`>0  and fr.apply_date<'"+tomorrow+"' and  fr.apply_date> '" + Constant.getStartTime() + "'";
            String sql="select fr.sign_code code,fr.hospital,fr.admin_team_id,fr.renew_change_reason from wlyy_sign_family_renew_log fr where fr.`status`>0  and fr.apply_date<'"+tomorrow+"' and  fr.apply_date> '" + Constant.getStartTime() + "'";
            //抽取數據
            List<SignFamilyRenew> signFamilies = SpringUtil.getBean(DBExtract.class).extract(SignFamilyRenew.class, sql);
            //清洗數據
            FilterModel etlModels = SpringUtil.getBean(RenewSignDataFilter.class).filter(signFamilies, sql, "now");
            FilterModel etlModels = SpringUtil.getBean(RenewSignDataFilter.class).filter(signFamilies,"1", sql, "now");
            //统计数据
            List<Map<String, List<ETLModel>>> returnDatas = SpringUtil.getBean(Level1Role.class).elt(etlModels.getEtlModelList());
            //统计数据 二级维度
@ -1352,39 +1352,4 @@ public class CurrentDayAllQuotaJob implements Job {
        return dateString;
    }
    /**
     * 根据年龄得到对应的code
     *
     * @param age
     * @return
     */
    public String getAgeCode(int age) {
        if (age < 7) {
            return Constant.level_age_1;
        } else if (age >= 7 && age < 18) {
            return Constant.level_age_2;
        } else if (age >= 18 && age < 30) {
            return Constant.level_age_3;
        } else if (age >= 30 && age < 50) {
            return Constant.level_age_4;
        } else if (age >= 50 && age < 65) {
            return Constant.level_age_5;
        } else {
            return Constant.level_age_6;
        }
    }
    private String saveContent(String id, Integer size, Long qkCount, Long orgCount, Long townCount, Long cityCount, boolean isAll, StringBuffer errorContent, Long errorCount) {
        StringBuffer string = new StringBuffer("统计 quotaid:" + id + " 的数据完成 ,数据库查询到签约数目:" + size);
        string.append(",过滤的脏数据数目:" + errorCount);
        string.append(",统计到市的数据总数:" + cityCount);
        string.append(",统计到区的数据总数:" + townCount);
        string.append(",统计到机构的数据总数:" + orgCount);
        string.append(",统计到团队的数据总数:" + qkCount);
        string.append(",是否统计成功:" + isAll);
        if (!isAll) {
            string.append(",失败原因:" + errorContent);
        }
        return string.toString();
    }
}

+ 1 - 1
patient-co-statistics/src/main/resources/application.yml

@ -1,5 +1,5 @@
server:
  port: 8080
  port: 8081
spring:
  datasource: