提交 a9fff3b4 作者: 沈振路

客服消息的链接查询添加gmt_create排序 & 判断链接数量根据sort去重统计

上级 c64128f4
package com.yaoyaozw.customer.service.wechat.service;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.yaoyaozw.customer.constants.CustomerCommonConstant;
import com.yaoyaozw.customer.constants.RabbitCommonNameConstant;
......@@ -14,6 +15,7 @@ import com.yaoyaozw.customer.service.wechat.entity.customerRequest.WeChatCustome
import com.yaoyaozw.customer.vo.customer.CrowdPackageUserVO;
import com.yaoyaozw.customer.vo.customer.CustomerDelayItemVO;
import com.yaoyaozw.customer.vo.referral.ReferralEntityVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -26,6 +28,7 @@ import java.util.*;
import java.util.concurrent.*;
import java.util.stream.Collectors;
@Slf4j
@Service
public class WeChatServiceImpl implements WeChatService{
......@@ -206,7 +209,7 @@ public class WeChatServiceImpl implements WeChatService{
Map<Integer, String> sortReferral = urlList!=null&&!urlList.isEmpty()?urlList.stream().collect(Collectors.toMap(ReferralEntityVo::getSort, ReferralEntityVo::getReferral, (v1, v2) -> v2)):new HashMap<>(1);
// 统计生成完成的非自定义链接的链接数量
int actualReferralCount = urlList == null ? 0 : (int) urlList.stream().filter(v -> !StringUtils.isAnyBlank(v.getAppid(), v.getReferral()) && v.getNewsType() != null && v.getNewsType() != -1).count();
int actualReferralCount = urlList == null ? 0 : (int) urlList.stream().filter(v -> !StringUtils.isAnyBlank(v.getAppid(), v.getReferral()) && v.getNewsType() != null && v.getNewsType() != -1).map(ReferralEntityVo::getSort).distinct().count();
if (customerGraphics.getReferralSize()!=null && customerGraphics.getReferralSize().equals(actualReferralCount)){
String content = customerGraphics.getContent();
......
......@@ -44,6 +44,8 @@
where referral.material_graphics_id=#{graphicsId} and referral.is_deleted=0 and referral.referral!='error'
and (referral.account_id is not null or referral.news_type = -1)
order by referral.gmt_create
</select>
<delete id="ultimateDeleteReferralsBatch">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论