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
7b30ce2e
Commit
7b30ce2e
authored
Feb 04, 2024
by
YG8999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单开门添加未保洁房间不能开门
parent
9191f29f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+18
-0
No files found.
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
7b30ce2e
...
...
@@ -5,6 +5,7 @@ import java.math.RoundingMode;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
cn.hutool.core.date.DateField
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.util.ObjectUtil
;
...
...
@@ -1082,6 +1083,23 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if
(
DateUtils
.
addHours
(
sOrder
.
getPreStartDate
(),
Constants
.
OPEN_DOOR_AHEAD_HOUR_MINUS
).
compareTo
(
new
Date
())
>
0
)
{
throw
new
BaseException
(
"预约时间未到达,可提前"
+
Constants
.
OPEN_DOOR_AHEAD_HOUR
+
"小时进场,请耐心等候!"
);
}
// 判断房间是否脏房中
if
(
sRoomVo
.
getIsDirtyRoom
()
>
0
)
{
throw
new
BaseException
(
"当前房间未保洁,请等待!"
);
}
// 55分钟内是否有保洁记录
LambdaQueryWrapper
<
SCleanRecords
>
recordsQueryWrapper
=
new
LambdaQueryWrapper
<>();
recordsQueryWrapper
.
eq
(
SCleanRecords:
:
getRoomId
,
sOrder
.
getRoomId
());
recordsQueryWrapper
.
ge
(
SCleanRecords:
:
getCreateTime
,
cn
.
hutool
.
core
.
date
.
DateUtil
.
offset
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
date
(),
DateField
.
MINUTE
,
-
55
));
List
<
SCleanRecords
>
recordsList
=
cleanRecordsService
.
list
(
recordsQueryWrapper
);
if
(
recordsList
!=
null
&&
recordsList
.
size
()
>
0
)
{
SCleanRecords
records
=
recordsList
.
get
(
0
);
if
(
CleaningStatusEnum
.
CLEANED
.
getCode
().
equals
(
records
.
getStatus
()))
{
// 如果保洁状态未不是保洁中
throw
new
BaseException
(
"当前房间待保洁中,请等待!"
);
}
}
//更改订单状态,房间状态,开始时间,结束时间
sOrder
.
setStatus
(
OrderStatusEnum
.
INUSE
.
getCode
());
//计算预约开始和结束时间时长
...
...
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