记得上下班打卡 | git大法好,push需谨慎

Commit 8930b3f7 authored by 胡佳晨's avatar 胡佳晨

抽奖数据迁移

parent c6971d1a
...@@ -409,13 +409,13 @@ public class RedisDataUtils { ...@@ -409,13 +409,13 @@ public class RedisDataUtils {
String redisAll = SweetConstant.REDIS_KEY_SWEET_LUCK_DRAW_ALL.concat(luckDrawNum); String redisAll = SweetConstant.REDIS_KEY_SWEET_LUCK_DRAW_ALL.concat(luckDrawNum);
String redisPresent = SweetConstant.REDIS_KEY_SWEET_LUCK_DRAW_PRESENT_MOBILE.concat(mobile); String redisPresent = SweetConstant.REDIS_KEY_SWEET_LUCK_DRAW_PRESENT_MOBILE.concat(mobile);
int surplus = (int) redisUtil.get(redisSurplus); int surplus = (int) redisUtil.get(redisSurplus);//当前中奖数量
int prize = (int) redisUtil.get(redisAll) + 1; int prize = (int) redisUtil.get(redisAll);//总量
int prizeALl = (int) redisUtil.get(redisAll) + 1; int prizeALl = (int) redisUtil.get(redisAll) + 1;//不变的总量
int count = (int) redisUtil.incr(redisKey, 1); int count = (int) redisUtil.incr(redisKey, 1);
if (count > 2) { if (count > 2) {
vo.setPrize(prize); vo.setPrize(prizeALl);
vo.setPrizeAll(prizeALl); vo.setPrizeAll(prizeALl);
return vo; return vo;
} }
...@@ -435,7 +435,6 @@ public class RedisDataUtils { ...@@ -435,7 +435,6 @@ public class RedisDataUtils {
surplus = (int) redisUtil.get(redisSurplus); surplus = (int) redisUtil.get(redisSurplus);
if (surplus < prize) { if (surplus < prize) {
surplus = (int) redisUtil.incr(redisSurplus, 1); surplus = (int) redisUtil.incr(redisSurplus, 1);
prize = surplus;
redisUtil.set(redisKey, 2); redisUtil.set(redisKey, 2);
} }
} }
...@@ -443,12 +442,12 @@ public class RedisDataUtils { ...@@ -443,12 +442,12 @@ public class RedisDataUtils {
sqls.add(SqlMapping.get("sweet_luck_draw.insert")); sqls.add(SqlMapping.get("sweet_luck_draw.insert"));
sqlsDataA.add(new Object[]{ sqlsDataA.add(new Object[]{
mobile, luckDrawNum, prize, prizeALl, now mobile, luckDrawNum, surplus, prize, now
}); });
queueUtils.sendMsgByRedis(MQConst.SweetQueue.LUCK_DRAW.getKey(), queueUtils.sendMsgByRedis(MQConst.SweetQueue.LUCK_DRAW.getKey(),
SqlMapping.gets(sqls, sqlsDataA)); SqlMapping.gets(sqls, sqlsDataA));
vo.setPrize(prize); vo.setPrize(surplus);
vo.setPrizeAll(prizeALl); vo.setPrizeAll(prizeALl);
return vo; return vo;
} }
......
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