抽奖修改
This commit is contained in:
@@ -207,9 +207,9 @@ public class DiscSpinningController {
|
|||||||
} else {
|
} else {
|
||||||
String redisKey = "";
|
String redisKey = "";
|
||||||
if (source.equals(2)) {
|
if (source.equals(2)) {
|
||||||
redisKey = RedisKeys.getDateKey("spinning:amount:taskW") + userId;
|
redisKey = RedisKeys.getDateKey("spinning:draw:taskW") + userId;
|
||||||
} else if (source.equals(3)) {
|
} else if (source.equals(3)) {
|
||||||
redisKey = RedisKeys.getDateKey("spinning:amount:taskM") + userId;
|
redisKey = RedisKeys.getDateKey("spinning:draw:taskM") + userId;
|
||||||
}
|
}
|
||||||
Map<String, Object> week = redisUtils.get(redisKey, Map.class);
|
Map<String, Object> week = redisUtils.get(redisKey, Map.class);
|
||||||
for (Map.Entry<String, Object> entry : week.entrySet()) {
|
for (Map.Entry<String, Object> entry : week.entrySet()) {
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public class DiscSpinningServiceImpl extends ServiceImpl<DiscSpinningDao, DiscSp
|
|||||||
@Transactional
|
@Transactional
|
||||||
public DiscSpinningRecord draws(int drawCount, double orderAmount, Long sourceId, Long userId, Integer source) {
|
public DiscSpinningRecord draws(int drawCount, double orderAmount, Long sourceId, Long userId, Integer source) {
|
||||||
DiscSpinning result = new DiscSpinning("谢谢惠顾", 1, BigDecimal.ZERO);
|
DiscSpinning result = new DiscSpinning("谢谢惠顾", 1, BigDecimal.ZERO);
|
||||||
List<DiscSpinning> prizes = baseMapper.selectList(new QueryWrapper<DiscSpinning>().eq("disc_type", source).orderByAsc("odds"));
|
List<DiscSpinning> prizes = baseMapper.selectList(new QueryWrapper<DiscSpinning>().eq("disc_type", source).orderByAsc("number"));
|
||||||
if (CollectionUtil.isEmpty(prizes)) {
|
if (CollectionUtil.isEmpty(prizes)) {
|
||||||
DiscSpinningRecord record = new DiscSpinningRecord(result.getName(), sourceId, userId, result.getUrl(), result.getType(),
|
DiscSpinningRecord record = new DiscSpinningRecord(result.getName(), sourceId, userId, result.getUrl(), result.getType(),
|
||||||
result.getNumber(), DateUtils.formatYMD(new Date()), DateUtils.format(new Date()), source);
|
result.getNumber(), DateUtils.formatYMD(new Date()), DateUtils.format(new Date()), source);
|
||||||
|
|||||||
@@ -363,7 +363,7 @@ public class TaskCenterServiceImpl extends ServiceImpl<TaskCenterDao, TaskCenter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CollectionUtil.isNotEmpty(taskWRedisMap)) {
|
if (CollectionUtil.isNotEmpty(taskWRedisMap)) {
|
||||||
redisUtils.set(RedisKeys.getDateKey("spinning:amount:taskW") + userId, taskWRedisMap, DateUtils.todayAfterSecond());
|
redisUtils.set(RedisKeys.getDateKey("spinning:draw:taskW") + userId, taskWRedisMap, DateUtils.todayAfterSecond());
|
||||||
}
|
}
|
||||||
} else if ("3".equals(type)) {
|
} else if ("3".equals(type)) {
|
||||||
if (signCount == null) {
|
if (signCount == null) {
|
||||||
@@ -379,7 +379,7 @@ public class TaskCenterServiceImpl extends ServiceImpl<TaskCenterDao, TaskCenter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CollectionUtil.isNotEmpty(taskWRedisMap)) {
|
if (CollectionUtil.isNotEmpty(taskWRedisMap)) {
|
||||||
redisUtils.set(RedisKeys.getDateKey("spinning:amount:taskM") + userId, taskWRedisMap, DateUtils.todayAfterSecond());
|
redisUtils.set(RedisKeys.getDateKey("spinning:draw:taskM") + userId, taskWRedisMap, DateUtils.todayAfterSecond());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user