提交 c6cfdc61 作者: gh

定时客服发送:根据人群包appid循环,支持无链接纯文本客服

上级 53396b29
......@@ -256,19 +256,17 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
List<ReferralEntityVo> referralList = referralEntityService.findReferralByCustomerGraphicsId(customerGraphics.getId());
Map<String, List<ReferralEntityVo>> referralMap = referralList.stream().collect(Collectors.groupingBy(ReferralEntityVo::getAppid));
//循环该客服下的所有素材
for (Map.Entry<String, List<ReferralEntityVo>> referralEntry : referralMap.entrySet()) {
//循环该人群包下的所有素材
for (Map.Entry<String, List<CrowdPackageUserVO>> usersEntry : appidUserMap.entrySet()) {
String appid = referralEntry.getKey();
String appid = usersEntry.getKey();
//获取该号的链接实体
List<ReferralEntityVo> referralEntityVo = referralMap.get(appid);
//获取该号的openid
List<CrowdPackageUserVO> packageUserVo = appidUserMap.get(appid);
List<CrowdPackageUserVO> packageUserVo = usersEntry.getValue();
if (referralEntityVo!=null&&!referralEntityVo.isEmpty()&&packageUserVo!=null&&!packageUserVo.isEmpty()){
weChatService.sendCustomerMessage(appid,customerGraphics,packageUserVo,referralEntityVo);
weChatService.sendCustomerMessage(appid,customerGraphics,packageUserVo,referralEntityVo);
}
}
//客服状态修改
customerGraphics.setSendStatus(CustomerCommonConstant.SEND_STATUS_FINISHED);
......
......@@ -201,7 +201,7 @@ public class WeChatServiceImpl implements WeChatService{
//类型判断
if (CUSTOMER_TEXT.equals(customerGraphics.getType())){
//文本类客服,需要判断替换链接的个数
Map<Integer, String> sortReferral = urlList.stream().collect(Collectors.toMap(ReferralEntityVo::getSort, ReferralEntityVo::getReferral, (v1, v2) -> v2));
Map<Integer, String> sortReferral = urlList!=null&&!urlList.isEmpty()?urlList.stream().collect(Collectors.toMap(ReferralEntityVo::getSort, ReferralEntityVo::getReferral, (v1, v2) -> v2)):new HashMap<>(1);
if (customerGraphics.getReferralSize()!=null&&customerGraphics.getReferralSize().equals(sortReferral.size())){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论