Commit b4486abf by 阮思源

修改群发逻辑,一个群获取一次小号

parent b6071d83
......@@ -289,9 +289,17 @@ public class PushBizImpl implements PushBiz {
pushGroupRecord.setPushStatus(pushRecord.getPushStatus());
pushGroupRecords.add(pushGroupRecord);
pushGroupRecordDao.insert(pushGroupRecord);
//获取群信息
GroupQrcode groupQrcode = groupQrcodeDao.getById(pushGroup.getBookGroupQrcodeId());
if (groupQrcode == null) {
LOGGER.error("未找到群信息!qrcodeId=" + pushGroup.getBookGroupQrcodeId());
continue;
}
//获取机器人微信号
String altId = wechatGroupConsr.getRobotIdByGroupId(groupQrcode.getWeixinGroupId());
//遍历发送消息
for (PushItem pushItem : pushItemList) {
sendWechatMessage(pushGroup, pushItem, pushGroupRecord.getId());
sendWechatMessage(pushGroup, pushItem, pushGroupRecord.getId(), altId);
}
}
}
......@@ -300,7 +308,7 @@ public class PushBizImpl implements PushBiz {
* 发消息
*/
@ParamLog("发消息")
private void sendWechatMessage(PushGroup pushGroup, PushItem pushItem, Long pushGroupRecordId) {
private void sendWechatMessage(PushGroup pushGroup, PushItem pushItem, Long pushGroupRecordId, String altId) {
//获取群信息
GroupQrcode groupQrcode = groupQrcodeDao.getById(pushGroup.getBookGroupQrcodeId());
if (groupQrcode == null) {
......@@ -314,8 +322,6 @@ public class PushBizImpl implements PushBiz {
return;
}
String otherUrl = "book_group_id=" + classifyDTO.getBookGroupId() + "&classify_id=" + classifyDTO.getId() + "&qrcode_id=" + pushGroup.getBookGroupQrcodeId();
//获取机器人微信号
String altId = wechatGroupConsr.getRobotIdByGroupId(groupId);
if (groupQrcode != null && !StringUtil.isEmpty(groupId) && !StringUtil.isEmpty(altId)) {
Integer itemType = pushItem.getItemType();
if (ItemTypeEnum.TEXT.value.equals(itemType)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment