提交 4af437ae 作者: 沈振路

关键词回复接口

上级 3a62eb96
...@@ -2,19 +2,16 @@ package com.yaoyaozw.customer.components; ...@@ -2,19 +2,16 @@ package com.yaoyaozw.customer.components;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference; import com.alibaba.fastjson.TypeReference;
import com.yaoyaozw.customer.common.R; import com.yaoyaozw.customer.common.R;
import com.yaoyaozw.customer.constants.ApiResultConstant; import com.yaoyaozw.customer.constants.ApiResultConstant;
import com.yaoyaozw.customer.constants.CustomerCommonConstant; import com.yaoyaozw.customer.constants.CustomerCommonConstant;
import com.yaoyaozw.customer.constants.FollowReplyCommonConstant; import com.yaoyaozw.customer.constants.CustomerMaterialConstant;
import com.yaoyaozw.customer.entity.AuthorizerInfo;
import com.yaoyaozw.customer.entity.CommonReferralBody; 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.enums.CustomerStoreTemplateEnum;
import com.yaoyaozw.customer.feigns.ReferralFeignClient; import com.yaoyaozw.customer.feigns.ReferralFeignClient;
import com.yaoyaozw.customer.service.AuthorizerInfoService; import com.yaoyaozw.customer.service.AuthorizerInfoService;
import com.yaoyaozw.customer.service.ReferralEntityService; import com.yaoyaozw.customer.service.ReferralEntityService;
...@@ -50,8 +47,6 @@ public class FollowReplyComponent { ...@@ -50,8 +47,6 @@ public class FollowReplyComponent {
private ReferralFeignClient referralFeignClient; private ReferralFeignClient referralFeignClient;
@Autowired @Autowired
private SnowflakeComponent snowflakeComponent; private SnowflakeComponent snowflakeComponent;
@Autowired
private AuthorizerInfoService authorizerInfoService;
/** /**
* 获取链接实体 * 获取链接实体
...@@ -156,7 +151,7 @@ public class FollowReplyComponent { ...@@ -156,7 +151,7 @@ public class FollowReplyComponent {
entity.setExtendDesc(sourceMaterial.getExtendDesc()); entity.setExtendDesc(sourceMaterial.getExtendDesc());
entity.setSort(sourceMaterial.getSort()); entity.setSort(sourceMaterial.getSort());
if (FollowReplyCommonConstant.needUpload(entity.getType())) { if (CustomerMaterialConstant.needUpload(entity.getType())) {
// 向腾讯后台上传素材文件 // 向腾讯后台上传素材文件
TencentMediaResponseVO uploadResult = tencentCustomerUtil.uploadTencentMedia(targetAuth.getAppId(), entity.getOriginMediaUrl(), entity.getType()); TencentMediaResponseVO uploadResult = tencentCustomerUtil.uploadTencentMedia(targetAuth.getAppId(), entity.getOriginMediaUrl(), entity.getType());
if (StringUtils.isNotEmpty(uploadResult.getErrmsg())) { if (StringUtils.isNotEmpty(uploadResult.getErrmsg())) {
...@@ -189,11 +184,11 @@ public class FollowReplyComponent { ...@@ -189,11 +184,11 @@ public class FollowReplyComponent {
} }
if (CollectionUtil.isNotEmpty(singleMaterialReferralList)) { if (CollectionUtil.isNotEmpty(singleMaterialReferralList)) {
// 处理链接的后续操作 // 处理链接的后续操作
if (FollowReplyCommonConstant.TENCENT_MEDIA_TYPE_NEWS.equals(entity.getType())) { if (CustomerMaterialConstant.TENCENT_MEDIA_TYPE_NEWS.equals(entity.getType())) {
// 图文, 将链接处理结果设置到主题表中 // 图文, 将链接处理结果设置到主题表中
ReferralEntity referralEntity = singleMaterialReferralList.get(0); ReferralEntity referralEntity = singleMaterialReferralList.get(0);
entity.setSourceUrl(referralEntity.getReferral()); entity.setSourceUrl(referralEntity.getReferral());
} else if (FollowReplyCommonConstant.TENCENT_MEDIA_TYPE_TEXT.equals(entity.getType())) { } else if (CustomerMaterialConstant.TENCENT_MEDIA_TYPE_TEXT.equals(entity.getType())) {
// 文本, 构造H5 // 文本, 构造H5
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
for (ReferralEntity referralEntity : singleMaterialReferralList) { for (ReferralEntity referralEntity : singleMaterialReferralList) {
......
...@@ -9,9 +9,10 @@ import java.util.List; ...@@ -9,9 +9,10 @@ import java.util.List;
* @author darker * @author darker
* @date 2023/3/14 11:56 * @date 2023/3/14 11:56
*/ */
public class FollowReplyCommonConstant { public class CustomerMaterialConstant {
public final static String FOLLOW_REPLY_REDIS_KEY = "followReplyMap"; public final static String FOLLOW_REPLY_REDIS_KEY = "followReplyMap";
public final static String CUSTOMER_KEYWORD_REDIS_KEY = "customerKeywordMap";
public final static String TENCENT_MEDIA_TYPE_PIC = "image"; public final static String TENCENT_MEDIA_TYPE_PIC = "image";
public final static String TENCENT_MEDIA_TYPE_VOICE = "voice"; public final static String TENCENT_MEDIA_TYPE_VOICE = "voice";
......
package com.yaoyaozw.customer.controller;
import com.yaoyaozw.customer.annotations.OperateLog;
import com.yaoyaozw.customer.common.BaseResult;
import com.yaoyaozw.customer.common.GenericsResult;
import com.yaoyaozw.customer.dto.keyword.CustomerKeywordCopyDTO;
import com.yaoyaozw.customer.dto.keyword.CustomerKeywordQueryDTO;
import com.yaoyaozw.customer.dto.keyword.CustomerKeywordSaveDTO;
import com.yaoyaozw.customer.entity.CommonReferralBody;
import com.yaoyaozw.customer.service.CustomerKeywordService;
import com.yaoyaozw.customer.vo.keyword.CustomerKeywordInfoVO;
import com.yaoyaozw.customer.vo.keyword.CustomerKeywordListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author darker
* @date 2023/3/20 11:14
*/
@RestController
@RequestMapping("/keyword")
public class CustomerKeywordController {
@Autowired
private CustomerKeywordService keywordService;
@PostMapping("/list")
public GenericsResult<List<CustomerKeywordListVO>> list(@RequestBody CustomerKeywordQueryDTO queryDto) {
return keywordService.list(queryDto);
}
@PostMapping("/create")
@OperateLog(module = "客服-关回", desc = "创建素材")
public GenericsResult<String> create(@RequestBody @Validated CustomerKeywordSaveDTO saveDto) {
return keywordService.create(saveDto);
}
@PostMapping("/createTextItem")
@OperateLog(module = "客服-关回", desc = "创建文本子素材")
public GenericsResult<List<CommonReferralBody>> createTextItem(@RequestBody CommonReferralBody referralBody) {
return keywordService.createTextItem(referralBody);
}
@GetMapping("/info/{id}")
public GenericsResult<CustomerKeywordInfoVO> getInfo(@PathVariable("id") Long id) {
return keywordService.getInfo(id);
}
@GetMapping("/remove/{id}")
@OperateLog(module = "客服-关回", desc = "删除素材")
public BaseResult remove(@PathVariable("id") Long id) {
return keywordService.remove(id);
}
@GetMapping("/removeTextItem/{id}")
@OperateLog(module = "客服-关回", desc = "删除文本子素材")
public GenericsResult<List<CommonReferralBody>> removeTextItem(@PathVariable("id") Long id) {
return keywordService.removeTextItem(id);
}
@PostMapping("/copy")
@OperateLog(module = "客服-关回", desc = "关回复用")
public BaseResult copy(@RequestBody CustomerKeywordCopyDTO copyDto) {
return keywordService.copy(copyDto);
}
}
...@@ -2,11 +2,7 @@ package com.yaoyaozw.customer.controller; ...@@ -2,11 +2,7 @@ package com.yaoyaozw.customer.controller;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.rabbitmq.client.AMQP; import com.yaoyaozw.customer.constants.CustomerMaterialConstant;
import com.rabbitmq.client.Channel;
import com.yaoyaozw.customer.constants.CustomerCommonConstant;
import com.yaoyaozw.customer.constants.FollowReplyCommonConstant;
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.entity.CustomerFollowReply;
import com.yaoyaozw.customer.mapper.KanbanCommonMapper; import com.yaoyaozw.customer.mapper.KanbanCommonMapper;
...@@ -15,8 +11,6 @@ import com.yaoyaozw.customer.service.CustomerDelayPublishService; ...@@ -15,8 +11,6 @@ import com.yaoyaozw.customer.service.CustomerDelayPublishService;
import com.yaoyaozw.customer.service.CustomerGraphicsService; import com.yaoyaozw.customer.service.CustomerGraphicsService;
import com.yaoyaozw.customer.vo.AuthInfoVO; import com.yaoyaozw.customer.vo.AuthInfoVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.ChannelCallback;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
...@@ -107,7 +101,7 @@ public class TestController { ...@@ -107,7 +101,7 @@ public class TestController {
@GetMapping("/testFollowReply") @GetMapping("/testFollowReply")
public void testFollowReply() { public void testFollowReply() {
Object obj = redisTemplate.opsForHash().get(FollowReplyCommonConstant.FOLLOW_REPLY_REDIS_KEY, "wx9f460fa46420016c"); Object obj = redisTemplate.opsForHash().get(CustomerMaterialConstant.FOLLOW_REPLY_REDIS_KEY, "wx9f460fa46420016c");
if (ObjectUtil.isNotNull(obj)) { if (ObjectUtil.isNotNull(obj)) {
List<CustomerFollowReply> list = JSONUtil.toList(JSONUtil.parseArray(obj.toString()), CustomerFollowReply.class); List<CustomerFollowReply> list = JSONUtil.toList(JSONUtil.parseArray(obj.toString()), CustomerFollowReply.class);
......
package com.yaoyaozw.customer.dto.keyword;
import com.yaoyaozw.customer.vo.AuthInfoVO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author darker
* @date 2023/3/13 19:59
*/
@Data
public class CustomerKeywordCopyDTO implements Serializable {
private AuthInfoVO sourceAuth;
private List<AuthInfoVO> targetAuthList;
}
package com.yaoyaozw.customer.dto.keyword;
import lombok.Data;
import java.io.Serializable;
/**
* @author darker
* @date 2023/3/13 19:59
*/
@Data
public class CustomerKeywordQueryDTO implements Serializable {
private String appId;
}
package com.yaoyaozw.customer.dto.keyword;
import com.yaoyaozw.customer.entity.CommonReferralBody;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author darker
* @date 2023/3/13 19:59
*/
@Data
public class CustomerKeywordSaveDTO implements Serializable {
private Long id;
@NotEmpty(message = "appid不能为空")
private String appid;
@NotEmpty(message = "关键词不能为空")
private String keyword;
@NotEmpty(message = "素材类型不能为空")
private String type;
private String originMediaUrl;
private String extendTitle;
private String extendDesc;
@NotNull(message = "素材排序不能为空")
private Integer sort;
private CommonReferralBody referralBody;
}
package com.yaoyaozw.customer.entity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import org.springframework.data.annotation.Id;
/**
* 客户关键字
*
* @author darker
* @date 2023/03/20
*/
@Data
public class CustomerKeyword implements Serializable {
/**
* 主键
*/
@Id
@TableId(value = "id", type = IdType.ID_WORKER)
private Long id;
/**
* 公众号appid
*/
@TableField("appid")
private String appid;
/**
* 关键词
*/
@TableField("keyword")
private String keyword;
/**
* 类型
*/
@TableField("type")
private String type;
/**
* 原始文件地址
*/
@TableField("origin_media_url")
private String originMediaUrl;
/**
* 腾讯media地址
*/
@TableField("tx_media_url")
private String txMediaUrl;
/**
* 腾讯mediaId
*/
@TableField("tx_media_id")
private String txMediaId;
/**
* 图文标题
*/
@TableField("extend_title")
private String extendTitle;
/**
* 图文描述
*/
@TableField("extend_desc")
private String extendDesc;
/**
* 跳转链接
*/
@TableField("source_url")
private String sourceUrl;
/**
* H5文本
*/
@TableField("content")
private String content;
/**
* 状态
*/
@TableField("status")
private Integer status;
/**
* 逻辑删除
*/
@TableField(value = "is_deleted", fill = FieldFill.INSERT)
@TableLogic
private Integer isDeleted;
/**
* 创建人
*/
@TableField(value = "create_user", fill = FieldFill.INSERT)
private Long createUser;
/**
* 创建时间
*/
@TableField(value = "gmt_create", fill = FieldFill.INSERT)
private Date gmtCreate;
/**
* 更新人
*/
@TableField(value = "modified_user", fill = FieldFill.INSERT_UPDATE)
private Long modifiedUser;
/**
* 更新时间
*/
@TableField(value = "gmt_modified", fill = FieldFill.INSERT_UPDATE)
private Date gmtModified;
@TableField(exist = false)
private List<ReferralEntity> referralEntityList;
private static final long serialVersionUID = 1L;
}
package com.yaoyaozw.customer.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yaoyaozw.customer.dto.follow.FollowReplyQueryDTO;
import com.yaoyaozw.customer.dto.keyword.CustomerKeywordQueryDTO;
import com.yaoyaozw.customer.entity.CustomerKeyword;
import com.yaoyaozw.customer.vo.follow.FollowReplyListVO;
import com.yaoyaozw.customer.vo.keyword.CustomerKeywordListVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author darker
* @date 2023/3/20 11:07
*/
@Repository
public interface CustomerKeywordMapper extends BaseMapper<CustomerKeyword> {
/**
* 得到列表
*
* @param queryDto 查询dto
* @return {@link List}<{@link CustomerKeywordListVO}>
*/
List<CustomerKeywordListVO> getList(@Param("queryDto") CustomerKeywordQueryDTO queryDto);
}
package com.yaoyaozw.customer.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yaoyaozw.customer.common.BaseResult;
import com.yaoyaozw.customer.common.GenericsResult;
import com.yaoyaozw.customer.dto.keyword.CustomerKeywordCopyDTO;
import com.yaoyaozw.customer.dto.keyword.CustomerKeywordQueryDTO;
import com.yaoyaozw.customer.dto.keyword.CustomerKeywordSaveDTO;
import com.yaoyaozw.customer.entity.CommonReferralBody;
import com.yaoyaozw.customer.entity.CustomerKeyword;
import com.yaoyaozw.customer.vo.keyword.CustomerKeywordInfoVO;
import com.yaoyaozw.customer.vo.keyword.CustomerKeywordListVO;
import java.util.List;
/**
* @author darker
* @date 2023/3/20 11:08
*/
public interface CustomerKeywordService extends IService<CustomerKeyword> {
/**
* 列表
*
* @param queryDto 查询dto
* @return {@link GenericsResult}<{@link List}<{@link CustomerKeywordListVO}>>
*/
GenericsResult<List<CustomerKeywordListVO>> list(CustomerKeywordQueryDTO queryDto);
/**
* 创建
*
* @param saveDto 保存dto
* @return {@link GenericsResult}<{@link String}>
*/
GenericsResult<String> create(CustomerKeywordSaveDTO saveDto);
/**
* 创建文本项
*
* @param referralBody 推荐身体
* @return {@link GenericsResult}<{@link List}<{@link CommonReferralBody}>>
*/
GenericsResult<List<CommonReferralBody>> createTextItem(CommonReferralBody referralBody);
/**
* 得到信息
*
* @param id id
* @return {@link GenericsResult}<{@link CustomerKeywordInfoVO}>
*/
GenericsResult<CustomerKeywordInfoVO> getInfo(Long id);
/**
* 删除
*
* @param id id
* @return {@link BaseResult}
*/
BaseResult remove(Long id);
/**
* 删除文本项
*
* @param id id
* @return {@link GenericsResult}<{@link List}<{@link CommonReferralBody}>>
*/
GenericsResult<List<CommonReferralBody>> removeTextItem(Long id);
/**
* 复制
*
* @param copyDto 复制dto
* @return {@link BaseResult}
*/
BaseResult copy(CustomerKeywordCopyDTO copyDto);
}
...@@ -11,7 +11,7 @@ import com.yaoyaozw.customer.common.BaseResult; ...@@ -11,7 +11,7 @@ import com.yaoyaozw.customer.common.BaseResult;
import com.yaoyaozw.customer.common.GenericsResult; import com.yaoyaozw.customer.common.GenericsResult;
import com.yaoyaozw.customer.components.FollowReplyComponent; import com.yaoyaozw.customer.components.FollowReplyComponent;
import com.yaoyaozw.customer.components.SnowflakeComponent; import com.yaoyaozw.customer.components.SnowflakeComponent;
import com.yaoyaozw.customer.constants.FollowReplyCommonConstant; import com.yaoyaozw.customer.constants.CustomerMaterialConstant;
import com.yaoyaozw.customer.dto.follow.FollowReplyCopyDTO; import com.yaoyaozw.customer.dto.follow.FollowReplyCopyDTO;
import com.yaoyaozw.customer.dto.follow.FollowReplyQueryDTO; import com.yaoyaozw.customer.dto.follow.FollowReplyQueryDTO;
import com.yaoyaozw.customer.dto.follow.FollowReplySaveDTO; import com.yaoyaozw.customer.dto.follow.FollowReplySaveDTO;
...@@ -91,14 +91,14 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -91,14 +91,14 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
if (isCreate) { if (isCreate) {
// 新增的id // 新增的id
entity.setId(snowflakeComponent.snowflakeId()); entity.setId(snowflakeComponent.snowflakeId());
} else if (!entity.getType().equals(sourceEntity.getType()) && FollowReplyCommonConstant.needReferral(sourceEntity.getType())) { } else if (!entity.getType().equals(sourceEntity.getType()) && CustomerMaterialConstant.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()));
} }
entity.setStatus(1); entity.setStatus(1);
// 判断是否需要上传文件(图片、语音) // 判断是否需要上传文件(图片、语音)
if (FollowReplyCommonConstant.needUpload(entity.getType())) { if (CustomerMaterialConstant.needUpload(entity.getType())) {
// 编辑的时候,删除原来的media // 编辑的时候,删除原来的media
if (!isCreate) { if (!isCreate) {
if (StringUtils.isNotBlank(sourceEntity.getTxMediaId())) { if (StringUtils.isNotBlank(sourceEntity.getTxMediaId())) {
...@@ -116,7 +116,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -116,7 +116,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 if (!FollowReplyCommonConstant.TENCENT_MEDIA_TYPE_TEXT.equals(entity.getType())){ } else if (!CustomerMaterialConstant.TENCENT_MEDIA_TYPE_TEXT.equals(entity.getType())){
// 获取书城公众号链接(图文) // 获取书城公众号链接(图文)
ReferralEntity referralEntity; ReferralEntity referralEntity;
try { try {
...@@ -268,13 +268,13 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -268,13 +268,13 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
BeanUtil.copyProperties(entity, infoVo); BeanUtil.copyProperties(entity, infoVo);
// 获取素材的链接数据 // 获取素材的链接数据
if (FollowReplyCommonConstant.needReferral(entity.getType())) { if (CustomerMaterialConstant.needReferral(entity.getType())) {
// 是需要设置referral的类型 // 是需要设置referral的类型
if (FollowReplyCommonConstant.TENCENT_MEDIA_TYPE_TEXT.equals(entity.getType())) { 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")); List<ReferralEntity> referralList = referralEntityService.list(new QueryWrapper<ReferralEntity>().eq(ReferralEntity.COL_MATERIAL_GRAPHICS_ID, id).orderByAsc("sort"));
infoVo.setTextBodyList(getReferralBodyFromEntity(referralList)); infoVo.setTextBodyList(getReferralBodyFromEntity(referralList));
} else if (FollowReplyCommonConstant.TENCENT_MEDIA_TYPE_NEWS.equals(entity.getType())) { } else if (CustomerMaterialConstant.TENCENT_MEDIA_TYPE_NEWS.equals(entity.getType())) {
try { try {
// 设置图文类型的链接数据 // 设置图文类型的链接数据
ReferralEntity referralEntity = referralEntityService.getOne(new QueryWrapper<ReferralEntity>().eq(ReferralEntity.COL_MATERIAL_GRAPHICS_ID, id)); ReferralEntity referralEntity = referralEntityService.getOne(new QueryWrapper<ReferralEntity>().eq(ReferralEntity.COL_MATERIAL_GRAPHICS_ID, id));
...@@ -355,7 +355,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -355,7 +355,7 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
} }
private String checkNecessary(FollowReplySaveDTO saveDto) { private String checkNecessary(FollowReplySaveDTO saveDto) {
if (!FollowReplyCommonConstant.TENCENT_MEDIA_TYPE_TEXT.equals(saveDto.getType())) { if (!CustomerMaterialConstant.TENCENT_MEDIA_TYPE_TEXT.equals(saveDto.getType())) {
// 非文本类型的都需要文件 // 非文本类型的都需要文件
if (StringUtils.isEmpty(saveDto.getOriginMediaUrl())) { if (StringUtils.isEmpty(saveDto.getOriginMediaUrl())) {
return "请选择素材文件"; return "请选择素材文件";
...@@ -373,9 +373,9 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe ...@@ -373,9 +373,9 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
} }
if (CollectionUtil.isNotEmpty(entityList)) { if (CollectionUtil.isNotEmpty(entityList)) {
String jsonStr = JSONUtil.toJsonStr(entityList); String jsonStr = JSONUtil.toJsonStr(entityList);
redisTemplate.opsForHash().put(FollowReplyCommonConstant.FOLLOW_REPLY_REDIS_KEY, appid, jsonStr); redisTemplate.opsForHash().put(CustomerMaterialConstant.FOLLOW_REPLY_REDIS_KEY, appid, jsonStr);
} else { } else {
redisTemplate.opsForHash().delete(FollowReplyCommonConstant.FOLLOW_REPLY_REDIS_KEY, appid); redisTemplate.opsForHash().delete(CustomerMaterialConstant.FOLLOW_REPLY_REDIS_KEY, appid);
} }
} }
......
...@@ -2,9 +2,8 @@ package com.yaoyaozw.customer.vo.follow; ...@@ -2,9 +2,8 @@ package com.yaoyaozw.customer.vo.follow;
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.constants.FollowReplyCommonConstant; import com.yaoyaozw.customer.constants.CustomerMaterialConstant;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable; import java.io.Serializable;
...@@ -31,6 +30,6 @@ public class FollowReplyListVO implements Serializable { ...@@ -31,6 +30,6 @@ public class FollowReplyListVO implements Serializable {
private Integer sort; private Integer sort;
public String getTypeDesc() { public String getTypeDesc() {
return FollowReplyCommonConstant.getTypeDesc(this.type); return CustomerMaterialConstant.getTypeDesc(this.type);
} }
} }
package com.yaoyaozw.customer.vo.keyword;
import com.yaoyaozw.customer.entity.CustomerFollowReply;
import com.yaoyaozw.customer.entity.CustomerKeyword;
import com.yaoyaozw.customer.entity.ReferralEntity;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author darker
* @date 2023/3/14 16:48
*/
@Data
public class CustomerKeywordCopyResultVO implements Serializable {
private Boolean hasError;
private List<CustomerKeyword> materialList;
private List<ReferralEntity> referralEntityList;
}
package com.yaoyaozw.customer.vo.keyword;
import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.yaoyaozw.customer.entity.CommonReferralBody;
import com.yaoyaozw.customer.vo.AuthInfoVO;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @author darker
* @date 2023/3/13 20:07
*/
@Data
public class CustomerKeywordInfoVO implements Serializable {
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
private String appid;
private String keyword;
private String type;
private String originMediaUrl;
private String extendTitle;
private String extendDesc;
private Integer sort;
private AuthInfoVO authInfo;
private CommonReferralBody referralBody;
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;
}
}
package com.yaoyaozw.customer.vo.keyword;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.yaoyaozw.customer.constants.CustomerMaterialConstant;
import lombok.Data;
import java.io.Serializable;
/**
* @author darker
* @date 2023/3/13 20:07
*/
@Data
public class CustomerKeywordListVO implements Serializable {
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
private String keyword;
private String authName;
private String typeDesc;
private String statusDesc;
private String type;
private Integer sort;
public String getTypeDesc() {
return CustomerMaterialConstant.getTypeDesc(this.type);
}
}
<?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.CustomerKeywordMapper">
<select id="getList" resultType="com.yaoyaozw.customer.vo.keyword.CustomerKeywordListVO">
select
ck.id,
ck.keyword,
ck.type,
ai.nick_name as authName,
if(ck.status = 1, '正常', '异常') as statusDesc
from customer_keyword ck
left join authorizer_info ai
on ck.appid = ai.appid
where ck.is_deleted = 0
and ck.appid = #{queryDto.appId}
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论