| | |
| | | package com.ruoyi.goods.service.biz; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.date.DatePattern; |
| | | import cn.hutool.core.date.DateUtil; |
| | |
| | | return livePageList; |
| | | } |
| | | |
| | | /** |
| | | * 直播详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public XiaoeLiveVo getLiveDetail(String id) { |
| | | return xiaoeUtils.getLiveDetail(id); |
| | | } |
| | | /** |
| | | * 预约直播 |
| | | * @param id |
| | |
| | | return xiaoeUtils.editLive(dto); |
| | | } |
| | | |
| | | /** |
| | | * 管理后台直播分页列表 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | public Page<XiaoeLiveVo> getMgtLivePage(XiaoeLiveQueryDto dto) { |
| | | Page<XiaoeLiveVo> livePageList = xiaoeUtils.getLivePageList(dto); |
| | | Long shopId = dto.getShopId(); |
| | | if (Objects.nonNull(shopId)) { |
| | | List<XiaoeLiveRecord> xiaoeLiveRecords = xiaoeLiveRecordService.getListByShopId(shopId); |
| | | if (CollUtil.isNotEmpty(xiaoeLiveRecords)) { |
| | | List<String> liveIdList = xiaoeLiveRecords.stream().map(XiaoeLiveRecord::getLiveId).collect(Collectors.toList()); |
| | | List<XiaoeLiveVo> filteredList = livePageList.getRecords().stream().filter(item -> liveIdList.contains(item.getId())).collect(Collectors.toList()); |
| | | livePageList.setRecords(filteredList); |
| | | } |
| | | } |
| | | return livePageList; |
| | | } |
| | | |
| | | /** |
| | | * 删除直播 |
| | | * @param id |
| | | */ |
| | | public void deleteLive(String id) { |
| | | Boolean flag = xiaoeUtils.deleteLive(id); |
| | | if (flag) { |
| | | //删除直播添加记录 |
| | | xiaoeLiveRecordService.lambdaUpdate().eq(XiaoeLiveRecord::getLiveId, id).remove(); |
| | | } |
| | | } |
| | | } |