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
f7d476d0
Commit
f7d476d0
authored
Mar 26, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分享订单信息增加实际支付金额,修改续单逻辑
parent
b3f86d3f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
9 deletions
+71
-9
ReceiptRdeisEnum.java
...on/src/main/java/share/common/enums/ReceiptRdeisEnum.java
+2
-0
RedisTask.java
share-quartz/src/main/java/share/quartz/task/RedisTask.java
+46
-7
OrderVo.java
...-system/src/main/java/share/system/domain/vo/OrderVo.java
+3
-1
SCleanRecordsServiceImpl.java
...a/share/system/service/impl/SCleanRecordsServiceImpl.java
+0
-1
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+20
-0
No files found.
share-common/src/main/java/share/common/enums/ReceiptRdeisEnum.java
View file @
f7d476d0
...
...
@@ -10,6 +10,8 @@ public enum ReceiptRdeisEnum {
ORDER_NO
(
6
,
"ORDER_NO."
),
TIKTOK_CLIENT_TOKEN
(
7
,
"TIKTOK_CLIENT_TOKEN"
),
TIKTOK_CLIENT_TOKEN_KEY
(
8
,
"TIKTOK_CLIENT_TOKEN_KEY"
),
//房间15分钟过期
ROOM_EXPIRE_TIME
(
9
,
"ROOM_EXPIRE_TIME."
),
;
...
...
share-quartz/src/main/java/share/quartz/task/RedisTask.java
View file @
f7d476d0
...
...
@@ -28,10 +28,7 @@ import share.system.domain.*;
import
share.system.domain.vo.MqttxVo
;
import
share.system.service.*
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
...
...
@@ -89,8 +86,8 @@ public class RedisTask {
final
long
FIVE_MINUTES
=
60
*
5
;
//4分钟的常量
final
long
FOUR_MINUTES
=
60
*
4
;
//
3
分钟的常量
final
long
THREE_MINUTES
=
60
*
3
;
//
1
分钟的常量
final
long
ONE_MINUTES
=
60
;
/**
...
...
@@ -287,14 +284,56 @@ public class RedisTask {
DateUtil
.
format
(
DateUtil
.
offsetMinute
(
new
Date
(),
1
),
DatePattern
.
NORM_DATETIME_PATTERN
),
"1"
,
DeviceOpSourceEnum
.
DEVICE_SOURCE_20
.
getCode
());
//延时3分钟断电
deviceOpService
.
openOrCloseDevice
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
true
,
THREE_MINUTES
,
deviceOpService
.
openOrCloseDevice
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
false
,
0L
,
DeviceOpSourceEnum
.
DEVICE_SOURCE_20
.
getCode
());
//延时一分钟通电
deviceOpService
.
openOrCloseDevice
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
OpTypeEnum
.
GET_ELECTRIC
.
getCode
(),
true
,
ONE_MINUTES
,
DeviceOpSourceEnum
.
DEVICE_SOURCE_20
.
getCode
());
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"orderNo"
,
sOrder
.
getOrderNo
());
//当前时间加15分钟
Date
date
=
DateUtil
.
offsetMinute
(
new
Date
(),
15
);
map
.
put
(
"expirationTime"
,
date
.
toString
());
JSONObject
json
=
new
JSONObject
(
map
);
redisUtil
.
set
(
ReceiptRdeisEnum
.
ROOM_EXPIRE_TIME
.
getValue
()
+
sOrder
.
getOrderNo
(),
json
.
toString
());
logger
.
info
(
"订单号为:"
+
sOrder
.
getOrderNo
()
+
"的订单已结束,更改订单状态为已使用"
);
}
});
}
public
void
autoRoomExpireTime
()
{
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
ROOM_EXPIRE_TIME
.
getValue
()
+
"*"
);
if
(
keys
.
size
()
==
0
)
{
return
;
}
keys
.
stream
().
forEach
(
key
->
{
String
value
=
redisUtil
.
get
(
String
.
valueOf
(
key
));
JSONObject
jsonObject
=
new
JSONObject
(
value
);
Date
expirationTime
=
jsonObject
.
getDate
(
"expirationTime"
);
String
orderNo
=
jsonObject
.
getStr
(
"orderNo"
);
SOrder
sOrder
=
isOrderService
.
getOne
(
new
LambdaQueryWrapper
<
SOrder
>().
eq
(
SOrder:
:
getOrderNo
,
orderNo
));
if
(
expirationTime
.
getTime
()
>
new
Date
().
getTime
())
{
List
<
SOrder
>
orderList
=
orderService
.
list
(
new
LambdaQueryWrapper
<
SOrder
>()
.
eq
(
SOrder:
:
getRoomId
,
sOrder
.
getRoomId
())
.
eq
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
INUSE
.
getCode
())
.
eq
(
SOrder:
:
getOrderType
,
OrderTypeEnum
.
RENEW
.
getCode
())
);
if
(!
CollectionUtils
.
isEmpty
(
orderList
))
{
redisUtil
.
delete
(
key
);
}
}
else
{
SCleanRecords
sCleanRecords
=
isCleanRecordsService
.
getOne
(
new
LambdaQueryWrapper
<
SCleanRecords
>().
eq
(
SCleanRecords:
:
getRoomId
,
sOrder
.
getRoomId
()).
eq
(
SCleanRecords:
:
getStatus
,
CleaningStatusEnum
.
CLEANING
.
getCode
()));
if
(
ObjectUtils
.
isEmpty
(
sCleanRecords
))
{
deviceOpService
.
openOrCloseDevice
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
false
,
0L
,
DeviceOpSourceEnum
.
DEVICE_SOURCE_20
.
getCode
());
}
redisUtil
.
delete
(
key
);
}
});
}
private
boolean
extracted
(
String
o
,
List
<
SOrder
>
sOrders
,
SOrder
sOrder
)
{
List
<
SOrder
>
sOrders1
=
sOrders
.
stream
().
filter
(
item
->
item
.
getStoreId
().
equals
(
sOrder
.
getStoreId
())
&&
...
...
share-system/src/main/java/share/system/domain/vo/OrderVo.java
View file @
f7d476d0
package
share
.
system
.
domain
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.Date
;
@Data
...
...
@@ -105,5 +105,7 @@ public class OrderVo {
private
Integer
status
;
private
BigDecimal
payPrice
;
}
share-system/src/main/java/share/system/service/impl/SCleanRecordsServiceImpl.java
View file @
f7d476d0
...
...
@@ -455,7 +455,6 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
isCleaner
(
sCleanRecords
);
sCleanRecords
.
setEndDate
(
DateUtil
.
date
());
sCleanRecords
.
setStatus
(
CleaningStatusEnum
.
CLEANED
.
getCode
());
SRoom
sRoom
=
new
SRoom
();
SCleanRecords
records
=
baseMapper
.
selectSCleanRecordsById
(
sCleanRecords
.
getId
());
if
(
records
==
null
)
{
throw
new
RuntimeException
(
"当前保洁任务不存在!"
);
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
f7d476d0
...
...
@@ -871,8 +871,16 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
sOrder
.
setStartDate
(
sOrder
.
getPreStartDate
());
sOrder
.
setEndDate
(
sOrder
.
getPreEndDate
());
sOrder
.
setStatus
(
OrderStatusEnum
.
INUSE
.
getCode
());
if
(
room
.
getStatus
().
equals
(
RoomStatusEnum
.
FREE
.
getValue
()))
{
room
.
setStatus
(
RoomStatusEnum
.
HOLD
.
getValue
());
roomService
.
updateById
(
room
);
}
//支付金额为0的
if
(
request
.
getPayFee
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
SCleanRecords
sCleanRecords
=
isCleanRecordsService
.
getOne
(
new
LambdaQueryWrapper
<
SCleanRecords
>().
eq
(
SCleanRecords:
:
getRoomId
,
sOrder
.
getRoomId
()));
if
(
ObjectUtil
.
isNotEmpty
(
sCleanRecords
))
{
isCleanRecordsService
.
removeById
(
sCleanRecords
.
getId
());
}
wechatNewService
.
sendMiniSubscribeMessage
(
sOrder
,
MessageReminderEnum
.
RESERVER
);
if
(
response
.
getStatus
().
equals
(
YesNoEnum
.
yes
.
getFlag
()))
{
baseMapper
.
updateById
(
sOrder
);
...
...
@@ -1291,6 +1299,18 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
@Override
public
void
paymentSuccessful
(
SOrder
sOrder
)
{
if
(
sOrder
.
getOrderType
().
equals
(
OrderTypeEnum
.
RENEW
.
getCode
()))
{
SRoom
room
=
roomService
.
getById
(
sOrder
.
getRoomId
());
if
(
room
.
getStatus
().
equals
(
RoomStatusEnum
.
FREE
.
getValue
()))
{
room
.
setStatus
(
RoomStatusEnum
.
HOLD
.
getValue
());
roomService
.
updateById
(
room
);
}
SCleanRecords
sCleanRecords
=
isCleanRecordsService
.
getOne
(
new
LambdaQueryWrapper
<
SCleanRecords
>()
.
eq
(
SCleanRecords:
:
getRoomId
,
sOrder
.
getRoomId
())
.
ne
(
SCleanRecords:
:
getStatus
,
CleaningStatusEnum
.
CLEANED
.
getCode
())
);
if
(
ObjectUtil
.
isNotEmpty
(
sCleanRecords
))
{
isCleanRecordsService
.
removeById
(
sCleanRecords
.
getId
());
}
wechatNewService
.
sendMiniSubscribeMessage
(
sOrder
,
MessageReminderEnum
.
RESERVER
);
sOrder
.
setStartDate
(
sOrder
.
getPreStartDate
());
sOrder
.
setEndDate
(
sOrder
.
getPreEndDate
());
...
...
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