From 044ee513806026dc94c8c82cd79b7d2744b704e6 Mon Sep 17 00:00:00 2001
From: zc <zyzc>
Date: 星期五, 31 十月 2025 15:54:13 +0800
Subject: [PATCH] 打开上报接口
---
rsf-open-api/src/main/java/com/vincent/rsf/openApi/service/impl/WmsErpServiceImpl.java | 26 ++++++++++++--------------
1 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/rsf-open-api/src/main/java/com/vincent/rsf/openApi/service/impl/WmsErpServiceImpl.java b/rsf-open-api/src/main/java/com/vincent/rsf/openApi/service/impl/WmsErpServiceImpl.java
index 1b1c596..61529c0 100644
--- a/rsf-open-api/src/main/java/com/vincent/rsf/openApi/service/impl/WmsErpServiceImpl.java
+++ b/rsf-open-api/src/main/java/com/vincent/rsf/openApi/service/impl/WmsErpServiceImpl.java
@@ -237,23 +237,21 @@
log.info("宸插畬鎴愯鍗曚笂浼狅細{}锛� 璇锋眰鍙傛暟锛� {}", rcsUrl, httpEntity.getBody());
ResponseEntity<String> exchange = restTemplate.exchange(rcsUrl, HttpMethod.POST, httpEntity, String.class);
- log.info("宸插畬鎴愯鍗曚笂浼狅紝璇锋眰缁撴灉锛� {}", exchange);
+ log.info("宸插畬鎴愯鍗曚笂浼狅紝璇锋眰缁撴灉锛� {}", exchange.getBody());
if (Objects.isNull(exchange.getBody())) {
throw new CoolException("涓婁紶澶辫触锛侊紒");
} else {
- ObjectMapper objectMapper = new ObjectMapper();
- objectMapper.coercionConfigDefaults().setCoercion(CoercionInputShape.EmptyString, CoercionAction.AsEmpty);
- try {
- CommonResponse commonResponse = new CommonResponse();
- ErpCommonResponse result = objectMapper.readValue(exchange.getBody(), ErpCommonResponse.class);
- if (!result.getIsError()) {
- commonResponse.setCode(200).setMsg(result.getMessage()).setData(result.getData());
- return commonResponse;
- } else {
- throw new CoolException("涓婁紶澶辫触锛侊紒");
- }
- } catch (JsonProcessingException e) {
- throw new CoolException(e.getMessage());
+// ObjectMapper objectMapper = new ObjectMapper();
+// objectMapper.coercionConfigDefaults().setCoercion(CoercionInputShape.EmptyString, CoercionAction.AsEmpty);
+ CommonResponse commonResponse = new CommonResponse();
+////
+// ErpCommonResponse result = objectMapper.readValue(exchange.getBody(), ErpCommonResponse.class);
+ ErpCommonResponse result = JSONObject.parseObject(exchange.getBody(), ErpCommonResponse.class);
+ if (!result.getIsError()) {
+ commonResponse.setCode(200).setMsg(result.getMessage()).setData(result.getData());
+ return commonResponse;
+ } else {
+ throw new CoolException("涓婁紶澶辫触锛侊紒");
}
}
}
--
Gitblit v1.9.1