Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
iClear-api
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
tao.mo
2022-07-26 15:26:22 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
98868837de86639588a0cfe90d7f957779464b00
98868837
1 parent
092771b5
API接口文档更新
mt 2022年7月26日15:26:14
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
32 deletions
doc/FedEx在线申报系统API - 数据推送接口(D类).docx
doc/FedEx在线申报系统API - 数据落地接口(C类).docx
src/main/java/com/erry/iclear/dateInterface/service/ApiService.java
src/test/java/com/erry/iclear/dateInterface/ApiTest.java
src/test/java/com/erry/iclear/dateInterface/SendMawbFedex.java
doc/FedEx在线申报系统API - 数据推送接口(D类).docx
View file @
9886883
No preview for this file type
doc/FedEx在线申报系统API - 数据落地接口(C类).docx
View file @
9886883
No preview for this file type
src/main/java/com/erry/iclear/dateInterface/service/ApiService.java
View file @
9886883
...
...
@@ -139,6 +139,7 @@ public class ApiService {
//推送时间
declearTask
.
setPushTime
(
new
Date
());
String
objJson
=
JsonToJava
.
toJson
(
d
);
log
.
info
(
"推送海关回执json: "
+
objJson
);
//推送海关回执数据
String
json
=
HttpUtils
.
doPost
(
this
.
customsUrl
,
objJson
,
headerMap
);
//接口响应时间
...
...
src/test/java/com/erry/iclear/dateInterface/ApiTest.java
View file @
9886883
...
...
@@ -24,17 +24,17 @@ public class ApiTest {
//获取HSCODE接口地址
public
static
String
hscodeRequest
=
"hscode/hscodeRequest"
;
public
static
String
timeStamp
=
"164
9839249891
"
;
public
static
String
timeStamp
=
"164
5153943
"
;
public
static
String
appId
=
"IDE"
;
public
static
String
appKey
=
"iClearExport"
;
//需要申请
public
static
String
security
=
"
b92131f03f19a348
"
;
public
static
String
security
=
"
6db193cb4165a71b
"
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
//D类申报的数据落地接口
//
ApiTest.sendMawb();
ApiTest
.
sendMawb
();
//C类申报的数据落地接口
ApiTest
.
sendMawbBasf
();
//
ApiTest.sendMawbBasf();
//C类EDI数据接口
// ApiTest.selectDecListBasf();
//C类回执数据接口
...
...
@@ -51,34 +51,34 @@ public class ApiTest {
String
masbJson
=
"{\"ieFlag\":\"E\",\"type\":\"EX\",\"agentCode\":\"1111980005\",\"agentName\":\"联邦快递(中国)有限公司\",\"billNo\":\"202204141\",\"contrNo\":\"3006622200\",\"customMaster\":\"0208\",\"cutMode\":\"601\",\"declTrnRel\":\"0\",\"distinatePort\":\"DEU000\",\"ediId\":\"001\",\"feeCurr\":\"EUR\",\"feeMark\":\"3\",\"feeRate\":110.9,\"grossWet\":4.6,\"iePort\":\"0101\",\"insurCurr\":\"EUR\",\"insurMark\":\"3\",\"insurRate\":0.74,\"netWt\":32,\"ownerCode\":\"3118962277\",\"ownerName\":\"测试核销单位\",\"packNo\":1,\"tradeCountry\":\"USA\",\"tradeMode\":\"110\",\"tradeCode\":\"32099616DM\",\"trafMode\":\"5\",\"tradeName\":\"测试发件人\",\"transMode\":\"1\",\"wrapType\":\"23\",\"tradeCodeScc\":\"A74125896321456987\",\"ownerCodeScc\":\"913100007421296207\",\"tradeAreaCode\":\"DEU\",\"entyPortCode\":\"310302\",\"goodsPlace\":\"\",\"declareName\":\"Jimmy shen\",\"overseasConsigneeEname\":\"PRYSMIAN KABEL UND SYSTEME GMBH\",\"mawbDetailList\":[{\"detailId\":\"204\",\"classMark\":\"\",\"codeTS\":\"8504409999\",\"declPrice\":3365,\"declTotal\":3365,\"dutyMode\":\"1\",\"exgNo\":\"\",\"exgVersion\":\"\",\"firstUnit\":\"007\",\"firstQty\":1,\"originCountry\":\"CHN\",\"secondUnit\":\"035\",\"secondQty\":1,\"tradeCurr\":\"EUR\",\"useTo\":\"03\",\"destinationCountry\":\"DEU\",\"ciqCode\":\"\",\"destCode\":\"110102\",\"districtCode\":\"44079\",\"gno\":1,\"gname\":\"变频调速装置\",\"gmodel\":\"4|0|控制电机用|240KW|西门子/SIEMENS|6RA8081-6GV62-0AA0|||\",\"gqty\":1,\"gunit\":\"007\"}]}"
;
System
.
out
.
println
(
new
Date
(
Long
.
valueOf
(
timeStamp
)));
String
token
=
SHA256Util
.
getSHA256String
(
"
IDE"
+
"iClearExport
"
+
ApiTest
.
security
+
ApiTest
.
timeStamp
);
String
token
=
SHA256Util
.
getSHA256String
(
"
BASF"
+
"iClearExportC
"
+
ApiTest
.
security
+
ApiTest
.
timeStamp
);
System
.
out
.
println
(
token
);
Header
[]
headers
=
HttpHeader
.
custom
()
.
other
(
"Content-Type"
,
"application/json"
)
.
other
(
"Appid"
,
ApiTest
.
appId
)
.
other
(
"appKey"
,
ApiTest
.
appKey
)
.
other
(
"TimeStamp"
,
ApiTest
.
timeStamp
)
.
other
(
"token"
,
token
)
.
build
();
HCB
hcb
=
HCB
.
custom
()
.
timeout
(
20000
)
.
pool
(
100
,
10
)
.
sslpv
(
SSLs
.
SSLProtocolVersion
.
TLSv1_2
)
.
ssl
()
.
retry
(
3
);
//String url = "https://40.73.78.157:8780/customs/sendMawb";
String
url
=
ApiTest
.
url
+
ApiTest
.
sendMawb
;
HttpConfig
config
=
HttpConfig
.
custom
()
.
headers
(
headers
)
.
url
(
url
)
.
encoding
(
"utf-8"
)
.
client
(
hcb
.
build
())
// .json(new Gson().toJson(createMawb()));
.
json
(
masbJson
);
System
.
out
.
println
(
HttpClientUtil
.
post
(
config
));
//
Header[] headers = HttpHeader.custom()
//
.other("Content-Type", "application/json")
//
.other("Appid", ApiTest.appId)
//
.other("appKey", ApiTest.appKey)
//
.other("TimeStamp", ApiTest.timeStamp)
//
.other("token", token)
//
.build();
//
//
HCB hcb = HCB.custom()
//
.timeout(20000)
//
.pool(100, 10)
//
.sslpv(SSLs.SSLProtocolVersion.TLSv1_2)
//
.ssl()
//
.retry(3);
//
//
//String url = "https://40.73.78.157:8780/customs/sendMawb";
//
String url = ApiTest.url + ApiTest.sendMawb;
//
HttpConfig config = HttpConfig.custom()
//
.headers(headers)
//
.url(url)
//
.encoding("utf-8")
//
.client(hcb.build())
//
//
.json(new Gson().toJson(createMawb()));
//
.json(masbJson);
//
System.out.println(HttpClientUtil.post(config));
}
/**
...
...
src/test/java/com/erry/iclear/dateInterface/SendMawbFedex.java
View file @
9886883
...
...
@@ -35,8 +35,8 @@ public class SendMawbFedex {
*/
public
static
void
sendMawbBasf
()
throws
Exception
{
//申报数据:consignmentCode 运单号需要修改
String
json
=
"{\"consignmentCode\":\"2
71002102051\",\"consignmentId\":164535620,\"consType\":\"C\",\"sender\":\"巴斯夫护理化学品(上海)有限公司\",\"shipperCustomsCode\":\"3119920047\",\"shipperSCC\":\"91310000607239894U\",\"operateUnitName\":\"巴斯夫护理化学品(上海)有限公司\",\"operateUnitCode\":\"3119920047\",\"operateSCC\":\"91310000607239894U\",\"consignmentList\":[{\"consignmentDetailId\":83010676,\"skuCode\":\"2917341090\",\"skuName\":\"邻苯二甲酸二丁酯\",\"model\":\"品名:邻苯二甲酸二丁酯 |品牌类型:0|出口享惠情况:0|成分含量:100% 邻苯二甲酸二丁酯|用途:化学分析用试剂,实验用途|GTIN:|CAS:|其他[非必报要素,请根据实际情况填报]:|\",\"knockdownNumber\":1,\"knockdownUnit\":\"035\",\"qtyLegalFirst\":1,\"unitLegalFirst\":\"035\",\"qtyLegalSecond\":\"1.0000\",\"unitLegalSecond\":\"\",\"declaredAmount\":10
,\"currency\":\"USD\",\"declaredWeight\":1}]}"
;
String
json
=
"{\"consignmentCode\":\"2
81833508306\",\"consignmentId\":14054615,\"consType\":\"C\",\"sender\":\"鲁泰纺织股份有限公司\",\"operateUnitName\":\"鲁泰纺织股份有限公司\",\"operateUnitCode\":\"3703930116\",\"operateSCC\":\"91370302613281175K\",\"shipperCustomsCode\":\"3703930116\",\"shipperSCC\":\"91370302613281175K\",\"EANNo\":\"0000000001\",\"consignmentList\":[{\"consignmentDetailId\":15815679,\"skuCode\":\"4205001090\",\"skuName\":\"其他动物皮革制的坐具套\",\"model\":\"品名:其他动物皮革制的坐具套|品牌类型:0|出口享惠情况:0|材质[皮革或再生皮革]:皮革|GTIN:|CAS:|其他[非必报要素,请根据实际情况填报]:|\",\"knockdownNumber\":1,\"knockdownUnit\":\"035\",\"qtyLegalFirst\":1,\"unitLegalFirst\":\"035\",\"declaredAmount\":1
,\"currency\":\"USD\",\"declaredWeight\":1}]}"
;
System
.
out
.
println
(
json
);
String
token
=
SHA256Util
.
getSHA256String
(
SendMawbFedex
.
appId
+
SendMawbFedex
.
appKey
+
SendMawbFedex
.
security
+
SendMawbFedex
.
timeStamp
);
System
.
out
.
println
(
token
);
//消息头
...
...
Please
register
or
login
to post a comment