礼金过期
This commit is contained in:
@@ -947,6 +947,9 @@ public class JDUtil {
|
||||
result.append(" ").append(skuName).append(" 礼金创建成功\n");
|
||||
if (giftKey == null) {
|
||||
result.append(" ").append(skuName).append(" 礼金创建失败但是转链成功\n");
|
||||
}else {
|
||||
// 将开通成功的怼进去redis 做一个定时调度去扫描,如果礼金今天会过期,就发送通知,需要判断是自营还是pop,pop礼金有效期是7天
|
||||
saveGiftCouponToRedis(skuId, giftKey, skuName, owner);
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -966,7 +969,22 @@ public class JDUtil {
|
||||
cacheMap.remove("finalWenAn" + wxid);
|
||||
}
|
||||
}
|
||||
/*
|
||||
将礼金信息写入 Redis **/
|
||||
public void saveGiftCouponToRedis(String skuId, String giftKey, String skuName, String owner) {
|
||||
String key = "gift_coupon:" + skuId ;
|
||||
String hashKey = giftKey;
|
||||
LocalDateTime expireTime = LocalDateTime.now().plus(owner.equals("g") ? 0 : 7, ChronoUnit.DAYS);
|
||||
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("giftKey", giftKey);
|
||||
data.put("skuName", skuName);
|
||||
data.put("owner", owner);
|
||||
data.put("expireTime", expireTime.format(DateTimeFormatter.ISO_DATE_TIME));
|
||||
|
||||
// 存入 Redis Hash
|
||||
redisTemplate.opsForHash().put(key, hashKey, JSON.toJSONString(data));
|
||||
}
|
||||
/**
|
||||
* 处理用户输入的推广方案内容
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user