|
|
|
@ -10,9 +10,11 @@ import com.lmax.disruptor.*;
|
|
|
|
|
import com.lmax.disruptor.dsl.Disruptor;
|
|
|
|
|
import com.lmax.disruptor.dsl.ProducerType;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.concurrent.*;
|
|
|
|
|
|
|
|
|
@ -46,7 +48,7 @@ public class CustomerDataJob {
|
|
|
|
|
private CustomerService customerService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void handle(){
|
|
|
|
|
public void handle(String cpUserIds){
|
|
|
|
|
|
|
|
|
|
//创建线程池
|
|
|
|
|
ExecutorService executors = Executors.newFixedThreadPool(THREAD_NUMBERS);
|
|
|
|
@ -65,14 +67,25 @@ public class CustomerDataJob {
|
|
|
|
|
|
|
|
|
|
disruptor.start();
|
|
|
|
|
|
|
|
|
|
int index =0;
|
|
|
|
|
DetailDTOMessageEventProducer producer = new DetailDTOMessageEventProducer(ringBuffer, qwMailListManageService, customerService, poiStoreStaffDOMapper);
|
|
|
|
|
if (StringUtils.isBlank(cpUserIds)){
|
|
|
|
|
List<PrivilageCpUserDO> privilageCpUserDOS = privilageCpUserDOMapper.selectList(null);
|
|
|
|
|
int index =0;
|
|
|
|
|
for (PrivilageCpUserDO privilageCpUserDO : privilageCpUserDOS) {
|
|
|
|
|
Long storeId = privilageCpUserStoreDOMapper.selectOneByCpUserId(privilageCpUserDO.getCpUserId());
|
|
|
|
|
producer.produceData(index,storeId,privilageCpUserDO.getCpUserId());
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
String[] split = cpUserIds.split(",");
|
|
|
|
|
List<String> cpUserIdList = Arrays.asList(split);
|
|
|
|
|
for (String cpUserId : cpUserIdList) {
|
|
|
|
|
Long storeId = privilageCpUserStoreDOMapper.selectOneByCpUserId(cpUserId);
|
|
|
|
|
producer.produceData(index,storeId,cpUserId);
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
disruptor.shutdown();
|
|
|
|
|
}
|
|
|
|
|