From 5c9223ef1c58f5f40fc59d7a0b6f86a1f0ede126 Mon Sep 17 00:00:00 2001 From: zoujiangtao Date: Wed, 25 Dec 2024 11:01:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=86=85=E5=AE=B9=EF=BC=9A?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=94=B5=E5=AD=90=E5=9B=9E=E5=8D=95=E9=99=84?= =?UTF-8?q?=E4=BB=B6URL=20=E5=A4=87=E6=B3=A8=EF=BC=9A=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=94=B5=E5=AD=90=E5=9B=9E=E5=8D=95=E9=99=84=E4=BB=B6URL=20?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=BA=EF=BC=9A=E9=82=B9=E6=B1=9F=E6=B6=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shkd/sys/sys/mservice/ApiService.java | 5 ++--- .../HitBackOperationServicePlugin.java | 21 ++++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/mservice/ApiService.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/mservice/ApiService.java index bc7d3a9..07cef59 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/mservice/ApiService.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/mservice/ApiService.java @@ -204,7 +204,6 @@ public class ApiService { String saveUrl = objects[0].getString("shkd_url"); - String saveRequestBody; String result = null; String saveResponseBody; @@ -315,11 +314,11 @@ public class ApiService { dynamicObjects.add(dynamic); logger.info("付款处理(支付结果) → BIP推送接口 → 成功\n成功单据编号:{}\n成功请求体:{}\n推送成功接口返回数据:{}", dynamic.getString("billno"), saveRequestBody, saveResponseBody); - result = "推送 → 付款处理(支付结果) → 成功"; + result = "推送 → 付款处理(支付结果) → 成功,返回信息:"; } else { logger.info("付款处理(支付结果) → BIP推送接口 → 失败\n失败单据编号:{}\n失败请求体:{}\n推送失败接口返回数据:{}", dynamic.getString("billno"), saveRequestBody, saveResponseBody); - result = "推送 → 付款处理(支付结果) → 失败"; + result = "推送 → 付款处理(支付结果) → 失败,返回信息:" + JSON.parseObject(saveResponseBody).getString("message"); } break; // 电子回单 diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/HitBackOperationServicePlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/HitBackOperationServicePlugin.java index 6c506c8..74ea538 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/HitBackOperationServicePlugin.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/HitBackOperationServicePlugin.java @@ -39,7 +39,6 @@ public class HitBackOperationServicePlugin extends AbstractOperationServicePlugI "shkd_pushstatus,shkd_businessnumber,shkd_businessid,shkd_businessname,billstatus,bankpaystatus" , new QFilter("id", QCP.in, pkValue) .and("billstatus", QCP.equals, "C")//已审核 - .and("shkd_pushstatus", QCP.equals, "未结算") .and("shkd_businessname", QCP.equals, "共享系统").toArray()); if (objects == null || objects.length == 0) { args.setCancel(true); @@ -48,23 +47,31 @@ public class HitBackOperationServicePlugin extends AbstractOperationServicePlugI StringBuilder stringBuilder = new StringBuilder(); for (DynamicObject dynamicObject : objects) { String bankpaystatus = dynamicObject.getString("bankpaystatus"); + if (!"未结算".equals(dynamicObject.getString("shkd_pushstatus"))) { + args.setCancel(true); + args.setCancelMessage("打回失败,该单据结算结果已被推送"); + return; + } + if ("TF、NC、OF".contains(bankpaystatus)) { List dynamicObjects = new ArrayList<>(); String result = ApiService.paymentSlipsJson(dynamicObject, "BIPNO", dynamicObjects, null); logger.info("result信息:{}", result); if (result.contains("成功")) { SaveServiceHelper.save(dynamicObjects.toArray(new DynamicObject[0])); - stringBuilder.append("单据编号:" + dynamicObject.getString("billno") + " → 打回成功\n"); + stringBuilder.append(result); + return; } else { - stringBuilder.append("单据编号:" + dynamicObject.getString("billno") + "打回失败\n"); + args.setCancel(true); + args.setCancelMessage(result); + return; } } else { - stringBuilder.append("单据编号:" + dynamicObject.getString("billno") + "打回失败,请确认银行支付状态\n"); + args.setCancel(true); + args.setCancelMessage("打回失败,请确认银行支付状态"); + return; } } - logger.info("打回结果:\n" + stringBuilder); - args.setCancel(true); - args.setCancelMessage(stringBuilder.toString()); } } } \ No newline at end of file