From 9f6dacf7b39e5aeba37d8faf575c9e56d8cbe51a Mon Sep 17 00:00:00 2001 From: czt <czt18638530771@163.com> Date: 星期六, 11 十月 2025 13:35:42 +0800 Subject: [PATCH] 武汉黄陂军粮-质检报告共享接口同步及推送 --- src/main/java/com/fzzy/push/shjdjw2023/Shjdjw2023HttpClientUtil.java | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/fzzy/push/shjdjw2023/Shjdjw2023HttpClientUtil.java b/src/main/java/com/fzzy/push/shjdjw2023/Shjdjw2023HttpClientUtil.java index d43370f..438c5b2 100644 --- a/src/main/java/com/fzzy/push/shjdjw2023/Shjdjw2023HttpClientUtil.java +++ b/src/main/java/com/fzzy/push/shjdjw2023/Shjdjw2023HttpClientUtil.java @@ -32,7 +32,7 @@ HttpURLConnection connection = null; OutputStream outputStream = null; String rs = ""; - ShjdjwRespDto responseDto; + ShjdjwRespDto responseDto = null; try { connection = (HttpURLConnection) urls.openConnection(); connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); @@ -68,15 +68,17 @@ rs = null; return new ShjdjwRespDto(99,e.getMessage()); } - log.info("---------鎺ュ彛杩斿洖锛�" + rs +"---------"); - if(StringUtils.isEmpty(rs)){ + if(StringUtils.isNotEmpty(rs)){ + rs = rs.replaceAll("\"", ""); + log.info("---------鎺ュ彛杩斿洖锛岀鏂囷細" + rs +"---------"); + rs = AESUtils.decrypt(rs, apiConfs.getPublicKey()); + log.info("---------鎺ュ彛杩斿洖锛岃В鏋愬悗锛�" + rs +"---------"); + responseDto = JSON.parseObject(rs, ShjdjwRespDto.class); + } + if(responseDto == null ) { return new ShjdjwRespDto(99,"鎺ュ彛璇锋眰鍙戠敓鏈煡閿欒"); } - if("dDTJ5xGqsmo32r40WKKPOLW6ORtH3mwMyv4YaJNzc4g=".equals(rs)){ - return new ShjdjwRespDto(1,"涓婃姤鎴愬姛"); - } -// responseDto = JSON.parseObject(rs, ShjdjwRespDto.class); - return new ShjdjwRespDto(1,"涓婃姤鎴愬姛"); + return responseDto; } finally { try { outputStream.close(); -- Gitblit v1.9.3