无需清账判断条件,变更时,不用调sap接口

This commit is contained in:
yuxueliang0813 2025-05-08 11:01:29 +08:00
parent 0b89cb776d
commit f03afd081c
2 changed files with 9 additions and 4 deletions

View File

@ -189,7 +189,7 @@ public class RecBillChangeListExtendPlugin extends AbstractListPlugin implements
};
DynamicObject payApply = BusinessDataServiceHelper.loadSingle("ap_payapply", filters);
if (payApply != null) {
this.getView().showTipNotification("所选单据不满足变更条件,存在SAP关联付款申请:" + payApply.getString("billno") + ",不允许变更。");
this.getView().showTipNotification("所选单据不满足变更条件,存在关联SAP付款申请" + payApply.getString("billno") + ",不允许变更。");
evt.setCancel(true);
}
}

View File

@ -12,8 +12,9 @@ import shjh.jhzj7.fi.fi.plugin.form.info.RecFieldsInfo;
import shjh.jhzj7.fi.fi.utils.SapUtils;
/**
* 动态表单插件
* 校验器插件
* 收款业务变更单提交清账状态校验
* shjh_cas_recbill_chan_ext submit操作的校验规则中
*/
public class ClosingStatusValidator extends AbstractValidator {
private final static Log logger = LogFactory.getLog(ClosingStatusValidator.class);
@ -25,7 +26,7 @@ public class ClosingStatusValidator extends AbstractValidator {
for (ExtendedDataEntity dataEntity : dataEntities) {
if (dataEntity != null) {
DynamicObject bill = dataEntity.getDataEntity();
////付款方为一次性客户/供应商时需校验国家城市必录
//付款方为一次性客户/供应商时需校验国家城市必录
String type = bill.getString(RecFieldsInfo.PAYER_TYPE);
if ("bd_customer".equals(type) || "bd_supplier".equals(type)){
long id = bill.getLong("payer");
@ -43,12 +44,16 @@ public class ClosingStatusValidator extends AbstractValidator {
}
}
}
//需要调用sap校验接口走如下判断逻辑;当无需金蝶清账时不去调用sap接口
if("A".equals(bill.getString(RecFieldsInfo.CLOSING_STATUS))){
continue;
}
String voucherNum = bill.getString("shjh_vouchernum");
if(SapUtils.isEmpty(voucherNum)){
//如果收款单凭证号为空
this.addErrorMessage(dataEntity, "所选单据不满足变更条件SAP凭证号≠空。");
}
//则需要调用SAP收款凭证清账状态查询接口
String billNumber = bill.getString("billno");
String companyCode = bill.getString("org.number");