From 8a7b05e0683ff738233d39295e4ad169b72efc95 Mon Sep 17 00:00:00 2001 From: jiazx0107@163.com <jiazx0107@163.com> Date: 星期六, 18 十一月 2023 16:17:48 +0800 Subject: [PATCH] 调整车牌识别配置2 --- src/main/java/com/fzzy/protocol/weightyh/GatewaySyncWeightImplHttp.java | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/fzzy/protocol/weightyh/GatewaySyncWeightImplHttp.java b/src/main/java/com/fzzy/protocol/weightyh/GatewaySyncWeightImplHttp.java index c64add6..7f73839 100644 --- a/src/main/java/com/fzzy/protocol/weightyh/GatewaySyncWeightImplHttp.java +++ b/src/main/java/com/fzzy/protocol/weightyh/GatewaySyncWeightImplHttp.java @@ -50,14 +50,20 @@ log.debug("--HTTP-WEIGHT-璇锋眰杩斿洖--{}", responseText); + if(StringUtils.isEmpty(responseText)) { + return new BaseResp(500, "鍚庡彴鎵ц澶辫触"); + } + JSONObject resp; + String jsonStr; //璇存槑鏄疛SONP鏍煎紡-jsonpCallback({"content":""}) if (responseText.indexOf("jsonpCallback") >= 0) { - responseText = responseText.substring(responseText.indexOf("(") + 1, responseText.length() - 1); - resp = JSONObject.parseObject(responseText); + jsonStr = responseText.substring(responseText.indexOf("(") + 1, responseText.length() - 1); + resp = JSONObject.parseObject(jsonStr); resp.put("code", "200"); } else { - resp = JSONObject.parseObject(responseText); + jsonStr = responseText; + resp = JSONObject.parseObject(jsonStr); } if ("200".equals(resp.get("code"))) { @@ -73,7 +79,7 @@ gatewayRemoteManager.getDeviceReportService(device.getPushProtocol()).reportWeightData(reqData); } } catch (Exception e) { - log.error("--------------鍦扮-HTTP鍗忚鎵ц寮傚父----{}", e.getMessage()); + log.error("--------------鍦扮-HTTP鍗忚鎵ц寮傚父----{}", e); } return new BaseResp(500, "鍚庡彴鎵ц澶辫触"); } -- Gitblit v1.9.3