forked from rongchao/epmet-cloud-rizhao
				
			
				 22 changed files with 178 additions and 42 deletions
			
			
		| @ -0,0 +1,9 @@ | |||
| package com.epmet.service; | |||
| 
 | |||
| import com.epmet.commons.tools.utils.Result; | |||
| 
 | |||
| public interface DimInitService { | |||
| 
 | |||
|     Result initAllDims(); | |||
| 
 | |||
| } | |||
| @ -0,0 +1,19 @@ | |||
| package com.epmet.service.impl; | |||
| 
 | |||
| import com.epmet.commons.tools.utils.Result; | |||
| import com.epmet.feign.DataStatisticalOpenFeignClient; | |||
| import com.epmet.service.DimInitService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| 
 | |||
| @Service | |||
| public class DimInitServiceImpl implements DimInitService { | |||
| 
 | |||
|     @Autowired | |||
|     private DataStatisticalOpenFeignClient statsFeignClient; | |||
| 
 | |||
|     @Override | |||
|     public Result initAllDims() { | |||
|         return statsFeignClient.initAllDims(); | |||
|     } | |||
| } | |||
| @ -0,0 +1,31 @@ | |||
| package com.epmet.task; | |||
| 
 | |||
| import com.epmet.commons.tools.utils.Result; | |||
| import com.epmet.service.DimInitService; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Component; | |||
| 
 | |||
| /** | |||
|  * @author zhaoqifeng | |||
|  * @dscription | |||
|  * @date 2020/6/23 14:36 | |||
|  */ | |||
| @Slf4j | |||
| @Component("dimInitTask") | |||
| public class DimInitTask implements ITask { | |||
| 
 | |||
| 	@Autowired | |||
| 	private DimInitService dimInitService; | |||
| 
 | |||
| 	@Override | |||
| 	public void run(String params) { | |||
| 		log.debug("DimInitTask定时任务正在执行,参数为:{}", params); | |||
| 		Result result = dimInitService.initAllDims(); | |||
| 		if (result.success()){ | |||
| 			log.debug("DimInitTask定时任务正在执行定时任务执行成功"); | |||
| 		}else { | |||
| 			log.debug("DimInitTask定时任务正在执行定时任务执行失败:" + result.getMsg()); | |||
| 		} | |||
| 	} | |||
| } | |||
					Loading…
					
					
				
		Reference in new issue