Commit a6b30a3d by 吕明尚

修改前台页面展示的未保洁 保洁管理显示空闲

parent 2ea0069a
......@@ -329,12 +329,17 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
List<Long> orderRoomIds = Optional.ofNullable(orderList).orElse(new ArrayList<>()).parallelStream().map(SOrder::getRoomId).collect(Collectors.toList());
List<SCleanRecords> hasOrderlist = list.stream().filter(item -> orderRoomIds.contains(item.getRoomId())).collect(Collectors.toList());
List<SCleanRecords> nonOrderlist = list.stream().filter(item -> !orderRoomIds.contains(item.getRoomId())).collect(Collectors.toList());
List<SRoom> rooms = new ArrayList<>();
if (CollectionUtils.isNotEmpty(hasOrderlist)) {
hasOrderlist.forEach(item -> {
item.setStatus(2);
item.setStartDate(now);
item.setEndDate(now);
item.setUpdateTime(now);
rooms.add(new SRoom() {{
setId(item.getRoomId());
setIsDirtyRoom(YesNoEnum.no.getIndex());
}});
});
}
List<SRoom> dirtyRoomList = new ArrayList<>();
......@@ -378,6 +383,9 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
if (CollectionUtils.isNotEmpty(dirtyRoomList)) {
roomService.updateBatchById(dirtyRoomList);
}
if (CollectionUtils.isNotEmpty(rooms)) {
roomService.updateBatchById(rooms);
}
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment