This commit is contained in:
雷欧(林平凡)
2024-12-02 11:12:05 +08:00
parent 641d52902a
commit 4f28f15406

View File

@@ -52,6 +52,8 @@ public class JDUtils {
"98e21c89ae5610240ec3f5f575f86a59"; "98e21c89ae5610240ec3f5f575f86a59";
private static final String SECRET_KEY = private static final String SECRET_KEY =
"3dcb6b23a1104639ac433fd07adb6dfb"; "3dcb6b23a1104639ac433fd07adb6dfb";
//标记唯一订单行:订单+sku维度的唯一标识
private static final String JD_REFRESH_TAG = "jd:refresh:tag:";
// 导购的 // 导购的
//private static final String APP_KEY = "faf410cb9587dc80dc7b31e321d7d322"; //private static final String APP_KEY = "faf410cb9587dc80dc7b31e321d7d322";
//private static final String SECRET_KEY = //private static final String SECRET_KEY =
@@ -287,14 +289,14 @@ public class JDUtils {
LocalDateTime endTime = isRealTime ? startTime.plusMinutes(50) : startTime.plusHours(1); LocalDateTime endTime = isRealTime ? startTime.plusMinutes(50) : startTime.plusHours(1);
String hourMinuteTag = isRealTime ? "minute" : "hour"; String hourMinuteTag = isRealTime ? "minute" : "hour";
String timeTag = startTime.format(DATE_TIME_FORMATTER); String timeTag = JD_REFRESH_TAG + startTime.format(DATE_TIME_FORMATTER);
HashOperations<String, String, String> hashOps = redisTemplate.opsForHash(); HashOperations<String, String, String> hashOps = redisTemplate.opsForHash();
// 检查这个小时或分钟是否已经被处理过 // 检查这个小时或分钟是否已经被处理过
if (hashOps.hasKey(timeTag, hourMinuteTag)) { //if (hashOps.hasKey(timeTag, hourMinuteTag)) {
return null; // return null;
} //}
// 调用 API 以拉取订单 // 调用 API 以拉取订单
UnionOpenOrderRowQueryResponse unionOpenOrderRowQueryResponse = getUnionOpenOrderRowQueryResponse(startTime, endTime, page); UnionOpenOrderRowQueryResponse unionOpenOrderRowQueryResponse = getUnionOpenOrderRowQueryResponse(startTime, endTime, page);