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
9d50bd7d
Commit
9d50bd7d
authored
Nov 18, 2023
by
wuwenlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
room status opt;
parent
33261ee5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
RoomStatusServiceImpl.java
...java/share/system/service/impl/RoomStatusServiceImpl.java
+17
-9
No files found.
share-system/src/main/java/share/system/service/impl/RoomStatusServiceImpl.java
View file @
9d50bd7d
...
...
@@ -15,6 +15,8 @@ import share.system.domain.vo.RoomStatusVo;
import
share.system.service.ISOrderService
;
import
share.system.service.ISStoreService
;
import
share.system.service.RoomStatusService
;
import
share.system.service.SConsumerService
;
import
java.util.*
;
/**
...
...
@@ -33,9 +35,15 @@ public class RoomStatusServiceImpl implements RoomStatusService {
@Autowired
private
ISOrderService
orderService
;
@Autowired
private
SConsumerService
consumerService
;
@Override
public
List
<
RoomStatusVo
>
roomStatus
(
Long
storeId
,
Long
roomId
,
Date
day
)
{
SConsumer
user
=
consumerService
.
getInfo
();
if
(
user
!=
null
){
FrontTokenComponent
.
loginSConsumerEntryThreadLocal
.
set
(
user
);
}
//查询门店营业时间
SStore
store
=
storeService
.
getById
(
storeId
);
// 通过门店及房间查询指定日期T+1的订单
...
...
@@ -135,21 +143,21 @@ public class RoomStatusServiceImpl implements RoomStatusService {
if
(
DateUtils
.
addSeconds
(
timeHourDate
,
59
*
60
+
59
).
compareTo
(
orderStartDate
)
>=
0
&&
timeHourDate
.
compareTo
(
orderEndDate
)
<
0
)
{
vo
.
setStatus
(
RoomStatusEnum
.
HOLD
.
getValue
());
//判断订单开始时间是否是同一个小时,如果是同一个小时,占用
结束
时间为订单开始时间
//判断订单开始时间是否是同一个小时,如果是同一个小时,占用
开始
时间为订单开始时间
if
(
StringUtils
.
equals
(
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH
,
timeHourDate
)
,
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH
,
orderStartDate
))){
vo
.
set
End
HoldTime
(
orderStartDate
);
vo
.
set
Start
HoldTime
(
orderStartDate
);
}
else
{
//占用
结束时间为当前时段59分59
秒
vo
.
set
EndHoldTime
(
DateUtils
.
addSeconds
(
timeHourDate
,
59
*
60
+
59
)
);
//占用
开始时间为当前时段0分0
秒
vo
.
set
StartHoldTime
(
timeHourDate
);
}
//判断订单结束时间是否是同一个小时,如果是同一个小时,占用
开始
时间为订单结束时间
//判断订单结束时间是否是同一个小时,如果是同一个小时,占用
结束
时间为订单结束时间
if
(
StringUtils
.
equals
(
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH
,
timeHourDate
)
,
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH
,
order
Start
Date
))){
vo
.
set
Start
HoldTime
(
orderEndDate
);
,
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH
,
order
End
Date
))){
vo
.
set
End
HoldTime
(
orderEndDate
);
}
else
{
//占用
开始时间为当前时段0分0
秒
vo
.
set
StartHoldTime
(
timeHourDate
);
//占用
结束时间为当前时段59分59
秒
vo
.
set
EndHoldTime
(
DateUtils
.
addSeconds
(
timeHourDate
,
59
*
60
+
59
)
);
}
}
});
...
...
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