收款单携带客户优化-客户组5
This commit is contained in:
		
							parent
							
								
									b6a75808d3
								
							
						
					
					
						commit
						b438c55167
					
				|  | @ -622,10 +622,23 @@ public class RecBillSaveOperation extends AbstractOperationServicePlugIn impleme | |||
|                     QFilter customerFilter = new QFilter("name", QCP.equals, oppunit); | ||||
|                     //可用状态 | ||||
|                     customerFilter.and(new QFilter("enable",QCP.equals,"1")); | ||||
|                     DynamicObject bd_customer = BusinessDataServiceHelper.loadSingle("bd_customer", customerFilter.toArray()); | ||||
|                     if (null != bd_customer) { | ||||
|                         bill.set("payer", bd_customer.getPkValue()); //付款人id | ||||
|                         bill.set("payername", bd_customer.getString("name")); //付款人名称 | ||||
|                     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){ | ||||
|                             for (int i = 0; i < bd_customer.length; i++) { | ||||
|                                 DynamicObjectCollection dynamicObjectCollection = bd_customer[i].getDynamicObjectCollection("shjh_entry_five"); | ||||
|                                 if (dynamicObjectCollection.size()!=0){ | ||||
|                                     bill.set("payer", bd_customer[i].getPkValue()); //付款人id | ||||
|                                     bill.set("payername", bd_customer[i].getString("name")); //付款人名称 | ||||
|                                     break; | ||||
|                                 } | ||||
|                             } | ||||
|                         } | ||||
|                     } | ||||
| //                    else { | ||||
| //                        //4.规则生单未配置客户——>默认不确定客户 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue