批量推送的时候,可以通过截取的方式,批量推送

// List<Map<String, String>> sendList = null;

// // 批次大小

// int batchSize = 100;

// // 批次次数

// int batchCount = 1;

// // 如果是批量发送,则计算分批次数

// if (params.containsKey("lstPpl")) {

// sendList = (List<Map<String, String>>) params.get("lstPpl");

// batchCount = (int) Math.ceil(sendList.size() / batchSize);

// }

// for (int i = 0; i <= batchCount; i++) {

// if (CollectionUtils.isNotEmpty(sendList)) {

// // 截取当前批次需要发送的open id

// requestMap.put("lstPpl", sendList.subList(i * batchSize, (i + 1) * batchSize > sendList.size() ? sendList.size() : (i + 1) * batchSize));

// }

posted @ 2020-12-28 10:52  夏之  阅读(87)  评论(0)    收藏  举报