From 0ecd8b8c158436b23298b66b64eaef0438b6425b Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期二, 17 六月 2025 09:36:53 +0800
Subject: [PATCH] art: SAP集成测试代码修改

---
 src/main/java/org/jeecg/modules/sap/service/impl/SAPServiceImpl.java |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/jeecg/modules/sap/service/impl/SAPServiceImpl.java b/src/main/java/org/jeecg/modules/sap/service/impl/SAPServiceImpl.java
index d87e15f..665b844 100644
--- a/src/main/java/org/jeecg/modules/sap/service/impl/SAPServiceImpl.java
+++ b/src/main/java/org/jeecg/modules/sap/service/impl/SAPServiceImpl.java
@@ -3,12 +3,16 @@
 import com.sap.conn.jco.JCoDestination;
 import com.sap.conn.jco.JCoFunction;
 import com.sap.conn.jco.JCoParameterList;
+import com.sap.conn.jco.JCoRepository;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.config.sap.SapRfcConnectionManager;
 import org.jeecg.modules.sap.service.SAPService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+
+import java.util.Arrays;
+import java.util.Collections;
 
 @Service
 @Slf4j
@@ -19,16 +23,16 @@
     @Override
     public String test() {
         JCoDestination destination = connectionManager.getDestination();
-        JCoFunction function = destination.getRepository().getFunction("ZPPF_022");
+        JCoRepository repository = destination.getRepository();
+        JCoFunction function = repository.getFunction("ZPPF_022");
 
         if (function == null) {
-            throw new RuntimeException("RFC 鍑芥暟妯″潡 Z_GET_MATERIAL_INFO 鏈壘鍒帮紒");
+            throw new RuntimeException("RFC 鍑芥暟妯″潡 ZPPF_022 鏈壘鍒帮紒");
         }
 
         // 璁剧疆杈撳叆鍙傛暟
-//        JCoParameterList input = function.getImportParameterList();
-//        input.setValue("MATERIAL_ID", materialId); // 鍙傛暟鍚嶉渶涓� SAP 鍑芥暟瀹氫箟涓�鑷�
-//        function.getImportParameterList().setValue("MATERIAL_ID", 0);
+        JCoParameterList input = function.getImportParameterList();
+        input.setValue("ZTAB_WERKS", Collections.singletonList("2301")); //鍙傛暟鍚嶉渶涓� SAP 鍑芥暟瀹氫箟涓�鑷�
 
         // 鎵ц璋冪敤
         function.execute(destination);

--
Gitblit v1.9.3