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
5ec2a8d4
Commit
5ec2a8d4
authored
Dec 28, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
在订单结束前30分钟进行保洁消息通知
parent
e3121473
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
4 deletions
+36
-4
RedisTask.java
share-quartz/src/main/java/share/quartz/task/RedisTask.java
+27
-3
SConsumerService.java
.../src/main/java/share/system/service/SConsumerService.java
+2
-0
SCleanRecordsServiceImpl.java
...a/share/system/service/impl/SCleanRecordsServiceImpl.java
+1
-1
SConsumerServiceImpl.java
.../java/share/system/service/impl/SConsumerServiceImpl.java
+6
-0
No files found.
share-quartz/src/main/java/share/quartz/task/RedisTask.java
View file @
5ec2a8d4
...
...
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.json.JSONObject
;
import
com.dianping.openapi.sdk.api.oauth.entity.CustomerRefreshTokenResponse
;
import
com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
...
...
@@ -17,6 +18,7 @@ import share.system.domain.Device;
import
share.system.domain.SOrder
;
import
share.system.domain.SRoom
;
import
share.system.domain.SStore
;
import
share.system.mapper.SConsumerMapper
;
import
share.system.service.*
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -60,6 +62,14 @@ public class RedisTask {
@Autowired
private
ISOrderService
orderService
;
@Autowired
private
SConsumerService
sConsumerService
;
//30分钟的常量
final
long
THIRTY_MINUTES
=
60
*
30
;
//29分钟的常量
final
long
THIRTY_NINE_MINUTES
=
60
*
29
;
//15分钟的常量
final
long
FIFTEEN_MINUTES
=
60
*
15
;
//14分钟的常量
...
...
@@ -68,6 +78,8 @@ public class RedisTask {
final
long
FIVE_MINUTES
=
60
*
5
;
//4分钟的常量
final
long
FOUR_MINUTES
=
60
*
4
;
//3分钟的常量
final
long
THREE_MINUTES
=
60
*
3
;
public
void
AuToReceiptCode
()
{
...
...
@@ -117,14 +129,26 @@ public class RedisTask {
String
value
=
redisUtil
.
get
(
String
.
valueOf
(
o
));
JSONObject
jsonObject
=
new
JSONObject
(
value
);
Date
expirationTime
=
jsonObject
.
getDate
(
"expirationTime"
);
//判断时间是否在15分钟到14分钟
SOrder
byOrderNo
=
orderService
.
getByOrderNo
(
jsonObject
.
getStr
(
"orderNo"
));
long
expire
=
(
expirationTime
.
getTime
()
-
new
Date
().
getTime
())
/
1000
;
//订单结束前30分钟,发送保洁消息
if
(
expire
<
THIRTY_MINUTES
&&
expire
>
THIRTY_NINE_MINUTES
)
{
SStore
store
=
storeService
.
getById
(
byOrderNo
.
getStoreId
());
SRoom
room
=
roomService
.
getById
(
byOrderNo
.
getRoomId
());
sConsumerService
.
selectListByStoreId
(
byOrderNo
.
getStoreId
()).
stream
().
forEach
(
item
->
{
// 循环发送短信提示门店保洁打扫卫生
smsService
.
sendSmsCleanRecords
(
item
.
getPhone
(),
store
,
room
);
});
}
//判断时间是否在15分钟到14分钟
if
(
expire
<
FIFTEEN_MINUTES
&&
expire
>
FOURTEEN_MINUTES
)
{
//语音
getResult
(
o
,
jsonObject
,
VoiceEnum
.
RENEWAL_REMINDER1
.
getCode
());
SOrder
byOrderNo
=
orderService
.
getByOrderNo
(
jsonObject
.
getStr
(
"orderNo"
));
SStore
sStore
=
storeService
.
getById
(
byOrderNo
.
getStoreId
());
SRoom
sRoom
=
roomService
.
getById
(
byOrderNo
.
getRoomId
());
// smsService.sendSmsCleanRecordsRemind15(byOrderNo.getConsumerPhone(), sStore, sRoom);
smsService
.
sendSmsOrderEndRemind
(
byOrderNo
.
getConsumerPhone
(),
sStore
,
sRoom
);
return
;
}
...
...
@@ -181,7 +205,7 @@ public class RedisTask {
DateUtil
.
format
(
new
Date
(),
DatePattern
.
NORM_DATETIME_PATTERN
),
DateUtil
.
format
(
DateUtil
.
offsetMinute
(
new
Date
(),
1
),
DatePattern
.
NORM_DATETIME_PATTERN
),
"1"
);
//延时5分钟断电
deviceOpService
.
openOrCloseDevice
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
true
,
FIV
E_MINUTES
);
deviceOpService
.
openOrCloseDevice
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
true
,
THRE
E_MINUTES
);
}
}
});
...
...
share-system/src/main/java/share/system/service/SConsumerService.java
View file @
5ec2a8d4
...
...
@@ -122,4 +122,6 @@ public interface SConsumerService extends IService<SConsumer>
int
addCleanConsumer
(
SConsumer
sConsumer
);
int
deleteCleanConsumerByIds
(
Long
[]
ids
);
public
List
<
SConsumer
>
selectListByStoreId
(
Long
storeId
);
}
share-system/src/main/java/share/system/service/impl/SCleanRecordsServiceImpl.java
View file @
5ec2a8d4
...
...
@@ -143,7 +143,7 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
if
(
b
)
{
SStore
store
=
sStoreMapper
.
selectSStoreById
(
storeId
);
SRoom
room
=
sRoomMapper
.
selectSRoomById
(
roomId
);
sendSms
(
storeId
,
store
,
room
);
//
sendSms(storeId,store,room);
}
return
b
;
}
...
...
share-system/src/main/java/share/system/service/impl/SConsumerServiceImpl.java
View file @
5ec2a8d4
...
...
@@ -105,6 +105,7 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
return
baseMapper
.
deleteSConsumerByIds
(
ids
);
}
/**
* 删除会员用户信息
*
...
...
@@ -221,6 +222,11 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
return
baseMapper
.
selectUnallocatedList
(
sConsumer
);
}
public
List
<
SConsumer
>
selectListByStoreId
(
Long
storeId
)
{
return
baseMapper
.
selectListByStoreId
(
storeId
);
}
@Override
public
int
addCleanConsumer
(
SConsumer
sConsumer
)
{
LambdaQueryWrapper
<
SConsumer
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
...
...
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