mitao
2024-07-27 d5a62c975afbaff26d17b61fa7b9fde7e2cb035d
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsSeckillServiceImpl.java
@@ -109,7 +109,7 @@
                .ne(GoodsSeckill::getStartStatus, StartStatusEnum.ENDED)
                .eq(GoodsSeckill::getListingStatus, ListingStatusEnum.ON_SHELVES)
                .le(GoodsSeckill::getStartTime, dto.getStartTime())
                .ge(GoodsSeckill::getEndTime, dto.getEndTime()).list();
                .ge(GoodsSeckill::getEndTime, dto.getStartTime()).list();
        Set<Long> existGoodsSkuIdSet = list.stream().map(GoodsSeckill::getGoodsSkuId)
                .collect(Collectors.toSet());
        if (!existGoodsSkuIdSet.isEmpty()) {
@@ -125,7 +125,8 @@
                            return goodsSkuMap.get(item.getGoodsSkuId());
                        }).filter(Objects::nonNull)
                        .collect(Collectors.joining(","));
                throw new ServiceException("添加失败,当前商品在该时间段内有其他秒杀活动");
                throw new ServiceException(
                        String.format("添加失败,商品%s在该时间段内有其他秒杀活动", goodsSkuNames));
            }
        }
        this.saveBatch(goodsSeckills);