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 f742331..526ef57 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 @@ -79,8 +79,26 @@ public class CommonBillOsPaymentBillFormPlugin extends AbstractBillPlugIn implem ArrayList paymentNumbers = new ArrayList<>(); DynamicObject[] loads = BusinessDataServiceHelper.load("shkd_paymatter", "id,shkd_paymatterinfo.number", QF.toArray()); for (DynamicObject load : loads) { - String paymentNumber = load.getString("shkd_paymatterinfo.number"); - paymentNumbers.add(paymentNumber); + String paymentNumber = load.getString("shkd_paymatterinfo.number");//由于辅助资料包含的付款事项可能存在非叶子节点的情况。查询对象的下级叶子对象。 + String sql_number = "%"+paymentNumber+"%"; + QFilter QFSon = new QFilter("longnumber", QCP.like, sql_number); + QFSon.and("isleaf",QCP.equals,"1"); + DynamicObject[] datum = BusinessDataServiceHelper.load("bos_assistantdata_detail", "id,number,longnumber,level", QFSon.toArray()); + for (DynamicObject data : datum) { + String longnumber = data.getString("longnumber");//长编码 + if (data.getInt("level")>1){ + int index = longnumber.indexOf("!"); + String substr = longnumber.substring(0, index); + if (substr.equals(paymentNumber)){ + paymentNumbers.add(data.getString("number")); + } + }else { + if (longnumber.equals(paymentNumber)){ + paymentNumbers.add(paymentNumber); + } + } + + } } if (!paymentNumbers.isEmpty()){ logger.info("付款事项编码集合为"+paymentNumbers.toString());