提交 4269c839 作者: 沈振路

Merge branch 'customer_service_SZlu'

package com.yaoyaozw.customer.controller; package com.yaoyaozw.customer.controller;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.rabbitmq.client.AMQP; import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel; import com.rabbitmq.client.Channel;
import com.yaoyaozw.customer.constants.CustomerCommonConstant; import com.yaoyaozw.customer.constants.CustomerCommonConstant;
import com.yaoyaozw.customer.constants.FollowReplyCommonConstant;
import com.yaoyaozw.customer.constants.RabbitCommonNameConstant; import com.yaoyaozw.customer.constants.RabbitCommonNameConstant;
import com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO; import com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO;
import com.yaoyaozw.customer.entity.CustomerFollowReply;
import com.yaoyaozw.customer.mapper.KanbanCommonMapper; import com.yaoyaozw.customer.mapper.KanbanCommonMapper;
import com.yaoyaozw.customer.service.AccountOrderService; import com.yaoyaozw.customer.service.AccountOrderService;
import com.yaoyaozw.customer.service.CustomerDelayPublishService; import com.yaoyaozw.customer.service.CustomerDelayPublishService;
...@@ -102,4 +105,17 @@ public class TestController { ...@@ -102,4 +105,17 @@ public class TestController {
} }
@GetMapping("/testFollowReply")
public void testFollowReply() {
Object obj = redisTemplate.opsForHash().get(FollowReplyCommonConstant.FOLLOW_REPLY_REDIS_KEY, "wx9f460fa46420016c");
if (ObjectUtil.isNotNull(obj)) {
List<CustomerFollowReply> list = JSONUtil.toList(JSONUtil.parseArray(obj.toString()), CustomerFollowReply.class);
for (CustomerFollowReply customerFollowReply : list) {
System.out.println(customerFollowReply);
}
}
}
} }
...@@ -126,6 +126,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -126,6 +126,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
} }
referralEntity.setMaterialGraphicsId(entity.getId()); referralEntity.setMaterialGraphicsId(entity.getId());
entity.setSourceUrl(referralEntity.getReferral()); entity.setSourceUrl(referralEntity.getReferral());
entity.setContent("");
// 保存链接数据 // 保存链接数据
if (ObjectUtil.isNull(referralEntity.getId())) { if (ObjectUtil.isNull(referralEntity.getId())) {
referralEntityService.save(referralEntity); referralEntityService.save(referralEntity);
...@@ -319,9 +320,11 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -319,9 +320,11 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
// 分配referral // 分配referral
for (CustomerFollowReply sourceEntity : sourceMaterialList) { for (CustomerFollowReply sourceEntity : sourceMaterialList) {
List<ReferralEntity> referralEntities = referralMap.get(sourceEntity.getId()); List<ReferralEntity> referralEntities = referralMap.get(sourceEntity.getId());
if (CollectionUtil.isNotEmpty(referralEntities)) {
referralEntities = referralEntities.stream().sorted(Comparator.comparingInt(ReferralEntity::getSort)).collect(Collectors.toList()); referralEntities = referralEntities.stream().sorted(Comparator.comparingInt(ReferralEntity::getSort)).collect(Collectors.toList());
sourceEntity.setReferralEntityList(referralEntities); sourceEntity.setReferralEntityList(referralEntities);
} }
}
return sourceMaterialList; return sourceMaterialList;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论