From c3a86a26058b839967bac13247e6c91e6fe3ddf8 Mon Sep 17 00:00:00 2001 From: zoujiangtao Date: Tue, 10 Dec 2024 17:00:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=86=85=E5=AE=B9=EF=BC=9A?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=20=E5=A4=87=E6=B3=A8?= =?UTF-8?q?=EF=BC=9A=E5=AE=9A=E6=97=B6=E6=8E=A8=E9=80=81=E5=8D=95=E6=8D=AE?= =?UTF-8?q?=E8=87=B3BIP=20=E6=8F=90=E4=BA=A4=E4=BA=BA=EF=BC=9A=E9=82=B9?= =?UTF-8?q?=E6=B1=9F=E6=B6=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/sys/plugin/task/PushTaskPlugin.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/task/PushTaskPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/task/PushTaskPlugin.java index e6990e9..375f092 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/task/PushTaskPlugin.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/task/PushTaskPlugin.java @@ -93,16 +93,18 @@ public class PushTaskPlugin extends AbstractTask implements Plugin { dynamicObjects.forEach(dynamicObject -> { String responseBody = ApiService.paymentSlipsJson(dynamicObject, "BIP"); if (!responseBody.contains("失败")) { - logger.info("推送 → {} → 成功\n推送单据编号:{}\n推送数据:{}", finalBillName, dynamicObject.getString("billno"), responseBody); JSONObject jsonObject = JSON.parseObject(responseBody); - JSONObject data = jsonObject.getJSONObject("data"); - String code = data.getString("code"); - String id = data.getString("id"); - dynamicObject.set("shkd_businessnumber", code); - dynamicObject.set("shkd_businessid", id); - dynamicObject.set("shkd_businessname", "BIP"); - dynamicObject.set("shkd_pushstatus", "已推送"); - objects.add(dynamicObject); + String code = jsonObject.getString("code"); + if ("200".equals(code)) { + JSONObject data = jsonObject.getJSONObject("data"); + dynamicObject.set("shkd_businessnumber", data.getString("code")); + dynamicObject.set("shkd_businessid", data.getString("id")); + dynamicObject.set("shkd_businessname", "BIP"); + dynamicObject.set("shkd_pushstatus", "已推送"); + objects.add(dynamicObject); + } else { + logger.info("推送 → {} → 失败\n失败单据编号:{}\n推送失败接口返回数据:{}", finalBillName, dynamicObject.getString("billno"), responseBody); + } } else { logger.info("推送 → {} → 失败,失败单据编号:{}", finalBillName, dynamicObject.getString("billno")); }