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

Commit 07fbedf8 authored by jiangxiulong's avatar jiangxiulong

注释掉mongo update;抽奖列表状态读redis

parent 859e5a25
...@@ -199,9 +199,9 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg ...@@ -199,9 +199,9 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
} }
if (prizeType == StatusConst.PRIZE_TYPE2) {// 中奖券 优惠券默认未领取状态 if (prizeType == StatusConst.PRIZE_TYPE2) {// 中奖券 优惠券默认未领取状态
//TODO 中券改为已领取 //TODO 中券改为已领取
receivingStatus = 2; /*receivingStatus = 2;
redisDataUtils.setSendCoupon(drawId,0); redisDataUtils.setSendCoupon(drawId,0);*/
// receivingStatus = 3; receivingStatus = 3;
} }
integralActivityDrawVo.setReceivingStatus(receivingStatus); integralActivityDrawVo.setReceivingStatus(receivingStatus);
// redis // redis
...@@ -260,6 +260,11 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg ...@@ -260,6 +260,11 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
Pageable pageable = PageRequest.of(pageNum - 1, pageSize, Sort.by(Sort.Direction.DESC, "createdAt")); Pageable pageable = PageRequest.of(pageNum - 1, pageSize, Sort.by(Sort.Direction.DESC, "createdAt"));
query.with(pageable); query.with(pageable);
List<IntegralActivityDrawVo> integralActivityDrawVos = mongoTemplate.find(query, IntegralActivityDrawVo.class, IntegralActivityDrawVo.class.getSimpleName()); List<IntegralActivityDrawVo> integralActivityDrawVos = mongoTemplate.find(query, IntegralActivityDrawVo.class, IntegralActivityDrawVo.class.getSimpleName());
// mongo
for (IntegralActivityDrawVo drawVo : integralActivityDrawVos) {
IntegralActivityDrawVo drawInfo = redisDataUtils.getIntegralActivityDrawInfo(drawVo.getDrawId());
drawVo.setReceivingStatus(drawInfo.getReceivingStatus());
}
sweetIntegralActivityDrawPagedResult.setList(integralActivityDrawVos).setTotal(count, pageSize).setPageSize(pageSize).setCurrentPage(pageNum); sweetIntegralActivityDrawPagedResult.setList(integralActivityDrawVos).setTotal(count, pageSize).setPageSize(pageSize).setCurrentPage(pageNum);
if (null == integralActivityDrawList) { if (null == integralActivityDrawList) {
redisDataUtils.setIntegralActivityDrawList(currentUid, integralActivityId, integralActivityDrawVos); redisDataUtils.setIntegralActivityDrawList(currentUid, integralActivityId, integralActivityDrawVos);
...@@ -347,7 +352,9 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg ...@@ -347,7 +352,9 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
String mobile = StringUtils.defaultString((String.valueOf(tokenClaims.get(CurrentUtil.TOKEN_MOBILE))), ""); String mobile = StringUtils.defaultString((String.valueOf(tokenClaims.get(CurrentUtil.TOKEN_MOBILE))), "");
String uid = StringUtils.defaultString((String.valueOf(tokenClaims.get(CurrentUtil.TOKEN_SUB))), ""); String uid = StringUtils.defaultString((String.valueOf(tokenClaims.get(CurrentUtil.TOKEN_SUB))), "");
//TODO 可以不判断发送状态 增加个redis 来判断是否发送过 //TODO 可以不判断发送状态 增加个redis 来判断是否发送过
if (null != drawVo && (drawVo.getReceivingStatus() == 1 || drawVo.getReceivingStatus() == 2 && redisDataUtils.isSendCoupon(drawId)) && drawVo.getUserId().equals(uid)) { // if (null != drawVo && (drawVo.getReceivingStatus() == 1 || drawVo.getReceivingStatus() == 2 && redisDataUtils.isSendCoupon(drawId)) && drawVo.getUserId().equals(uid)) {
// TODO: 2021/12/24 jxl 是否有必要判断中奖类型 和 券id是否在配置中
if (null != drawVo && drawVo.getReceivingStatus() != 2 && drawVo.getUserId().equals(uid)) {
// 发放券 // 发放券
LocalDateTime nowTime = LocalDateTime.now(); LocalDateTime nowTime = LocalDateTime.now();
LinkedList<String> sqls = CollectionUtil.linkedListString(); LinkedList<String> sqls = CollectionUtil.linkedListString();
...@@ -372,7 +379,7 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg ...@@ -372,7 +379,7 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
redisDataUtils.updateIntegralActivityDrawInfo(drawId, couponId); redisDataUtils.updateIntegralActivityDrawInfo(drawId, couponId);
//TODO 注释修改券逻辑 //TODO 注释修改券逻辑
redisDataUtils.setSendCoupon(drawId,1); // redisDataUtils.setSendCoupon(drawId,1);
// mongoTemplate.getCollection(IntegralActivityDrawVo.class.getSimpleName()).updateOne( // mongoTemplate.getCollection(IntegralActivityDrawVo.class.getSimpleName()).updateOne(
// Query.query(Criteria.where("drawId").is(drawId)).getQueryObject(), // Query.query(Criteria.where("drawId").is(drawId)).getQueryObject(),
// new Document("$set", new Document("receivingStatus", 2) // new Document("$set", new Document("receivingStatus", 2)
......
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