Showing
5 changed files
with
33 additions
and
32 deletions
No preview for this file type
No preview for this file type
| ... | @@ -139,6 +139,7 @@ public class ApiService { | ... | @@ -139,6 +139,7 @@ public class ApiService { |
| 139 | //推送时间 | 139 | //推送时间 |
| 140 | declearTask.setPushTime(new Date()); | 140 | declearTask.setPushTime(new Date()); |
| 141 | String objJson = JsonToJava.toJson(d); | 141 | String objJson = JsonToJava.toJson(d); |
| 142 | + log.info("推送海关回执json: " + objJson); | ||
| 142 | //推送海关回执数据 | 143 | //推送海关回执数据 |
| 143 | String json = HttpUtils.doPost(this.customsUrl,objJson,headerMap); | 144 | String json = HttpUtils.doPost(this.customsUrl,objJson,headerMap); |
| 144 | //接口响应时间 | 145 | //接口响应时间 | ... | ... |
| ... | @@ -24,17 +24,17 @@ public class ApiTest { | ... | @@ -24,17 +24,17 @@ public class ApiTest { |
| 24 | //获取HSCODE接口地址 | 24 | //获取HSCODE接口地址 |
| 25 | public static String hscodeRequest = "hscode/hscodeRequest"; | 25 | public static String hscodeRequest = "hscode/hscodeRequest"; |
| 26 | 26 | ||
| 27 | - public static String timeStamp = "1649839249891"; | 27 | + public static String timeStamp = "1645153943"; |
| 28 | public static String appId = "IDE"; | 28 | public static String appId = "IDE"; |
| 29 | public static String appKey = "iClearExport"; | 29 | public static String appKey = "iClearExport"; |
| 30 | //需要申请 | 30 | //需要申请 |
| 31 | - public static String security = "b92131f03f19a348"; | 31 | + public static String security = "6db193cb4165a71b"; |
| 32 | 32 | ||
| 33 | public static void main(String[] args) throws Exception{ | 33 | public static void main(String[] args) throws Exception{ |
| 34 | //D类申报的数据落地接口 | 34 | //D类申报的数据落地接口 |
| 35 | -// ApiTest.sendMawb(); | 35 | + ApiTest.sendMawb(); |
| 36 | //C类申报的数据落地接口 | 36 | //C类申报的数据落地接口 |
| 37 | - ApiTest.sendMawbBasf(); | 37 | +// ApiTest.sendMawbBasf(); |
| 38 | //C类EDI数据接口 | 38 | //C类EDI数据接口 |
| 39 | // ApiTest.selectDecListBasf(); | 39 | // ApiTest.selectDecListBasf(); |
| 40 | //C类回执数据接口 | 40 | //C类回执数据接口 |
| ... | @@ -51,34 +51,34 @@ public class ApiTest { | ... | @@ -51,34 +51,34 @@ public class ApiTest { |
| 51 | 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\"}]}"; | 51 | 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\"}]}"; |
| 52 | 52 | ||
| 53 | System.out.println(new Date(Long.valueOf(timeStamp))); | 53 | System.out.println(new Date(Long.valueOf(timeStamp))); |
| 54 | - String token = SHA256Util.getSHA256String("IDE" + "iClearExport" + ApiTest.security + ApiTest.timeStamp); | 54 | + String token = SHA256Util.getSHA256String("BASF" + "iClearExportC" + ApiTest.security + ApiTest.timeStamp); |
| 55 | System.out.println(token); | 55 | System.out.println(token); |
| 56 | 56 | ||
| 57 | - Header[] headers = HttpHeader.custom() | 57 | +// Header[] headers = HttpHeader.custom() |
| 58 | - .other("Content-Type", "application/json") | 58 | +// .other("Content-Type", "application/json") |
| 59 | - .other("Appid", ApiTest.appId) | 59 | +// .other("Appid", ApiTest.appId) |
| 60 | - .other("appKey", ApiTest.appKey) | 60 | +// .other("appKey", ApiTest.appKey) |
| 61 | - .other("TimeStamp", ApiTest.timeStamp) | 61 | +// .other("TimeStamp", ApiTest.timeStamp) |
| 62 | - .other("token", token) | 62 | +// .other("token", token) |
| 63 | - .build(); | 63 | +// .build(); |
| 64 | - | 64 | +// |
| 65 | - HCB hcb = HCB.custom() | 65 | +// HCB hcb = HCB.custom() |
| 66 | - .timeout(20000) | 66 | +// .timeout(20000) |
| 67 | - .pool(100, 10) | 67 | +// .pool(100, 10) |
| 68 | - .sslpv(SSLs.SSLProtocolVersion.TLSv1_2) | 68 | +// .sslpv(SSLs.SSLProtocolVersion.TLSv1_2) |
| 69 | - .ssl() | 69 | +// .ssl() |
| 70 | - .retry(3); | 70 | +// .retry(3); |
| 71 | - | 71 | +// |
| 72 | - //String url = "https://40.73.78.157:8780/customs/sendMawb"; | 72 | +// //String url = "https://40.73.78.157:8780/customs/sendMawb"; |
| 73 | - String url = ApiTest.url + ApiTest.sendMawb; | 73 | +// String url = ApiTest.url + ApiTest.sendMawb; |
| 74 | - HttpConfig config = HttpConfig.custom() | 74 | +// HttpConfig config = HttpConfig.custom() |
| 75 | - .headers(headers) | 75 | +// .headers(headers) |
| 76 | - .url(url) | 76 | +// .url(url) |
| 77 | - .encoding("utf-8") | 77 | +// .encoding("utf-8") |
| 78 | - .client(hcb.build()) | 78 | +// .client(hcb.build()) |
| 79 | -// .json(new Gson().toJson(createMawb())); | 79 | +//// .json(new Gson().toJson(createMawb())); |
| 80 | - .json(masbJson); | 80 | +// .json(masbJson); |
| 81 | - System.out.println(HttpClientUtil.post(config)); | 81 | +// System.out.println(HttpClientUtil.post(config)); |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | /** | 84 | /** | ... | ... |
| ... | @@ -35,8 +35,8 @@ public class SendMawbFedex { | ... | @@ -35,8 +35,8 @@ public class SendMawbFedex { |
| 35 | */ | 35 | */ |
| 36 | public static void sendMawbBasf() throws Exception{ | 36 | public static void sendMawbBasf() throws Exception{ |
| 37 | //申报数据:consignmentCode 运单号需要修改 | 37 | //申报数据:consignmentCode 运单号需要修改 |
| 38 | - 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}]}"; | 38 | + 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}]}"; |
| 39 | - | 39 | + System.out.println(json); |
| 40 | String token = SHA256Util.getSHA256String(SendMawbFedex.appId + SendMawbFedex.appKey + SendMawbFedex.security + SendMawbFedex.timeStamp); | 40 | String token = SHA256Util.getSHA256String(SendMawbFedex.appId + SendMawbFedex.appKey + SendMawbFedex.security + SendMawbFedex.timeStamp); |
| 41 | System.out.println(token); | 41 | System.out.println(token); |
| 42 | //消息头 | 42 | //消息头 | ... | ... |
-
Please register or login to post a comment