This commit is contained in:
Van0313
2025-07-05 21:15:53 +08:00
parent 61fcedf5d7
commit 543f85d9a5

View File

@@ -548,10 +548,10 @@ public class JDScheduleJob {
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() {
Set<String> keys = redisTemplate.keys("gift_coupon:*");
if (keys == null || keys.isEmpty()) return;
if (keys.isEmpty()) return;
for (String key : keys) {
Map<Object, Object> entries = redisTemplate.opsForHash().entries(key);
@@ -578,6 +578,7 @@ public class JDScheduleJob {
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")));
wxUtil.sendTextMessage(WXUtil.default_super_admin_wxid, message, 1, "bot", false);
redisTemplate.delete(key);
}
}
}