Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
62be57d5
提交
62be57d5
authored
11月 02, 2022
作者:
gh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
订单活跃关闭,定时客服开启
上级
4f512eac
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
31 行增加
和
20 行删除
+31
-20
SchedulingTask.java
...java/com/yaoyaozw/customer/scheduling/SchedulingTask.java
+2
-2
CustomerGraphicsServiceImpl.java
...zw/customer/service/impl/CustomerGraphicsServiceImpl.java
+17
-8
WeChatService.java
...oyaozw/customer/service/wechat/service/WeChatService.java
+3
-5
WeChatServiceImpl.java
...zw/customer/service/wechat/service/WeChatServiceImpl.java
+3
-3
CrowdPackageUserVO.java
...com/yaoyaozw/customer/vo/customer/CrowdPackageUserVO.java
+3
-0
RegisterUserEntityMapper.xml
src/main/resources/mapper/RegisterUserEntityMapper.xml
+3
-2
没有找到文件。
src/main/java/com/yaoyaozw/customer/scheduling/SchedulingTask.java
浏览文件 @
62be57d5
...
@@ -44,7 +44,7 @@ public class SchedulingTask {
...
@@ -44,7 +44,7 @@ public class SchedulingTask {
/**
/**
* 拉取付费订单(每15min一次)
* 拉取付费订单(每15min一次)
*/
*/
@Scheduled
(
cron
=
"0 5/15 * * * *"
)
//
@Scheduled(cron = "0 5/15 * * * *")
public
void
retrieveOrderData
(){
public
void
retrieveOrderData
(){
Calendar
calendar
=
Calendar
.
getInstance
();
Calendar
calendar
=
Calendar
.
getInstance
();
...
@@ -63,7 +63,7 @@ public class SchedulingTask {
...
@@ -63,7 +63,7 @@ public class SchedulingTask {
/**
/**
* 更新付费用户近一月平均充值(每天一次:4点10分)
* 更新付费用户近一月平均充值(每天一次:4点10分)
*/
*/
@Scheduled
(
cron
=
"0 10 4 * * *"
)
//
@Scheduled(cron = "0 10 4 * * *")
public
void
retrieveMonthOrder
(){
public
void
retrieveMonthOrder
(){
Calendar
calendar
=
Calendar
.
getInstance
();
Calendar
calendar
=
Calendar
.
getInstance
();
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsServiceImpl.java
浏览文件 @
62be57d5
...
@@ -15,11 +15,8 @@ import com.yaoyaozw.customer.constants.CustomerCommonConstant;
...
@@ -15,11 +15,8 @@ import com.yaoyaozw.customer.constants.CustomerCommonConstant;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageQueryDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageQueryDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageSaveDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerMessageSaveDTO
;
import
com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO
;
import
com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO
;
import
com.yaoyaozw.customer.entity.
AuthorizerToken
;
import
com.yaoyaozw.customer.entity.
*
;
import
com.yaoyaozw.customer.dto.customer.CustomerReferralDTO
;
import
com.yaoyaozw.customer.dto.customer.CustomerReferralDTO
;
import
com.yaoyaozw.customer.entity.CrowdPackageCondition
;
import
com.yaoyaozw.customer.entity.CrowdPackageConditionMatch
;
import
com.yaoyaozw.customer.entity.ReferralEntity
;
import
com.yaoyaozw.customer.mapper.KanbanCommonMapper
;
import
com.yaoyaozw.customer.mapper.KanbanCommonMapper
;
import
com.yaoyaozw.customer.service.CrowdPackageConditionMatchService
;
import
com.yaoyaozw.customer.service.CrowdPackageConditionMatchService
;
import
com.yaoyaozw.customer.service.CrowdPackageConditionService
;
import
com.yaoyaozw.customer.service.CrowdPackageConditionService
;
...
@@ -41,7 +38,6 @@ import java.util.stream.Collectors;
...
@@ -41,7 +38,6 @@ import java.util.stream.Collectors;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yaoyaozw.customer.entity.CustomerGraphics
;
import
com.yaoyaozw.customer.mapper.CustomerGraphicsMapper
;
import
com.yaoyaozw.customer.mapper.CustomerGraphicsMapper
;
import
com.yaoyaozw.customer.service.CustomerGraphicsService
;
import
com.yaoyaozw.customer.service.CustomerGraphicsService
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -224,16 +220,29 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
...
@@ -224,16 +220,29 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
List
<
CustomerGraphics
>
customerGraphicsList
=
list
(
new
QueryWrapper
<
CustomerGraphics
>().
eq
(
CustomerGraphics
.
COL_POST_TIME
,
requestDate
).
eq
(
CustomerGraphics
.
COL_SEND_STATUS
,
9
));
List
<
CustomerGraphics
>
customerGraphicsList
=
list
(
new
QueryWrapper
<
CustomerGraphics
>().
eq
(
CustomerGraphics
.
COL_POST_TIME
,
requestDate
).
eq
(
CustomerGraphics
.
COL_SEND_STATUS
,
9
));
List
<
CrowdPackage
>
crowdPackageList
=
crowdPackageService
.
list
();
Map
<
Long
,
CrowdPackage
>
crowdPackageMap
=
crowdPackageList
.
stream
().
collect
(
Collectors
.
toMap
(
CrowdPackage:
:
getId
,
a
->
a
));
if
(!
customerGraphicsList
.
isEmpty
()){
if
(!
customerGraphicsList
.
isEmpty
()){
LOCAL_LOG
.
info
(
"start sendCustomerMessage"
);
LOCAL_LOG
.
info
(
"start sendCustomerMessage"
);
for
(
CustomerGraphics
customerGraphics
:
customerGraphicsList
)
{
for
(
CustomerGraphics
customerGraphics
:
customerGraphicsList
)
{
//人群包id
//人群包id
Long
packId
=
customerGraphics
.
getPackId
();
Long
packId
=
customerGraphics
.
getPackId
();
CrowdPackage
crowdPackage
=
crowdPackageMap
.
get
(
packId
);
Long
activeTimeMax
=
crowdPackage
.
getActiveTimeMax
();
Long
activeTimeMin
=
crowdPackage
.
getActiveTimeMin
();
//根据人群包找人,并按appId分组
//根据人群包找人,并按appId分组
List
<
CrowdPackageUserVO
>
userList
=
registerUserEntityService
.
getCurrentInPackUserList
(
packId
,
false
);
List
<
CrowdPackageUserVO
>
userList
=
registerUserEntityService
.
getCurrentInPackUserList
(
packId
,
false
);
//去重
Map
<
String
,
List
<
CrowdPackageUserVO
>>
appidUserMap
=
userList
.
stream
().
collect
(
Collectors
.
groupingBy
(
CrowdPackageUserVO:
:
getAppId
,
//1.活跃时间判断,2.用户去重
Collectors
.
collectingAndThen
(
toCollection
(()
->
new
TreeSet
<>(
Comparator
.
comparing
(
CrowdPackageUserVO:
:
getOpenId
))),
ArrayList:
:
new
)));
Map
<
String
,
List
<
CrowdPackageUserVO
>>
appidUserMap
=
userList
.
stream
()
.
filter
(
a
->
a
.
getLastActive
()!=
null
&&(
activeTimeMin
==
null
||
a
.
getLastActive
().
getTime
()>
activeTimeMin
)&&(
activeTimeMax
==
null
||
a
.
getLastActive
().
getTime
()<
activeTimeMax
))
.
collect
(
Collectors
.
groupingBy
(
CrowdPackageUserVO:
:
getAppId
,
Collectors
.
collectingAndThen
(
toCollection
(()
->
new
TreeSet
<>(
Comparator
.
comparing
(
CrowdPackageUserVO:
:
getOpenId
))),
ArrayList:
:
new
)));
//根据客服id找不同公众号的链接,并按appId分组
//根据客服id找不同公众号的链接,并按appId分组
List
<
ReferralEntityVo
>
referralList
=
referralEntityService
.
findReferralByCustomerGraphicsId
(
customerGraphics
.
getId
());
List
<
ReferralEntityVo
>
referralList
=
referralEntityService
.
findReferralByCustomerGraphicsId
(
customerGraphics
.
getId
());
...
...
src/main/java/com/yaoyaozw/customer/service/wechat/service/WeChatService.java
浏览文件 @
62be57d5
package
com
.
yaoyaozw
.
customer
.
service
.
wechat
.
service
;
package
com
.
yaoyaozw
.
customer
.
service
.
wechat
.
service
;
import
com.yaoyaozw.customer.entity.AuthorizerToken
;
import
com.yaoyaozw.customer.entity.*
;
import
com.yaoyaozw.customer.entity.CustomerDelayPublish
;
import
com.yaoyaozw.customer.entity.CustomerGraphics
;
import
com.yaoyaozw.customer.entity.RegisterUserEntity
;
import
com.yaoyaozw.customer.vo.customer.CrowdPackageUserVO
;
import
com.yaoyaozw.customer.vo.customer.CrowdPackageUserVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerDelayItemVO
;
import
com.yaoyaozw.customer.vo.customer.CustomerDelayItemVO
;
import
com.yaoyaozw.customer.vo.referral.ReferralEntityVo
;
import
com.yaoyaozw.customer.vo.referral.ReferralEntityVo
;
...
@@ -26,6 +23,7 @@ public interface WeChatService {
...
@@ -26,6 +23,7 @@ public interface WeChatService {
/**
/**
* 定时发送客服消息
* 定时发送客服消息
*/
*/
void
sendCustomerMessage
(
String
appid
,
AuthorizerToken
authorizerToken
,
CustomerGraphics
customerGraphics
,
List
<
CrowdPackageUserVO
>
openidList
,
List
<
ReferralEntityVo
>
referralEntityVo
);
void
sendCustomerMessage
(
String
appid
,
AuthorizerToken
authorizerToken
,
CustomerGraphics
customerGraphics
,
List
<
CrowdPackageUserVO
>
openidList
,
List
<
ReferralEntityVo
>
referralEntityVo
);
}
}
src/main/java/com/yaoyaozw/customer/service/wechat/service/WeChatServiceImpl.java
浏览文件 @
62be57d5
...
@@ -3,6 +3,7 @@ package com.yaoyaozw.customer.service.wechat.service;
...
@@ -3,6 +3,7 @@ package com.yaoyaozw.customer.service.wechat.service;
import
com.yaoyaozw.customer.constants.CustomerCommonConstant
;
import
com.yaoyaozw.customer.constants.CustomerCommonConstant
;
import
com.yaoyaozw.customer.entity.AuthorizerToken
;
import
com.yaoyaozw.customer.entity.AuthorizerToken
;
import
com.yaoyaozw.customer.entity.CrowdPackage
;
import
com.yaoyaozw.customer.entity.CustomerDelayPublish
;
import
com.yaoyaozw.customer.entity.CustomerDelayPublish
;
import
com.yaoyaozw.customer.entity.CustomerGraphics
;
import
com.yaoyaozw.customer.entity.CustomerGraphics
;
import
com.yaoyaozw.customer.service.AuthorizerTokenService
;
import
com.yaoyaozw.customer.service.AuthorizerTokenService
;
...
@@ -125,7 +126,8 @@ public class WeChatServiceImpl implements WeChatService{
...
@@ -125,7 +126,8 @@ public class WeChatServiceImpl implements WeChatService{
@Override
@Override
public
void
sendCustomerMessage
(
String
appid
,
AuthorizerToken
authorizerToken
,
CustomerGraphics
customerGraphics
,
List
<
CrowdPackageUserVO
>
openidList
,
List
<
ReferralEntityVo
>
referralEntityVo
)
{
public
void
sendCustomerMessage
(
String
appid
,
AuthorizerToken
authorizerToken
,
CustomerGraphics
customerGraphics
,
List
<
CrowdPackageUserVO
>
openidList
,
List
<
ReferralEntityVo
>
referralEntityVo
)
{
//token
//token
UriComponentsBuilder
uriComponentsBuilder
=
UriComponentsBuilder
.
fromHttpUrl
(
customerPath
).
queryParam
(
"access_token"
,
authorizerToken
.
getAuthorizerAccessToken
());
UriComponentsBuilder
uriComponentsBuilder
=
UriComponentsBuilder
.
fromHttpUrl
(
customerPath
).
queryParam
(
"access_token"
,
authorizerToken
.
getAuthorizerAccessToken
());
//构建请求参数(文本/图文)
//构建请求参数(文本/图文)
...
@@ -146,7 +148,6 @@ public class WeChatServiceImpl implements WeChatService{
...
@@ -146,7 +148,6 @@ public class WeChatServiceImpl implements WeChatService{
customerRequest
.
setTouser
(
crowdPackageUserVO
.
getOpenId
());
customerRequest
.
setTouser
(
crowdPackageUserVO
.
getOpenId
());
try
{
try
{
WeChatResponseEntity
response
=(
WeChatResponseEntity
)
weChatRestService
.
httpPostRequest
(
uriComponentsBuilder
,
customerRequest
,
WeChatResponseEntity
.
class
);
WeChatResponseEntity
response
=(
WeChatResponseEntity
)
weChatRestService
.
httpPostRequest
(
uriComponentsBuilder
,
customerRequest
,
WeChatResponseEntity
.
class
);
if
(
SUCCESS_CODE
.
equals
(
response
.
getErrcode
())){
if
(
SUCCESS_CODE
.
equals
(
response
.
getErrcode
())){
...
@@ -164,7 +165,6 @@ public class WeChatServiceImpl implements WeChatService{
...
@@ -164,7 +165,6 @@ public class WeChatServiceImpl implements WeChatService{
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
finally
{
}
finally
{
latch
.
countDown
();
latch
.
countDown
();
...
...
src/main/java/com/yaoyaozw/customer/vo/customer/CrowdPackageUserVO.java
浏览文件 @
62be57d5
...
@@ -3,6 +3,7 @@ package com.yaoyaozw.customer.vo.customer;
...
@@ -3,6 +3,7 @@ package com.yaoyaozw.customer.vo.customer;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
/**
* @author darker
* @author darker
...
@@ -23,6 +24,8 @@ public class CrowdPackageUserVO implements Serializable {
...
@@ -23,6 +24,8 @@ public class CrowdPackageUserVO implements Serializable {
private
Long
setupId
;
private
Long
setupId
;
private
Date
lastActive
;
private
String
inPackage
;
private
String
inPackage
;
private
String
storeType
;
private
String
storeType
;
...
...
src/main/resources/mapper/RegisterUserEntityMapper.xml
浏览文件 @
62be57d5
...
@@ -92,9 +92,10 @@
...
@@ -92,9 +92,10 @@
setup_id,
setup_id,
open_id,
open_id,
in_Package,
in_Package,
app_id
app_id,
last_active
from register_user_entity
from register_user_entity
where find_in_set(#{packageId}, in_package)
where find_in_set(#{packageId}, in_package)
and TIMESTAMPDIFF(HOUR,last_active,now() )
<
48
</select>
</select>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论