From 7015ea8375bee31504a77d3cebe1cb6fd9261823 Mon Sep 17 00:00:00 2001 From: zoujiangtao Date: Sun, 22 Dec 2024 17:05:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=86=85=E5=AE=B9=EF=BC=9A?= =?UTF-8?q?=E9=93=B6=E4=BC=81=E4=BA=A4=E6=98=93=E6=98=8E=E7=BB=86=EF=BC=8C?= =?UTF-8?q?=E7=94=B5=E5=AD=90=E5=9B=9E=E5=8D=95=E6=9F=A5=E8=AF=A2=E6=8E=A8?= =?UTF-8?q?=E9=80=81BIP=20=E5=A4=87=E6=B3=A8=EF=BC=9A=E9=93=B6=E4=BC=81?= =?UTF-8?q?=E4=BA=A4=E6=98=93=E6=98=8E=E7=BB=86=EF=BC=8C=E7=94=B5=E5=AD=90?= =?UTF-8?q?=E5=9B=9E=E5=8D=95=E6=9F=A5=E8=AF=A2=E6=8E=A8=E9=80=81BIP=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 --- .../java/shkd/sys/sys/mservice/ApiService.java | 16 ++++++++++++---- .../sys/plugin/form/ApiMappingBillPlugin.java | 11 +++++++++-- .../plugin/form/PaymentProcessingBillPlugin.java | 2 +- .../shkd/sys/sys/plugin/task/PushTaskPlugin.java | 6 +++--- 4 files changed, 25 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 6ffe6f6..521d4a7 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 @@ -168,7 +168,7 @@ public class ApiService { * @param systemName 推送系统标识 * @return 推送结果 */ - public static String paymentSlipsJson(DynamicObject dynamic, String systemName, List dynamicObjects) { + public static String paymentSlipsJson(DynamicObject dynamic, String systemName, List dynamicObjects, String requestBody) { // 获取推送的单据标识 String billMark = dynamic.getDataEntityType().getName(); @@ -189,11 +189,9 @@ public class ApiService { String saveUrl = objects[0].getString("shkd_url"); - // 组装请求体数据 - String saveRequestBody = assembleRequestBody(dynamic, objects[0]); - logger.info("请求URL:{}\n组装请求body:{}", saveUrl, saveRequestBody); + String saveRequestBody; String result = null; String saveResponseBody; JSONObject jsonObject; @@ -202,6 +200,16 @@ public class ApiService { String submitUrl; Map submitRequestBody; String submitResponseBody; + + if (requestBody != null) { + // 组装请求体数据 + saveRequestBody = requestBody; + logger.info("请求URL:{}\n组装请求body:{}", saveUrl, saveRequestBody); + } else { + saveRequestBody = assembleRequestBody(dynamic, objects[0]); + logger.info("请求URL:{}\n组装请求body:{}", saveUrl, saveRequestBody); + } + switch (saveUrl) { // 付款处理 case "https://biptestctny.invest.com.cn:8002/iuap-api-auth/yonbip/fi/fundpayment/save": diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiMappingBillPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiMappingBillPlugin.java index 3901914..4f8476b 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiMappingBillPlugin.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiMappingBillPlugin.java @@ -130,13 +130,20 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin { List dynamicObjects = new ArrayList<>(); if ("shkd_testapi".equals(itemKey)) { - String result = ApiService.paymentSlipsJson(billObject, "BIP", dynamicObjects); + String result = ApiService.paymentSlipsJson(billObject, "BIP", dynamicObjects, null); + SaveServiceHelper.save(dynamicObjects.toArray(new DynamicObject[0])); + this.getView().showTipNotification("返回结果:" + result); + } + + if ("shkd_pushjson".equals(itemKey)) { + String requestBody = ApiService.assembleRequestBody(billObject, dataEntity); + String result = ApiService.paymentSlipsJson(billObject, "BIP", dynamicObjects, requestBody); SaveServiceHelper.save(dynamicObjects.toArray(new DynamicObject[0])); this.getView().showTipNotification("返回结果:" + result); } if ("shkd_hitback".equals(itemKey)) { - String result = ApiService.paymentSlipsJson(billObject, "BIPNO", dynamicObjects); + String result = ApiService.paymentSlipsJson(billObject, "BIPNO", dynamicObjects, null); SaveServiceHelper.save(dynamicObjects.toArray(new DynamicObject[0])); this.getView().showTipNotification("返回结果:" + result); } diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/PaymentProcessingBillPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/PaymentProcessingBillPlugin.java index 7152e43..87cacb2 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/PaymentProcessingBillPlugin.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/PaymentProcessingBillPlugin.java @@ -30,7 +30,7 @@ public class PaymentProcessingBillPlugin extends AbstractBillPlugIn implements P String bankpaystatus = dataEntity.getString("bankpaystatus"); if ("TF、NC、OF".contains(bankpaystatus)) { List dynamicObjects = new ArrayList<>(); - String result = ApiService.paymentSlipsJson(dataEntity, "BIPNO", dynamicObjects); + String result = ApiService.paymentSlipsJson(dataEntity, "BIPNO", dynamicObjects, null); if (result.contains("成功")) { SaveServiceHelper.save(dynamicObjects.toArray(new DynamicObject[0])); this.getView().showSuccessNotification("打回成功"); 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 920fb82..91daeef 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 @@ -62,7 +62,7 @@ public class PushTaskPlugin extends AbstractTask implements Plugin { .and("shkd_pushstatus", QCP.not_equals, "结算失败") .and("billstatus", QCP.equals, "D").toArray()); dynamicObjects = Arrays.asList(objects1); - dynamicObjects.forEach(dynamicObject -> ApiService.paymentSlipsJson(dynamicObject, "BIP", dynamicObjectList)); + dynamicObjects.forEach(dynamicObject -> ApiService.paymentSlipsJson(dynamicObject, "BIP", dynamicObjectList, null)); SaveServiceHelper.save(dynamicObjectList.toArray(new DynamicObject[0])); break; // 收款处理 @@ -75,7 +75,7 @@ public class PushTaskPlugin extends AbstractTask implements Plugin { .and("shkd_pushstatus", QCP.not_equals, "已结算") .and("billstatus", QCP.equals, "D").toArray()); dynamicObjects = Arrays.asList(objects2); - dynamicObjects.forEach(dynamicObject -> ApiService.paymentSlipsJson(dynamicObject, "BIP", dynamicObjectList)); + dynamicObjects.forEach(dynamicObject -> ApiService.paymentSlipsJson(dynamicObject, "BIP", dynamicObjectList, null)); break; // 银行收付处理 case "bei_transdetail_cas": @@ -104,7 +104,7 @@ public class PushTaskPlugin extends AbstractTask implements Plugin { .and("shkd_pushstatus", QCP.equals, "结算失败").toArray()); dynamicObjects = Arrays.asList(objects4); dynamicObjects.addAll(Arrays.asList(objects5)); - dynamicObjects.forEach(dynamicObject -> ApiService.paymentSlipsJson(dynamicObject, "BIPNO", dynamicObjectList)); + dynamicObjects.forEach(dynamicObject -> ApiService.paymentSlipsJson(dynamicObject, "BIPNO", dynamicObjectList, null)); SaveServiceHelper.save(dynamicObjectList.toArray(new DynamicObject[0])); default: }