mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 15:21:53 +08:00
【功能修复】商城:秒杀活动的活动排重校验不正确的问题
This commit is contained in:
parent
caf49aae35
commit
9ae3682b2d
@ -31,9 +31,9 @@ public interface SeckillActivityMapper extends BaseMapperX<SeckillActivityDO> {
|
|||||||
.orderByDesc(SeckillActivityDO::getId));
|
.orderByDesc(SeckillActivityDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<SeckillActivityDO> selectListByStatus(Integer status) {
|
default List<SeckillActivityDO> selectListBySpuIdAndStatus(Long spuId, Integer status) {
|
||||||
return selectList(new LambdaQueryWrapperX<SeckillActivityDO>()
|
return selectList(SeckillActivityDO::getSpuId, spuId,
|
||||||
.eqIfPresent(SeckillActivityDO::getStatus, status));
|
SeckillActivityDO::getStatus, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -97,7 +97,7 @@ public class SeckillActivityServiceImpl implements SeckillActivityService {
|
|||||||
seckillConfigService.validateSeckillConfigExists(configIds);
|
seckillConfigService.validateSeckillConfigExists(configIds);
|
||||||
|
|
||||||
// 2.1 查询所有开启的秒杀活动
|
// 2.1 查询所有开启的秒杀活动
|
||||||
List<SeckillActivityDO> activityList = seckillActivityMapper.selectListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
List<SeckillActivityDO> activityList = seckillActivityMapper.selectListBySpuIdAndStatus(spuId, CommonStatusEnum.ENABLE.getStatus());
|
||||||
if (activityId != null) { // 排除自己
|
if (activityId != null) { // 排除自己
|
||||||
activityList.removeIf(item -> ObjectUtil.equal(item.getId(), activityId));
|
activityList.removeIf(item -> ObjectUtil.equal(item.getId(), activityId));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user