Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
f9a9280e
Commit
f9a9280e
authored
Aug 12, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
晚上七点发送短信沉香专场
parent
d14e02e3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
12 deletions
+35
-12
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/SpecialPerformanceRequestDto.java
...to/request/distribution/SpecialPerformanceRequestDto.java
+5
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SpecialPerformanceServiceImpl.java
...h/wx/impl/distribution/SpecialPerformanceServiceImpl.java
+3
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+5
-3
ch-wx-api/src/main/java/com/wwdz/ch/wx/job/SendMsgFromExcelJob.java
...src/main/java/com/wwdz/ch/wx/job/SendMsgFromExcelJob.java
+12
-9
ch-wx-api/src/main/resources/喜马拉雅品类用户手机号.xlsx
ch-wx-api/src/main/resources/喜马拉雅品类用户手机号.xlsx
+0
-0
ch-wx-api/src/main/resources/沉香短信表.xlsx
ch-wx-api/src/main/resources/沉香短信表.xlsx
+0
-0
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/LogisticsApiTest.java
...pi/src/test/java/com/wwdz/ch/wx/api/LogisticsApiTest.java
+10
-0
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/SpecialPerformanceRequestDto.java
View file @
f9a9280e
...
@@ -97,4 +97,9 @@ public class SpecialPerformanceRequestDto extends BaseRequestDto implements Enti
...
@@ -97,4 +97,9 @@ public class SpecialPerformanceRequestDto extends BaseRequestDto implements Enti
* 分享记录id
* 分享记录id
*/
*/
private
String
shareRecordId
;
private
String
shareRecordId
;
/**
* 短信点击进入的标识
*/
private
String
smsFlag
;
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SpecialPerformanceServiceImpl.java
View file @
f9a9280e
...
@@ -276,6 +276,9 @@ public class SpecialPerformanceServiceImpl implements SpecialPerformanceService
...
@@ -276,6 +276,9 @@ public class SpecialPerformanceServiceImpl implements SpecialPerformanceService
@Override
@Override
public
Result
findItemList
(
SpecialPerformanceRequestDto
dto
)
{
public
Result
findItemList
(
SpecialPerformanceRequestDto
dto
)
{
try
{
try
{
if
(
StringUtils
.
hasLength
(
dto
.
getSmsFlag
()))
{
logger
.
info
(
"用户id:{} 通过短信进入专场:{}"
,
dto
.
getUserId
(),
dto
.
getSpecialPerformanceId
());
}
String
shareRecordId
=
dto
.
getShareRecordId
();
String
shareRecordId
=
dto
.
getShareRecordId
();
DistributorShareRecord
distributorShareRecord
=
null
;
DistributorShareRecord
distributorShareRecord
=
null
;
long
introducerId
=
CommConsts
.
SYSTEM_ACCOUNT
;
long
introducerId
=
CommConsts
.
SYSTEM_ACCOUNT
;
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
f9a9280e
...
@@ -1153,7 +1153,9 @@ public class SupplierItemServiceImpl implements SupplierItemService {
...
@@ -1153,7 +1153,9 @@ public class SupplierItemServiceImpl implements SupplierItemService {
searchDto
.
setLimit
(
dto
.
getLimit
());
searchDto
.
setLimit
(
dto
.
getLimit
());
String
viewKey
=
userId
+
":homepage"
;
String
viewKey
=
userId
+
":homepage"
;
if
(
dto
.
getPage
()
==
1
)
{
if
(
dto
.
getPage
()
==
1
)
{
redisUtils
.
delete
(
viewKey
);
if
(
redisUtils
.
hasKey
(
viewKey
))
{
redisUtils
.
delete
(
viewKey
);
}
}
}
if
(
redisUtils
.
hasKey
(
viewKey
))
{
if
(
redisUtils
.
hasKey
(
viewKey
))
{
List
<
Long
>
searchItemIds
=
(
List
<
Long
>)
redisUtils
.
get
(
viewKey
);
List
<
Long
>
searchItemIds
=
(
List
<
Long
>)
redisUtils
.
get
(
viewKey
);
...
@@ -1165,9 +1167,9 @@ public class SupplierItemServiceImpl implements SupplierItemService {
...
@@ -1165,9 +1167,9 @@ public class SupplierItemServiceImpl implements SupplierItemService {
if
(
redisUtils
.
hasKey
(
viewKey
))
{
if
(
redisUtils
.
hasKey
(
viewKey
))
{
List
<
Long
>
searchItemIds
=
(
List
<
Long
>)
redisUtils
.
get
(
viewKey
);
List
<
Long
>
searchItemIds
=
(
List
<
Long
>)
redisUtils
.
get
(
viewKey
);
searchItemIds
.
addAll
(
filterItemIds
);
searchItemIds
.
addAll
(
filterItemIds
);
redisUtils
.
set
(
viewKey
,
searchItemIds
);
redisUtils
.
set
(
viewKey
,
searchItemIds
,
60
*
60
*
2
);
}
else
{
}
else
{
redisUtils
.
set
(
viewKey
,
filterItemIds
);
redisUtils
.
set
(
viewKey
,
filterItemIds
,
60
*
60
*
2
);
}
}
Date
now
=
new
Date
();
Date
now
=
new
Date
();
supplierItemList
.
forEach
(
supplierItem
->
{
supplierItemList
.
forEach
(
supplierItem
->
{
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/job/SendMsgFromExcelJob.java
View file @
f9a9280e
...
@@ -46,8 +46,8 @@ public class SendMsgFromExcelJob {
...
@@ -46,8 +46,8 @@ public class SendMsgFromExcelJob {
@Value
(
"${spring.profiles.active}"
)
@Value
(
"${spring.profiles.active}"
)
private
String
env
;
private
String
env
;
// 每年8月
8日晚上8
点执行一次
// 每年8月
12日晚上19
点执行一次
// @Scheduled(cron = "0 0 20 8
8 ?")
@Scheduled
(
cron
=
"0 0 19 12
8 ?"
)
public
void
executeTask
()
{
public
void
executeTask
()
{
if
(
"dev"
.
equals
(
env
))
{
if
(
"dev"
.
equals
(
env
))
{
logger
.
info
(
">>>>>>>>>>>>>>>>>>>>>>> dev环境, 不执行给指定类目用户发送通知任务<<<<<<<<<<<<<<<<<<<<<"
);
logger
.
info
(
">>>>>>>>>>>>>>>>>>>>>>> dev环境, 不执行给指定类目用户发送通知任务<<<<<<<<<<<<<<<<<<<<<"
);
...
@@ -60,7 +60,7 @@ public class SendMsgFromExcelJob {
...
@@ -60,7 +60,7 @@ public class SendMsgFromExcelJob {
}
}
logger
.
info
(
">>>>>>>>>>>> sendMsgFromExcel 开始执行 <<<<<<<<<<<<"
);
logger
.
info
(
">>>>>>>>>>>> sendMsgFromExcel 开始执行 <<<<<<<<<<<<"
);
try
{
try
{
String
key
=
"
xmly:sendMsgFromExcel:0808
"
;
String
key
=
"
cx:sendMsgFromExcel:0812
"
;
Date
now
=
new
Date
();
Date
now
=
new
Date
();
if
(
redisUtils
.
hasKey
(
key
))
{
if
(
redisUtils
.
hasKey
(
key
))
{
String
msg
=
"给指定类目用户发送通知任务正在重复执行"
;
String
msg
=
"给指定类目用户发送通知任务正在重复执行"
;
...
@@ -68,7 +68,7 @@ public class SendMsgFromExcelJob {
...
@@ -68,7 +68,7 @@ public class SendMsgFromExcelJob {
logger
.
info
(
">>>>>>>>>>>> sendMsgFromExcel 已经执行过了 <<<<<<<<<<<<"
);
logger
.
info
(
">>>>>>>>>>>> sendMsgFromExcel 已经执行过了 <<<<<<<<<<<<"
);
return
;
return
;
}
}
String
fileName
=
"
喜马拉雅品类用户手机号
.xlsx"
;
String
fileName
=
"
沉香短信表
.xlsx"
;
InputStream
inputStream
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
fileName
);
InputStream
inputStream
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
fileName
);
StringArrayExcelReadListener
listener
=
new
StringArrayExcelReadListener
();
StringArrayExcelReadListener
listener
=
new
StringArrayExcelReadListener
();
ExcelReader
reader
=
EasyExcelFactory
.
read
(
inputStream
,
listener
).
build
();
ExcelReader
reader
=
EasyExcelFactory
.
read
(
inputStream
,
listener
).
build
();
...
@@ -78,17 +78,20 @@ public class SendMsgFromExcelJob {
...
@@ -78,17 +78,20 @@ public class SendMsgFromExcelJob {
List
<
String
>
head
=
listener
.
getHead
();
List
<
String
>
head
=
listener
.
getHead
();
logger
.
info
(
"excel title = {}"
,
head
);
logger
.
info
(
"excel title = {}"
,
head
);
List
<
List
<
String
>>
dataList
=
listener
.
getData
();
List
<
List
<
String
>>
dataList
=
listener
.
getData
();
logger
.
info
(
">>>>>>>>>>
喜马拉雅
类目 excel 读取数据 : {} 条"
,
dataList
.
size
());
logger
.
info
(
">>>>>>>>>>
沉香
类目 excel 读取数据 : {} 条"
,
dataList
.
size
());
dataList
.
stream
().
forEach
(
row
->
{
dataList
.
stream
().
forEach
(
row
->
{
String
phone
=
row
.
get
(
0
);
String
phone
=
row
.
get
(
0
);
String
url
=
wxAppletApi
.
getUrlLink
(
CommConsts
.
ITEM_OF_GROUPPURCHASE_URL
,
"itemId="
+
32894809
);
String
url
=
wxAppletApi
.
getUrlLink
(
CommConsts
.
SPECIAL_PERFORMANCE_URL
,
"specialId="
+
28
+
"&k=sms"
);
//发短信
//发短信
String
msg
=
"
藏传手绘黄财神小唐卡开启众筹
啦,请前往"
+
url
+
"查看"
;
String
msg
=
"
万香之王·沉香高货专场开始
啦,请前往"
+
url
+
"查看"
;
aliSmsSender
.
sendSms
(
phone
,
msg
);
aliSmsSender
.
sendSms
(
phone
,
msg
);
logger
.
info
(
"手机号: {},
喜马拉雅
类目, 发送短信成功"
,
phone
);
logger
.
info
(
"手机号: {},
沉香
类目, 发送短信成功"
,
phone
);
});
});
String
successMsg
=
"给指定类目用户发送通知执行完成"
;
String
successMsg
=
"给指定类目用户发送通知执行完成"
;
aliSmsSender
.
sendSms
(
"15757185512"
,
successMsg
);
//发短信
String
url
=
wxAppletApi
.
getUrlLink
(
CommConsts
.
SPECIAL_PERFORMANCE_URL
,
"specialId="
+
28
+
"&k=sms"
);
String
msg
=
"万香之王·沉香高货专场开始啦,请前往"
+
url
+
"查看"
;
aliSmsSender
.
sendSms
(
"15757185512"
,
msg
);
redisUtils
.
set
(
key
,
now
,
3600
*
24
);
redisUtils
.
set
(
key
,
now
,
3600
*
24
);
logger
.
info
(
">>>>>>>>>>>> sendMsgFromExcel 发送通知给指定用户定时任务执行完成 <<<<<<<<<<<<"
);
logger
.
info
(
">>>>>>>>>>>> sendMsgFromExcel 发送通知给指定用户定时任务执行完成 <<<<<<<<<<<<"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
ch-wx-api/src/main/resources/喜马拉雅品类用户手机号.xlsx
deleted
100644 → 0
View file @
d14e02e3
File deleted
ch-wx-api/src/main/resources/沉香短信表.xlsx
0 → 100644
View file @
f9a9280e
File added
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/LogisticsApiTest.java
View file @
f9a9280e
...
@@ -3,6 +3,7 @@ package com.wwdz.ch.wx.api;
...
@@ -3,6 +3,7 @@ package com.wwdz.ch.wx.api;
import
com.wwdz.ch.core.api.LogisticsApi
;
import
com.wwdz.ch.core.api.LogisticsApi
;
import
com.wwdz.ch.core.entity.LogisticsRequestDto
;
import
com.wwdz.ch.core.entity.LogisticsRequestDto
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.wx.job.SendMsgFromExcelJob
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -21,6 +22,9 @@ public class LogisticsApiTest {
...
@@ -21,6 +22,9 @@ public class LogisticsApiTest {
@Autowired
@Autowired
LogisticsApi
logisticsApi
;
LogisticsApi
logisticsApi
;
@Autowired
SendMsgFromExcelJob
sendMsgFromExcelJob
;
@Test
@Test
public
void
findTrails
()
{
public
void
findTrails
()
{
...
@@ -30,4 +34,10 @@ public class LogisticsApiTest {
...
@@ -30,4 +34,10 @@ public class LogisticsApiTest {
Result
result
=
logisticsApi
.
findTrails
(
dto
);
Result
result
=
logisticsApi
.
findTrails
(
dto
);
logger
.
info
(
"物流轨迹: {}"
+
result
);
logger
.
info
(
"物流轨迹: {}"
+
result
);
}
}
@Test
public
void
test
()
{
sendMsgFromExcelJob
.
executeTask
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment