重构评论

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

View File

@@ -174,6 +174,11 @@ public class WXUtil {
jdidToWxidMap.put(admin10.getUnionId(), admin10.getWxid()); jdidToWxidMap.put(admin10.getUnionId(), admin10.getWxid());
jdidToRemarkMap.put(admin10.getUnionId(), admin10.getName()); jdidToRemarkMap.put(admin10.getUnionId(), admin10.getName());
//102|12:50:55|wxid_kr145nk7l0an31|收到私聊|1
SuperAdmin admin11 = new SuperAdmin("wxid_cfmrk2upjtf322", "0213", "", "", "");
super_admins.put(admin11.getWxid() + admin11.getUnionId(), admin11);
/* 内部管理群 */ /* 内部管理群 */
// 方案 // 方案