李俊

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	doc/FedEx在线申报系统API - 数据落地接口(C类).docx
......@@ -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);
//接口响应时间
......
......@@ -24,17 +24,17 @@ public class ApiTest {
//获取HSCODE接口地址
public static String hscodeRequest = "hscode/hscodeRequest";
public static String timeStamp = "1649839249891";
public static String timeStamp = "1645153943";
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));
}
/**
......
......@@ -35,8 +35,8 @@ public class SendMawbFedex {
*/
public static void sendMawbBasf() throws Exception{
//申报数据:consignmentCode 运单号需要修改
String json ="{\"consignmentCode\":\"271002102051\",\"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\":\"281833508306\",\"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);
//消息头
......