CustStatisticNightJob.java 1.51 KB
/*
package cn.com.glsx.entmicro.job;

import cn.com.glsx.entmicro.service.CustomerStatisticsService;
import cn.com.glsx.entmicro.service.SyncDataService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import com.dangdang.elasticjob.lite.annotation.ElasticSimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

*/
/**
 * @author fengzhi
 * @version 1.0
 * @description: 客户统计数据落地(晚上统计更新最新)
 * @date 2021/10/3 14:25
 *//*

@Slf4j
@Component
@ElasticSimpleJob(jobName = "CustStatisticNightJob", cron = "0 50 11 * * ?")
public class CustStatisticNightJob implements SimpleJob {

    @Autowired
    private CustomerStatisticsService customerStatisticsService;

    @Autowired
    private SyncDataService syncDataService;

    @Override
    public void execute(ShardingContext shardingContext) {
        try {
            syncDataService.setMerchantListener((Integer merchantId)-> {
                    List<Integer> integerList=new ArrayList<>();
                    integerList.add(merchantId);
                    customerStatisticsService.customerStatistics(integerList);
                    log.info("晚上刷新客户统计数据落地,integerList:{}", integerList);
            });
        } catch (Exception e) {
            log.info("客户统计数据落地异常,{}", e);
        }
    }
}
*/