From b3c9d91f831f34f4d26c8b5d0310bed430638539 Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Wed, 2 Jul 2025 11:52:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=98=E6=AC=BE=E5=8D=95=EF=BC=8C=E5=B7=B2?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E2=80=9C=E7=BB=93=E6=9E=84=E6=80=A7=E6=B8=85?= =?UTF-8?q?=E8=B4=A6=E5=AE=A2=E6=88=B7=E6=98=A0=E5=B0=84=E8=A1=A8=E2=80=9D?= =?UTF-8?q?=20and=20=E4=B8=9A=E5=8A=A1=E5=B0=8F=E7=B1=BB=3D=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E9=87=91=E8=9D=B6=E6=B8=85=E8=B4=A6=E7=9A=84=EF=BC=8C?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E9=9C=80=E8=A6=81=E4=B8=8B=E6=8E=A8=E6=B8=85?= =?UTF-8?q?=E8=B4=A6=E5=8D=95=E7=9A=84=E6=89=8D=E9=9C=80=E8=A6=81=E5=8B=BE?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fi/fi/plugin/form/RecBillFromPlugin.java | 22 +++++++++++++------ .../plugin/operate/RecBillSaveOperation.java | 4 +++- 2 files changed, 18 insertions(+), 8 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 221bafa..7a27c8f 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/form/RecBillFromPlugin.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/form/RecBillFromPlugin.java @@ -182,6 +182,7 @@ public class RecBillFromPlugin extends AbstractFormPlugin implements Plugin { if (null != bizSmall) { String string = bizSmall.getString("shjh_qzfs");//业务小类中的清账方式 DynamicObjectCollection entryEntity = this.getModel().getEntryEntity("entry"); + DynamicObject currentorg = (DynamicObject) this.getModel().getValue("org");//单据所属当前公司 //当收款单【业务小类】清账方式字段=全部金蝶清账 if ("qbjdqz".equals(string)) { //判断收款单中的客户信息,是否在《结构性清账客户映射表》中 @@ -195,9 +196,11 @@ public class RecBillFromPlugin extends AbstractFormPlugin implements Plugin { this.getModel().setValue("shjh_closingstatus", "A", i);//无需金蝶清账 } if (null != value && "bd_customer".equals(this.getModel().getValue(RecFieldsInfo.PAYER_TYPE))) { - DynamicObject customerObj = BusinessDataServiceHelper.loadSingle(value, "bd_customer"); - QFilter number = new QFilter("shjh_customer.number", QCP.equals, customerObj.getString("number")); - DynamicObject mappingObj = BusinessDataServiceHelper.loadSingle("shjh_jgqzcust", number.toArray()); +// DynamicObject customerObj = BusinessDataServiceHelper.loadSingle(value, "bd_customer"); + QFilter mapnumber = new QFilter("shjh_customer.id", QCP.equals, value); + mapnumber.and("enable", QCP.equals, "1");//是否可用 + mapnumber.and("shjh_org.id", QCP.equals, currentorg.getLong("id"));//公司 + DynamicObject mappingObj = BusinessDataServiceHelper.loadSingle("shjh_jgqzcust", mapnumber.toArray()); if (null != mappingObj) { for (int i = 0; i < entryEntity.size(); i++) { this.getModel().setValue("shjh_needpushbill", true, i);//需要下推清账单 @@ -213,8 +216,10 @@ public class RecBillFromPlugin extends AbstractFormPlugin implements Plugin { }else{ //当客户拆分=是,以分录客户来判断 for (int i = 0; i < entryEntity.size(); i++) { - QFilter number = new QFilter("shjh_customer.number", QCP.equals, entryEntity.get(i).getString("shjh_entrycustomer.number")); - DynamicObject mappingObj = BusinessDataServiceHelper.loadSingle("shjh_jgqzcust", number.toArray()); + QFilter mapnumber = new QFilter("shjh_customer.number", QCP.equals, entryEntity.get(i).getString("shjh_entrycustomer.number")); + mapnumber.and("enable", QCP.equals, "1");//是否可用 + mapnumber.and("shjh_org.id", QCP.equals, currentorg.getLong("id"));//公司 + DynamicObject mappingObj = BusinessDataServiceHelper.loadSingle("shjh_jgqzcust", mapnumber.toArray()); if (null != mappingObj) { this.getModel().setValue("shjh_needpushbill", true, i); }else{ @@ -263,10 +268,13 @@ public class RecBillFromPlugin extends AbstractFormPlugin implements Plugin { } DynamicObjectCollection entryEntity = this.getModel().getEntryEntity("entry"); if(iskdqbqz){ + DynamicObject currentorg = (DynamicObject) this.getModel().getValue("org");//单据所属当前公司 //业务小类是全部金蝶清账,再判断结构性客户 for (int i = 0; i < entryEntity.size(); i++) { - QFilter number = new QFilter("shjh_customer.number", QCP.equals, entryEntity.get(i).getString("shjh_entrycustomer.number")); - DynamicObject mappingObj = BusinessDataServiceHelper.loadSingle("shjh_jgqzcust", number.toArray()); + QFilter mapnumber = new QFilter("shjh_customer.number", QCP.equals, entryEntity.get(i).getString("shjh_entrycustomer.number")); + mapnumber.and("enable", QCP.equals, "1");//是否可用 + mapnumber.and("shjh_org.id", QCP.equals, currentorg.getLong("id"));//公司 + DynamicObject mappingObj = BusinessDataServiceHelper.loadSingle("shjh_jgqzcust", mapnumber.toArray()); if (null != mappingObj) { this.getModel().setValue("shjh_needpushbill", true, i);//需要下推清账单 this.getModel().setValue("shjh_closingstatus", "B", i);//待清账 diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/operate/RecBillSaveOperation.java b/main/java/shjh/jhzj7/fi/fi/plugin/operate/RecBillSaveOperation.java index 0062416..5a5157d 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/operate/RecBillSaveOperation.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/operate/RecBillSaveOperation.java @@ -199,7 +199,9 @@ public class RecBillSaveOperation extends AbstractOperationServicePlugIn impleme bill.set("shjh_qzzt", "A");//无需金蝶清账 }else{ //根据收款单付款人id判断,此时的付款类型是客户 - QFilter mapnumber = new QFilter("shjh_customer.id", QCP.equals, bill.getLong("payer")); + QFilter mapnumber = new QFilter("shjh_customer.id", QCP.equals, bill.getLong("payer"));//客户 + mapnumber.and("enable", QCP.equals, "1");//是否可用 + mapnumber.and("shjh_org.id", QCP.equals, org.getLong("id"));//公司 DynamicObject mappingObj = BusinessDataServiceHelper.loadSingle("shjh_jgqzcust", mapnumber.toArray()); if(mappingObj != null){ //结构性清账客户映射表中有值