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
ab662090
Commit
ab662090
authored
Mar 26, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
房间开门增加限制,脏房不许开门
parent
08e1d8ce
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
27 deletions
+19
-27
OpenInterfaceServiceImpl.java
...a/share/system/service/impl/OpenInterfaceServiceImpl.java
+10
-13
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+9
-14
No files found.
share-system/src/main/java/share/system/service/impl/OpenInterfaceServiceImpl.java
View file @
ab662090
package
share
.
system
.
service
.
impl
;
import
cn.hutool.core.date.DateField
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.json.JSONObject
;
...
...
@@ -110,6 +109,15 @@ public class OpenInterfaceServiceImpl implements OpenInterfaceService {
).
collect
(
Collectors
.
toList
()).
isEmpty
())
{
throw
new
BaseException
(
"房间取电设备不存在!"
);
}
//当前房间是否有保洁任务
LambdaQueryWrapper
<
SCleanRecords
>
recordsQueryWrapper
=
new
LambdaQueryWrapper
<>();
recordsQueryWrapper
.
eq
(
SCleanRecords:
:
getRoomId
,
sOrder
.
getRoomId
());
recordsQueryWrapper
.
ne
(
SCleanRecords:
:
getStatus
,
CleaningStatusEnum
.
CLEANED
.
getCode
());
SCleanRecords
sCleanRecords
=
cleanRecordsService
.
getOne
(
recordsQueryWrapper
);
if
(
ObjectUtil
.
isNotEmpty
(
sCleanRecords
))
{
// 如果保洁状态未不是保洁中
throw
new
BaseException
(
"当前房间待保洁,请联系客服!"
);
}
if
(
sOrder
.
getStatus
().
equals
(
OrderStatusEnum
.
UNUSED
.
getCode
()))
{
if
(
RoomStatusEnum
.
HOLD
.
getValue
().
compareTo
(
sRoomVo
.
getStatus
())
==
0
||
!
checkOrderOpenDoor
(
sOrder
))
{
...
...
@@ -123,18 +131,7 @@ public class OpenInterfaceServiceImpl implements OpenInterfaceService {
// 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
,
-
60
));
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
());
//计算预约开始和结束时间时长
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
ab662090
package
share
.
system
.
service
.
impl
;
import
cn.hutool.core.date.DateField
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.util.ObjectUtil
;
...
...
@@ -1581,6 +1580,15 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
).
collect
(
Collectors
.
toList
()).
isEmpty
())
{
throw
new
BaseException
(
"房间取电设备不存在!"
);
}
//当前房间是否有保洁任务
LambdaQueryWrapper
<
SCleanRecords
>
recordsQueryWrapper
=
new
LambdaQueryWrapper
<>();
recordsQueryWrapper
.
eq
(
SCleanRecords:
:
getRoomId
,
sOrder
.
getRoomId
());
recordsQueryWrapper
.
ne
(
SCleanRecords:
:
getStatus
,
CleaningStatusEnum
.
CLEANED
.
getCode
());
SCleanRecords
sCleanRecords
=
cleanRecordsService
.
getOne
(
recordsQueryWrapper
);
if
(
ObjectUtil
.
isNotEmpty
(
sCleanRecords
))
{
// 如果保洁状态未不是保洁中
throw
new
BaseException
(
"当前房间待保洁,请联系客服!"
);
}
if
(
sOrder
.
getStatus
().
equals
(
OrderStatusEnum
.
UNUSED
.
getCode
()))
{
if
(
RoomStatusEnum
.
HOLD
.
getValue
().
compareTo
(
sRoomVo
.
getStatus
())
==
0
||
!
checkOrderOpenDoor
(
sOrder
))
{
...
...
@@ -1594,19 +1602,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
// 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
,
-
60
));
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