流水下推收款单携带客户逻辑回退

This commit is contained in:
李贵强 2025-07-03 14:51:36 +08:00
parent aab997b901
commit 1bb70c4b58
1 changed files with 14 additions and 15 deletions

View File

@ -624,12 +624,11 @@ public class RecBillSaveOperation extends AbstractOperationServicePlugIn impleme
customerFilter.and(new QFilter("enable",QCP.equals,"1"));
DynamicObject[] bd_customer = BusinessDataServiceHelper.load("bd_customer", "id,name,shjh_entry_five",customerFilter.toArray());
if (null != bd_customer && bd_customer.length==1) {
bill.set("payer", bd_customer[0].getPkValue()); //付款人id
bill.set("payername", bd_customer[0].getString("name")); //付款人名称
}else {
assert bd_customer != null;
if (bd_customer.length>1){
if (null != bd_customer ) {
if (bd_customer.length==1){
bill.set("payer", bd_customer[0].getPkValue()); //付款人id
bill.set("payername", bd_customer[0].getString("name")); //付款人名称
}else if (bd_customer.length>1){
for (int i = 0; i < bd_customer.length; i++) {
DynamicObjectCollection dynamicObjectCollection = bd_customer[i].getDynamicObjectCollection("shjh_entry_five");
if (dynamicObjectCollection.size()!=0){
@ -640,15 +639,15 @@ public class RecBillSaveOperation extends AbstractOperationServicePlugIn impleme
}
}
}
// else {
// //4.规则生单未配置客户>默认不确定客户
// QFilter qFilter1 = new QFilter("number", QCP.equals, "1042086"); //4000042
// DynamicObject bdCustomer = BusinessDataServiceHelper.loadSingle("bd_customer", qFilter1.toArray());
// if (null != bdCustomer) {
// bill.set("payer", bdCustomer.getPkValue()); //付款人id
// bill.set("payername", bdCustomer.getString("name")); //付款人名称
// }
// }
else {
//4.规则生单未配置客户>默认不确定客户
QFilter qFilter1 = new QFilter("number", QCP.equals, "1042086"); //4000042
DynamicObject bdCustomer = BusinessDataServiceHelper.loadSingle("bd_customer", qFilter1.toArray());
if (null != bdCustomer) {
bill.set("payer", bdCustomer.getPkValue()); //付款人id
bill.set("payername", bdCustomer.getString("name")); //付款人名称
}
}
}
}
}