SyncCustomerBaseJob.java
1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
package cn.com.glsx.entmicro.job;
import cn.com.glsx.entmicro.config.SystemProperty;
import cn.com.glsx.entmicro.service.CustomerBaseService;
import cn.com.glsx.entmicro.service.CustomerService;
import cn.com.glsx.entmicro.service.MerchantListener;
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 com.glsx.plat.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
*/
/**
* @author zhouhaibao
* @version 1.0
* @description: 定时任务同步企微客户群
* @date 2021/8/12 11:25
*//*
@Slf4j
@Component
@ElasticSimpleJob(jobName = "syncCustomerBaseJob", cron = "0 0 23 * * ?")
public class SyncCustomerBaseJob implements SimpleJob {
@Autowired
private CustomerBaseService customerBaseService;
@Autowired
private SyncDataService syncDataService;
@Override
public void execute(ShardingContext shardingContext) {
try {
syncDataService.setMerchantListener((Integer merchantId) -> {
customerBaseService.syncEntmicroCustomerBase(merchantId, null);
});
} catch (Exception e) {
log.info("同步客户群数据异常,msg:" + e.getMessage());
}
}
}
*/