From 271c5a94e01579f991770b18fdcd4b42b1efd8e9 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Tue, 13 Jun 2023 15:13:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/v1/NotifyController.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/open-api/src/main/java/com/api/controller/v1/NotifyController.java b/open-api/src/main/java/com/api/controller/v1/NotifyController.java index 6dd5f24..fb075f6 100644 --- a/open-api/src/main/java/com/api/controller/v1/NotifyController.java +++ b/open-api/src/main/java/com/api/controller/v1/NotifyController.java @@ -49,7 +49,7 @@ public class NotifyController { public void lakala(@RequestBody String reqBody, HttpServletResponse response) { try { log.info("========= Start 拉卡拉交易通知 Start ==========="); - log.info("平台接收拉卡拉交易通知:", reqBody); + log.info("平台接收拉卡拉交易通知:" + reqBody); System.out.println(reqBody); JSONObject body = JSONObject.parseObject(reqBody); @@ -88,14 +88,18 @@ public class NotifyController { responseQueryTradeModel.setAttach(tradeOrder.getAttach()); responseQueryTradeModel.setSign(SignatureUtil.createSign(responseQueryTradeModel, merKeyService.getKeyByMerNo(tradeOrder.getMerNo()))); - log.info("发送URL:", order.getPayNotifyUrl()); - log.info("发送参数:", JSONObject.toJSONString(responseQueryTradeModel)); + log.info("发送URL:" + order.getPayNotifyUrl()); + log.info("发送参数:" + JSONObject.toJSONString(responseQueryTradeModel)); JSONObject result = HttpsUtils.doPost(order.getPayNotifyUrl(), JSONObject.toJSONString(responseQueryTradeModel)); - log.info("响应参数:", result); - BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream()); - out.write(result.toJSONString().getBytes()); - out.flush(); - out.close(); + if (result != null) { + log.info("响应参数:" + result); + BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream()); + out.write(result.toJSONString().getBytes()); + out.flush(); + out.close(); + } else { + log.info("响应参数:null"); + } } } catch (Exception e) {