Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
陈绍鑫 2025-04-27 13:58:36 +08:00
commit a1a43a83f3
3 changed files with 41 additions and 92 deletions

View File

@ -251,7 +251,7 @@ public class ApiService {
jsonObject = JSON.parseObject(saveResponseBody); jsonObject = JSON.parseObject(saveResponseBody);
code = jsonObject.getString("code"); code = jsonObject.getString("code");
if ("200".equals(code)) { if ("200".equals(code)) {
LogService.newLog("INFO", "付款单", dynamic.getString("billno"), "付款处理 → BIP保存接口 → 成功", "请求数据:" + saveRequestBody + "\n推送成功接口返回数据" + saveResponseBody); // LogService.newLog("INFO", "付款单", dynamic.getString("billno"), "付款处理 → BIP保存接口 → 成功", "请求数据:" + saveRequestBody + "\n推送成功接口返回数据" + saveResponseBody);
logger.info("付款处理 → BIP保存接口 → 成功\n失败单据编号{}\n推送失败接口返回数据{}", dynamic.getString("billno"), saveResponseBody); logger.info("付款处理 → BIP保存接口 → 成功\n失败单据编号{}\n推送失败接口返回数据{}", dynamic.getString("billno"), saveResponseBody);
data = jsonObject.getJSONObject("data"); data = jsonObject.getJSONObject("data");
dynamic.set("shkd_businessnumber", data.getString("code")); dynamic.set("shkd_businessnumber", data.getString("code"));
@ -268,7 +268,7 @@ public class ApiService {
logger.info("付款处理 → BIP提交接口 → 返回结果:{}", submitResponseBody); logger.info("付款处理 → BIP提交接口 → 返回结果:{}", submitResponseBody);
result = "推送 → 付款处理单 → 成功"; result = "推送 → 付款处理单 → 成功";
} else { } else {
LogService.newLog("ERROR", "付款单", dynamic.getString("billno"), "付款处理 → BIP保存接口 → 失败", "请求数据:" + saveRequestBody + "\n推送失败接口返回数据" + saveResponseBody); // LogService.newLog("ERROR", "付款单", dynamic.getString("billno"), "付款处理 → BIP保存接口 → 失败", "请求数据:" + saveRequestBody + "\n推送失败接口返回数据" + saveResponseBody);
logger.info("付款处理 → BIP保存接口 → 失败\n失败单据编号{}\n推送失败接口返回数据{}", dynamic.getString("billno"), saveResponseBody); logger.info("付款处理 → BIP保存接口 → 失败\n失败单据编号{}\n推送失败接口返回数据{}", dynamic.getString("billno"), saveResponseBody);
result = "推送 → 付款处理单 → 失败"; result = "推送 → 付款处理单 → 失败";
} }
@ -281,7 +281,7 @@ public class ApiService {
jsonObject = JSON.parseObject(saveResponseBody); jsonObject = JSON.parseObject(saveResponseBody);
code = jsonObject.getString("code"); code = jsonObject.getString("code");
if ("200".equals(code)) { if ("200".equals(code)) {
LogService.newLog("INFO", "收款单", dynamic.getString("billno"), "收款处理 → BIP保存接口 → 成功", "请求数据:" + saveRequestBody + "\n推送成功接口返回数据" + saveResponseBody); // LogService.newLog("INFO", "收款单", dynamic.getString("billno"), "收款处理 → BIP保存接口 → 成功", "请求数据:" + saveRequestBody + "\n推送成功接口返回数据" + saveResponseBody);
logger.info("收款处理 → BIP保存接口 → 成功\n失败单据编号{}\n推送失败接口返回数据{}", dynamic.getString("billno"), saveResponseBody); logger.info("收款处理 → BIP保存接口 → 成功\n失败单据编号{}\n推送失败接口返回数据{}", dynamic.getString("billno"), saveResponseBody);
data = jsonObject.getJSONObject("data"); data = jsonObject.getJSONObject("data");
@ -298,7 +298,7 @@ public class ApiService {
logger.info("收款处理 → BIP提交接口 → 返回结果:{}", submitResponseBody); logger.info("收款处理 → BIP提交接口 → 返回结果:{}", submitResponseBody);
result = "推送 → 收款处理 → 成功"; result = "推送 → 收款处理 → 成功";
} else { } else {
LogService.newLog("ERROR", "收款单", dynamic.getString("billno"), "收款处理 → BIP保存接口 → 失败", "请求数据:" + saveRequestBody + "\n推送失败接口返回数据" + saveResponseBody); // LogService.newLog("ERROR", "收款单", dynamic.getString("billno"), "收款处理 → BIP保存接口 → 失败", "请求数据:" + saveRequestBody + "\n推送失败接口返回数据" + saveResponseBody);
logger.info("收款处理 → BIP保存接口 → 失败\n失败单据编号{}\n推送失败接口返回数据{}", dynamic.getString("billno"), saveResponseBody); logger.info("收款处理 → BIP保存接口 → 失败\n失败单据编号{}\n推送失败接口返回数据{}", dynamic.getString("billno"), saveResponseBody);
result = "推送 → 收款处理 → 失败"; result = "推送 → 收款处理 → 失败";
@ -314,12 +314,12 @@ public class ApiService {
dynamic.set("shkd_pushstatus", "已推送"); dynamic.set("shkd_pushstatus", "已推送");
dynamic.set("shkd_businessname", "共享系统"); dynamic.set("shkd_businessname", "共享系统");
dynamicObjects.add(dynamic); dynamicObjects.add(dynamic);
LogService.newLog("INFO", "银行收付处理", dynamic.getString("billno"), "银行收付处理 → BIP推送接口 → 成功", "请求数据:" + saveRequestBody + "\n推送成功接口返回数据" + saveResponseBody); // LogService.newLog("INFO", "银行收付处理", dynamic.getString("billno"), "银行收付处理 → BIP推送接口 → 成功", "请求数据:" + saveRequestBody + "\n推送成功接口返回数据" + saveResponseBody);
logger.info("银行收付处理 → BIP推送接口 → 成功\n成功单据编号{}\n成功请求体{}\n推送成功接口返回数据{}", dynamic.getString("billno"), saveRequestBody, saveResponseBody); logger.info("银行收付处理 → BIP推送接口 → 成功\n成功单据编号{}\n成功请求体{}\n推送成功接口返回数据{}", dynamic.getString("billno"), saveRequestBody, saveResponseBody);
result = "推送 → 银行收付处理 → 成功"; result = "推送 → 银行收付处理 → 成功";
} else { } else {
LogService.newLog("ERROR", "银行收付处理", dynamic.getString("billno"), "银行收付处理 → BIP推送接口 → 失败", "请求数据:" + saveRequestBody + "\n推送失败接口返回数据" + saveResponseBody); // LogService.newLog("ERROR", "银行收付处理", dynamic.getString("billno"), "银行收付处理 → BIP推送接口 → 失败", "请求数据:" + saveRequestBody + "\n推送失败接口返回数据" + saveResponseBody);
logger.info("银行收付处理 → BIP推送接口 → 失败\n失败单据编号{}\n失败请求体{}\n推送失败接口返回数据{}", dynamic.getString("billno"), saveRequestBody, saveResponseBody); logger.info("银行收付处理 → BIP推送接口 → 失败\n失败单据编号{}\n失败请求体{}\n推送失败接口返回数据{}", dynamic.getString("billno"), saveRequestBody, saveResponseBody);
result = "推送 → 银行收付处理 → 失败"; result = "推送 → 银行收付处理 → 失败";
@ -342,13 +342,13 @@ public class ApiService {
} }
dynamicObjects.add(dynamic); dynamicObjects.add(dynamic);
LogService.newLog("INFO", "付款单(结算结果)", dynamic.getString("billno"), "付款处理(支付结果) → BIP推送接口 → 成功", "请求数据:" + saveRequestBody + "\n推送成功接口返回数据" + saveResponseBody); // LogService.newLog("INFO", "付款单(结算结果)", dynamic.getString("billno"), "付款处理(支付结果) → BIP推送接口 → 成功", "请求数据:" + saveRequestBody + "\n推送成功接口返回数据" + saveResponseBody);
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 {
LogService.newLog("ERROR", "付款单(结算结果)", dynamic.getString("billno"), "付款处理(支付结果) → BIP推送接口 → 失败", "请求数据:" + saveRequestBody + "\n推送失败接口返回数据" + saveResponseBody); // LogService.newLog("ERROR", "付款单(结算结果)", dynamic.getString("billno"), "付款处理(支付结果) → BIP推送接口 → 失败", "请求数据:" + saveRequestBody + "\n推送失败接口返回数据" + saveResponseBody);
logger.info("付款处理(支付结果) → BIP推送接口 → 失败\n失败单据编号{}\n失败请求体{}\n推送失败接口返回数据{}", logger.info("付款处理(支付结果) → BIP推送接口 → 失败\n失败单据编号{}\n失败请求体{}\n推送失败接口返回数据{}",
dynamic.getString("billno"), saveRequestBody, saveResponseBody); dynamic.getString("billno"), saveRequestBody, saveResponseBody);
@ -390,11 +390,11 @@ public class ApiService {
String attachmentRequestBody = getAttachmentRequestBody(hashMap); String attachmentRequestBody = getAttachmentRequestBody(hashMap);
String pushResult = pushBill(token, "https://10.1.9.43/iuap-api-auth//yonbip/ctm/bank/tran/update", attachmentRequestBody); String pushResult = pushBill(token, "https://10.1.9.43/iuap-api-auth//yonbip/ctm/bank/tran/update", attachmentRequestBody);
logger.info("电子回单查询 → BIP推送附件接口 → 请求返回结果:\n{}", pushResult); logger.info("电子回单查询 → BIP推送附件接口 → 请求返回结果:\n{}", pushResult);
LogService.newLog("INFO", "电子回单", dynamic.getString("billno"), "电子回单查询 → BIP推送接口 → 成功", "请求数据:" + saveRequestBody + "\n推送成功接口返回数据" + saveResponseBody + "\n推送附件URL" + pdfUrl + "\n推送附件接口返回数据" + pushResult); // LogService.newLog("INFO", "电子回单", dynamic.getString("billno"), "电子回单查询 → BIP推送接口 → 成功", "请求数据:" + saveRequestBody + "\n推送成功接口返回数据" + saveResponseBody + "\n推送附件URL" + pdfUrl + "\n推送附件接口返回数据" + pushResult);
result = "推送 → 电子回单和附件 → 成功"; result = "推送 → 电子回单和附件 → 成功";
} else { } else {
LogService.newLog("ERROR", "电子回单", dynamic.getString("billno"), "电子回单查询 → BIP推送接口 → 失败", "请求数据:" + saveRequestBody + "\n推送失败接口返回数据" + saveResponseBody); // LogService.newLog("ERROR", "电子回单", dynamic.getString("billno"), "电子回单查询 → BIP推送接口 → 失败", "请求数据:" + saveRequestBody + "\n推送失败接口返回数据" + saveResponseBody);
logger.info("电子回单查询 → BIP推送接口 → 失败\n失败单据编号{}\n失败请求体{}\n推送失败接口返回数据{}", logger.info("电子回单查询 → BIP推送接口 → 失败\n失败单据编号{}\n失败请求体{}\n推送失败接口返回数据{}",
dynamic.getString("billno"), saveRequestBody, saveResponseBody); dynamic.getString("billno"), saveRequestBody, saveResponseBody);

View File

@ -106,7 +106,7 @@ public class ApiTestBillPlugin extends AbstractBillPlugIn implements Plugin {
this.getView().invokeOperation("unsubmit"); this.getView().invokeOperation("unsubmit");
} }
if ("B".equals(this.getModel().getDataEntity(true).getString("billstatus"))) { if ("C".equals(this.getModel().getDataEntity(true).getString("billstatus"))) {
this.getView().invokeOperation("unaudit"); this.getView().invokeOperation("unaudit");
} }
} }

View File

@ -1,55 +1,20 @@
package shkd.sys.sys.plugin.form; package shkd.sys.sys.plugin.form;
import kd.bos.bill.AbstractBillPlugIn; import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.bill.BillShowParameter;
import kd.bos.cache.CacheFactory;
import kd.bos.cache.TempFileCache;
import kd.bos.context.RequestContext;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.entity.LocaleString;
import kd.bos.dataentity.resource.ResManager;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.MainEntityType;
import kd.bos.entity.operate.result.OperationResult; import kd.bos.entity.operate.result.OperationResult;
import kd.bos.exception.KDBizException;
import kd.bos.form.IFormView;
import kd.bos.form.control.Toolbar; import kd.bos.form.control.Toolbar;
import kd.bos.form.control.events.ItemClickEvent; import kd.bos.form.control.events.ItemClickEvent;
import kd.bos.form.events.AfterDoOperationEventArgs;
import kd.bos.logging.Log; import kd.bos.logging.Log;
import kd.bos.logging.LogFactory; import kd.bos.logging.LogFactory;
import kd.bos.metadata.dao.MetadataDao;
import kd.bos.mvc.FormConfigFactory;
import kd.bos.mvc.SessionManager;
import kd.bos.orm.query.QCP; import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter; import kd.bos.orm.query.QFilter;
import kd.bos.print.core.service.PrtAttach;
import kd.bos.print.matchtpl.MatcherTpl;
import kd.bos.print.matchtpl.ViewType;
import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.MetadataServiceHelper;
import kd.bos.servicehelper.PrintServiceHelper;
import kd.bos.servicehelper.QueryServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.bos.servicehelper.print.NotePrintService;
import kd.bos.util.ExceptionUtils;
import kd.sdk.plugin.Plugin; import kd.sdk.plugin.Plugin;
import kd.tmc.bei.business.ocr.impl.ScanServiceImpl;
import kd.tmc.bei.business.ocr.invoke.ScanSystemFactory;
import kd.tmc.bei.business.opservice.elec.ViewReceiptService;
import kd.tmc.bei.common.helper.BeiHelper;
import kd.tmc.bei.common.helper.ReceiptPrintHelper;
import kd.tmc.bei.common.resource.BeiBizResource;
import kd.tmc.fbp.common.ofd.OfdConvertUtil;
import kd.tmc.fbp.common.util.EmptyUtil;
import shkd.sys.sys.mservice.ApiService; import shkd.sys.sys.mservice.ApiService;
import java.io.IOException;
import java.io.InputStream;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import static kd.bos.servicehelper.workflow.WorkflowServiceHelper.abandonByBusienssKey; import static kd.bos.servicehelper.workflow.WorkflowServiceHelper.abandonByBusienssKey;
@ -83,55 +48,39 @@ public class PaymentProcessingBillPlugin extends AbstractBillPlugIn implements P
return; return;
} }
abandonByBusienssKey(dataEntity.getPkValue().toString()); try {
List<DynamicObject> dynamicObjects = new ArrayList<>(); abandonByBusienssKey(this.getModel().getDataEntity(true).getPkValue().toString());
if ("B".equals(dataEntity.getString("billstatus"))) { } catch (Exception ignored) {
OperationResult result = this.getView().invokeOperation("unsubmit"); }
if (result.isSuccess()) { OperationResult operation;
DynamicObject[] objects = BusinessDataServiceHelper.load("cas_paybill", if ("B".equals(this.getModel().getDataEntity(true).getString("billstatus"))) {
"id,billno,actpayamt,entry,entry.e_expenseitem,entry.e_remark,settletype,acttradedate," + operation = this.getView().invokeOperation("unsubmit");
"payeebanknum,payeetype,payeenumber,payeracctbank,payeebank,payeebankname,paymenttype," + operation.setShowMessage(false);
"org,bizdate,description,shkd_pushstatus,shkd_businessnumber,shkd_businessid,shkd_businessname," + } else if ("C".equals(this.getModel().getDataEntity(true).getString("billstatus"))) {
"billstatus,bankpaystatus", new QFilter("billno", QCP.equals, dataEntity.getString("billno")).toArray()); operation = this.getView().invokeOperation("unaudit");
String pushResult = ApiService.paymentSlipsJson(objects[0], "BIPRE", dynamicObjects, null); operation.setShowMessage(false);
logger.info("result信息{}", pushResult); } else {
if (pushResult.contains("成功")) { operation = null;
SaveServiceHelper.save(dynamicObjects.toArray(new DynamicObject[0]));
this.getView().showSuccessNotification("打回成功");
} else {
this.getView().showTipNotification("打回失败调用BIP接口失败");
}
}
} }
if ("C".equals(dataEntity.getString("billstatus"))) { if (operation != null && operation.isSuccess()) {
OperationResult result = this.getView().invokeOperation("unaudit"); this.getView().invokeOperation("refresh");
if (result.isSuccess()) { DynamicObject[] objects = BusinessDataServiceHelper.load("cas_paybill",
DynamicObject[] objects = BusinessDataServiceHelper.load("cas_paybill", "id,billno,actpayamt,entry,entry.e_expenseitem,entry.e_remark,settletype,acttradedate," +
"id,billno,actpayamt,entry,entry.e_expenseitem,entry.e_remark,settletype,acttradedate," + "payeebanknum,payeetype,payeenumber,payeracctbank,payeebank,payeebankname,paymenttype," +
"payeebanknum,payeetype,payeenumber,payeracctbank,payeebank,payeebankname,paymenttype," + "org,bizdate,description,shkd_pushstatus,shkd_businessnumber,shkd_businessid,shkd_businessname," +
"org,bizdate,description,shkd_pushstatus,shkd_businessnumber,shkd_businessid,shkd_businessname," + "billstatus,bankpaystatus", new QFilter("billno", QCP.equals, dataEntity.getString("billno")).toArray());
"billstatus,bankpaystatus", new QFilter("billno", QCP.equals, dataEntity.getString("billno")).toArray()); List<DynamicObject> dynamicObjects = new ArrayList<>();
String pushResult = ApiService.paymentSlipsJson(objects[0], "BIPRE", dynamicObjects, null); String pushResult = ApiService.paymentSlipsJson(objects[0], "BIPRE", dynamicObjects, null);
logger.info("result信息{}", pushResult); logger.info("result信息{}", pushResult);
if (pushResult.contains("成功")) { if (pushResult.contains("成功")) {
SaveServiceHelper.save(dynamicObjects.toArray(new DynamicObject[0])); SaveServiceHelper.save(dynamicObjects.toArray(new DynamicObject[0]));
this.getView().showSuccessNotification("打回成功"); this.getView().showSuccessNotification("打回成功");
} else { } else {
this.getView().showTipNotification("打回失败调用BIP接口失败"); this.getView().showTipNotification("打回失败调用BIP接口失败");
}
} }
} } else {
} this.getView().showTipNotification("打回失败,请联系相关业务老师查看");
}
@Override
public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) {
if (("unsubmit".equals(afterDoOperationEventArgs.getOperateKey()) || "unaudit".equals(afterDoOperationEventArgs.getOperateKey())) && afterDoOperationEventArgs.getOperationResult().isSuccess()) {
DynamicObject dataEntity = this.getModel().getDataEntity(true);
Object businessname = dataEntity.get("shkd_businessname");
if (businessname != null && "共享系统".equals(businessname.toString())) {
afterDoOperationEventArgs.getOperationResult().setShowMessage(false);
} }
} }
} }