|
|
@ -14,14 +14,13 @@ import com.lmax.disruptor.*;
|
|
|
|
import com.lmax.disruptor.dsl.Disruptor;
|
|
|
|
import com.lmax.disruptor.dsl.Disruptor;
|
|
|
|
import com.lmax.disruptor.dsl.ProducerType;
|
|
|
|
import com.lmax.disruptor.dsl.ProducerType;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
import me.chanjar.weixin.common.error.WxErrorException;
|
|
|
|
|
|
|
|
import me.chanjar.weixin.cp.bean.WxCpUser;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import java.util.concurrent.*;
|
|
|
|
import java.util.concurrent.*;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -60,7 +59,7 @@ public class CustomerDataJob {
|
|
|
|
private RedisUtil redisUtil;
|
|
|
|
private RedisUtil redisUtil;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void handle(String cpUserIds) {
|
|
|
|
public void handle(String cpUserIds) throws WxErrorException {
|
|
|
|
|
|
|
|
|
|
|
|
//创建线程池
|
|
|
|
//创建线程池
|
|
|
|
ExecutorService executors = Executors.newFixedThreadPool(THREAD_NUMBERS);
|
|
|
|
ExecutorService executors = Executors.newFixedThreadPool(THREAD_NUMBERS);
|
|
|
@ -109,14 +108,25 @@ public class CustomerDataJob {
|
|
|
|
index++;
|
|
|
|
index++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
String[] split = cpUserIds.split(",");
|
|
|
|
// String[] split = cpUserIds.split(",");
|
|
|
|
List<String> cpUserIdList = Arrays.asList(split);
|
|
|
|
// List<String> cpUserIdList = Arrays.asList(split);
|
|
|
|
|
|
|
|
List<String> cpUserIdList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<WxCpUser> wxCpUsers = qwMailListManageService.syncUser();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < wxCpUsers.size(); i++) {
|
|
|
|
|
|
|
|
WxCpUser item = wxCpUsers.get(i);
|
|
|
|
|
|
|
|
cpUserIdList.add(item.getUserId());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取账号的总客户数
|
|
|
|
// 获取账号的总客户数
|
|
|
|
List<Map<String, Object>> customerList = opSellerCustomerRelationDOMapper.selectCustomersByCpUserIdByList(cpUserIdList);
|
|
|
|
List<Map<String, Object>> customerList = opSellerCustomerRelationDOMapper.selectCustomersByCpUserIdByList(cpUserIdList);
|
|
|
|
Map<String, Object> customerMap = new HashMap<>();
|
|
|
|
Map<String, Object> customerMap = new HashMap<>();
|
|
|
|
for (int i = 0; i < customerList.size(); i++) {
|
|
|
|
for (int i = 0; i < customerList.size(); i++) {
|
|
|
|
Map<String, Object> item = customerList.get(i);
|
|
|
|
Map<String, Object> item = customerList.get(i);
|
|
|
|
customerMap.put(item.get("cpUserId").toString(), item.get("sumCustomer"));
|
|
|
|
if(null != item.get("cpUserId")){
|
|
|
|
|
|
|
|
customerMap.put(item.get("cpUserId").toString(), item.get("sumCustomer"));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (String cpUserId : cpUserIdList) {
|
|
|
|
for (String cpUserId : cpUserIdList) {
|
|
|
|