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
9d34d6ce
Commit
9d34d6ce
authored
Feb 28, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
f3f93af5
bf6d268c
Show 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 @
9d34d6ce
...
...
@@ -15,6 +15,15 @@ public enum 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
()
{
return
code
;
}
...
...
share-system/src/main/java/share/system/service/impl/RoomStatusServiceImpl.java
View file @
9d34d6ce
...
...
@@ -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
){
vo
.
setStatus
(
RoomStatusEnum
.
FREE
.
getValue
());
checkIsDirtyRoom
(
vo
,
timeHourDate
,
store
,
cleanRecords
,
day
);
checkTimeHourToSysDate
(
vo
,
timeHourDate
,
day
,
finalNowTime
,
isToday
);
checkTimeHourToBusiness
(
vo
,
timeHourDate
,
store
,
day
);
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
){
if
(
Objects
.
isNull
(
vo
.
getEndHoldTime
())||
vo
.
getEndHoldTime
().
compareTo
(
date
)<
0
){
vo
.
setEndHoldTime
(
date
);
...
...
share-system/src/main/java/share/system/service/impl/SCleanRecordsServiceImpl.java
View file @
9d34d6ce
...
...
@@ -428,7 +428,7 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
public
SCleanRecords
lastCleanByRoomId
(
Long
roomId
)
{
LambdaQueryWrapper
<
SCleanRecords
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
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
);
if
(
CollectionUtils
.
isNotEmpty
(
records
)){
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