录单
This commit is contained in:
@@ -548,10 +548,10 @@ public class JDScheduleJob {
|
|||||||
hashOps.putAll(key, hours.stream().collect(Collectors.toMap(h -> h, h -> "1")));
|
hashOps.putAll(key, hours.stream().collect(Collectors.toMap(h -> h, h -> "1")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Scheduled(cron = "0 0 0,8 * * ?")
|
@Scheduled(cron = "0 0 0 * * ?")
|
||||||
public void checkGiftCouponsExpiry() {
|
public void checkGiftCouponsExpiry() {
|
||||||
Set<String> keys = redisTemplate.keys("gift_coupon:*");
|
Set<String> keys = redisTemplate.keys("gift_coupon:*");
|
||||||
if (keys == null || keys.isEmpty()) return;
|
if (keys.isEmpty()) return;
|
||||||
|
|
||||||
for (String key : keys) {
|
for (String key : keys) {
|
||||||
Map<Object, Object> entries = redisTemplate.opsForHash().entries(key);
|
Map<Object, Object> entries = redisTemplate.opsForHash().entries(key);
|
||||||
@@ -578,6 +578,7 @@ public class JDScheduleJob {
|
|||||||
if (isAboutToExpire) {
|
if (isAboutToExpire) {
|
||||||
String message = String.format("[礼金提醒]\n商品:%s\n礼金Key:%s\n类型:%s\n将在 %s 过期", skuName, giftKey, "g".equals(owner) ? "自营" : "POP", expireTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")));
|
String message = String.format("[礼金提醒]\n商品:%s\n礼金Key:%s\n类型:%s\n将在 %s 过期", skuName, giftKey, "g".equals(owner) ? "自营" : "POP", expireTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")));
|
||||||
wxUtil.sendTextMessage(WXUtil.default_super_admin_wxid, message, 1, "bot", false);
|
wxUtil.sendTextMessage(WXUtil.default_super_admin_wxid, message, 1, "bot", false);
|
||||||
|
redisTemplate.delete(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user