重构评论
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user