提交 c39cabf2 作者: 沈振路

关回finish

上级 ea246c31
...@@ -110,6 +110,8 @@ public class FollowReplyComponent { ...@@ -110,6 +110,8 @@ public class FollowReplyComponent {
handleReferralName(dateStr, authInfoVo.getAccountName(), targetReferral); handleReferralName(dateStr, authInfoVo.getAccountName(), targetReferral);
} }
doGetReferral(targetReferral); doGetReferral(targetReferral);
} else if (newsType.equals(-1)) {
targetReferral.setReferral(sourceReferral.getReferral());
} }
return targetReferral; return targetReferral;
...@@ -133,7 +135,9 @@ public class FollowReplyComponent { ...@@ -133,7 +135,9 @@ public class FollowReplyComponent {
SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd"); SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd");
String dateStr = format.format(new Date()); String dateStr = format.format(new Date());
int idx = 1;
for (CustomerFollowReply sourceMaterial : sourceMaterialList) { for (CustomerFollowReply sourceMaterial : sourceMaterialList) {
localLog.info("素材处理进度: {}/{}", idx++, sourceMaterialList.size());
CustomerFollowReply entity = new CustomerFollowReply(); CustomerFollowReply entity = new CustomerFollowReply();
int status = 1; int status = 1;
...@@ -186,7 +190,7 @@ public class FollowReplyComponent { ...@@ -186,7 +190,7 @@ public class FollowReplyComponent {
// 文本, 构造H5 // 文本, 构造H5
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
for (ReferralEntity referralEntity : singleMaterialReferralList) { for (ReferralEntity referralEntity : singleMaterialReferralList) {
builder.append(structH5Line(referralEntity)).append("\n\n"); builder.append(structH5Line(false, referralEntity)).append("\n\n");
} }
entity.setContent(builder.toString().trim()); entity.setContent(builder.toString().trim());
...@@ -219,7 +223,7 @@ public class FollowReplyComponent { ...@@ -219,7 +223,7 @@ public class FollowReplyComponent {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
for (ReferralEntity referral : referralList) { for (ReferralEntity referral : referralList) {
referral.setSort(idx); referral.setSort(idx);
builder.append(structH5Line(referral)); builder.append(structH5Line(false, referral));
if (idx < referralList.size()) { if (idx < referralList.size()) {
builder.append("\n\n"); builder.append("\n\n");
...@@ -232,24 +236,30 @@ public class FollowReplyComponent { ...@@ -232,24 +236,30 @@ public class FollowReplyComponent {
return builder.toString(); return builder.toString();
} }
public void contractH5ContentBatch(List<ReferralEntity> referralEntityList) {
referralEntityList.forEach(item -> item.setH5Content(structH5Line(true, item)));
}
/** /**
* 构造 h5 * 构造 h5
* *
* @param referralEntity 链接实体 * @param referralEntity 链接实体
* @return {@link String} * @return {@link String}
*/ */
private String structH5Line(ReferralEntity referralEntity) { private String structH5Line(Boolean needStyle, ReferralEntity referralEntity) {
Integer newsType = referralEntity.getNewsType(); Integer newsType = referralEntity.getNewsType();
// 文本类型替换h5链接 // 文本类型替换h5链接
String context = null; String context = null;
localLog.info("referral参数 --> {}", referralEntity);
if (CustomerCommonConstant.REPLACE_LINK_NEWS_TYPE_LIST.contains(newsType)) { if (CustomerCommonConstant.REPLACE_LINK_NEWS_TYPE_LIST.contains(newsType)) {
context = CustomerCommonConstant.CUSTOMER_TEXT_LINK_TEMPLATE.replace(CustomerCommonConstant.CUSTOMER_TEXT_CONTENT_PLACEHOLDER, referralEntity.getTextContent()); context = CustomerCommonConstant.CUSTOMER_TEXT_LINK_TEMPLATE.replace(CustomerCommonConstant.CUSTOMER_TEXT_CONTENT_PLACEHOLDER, referralEntity.getTextContent());
context = context.replace(CustomerCommonConstant.CUSTOMER_TEXT_URL_PLACEHOLDER, referralEntity.getReferral());
if (!needStyle) {
context = context.replace(CustomerCommonConstant.H5_STYLE_CODE, "");
}
} else if (CustomerCommonConstant.COMMON_NEWS_TYPE_LIST.contains(newsType)){ } else if (CustomerCommonConstant.COMMON_NEWS_TYPE_LIST.contains(newsType)){
context = referralEntity.getTextContent(); context = referralEntity.getTextContent();
} }
if (ObjectUtil.isNotNull(context)) {
context = context.replace(CustomerCommonConstant.CUSTOMER_TEXT_URL_PLACEHOLDER, referralEntity.getReferral());
}
return context; return context;
} }
......
...@@ -39,6 +39,7 @@ public class CommonReferralBody implements Serializable { ...@@ -39,6 +39,7 @@ public class CommonReferralBody implements Serializable {
private Long infoId; private Long infoId;
@ApiModelProperty("链接类型") @ApiModelProperty("链接类型")
@JsonSerialize(using = ToStringSerializer.class)
private Integer newsType; private Integer newsType;
@ApiModelProperty("链接名") @ApiModelProperty("链接名")
...@@ -97,6 +98,8 @@ public class CommonReferralBody implements Serializable { ...@@ -97,6 +98,8 @@ public class CommonReferralBody implements Serializable {
@ApiModelProperty(value = "模板Id") @ApiModelProperty(value = "模板Id")
private String templateId; private String templateId;
private String h5Content;
public Date getStartTime() { public Date getStartTime() {
if (ObjectUtil.isNull(this.startTime) && CollectionUtil.isNotEmpty(this.dateList)) { if (ObjectUtil.isNull(this.startTime) && CollectionUtil.isNotEmpty(this.dateList)) {
return dateList.get(0); return dateList.get(0);
......
...@@ -209,6 +209,9 @@ public class ReferralEntity implements Serializable { ...@@ -209,6 +209,9 @@ public class ReferralEntity implements Serializable {
private Long infoId; private Long infoId;
@TableField(exist = false) @TableField(exist = false)
private String h5Content;
@TableField(exist = false)
private String accountName; private String accountName;
public static final String COL_ID = "id"; public static final String COL_ID = "id";
......
...@@ -3,7 +3,9 @@ package com.yaoyaozw.customer.mapper; ...@@ -3,7 +3,9 @@ package com.yaoyaozw.customer.mapper;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yaoyaozw.customer.entity.AuthorizerInfo; import com.yaoyaozw.customer.entity.AuthorizerInfo;
import com.yaoyaozw.customer.vo.AuthInfoVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/** /**
...@@ -14,4 +16,12 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -14,4 +16,12 @@ import org.apache.ibatis.annotations.Mapper;
@DS("material") @DS("material")
public interface AuthorizerInfoMapper extends BaseMapper<AuthorizerInfo> { public interface AuthorizerInfoMapper extends BaseMapper<AuthorizerInfo> {
/**
* 根据appid获取公众号信息
*
* @param appid appid
* @return {@link AuthInfoVO}
*/
AuthInfoVO getAuthInfoByAppid(@Param("appid") String appid);
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ package com.yaoyaozw.customer.service; ...@@ -2,6 +2,7 @@ package com.yaoyaozw.customer.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yaoyaozw.customer.entity.AuthorizerInfo; import com.yaoyaozw.customer.entity.AuthorizerInfo;
import com.yaoyaozw.customer.vo.AuthInfoVO;
/** /**
...@@ -12,5 +13,12 @@ import com.yaoyaozw.customer.entity.AuthorizerInfo; ...@@ -12,5 +13,12 @@ import com.yaoyaozw.customer.entity.AuthorizerInfo;
*/ */
public interface AuthorizerInfoService extends IService<AuthorizerInfo> { public interface AuthorizerInfoService extends IService<AuthorizerInfo> {
/**
* 根据appid获取公众号信息
*
* @param appid appid
* @return {@link AuthInfoVO}
*/
AuthInfoVO getAuthInfoByAppid(String appid);
} }
...@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yaoyaozw.customer.entity.AuthorizerInfo; import com.yaoyaozw.customer.entity.AuthorizerInfo;
import com.yaoyaozw.customer.mapper.AuthorizerInfoMapper; import com.yaoyaozw.customer.mapper.AuthorizerInfoMapper;
import com.yaoyaozw.customer.service.AuthorizerInfoService; import com.yaoyaozw.customer.service.AuthorizerInfoService;
import com.yaoyaozw.customer.vo.AuthInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -16,4 +19,17 @@ import org.springframework.stereotype.Service; ...@@ -16,4 +19,17 @@ import org.springframework.stereotype.Service;
@Service @Service
public class AuthorizerInfoServiceImpl extends ServiceImpl<AuthorizerInfoMapper, AuthorizerInfo> implements AuthorizerInfoService { public class AuthorizerInfoServiceImpl extends ServiceImpl<AuthorizerInfoMapper, AuthorizerInfo> implements AuthorizerInfoService {
@Autowired
private RedisTemplate<String, Object> redisTemplate;
@Override
public AuthInfoVO getAuthInfoByAppid(String appid) {
AuthInfoVO authInfo = this.baseMapper.getAuthInfoByAppid(appid);
Object storeTypeName = redisTemplate.opsForHash().get("STORE_NAME_MAP", authInfo.getStoreType());
if (storeTypeName != null) {
authInfo.setStoreTypeName(String.valueOf(storeTypeName));
}
return authInfo;
}
} }
...@@ -19,6 +19,7 @@ import com.yaoyaozw.customer.entity.CommonReferralBody; ...@@ -19,6 +19,7 @@ import com.yaoyaozw.customer.entity.CommonReferralBody;
import com.yaoyaozw.customer.entity.CustomerFollowReply; import com.yaoyaozw.customer.entity.CustomerFollowReply;
import com.yaoyaozw.customer.entity.ReferralEntity; import com.yaoyaozw.customer.entity.ReferralEntity;
import com.yaoyaozw.customer.mapper.CustomerFollowReplyMapper; import com.yaoyaozw.customer.mapper.CustomerFollowReplyMapper;
import com.yaoyaozw.customer.service.AuthorizerInfoService;
import com.yaoyaozw.customer.service.CustomerFollowReplyService; import com.yaoyaozw.customer.service.CustomerFollowReplyService;
import com.yaoyaozw.customer.service.ReferralEntityService; import com.yaoyaozw.customer.service.ReferralEntityService;
import com.yaoyaozw.customer.utils.TencentCustomerUtil; import com.yaoyaozw.customer.utils.TencentCustomerUtil;
...@@ -34,6 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -34,6 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -55,6 +57,8 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -55,6 +57,8 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
private FollowReplyComponent followReplyComponent; private FollowReplyComponent followReplyComponent;
@Autowired @Autowired
private ReferralEntityService referralEntityService; private ReferralEntityService referralEntityService;
@Autowired
private AuthorizerInfoService authorizerInfoService;
@Override @Override
...@@ -84,7 +88,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -84,7 +88,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
if (isCreate) { if (isCreate) {
// 新增的id // 新增的id
entity.setId(snowflakeComponent.snowflakeId()); entity.setId(snowflakeComponent.snowflakeId());
} else if (FollowReplyCommonConstant.needReferral(sourceEntity.getType())) { } else if (!entity.getType().equals(sourceEntity.getType()) && FollowReplyCommonConstant.needReferral(sourceEntity.getType())) {
// 如果编辑更换过类型,清除掉referral数据 // 如果编辑更换过类型,清除掉referral数据
referralEntityService.remove(new QueryWrapper<ReferralEntity>().eq(ReferralEntity.COL_MATERIAL_GRAPHICS_ID, sourceEntity.getId())); referralEntityService.remove(new QueryWrapper<ReferralEntity>().eq(ReferralEntity.COL_MATERIAL_GRAPHICS_ID, sourceEntity.getId()));
} }
...@@ -109,7 +113,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -109,7 +113,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
} }
entity.setTxMediaUrl(uploadResponse.getUrl()); entity.setTxMediaUrl(uploadResponse.getUrl());
entity.setTxMediaId(uploadResponse.getMedia_id()); entity.setTxMediaId(uploadResponse.getMedia_id());
} else { } else if (!FollowReplyCommonConstant.TENCENT_MEDIA_TYPE_TEXT.equals(entity.getType())){
// 获取书城公众号链接(图文) // 获取书城公众号链接(图文)
ReferralEntity referralEntity; ReferralEntity referralEntity;
try { try {
...@@ -161,10 +165,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -161,10 +165,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
// 保存主体 // 保存主体
this.updateById(entity); this.updateById(entity);
JSONArray referralJsonArray = JSONUtil.parseArray(referralList); return new GenericsResult<>(getReferralBodyFromEntity(referralList));
List<CommonReferralBody> referralBodyList = JSONUtil.toList(referralJsonArray, CommonReferralBody.class);
return new GenericsResult<>(referralBodyList);
} }
@Override @Override
...@@ -205,11 +206,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -205,11 +206,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
entity.setContent(content); entity.setContent(content);
// 保存实体 // 保存实体
this.updateById(entity); this.updateById(entity);
return new GenericsResult<>(getReferralBodyFromEntity(referralList));
JSONArray referralJsonArray = JSONUtil.parseArray(referralList);
List<CommonReferralBody> referralBodyList = JSONUtil.toList(referralJsonArray, CommonReferralBody.class);
return new GenericsResult<>(referralBodyList);
} }
@Override @Override
...@@ -217,7 +214,8 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -217,7 +214,8 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
AuthInfoVO sourceAuth = copyDto.getSourceAuth(); AuthInfoVO sourceAuth = copyDto.getSourceAuth();
List<AuthInfoVO> targetAuthList = copyDto.getTargetAuthList(); List<AuthInfoVO> targetAuthList = copyDto.getTargetAuthList();
localLog.info("调用复用, 源公众号: {}, 目标公众号: {}条", sourceAuth.getAccountName(), targetAuthList.size()); long copyFlag = System.currentTimeMillis();
localLog.info("关回复用, 复用批次号: {}, 源公众号: {}, 目标公众号: {}条", copyFlag, sourceAuth.getAccountName(), targetAuthList.size());
List<CustomerFollowReply> sourceMaterialList = getSourceMaterialList(sourceAuth.getAppId()); List<CustomerFollowReply> sourceMaterialList = getSourceMaterialList(sourceAuth.getAppId());
if (CollectionUtil.isEmpty(sourceMaterialList)) { if (CollectionUtil.isEmpty(sourceMaterialList)) {
return new BaseResult().error("源公众号找不到素材"); return new BaseResult().error("源公众号找不到素材");
...@@ -226,7 +224,9 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -226,7 +224,9 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
removeOriginMaterialList(targetAuthList); removeOriginMaterialList(targetAuthList);
List<String> errorAuthList = null; List<String> errorAuthList = null;
int idx = 1;
for (AuthInfoVO targetAuth : targetAuthList) { for (AuthInfoVO targetAuth : targetAuthList) {
localLog.info("批次号: {}, 公众号处理进度: {}/{}", copyFlag, idx++, targetAuthList.size());
// 调用复用 // 调用复用
FollowReplyCopyResultVO result = followReplyComponent.copyMaterialToTarget(targetAuth, sourceMaterialList); FollowReplyCopyResultVO result = followReplyComponent.copyMaterialToTarget(targetAuth, sourceMaterialList);
if (result.getHasError()) { if (result.getHasError()) {
...@@ -234,13 +234,21 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -234,13 +234,21 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
errorAuthList = new ArrayList<>(); errorAuthList = new ArrayList<>();
} }
errorAuthList.add(targetAuth.getAccountName()); errorAuthList.add(targetAuth.getAccountName());
} else {
if (CollectionUtil.isNotEmpty(result.getMaterialList())) {
this.saveBatch(result.getMaterialList());
}
if (CollectionUtil.isNotEmpty(result.getReferralEntityList())) {
referralEntityService.saveBatch(result.getReferralEntityList());
}
} }
} }
if (CollectionUtil.isNotEmpty(errorAuthList)) { if (CollectionUtil.isNotEmpty(errorAuthList)) {
return new BaseResult().error("部分成功; 复用异常公众号: " + errorAuthList); return new BaseResult().error("部分成功; 复用异常公众号: " + errorAuthList);
} }
return new BaseResult().success(); return new BaseResult().success("复用完成");
} }
@Override @Override
...@@ -256,9 +264,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -256,9 +264,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
if (FollowReplyCommonConstant.TENCENT_MEDIA_TYPE_TEXT.equals(entity.getType())) { if (FollowReplyCommonConstant.TENCENT_MEDIA_TYPE_TEXT.equals(entity.getType())) {
// 文本类型 // 文本类型
List<ReferralEntity> referralList = referralEntityService.list(new QueryWrapper<ReferralEntity>().eq(ReferralEntity.COL_MATERIAL_GRAPHICS_ID, id).orderByAsc("sort")); List<ReferralEntity> referralList = referralEntityService.list(new QueryWrapper<ReferralEntity>().eq(ReferralEntity.COL_MATERIAL_GRAPHICS_ID, id).orderByAsc("sort"));
JSONArray referralJsonArray = JSONUtil.parseArray(referralList); infoVo.setTextBodyList(getReferralBodyFromEntity(referralList));
List<CommonReferralBody> referralBodyList = JSONUtil.toList(referralJsonArray, CommonReferralBody.class);
infoVo.setTextBodyList(referralBodyList);
} else if (FollowReplyCommonConstant.TENCENT_MEDIA_TYPE_NEWS.equals(entity.getType())) { } else if (FollowReplyCommonConstant.TENCENT_MEDIA_TYPE_NEWS.equals(entity.getType())) {
try { try {
// 设置图文类型的链接数据 // 设置图文类型的链接数据
...@@ -272,12 +278,21 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -272,12 +278,21 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
return new GenericsResult<>(false, "获取图文链接实体异常"); return new GenericsResult<>(false, "获取图文链接实体异常");
} }
} }
} }
// 根据appid获取公众号信息
AuthInfoVO authInfo = authorizerInfoService.getAuthInfoByAppid(infoVo.getAppid());
if (ObjectUtil.isNull(authInfo)) {
return new GenericsResult<>(false, "无法获取公众号信息");
}
infoVo.setAuthInfo(authInfo);
return new GenericsResult<>(infoVo); return new GenericsResult<>(infoVo);
} }
private List<CommonReferralBody> getReferralBodyFromEntity(List<ReferralEntity> referralList) {
followReplyComponent.contractH5ContentBatch(referralList);
JSONArray referralJsonArray = JSONUtil.parseArray(referralList);
return JSONUtil.toList(referralJsonArray, CommonReferralBody.class);
}
private List<CustomerFollowReply> getSourceMaterialList(String appid) { private List<CustomerFollowReply> getSourceMaterialList(String appid) {
List<CustomerFollowReply> sourceMaterialList = this.list(new QueryWrapper<CustomerFollowReply>().eq("appid", appid)); List<CustomerFollowReply> sourceMaterialList = this.list(new QueryWrapper<CustomerFollowReply>().eq("appid", appid));
...@@ -288,14 +303,16 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -288,14 +303,16 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
localLog.info("获取到源公众号素材: {}条", sourceMaterialList.size()); localLog.info("获取到源公众号素材: {}条", sourceMaterialList.size());
// 获取链接 // 获取链接
List<Long> materialIdList = sourceMaterialList.stream().map(CustomerFollowReply::getId).collect(Collectors.toList()); List<Long> materialIdList = sourceMaterialList.stream().map(CustomerFollowReply::getId).collect(Collectors.toList());
List<ReferralEntity> referralEntityList = referralEntityService.list(new QueryWrapper<ReferralEntity>().eq(ReferralEntity.COL_MATERIAL_GRAPHICS_ID, materialIdList)); List<ReferralEntity> referralEntityList = referralEntityService.list(new QueryWrapper<ReferralEntity>().in(ReferralEntity.COL_MATERIAL_GRAPHICS_ID, materialIdList));
localLog.info("获取到源公众号链接数据: {}条", referralEntityList.size()); localLog.info("获取到源公众号链接数据: {}条", referralEntityList.size());
Map<Long, List<ReferralEntity>> referralMap = referralEntityList.stream().collect(Collectors.groupingBy(ReferralEntity::getMaterialGraphicsId)); Map<Long, List<ReferralEntity>> referralMap = referralEntityList.stream().collect(Collectors.groupingBy(ReferralEntity::getMaterialGraphicsId));
// 分配referral // 分配referral
for (CustomerFollowReply sourceEntity : sourceMaterialList) { for (CustomerFollowReply sourceEntity : sourceMaterialList) {
sourceEntity.setReferralEntityList(referralMap.get(sourceEntity.getId())); List<ReferralEntity> referralEntities = referralMap.get(sourceEntity.getId());
referralEntities = referralEntities.stream().sorted(Comparator.comparingInt(ReferralEntity::getSort)).collect(Collectors.toList());
sourceEntity.setReferralEntityList(referralEntities);
} }
return sourceMaterialList; return sourceMaterialList;
......
package com.yaoyaozw.customer.vo.follow; package com.yaoyaozw.customer.vo.follow;
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.vo.AuthInfoVO;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -22,7 +25,7 @@ public class FollowReplyInfoVO implements Serializable { ...@@ -22,7 +25,7 @@ public class FollowReplyInfoVO implements Serializable {
private String name; private String name;
private Integer type; private String type;
private String originMediaUrl; private String originMediaUrl;
...@@ -32,8 +35,17 @@ public class FollowReplyInfoVO implements Serializable { ...@@ -32,8 +35,17 @@ public class FollowReplyInfoVO implements Serializable {
private Integer sort; private Integer sort;
private AuthInfoVO authInfo;
private CommonReferralBody referralBody; private CommonReferralBody referralBody;
private List<CommonReferralBody> textBodyList; private List<CommonReferralBody> textBodyList;
public CommonReferralBody getReferralBody() {
return ObjectUtil.isNull(referralBody) ? new CommonReferralBody() : referralBody;
}
public List<CommonReferralBody> getTextBodyList() {
return textBodyList == null ? new ArrayList<>(4) : textBodyList;
}
} }
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yaoyaozw.customer.mapper.AuthorizerInfoMapper">
<select id="getAuthInfoByAppid" resultType="com.yaoyaozw.customer.vo.AuthInfoVO">
select
id,
appid as appId,
account_id as accountId,
nick_name as accountName,
store_type as storeType
from authorizer_info
where appid = #{appid}
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论