forked from luyan/epmet-cloud-lingshan
4 changed files with 44 additions and 9 deletions
@ -0,0 +1,34 @@ |
|||||
|
package com.epmet.task; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.extract.form.IcUserCategoryAnalysisDailyFormDTO; |
||||
|
import com.epmet.feign.DataStatisticalOpenFeignClient; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
|
||||
|
@Slf4j |
||||
|
@Component("icUserCategoryAnalysisTask") |
||||
|
public class IcUserCategoryAnalysisTask implements ITask { |
||||
|
|
||||
|
@Autowired |
||||
|
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; |
||||
|
|
||||
|
@Override |
||||
|
public void run(String params) { |
||||
|
log.info("icUserCategoryAnalysisTask定时任务正在执行,参数为:{}", params); |
||||
|
IcUserCategoryAnalysisDailyFormDTO formDTO = new IcUserCategoryAnalysisDailyFormDTO(); |
||||
|
if (StringUtils.isNotBlank(params)) { |
||||
|
formDTO = JSON.parseObject(params, IcUserCategoryAnalysisDailyFormDTO.class); |
||||
|
} |
||||
|
Result result = dataStatisticalOpenFeignClient.statUserCategoryDaily(formDTO); |
||||
|
if (result.success()) { |
||||
|
log.info("icUserCategoryAnalysisTask定时任务正在执行定时任务执行成功"); |
||||
|
} else { |
||||
|
log.warn("icUserCategoryAnalysisTask定时任务正在执行定时任务执行失败:" + result.getMsg()); |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue