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
4dfba59d
Commit
4dfba59d
authored
Sep 05, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改定时任务,房间状态
parent
ecd35dd7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
RedisTask.java
share-quartz/src/main/java/share/quartz/task/RedisTask.java
+8
-5
RoomStatusServiceImpl.java
...java/share/system/service/impl/RoomStatusServiceImpl.java
+6
-3
No files found.
share-quartz/src/main/java/share/quartz/task/RedisTask.java
View file @
4dfba59d
...
@@ -19,7 +19,6 @@ import org.slf4j.Logger;
...
@@ -19,7 +19,6 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.security.core.parameters.P
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -328,13 +327,13 @@ public class RedisTask {
...
@@ -328,13 +327,13 @@ public class RedisTask {
redisUtil
.
delete
(
o
);
redisUtil
.
delete
(
o
);
throw
new
BaseException
(
"订单不存在!"
);
throw
new
BaseException
(
"订单不存在!"
);
}
}
if
(
extracted
(
o
,
sOrders
,
sOrder
))
return
;
//更改订单状态
sOrder
.
setStatus
(
OrderStatusEnum
.
USED
.
getCode
());
isOrderService
.
updateById
(
sOrder
);
//查询当前用户是否只有一个订单
//查询当前用户是否只有一个订单
LambdaQueryWrapper
<
SOrder
>
sOrderLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
SOrder
>
sOrderLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
sOrderLambdaQueryWrapper
.
eq
(
SOrder
::
getConsumerId
,
sOrder
.
getConsumerId
());
sOrderLambdaQueryWrapper
.
eq
(
SOrder
::
getConsumerId
,
sOrder
.
getConsumerId
());
sOrderLambdaQueryWrapper
.
eq
(
SOrder:
:
getPayStatus
,
YesNoEnum
.
yes
.
getIndex
());
sOrderLambdaQueryWrapper
.
notIn
(
SOrder:
:
getRefundStatus
,
RefundStatusEnum
.
getRefundedStatus
());
sOrderLambdaQueryWrapper
.
in
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
getUnfinishOrderStatus
());
sOrderLambdaQueryWrapper
.
eq
(
SOrder:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
());
List
<
SOrder
>
sOrderList
=
isOrderService
.
list
(
sOrderLambdaQueryWrapper
);
List
<
SOrder
>
sOrderList
=
isOrderService
.
list
(
sOrderLambdaQueryWrapper
);
if
(
sOrderList
.
size
()
==
1
){
if
(
sOrderList
.
size
()
==
1
){
//查询是否有上级
//查询是否有上级
...
@@ -370,6 +369,10 @@ public class RedisTask {
...
@@ -370,6 +369,10 @@ public class RedisTask {
}
}
}
}
}
}
if
(
extracted
(
o
,
sOrders
,
sOrder
))
return
;
//更改订单状态
sOrder
.
setStatus
(
OrderStatusEnum
.
USED
.
getCode
());
isOrderService
.
updateById
(
sOrder
);
// 修改房间状态
// 修改房间状态
SRoom
room
=
roomService
.
getById
(
sOrder
.
getRoomId
());
SRoom
room
=
roomService
.
getById
(
sOrder
.
getRoomId
());
if
(
ObjectUtil
.
isNotEmpty
(
room
))
{
if
(
ObjectUtil
.
isNotEmpty
(
room
))
{
...
...
share-system/src/main/java/share/system/service/impl/RoomStatusServiceImpl.java
View file @
4dfba59d
...
@@ -304,13 +304,16 @@ public class RoomStatusServiceImpl implements RoomStatusService {
...
@@ -304,13 +304,16 @@ public class RoomStatusServiceImpl implements RoomStatusService {
}
}
}
}
}
else
{
}
else
{
//
orderEndDate = DateUtils.addMinutes(orderEndDate, Constants.ROOM_LOCK_DELAY_MINUTE);
orderEndDate
=
DateUtils
.
addMinutes
(
orderEndDate
,
Constants
.
ROOM_LOCK_DELAY_MINUTE
);
orderEndDate
=
DateUtils
.
addMinutes
(
orderEndDate
,
Constants
.
ROMM_LOCK_LAZY_MINUTE
);
//
orderEndDate = DateUtils.addMinutes(orderEndDate, Constants.ROMM_LOCK_LAZY_MINUTE);
}
}
}
}
// orderStartDate = DateUtils.addMinutes(orderStartDate, -Constants.ROOM_LOCK_DELAY_MINUTE);
if
(
OrderTypeEnum
.
RESERVER
.
getCode
().
compareTo
(
orderType
)
==
0
)
{
orderStartDate
=
DateUtils
.
addMinutes
(
orderStartDate
,
-
Constants
.
ROOM_LOCK_DELAY_MINUTE
);
}
else
{
orderStartDate
=
DateUtils
.
addMinutes
(
orderStartDate
,
-
Constants
.
ROMM_LOCK_LAZY_MINUTE
);
orderStartDate
=
DateUtils
.
addMinutes
(
orderStartDate
,
-
Constants
.
ROMM_LOCK_LAZY_MINUTE
);
}
}
}
if
(
DateUtils
.
addSeconds
(
timeHourDate
,
59
*
60
+
59
).
compareTo
(
orderStartDate
)
>=
0
&&
timeHourDate
.
compareTo
(
orderEndDate
)
<=
0
)
{
if
(
DateUtils
.
addSeconds
(
timeHourDate
,
59
*
60
+
59
).
compareTo
(
orderStartDate
)
>=
0
&&
timeHourDate
.
compareTo
(
orderEndDate
)
<=
0
)
{
vo
.
setStatus
(
RoomStatusEnum
.
HOLD
.
getValue
());
vo
.
setStatus
(
RoomStatusEnum
.
HOLD
.
getValue
());
...
...
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