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
e68edc51
Commit
e68edc51
authored
Mar 15, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
房间列表使用中的房间增加订单结束时间
parent
c69e98f5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+10
-6
SRoomServiceImpl.java
...main/java/share/system/service/impl/SRoomServiceImpl.java
+12
-0
No files found.
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
e68edc51
...
@@ -168,6 +168,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -168,6 +168,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
}
if
(
ObjectUtil
.
isNotEmpty
(
sOrder
.
getStatus
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
sOrder
.
getStatus
()))
{
OrderStatusEnum
orderStatusEnum
=
OrderStatusEnum
.
getEnumByCode
(
sOrder
.
getStatus
());
OrderStatusEnum
orderStatusEnum
=
OrderStatusEnum
.
getEnumByCode
(
sOrder
.
getStatus
());
if
(
orderStatusEnum
!=
null
)
{
switch
(
orderStatusEnum
)
{
switch
(
orderStatusEnum
)
{
case
CANCEL:
case
CANCEL:
queryWrapper
.
in
(
SOrder:
:
getStatus
,
new
ArrayList
<
Integer
>()
{{
queryWrapper
.
in
(
SOrder:
:
getStatus
,
new
ArrayList
<
Integer
>()
{{
...
@@ -185,7 +186,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -185,7 +186,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
break
;
break
;
}
}
}
}
queryWrapper
.
orderByDesc
(
true
,
SOrder:
:
getCreateTime
);
}
queryWrapper
.
orderByDesc
(
SOrder:
:
getCreateTime
);
List
<
SOrder
>
orders
=
baseMapper
.
selectList
(
queryWrapper
);
List
<
SOrder
>
orders
=
baseMapper
.
selectList
(
queryWrapper
);
return
convertDosToVos
(
orders
);
return
convertDosToVos
(
orders
);
}
}
...
@@ -368,7 +370,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -368,7 +370,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
SOrder
sOrder
=
getInfoException
(
request
.
getOrderNo
());
SOrder
sOrder
=
getInfoException
(
request
.
getOrderNo
());
SOrder
oldSOrder
=
new
SOrder
();
SOrder
oldSOrder
=
new
SOrder
();
BeanUtils
.
copyProperties
(
sOrder
,
oldSOrder
);
BeanUtils
.
copyProperties
(
sOrder
,
oldSOrder
);
if
(
sOrder
==
null
)
{
if
(
ObjectUtils
.
isEmpty
(
sOrder
)
)
{
throw
new
BaseException
(
"订单不存在"
);
throw
new
BaseException
(
"订单不存在"
);
}
}
Date
date
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
offsetDay
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
date
(),
-
30
);
Date
date
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
offsetDay
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
date
(),
-
30
);
...
@@ -522,7 +524,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -522,7 +524,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
List
<
SCleanRecords
>
sCleanRecords
=
isCleanRecordsService
.
list
(
cleanRecordsQueryWrapper
);
List
<
SCleanRecords
>
sCleanRecords
=
isCleanRecordsService
.
list
(
cleanRecordsQueryWrapper
);
if
(
CollectionUtils
.
isNotEmpty
(
sCleanRecords
))
{
if
(
CollectionUtils
.
isNotEmpty
(
sCleanRecords
))
{
//去掉保洁中的房间
//去掉保洁中的房间
List
<
Long
>
cleanRoomIds
=
Optional
.
of
Nullable
(
sCleanRecords
).
orElse
(
new
ArrayList
<>()).
parallelStream
().
map
(
SCleanRecords:
:
getRoomId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
cleanRoomIds
=
Optional
.
of
(
sCleanRecords
).
orElse
(
new
ArrayList
<>()).
parallelStream
().
map
(
SCleanRecords:
:
getRoomId
).
collect
(
Collectors
.
toList
());
//获取不在保洁的房间
//获取不在保洁的房间
list
=
list
.
stream
().
filter
(
sRoom
->
!
cleanRoomIds
.
contains
(
sRoom
.
getId
())).
collect
(
Collectors
.
toList
());
list
=
list
.
stream
().
filter
(
sRoom
->
!
cleanRoomIds
.
contains
(
sRoom
.
getId
())).
collect
(
Collectors
.
toList
());
}
}
...
@@ -546,7 +548,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -546,7 +548,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
List
<
SOrder
>
orderList
=
list
(
sOrderLambdaQueryWrapper
);
List
<
SOrder
>
orderList
=
list
(
sOrderLambdaQueryWrapper
);
if
(
CollectionUtils
.
isNotEmpty
(
orderList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
orderList
))
{
//去掉被占用的房间
//去掉被占用的房间
List
<
Long
>
orderRoomIds
=
Optional
.
of
Nullable
(
orderList
).
orElse
(
new
ArrayList
<>()).
parallelStream
().
map
(
SOrder:
:
getRoomId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
orderRoomIds
=
Optional
.
of
(
orderList
).
orElse
(
new
ArrayList
<>()).
parallelStream
().
map
(
SOrder:
:
getRoomId
).
collect
(
Collectors
.
toList
());
list
=
list
.
stream
().
filter
(
sRoom
->
!
orderRoomIds
.
contains
(
sRoom
.
getId
())).
collect
(
Collectors
.
toList
());
list
=
list
.
stream
().
filter
(
sRoom
->
!
orderRoomIds
.
contains
(
sRoom
.
getId
())).
collect
(
Collectors
.
toList
());
}
}
return
roomService
.
convertDoListToVoList
(
list
);
return
roomService
.
convertDoListToVoList
(
list
);
...
@@ -577,11 +579,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -577,11 +579,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
SCleanRecords
cleanRecords
=
isCleanRecordsService
.
lastCleanByRoomId
(
sOrder
.
getRoomId
());
SCleanRecords
cleanRecords
=
isCleanRecordsService
.
lastCleanByRoomId
(
sOrder
.
getRoomId
());
if
(
ObjectUtil
.
isEmpty
(
cleanRecords
)
||
cleanRecords
.
getStatus
().
equals
(
CleaningStatusEnum
.
CLEANED
.
getCode
()))
{
if
(
ObjectUtil
.
isEmpty
(
cleanRecords
)
||
cleanRecords
.
getStatus
().
equals
(
CleaningStatusEnum
.
CLEANED
.
getCode
()))
{
//房间添加保洁记录
//房间添加保洁记录
boolean
b
=
isCleanRecordsService
.
addSCleanRecords
(
sOrder
.
getStoreId
(),
sOrder
.
getRoomId
());
isCleanRecordsService
.
addSCleanRecords
(
sOrder
.
getStoreId
(),
sOrder
.
getRoomId
());
}
}
}
}
//判断极端条件,在订单换房时原订单在自动开始的订单中变为订单开始状态
boolean
inuse
=
redisUtils
.
exists
(
ReceiptRdeisEnum
.
ORDER_NO_KEY
.
getValue
()
+
sOrder
.
getOrderNo
());
//原订单是否使用中
//原订单是否使用中
if
(
sOrder
.
getStatus
().
equals
(
OrderStatusEnum
.
INUSE
.
getCode
()))
{
if
(
sOrder
.
getStatus
().
equals
(
OrderStatusEnum
.
INUSE
.
getCode
())
|
inuse
)
{
// 使用中订单断电, 延时3分钟断电
// 使用中订单断电, 延时3分钟断电
deviceOpService
.
openOrCloseDevice
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
deviceOpService
.
openOrCloseDevice
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
false
,
0
);
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
false
,
0
);
...
...
share-system/src/main/java/share/system/service/impl/SRoomServiceImpl.java
View file @
e68edc51
...
@@ -128,6 +128,11 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -128,6 +128,11 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
List
<
SPack
>
packList
=
packService
.
selectPackListByIds
(
packIdList
);
List
<
SPack
>
packList
=
packService
.
selectPackListByIds
(
packIdList
);
List
<
RoomStatusVo
>
roomStatusVoList
=
roomStatusService
.
listRoomStatus
(
store
.
getId
(),
roomList
);
List
<
RoomStatusVo
>
roomStatusVoList
=
roomStatusService
.
listRoomStatus
(
store
.
getId
(),
roomList
);
Map
<
Long
,
List
<
RoomStatusVo
>>
roomStatusMap
=
Optional
.
ofNullable
(
roomStatusVoList
).
orElse
(
new
ArrayList
<>()).
stream
().
collect
(
Collectors
.
groupingBy
(
RoomStatusVo:
:
getRoomId
));
Map
<
Long
,
List
<
RoomStatusVo
>>
roomStatusMap
=
Optional
.
ofNullable
(
roomStatusVoList
).
orElse
(
new
ArrayList
<>()).
stream
().
collect
(
Collectors
.
groupingBy
(
RoomStatusVo:
:
getRoomId
));
LambdaQueryWrapper
<
SOrder
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
SOrder:
:
getStoreId
,
store
.
getId
());
wrapper
.
in
(
SOrder:
:
getRoomId
,
roomIds
);
wrapper
.
eq
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
INUSE
.
getCode
());
List
<
SOrder
>
list
=
orderService
.
list
(
wrapper
);
roomList
.
stream
().
forEach
(
sRoom
->
{
roomList
.
stream
().
forEach
(
sRoom
->
{
SRoomVo
vo
=
new
SRoomVo
();
SRoomVo
vo
=
new
SRoomVo
();
BeanUtils
.
copyProperties
(
sRoom
,
vo
);
BeanUtils
.
copyProperties
(
sRoom
,
vo
);
...
@@ -150,6 +155,13 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -150,6 +155,13 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
});
});
vo
.
setPackList
(
packs
);
vo
.
setPackList
(
packs
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
list
.
forEach
(
order
->
{
if
(
order
.
getRoomId
().
compareTo
(
vo
.
getId
())
==
0
)
{
vo
.
setRecordsTime
(
order
.
getEndDate
());
}
});
}
voList
.
add
(
vo
);
voList
.
add
(
vo
);
});
});
}
}
...
...
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