修改同步明细接口。

dev
kevin jiang 5 years ago
parent d87dabb7d7
commit fc04804860

@ -14,14 +14,13 @@ import com.lmax.disruptor.*;
import com.lmax.disruptor.dsl.Disruptor;
import com.lmax.disruptor.dsl.ProducerType;
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.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.*;
/**
@ -60,7 +59,7 @@ public class CustomerDataJob {
private RedisUtil redisUtil;
public void handle(String cpUserIds) {
public void handle(String cpUserIds) throws WxErrorException {
//创建线程池
ExecutorService executors = Executors.newFixedThreadPool(THREAD_NUMBERS);
@ -109,15 +108,26 @@ public class CustomerDataJob {
index++;
}
} else {
String[] split = cpUserIds.split(",");
List<String> cpUserIdList = Arrays.asList(split);
// String[] split = cpUserIds.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);
Map<String, Object> customerMap = new HashMap<>();
for (int i = 0; i < customerList.size(); i++) {
Map<String, Object> item = customerList.get(i);
if(null != item.get("cpUserId")){
customerMap.put(item.get("cpUserId").toString(), item.get("sumCustomer"));
}
}
for (String cpUserId : cpUserIdList) {
QueryWrapper<PrivilageCpUserDO> cpUserDOQueryWrapper = new QueryWrapper<>();

@ -24,6 +24,7 @@ import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.*;
import me.chanjar.weixin.cp.bean.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -430,6 +431,8 @@ public class QWMailListManageService {
return customers;
}
private File file = new File("file/601.txt");
public void getCustomerNew(String cpUserId, Integer sumCustomer, CustomerService customerService, List<Map<String, Object>> tagList) throws WxErrorException {
//查询店铺id——店铺ID存在说明该账号的客户都绑在店上不存在则说明绑在账号上
// Long storeId = privilageCpUserStoreDOMapper.selectOneByCpUserId(cpUserId);
@ -515,9 +518,13 @@ public class QWMailListManageService {
turnBackDTO.setWxData(wxDataDTO);
// SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// Date jtime = sdf.parse(turnBackDTO.getJoinTime());
// Date etime = sdf.parse("2020-05-28 00:00:00");
// if (jtime.before(etime)) {
// Date stime = sdf.parse("2020-05-25 00:00:00");
// Date etime = sdf.parse("2020-05-26 00:00:00");
//
//
// if (jtime.after(stime) && jtime.before(etime)) {
//// System.out.println("aa" + turnBackDTO.toString());
// FileUtils.write(file, turnBackDTO.toString() + "\n","utf-8", true);
// continue;
// }
// System.out.println(turnBackDTO.toString());

@ -57,7 +57,10 @@ public class JobTest {
// 13278869965
// 19906239800
String cpUserIds = "17386133351";
customerDataJob.handle(null);
customerDataJob.handle(cpUserIds);
// List<String> cpUserIds = dataAccountDOMapper.selectByAccount();
// customerDataJob.handleList(cpUserIds);
log.info("<--获取联系客户统计数据定时任务结束-->");

Loading…
Cancel
Save