|
@@ -209,11 +209,35 @@ public class LiveAutoTaskServiceImpl implements ILiveAutoTaskService {
|
|
|
{
|
|
{
|
|
|
LiveAutoTask existTask = baseMapper.selectLiveAutoTaskById(liveAutoTask.getId());
|
|
LiveAutoTask existTask = baseMapper.selectLiveAutoTaskById(liveAutoTask.getId());
|
|
|
redisCache.redisTemplate.opsForZSet().removeRangeByScore("live:auto_task:" + existTask.getLiveId(), existTask.getAbsValue().getTime(), existTask.getAbsValue().getTime());
|
|
redisCache.redisTemplate.opsForZSet().removeRangeByScore("live:auto_task:" + existTask.getLiveId(), existTask.getAbsValue().getTime(), existTask.getAbsValue().getTime());
|
|
|
- LiveGoodsVo liveGoodsVo = goodsService.selectLiveGoodsVoByGoodsId(Long.valueOf(liveAutoTask.getContent()));
|
|
|
|
|
- if(liveGoodsVo == null) return -1;
|
|
|
|
|
- liveAutoTask.setContent(JSON.toJSONString(liveGoodsVo));
|
|
|
|
|
-
|
|
|
|
|
- return baseMapper.updateLiveAutoTask(liveAutoTask);
|
|
|
|
|
|
|
+ if (liveAutoTask.getTaskType() == 1L) {
|
|
|
|
|
+ // 商品
|
|
|
|
|
+ LiveGoodsVo liveGoodsVo = goodsService.selectLiveGoodsVoByGoodsId(Long.valueOf(liveAutoTask.getContent()));
|
|
|
|
|
+ if(liveGoodsVo == null) return -1;
|
|
|
|
|
+ liveAutoTask.setContent(JSON.toJSONString(liveGoodsVo));
|
|
|
|
|
+ return baseMapper.updateLiveAutoTask(liveAutoTask);
|
|
|
|
|
+ }else if (liveAutoTask.getTaskType() == 2L) {
|
|
|
|
|
+ // 红包
|
|
|
|
|
+ LiveRedConf liveRedConf = liveRedConfMapper.selectLiveRedConfByRedId(Long.valueOf(liveAutoTask.getContent()));
|
|
|
|
|
+ if(liveRedConf == null) return -1;
|
|
|
|
|
+ if(liveRedConf.getRedStatus() != 0L) return -1;
|
|
|
|
|
+ liveAutoTask.setContent(JSON.toJSONString(liveRedConf));
|
|
|
|
|
+ return baseMapper.updateLiveAutoTask(liveAutoTask);
|
|
|
|
|
+ }else if (liveAutoTask.getTaskType() == 4L) {
|
|
|
|
|
+ // 开启抽奖
|
|
|
|
|
+ LiveLotteryConf liveLotteryConf = liveLotteryConfMapper.selectLiveLotteryConfByLotteryId(Long.valueOf(liveAutoTask.getContent()));
|
|
|
|
|
+ if(liveLotteryConf == null) return -1;
|
|
|
|
|
+ if(!"0".equals(liveLotteryConf.getLotteryStatus())) return -1;
|
|
|
|
|
+ List<LiveLotteryProduct> prizes = lotteryProductConfMapper.selectLiveLotteryProductConfByLotteryId(liveLotteryConf.getLotteryId());
|
|
|
|
|
+ if (prizes == null || prizes.isEmpty()) {
|
|
|
|
|
+ return -1;
|
|
|
|
|
+ }
|
|
|
|
|
+ liveAutoTask.setContent(JSON.toJSONString(liveLotteryConf));
|
|
|
|
|
+ return baseMapper.updateLiveAutoTask(liveAutoTask);
|
|
|
|
|
+ } else if(liveAutoTask.getTaskType() == 3L){
|
|
|
|
|
+ return baseMapper.updateLiveAutoTask(liveAutoTask);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return -1;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|