cl
7 天以前 8f9e9aadb79db1ad349e4988a2e302b02c3b962b
#上报 过滤
2个文件已修改
20 ■■■■■ 已修改文件
rsf-server/src/main/java/com/vincent/rsf/server/manager/schedules/CloudWmsNotifySchedule.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/CloudWmsNotifyLogServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/manager/schedules/CloudWmsNotifySchedule.java
@@ -109,11 +109,9 @@
            responseJson = String.valueOf(res);
        }
        Object codeObj = res != null ? res.get("code") : null;
        boolean success = Integer.valueOf(200).equals(codeObj);
        int status = success ? cloudWmsNotifyLogService.getNotifyStatusSuccess() : cloudWmsNotifyLogService.getNotifyStatusPending();
        if (!success && !isInfiniteRetry(effectiveMaxRetry) && nextRetry >= effectiveMaxRetry) {
            status = cloudWmsNotifyLogService.getNotifyStatusFail();
        }
        Object statusObj = res != null ? res.get("status") : null;
        boolean success = Integer.valueOf(200).equals(codeObj) || Integer.valueOf(200).equals(statusObj);
        int status = success ? cloudWmsNotifyLogService.getNotifyStatusSuccess() : cloudWmsNotifyLogService.getNotifyStatusFail();
        logRecord.setLastRequestBody(requestBody);
        logRecord.setLastResponseBody(responseJson);
        logRecord.setLastNotifyTime(now);
@@ -131,9 +129,10 @@
        logRecord.setLastNotifyTime(now);
        logRecord.setRetryCount(nextRetry);
        // logRecord.setNotifyStatus(nextRetry >= effectiveMaxRetry ? cloudWmsNotifyLogService.getNotifyStatusFail() : cloudWmsNotifyLogService.getNotifyStatusPending());
        logRecord.setNotifyStatus(!isInfiniteRetry(effectiveMaxRetry) && nextRetry >= effectiveMaxRetry
        int status = !isInfiniteRetry(effectiveMaxRetry) && nextRetry >= effectiveMaxRetry
                ? cloudWmsNotifyLogService.getNotifyStatusFail()
                : cloudWmsNotifyLogService.getNotifyStatusPending());
                : cloudWmsNotifyLogService.getNotifyStatusPending();
        logRecord.setNotifyStatus(status);
        logRecord.setUpdateTime(now);
        cloudWmsNotifyLogService.updateById(logRecord);
        log.warn("云仓上报失败,id={},bizRef={},attempt={},notifyStatus={},error={}",
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/CloudWmsNotifyLogServiceImpl.java
@@ -23,9 +23,11 @@
    @Override
    public List<CloudWmsNotifyLog> listPending(int limit, int maxRetry) {
        Page<CloudWmsNotifyLog> page = new Page<>(1, Math.max(1, limit));
        // .lt(CloudWmsNotifyLog::getRetryCount, maxRetry)
        LambdaQueryWrapper<CloudWmsNotifyLog> wrapper = new LambdaQueryWrapper<CloudWmsNotifyLog>()
                .eq(CloudWmsNotifyLog::getNotifyStatus, getNotifyStatusPending())
                // 仅查询数据库配置状态:待通知 + 失败(可重试)
                .in(CloudWmsNotifyLog::getNotifyStatus, getNotifyStatusPending(), getNotifyStatusFail())
                // 仅查询可重试数据:无限重试、未配置上限、或未达到上限
                .apply("(max_retry_count IS NULL OR max_retry_count = -1 OR retry_count < max_retry_count)")
                .orderByAsc(CloudWmsNotifyLog::getId);
        if (maxRetry >= 0) {
            wrapper.lt(CloudWmsNotifyLog::getRetryCount, maxRetry);
@@ -75,6 +77,7 @@
    public void fillFromConfig(CloudWmsNotifyLog log) {
        Integer maxRetry = getConfigInt(GlobalConfigCode.CLOUD_WMS_NOTIFY_MAX_RETRY);
        Integer interval = getConfigInt(GlobalConfigCode.CLOUD_WMS_NOTIFY_RETRY_INTERVAL_SECONDS);
        log.setNotifyStatus(getNotifyStatusPending());
        log.setMaxRetryCount(maxRetry);
        log.setRetryIntervalSeconds(interval);
    }