同名客户携带改动
This commit is contained in:
parent
58b879f9c5
commit
c8b45040e4
|
|
@ -647,6 +647,8 @@ public class RecBillSaveOperation extends AbstractOperationServicePlugIn impleme
|
||||||
exitCustomerArray = true;
|
exitCustomerArray = true;
|
||||||
} else {
|
} else {
|
||||||
//存在多个客户,判断组织编码companyNumber是否在客户基础资料客户组5分录中的销售公司编码中配置
|
//存在多个客户,判断组织编码companyNumber是否在客户基础资料客户组5分录中的销售公司编码中配置
|
||||||
|
List<DynamicObject> matchingCustomers = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < bd_customer.length; i++) {
|
for (int i = 0; i < bd_customer.length; i++) {
|
||||||
Set<String> numberSet = new HashSet<>();
|
Set<String> numberSet = new HashSet<>();
|
||||||
DynamicObject customer = BusinessDataServiceHelper.loadSingle(bd_customer[i].getPkValue(), "bd_customer");
|
DynamicObject customer = BusinessDataServiceHelper.loadSingle(bd_customer[i].getPkValue(), "bd_customer");
|
||||||
|
|
@ -660,15 +662,21 @@ public class RecBillSaveOperation extends AbstractOperationServicePlugIn impleme
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (numberSet.contains(companyNumber)) {
|
if (numberSet.contains(companyNumber)) {
|
||||||
bill.set("payer", bd_customer[i].getPkValue()); //付款人id
|
matchingCustomers.add(bd_customer[i]);
|
||||||
bill.set("payernumber", bd_customer[i].getString("number")); //付款人编码
|
}
|
||||||
bill.set("payername", bd_customer[i].getString("name")); //付款人名称
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 处理匹配结果
|
||||||
|
if (matchingCustomers.size() == 1) {
|
||||||
|
// 只有一个客户匹配,使用该客户
|
||||||
|
bill.set("payer", matchingCustomers.get(0).getPkValue());
|
||||||
|
bill.set("payernumber", matchingCustomers.get(0).getString("number"));
|
||||||
|
bill.set("payername", matchingCustomers.get(0).getString("name"));
|
||||||
exitCustomerArray = true;
|
exitCustomerArray = true;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// 多个客户都匹配,使用规则4的默认客户
|
||||||
|
// 没有客户匹配,保持原样(将触发规则4处理)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!exitCustomerArray) {
|
if (!exitCustomerArray) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue