提交人:邹江涛

时间:2025-11-24 16:52
提交内容:打回日志提示调整
This commit is contained in:
Tao 2025-12-09 18:13:23 +08:00
parent 6548adf296
commit 0358e37457
1 changed files with 25 additions and 2 deletions

View File

@ -45,7 +45,6 @@ public class PaymentProcessingListPlugin extends AbstractListPlugin implements P
ListSelectedRowCollection selectedRows = list.getSelectedRows(); ListSelectedRowCollection selectedRows = list.getSelectedRows();
if ("hitback".equals(operateKey)) { if ("hitback".equals(operateKey)) {
logger.info("进入打回操作 → hitback");
if (selectedRows.isEmpty()) { if (selectedRows.isEmpty()) {
this.getView().showTipNotification("请选择一条数据"); this.getView().showTipNotification("请选择一条数据");
return; return;
@ -57,6 +56,8 @@ public class PaymentProcessingListPlugin extends AbstractListPlugin implements P
Object primaryKeyValue = listSelectedRow.getPrimaryKeyValue(); Object primaryKeyValue = listSelectedRow.getPrimaryKeyValue();
DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(primaryKeyValue, "cas_paybill"); DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(primaryKeyValue, "cas_paybill");
DynamicObject loadSingle = BusinessDataServiceHelper.loadSingle(dynamicObject.getDynamicObjectType().getName(), "id,billno,name,billstatus,shkd_businessname", new QFilter("id", QCP.equals, dynamicObject.getPkValue()).toArray()); DynamicObject loadSingle = BusinessDataServiceHelper.loadSingle(dynamicObject.getDynamicObjectType().getName(), "id,billno,name,billstatus,shkd_businessname", new QFilter("id", QCP.equals, dynamicObject.getPkValue()).toArray());
String billno = loadSingle.getString("billno");
logger.info("进入打回操作 → hitback\nbillno:{}", billno);
Object businessname = loadSingle.get("shkd_businessname"); Object businessname = loadSingle.get("shkd_businessname");
String billstatus = loadSingle.getString("billstatus"); String billstatus = loadSingle.getString("billstatus");
if (businessname != null) { if (businessname != null) {
@ -79,7 +80,12 @@ public class PaymentProcessingListPlugin extends AbstractListPlugin implements P
if (pushResult.contains("成功")) { if (pushResult.contains("成功")) {
SaveServiceHelper.save(dynamicObjects.toArray(new DynamicObject[0])); SaveServiceHelper.save(dynamicObjects.toArray(new DynamicObject[0]));
} else { } else {
this.getView().showTipNotification("打回失败失败原因调用BIP打回接口失败"); String returnResults = extractMessageFromResult(pushResult);
if (!returnResults.isEmpty()) {
this.getView().showTipNotification("打回失败失败原因BIP单据" + returnResults);
} else {
this.getView().showTipNotification("打回失败,请找业务老师处理");
}
return; return;
} }
} }
@ -90,24 +96,41 @@ public class PaymentProcessingListPlugin extends AbstractListPlugin implements P
operation = OperationServiceHelper.executeOperate("unaudit", "cas_paybill", new DynamicObject[]{dynamicObject}, OperateOption.create()); operation = OperationServiceHelper.executeOperate("unaudit", "cas_paybill", new DynamicObject[]{dynamicObject}, OperateOption.create());
} else { } else {
this.getView().showTipNotification("单据不为已提交或已审核状态,无法打回"); this.getView().showTipNotification("单据不为已提交或已审核状态,无法打回");
logger.info("单据:{}打回失败,失败原因:单据不为已提交或已审核状态", billno);
return; return;
} }
List<IOperateInfo> allErrorOrValidateInfo = operation.getAllErrorOrValidateInfo(); List<IOperateInfo> allErrorOrValidateInfo = operation.getAllErrorOrValidateInfo();
if (!allErrorOrValidateInfo.isEmpty()) { if (!allErrorOrValidateInfo.isEmpty()) {
this.getView().showTipNotification("打回失败,失败原因:撤销(反审核)操作失败 → " + allErrorOrValidateInfo.get(0).getMessage()); this.getView().showTipNotification("打回失败,失败原因:撤销(反审核)操作失败 → " + allErrorOrValidateInfo.get(0).getMessage());
logger.info("单据:{}打回失败,失败原因:撤销(反审核)操作失败 → " + allErrorOrValidateInfo.get(0).getMessage());
return; return;
} else { } else {
this.getView().showSuccessNotification("打回成功"); this.getView().showSuccessNotification("打回成功");
logger.info("单据:{}打回成功", billno);
list.refresh(); list.refresh();
} }
} else { } else {
this.getView().showTipNotification("来源系统为BIP或星空且单据状态为提交或审核才允许打回"); this.getView().showTipNotification("来源系统为BIP或星空且单据状态为提交或审核才允许打回");
logger.info("单据:{}打回失败失败原因来源系统为BIP或星空且单据状态为提交或审核才允许打回", billno);
return; return;
} }
} else { } else {
this.getView().showTipNotification("来源系统为BIP或星空且单据状态为提交或审核才允许打回"); this.getView().showTipNotification("来源系统为BIP或星空且单据状态为提交或审核才允许打回");
logger.info("单据:{}打回失败失败原因来源系统为BIP或星空且单据状态为提交或审核才允许打回", billno);
} }
} }
} }
} }
private String extractMessageFromResult(String result) {
// 查找 "返回信息:" 后面的部分
String keyword = "返回信息:";
int startIndex = result.indexOf(keyword);
if (startIndex != -1) {
// 提取 "返回信息:" 后面的消息部分
return result.substring(startIndex + keyword.length());
}
return ""; // 如果没有找到则返回空字符串
}
} }