This commit is contained in:
Van0313
2025-04-27 16:58:00 +08:00
parent c6f64218db
commit d55eacd0b1

View File

@@ -1556,11 +1556,12 @@ public class JDUtil {
// 今天的日期 // 今天的日期
String today = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd ")); String today = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd "));
String redisKey = "order_count:" + today; String redisKey = "order_count:" + today;
Integer count = 1; Integer count;
try { try {
// 从 Redis 获取当前日期的订单计数器 // 从 Redis 获取当前日期的订单计数器
String s = redisTemplate.opsForValue().get(redisKey); String s = redisTemplate.opsForValue().get(redisKey);
count = s != null ? Integer.parseInt(s) : 1;
Integer num = 1; Integer num = 1;
try { try {
num = Integer.valueOf(split[4].trim()); num = Integer.valueOf(split[4].trim());
@@ -1569,7 +1570,7 @@ public class JDUtil {
} }
for (int i = 0; i < num; i++) { for (int i = 0; i < num; i++) {
if (s != null) { if (s != null) {
count = num + 1; // 递增计数器 count++; // 递增计数器
} }
// 将新的计数器值保存回 Redis // 将新的计数器值保存回 Redis
@@ -1680,7 +1681,6 @@ private void generateComment(String fromWxid, String productType) {
} }
// 定义一个内部类来存储用户交互状态 // 定义一个内部类来存储用户交互状态
@Getter @Getter
@Setter @Setter