| 
					
				 | 
			
			
				@ -109,14 +109,21 @@ public class MysqlToEsQuotaJob implements Job { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            endTime = endTime + " 17:00:00"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //初始化开始时间 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isEmpty(startTime)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            startTime = new LocalDate(new DateTime().minusDays(2)).toString("yyyy-MM-dd") + " 17:00:00"; //2017-06-01 17:00:00 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            startTime = startTime + " 17:00:00"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //初始化统计年份 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        this.year = getNowYearByDate(endTime); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //初始化开始时间 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if ("2".equals(timeLevel)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //按年度到达量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            startTime = this.year + "-06-30 17:00:00"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //增量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (StringUtils.isEmpty(startTime)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                startTime = new LocalDate(new DateTime().minusDays(2)).toString("yyyy-MM-dd") + " 17:00:00"; //2017-06-01 17:00:00 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                startTime = startTime + " 17:00:00"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        this.quotaDate = DateUtil.strToDate(endTime, "yyyy-MM-dd"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -128,6 +135,7 @@ public class MysqlToEsQuotaJob implements Job { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private void computequota() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("========================quotaCode:" + wlyyJobConfigVO.getId() + ","+DateUtil.dateToStr(quotaDate, "yyyy-MM-dd")+" start========================"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            QuartzJobLog tjQuotaLog = new QuartzJobLog(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            tjQuotaLog.setJobId(wlyyJobConfigVO.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            tjQuotaLog.setJobStartTime(new Date()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -153,6 +161,7 @@ public class MysqlToEsQuotaJob implements Job { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            tjQuotaLog.setJobEndTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            tjQuotaLog.setJobContent(JSONArray.fromObject(filterModel.getErrorModels()).toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            saveLog(tjQuotaLog); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("========================quotaCode:" + wlyyJobConfigVO.getId() + ","+DateUtil.dateToStr(quotaDate, "yyyy-MM-dd")+" end========================"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -246,8 +255,8 @@ public class MysqlToEsQuotaJob implements Job { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private FilterModel filter(List<DataModel> dataModel) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            FilterModel filterModel= SpringUtil.getBean(FilterHelper.class).filter(dataModel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("FilterModel:  success sizs:"+filterModel.getData().size()+",error size:"+filterModel.getErrorModels().size()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            FilterModel filterModel = SpringUtil.getBean(FilterHelper.class).filter(dataModel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("FilterModel:  success sizs:" + filterModel.getData().size() + ",error size:" + filterModel.getErrorModels().size()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return filterModel; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.error("filter error:" + e.getMessage()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -267,18 +276,18 @@ public class MysqlToEsQuotaJob implements Job { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (StringUtils.isEmpty(wlyyJobConfigVO.getCacheKey())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //不支持直接去数据库拿 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                dataModels = SpringUtil.getBean(ExtractHelper.class).extractData(wlyyJobConfigVO, startTime, endTime, year, timeLevel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //缓存的key 是 时间+timelevel+key 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                StringBuffer bu=new StringBuffer(DateUtil.dateToStr(quotaDate,"yyyy-MM-dd")+"-"+timeLevel+"-"+wlyyJobConfigVO.getCacheKey()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                StringBuffer bu = new StringBuffer(DateUtil.dateToStr(quotaDate, "yyyy-MM-dd") + "-" + timeLevel + "-" + wlyyJobConfigVO.getCacheKey()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //支持的话判断缓存有没有值 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                dataModels= Cache.getCache(bu.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if(dataModels==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                dataModels = Cache.getCache(bu.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (dataModels == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    //如果缓存是空的那么直接数据库拿 在放入缓存 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    dataModels = SpringUtil.getBean(ExtractHelper.class).extractData(wlyyJobConfigVO, startTime, endTime, year, timeLevel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     Cache.addCache(bu.toString(),dataModels); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    Cache.addCache(bu.toString(), dataModels); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("quotaCode:"+wlyyJobConfigVO.getId()+",size:"+dataModels.size()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("quotaCode:" + wlyyJobConfigVO.getId() + ",size:" + dataModels.size()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return dataModels; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.error("extract error:" + e.getMessage()); 
			 |