From a9bf63b0d0a721a0518206258348d11c495ec90f Mon Sep 17 00:00:00 2001 From: zichun <26684461+reporkey@users.noreply.github.com> Date: Tue, 28 Jul 2026 00:21:31 +0800 Subject: [PATCH] fix(erp): unwrap execStaging result from ERP response envelope (dataset.rows[0]) --- src/main/java/com/xly/service/ErpClient.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/xly/service/ErpClient.java b/src/main/java/com/xly/service/ErpClient.java index 2aa4056..c7d3851 100644 --- a/src/main/java/com/xly/service/ErpClient.java +++ b/src/main/java/com/xly/service/ErpClient.java @@ -251,7 +251,13 @@ public class ErpClient { .POST(HttpRequest.BodyPublishers.ofString("{}", StandardCharsets.UTF_8)) .build(); HttpResponse resp = http.send(req, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); - return mapper.readTree(resp.body()); + JsonNode root = mapper.readTree(resp.body()); + if (root.has("status")) { + return root; + } + // ERP 统一响应包装:真实结果 {status,msg,billId} 在 dataset.rows[0] + JsonNode row = root.path("dataset").path("rows").path(0); + return row.isObject() ? row : root; } catch (Exception e) { throw new RuntimeException("ERP 暂存执行异常: " + e.getMessage(), e); } -- libgit2 0.22.2