//找到需要发的微信号,参考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);
                            }
                        }
                    }
                }

微信群发接口调用代码相关推荐

  1. java 朋友圈分享接口_微信发朋友圈api接口调用代码

    微信发朋友圈api接口调用代码,推送微信朋友圈.发朋友圈 /** * 触发推送朋友圈列表 * @author wechatno:tangjinjinwx * startTime传秒 * @blog h ...

  2. 聚合微信聊天crm调用代码

    聚合微信聊天crm调用代码 /** * 群发好友消息任务 * * @author wechatno:tangjinjinwx * @blog http://www.wlkankan.cn */ @As ...

  3. java字典写实例,基于JAVA的新华字典接口调用代码实例

    基于JAVA的新华字典接口调用代码实例 接口描述:基于JA V A的新华字典接口调用代码实例 接口平台:聚合数据 import java.io.BufferedReader; import java. ...

  4. python的坐标代码_基于Python的地图坐标服务接口调用代码实例

    代码描述:基于Python的地图坐标服务接口调用代码实例 关联数据:地图坐标服务 接口地址:http://www.juhe.cn/docs/api/id/32 #!/usr/bin/python # ...

  5. python在律师上作中的实例_基于Python的律师信息查询接口调用代码实例

    基于Python的律师信息查询接口调用代码实例代码描述:基于Python的律师信息查询接口调用代码实例 代码平台:聚合数据 #!/usr/bin/python # -*- coding: utf-8 ...

  6. java 金数据推送数据_基于JAVA的黄金数据接口调用代码实例

    代码描述:基于JAVA的黄金数据接口调用代码实例 接口地址:http://www.juhe.cn/docs/api/id/29 1.[代码][Java]代码 import java.io.Buffer ...

  7. 使用php进行财务统计,基于php的基金财务数据接口调用代码实例

    代码描述:基于php的基金财务数据接口调用代码实例 关联数据:基金财务数据 接口地址:http://www.juhe.cn/docs/api/id/28 1.[代码][PHP]代码 // +----- ...

  8. 微信api接口调用-发朋友圈

    微信api接口调用-发朋友圈 /*** 发微信朋友圈* @author wechatno:tangjinjinwx* @blog http://www.wlkankan.cn*/@Asyncpubli ...

  9. php股票网站源代码,基于php的新三板实时股票信息接口调用代码实例

    基于php的新三板实时股票信息接口调用代码实例 聚合数据新三板实时股票信息接口:https://www.juhe.cn/docs/api/id/185,若需要,则需通过此申请APPKEY. 示例:// ...

最新文章

  1. CentOS 6和CentOS 7管理系统服务的区别
  2. SQL Server 2012 安全新特性:包含数据库
  3. Android Studio如何用真机调试
  4. 统计学习方法第四章朴素贝叶斯法-李航
  5. 一体化市场谋定国际品牌贸易 对话国际农民丰收节贸易会
  6. 向量几何在游戏编程中的使用系列二之2-D物体间的碰撞响应
  7. POJ - 2186 Popular Cows(强连通缩点)
  8. python机器学习入门(Day1:Numpy)
  9. windows 下架设svn服务器
  10. Python 爬虫基础 - 浏览器伪装
  11. mysql 5.6.21 rpm_centos_mysql5.6.21_rpm安装
  12. phpstorm增加swoole自动提示
  13. 各种排序算法的实现直接插入排序
  14. 高一计算机教学,高一信息技术教学计划参考
  15. 汉英词典python
  16. java打造手机远程控制电脑之详细教程
  17. 《Two-Archive Evolutionary Algorithm for Constrained Multiobjective Optimization》阅读笔记
  18. Maya mental ray 焦散
  19. 【数值分析实验MATLAB】数值积分:梯形公式、辛普森公式、复化梯形公式、复化辛普森公式、龙贝格算法、自适应求积方法
  20. 输出日期为2021年的第几天(switch...case)

热门文章

  1. 图像分割标签制作软件
  2. python----读大文件
  3. 【PPT模板】动态时间轴(含资源下载)
  4. 【python】nonlocal的详解
  5. 建筑行业app开发定制公司(方案)
  6. python数据分析概述答案_Python数据分析实战(1)数据分析概述
  7. 错误信息:没有为会计年度0定义版本2018.
  8. CCF计算机软件能力认证试题练习:201609-3 炉石传说
  9. PHP的电话号码识别
  10. adams怎么打开自带模型_adams2013版怎样打开一个做好的bi – 手机爱问