Commit 2aaeb92d authored by 端鹏程's avatar 端鹏程

esb-sdk-test初始化

parents
Pipeline #37772 failed with stages
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4" />
\ No newline at end of file
File added
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>esb-sdk-test</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.huansi</groupId>
<artifactId>esb-sdk</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/esb-sdk.jar</systemPath>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11-beta-1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
url=http://oauth.saas.huansi.net/connect/token
client_id=esb client
client_secret=6F8CDD46-E782-4AF4-8F32-4A2D0E8C625D
grant_type=password
scope=ESB offline_access openid profile
username={"TenantCode":"111","UserNo":"admin","Lang":"cn"}
password=123456
\ No newline at end of file
{
"bill_type_code": "",
"bill_standard_code": "",
"bill_id": "",
"bill_no": "",
"to_tenant_code": "",
"bill_data": [],
"update_status": 0,
"client_id": "",
"to_client_id": ""
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<upload>
<bill-type-code></bill-type-code>
<bill-standard-code></bill-standard-code>
<bill-id></bill-id>
<bill-no></bill-no>
<to-tenant-code></to-tenant-code>
<bill-data></bill-data>
<update-status></update-status>
<client-id></client-id>
<to-client-id></to-client-id>
</upload>
\ No newline at end of file
package com.huansi.api;
import com.alibaba.fastjson.JSONObject;
import com.huansi.client.functions.Download;
import com.huansi.client.functions.Login;
import org.junit.Test;
public class DownloadRequestTest {
@Test
public void download() {
TestClient client = new TestClient();
client.config();
LoginRequest loginRequest = new Login();
loginRequest.login();
DownloadRequest downloadRequest = new Download();
System.out.println(JSONObject.toJSONString(downloadRequest.download()));
}
@Test
public void downloadResponse() {
TestClient client = new TestClient();
client.config();
LoginRequest loginRequest = new Login();
loginRequest.login();
DownloadRequest downloadRequest = new Download();
System.out.println(JSONObject.toJSONString(downloadRequest.downloadResponse("1",true,"成功")));
}
}
\ No newline at end of file
package com.huansi.api;
import com.huansi.client.EsbClient;
import com.huansi.client.utils.ScheduledExecutor;
import org.junit.Test;
/**
* @ClassName TestClient
* @Description
* @Author duanpc
* @Date 2021/6/30 16:48
* @Version 1.0
**/
public class TestClient {
public void config(){
EsbClient client = EsbClient.getInstance();
client.setClientId("8");
client.setUrl("http://esb-dev-hangzhou.saas.huansi.net");
}
@Test
public void execute(){
ScheduledExecutor executor = new ScheduledExecutor();
executor.execute();
}
}
package com.huansi.api;
import com.huansi.client.ParamsConfig;
import com.huansi.client.functions.Login;
import com.huansi.client.functions.Upload;
import com.huansi.client.utils.Result;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class UploadRequestTest {
@Test
public void upload() {
TestClient client = new TestClient();
client.config();
LoginRequest loginRequest = new Login();
loginRequest.login();
UploadRequest uploadRequest = new Upload();
Map<String, Object> map = new HashMap<>();
map.put("Bill_Id", "111111");
map.put("sBillNo", "G210313009");
map.put("sOrderNo", "SD21031302");
map.put("sCustomerOrderNo", "");
map.put("nQty", "19398.00");
map.put("sUnit", "M");
map.put("sCardNo", "G210313009");
map.put("TrackJobGUID", "6E2A7C37-8272-4FDB-AD4D-ACEA008A5DF9");
map.put("TrackOutputGUID", "63339B62-FEF3-42D9-B096-ACEA008A5BCF");
map.put("sMaterialLot", "20210312041");
map.put("upbCustomerGUID", "13FF9BF1-4961-4CB6-864A-ACE2010DCCE7");
map.put("sCustomerNo", "K0463");
map.put("sCustomerName", "mmp");
map.put("upbSalesGUID", "A5194647-C7EE-47F1-AB68-F540C5CD072D");
map.put("sSalesNo", "汝文伟");
map.put("sSalesName", "汝文伟");
map.put("sOrderType", "R");
map.put("sMaterialTypeCode", "麻系列");
map.put("sMaterialTypeName", "麻系列");
map.put("ummMaterialGUID", "95F60778-BE5A-4192-8D3F-ACE201129DE0");
map.put("sMaterialNo", "高弹SPH乱麻");
map.put("sMaterialName", "高弹SPH乱麻");
map.put("sComponent", "");
map.put("sCustomerMaterialNo", "167*高弹骑兵斜乱麻");
map.put("sCustomerMaterialName", null);
map.put("sRawWidth", "196");
map.put("sRawGMWT", "308");
map.put("sColorNo", "JL21030536");
map.put("sColorName", "19#黑色");
map.put("sCustomerColorNo", "JL21030536");
map.put("sCustomerColorName", "19#黑色");
map.put("nPlanOutputQty", "970.00");
map.put("nPlanOutputQtyEx", "0.00");
map.put("sWorkingProcedureNo", "0012");
map.put("sWorkingProcedureName", "开幅");
map.put("sFinishingMethod", "");
map.put("sContractNo", "");
map.put("tTrackTime", "2021-03-18T16:49:00");
map.put("tFactStartTime", "2021-03-18T16:49:00");
map.put("tFactEndTime", "2021-03-18T16:49:00");
map.put("sWorkerGroupNo", "脱水开幅乙组");
map.put("sWorkerGroupName", "脱水开幅乙组");
map.put("sWorkerNoList", "00155");
map.put("sWorkerNameList", "陈利祥");
map.put("sUnionCardNoList", "");
map.put("sEquipmentNo", "6#开幅机");
map.put("sEquipmentName", "6#开幅机");
map.put("iJobGroupOrderNo", 9);
map.put("test", 1);
List<Map> list = new ArrayList<>();
list.add(map);
// Map paramsConfig = new HashMap();
// paramsConfig.put("bill_type_code",5);
// paramsConfig.put("bill_standard_code","dyeing");
// paramsConfig.put("bill_id","YGC0624003");
// paramsConfig.put("bill_no","YGC0624003");
// paramsConfig.put("to_tenant_code","");
// paramsConfig.put("update_status",1);
// paramsConfig.put("client_id","1");
// paramsConfig.put("to_client_id","2");
ParamsConfig paramsConfig = new ParamsConfig();
paramsConfig.setBillId("YGC0624003");
paramsConfig.setBillNo("YGC0624003");
paramsConfig.setBillTypeCode("5");
paramsConfig.setBillStandardCode("dyeing");
paramsConfig.setClientId("1");
paramsConfig.setToClientId("2");
paramsConfig.setToTenantCode("");
paramsConfig.setUpdateStatus(1);
Result result = uploadRequest.upload(list, paramsConfig);
System.out.println(result);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment