| | |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.common.core.utils.page.CollUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.goods.controller.management.dto.GoodsSeckillDTO; |
| | |
| | | Set<Long> goodsSkuIdList = null; |
| | | goodsSkuIdList = page1.stream().map(GoodsSku::getId) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | if (CollUtils.isEmpty(goodsSkuIdList)) { |
| | | return PageDTO.empty(0L, 0L); |
| | | } |
| | | Page<GoodsSeckill> page = new Page<>(); |
| | | page.setSize(homeGoodsSkuDTO.getPageSize()); |
| | | page.setCurrent(homeGoodsSkuDTO.getPageCurr()); |
| | |
| | | homeGoodsSeckillInfoVO.setCoverPic(data6.getCoverPic()); |
| | | homeGoodsSeckillInfoVO.setAlbum(data6.getAlbum()); |
| | | homeGoodsSeckillInfoVO.setShareTitle(byId.getShareTitle()); |
| | | if (StringUtils.isNotBlank(byId.getShareTitle())) { |
| | | homeGoodsSeckillInfoVO.setShareTitle(byId.getShareTitle()); |
| | | } else { |
| | | homeGoodsSeckillInfoVO.setShareTitle(data6.getSkuName()); |
| | | } |
| | | if (StringUtils.isNotBlank(byId.getSharePic())) { |
| | | homeGoodsSeckillInfoVO.setSharePic(byId.getSharePic()); |
| | | } else { |
| | | homeGoodsSeckillInfoVO.setSharePic(data6.getCoverPic()); |
| | | } |
| | | homeGoodsSeckillInfoVO.setSeckillPrice(byId.getSeckillPrice()); |
| | | homeGoodsSeckillInfoVO.setDescription(data6.getDescription()); |
| | | homeGoodsSeckillInfoVO.setDetail(data6.getDetail()); |
| | |
| | | |
| | | return homeGoodsSeckillInfoVO; |
| | | } |
| | | |
| | | /** |
| | | * 结束异常的秒杀 |
| | | */ |
| | | @Override |
| | | public void updSeckillStatus() { |
| | | baseMapper.updSeckillStatus(); |
| | | } |
| | | |
| | | /** |
| | | * 根据秒杀id集合查询商品sku信息 |
| | | * |
| | | * @param seckillIdSet |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<GoodsSku> getGoodsSkuBySeckillIdSet(Set<Long> seckillIdSet) { |
| | | List<GoodsSeckill> goodsSeckills = this.listByIds(seckillIdSet); |
| | | List<Long> goodsSkuIdList = goodsSeckills.stream().map(GoodsSeckill::getGoodsSkuId) |
| | | .collect(Collectors.toList()); |
| | | return goodsSkuService.listByIds(goodsSkuIdList); |
| | | } |
| | | } |