提交 cac45307 作者: 沈振路

客服消息发送适配“番茄小程序”

上级 3bc6faa8
...@@ -272,7 +272,8 @@ public class CustomerServiceCommonAsyncComponent { ...@@ -272,7 +272,8 @@ public class CustomerServiceCommonAsyncComponent {
} catch (Exception e) { } catch (Exception e) {
LOCAL_LOG.warn("公众号: {} 获取链接异常: {}", authInfoVo.getAccountName(), e.getMessage()); LOCAL_LOG.warn("公众号: {} 获取链接异常: {}", authInfoVo.getAccountName(), e.getMessage());
} }
// 所有处理结束之后,重新赋值 referralEntity 的accountId 为公众号本身的Id(主要是因为客服消息生成之后,发送的时候,referral_entity 表只有 account_id 字段可以区分推送公众号)进行保存
referralEntity.setAccountId(authInfoVo.getAccountId());
referralEntityList.add(referralEntity); referralEntityList.add(referralEntity);
} }
......
...@@ -284,7 +284,7 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap ...@@ -284,7 +284,7 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
Date requestDate = integrationRequestDTO.getRequestDate(); Date requestDate = integrationRequestDTO.getRequestDate();
long currentTimestamp = requestDate.getTime(); long currentTimestamp = System.currentTimeMillis();
//获取待发送的开启客服 //获取待发送的开启客服
List<CustomerGraphics> customerGraphicsList = list(new QueryWrapper<CustomerGraphics>().eq(CustomerGraphics.COL_POST_TIME, requestDate).eq(CustomerGraphics.COL_SEND_STATUS,CustomerCommonConstant.SEND_STATUS_ACTIVE)); List<CustomerGraphics> customerGraphicsList = list(new QueryWrapper<CustomerGraphics>().eq(CustomerGraphics.COL_POST_TIME, requestDate).eq(CustomerGraphics.COL_SEND_STATUS,CustomerCommonConstant.SEND_STATUS_ACTIVE));
...@@ -332,7 +332,13 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap ...@@ -332,7 +332,13 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
.filter(v -> v.getNewsType() != null && v.getNewsType() == -1) .filter(v -> v.getNewsType() != null && v.getNewsType() == -1)
.collect(Collectors.toList()); .collect(Collectors.toList());
// 非自定义链接 // 非自定义链接
Map<String, List<ReferralEntityVo>> referralMap = referralList.stream().filter(a->!StringUtils.isAnyBlank(a.getReferral(), a.getAppid())).collect(Collectors.groupingBy(ReferralEntityVo::getAppid)); Map<String, List<ReferralEntityVo>> referralMap = referralList
// 允许小程序类型的不设置referral字段的值
.stream().filter(a ->
// 过滤掉:appId 为空 或者(非小程序类型且链接为空) 的referral记录
StringUtils.isNotBlank(a.getAppid())
&& (StringUtils.isNotBlank(a.getReferral()) || CustomerCommonConstant.CUSTOMER_TYPE_VALUE_MINI_PROGRAM.equals(customerGraphics.getType()) ))
.collect(Collectors.groupingBy(ReferralEntityVo::getAppid));
//循环该人群包下的所有素材 //循环该人群包下的所有素材
int singleUserCount = 0; int singleUserCount = 0;
for (Map.Entry<String, List<CrowdPackageUserVO>> usersEntry : appidUserMap.entrySet()) { for (Map.Entry<String, List<CrowdPackageUserVO>> usersEntry : appidUserMap.entrySet()) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论