From 684677b725d90fb6d5310d59dff4bbe75be4d2a5 Mon Sep 17 00:00:00 2001 From: zengweihai Date: Fri, 14 Jun 2024 15:25:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E6=8D=AE=E7=B1=BB=E5=9E=8B=E5=85=B3?= =?UTF-8?q?=E8=81=94=E7=BA=A6=E6=9D=9F=E4=BB=98=E6=AC=BE=E4=BA=8B=E9=A1=B9?= =?UTF-8?q?=E3=80=81=E4=BB=98=E6=AC=BE=E4=BA=8B=E9=A1=B9=E5=85=B3=E8=81=94?= =?UTF-8?q?=E8=B4=B9=E7=94=A8=E9=A1=B9=E7=9B=AE=E4=BB=A3=E7=A0=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A401?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CommonBillOsPaymentBillFormPlugin.java | 2 ++ .../CommonExpenseItemBillFormPlugin.java | 22 +++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/shkd-cosmic-debug/src/main/java/shkd/fi/er/plugin/formplugin/CommonBillOsPaymentBillFormPlugin.java b/shkd-cosmic-debug/src/main/java/shkd/fi/er/plugin/formplugin/CommonBillOsPaymentBillFormPlugin.java index 22e4204..0a6539b 100644 --- a/shkd-cosmic-debug/src/main/java/shkd/fi/er/plugin/formplugin/CommonBillOsPaymentBillFormPlugin.java +++ b/shkd-cosmic-debug/src/main/java/shkd/fi/er/plugin/formplugin/CommonBillOsPaymentBillFormPlugin.java @@ -19,6 +19,8 @@ import java.util.EventObject; /** * 单据界面插件 + * 单据类型及部门约束付款事项 + * 根据付款事项辅助资料查找对应的付款事项对应及其下级的叶子对象 */ public class CommonBillOsPaymentBillFormPlugin extends AbstractBillPlugIn implements BeforeF7SelectListener,Plugin { diff --git a/shkd-cosmic-debug/src/main/java/shkd/fi/er/plugin/formplugin/CommonExpenseItemBillFormPlugin.java b/shkd-cosmic-debug/src/main/java/shkd/fi/er/plugin/formplugin/CommonExpenseItemBillFormPlugin.java index 735bbd0..6f69243 100644 --- a/shkd-cosmic-debug/src/main/java/shkd/fi/er/plugin/formplugin/CommonExpenseItemBillFormPlugin.java +++ b/shkd-cosmic-debug/src/main/java/shkd/fi/er/plugin/formplugin/CommonExpenseItemBillFormPlugin.java @@ -21,6 +21,8 @@ import java.util.List; /** * 单据界面插件 + * 付款事项根据费用项目关联付款事项约束费用项目 + * 根据付款事项编码查询对于的费用项目(级次大于1的付款事项按它的1级编码查询) */ public class CommonExpenseItemBillFormPlugin extends AbstractBillPlugIn implements BeforeF7SelectListener,Plugin { String entityId; @@ -50,15 +52,27 @@ public class CommonExpenseItemBillFormPlugin extends AbstractBillPlugIn implemen DynamicObject payment = null; if ("expenseitem".equals(name)){ if (paymentList.contains(entityId)){ - payment = dataEntity.getDynamicObject("shkd_payment"); + String payID = dataEntity.getDynamicObject("shkd_payment").getString("id"); + payment = BusinessDataServiceHelper.loadSingle(payID,"bos_assistantdata_detail"); }else if (paymentItemList.contains(entityId)){ - payment = dataEntity.getDynamicObject("shkd_paymentitem"); + String payID = dataEntity.getDynamicObject("shkd_paymentitem").getString("id"); + payment = BusinessDataServiceHelper.loadSingle(payID,"bos_assistantdata_detail"); } if (payment != null){ - String paymentNumber = payment.getString("number"); - if (StringUtils.isNotEmpty(paymentNumber)){//付款事项编码不为空 + String longPaymentNumber = payment.getString("longnumber"); + if (StringUtils.isNotEmpty(longPaymentNumber)){//付款事项编码不为空 + String paymentNumber = ""; + int level = payment.getInt("level"); + if (level > 1){ + int index = longPaymentNumber.indexOf("!"); + paymentNumber = longPaymentNumber.substring(0, index);//取一级付款事项编码 + }else { + paymentNumber = longPaymentNumber; + } + ArrayList paymentIds = new ArrayList<>(); QFilter qFilter = new QFilter("shkd_paymatterinfo.number", QCP.equals, paymentNumber); + qFilter.and("enable",QCP.equals,"1");//使用状态为可用 DynamicObject[] loads = BusinessDataServiceHelper.load("shkd_accountlinkmatter","id,shkd_expenseitem.id",qFilter.toArray()); for (DynamicObject load : loads) { long aLong = load.getLong("shkd_expenseitem.id");