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
476634a2
Commit
476634a2
authored
Mar 12, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改房间状态显示和保洁管房间理显示一致
parent
8734ea03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
SRoomServiceImpl.java
...main/java/share/system/service/impl/SRoomServiceImpl.java
+18
-0
No files found.
share-system/src/main/java/share/system/service/impl/SRoomServiceImpl.java
View file @
476634a2
...
...
@@ -52,6 +52,8 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
private
RoomStatusService
roomStatusService
;
@Autowired
private
SStoreConsumerMapper
storeConsumerMapper
;
@Autowired
private
ISCleanRecordsService
cleanRecordsService
;
/**
...
...
@@ -118,6 +120,8 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
// List<Long> storeIds = roomList.stream().map(SRoom::getStoreId).collect(Collectors.toList());
List
<
Long
>
roomIds
=
roomList
.
stream
().
map
(
SRoom:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
SRoomPack
>
roomPacks
=
roomPackService
.
packIdsByRoomIds
(
roomIds
);
List
<
SCleanRecords
>
sCleanRecordsList
=
cleanRecordsService
.
unCleanedListByRoomIds
(
roomIds
);
Map
<
Long
,
List
<
SCleanRecords
>>
recordsMap
=
Optional
.
ofNullable
(
sCleanRecordsList
).
orElse
(
new
ArrayList
<>()).
stream
().
collect
(
Collectors
.
groupingBy
(
SCleanRecords:
:
getRoomId
));
SStore
store
=
sStoreService
.
getById
(
roomList
.
get
(
0
).
getStoreId
());
Map
<
Long
,
List
<
SRoomPack
>>
roomPackMap
=
Optional
.
ofNullable
(
roomPacks
).
orElse
(
new
ArrayList
<>()).
stream
().
collect
(
Collectors
.
groupingBy
(
SRoomPack:
:
getRoomId
));
List
<
Long
>
packIdList
=
Optional
.
ofNullable
(
roomPacks
).
orElse
(
new
ArrayList
<>()).
stream
().
map
(
SRoomPack:
:
getPackId
).
collect
(
Collectors
.
toList
());
...
...
@@ -129,6 +133,12 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
BeanUtils
.
copyProperties
(
sRoom
,
vo
);
vo
.
setStoreName
(
store
.
getName
());
vo
.
setRoomStatusList
(
roomStatusMap
.
get
(
sRoom
.
getId
()));
if
(
CollectionUtils
.
isNotEmpty
(
sCleanRecordsList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
recordsMap
.
get
(
vo
.
getId
())))
{
SCleanRecords
records
=
recordsMap
.
get
(
vo
.
getId
()).
get
(
0
);
vo
.
setRecordsStatus
(
records
.
getStatus
());
}
}
if
(!
roomPackMap
.
isEmpty
())
{
List
<
Long
>
packIds
=
Optional
.
ofNullable
(
roomPackMap
.
get
(
sRoom
.
getId
())).
orElse
(
new
ArrayList
<>()).
stream
().
map
(
SRoomPack:
:
getPackId
).
collect
(
Collectors
.
toList
());
sRoom
.
setPackIds
(
packIds
.
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
...
...
@@ -330,6 +340,14 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
public
SRoomVo
queryById
(
Long
id
)
{
SRoom
room
=
baseMapper
.
selectById
(
id
);
SStore
sStore
=
sStoreService
.
selectSStoreById
(
room
.
getStoreId
());
LambdaQueryWrapper
<
SCleanRecords
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
in
(
SCleanRecords:
:
getRoomId
,
id
);
queryWrapper
.
ne
(
SCleanRecords:
:
getStatus
,
CleaningStatusEnum
.
CLEANED
.
getCode
());
queryWrapper
.
orderByDesc
(
SCleanRecords:
:
getStartDate
);
List
<
SCleanRecords
>
list
=
cleanRecordsService
.
list
(
queryWrapper
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
room
.
setRecordsStatus
(
list
.
get
(
0
).
getStatus
());
}
room
.
setOpenShopUuid
(
sStore
.
getOpenShopUuid
());
List
<
Long
>
packIds
=
roomPackService
.
selectPackListByRoomId
(
id
);
//过滤首次下单套餐
...
...
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