From 64d7eb4feb399df11a356ec12ffd4f06f63cf4f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=B4=B5=E5=BC=BA?= Date: Thu, 17 Jul 2025 11:00:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E6=AC=BE=E5=8D=95=E4=BB=98=E6=AC=BE?= =?UTF-8?q?=E4=BA=BA=E7=B1=BB=E5=9E=8B=E5=88=87=E6=8D=A2=E6=8A=A5=E9=94=99?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fi/fi/plugin/form/RecBillFromPlugin.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/form/RecBillFromPlugin.java b/main/java/shjh/jhzj7/fi/fi/plugin/form/RecBillFromPlugin.java index 757adfb..965f9b5 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/form/RecBillFromPlugin.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/form/RecBillFromPlugin.java @@ -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());