定时拉取sap应付凭证增加供应商账户组的过滤条件,剔除这两个选项 D200 D201
This commit is contained in:
		
							parent
							
								
									4af62784cf
								
							
						
					
					
						commit
						e6dae28bf9
					
				|  | @ -114,6 +114,7 @@ public class SappzFormPlugin extends AbstractFormPlugin { | ||||||
|                 for (DynamicObject shjh_gyss : shjh_gys) { |                 for (DynamicObject shjh_gyss : shjh_gys) { | ||||||
|                     addFilterDumpCondition(IT_LIST, "LIFNR", shjh_gyss.getString("fbasedataid.number"), shjh_gyss.getString("fbasedataid.number")); |                     addFilterDumpCondition(IT_LIST, "LIFNR", shjh_gyss.getString("fbasedataid.number"), shjh_gyss.getString("fbasedataid.number")); | ||||||
|                 } |                 } | ||||||
|  | 
 | ||||||
|                 DynamicObjectCollection shjhEntryentity = this.getModel().getEntryEntity("shjh_entryentity"); |                 DynamicObjectCollection shjhEntryentity = this.getModel().getEntryEntity("shjh_entryentity"); | ||||||
|                 shjhEntryentity.clear(); |                 shjhEntryentity.clear(); | ||||||
|                 //根据查询条件,调用SAP查询凭证接口,生成分录行 |                 //根据查询条件,调用SAP查询凭证接口,生成分录行 | ||||||
|  |  | ||||||
|  | @ -63,7 +63,7 @@ public class QuerySapCreatePayApplyTask extends AbstractTask { | ||||||
|         LocalDate startDate = currentDate.minusDays(daysBefore); |         LocalDate startDate = currentDate.minusDays(daysBefore); | ||||||
|         // 计算结束日期(临期_后表示今天之后的天数) |         // 计算结束日期(临期_后表示今天之后的天数) | ||||||
|         LocalDate endDate = currentDate.plusDays(daysAfter); |         LocalDate endDate = currentDate.plusDays(daysAfter); | ||||||
|         JSONArray IT_LIST = new JSONArray(1); |         JSONArray IT_LIST = new JSONArray(3); | ||||||
|         JSONObject result;//sap应付凭证接口返回值 |         JSONObject result;//sap应付凭证接口返回值 | ||||||
|         JSONObject sapdata;//sap应付凭证接口返回值data |         JSONObject sapdata;//sap应付凭证接口返回值data | ||||||
|         String formatStartDate; // 开始日期-文本 |         String formatStartDate; // 开始日期-文本 | ||||||
|  | @ -83,6 +83,8 @@ public class QuerySapCreatePayApplyTask extends AbstractTask { | ||||||
|             IT_LIST.clear();//使用之前先清空 |             IT_LIST.clear();//使用之前先清空 | ||||||
|             // 添加SAP应付凭到期日过滤条件 |             // 添加SAP应付凭到期日过滤条件 | ||||||
|             addFilterCondition(IT_LIST, "FAEDT", formatStartDate, formatEndDate); |             addFilterCondition(IT_LIST, "FAEDT", formatStartDate, formatEndDate); | ||||||
|  |             //供应商账户组作为筛选条件,此时需要剔除D200 D201两个选项 | ||||||
|  |             removeSupplierGroupFilter(IT_LIST); | ||||||
|             record = formatStartDate+"临期第"+i+"次"+formatEndDate; |             record = formatStartDate+"临期第"+i+"次"+formatEndDate; | ||||||
|             logger.info(record); |             logger.info(record); | ||||||
|             result = vouchers_payable(IT_LIST,record); |             result = vouchers_payable(IT_LIST,record); | ||||||
|  | @ -129,6 +131,25 @@ public class QuerySapCreatePayApplyTask extends AbstractTask { | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     //增加供应商账户组的过滤条件,剔除这两个选项 D200 D201 | ||||||
|  |     private void removeSupplierGroupFilter(JSONArray IT_LIST){ | ||||||
|  |         JSONObject jsonObject0 = new JSONObject(); | ||||||
|  |         jsonObject0.put("FIELD", "KTOKK"); // 字段名称 | ||||||
|  |         jsonObject0.put("SIGN", "E"); // I:包含 E:排除 | ||||||
|  |         jsonObject0.put("LOW", "D200"); // LOW ,枚举字段所代表值的区间开始值 | ||||||
|  |         jsonObject0.put("HIGH", "D200"); // HIGH,枚举字段所代表值的区间结束值 | ||||||
|  |         jsonObject0.put("OPTION", "EQ"); // 默认BT:单条 | ||||||
|  |         IT_LIST.add(jsonObject0); | ||||||
|  | 
 | ||||||
|  |         JSONObject jsonObject1 = new JSONObject(); | ||||||
|  |         jsonObject1.put("FIELD", "KTOKK"); // 字段名称 | ||||||
|  |         jsonObject1.put("SIGN", "E"); // I:包含 E:排除 | ||||||
|  |         jsonObject1.put("LOW", "D201"); // LOW ,枚举字段所代表值的区间开始值 | ||||||
|  |         jsonObject1.put("HIGH", "D201"); // HIGH,枚举字段所代表值的区间结束值 | ||||||
|  |         jsonObject1.put("OPTION", "EQ"); // 默认BT:单条 | ||||||
|  |         IT_LIST.add(jsonObject1); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     /** |     /** | ||||||
|      * 通过SAP接口查询应付凭证数据,并生成应付付款申请单 |      * 通过SAP接口查询应付凭证数据,并生成应付付款申请单 | ||||||
|      */ |      */ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue