Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
b9723371
提交
b9723371
authored
11月 01, 2023
作者:
沈振路
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
关回多图文配置(不入库,进缓存)
上级
5d3b35dc
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
311 行增加
和
2 行删除
+311
-2
CustomerMaterialConstant.java
...yaoyaozw/customer/constants/CustomerMaterialConstant.java
+1
-0
FollowReplyMultiNewsController.java
...w/customer/controller/FollowReplyMultiNewsController.java
+28
-0
FollowReplyMultiNewsCreateDTO.java
...zw/customer/dto/follow/FollowReplyMultiNewsCreateDTO.java
+25
-0
FollowReplySaveDTO.java
.../com/yaoyaozw/customer/dto/follow/FollowReplySaveDTO.java
+6
-0
NewsMessageReplyEntity.java
.../yaoyaozw/customer/dto/follow/NewsMessageReplyEntity.java
+28
-0
CustomerFollowReplyMultiNews.java
...aoyaozw/customer/entity/CustomerFollowReplyMultiNews.java
+81
-0
CustomerFollowReplyMultiNewsMapper.java
...w/customer/mapper/CustomerFollowReplyMultiNewsMapper.java
+15
-0
CustomerFollowReplyMultiNewsService.java
...customer/service/CustomerFollowReplyMultiNewsService.java
+23
-0
CustomerFollowReplyMultiNewsServiceImpl.java
...service/impl/CustomerFollowReplyMultiNewsServiceImpl.java
+88
-0
CustomerFollowReplyServiceImpl.java
...customer/service/impl/CustomerFollowReplyServiceImpl.java
+12
-2
CustomerGraphicsServiceImpl.java
...zw/customer/service/impl/CustomerGraphicsServiceImpl.java
+4
-0
没有找到文件。
src/main/java/com/yaoyaozw/customer/constants/CustomerMaterialConstant.java
浏览文件 @
b9723371
...
@@ -18,6 +18,7 @@ public class CustomerMaterialConstant {
...
@@ -18,6 +18,7 @@ public class CustomerMaterialConstant {
public
final
static
String
TENCENT_MEDIA_TYPE_VOICE
=
"voice"
;
public
final
static
String
TENCENT_MEDIA_TYPE_VOICE
=
"voice"
;
public
final
static
String
TENCENT_MEDIA_TYPE_NEWS
=
"news"
;
public
final
static
String
TENCENT_MEDIA_TYPE_NEWS
=
"news"
;
public
final
static
String
TENCENT_MEDIA_TYPE_TEXT
=
"text"
;
public
final
static
String
TENCENT_MEDIA_TYPE_TEXT
=
"text"
;
public
final
static
String
TENCENT_MEDIA_TYPE_MULTI_NEWS
=
"multi_news"
;
public
static
Boolean
needUpload
(
String
type
)
{
public
static
Boolean
needUpload
(
String
type
)
{
...
...
src/main/java/com/yaoyaozw/customer/controller/FollowReplyMultiNewsController.java
0 → 100644
浏览文件 @
b9723371
package
com
.
yaoyaozw
.
customer
.
controller
;
import
com.yaoyaozw.customer.common.R
;
import
com.yaoyaozw.customer.dto.follow.FollowReplyMultiNewsCreateDTO
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author darker
* @date 2023/10/26 16:11
*/
@RestController
@RequestMapping
(
"/follow-reply/multi-news"
)
public
class
FollowReplyMultiNewsController
{
@PostMapping
(
"/createMultiNews"
)
public
R
createMultiNews
(
@RequestBody
FollowReplyMultiNewsCreateDTO
createDto
)
{
return
null
;
}
}
src/main/java/com/yaoyaozw/customer/dto/follow/FollowReplyMultiNewsCreateDTO.java
0 → 100644
浏览文件 @
b9723371
package
com
.
yaoyaozw
.
customer
.
dto
.
follow
;
import
com.yaoyaozw.customer.entity.CommonReferralBody
;
import
com.yaoyaozw.customer.entity.CustomerFollowReplyMultiNews
;
import
com.yaoyaozw.customer.entity.ReferralEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
/**
* @author darker
* @date 2023/10/26 16:14
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
public
class
FollowReplyMultiNewsCreateDTO
extends
CustomerFollowReplyMultiNews
implements
Serializable
{
/**
* 链接参数
*/
private
CommonReferralBody
referralBody
;
}
src/main/java/com/yaoyaozw/customer/dto/follow/FollowReplySaveDTO.java
浏览文件 @
b9723371
...
@@ -8,6 +8,7 @@ import lombok.Data;
...
@@ -8,6 +8,7 @@ import lombok.Data;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
/**
/**
* @author darker
* @author darker
...
@@ -37,4 +38,9 @@ public class FollowReplySaveDTO implements Serializable {
...
@@ -37,4 +38,9 @@ public class FollowReplySaveDTO implements Serializable {
private
Integer
sort
;
private
Integer
sort
;
private
CommonReferralBody
referralBody
;
private
CommonReferralBody
referralBody
;
/**
* 多图文的图文列表
*/
private
List
<
FollowReplyMultiNewsCreateDTO
>
multiNewsList
;
}
}
src/main/java/com/yaoyaozw/customer/dto/follow/NewsMessageReplyEntity.java
0 → 100644
浏览文件 @
b9723371
package
com
.
yaoyaozw
.
customer
.
dto
.
follow
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
/**
* @author darker
* @date 2023/10/26 10:49
*/
@Data
@NoArgsConstructor
public
class
NewsMessageReplyEntity
implements
Serializable
{
private
String
title
;
private
String
picUrl
;
private
String
linkUrl
;
public
NewsMessageReplyEntity
(
String
title
,
String
picUrl
,
String
linkUrl
)
{
this
.
title
=
title
;
this
.
picUrl
=
picUrl
;
this
.
linkUrl
=
linkUrl
;
}
}
src/main/java/com/yaoyaozw/customer/entity/CustomerFollowReplyMultiNews.java
0 → 100644
浏览文件 @
b9723371
package
com
.
yaoyaozw
.
customer
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
/**
* @author darker
* @date 2023/10/26
*/
@Data
@TableName
(
"customer_follow_reply_multi_news"
)
public
class
CustomerFollowReplyMultiNews
implements
Serializable
{
/**
* 主键Id
*/
@TableId
(
value
=
"id"
,
type
=
IdType
.
ID_WORKER
)
private
Long
id
;
/**
* customer_follow_reply 表主键Id
*/
@TableField
(
"reply_id"
)
private
Long
replyId
;
/**
* 标题
*/
@TableField
(
"title"
)
private
String
title
;
/**
* 图片地址
*/
@TableField
(
"pic_url"
)
private
String
picUrl
;
/**
* 链接地址
*/
@TableField
(
"link_url"
)
private
String
linkUrl
;
/**
* 逻辑删除
*/
@TableField
(
"is_deleted"
)
private
Integer
isDeleted
;
/**
* 创建时间
*/
@TableField
(
"gmt_create"
)
private
Date
gmtCreate
;
/**
* 创建人
*/
@TableField
(
"create_user"
)
private
Long
createUser
;
/**
* 修改时间
*/
@TableField
(
"gmt_modified"
)
private
Date
gmtModified
;
/**
* 修改人
*/
@TableField
(
"modified_user"
)
private
Long
modifiedUser
;
private
static
final
long
serialVersionUID
=
1L
;
}
src/main/java/com/yaoyaozw/customer/mapper/CustomerFollowReplyMultiNewsMapper.java
0 → 100644
浏览文件 @
b9723371
package
com
.
yaoyaozw
.
customer
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yaoyaozw.customer.entity.CustomerFollowReplyMultiNews
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @author darker
* @date 2023/11/1 14:28
*/
@Mapper
public
interface
CustomerFollowReplyMultiNewsMapper
extends
BaseMapper
<
CustomerFollowReplyMultiNews
>
{
}
src/main/java/com/yaoyaozw/customer/service/CustomerFollowReplyMultiNewsService.java
0 → 100644
浏览文件 @
b9723371
package
com
.
yaoyaozw
.
customer
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yaoyaozw.customer.dto.follow.FollowReplyMultiNewsCreateDTO
;
import
com.yaoyaozw.customer.entity.CustomerFollowReplyMultiNews
;
import
java.util.List
;
/**
* @author darker
* @date 2023/11/1 14:28
*/
public
interface
CustomerFollowReplyMultiNewsService
extends
IService
<
CustomerFollowReplyMultiNews
>
{
/**
* 保存关回多图文的图文列表
* @param replyId 关回配置的主键Id
* @param appId 公众号 appId
* @param multiNewsList 图文列表
*/
void
saveFollowReplyMultiNews
(
Long
replyId
,
String
appId
,
List
<
FollowReplyMultiNewsCreateDTO
>
multiNewsList
);
}
src/main/java/com/yaoyaozw/customer/service/impl/CustomerFollowReplyMultiNewsServiceImpl.java
0 → 100644
浏览文件 @
b9723371
package
com
.
yaoyaozw
.
customer
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yaoyaozw.customer.components.FollowReplyComponent
;
import
com.yaoyaozw.customer.components.SnowflakeComponent
;
import
com.yaoyaozw.customer.dto.follow.FollowReplyMultiNewsCreateDTO
;
import
com.yaoyaozw.customer.dto.follow.NewsMessageReplyEntity
;
import
com.yaoyaozw.customer.entity.CommonReferralBody
;
import
com.yaoyaozw.customer.entity.CustomerFollowReply
;
import
com.yaoyaozw.customer.entity.CustomerFollowReplyMultiNews
;
import
com.yaoyaozw.customer.entity.ReferralEntity
;
import
com.yaoyaozw.customer.mapper.CustomerFollowReplyMultiNewsMapper
;
import
com.yaoyaozw.customer.service.CustomerFollowReplyMultiNewsService
;
import
com.yaoyaozw.customer.service.ReferralEntityService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @author darker
* @date 2023/11/1 14:29
*/
@Service
public
class
CustomerFollowReplyMultiNewsServiceImpl
extends
ServiceImpl
<
CustomerFollowReplyMultiNewsMapper
,
CustomerFollowReplyMultiNews
>
implements
CustomerFollowReplyMultiNewsService
{
private
final
static
Logger
localLog
=
LoggerFactory
.
getLogger
(
CustomerFollowReplyMultiNewsServiceImpl
.
class
);
private
final
static
String
FOLLOW_REPLY_MULTI_NEWS_CACHE_KEY
=
"followReplyMultiNews"
;
@Autowired
private
ReferralEntityService
referralEntityService
;
@Autowired
private
FollowReplyComponent
followReplyComponent
;
@Autowired
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
@Autowired
private
SnowflakeComponent
snowflakeComponent
;
@Override
public
void
saveFollowReplyMultiNews
(
Long
replyId
,
String
appId
,
List
<
FollowReplyMultiNewsCreateDTO
>
multiNewsList
)
{
if
(
CollectionUtil
.
isEmpty
(
multiNewsList
))
{
return
;
}
localLog
.
info
(
"reply id {} save multi news size {}"
,
replyId
,
multiNewsList
.
size
());
// 删除这个replyId当前的所有的多图文配置
List
<
CustomerFollowReplyMultiNews
>
currentMultiNewsList
=
this
.
list
(
new
QueryWrapper
<
CustomerFollowReplyMultiNews
>().
eq
(
"reply_id"
,
replyId
));
if
(
CollectionUtil
.
isNotEmpty
(
currentMultiNewsList
))
{
// 删除这些多图文配置对应的referral_entity 数据
List
<
Long
>
multiNewsIdList
=
currentMultiNewsList
.
stream
().
map
(
CustomerFollowReplyMultiNews:
:
getId
).
collect
(
Collectors
.
toList
());
referralEntityService
.
remove
(
new
QueryWrapper
<
ReferralEntity
>().
in
(
ReferralEntity
.
COL_MATERIAL_GRAPHICS_ID
,
multiNewsIdList
));
this
.
removeByIds
(
multiNewsIdList
);
redisTemplate
.
opsForHash
().
delete
(
FOLLOW_REPLY_MULTI_NEWS_CACHE_KEY
,
appId
);
}
List
<
ReferralEntity
>
referralEntityList
=
new
ArrayList
<>(
multiNewsList
.
size
());
List
<
CustomerFollowReplyMultiNews
>
entityList
=
new
ArrayList
<>(
multiNewsList
.
size
());
// 处理链接
for
(
FollowReplyMultiNewsCreateDTO
multiNewsEntity
:
multiNewsList
)
{
CommonReferralBody
referralBody
=
multiNewsEntity
.
getReferralBody
();
// 调用通用方法生成referralEntity
ReferralEntity
referralEntity
=
followReplyComponent
.
getCreateReferralEntity
(
referralBody
);
referralEntityList
.
add
(
referralEntity
);
// 将生成的链接设置到多图文表中
multiNewsEntity
.
setLinkUrl
(
referralEntity
.
getReferral
());
CustomerFollowReplyMultiNews
entity
=
new
CustomerFollowReplyMultiNews
();
BeanUtil
.
copyProperties
(
multiNewsEntity
,
entity
);
entityList
.
add
(
entity
);
}
localLog
.
info
(
"generate multi news size {}, referral entity size {}"
,
entityList
.
size
(),
referralEntityList
.
size
());
// 将这些多图文信息转换到缓存
List
<
NewsMessageReplyEntity
>
cacheEntityList
=
JSONUtil
.
toList
(
JSONUtil
.
parseArray
(
multiNewsList
),
NewsMessageReplyEntity
.
class
);
redisTemplate
.
opsForHash
().
put
(
FOLLOW_REPLY_MULTI_NEWS_CACHE_KEY
,
appId
,
JSONUtil
.
toJsonStr
(
cacheEntityList
));
// this.saveBatch(entityList);
// referralEntityService.saveBatch(referralEntityList);
}
}
src/main/java/com/yaoyaozw/customer/service/impl/CustomerFollowReplyServiceImpl.java
浏览文件 @
b9723371
...
@@ -13,6 +13,7 @@ import com.yaoyaozw.customer.components.FollowReplyComponent;
...
@@ -13,6 +13,7 @@ import com.yaoyaozw.customer.components.FollowReplyComponent;
import
com.yaoyaozw.customer.components.SnowflakeComponent
;
import
com.yaoyaozw.customer.components.SnowflakeComponent
;
import
com.yaoyaozw.customer.constants.CustomerMaterialConstant
;
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.FollowReplyMultiNewsCreateDTO
;
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
;
import
com.yaoyaozw.customer.entity.CommonReferralBody
;
import
com.yaoyaozw.customer.entity.CommonReferralBody
;
...
@@ -20,6 +21,7 @@ import com.yaoyaozw.customer.entity.CustomerFollowReply;
...
@@ -20,6 +21,7 @@ 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.AuthorizerInfoService
;
import
com.yaoyaozw.customer.service.CustomerFollowReplyMultiNewsService
;
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
;
...
@@ -62,6 +64,8 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
...
@@ -62,6 +64,8 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
private
AuthorizerInfoService
authorizerInfoService
;
private
AuthorizerInfoService
authorizerInfoService
;
@Autowired
@Autowired
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
@Autowired
private
CustomerFollowReplyMultiNewsService
followReplyMultiNewsService
;
@Override
@Override
...
@@ -116,6 +120,12 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
...
@@ -116,6 +120,12 @@ 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
(
CustomerMaterialConstant
.
TENCENT_MEDIA_TYPE_MULTI_NEWS
.
equals
(
entity
.
getType
()))
{
// 多图文
List
<
FollowReplyMultiNewsCreateDTO
>
multiNewsList
=
saveDto
.
getMultiNewsList
();
localLog
.
info
(
"appId {} follow reply has multi news size {}"
,
saveDto
.
getAppid
(),
multiNewsList
.
size
());
followReplyMultiNewsService
.
saveFollowReplyMultiNews
(
entity
.
getId
(),
saveDto
.
getAppid
(),
saveDto
.
getMultiNewsList
());
return
new
GenericsResult
<>(
true
,
"【测试】多图文关回设置成功"
);
}
else
if
(!
CustomerMaterialConstant
.
TENCENT_MEDIA_TYPE_TEXT
.
equals
(
entity
.
getType
())){
}
else
if
(!
CustomerMaterialConstant
.
TENCENT_MEDIA_TYPE_TEXT
.
equals
(
entity
.
getType
())){
// 获取书城公众号链接(图文)
// 获取书城公众号链接(图文)
ReferralEntity
referralEntity
;
ReferralEntity
referralEntity
;
...
@@ -355,8 +365,8 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
...
@@ -355,8 +365,8 @@ public class CustomerFollowReplyServiceImpl extends ServiceImpl<CustomerFollowRe
}
}
private
String
checkNecessary
(
FollowReplySaveDTO
saveDto
)
{
private
String
checkNecessary
(
FollowReplySaveDTO
saveDto
)
{
if
(!
CustomerMaterialConstant
.
TENCENT_MEDIA_TYPE_TEXT
.
equals
(
saveDto
.
getType
()))
{
if
(!
CustomerMaterialConstant
.
TENCENT_MEDIA_TYPE_TEXT
.
equals
(
saveDto
.
getType
())
&&
!
CustomerMaterialConstant
.
TENCENT_MEDIA_TYPE_MULTI_NEWS
.
equals
(
saveDto
.
getType
())
)
{
//
非文本类型的都
需要文件
//
文本类型和多图文类型的都不
需要文件
if
(
StringUtils
.
isEmpty
(
saveDto
.
getOriginMediaUrl
()))
{
if
(
StringUtils
.
isEmpty
(
saveDto
.
getOriginMediaUrl
()))
{
return
"请选择素材文件"
;
return
"请选择素材文件"
;
}
}
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsServiceImpl.java
浏览文件 @
b9723371
...
@@ -237,6 +237,10 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
...
@@ -237,6 +237,10 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
Long
packId
=
customerGraphics
.
getPackId
();
Long
packId
=
customerGraphics
.
getPackId
();
CrowdPackage
crowdPackage
=
crowdPackageMap
.
get
(
packId
);
CrowdPackage
crowdPackage
=
crowdPackageMap
.
get
(
packId
);
if
(
crowdPackage
==
null
)
{
LOCAL_LOG
.
warn
(
"crowd package id {} not exist"
,
packId
);
continue
;
}
//活跃时间限制窗口
//活跃时间限制窗口
Long
activeTimeMax
=
crowdPackage
.
getActiveTimeMax
();
Long
activeTimeMax
=
crowdPackage
.
getActiveTimeMax
();
Long
activeTimeMin
=
crowdPackage
.
getActiveTimeMin
();
Long
activeTimeMin
=
crowdPackage
.
getActiveTimeMin
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论