提交内容:获取电子回单附件URL

备注:获取电子回单附件URL
提交人:邹江涛
This commit is contained in:
zoujiangtao 2024-12-25 11:01:41 +08:00
parent 8b31f009f8
commit 5c9223ef1c
2 changed files with 16 additions and 10 deletions

View File

@ -204,7 +204,6 @@ public class ApiService {
String saveUrl = objects[0].getString("shkd_url"); String saveUrl = objects[0].getString("shkd_url");
String saveRequestBody; String saveRequestBody;
String result = null; String result = null;
String saveResponseBody; String saveResponseBody;
@ -315,11 +314,11 @@ public class ApiService {
dynamicObjects.add(dynamic); dynamicObjects.add(dynamic);
logger.info("付款处理(支付结果) → BIP推送接口 → 成功\n成功单据编号{}\n成功请求体{}\n推送成功接口返回数据{}", logger.info("付款处理(支付结果) → BIP推送接口 → 成功\n成功单据编号{}\n成功请求体{}\n推送成功接口返回数据{}",
dynamic.getString("billno"), saveRequestBody, saveResponseBody); dynamic.getString("billno"), saveRequestBody, saveResponseBody);
result = "推送 → 付款处理(支付结果) → 成功"; result = "推送 → 付款处理(支付结果) → 成功,返回信息:";
} else { } else {
logger.info("付款处理(支付结果) → BIP推送接口 → 失败\n失败单据编号{}\n失败请求体{}\n推送失败接口返回数据{}", logger.info("付款处理(支付结果) → BIP推送接口 → 失败\n失败单据编号{}\n失败请求体{}\n推送失败接口返回数据{}",
dynamic.getString("billno"), saveRequestBody, saveResponseBody); dynamic.getString("billno"), saveRequestBody, saveResponseBody);
result = "推送 → 付款处理(支付结果) → 失败"; result = "推送 → 付款处理(支付结果) → 失败,返回信息:" + JSON.parseObject(saveResponseBody).getString("message");
} }
break; break;
// 电子回单 // 电子回单

View File

@ -39,7 +39,6 @@ public class HitBackOperationServicePlugin extends AbstractOperationServicePlugI
"shkd_pushstatus,shkd_businessnumber,shkd_businessid,shkd_businessname,billstatus,bankpaystatus" "shkd_pushstatus,shkd_businessnumber,shkd_businessid,shkd_businessname,billstatus,bankpaystatus"
, new QFilter("id", QCP.in, pkValue) , new QFilter("id", QCP.in, pkValue)
.and("billstatus", QCP.equals, "C")//已审核 .and("billstatus", QCP.equals, "C")//已审核
.and("shkd_pushstatus", QCP.equals, "未结算")
.and("shkd_businessname", QCP.equals, "共享系统").toArray()); .and("shkd_businessname", QCP.equals, "共享系统").toArray());
if (objects == null || objects.length == 0) { if (objects == null || objects.length == 0) {
args.setCancel(true); args.setCancel(true);
@ -48,23 +47,31 @@ public class HitBackOperationServicePlugin extends AbstractOperationServicePlugI
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
for (DynamicObject dynamicObject : objects) { for (DynamicObject dynamicObject : objects) {
String bankpaystatus = dynamicObject.getString("bankpaystatus"); String bankpaystatus = dynamicObject.getString("bankpaystatus");
if (!"未结算".equals(dynamicObject.getString("shkd_pushstatus"))) {
args.setCancel(true);
args.setCancelMessage("打回失败,该单据结算结果已被推送");
return;
}
if ("TF、NC、OF".contains(bankpaystatus)) { if ("TF、NC、OF".contains(bankpaystatus)) {
List<DynamicObject> dynamicObjects = new ArrayList<>(); List<DynamicObject> dynamicObjects = new ArrayList<>();
String result = ApiService.paymentSlipsJson(dynamicObject, "BIPNO", dynamicObjects, null); String result = ApiService.paymentSlipsJson(dynamicObject, "BIPNO", dynamicObjects, null);
logger.info("result信息{}", result); logger.info("result信息{}", result);
if (result.contains("成功")) { if (result.contains("成功")) {
SaveServiceHelper.save(dynamicObjects.toArray(new DynamicObject[0])); SaveServiceHelper.save(dynamicObjects.toArray(new DynamicObject[0]));
stringBuilder.append("单据编号:" + dynamicObject.getString("billno") + " → 打回成功\n"); stringBuilder.append(result);
return;
} else { } else {
stringBuilder.append("单据编号:" + dynamicObject.getString("billno") + "打回失败\n"); args.setCancel(true);
args.setCancelMessage(result);
return;
} }
} else { } else {
stringBuilder.append("单据编号:" + dynamicObject.getString("billno") + "打回失败,请确认银行支付状态\n"); args.setCancel(true);
args.setCancelMessage("打回失败,请确认银行支付状态");
return;
} }
} }
logger.info("打回结果:\n" + stringBuilder);
args.setCancel(true);
args.setCancelMessage(stringBuilder.toString());
} }
} }
} }