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
34df0466
Commit
34df0466
authored
May 13, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改房间状态接口
parent
c713844a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
RoomStatusServiceImpl.java
...java/share/system/service/impl/RoomStatusServiceImpl.java
+16
-16
No files found.
share-system/src/main/java/share/system/service/impl/RoomStatusServiceImpl.java
View file @
34df0466
...
...
@@ -58,14 +58,10 @@ public class RoomStatusServiceImpl implements RoomStatusService {
SStore
store
=
storeService
.
getById
(
storeId
);
// 通过门店及房间查询指定日期T+1的订单
List
<
SOrder
>
orderList
=
orderService
.
listByRoomInfo
(
storeId
,
new
ArrayList
<
Long
>(){{
add
(
roomId
);}},
day
);
//去掉ID为orderId的订单
if
(
CollectionUtils
.
isNotEmpty
(
orderList
)
&&
Objects
.
nonNull
(
orderId
))
{
orderList
=
orderList
.
stream
().
filter
(
order
->
order
.
getId
().
compareTo
(
orderId
)
!=
0
).
collect
(
Collectors
.
toList
());
}
SCleanRecords
cleanRecords
=
cleanRecordsService
.
lastCleanByRoomId
(
roomId
);
SRoom
room
=
roomService
.
getById
(
roomId
);
List
<
RoomStatusVo
>
voList
=
generatorRoomStatusList
(
store
,
room
,
orderList
,
cleanRecords
,
day
,
orderType
,
user
);
voList
.
addAll
(
generatorRoomStatusList
(
store
,
room
,
orderList
,
cleanRecords
,
DateUtils
.
addDays
(
day
,
1
),
orderType
,
user
));
List
<
RoomStatusVo
>
voList
=
generatorRoomStatusList
(
store
,
room
,
orderList
,
cleanRecords
,
day
,
orderType
,
user
,
orderId
);
voList
.
addAll
(
generatorRoomStatusList
(
store
,
room
,
orderList
,
cleanRecords
,
DateUtils
.
addDays
(
day
,
1
),
orderType
,
user
,
orderId
));
return
voList
;
}
...
...
@@ -89,16 +85,14 @@ public class RoomStatusServiceImpl implements RoomStatusService {
List
<
RoomStatusVo
>
voList
=
new
ArrayList
<>();
Map
<
Long
,
SCleanRecords
>
finalCleanRecordMap
=
cleanRecordMap
;
roomList
.
stream
().
forEach
(
room
->
{
voList
.
addAll
(
generatorRoomStatusList
(
store
,
room
,
orderMap
.
get
(
room
.
getId
()),
finalCleanRecordMap
.
get
(
room
.
getId
()),
day
,
OrderTypeEnum
.
RESERVER
.
getCode
(),
user
));
voList
.
addAll
(
generatorRoomStatusList
(
store
,
room
,
orderMap
.
get
(
room
.
getId
()),
finalCleanRecordMap
.
get
(
room
.
getId
()),
DateUtils
.
addDays
(
day
,
1
),
OrderTypeEnum
.
RESERVER
.
getCode
(),
user
));
voList
.
addAll
(
generatorRoomStatusList
(
store
,
room
,
orderMap
.
get
(
room
.
getId
()),
finalCleanRecordMap
.
get
(
room
.
getId
()),
day
,
OrderTypeEnum
.
RESERVER
.
getCode
(),
user
,
null
));
voList
.
addAll
(
generatorRoomStatusList
(
store
,
room
,
orderMap
.
get
(
room
.
getId
()),
finalCleanRecordMap
.
get
(
room
.
getId
()),
DateUtils
.
addDays
(
day
,
1
),
OrderTypeEnum
.
RESERVER
.
getCode
(),
user
,
null
));
});
return
voList
;
}
private
List
<
RoomStatusVo
>
generatorRoomStatusList
(
SStore
store
,
SRoom
room
,
List
<
SOrder
>
orderList
,
SCleanRecords
cleanRecords
,
Date
day
,
Integer
orderType
,
SConsumer
user
){
private
List
<
RoomStatusVo
>
generatorRoomStatusList
(
SStore
store
,
SRoom
room
,
List
<
SOrder
>
orderList
,
SCleanRecords
cleanRecords
,
Date
day
,
Integer
orderType
,
SConsumer
user
,
Long
orderId
)
{
String
nowTime
=
"00:00"
;
Boolean
isAvailable
=
false
;
if
(
orderType
.
equals
(
OrderTypeEnum
.
RENEW
.
getCode
()))
{
...
...
@@ -151,20 +145,20 @@ public class RoomStatusServiceImpl implements RoomStatusService {
vo
.
setTimeHour
(
timeHour
);
vo
.
setIsAvailable
(
finalIsAvailable
);
Date
timeHourDate
=
DateUtils
.
parseDate
(
timeHour
);
setTimeHourStatus
(
vo
,
timeHourDate
,
store
,
room
,
finalOrderList
,
cleanRecords
,
dayStr
,
finalNowTime
,
isToday
,
orderType
,
user
);
setTimeHourStatus
(
vo
,
timeHourDate
,
store
,
room
,
finalOrderList
,
cleanRecords
,
dayStr
,
finalNowTime
,
isToday
,
orderType
,
user
,
orderId
);
voList
.
add
(
vo
);
});
return
voList
;
}
//设置时间段房间可预约状态(可预约:大于营业开始时间,小于营业结束时间,大于当前时间,当前时间没有订单)
private
void
setTimeHourStatus
(
RoomStatusVo
vo
,
Date
timeHourDate
,
SStore
store
,
SRoom
room
,
List
<
SOrder
>
orderList
,
SCleanRecords
cleanRecords
,
String
day
,
String
finalNowTime
,
Boolean
isToday
,
Integer
orderType
,
SConsumer
user
)
{
private
void
setTimeHourStatus
(
RoomStatusVo
vo
,
Date
timeHourDate
,
SStore
store
,
SRoom
room
,
List
<
SOrder
>
orderList
,
SCleanRecords
cleanRecords
,
String
day
,
String
finalNowTime
,
Boolean
isToday
,
Integer
orderType
,
SConsumer
user
,
Long
orderId
)
{
vo
.
setStatus
(
RoomStatusEnum
.
FREE
.
getValue
());
if
(
checkRoomUpShelf
(
vo
,
timeHourDate
,
room
))
{
checkIsDirtyRoom
(
vo
,
timeHourDate
,
store
,
cleanRecords
,
day
);
checkTimeHourToSysDate
(
vo
,
timeHourDate
,
day
,
finalNowTime
,
isToday
);
checkTimeHourToBusiness
(
vo
,
timeHourDate
,
store
,
day
);
checkTimeHourToOrder
(
vo
,
timeHourDate
,
orderList
,
cleanRecords
,
orderType
,
user
);
checkTimeHourToOrder
(
vo
,
timeHourDate
,
orderList
,
cleanRecords
,
orderType
,
user
,
orderId
);
}
}
...
...
@@ -284,7 +278,7 @@ public class RoomStatusServiceImpl implements RoomStatusService {
}
}
private
void
checkTimeHourToOrder
(
RoomStatusVo
vo
,
Date
timeHourDate
,
List
<
SOrder
>
orderList
,
SCleanRecords
cleanRecords
,
Integer
orderType
,
SConsumer
user
)
{
private
void
checkTimeHourToOrder
(
RoomStatusVo
vo
,
Date
timeHourDate
,
List
<
SOrder
>
orderList
,
SCleanRecords
cleanRecords
,
Integer
orderType
,
SConsumer
user
,
Long
orderId
)
{
// SConsumer user = consumerService.getInfo();
if
(
CollectionUtils
.
isNotEmpty
(
orderList
)){
orderList
.
stream
().
forEach
(
order
->
{
...
...
@@ -301,7 +295,13 @@ public class RoomStatusServiceImpl implements RoomStatusService {
orderEndDate
=
cleanRecords
.
getEndDate
();
}
}
else
{
orderEndDate
=
DateUtils
.
addMinutes
(
orderEndDate
,
Constants
.
ROOM_LOCK_DELAY_MINUTE
);
if
(!
ObjectUtils
.
isEmpty
(
orderId
))
{
if
(!
order
.
getId
().
equals
(
orderId
))
{
orderEndDate
=
DateUtils
.
addMinutes
(
orderEndDate
,
Constants
.
ROOM_LOCK_DELAY_MINUTE
);
}
}
else
{
orderEndDate
=
DateUtils
.
addMinutes
(
orderEndDate
,
Constants
.
ROOM_LOCK_DELAY_MINUTE
);
}
}
orderStartDate
=
DateUtils
.
addMinutes
(
orderStartDate
,
-
Constants
.
ROOM_LOCK_DELAY_MINUTE
);
}
...
...
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