|
@@ -0,0 +1,75 @@
|
|
|
|
+package com.zkqy;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+import com.google.gson.Gson;
|
|
|
|
+import com.kingdee.bos.webapi.entity.IdentifyInfo;
|
|
|
|
+import com.kingdee.bos.webapi.entity.QueryParam;
|
|
|
|
+import com.kingdee.bos.webapi.sdk.K3CloudApi;
|
|
|
|
+import org.apache.http.client.HttpClient;
|
|
|
|
+import org.junit.jupiter.api.Test;
|
|
|
|
+import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
+
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+@SpringBootTest(classes = ZkqyApplication.class)
|
|
|
|
+
|
|
|
|
+public class Test01 {
|
|
|
|
+
|
|
|
|
+ @Test
|
|
|
|
+ public void testA() throws Exception {
|
|
|
|
+ K3CloudApi api = new K3CloudApi();
|
|
|
|
+ List datacenter = api.getDataCenters();
|
|
|
|
+ Gson gson = new Gson();
|
|
|
|
+ System.out.printf("或则环境账套信息:%s%n",gson.toJson(datacenter));
|
|
|
|
+ System.out.println("ddddd");
|
|
|
|
+
|
|
|
|
+ //注意 1:此处不再使用参数形式传入用户名及密码等敏感信息,改为在登录配置文件中设置。
|
|
|
|
+ //注意 2:必须先配置第三方系统登录授权信息后,再进行业务操作,详情参考各语言版本SDK介绍中的登录配置文件说明。
|
|
|
|
+ //读取配置,初始化SDK
|
|
|
|
+// K3CloudApi client = new K3CloudApi();
|
|
|
|
+ //请求参数,要求为json字符串
|
|
|
|
+// String jsonData = "{\"FormId\":\"FBottomEntity\",\"FieldKeys\":\"FMATERIALNAME2\",\"FilterString\":[],\"OrderString\":\"\",\"TopRowCount\":0,\"StartRow\":0,\"Limit\":2000,\"SubSystemId\":\"\"}";
|
|
|
|
+// try {
|
|
|
|
+// //调用接口
|
|
|
|
+// String resultJson = String.valueOf(api.executeBillQuery(jsonData));
|
|
|
|
+// System.out.println("接口返回结果: " + resultJson);
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
+//// fail(e.getMessage());
|
|
|
|
+// System.out.println(e.getMessage());
|
|
|
|
+// }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Test
|
|
|
|
+ public void test02() throws Exception {
|
|
|
|
+ IdentifyInfo identifyInfo=new IdentifyInfo();
|
|
|
|
+ identifyInfo.setAppId("291472_5Z6q2/Ho6roeQaXv0d5PS61FQrTa0PNs");
|
|
|
|
+ identifyInfo.setAppSecret("18d80a2709c7446ea44aa14b7d94e86e");
|
|
|
|
+ identifyInfo.setServerUrl("http://kdcloudserver/K3Cloud/");
|
|
|
|
+ identifyInfo.setUserName("王金明");
|
|
|
|
+ identifyInfo.setPwd("123456");
|
|
|
|
+ identifyInfo.setConnectTimeout(300);
|
|
|
|
+ identifyInfo.setdCID("61c7dd2d0ff564");
|
|
|
|
+ identifyInfo.setRequestTimeout(300);
|
|
|
|
+// K3CloudApi client = new K3CloudApi(identifyInfo);
|
|
|
|
+// String jsonData = "{\"FormId\":\"FBottomEntity\",\"FieldKeys\":\"FMATERIALNAME2\",\"FilterString\":[],\"OrderString\":\"\",\"TopRowCount\":0,\"StartRow\":0,\"Limit\":2000,\"SubSystemId\":\"\"}";
|
|
|
|
+// try {
|
|
|
|
+// //调用接口
|
|
|
|
+// String resultJson = String.valueOf(client.executeBillQuery(jsonData));
|
|
|
|
+// System.out.println("接口返回结果: " + resultJson);
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
+//// fail(e.getMessage());
|
|
|
|
+// System.out.println(e.getMessage());
|
|
|
|
+// }
|
|
|
|
+ K3CloudApi api = new K3CloudApi();
|
|
|
|
+
|
|
|
|
+ List datacenter = api.getDataCenters();
|
|
|
|
+ Gson gson = new Gson();
|
|
|
|
+ System.out.printf("或则环境账套信息:%s%n",gson.toJson(datacenter));
|
|
|
|
+ System.out.println("ddddd");
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|