提交 c0b57dff 作者: 沈振路

关回多图文编辑回显

上级 5a006ffe
...@@ -279,26 +279,38 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -279,26 +279,38 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
FollowReplyInfoVO infoVo = new FollowReplyInfoVO(); FollowReplyInfoVO infoVo = new FollowReplyInfoVO();
BeanUtil.copyProperties(entity, infoVo); BeanUtil.copyProperties(entity, infoVo);
// 获取素材的链接数据 if (!CustomerMaterialConstant.TENCENT_MEDIA_TYPE_MULTI_NEWS.equals(entity.getType())) {
if (CustomerMaterialConstant.needReferral(entity.getType())) { // 获取素材的链接数据
// 是需要设置referral的类型 if (CustomerMaterialConstant.needReferral(entity.getType())) {
if (CustomerMaterialConstant.TENCENT_MEDIA_TYPE_TEXT.equals(entity.getType())) { // 是需要设置referral的类型
// 文本类型 if (CustomerMaterialConstant.TENCENT_MEDIA_TYPE_TEXT.equals(entity.getType())) {
List<ReferralEntity> referralList = referralEntityService.list(new QueryWrapper<ReferralEntity>().eq(ReferralEntity.COL_MATERIAL_GRAPHICS_ID, id).orderByAsc("sort")); // 文本类型
infoVo.setTextBodyList(getReferralBodyFromEntity(referralList)); List<ReferralEntity> referralList = referralEntityService.list(new QueryWrapper<ReferralEntity>().eq(ReferralEntity.COL_MATERIAL_GRAPHICS_ID, id).orderByAsc("sort"));
} else if (CustomerMaterialConstant.TENCENT_MEDIA_TYPE_NEWS.equals(entity.getType())) { infoVo.setTextBodyList(getReferralBodyFromEntity(referralList));
try { } else if (CustomerMaterialConstant.TENCENT_MEDIA_TYPE_NEWS.equals(entity.getType())) {
// 设置图文类型的链接数据 try {
ReferralEntity referralEntity = referralEntityService.getOne(new QueryWrapper<ReferralEntity>().eq(ReferralEntity.COL_MATERIAL_GRAPHICS_ID, id)); // 设置图文类型的链接数据
if (ObjectUtil.isNotNull(referralEntity)) { ReferralEntity referralEntity = referralEntityService.getOne(new QueryWrapper<ReferralEntity>().eq(ReferralEntity.COL_MATERIAL_GRAPHICS_ID, id));
CommonReferralBody referralBody = new CommonReferralBody(); if (ObjectUtil.isNotNull(referralEntity)) {
BeanUtil.copyProperties(referralEntity, referralBody); CommonReferralBody referralBody = new CommonReferralBody();
infoVo.setReferralBody(referralBody); BeanUtil.copyProperties(referralEntity, referralBody);
infoVo.setReferralBody(referralBody);
}
} catch (Exception e) {
return new GenericsResult<>(false, "获取图文链接实体异常");
} }
} catch (Exception e) {
return new GenericsResult<>(false, "获取图文链接实体异常");
} }
} }
} else {
// 获取多图文
List<CustomerFollowReplyMultiNews> multiNewsList = followReplyMultiNewsService.list(new QueryWrapper<CustomerFollowReplyMultiNews>().eq("reply_id", id));
if (CollectionUtil.isNotEmpty(multiNewsList)) {
List<Long> multiNewsIdList = multiNewsList.stream().map(CustomerFollowReplyMultiNews::getId).collect(Collectors.toList());
List<ReferralEntity> referralEntityList = referralEntityService.list(new QueryWrapper<ReferralEntity>().in(ReferralEntity.COL_MATERIAL_GRAPHICS_ID, multiNewsIdList));
Map<Long, ReferralEntity> referralEntityMap = referralEntityList.stream().collect(Collectors.toMap(ReferralEntity::getMaterialGraphicsId, Function.identity(), (o1, o2) -> o2));
multiNewsList.forEach(item -> item.setReferralEntity(referralEntityMap.get(item.getId())));
infoVo.setMultiNewsList(multiNewsList);
}
} }
// 根据appid获取公众号信息 // 根据appid获取公众号信息
AuthInfoVO authInfo = authorizerInfoService.getAuthInfoByAppid(infoVo.getAppid()); AuthInfoVO authInfo = authorizerInfoService.getAuthInfoByAppid(infoVo.getAppid());
......
...@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil; ...@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.yaoyaozw.customer.entity.CommonReferralBody; import com.yaoyaozw.customer.entity.CommonReferralBody;
import com.yaoyaozw.customer.entity.CustomerFollowReplyMultiNews;
import com.yaoyaozw.customer.vo.AuthInfoVO; import com.yaoyaozw.customer.vo.AuthInfoVO;
import lombok.Data; import lombok.Data;
...@@ -39,6 +40,8 @@ public class FollowReplyInfoVO implements Serializable { ...@@ -39,6 +40,8 @@ public class FollowReplyInfoVO implements Serializable {
private CommonReferralBody referralBody; private CommonReferralBody referralBody;
private List<CustomerFollowReplyMultiNews> multiNewsList;
private List<CommonReferralBody> textBodyList; private List<CommonReferralBody> textBodyList;
public CommonReferralBody getReferralBody() { public CommonReferralBody getReferralBody() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论