Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_ht
Commits
76553aef
Commit
76553aef
authored
Dec 11, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加短信发送接口
parent
0e6ee4c2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
1 deletions
+35
-1
OrderTask.java
share-quartz/src/main/java/share/quartz/task/OrderTask.java
+20
-1
RedisTask.java
share-quartz/src/main/java/share/quartz/task/RedisTask.java
+14
-0
SStoreServiceImpl.java
...ain/java/share/system/service/impl/SStoreServiceImpl.java
+1
-0
No files found.
share-quartz/src/main/java/share/quartz/task/OrderTask.java
View file @
76553aef
...
...
@@ -7,6 +7,7 @@ import cn.hutool.core.util.ObjectUtil;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONObject
;
import
lombok.extern.slf4j.Slf4j
;
import
org.bouncycastle.util.Store
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -66,12 +67,22 @@ public class OrderTask {
@Autowired
private
WechatNewService
wechatNewService
;
@Autowired
private
SmsService
smsService
;
@Autowired
private
ISStoreService
storeService
;
final
int
ZERO
=
0
;
//10分钟的常量
final
long
TEN_MINUTES
=
60
*
10
;
//9分钟的常量
final
long
NINE_MINUTES
=
60
*
9
;
//15分钟的常量
final
long
FIFTEEN_MINUTES
=
60
*
15
;
//14分钟的常量
final
long
FOURTEEN_MINUTES
=
60
*
14
;
public
void
autoCancel
()
{
...
...
@@ -230,11 +241,19 @@ public class OrderTask {
Date
expirationTime
=
jsonObject
.
getDate
(
"expirationTime"
);
String
orderNo
=
jsonObject
.
getStr
(
"orderNo"
);
//时间到期前10分钟到9分
//
long expire = (expirationTime.getTime() - new Date().getTime()) / 1000;
long
expire
=
(
expirationTime
.
getTime
()
-
new
Date
().
getTime
())
/
1000
;
// if (expire < TEN_MINUTES && expire > NINE_MINUTES) {
// SOrder byOrderNo = orderService.getByOrderNo(String.valueOf(orderNo));
// wechatNewService.sendMiniSubscribeMessage(byOrderNo, MessageReminderEnum.RESERVER);
// }
//判断时间是否在15分钟到14分钟
if
(
expire
<
FIFTEEN_MINUTES
&&
expire
>
FOURTEEN_MINUTES
)
{
SOrder
byOrderNo
=
orderService
.
getByOrderNo
(
String
.
valueOf
(
orderNo
));
SStore
sStore
=
storeService
.
getById
(
byOrderNo
.
getStoreId
());
SRoom
sRoom
=
roomService
.
getById
(
byOrderNo
.
getRoomId
());
smsService
.
sendSmsOrderStartRemind
(
byOrderNo
.
getConsumerPhone
(),
sStore
,
sRoom
);
return
;
}
if
(
expirationTime
.
getTime
()
<
new
Date
().
getTime
())
{
sOrders
.
add
(
orderService
.
getByOrderNo
(
String
.
valueOf
(
orderNo
)));
}
...
...
share-quartz/src/main/java/share/quartz/task/RedisTask.java
View file @
76553aef
...
...
@@ -16,6 +16,7 @@ import share.common.exception.base.BaseException;
import
share.system.domain.Device
;
import
share.system.domain.SOrder
;
import
share.system.domain.SRoom
;
import
share.system.domain.SStore
;
import
share.system.service.*
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -50,6 +51,15 @@ public class RedisTask {
@Autowired
private
WechatNewService
wechatNewService
;
@Autowired
private
SmsService
smsService
;
@Autowired
private
ISStoreService
storeService
;
@Autowired
private
ISOrderService
orderService
;
//15分钟的常量
final
long
FIFTEEN_MINUTES
=
60
*
15
;
//14分钟的常量
...
...
@@ -112,6 +122,10 @@ public class RedisTask {
if
(
expire
<
FIFTEEN_MINUTES
&&
expire
>
FOURTEEN_MINUTES
)
{
//语音
getResult
(
o
,
jsonObject
,
VoiceEnum
.
RENEWAL_REMINDER1
.
getCode
());
SOrder
byOrderNo
=
orderService
.
getByOrderNo
(
String
.
valueOf
(
o
));
SStore
sStore
=
storeService
.
getById
(
byOrderNo
.
getStoreId
());
SRoom
sRoom
=
roomService
.
getById
(
byOrderNo
.
getRoomId
());
smsService
.
sendSmsOrderEndRemind
(
byOrderNo
.
getConsumerPhone
(),
sStore
,
sRoom
);
return
;
}
//判断时间是否在5分钟到4分钟
...
...
share-system/src/main/java/share/system/service/impl/SStoreServiceImpl.java
View file @
76553aef
...
...
@@ -279,6 +279,7 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
List
<
SRoomVo
>
roomVoList1
=
roomVoListMap
.
get
(
voList
.
get
(
i
).
getId
());
if
(
CollectionUtils
.
isEmpty
(
roomVoList1
))
{
voList
.
remove
(
i
);
i
=
-
1
;
}
else
{
voList
.
get
(
i
).
setRoomVoList
(
roomVoList1
);
}
...
...
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