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
0e0655f1
Commit
0e0655f1
authored
Mar 03, 2024
by
wuwenlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
脏房到次日门店保洁时段锁定房间状态不可预定,如果没有设置门店保洁时段则只锁定当日
parent
0ead1888
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
RoomStatusServiceImpl.java
...java/share/system/service/impl/RoomStatusServiceImpl.java
+21
-10
No files found.
share-system/src/main/java/share/system/service/impl/RoomStatusServiceImpl.java
View file @
0e0655f1
...
...
@@ -24,6 +24,8 @@ public class RoomStatusServiceImpl implements RoomStatusService {
private
final
static
String
[]
LOCKS
=
{
"0"
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"10"
,
"11"
,
"12"
,
"13"
,
"14"
,
"15"
,
"16"
,
"17"
,
"18"
,
"19"
,
"20"
,
"21"
,
"22"
,
"23"
};
private
final
static
String
DefaultCleaningPeriod
=
"00:00"
;
@Autowired
private
ISStoreService
storeService
;
...
...
@@ -139,27 +141,31 @@ public class RoomStatusServiceImpl implements RoomStatusService {
}
private
void
checkIsDirtyRoom
(
RoomStatusVo
vo
,
Date
timeHourDate
,
SStore
store
,
SCleanRecords
cleanRecords
,
String
day
){
CleaningStatusEnum
cleaningStatusEnum
=
null
;
if
(
Objects
.
isNull
(
cleanRecords
))
{
return
;
}
cleaningStatusEnum
=
CleaningStatusEnum
.
getEnumByCode
(
cleanRecords
.
getStatus
());
String
cleaningPeriod
=
StringUtils
.
isNotBlank
(
store
.
getCleaningPeriod
())?
store
.
getCleaningPeriod
():
DefaultCleaningPeriod
;
CleaningStatusEnum
cleaningStatusEnum
=
CleaningStatusEnum
.
getEnumByCode
(
cleanRecords
.
getStatus
());
Boolean
isHold
=
false
;
switch
(
cleaningStatusEnum
){
case
UNCLEAN:
case
CLEANING:
//当天
if
(
StringUtils
.
equals
(
day
,
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD
,
DateUtils
.
getNowDate
()))){
vo
.
setStatus
(
RoomStatusEnum
.
HOLD
.
getValue
());
changeStartHoldTime
(
vo
,
timeHourDate
);
changeEndHoldTime
(
vo
,
DateUtils
.
addSeconds
(
timeHourDate
,
59
*
60
+
59
));
if
(
DateUtils
.
getNowDate
().
getTime
()
<
DateUtils
.
parseDate
(
day
+
" "
+
cleaningPeriod
).
getTime
())
{
if
(
timeHourDate
.
getTime
()
<
DateUtils
.
parseDate
(
day
+
" "
+
cleaningPeriod
).
getTime
())
{
isHold
=
true
;
}
}
else
{
isHold
=
true
;
}
}
//次日
if
(
StringUtils
.
equals
(
day
,
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD
,
DateUtils
.
addDays
(
DateUtils
.
getNowDate
(),
1
)))){
if
(
StringUtils
.
isNotBlank
(
store
.
getCleaningPeriod
())
&&
timeHourDate
.
getTime
()<
DateUtils
.
parseDate
(
day
+
" "
+
store
.
getCleaningPeriod
()).
getTime
()){
vo
.
setStatus
(
RoomStatusEnum
.
HOLD
.
getValue
());
changeStartHoldTime
(
vo
,
timeHourDate
);
changeEndHoldTime
(
vo
,
DateUtils
.
addSeconds
(
timeHourDate
,
59
*
60
+
59
));
if
(
DateUtils
.
getNowDate
().
getTime
()
>=
DateUtils
.
parseDate
(
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD
,
DateUtils
.
getNowDate
())+
" "
+
cleaningPeriod
).
getTime
()
&&
timeHourDate
.
getTime
()
<
DateUtils
.
parseDate
(
day
+
" "
+
cleaningPeriod
).
getTime
()){
isHold
=
true
;
}
}
break
;
...
...
@@ -168,6 +174,11 @@ public class RoomStatusServiceImpl implements RoomStatusService {
default
:
break
;
}
if
(
isHold
){
vo
.
setStatus
(
RoomStatusEnum
.
HOLD
.
getValue
());
changeStartHoldTime
(
vo
,
timeHourDate
);
changeEndHoldTime
(
vo
,
DateUtils
.
addSeconds
(
timeHourDate
,
59
*
60
+
59
));
}
}
private
void
changeEndHoldTime
(
RoomStatusVo
vo
,
Date
date
){
...
...
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