CustomerSyncToBigDataComponent.java
1.15 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
package cn.com.glsx.entmicro.manager;
import cn.com.glsx.entmicro.entity.EntmicroStaff;
import cn.com.glsx.entmicro.service.CustomerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.List;
/**
* @author wangxw
* @version 1.0.0
* @ClassName CustomerSyncToBigDataComponent.java
* @description: ${description}
* @createTime 2021年12月07日 00:09:00
*/
@Slf4j
@Component
public class CustomerSyncToBigDataComponent {
@Autowired
private CustomerService customerService;
@Async("taskExecutor")
public void syncCustomerToBigData(List<EntmicroStaff> entmicroStaffList,String type) {
if (CollectionUtils.isEmpty(entmicroStaffList)) {
log.info("customer info sync to bigdata staff empty.");
return;
}
for (EntmicroStaff entmicroStaff:entmicroStaffList) {
customerService.syncCustomerToBigData(entmicroStaff.getId(), type, entmicroStaff.getMerchantid());
}
}
}