Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
0e6ca380
提交
0e6ca380
authored
11月 02, 2022
作者:
gh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
月平均付费修正
上级
7e4cf8cc
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
12 行增加
和
12 行删除
+12
-12
SchedulingTask.java
...java/com/yaoyaozw/customer/scheduling/SchedulingTask.java
+4
-4
CustomerGraphicsServiceImpl.java
...zw/customer/service/impl/CustomerGraphicsServiceImpl.java
+2
-0
WeChatServiceImpl.java
...zw/customer/service/wechat/service/WeChatServiceImpl.java
+5
-7
AccountOrderMapper.xml
src/main/resources/mapper/AccountOrderMapper.xml
+1
-1
没有找到文件。
src/main/java/com/yaoyaozw/customer/scheduling/SchedulingTask.java
浏览文件 @
0e6ca380
...
...
@@ -46,7 +46,7 @@ public class SchedulingTask {
/**
* 拉取付费订单(每15min一次)
*/
@Scheduled
(
cron
=
"0 5/15 * * * *"
)
//
@Scheduled(cron = "0 5/15 * * * *")
public
void
retrieveOrderData
(){
Calendar
calendar
=
Calendar
.
getInstance
();
...
...
@@ -59,13 +59,13 @@ public class SchedulingTask {
integrationRequestDTO
.
setRequestDate
(
calendar
.
getTime
());
accountOrderService
.
activeUserByOrder
(
integrationRequestDTO
);
//
accountOrderService.activeUserByOrder(integrationRequestDTO);
}
/**
* 更新付费用户近一月平均充值(每天一次:4点10分)
*/
@Scheduled
(
cron
=
"0 10 4 * * *"
)
//
@Scheduled(cron = "0 10 4 * * *")
public
void
retrieveMonthOrder
(){
Calendar
calendar
=
Calendar
.
getInstance
();
...
...
@@ -78,7 +78,7 @@ public class SchedulingTask {
integrationRequestDTO
.
setRequestDate
(
calendar
.
getTime
());
accountOrderService
.
calculateAvgMonth
(
integrationRequestDTO
);
//
accountOrderService.calculateAvgMonth(integrationRequestDTO);
}
...
...
src/main/java/com/yaoyaozw/customer/service/impl/CustomerGraphicsServiceImpl.java
浏览文件 @
0e6ca380
...
...
@@ -222,6 +222,7 @@ 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
));
if
(!
customerGraphicsList
.
isEmpty
()){
LOCAL_LOG
.
info
(
"start sendCustomerMessage"
);
for
(
CustomerGraphics
customerGraphics
:
customerGraphicsList
)
{
//人群包id
Long
packId
=
customerGraphics
.
getPackId
();
...
...
@@ -255,6 +256,7 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
}
}
updateBatchById
(
customerGraphicsList
);
LOCAL_LOG
.
info
(
"end sendCustomerMessage"
);
}
}
...
...
src/main/java/com/yaoyaozw/customer/service/wechat/service/WeChatServiceImpl.java
浏览文件 @
0e6ca380
...
...
@@ -35,13 +35,13 @@ public class WeChatServiceImpl implements WeChatService{
private
static
final
String
CUSTOMER_NEWS
=
"news"
;
private
static
final
int
THREAD_
NUM
=
1000
;
private
static
final
int
THREAD_
SIZE
=
1000
;
private
static
final
Integer
SUCCESS_CODE
=
0
;
private
static
final
Integer
EXPIRED_CODE
=
40001
;
private
static
final
Integer
FORBID_T
ime
=
6
;
private
static
final
Integer
FORBID_T
IME
=
6
;
private
static
final
ThreadPoolExecutor
EXECUTOR
=
new
ThreadPoolExecutor
(
20
,
100
,
60L
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(
2
),
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
...
...
@@ -63,7 +63,7 @@ public class WeChatServiceImpl implements WeChatService{
Calendar
instance
=
Calendar
.
getInstance
();
int
i
=
instance
.
get
(
Calendar
.
HOUR_OF_DAY
);
//早上0-6点不发
if
(
i
<
FORBID_T
ime
){
if
(
i
<
FORBID_T
IME
){
//token
UriComponentsBuilder
uriComponentsBuilder
=
UriComponentsBuilder
.
fromHttpUrl
(
customerPath
).
queryParam
(
"access_token"
,
authorizerToken
.
getAuthorizerAccessToken
());
//找到延时序列
...
...
@@ -135,9 +135,9 @@ public class WeChatServiceImpl implements WeChatService{
//计数器
CountDownLatch
latch
=
new
CountDownLatch
(
openidList
.
size
());
for
(
int
i
=
0
;
i
<
openidList
.
size
();
i
+=
THREAD_
NUM
)
{
for
(
int
i
=
0
;
i
<
openidList
.
size
();
i
+=
THREAD_
SIZE
)
{
List
<
CrowdPackageUserVO
>
subOpenidList
=
openidList
.
subList
(
i
,
Math
.
min
(
i
+
THREAD_
NUM
,
openidList
.
size
()));
List
<
CrowdPackageUserVO
>
subOpenidList
=
openidList
.
subList
(
i
,
Math
.
min
(
i
+
THREAD_
SIZE
,
openidList
.
size
()));
//TODO:配置多线程+测试+记录发送量
EXECUTOR
.
execute
(()->{
...
...
@@ -146,7 +146,6 @@ public class WeChatServiceImpl implements WeChatService{
customerRequest
.
setTouser
(
crowdPackageUserVO
.
getOpenId
());
try
{
System
.
err
.
println
(
customerRequest
.
getTouser
());
WeChatResponseEntity
response
=(
WeChatResponseEntity
)
weChatRestService
.
httpPostRequest
(
uriComponentsBuilder
,
customerRequest
,
WeChatResponseEntity
.
class
);
...
...
@@ -156,7 +155,6 @@ public class WeChatServiceImpl implements WeChatService{
//发送成功计数
customerGraphics
.
updateCount
();
}
System
.
err
.
println
(
response
);
}
else
if
(
EXPIRED_CODE
.
equals
(
response
.
getErrcode
())
){
Thread
.
sleep
(
500
);
//token过期重新取一下
...
...
src/main/resources/mapper/AccountOrderMapper.xml
浏览文件 @
0e6ca380
...
...
@@ -37,7 +37,7 @@
<select
id=
"findMonthDailyAccountOrder"
resultType=
"com.yaoyaozw.customer.vo.kanban.UserAvgAmountVO"
>
SELECT
open_id,convert(SUM(profit)/(if(datediff(CURDATE(),user_subscribe_time)
<
30,datediff(CURDATE(),user_subscribe_time),30)),decimal(8,2))
open_id,convert(SUM(profit)/(if(datediff(CURDATE(),user_subscribe_time)
<
30,datediff(CURDATE(),user_subscribe_time),30)),decimal(8,2))
as avgAmount
FROM
account_order
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论