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
b8ae7060
Commit
b8ae7060
authored
Feb 28, 2024
by
wuwenlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
脏房到次日门店保洁时段锁定房间状态不可预定,如果没有设置门店保洁时段则只锁定当日
parent
2f52bd75
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
2 deletions
+39
-2
CleaningStatusEnum.java
.../src/main/java/share/common/enums/CleaningStatusEnum.java
+9
-0
RoomStatusServiceImpl.java
...java/share/system/service/impl/RoomStatusServiceImpl.java
+29
-1
SCleanRecordsServiceImpl.java
...a/share/system/service/impl/SCleanRecordsServiceImpl.java
+1
-1
No files found.
share-common/src/main/java/share/common/enums/CleaningStatusEnum.java
View file @
b8ae7060
...
@@ -15,6 +15,15 @@ public enum CleaningStatusEnum {
...
@@ -15,6 +15,15 @@ public enum CleaningStatusEnum {
CleaningStatusEnum
()
{
CleaningStatusEnum
()
{
}
}
public
static
CleaningStatusEnum
getEnumByCode
(
Integer
code
)
{
for
(
CleaningStatusEnum
status
:
CleaningStatusEnum
.
values
())
{
if
(
status
.
getCode
().
compareTo
(
code
)==
0
)
{
return
status
;
}
}
return
null
;
}
public
Integer
getCode
()
{
public
Integer
getCode
()
{
return
code
;
return
code
;
}
}
...
...
share-system/src/main/java/share/system/service/impl/RoomStatusServiceImpl.java
View file @
b8ae7060
...
@@ -120,12 +120,40 @@ public class RoomStatusServiceImpl implements RoomStatusService {
...
@@ -120,12 +120,40 @@ public class RoomStatusServiceImpl implements RoomStatusService {
//设置时间段房间可预约状态(可预约:大于营业开始时间,小于营业结束时间,大于当前时间,当前时间没有订单)
//设置时间段房间可预约状态(可预约:大于营业开始时间,小于营业结束时间,大于当前时间,当前时间没有订单)
private
void
setTimeHourStatus
(
RoomStatusVo
vo
,
Date
timeHourDate
,
SStore
store
,
List
<
SOrder
>
orderList
,
SCleanRecords
cleanRecords
,
String
day
,
String
finalNowTime
,
Boolean
isToday
,
Integer
orderType
,
SConsumer
user
){
private
void
setTimeHourStatus
(
RoomStatusVo
vo
,
Date
timeHourDate
,
SStore
store
,
List
<
SOrder
>
orderList
,
SCleanRecords
cleanRecords
,
String
day
,
String
finalNowTime
,
Boolean
isToday
,
Integer
orderType
,
SConsumer
user
){
vo
.
setStatus
(
RoomStatusEnum
.
FREE
.
getValue
());
vo
.
setStatus
(
RoomStatusEnum
.
FREE
.
getValue
());
checkIsDirtyRoom
(
vo
,
timeHourDate
,
store
,
cleanRecords
,
day
);
checkTimeHourToSysDate
(
vo
,
timeHourDate
,
day
,
finalNowTime
,
isToday
);
checkTimeHourToSysDate
(
vo
,
timeHourDate
,
day
,
finalNowTime
,
isToday
);
checkTimeHourToBusiness
(
vo
,
timeHourDate
,
store
,
day
);
checkTimeHourToBusiness
(
vo
,
timeHourDate
,
store
,
day
);
checkTimeHourToOrder
(
vo
,
timeHourDate
,
orderList
,
cleanRecords
,
orderType
,
user
);
checkTimeHourToOrder
(
vo
,
timeHourDate
,
orderList
,
cleanRecords
,
orderType
,
user
);
}
}
private
void
checkIsDirtyRoom
(
RoomStatusVo
vo
,
Date
timeHourDate
,
SStore
store
,
SCleanRecords
cleanRecords
,
String
day
){
CleaningStatusEnum
cleaningStatusEnum
=
CleaningStatusEnum
.
getEnumByCode
(
cleanRecords
.
getStatus
());
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
(
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
));
}
}
break
;
case
CLEANED:
break
;
default
:
break
;
}
}
private
void
changeEndHoldTime
(
RoomStatusVo
vo
,
Date
date
){
private
void
changeEndHoldTime
(
RoomStatusVo
vo
,
Date
date
){
if
(
Objects
.
isNull
(
vo
.
getEndHoldTime
())||
vo
.
getEndHoldTime
().
compareTo
(
date
)<
0
){
if
(
Objects
.
isNull
(
vo
.
getEndHoldTime
())||
vo
.
getEndHoldTime
().
compareTo
(
date
)<
0
){
vo
.
setEndHoldTime
(
date
);
vo
.
setEndHoldTime
(
date
);
...
...
share-system/src/main/java/share/system/service/impl/SCleanRecordsServiceImpl.java
View file @
b8ae7060
...
@@ -428,7 +428,7 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
...
@@ -428,7 +428,7 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
public
SCleanRecords
lastCleanByRoomId
(
Long
roomId
)
{
public
SCleanRecords
lastCleanByRoomId
(
Long
roomId
)
{
LambdaQueryWrapper
<
SCleanRecords
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
SCleanRecords
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SCleanRecords:
:
getRoomId
,
roomId
);
queryWrapper
.
eq
(
SCleanRecords:
:
getRoomId
,
roomId
);
queryWrapper
.
gt
(
SCleanRecords:
:
getCreateTime
,
DateUtils
.
addDays
(
new
Date
(),-
1
));
queryWrapper
.
gt
(
SCleanRecords:
:
getCreateTime
,
DateUtils
.
addDays
(
new
Date
(),-
7
));
List
<
SCleanRecords
>
records
=
list
(
queryWrapper
);
List
<
SCleanRecords
>
records
=
list
(
queryWrapper
);
if
(
CollectionUtils
.
isNotEmpty
(
records
)){
if
(
CollectionUtils
.
isNotEmpty
(
records
)){
Optional
<
SCleanRecords
>
cleanRecords
=
records
.
stream
().
max
(
Comparator
.
comparing
(
SCleanRecords:
:
getCreateTime
));
Optional
<
SCleanRecords
>
cleanRecords
=
records
.
stream
().
max
(
Comparator
.
comparing
(
SCleanRecords:
:
getCreateTime
));
...
...
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