Commit 25cbfdc4 authored by 邓吉芬's avatar 邓吉芬

修改商品缓存

parent 31dd5ed1
...@@ -215,7 +215,7 @@ public class DrawManagerImpl implements IDrawManager { ...@@ -215,7 +215,7 @@ public class DrawManagerImpl implements IDrawManager {
AccountPrize accountPrize; AccountPrize accountPrize;
if (drawCountTotal - alreadyDrawCount > 0) { if (drawCountTotal - alreadyDrawCount > 0) {
// 获得奖品 // 获得奖品
List<Prize> prizeList = prizeService.listAllPrizes(); List<Prize> prizeList = prizeService.listAllPrizes(activityConfig.getActivityId());
if (CollectionUtils.isEmpty(prizeList)) { if (CollectionUtils.isEmpty(prizeList)) {
throw new BusinessException(ErrorEnum.DRAW_CHECK_EXP, "活动已结束!"); throw new BusinessException(ErrorEnum.DRAW_CHECK_EXP, "活动已结束!");
} }
......
...@@ -20,7 +20,7 @@ public interface IPrizeService extends IService<Prize> { ...@@ -20,7 +20,7 @@ public interface IPrizeService extends IService<Prize> {
* *
* @return * @return
*/ */
List<Prize> listAllPrizes(); List<Prize> listAllPrizes(Long activityId);
/** /**
* 更新数量 * 更新数量
......
...@@ -38,8 +38,6 @@ public class AccountPrizeServiceImpl extends ServiceImpl<AccountPrizeMapper, Acc ...@@ -38,8 +38,6 @@ public class AccountPrizeServiceImpl extends ServiceImpl<AccountPrizeMapper, Acc
@Resource @Resource
private PrizeMapper prizeMapper; private PrizeMapper prizeMapper;
@Value("${draw.activityId}")
private int activityId;
@Override @Override
public Integer gainAlreadyDrawCount(String phone,Long activityId, LocalDateTime start, LocalDateTime end) { public Integer gainAlreadyDrawCount(String phone,Long activityId, LocalDateTime start, LocalDateTime end) {
......
...@@ -28,11 +28,10 @@ public class PrizeServiceImpl extends ServiceImpl<PrizeMapper, Prize> implements ...@@ -28,11 +28,10 @@ public class PrizeServiceImpl extends ServiceImpl<PrizeMapper, Prize> implements
@Resource @Resource
private PrizeMapper prizeMapper; private PrizeMapper prizeMapper;
@Value("${draw.activityId}")
private Long activityId;
@Override @Override
public List<Prize> listAllPrizes() { public List<Prize> listAllPrizes(Long activityId) {
List<Prize> prizeList; List<Prize> prizeList;
LambdaQueryWrapper<Prize> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Prize> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Prize::getValidStatus, YesOrNoEnum.YES.getCode()); wrapper.eq(Prize::getValidStatus, YesOrNoEnum.YES.getCode());
......
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