|
|
@@ -165,6 +165,9 @@ public class CorpMsgBulkTaskServiceImpl extends ServiceImpl<CorpMsgBulkTaskMappe
|
|
|
@Override
|
|
|
public void sendActiveCorpBulkMsg(CorpActiveBulkMsg msg) {
|
|
|
String content = msg.getContent();
|
|
|
+ if (StrUtil.isEmpty(content)) {
|
|
|
+ throw BusinessRuntimeException.getInstance("群发内容为空");
|
|
|
+ }
|
|
|
String img = msg.getImg();
|
|
|
Long wxCorpId = Optional.ofNullable(msg.getWxCorpId()).orElse(2l);
|
|
|
WxCorpApp wxCorpApp = wxCorpAppMapper.selectById(wxCorpId);
|
|
|
@@ -179,7 +182,7 @@ public class CorpMsgBulkTaskServiceImpl extends ServiceImpl<CorpMsgBulkTaskMappe
|
|
|
} catch (Exception e) {
|
|
|
}
|
|
|
}
|
|
|
- List<CorpUserFollowRelationDto> corpUserFollowRelations = corpUserFollowRelationMapper.selectCorpUserFollowRelationB(wxCorpApp.getId(), service_follow_ids);
|
|
|
+ List<CorpUserFollowRelationDto> corpUserFollowRelations = corpUserFollowRelationMapper.selectCorpUserFollowRelation(wxCorpApp.getId(), service_follow_ids);
|
|
|
//将成员与客户相同关联聚合
|
|
|
Map<String, List<CorpUserFollowRelationDto>> collect = corpUserFollowRelations.stream().collect(Collectors.groupingBy(CorpUserFollowRelationDto::getFollowId));
|
|
|
//附件
|
|
|
@@ -215,9 +218,9 @@ public class CorpMsgBulkTaskServiceImpl extends ServiceImpl<CorpMsgBulkTaskMappe
|
|
|
corpMsgTemplate.setSender(followId);
|
|
|
corpMsgTemplate.setExternalUserid(corpUserIdList);
|
|
|
CorpMsgTemplateAddResult result = corpOps.addMsgTemplate(wxCorpApp.getCorpId(), corpMsgTemplate);
|
|
|
- System.out.println(result.getErrMsg());
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
+ log.error("发送企业微信失败:{}", StringUtil.getErrorText(e));
|
|
|
}
|
|
|
});
|
|
|
}
|