重构评论

This commit is contained in:
Van0313
2025-05-14 12:56:24 +08:00
parent a25e78715f
commit 69db3d68d5
2 changed files with 12 additions and 0 deletions

View File

@@ -198,6 +198,7 @@ public class JDScheduleJob {
Arrays.stream(response.getQueryResult().getData()).parallel().map(this::createOrderRow).forEach(orderRowRepository::save);
}
public int fetchOrders(OrderFetchStrategy strategy, String appKey, String secretKey) {
TimeRange range = strategy.calculateRange(LocalDateTime.now());
int count = 0;
@@ -304,6 +305,9 @@ public class JDScheduleJob {
OrderFetchStrategy strategy = new Days3090Strategy();
for (WXUtil.SuperAdmin admin : super_admins.values()) {
try {
if (Util.isAnyEmpty(admin.getAppKey(), admin.getSecretKey())){
continue;
}
int count = fetchOrders(strategy, admin.getAppKey(), admin.getSecretKey());
logger.info("账号{} 3090订单拉取完成新增{}条", admin.getName(), count);
} catch (Exception e) {
@@ -328,6 +332,9 @@ public class JDScheduleJob {
OrderFetchStrategy strategy = new Days1430Strategy(); // 需补充Days1430Strategy实现
for (WXUtil.SuperAdmin admin : super_admins.values()) {
try {
if (Util.isAnyEmpty(admin.getAppKey(), admin.getSecretKey())){
continue;
}
int count = fetchOrders(strategy, admin.getAppKey(), admin.getSecretKey());
logger.info("账号{} 1430订单拉取完成新增{}条", admin.getName(), count);
} catch (Exception e) {