凭证传输接口-增加已审核凭证过滤
This commit is contained in:
		
							parent
							
								
									5e98e9e32c
								
							
						
					
					
						commit
						422181dec0
					
				|  | @ -8,6 +8,7 @@ import kd.bos.dataentity.utils.StringUtils; | |||
| import kd.bos.entity.ExtendedDataEntity; | ||||
| import kd.bos.entity.formula.RowDataModel; | ||||
| import kd.bos.entity.operate.result.OperateErrorInfo; | ||||
| import kd.bos.entity.operate.result.OperationResult; | ||||
| import kd.bos.entity.plugin.AbstractOperationServicePlugIn; | ||||
| import kd.bos.entity.plugin.AddValidatorsEventArgs; | ||||
| import kd.bos.entity.plugin.PreparePropertysEventArgs; | ||||
|  | @ -20,6 +21,7 @@ import kd.bos.orm.query.QCP; | |||
| import kd.bos.orm.query.QFilter; | ||||
| import kd.bos.servicehelper.BusinessDataServiceHelper; | ||||
| import kd.bos.servicehelper.operation.SaveServiceHelper; | ||||
| import kd.fi.cas.helper.VoucherBookHelper; | ||||
| import kd.sdk.plugin.Plugin; | ||||
| import shjh.jhzj7.fi.fi.plugin.form.info.RecFieldsInfo; | ||||
| import shjh.jhzj7.fi.fi.utils.ApiUtils; | ||||
|  | @ -146,6 +148,13 @@ public class RecPushVoucherOperation extends AbstractOperationServicePlugIn impl | |||
|                         //抬头,参考《IS_HEADER》 | ||||
|                         data.put("IS_HEADER", getIS_HEADER(recBill)); | ||||
|                         //详细,参考《IT_ITEM》 | ||||
|                         JSONArray itItem = getIT_ITEM(recBill); | ||||
|                         if (itItem==null){ | ||||
|                             this.getOperationResult().setSuccess(false);//成功true;失败false | ||||
|                             this.getOperationResult().setMessage("凭证不存在或未审核");    // 提示内容 | ||||
|                             this.getOperationResult().setShowMessage(true);    // 是否显示提示消息 | ||||
|                             continue; | ||||
|                         } | ||||
|                         data.put("IT_ITEM", getIT_ITEM(recBill)); | ||||
|                         //收款类型=推预付款、员工还款需要传清账数据 | ||||
|                         String receivingType = recBill.getString("receivingtype.number"); | ||||
|  | @ -286,27 +295,18 @@ public class RecPushVoucherOperation extends AbstractOperationServicePlugIn impl | |||
|             PRCTR = shjhPc.getString("number"); | ||||
|         } | ||||
| 
 | ||||
|         // 5. 查询关联的凭证信息 | ||||
|         // 5. 查询关联的凭证信息——凭证必传 | ||||
|         QFilter voucherFilters = new QFilter("sourcebill", QCP.equals, recBill.getPkValue()); | ||||
|         voucherFilters.and(new QFilter("billstatus",QCP.equals,"C"));//已审核 | ||||
|         DynamicObject gl_voucher = BusinessDataServiceHelper.loadSingle("gl_voucher", | ||||
|                 "id,sourcebill,entries,entries.account,entries.debitlocal,entries.creditlocal,entries.entrydc", | ||||
|                 new QFilter("sourcebill", QCP.equals, recBill.getPkValue()).toArray()); | ||||
|                 voucherFilters.toArray()); | ||||
| 
 | ||||
|         if (gl_voucher != null) { | ||||
|             DynamicObjectCollection entries = gl_voucher.getDynamicObjectCollection("entries"); | ||||
|             if (entries != null && !entries.isEmpty()) { | ||||
|                 for (DynamicObject entry : entries) { | ||||
|                     JSONObject IT_ITEMS = new JSONObject(); | ||||
| 
 | ||||
| //                    // 设置客户/供应商编号 | ||||
| //                    switch (payerType) { | ||||
| //                        case "bd_customer": | ||||
| //                            IT_ITEMS.put("KUNNR", cusOrSupNumber); | ||||
| //                            break; | ||||
| //                        case "bd_supplier": | ||||
| //                            IT_ITEMS.put("LIFNR", cusOrSupNumber); | ||||
| //                            break; | ||||
| //                    } | ||||
| 
 | ||||
|                     // 设置科目 | ||||
|                     DynamicObject account = entry.getDynamicObject("account"); | ||||
|                     if (account != null) { | ||||
|  | @ -385,6 +385,10 @@ public class RecPushVoucherOperation extends AbstractOperationServicePlugIn impl | |||
|                     IT_ITEM.add(IT_ITEMS); | ||||
|                 } | ||||
|             } | ||||
|         }else { | ||||
|             String billNo = recBill.getString("billno"); | ||||
|             logger.error("无法获取收款单[" + billNo + "]关联的凭证信息,凭证不存在或未审核"); | ||||
|             return null; | ||||
|         } | ||||
| 
 | ||||
|         return IT_ITEM; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue