Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
e1758e1d
提交
e1758e1d
authored
10月 19, 2022
作者:
沈振路
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
延时客服-finish
上级
6e87f898
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
138 行增加
和
13 行删除
+138
-13
CustomerServiceCommonAsyncComponent.java
...tomer/components/CustomerServiceCommonAsyncComponent.java
+2
-2
CustomerCommonConstant.java
...m/yaoyaozw/customer/constants/CustomerCommonConstant.java
+1
-0
CustomerCommonController.java
...aoyaozw/customer/controller/CustomerCommonController.java
+6
-0
CustomerGraphicsDelay.java
...a/com/yaoyaozw/customer/entity/CustomerGraphicsDelay.java
+0
-6
MaterialCommonMapper.java
...va/com/yaoyaozw/customer/mapper/MaterialCommonMapper.java
+7
-0
CustomerGraphicsDelayService.java
...oyaozw/customer/service/CustomerGraphicsDelayService.java
+7
-0
CustomerServiceCommonService.java
...oyaozw/customer/service/CustomerServiceCommonService.java
+7
-0
CustomerDelayTextServiceImpl.java
...w/customer/service/impl/CustomerDelayTextServiceImpl.java
+18
-3
CustomerGraphicsDelayServiceImpl.java
...stomer/service/impl/CustomerGraphicsDelayServiceImpl.java
+37
-2
CustomerServiceCommonServiceImpl.java
...stomer/service/impl/CustomerServiceCommonServiceImpl.java
+7
-0
MaterialCommonMapper.xml
src/main/resources/mapper/MaterialCommonMapper.xml
+12
-0
Test.java
src/test/java/Test.java
+34
-0
没有找到文件。
src/main/java/com/yaoyaozw/customer/components/CustomerServiceCommonAsyncComponent.java
浏览文件 @
e1758e1d
...
...
@@ -365,7 +365,7 @@ public class CustomerServiceCommonAsyncComponent {
String
name
=
CustomerCommonConstant
.
getLinkNameModel
(
targetReferralEntity
.
getNewsType
());
if
(
StringUtils
.
isNotBlank
(
name
)
&&
!
CustomerCommonConstant
.
USUAL_LINK_NEWS_TYPE
.
equals
(
targetReferralEntity
.
getNewsType
()))
{
name
=
name
+
"-"
+
System
.
currentTimeMillis
()
%
10000
;
name
=
name
+
"-"
+
System
.
currentTimeMillis
()
%
10000
0
;
targetReferralEntity
.
setName
(
name
);
}
...
...
@@ -409,7 +409,7 @@ public class CustomerServiceCommonAsyncComponent {
targetCustomerGraphics
.
setSendStatus
(
CustomerCommonConstant
.
SEND_STATUS_ACTIVE
);
if
(
StringUtils
.
isNotBlank
(
h5Context
))
{
targetCustomerGraphics
.
setContent
(
h5Context
.
toString
());
targetCustomerGraphics
.
setContent
(
h5Context
.
toString
()
.
replace
(
CustomerCommonConstant
.
H5_STYLE_CODE
,
""
)
);
}
LOCAL_LOG
.
info
(
"保存主体数据, 主体id: {}"
,
mainId
);
customerGraphicsDelayMapper
.
insert
(
targetCustomerGraphics
);
...
...
src/main/java/com/yaoyaozw/customer/constants/CustomerCommonConstant.java
浏览文件 @
e1758e1d
...
...
@@ -27,6 +27,7 @@ public class CustomerCommonConstant {
public
final
static
List
<
Integer
>
COMMON_NEWS_TYPE_LIST
=
Collections
.
singletonList
(
4
);
public
final
static
String
YW_LINK_LIMIT_REDIS_KEY
=
"YW_REFERRAL"
;
public
final
static
String
YANG_GUANG_ACCESS_LIMIT_REDIS_KEY
=
"YG_ACCESS_LIMIT_NUM"
;
public
final
static
Integer
BOOK_NEWS_TYPE
=
1
;
...
...
src/main/java/com/yaoyaozw/customer/controller/CustomerCommonController.java
浏览文件 @
e1758e1d
...
...
@@ -30,4 +30,10 @@ public class CustomerCommonController {
return
commonService
.
getStoreList
();
}
@GetMapping
(
"/getCoverPicList"
)
@ApiOperation
(
"获取书城列表"
)
public
GenericsResult
<
List
<
CommonOptionResponseVO
>>
getCoverPicList
()
{
return
commonService
.
getCoverPicList
();
}
}
src/main/java/com/yaoyaozw/customer/entity/CustomerGraphicsDelay.java
浏览文件 @
e1758e1d
...
...
@@ -75,12 +75,6 @@ public class CustomerGraphicsDelay implements Serializable {
private
Integer
isPay
;
/**
* 是否是历史遗留
*/
@TableField
(
value
=
"is_history"
)
private
Integer
isHistory
;
/**
* 发送序列
*/
@TableField
(
value
=
"post_sort"
)
...
...
src/main/java/com/yaoyaozw/customer/mapper/MaterialCommonMapper.java
浏览文件 @
e1758e1d
...
...
@@ -34,4 +34,11 @@ public interface MaterialCommonMapper {
*/
List
<
AuthInfoVO
>
getAuthInfoList
(
@Param
(
"accountSet"
)
Set
<
String
>
accountSet
);
/**
* 把封面图片列表
*
* @return {@link GenericsResult}<{@link List}<{@link CommonOptionResponseVO}>>
*/
List
<
CommonOptionResponseVO
>
getCoverPicList
();
}
src/main/java/com/yaoyaozw/customer/service/CustomerGraphicsDelayService.java
浏览文件 @
e1758e1d
...
...
@@ -96,5 +96,12 @@ public interface CustomerGraphicsDelayService extends IService<CustomerGraphicsD
* @return {@link GenericsResult}<{@link List}<{@link CommonOptionResponseVO}>>
*/
GenericsResult
<
List
<
CommonOptionResponseVO
>>
getTimeIntervalList
();
/**
* 客户重新排序
*
* @param appId 应用程序id
*/
void
reSortCustomer
(
String
appId
);
}
src/main/java/com/yaoyaozw/customer/service/CustomerServiceCommonService.java
浏览文件 @
e1758e1d
...
...
@@ -26,4 +26,11 @@ public interface CustomerServiceCommonService {
* @return {@link GenericsResult}<{@link CommonOptionResponseVO}>
*/
GenericsResult
<
List
<
CommonOptionResponseVO
>>
getStoreList
();
/**
* 把封面图片列表
*
* @return {@link GenericsResult}<{@link List}<{@link CommonOptionResponseVO}>>
*/
GenericsResult
<
List
<
CommonOptionResponseVO
>>
getCoverPicList
();
}
src/main/java/com/yaoyaozw/customer/service/impl/CustomerDelayTextServiceImpl.java
浏览文件 @
e1758e1d
...
...
@@ -19,6 +19,7 @@ import com.yaoyaozw.customer.mapper.CustomerGraphicsDelayMapper;
import
com.yaoyaozw.customer.mapper.KanbanCommonMapper
;
import
com.yaoyaozw.customer.service.AuthorizerInfoService
;
import
com.yaoyaozw.customer.service.CustomerDelayTextService
;
import
com.yaoyaozw.customer.service.CustomerGraphicsDelayService
;
import
com.yaoyaozw.customer.service.ReferralEntityService
;
import
com.yaoyaozw.customer.vo.AuthInfoVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerContentVO
;
...
...
@@ -54,9 +55,9 @@ public class CustomerDelayTextServiceImpl extends ServiceImpl<CustomerGraphicsDe
@Autowired
private
CustomerServiceCommonAsyncComponent
commonAsyncComponent
;
@Autowired
private
AuthorizerInfoService
authorizerInfoService
;
@Autowired
private
KanbanCommonMapper
kanbanCommonMapper
;
@Autowired
private
CustomerGraphicsDelayService
graphicsDelayService
;
@Override
public
GenericsResult
<
String
>
insertCustomerDelay
(
CustomerDelayTextSaveDTO
saveDto
)
{
...
...
@@ -64,13 +65,27 @@ public class CustomerDelayTextServiceImpl extends ServiceImpl<CustomerGraphicsDe
localLog
.
info
(
"处理主体数据"
);
CustomerGraphicsDelay
customerGraphicsDelay
=
new
CustomerGraphicsDelay
();
BeanUtil
.
copyProperties
(
saveDto
,
customerGraphicsDelay
);
boolean
isCreate
=
ObjectUtil
.
isNull
(
customerGraphicsDelay
.
getId
());
customerGraphicsDelay
.
initOperateInfo
(
tokenManager
.
getUserIdFromToken
(),
ObjectUtil
.
isNull
(
saveDto
.
getId
()));
if
(
ObjectUtil
.
isNull
(
customerGraphicsDelay
.
getId
())
)
{
if
(
isCreate
)
{
long
id
=
snowflakeComponent
.
snowflakeId
();
customerGraphicsDelay
.
setId
(
id
);
}
customerGraphicsDelay
.
setSendStatus
(
CustomerCommonConstant
.
SEND_STATUS_ACTIVE
);
super
.
saveOrUpdate
(
customerGraphicsDelay
);
String
appId
=
saveDto
.
getAppId
();
if
(
StringUtils
.
isBlank
(
appId
))
{
// 更新的时候
CustomerGraphicsDelay
entity
=
super
.
getById
(
saveDto
.
getId
());
if
(
ObjectUtil
.
isNotNull
(
entity
))
{
appId
=
entity
.
getAppId
();
}
}
if
(!
StringUtils
.
isBlank
(
appId
))
{
graphicsDelayService
.
reSortCustomer
(
appId
);
}
return
new
GenericsResult
<>(
customerGraphicsDelay
.
getId
().
toString
());
}
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsDelayServiceImpl.java
浏览文件 @
e1758e1d
...
...
@@ -22,6 +22,7 @@ import com.yaoyaozw.customer.entity.ReferralEntity;
import
com.yaoyaozw.customer.mapper.CustomerGraphicsDelayMapper
;
import
com.yaoyaozw.customer.mapper.KanbanCommonMapper
;
import
com.yaoyaozw.customer.service.AuthorizerInfoService
;
import
com.yaoyaozw.customer.service.CustomerDelayTextService
;
import
com.yaoyaozw.customer.service.CustomerGraphicsDelayService
;
import
com.yaoyaozw.customer.service.ReferralEntityService
;
import
com.yaoyaozw.customer.vo.AuthInfoVO
;
...
...
@@ -134,6 +135,7 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
if
(!
referralResult
)
{
return
new
BaseResult
().
error
(
"新增/更新 链接数据异常"
);
}
reSortCustomer
(
saveDto
.
getAppId
());
return
new
BaseResult
().
success
();
}
...
...
@@ -180,21 +182,32 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
@Override
public
BaseResult
removeCustomerDelay
(
Long
id
)
{
CustomerGraphicsDelay
entity
=
super
.
getById
(
id
);
boolean
result
=
super
.
removeById
(
id
);
if
(
result
)
{
referralEntityService
.
ultimateDeleteReferrals
(
id
,
null
);
localLog
.
info
(
"处理完成, 正在重新排序"
);
reSortCustomer
(
entity
.
getAppId
());
return
new
BaseResult
().
success
();
}
referralEntityService
.
ultimateDeleteReferrals
(
id
,
null
);
return
new
BaseResult
().
error
(
"弃用失败"
);
}
@Override
public
BaseResult
removeBatch
(
List
<
Long
>
idList
)
{
List
<
CustomerGraphicsDelay
>
list
=
(
List
<
CustomerGraphicsDelay
>)
super
.
listByIds
(
idList
);
boolean
result
=
super
.
removeByIds
(
idList
);
if
(
result
)
{
referralEntityService
.
ultimateDeleteReferralsBatch
(
idList
,
null
);
localLog
.
info
(
"处理完成, 正在重新排序"
);
Set
<
String
>
appIdSet
=
list
.
stream
().
map
(
CustomerGraphicsDelay:
:
getAppId
).
collect
(
Collectors
.
toSet
());
for
(
String
appId
:
appIdSet
)
{
reSortCustomer
(
appId
);
}
return
new
BaseResult
().
success
();
}
referralEntityService
.
ultimateDeleteReferralsBatch
(
idList
,
null
);
return
new
BaseResult
().
error
(
"删除失败"
);
}
...
...
@@ -267,5 +280,27 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
List
<
CommonOptionResponseVO
>
timeIntervalList
=
super
.
baseMapper
.
getTimeIntervalList
();
return
new
GenericsResult
<>(
timeIntervalList
);
}
@Override
public
void
reSortCustomer
(
String
appId
)
{
List
<
CustomerGraphicsDelay
>
list
=
super
.
list
(
new
QueryWrapper
<
CustomerGraphicsDelay
>().
eq
(
"app_id"
,
appId
).
orderByAsc
(
"time_interval"
));
int
idx
=
0
;
Long
previousTime
=
0L
;
for
(
CustomerGraphicsDelay
item
:
list
)
{
boolean
equal
=
previousTime
.
equals
(
item
.
getTimeInterval
());
if
(!
equal
)
{
idx
+=
1
;
}
item
.
setPostSort
(
idx
);
previousTime
=
item
.
getTimeInterval
();
}
if
(
CollectionUtil
.
isNotEmpty
(
list
))
{
super
.
updateBatchById
(
list
);
}
}
}
src/main/java/com/yaoyaozw/customer/service/impl/CustomerServiceCommonServiceImpl.java
浏览文件 @
e1758e1d
...
...
@@ -37,4 +37,11 @@ public class CustomerServiceCommonServiceImpl implements CustomerServiceCommonSe
List
<
CommonOptionResponseVO
>
storeList
=
materialCommonMapper
.
getStoreList
();
return
new
GenericsResult
<>(
storeList
);
}
@Override
public
GenericsResult
<
List
<
CommonOptionResponseVO
>>
getCoverPicList
()
{
List
<
CommonOptionResponseVO
>
coverPicList
=
materialCommonMapper
.
getCoverPicList
();
return
new
GenericsResult
<>(
coverPicList
);
}
}
src/main/resources/mapper/MaterialCommonMapper.xml
浏览文件 @
e1758e1d
...
...
@@ -22,4 +22,15 @@
#{accountId}
</foreach>
</select>
<select
id=
"getCoverPicList"
resultType=
"com.yaoyaozw.customer.vo.CommonOptionResponseVO"
>
select
dic_value as label,
dic_key as `value`
from sys_dictionary
where is_deleted = 0 and level = 3
and group_id = 'CUSTOMER_PIC'
order by sort
</select>
</mapper>
\ No newline at end of file
src/test/java/Test.java
0 → 100644
浏览文件 @
e1758e1d
import
com.yaoyaozw.customer.CustomerServiceApplication
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
java.util.concurrent.TimeUnit
;
/**
* @author darker
* @date 2022/10/19 14:42
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
CustomerServiceApplication
.
class
)
public
class
Test
{
@Autowired
private
RedisTemplate
redisTemplate
;
@org
.
junit
.
Test
public
void
testRedis
()
{
redisTemplate
.
opsForValue
().
set
(
"count"
,
0
);
redisTemplate
.
expire
(
"count"
,
1
,
TimeUnit
.
MINUTES
);
try
{
Thread
.
sleep
(
15000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
redisTemplate
.
opsForValue
().
increment
(
"count"
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论