Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
esb-sdk-test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
端鹏程
esb-sdk-test
Commits
2aaeb92d
Commit
2aaeb92d
authored
Jul 05, 2021
by
端鹏程
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
esb-sdk-test初始化
parents
Pipeline
#37772
failed with stages
Changes
9
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
235 additions
and
0 deletions
+235
-0
esb-sdk-test.iml
esb-sdk-test.iml
+3
-0
esb-sdk.jar
lib/esb-sdk.jar
+0
-0
pom.xml
pom.xml
+40
-0
config.properties
src/main/resources/huansi/config.properties
+8
-0
upload.json
src/main/resources/template/upload.json
+12
-0
upload.xml
src/main/resources/template/upload.xml
+13
-0
DownloadRequestTest.java
src/test/java/com/huansi/api/DownloadRequestTest.java
+32
-0
TestClient.java
src/test/java/com/huansi/api/TestClient.java
+28
-0
UploadRequestTest.java
src/test/java/com/huansi/api/UploadRequestTest.java
+99
-0
No files found.
esb-sdk-test.iml
0 → 100644
View file @
2aaeb92d
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"JAVA_MODULE"
version=
"4"
/>
\ No newline at end of file
lib/esb-sdk.jar
0 → 100644
View file @
2aaeb92d
File added
pom.xml
0 → 100644
View file @
2aaeb92d
<?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
src/main/resources/huansi/config.properties
0 → 100644
View file @
2aaeb92d
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
src/main/resources/template/upload.json
0 → 100644
View file @
2aaeb92d
{
"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
src/main/resources/template/upload.xml
0 → 100644
View file @
2aaeb92d
<?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
src/test/java/com/huansi/api/DownloadRequestTest.java
0 → 100644
View file @
2aaeb92d
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
src/test/java/com/huansi/api/TestClient.java
0 → 100644
View file @
2aaeb92d
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
();
}
}
src/test/java/com/huansi/api/UploadRequestTest.java
0 → 100644
View file @
2aaeb92d
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment