单据类型关联约束付款事项代码提交03

This commit is contained in:
zengweihai 2024-06-13 19:05:39 +08:00
parent fb18d6c961
commit 8f8dcf1c84
1 changed files with 20 additions and 2 deletions

View File

@ -79,8 +79,26 @@ public class CommonBillOsPaymentBillFormPlugin extends AbstractBillPlugIn implem
ArrayList<Object> 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());