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");