收款单付款人类型切换报错bug

This commit is contained in:
李贵强 2025-07-17 11:00:40 +08:00
parent bf5ecf5324
commit 64d7eb4feb
1 changed files with 13 additions and 5 deletions

View File

@ -161,9 +161,17 @@ public class RecBillFromPlugin extends AbstractFormPlugin implements Plugin {
String type = (String) this.getModel().getValue(RecFieldsInfo.PAYER_TYPE);
if ("bd_customer".equals(type) || "bd_supplier".equals(type)) {
//付款人是客商
Object value = this.getModel().getValue("payer");
if (null != value) {
DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(value, type);
Object pkValue = this.getModel().getValue("payer");
Long longValue;
if (pkValue instanceof Integer) {
longValue = ((Integer) pkValue).longValue();
} else if (pkValue instanceof Long) {
longValue = (Long) pkValue;
} else {
longValue = null; // 或者其他默认值
}
if (longValue!=null && longValue!=0L) {
DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(pkValue, type);
if (null != dynamicObject) {
String name = dynamicObject.getString("group.name");
if (null != name && name.contains("一次性")) {
@ -186,9 +194,9 @@ public class RecBillFromPlugin extends AbstractFormPlugin implements Plugin {
this.getModel().setValue("shjh_needpushbill", false, i);//不需要下推清账单
this.getModel().setValue("shjh_closingstatus", "A", i);//无需金蝶清账
}
if (null != value && "bd_customer".equals(type)) {
if ("bd_customer".equals(type)) {
DynamicObject currentorg = (DynamicObject) this.getModel().getValue("org");//单据所属当前公司
QFilter mapnumber = new QFilter("shjh_customer.id", QCP.equals, value);
QFilter mapnumber = new QFilter("shjh_customer.id", QCP.equals, pkValue);
mapnumber.and("enable", QCP.equals, "1");//是否可用
mapnumber.and("shjh_org.id", QCP.equals, currentorg.getLong("id"));//公司
DynamicObject mappingObj = BusinessDataServiceHelper.loadSingle("shjh_jgqzcust", mapnumber.toArray());