微信群发接口调用代码
//找到需要发的微信号,参考https://www.wuliaokankan.cn/url301/138.html
List<AccountInfo> accList = accountDao.getAllAccountInfoByTypeCidDid(info.getCid(), info.getDid());
if(null != accList && accList.size()>0){
List<String> whoinvisibleIdList = whoinvisibleIdList(info) ;//不给谁看
for(int i=0;i<accList.size();i++){
AccountInfo account = accList.get(i);
List<WeChatAccountInfo> weChatIdList = weChatAccountDao.findWeChatAccountInfo(account.getCid(), account.getId());
if(null != weChatIdList && weChatIdList.size()>0){
for(int j=0;j<weChatIdList.size();j++){
WeChatAccountInfo waInfo = weChatIdList.get(j);//哪些微信号需要定时操作
//微信号中需要屏蔽的微信号的好友
List<String> friendWechatList = whoinvisibleWechatIdList(whoinvisibleIdList, info, waInfo, weChatContactDao);
//子任务分别处理 存储子任务详情
if(info.getTasktype()==1){//添加群发任务
//找到需要群发的好友微信号,屏蔽不需要群发的人
List<String> newfriendWechatList = weChatContactDao.findFriendWeChatIds(waInfo.getWechatid(), friendWechatList);
if(null != newfriendWechatList && newfriendWechatList.size()>0){
if(newfriendWechatList.size()<=200){
saveGroupSendTimeTaskDetail(info, newfriendWechatList, waInfo.getWechatid(), timeTaskDetailsDao);
}else{
int subCount = newfriendWechatList.size();
int subSize = 200;
int subPageTotal = (subCount / subSize) + ((subCount % subSize > 0) ? 1 : 0);
// 根据页码取数据
for (int x = 0, len = subPageTotal - 1; x <= len; x++) {
// 分页计算
int fromIndex = x * subSize;
int toIndex = ((x == len) ? subCount : ((x + 1) * subSize));
List<String> strings = newfriendWechatList.subList(fromIndex, toIndex);
String dat = info.getExecute_time();
Date dte = DateUtil.convertString2Date(dat, DateUtil.DATE_FORMAT_4);
long times = dte.getTime() + (x * 1000 * 60 *10);
dat = DateUtil.convertDate2String(new Date(times), DateUtil.DATE_FORMAT_4);
info.setExecute_time(dat);
saveGroupSendTimeTaskDetail(info, strings, waInfo.getWechatid(), timeTaskDetailsDao);
}
}
}
}else if(info.getTasktype()==2){//发朋友圈
saveCircleSendTimeTaskDetail(info, friendWechatList, waInfo.getWechatid(), timeTaskDetailsDao);
}
}
}
}
微信群发接口调用代码相关推荐
- java 朋友圈分享接口_微信发朋友圈api接口调用代码
微信发朋友圈api接口调用代码,推送微信朋友圈.发朋友圈 /** * 触发推送朋友圈列表 * @author wechatno:tangjinjinwx * startTime传秒 * @blog h ...
- 聚合微信聊天crm调用代码
聚合微信聊天crm调用代码 /** * 群发好友消息任务 * * @author wechatno:tangjinjinwx * @blog http://www.wlkankan.cn */ @As ...
- java字典写实例,基于JAVA的新华字典接口调用代码实例
基于JAVA的新华字典接口调用代码实例 接口描述:基于JA V A的新华字典接口调用代码实例 接口平台:聚合数据 import java.io.BufferedReader; import java. ...
- python的坐标代码_基于Python的地图坐标服务接口调用代码实例
代码描述:基于Python的地图坐标服务接口调用代码实例 关联数据:地图坐标服务 接口地址:http://www.juhe.cn/docs/api/id/32 #!/usr/bin/python # ...
- python在律师上作中的实例_基于Python的律师信息查询接口调用代码实例
基于Python的律师信息查询接口调用代码实例代码描述:基于Python的律师信息查询接口调用代码实例 代码平台:聚合数据 #!/usr/bin/python # -*- coding: utf-8 ...
- java 金数据推送数据_基于JAVA的黄金数据接口调用代码实例
代码描述:基于JAVA的黄金数据接口调用代码实例 接口地址:http://www.juhe.cn/docs/api/id/29 1.[代码][Java]代码 import java.io.Buffer ...
- 使用php进行财务统计,基于php的基金财务数据接口调用代码实例
代码描述:基于php的基金财务数据接口调用代码实例 关联数据:基金财务数据 接口地址:http://www.juhe.cn/docs/api/id/28 1.[代码][PHP]代码 // +----- ...
- 微信api接口调用-发朋友圈
微信api接口调用-发朋友圈 /*** 发微信朋友圈* @author wechatno:tangjinjinwx* @blog http://www.wlkankan.cn*/@Asyncpubli ...
- php股票网站源代码,基于php的新三板实时股票信息接口调用代码实例
基于php的新三板实时股票信息接口调用代码实例 聚合数据新三板实时股票信息接口:https://www.juhe.cn/docs/api/id/185,若需要,则需通过此申请APPKEY. 示例:// ...
最新文章
- CentOS 6和CentOS 7管理系统服务的区别
- SQL Server 2012 安全新特性:包含数据库
- Android Studio如何用真机调试
- 统计学习方法第四章朴素贝叶斯法-李航
- 一体化市场谋定国际品牌贸易 对话国际农民丰收节贸易会
- 向量几何在游戏编程中的使用系列二之2-D物体间的碰撞响应
- POJ - 2186 Popular Cows(强连通缩点)
- python机器学习入门(Day1:Numpy)
- windows 下架设svn服务器
- Python 爬虫基础 - 浏览器伪装
- mysql 5.6.21 rpm_centos_mysql5.6.21_rpm安装
- phpstorm增加swoole自动提示
- 各种排序算法的实现直接插入排序
- 高一计算机教学,高一信息技术教学计划参考
- 汉英词典python
- java打造手机远程控制电脑之详细教程
- 《Two-Archive Evolutionary Algorithm for Constrained Multiobjective Optimization》阅读笔记
- Maya mental ray 焦散
- 【数值分析实验MATLAB】数值积分:梯形公式、辛普森公式、复化梯形公式、复化辛普森公式、龙贝格算法、自适应求积方法
- 输出日期为2021年的第几天(switch...case)