Showing
4 changed files
with
158 additions
and
46 deletions
| ... | @@ -7,6 +7,8 @@ import com.arronlong.httpclientutil.common.HttpHeader; | ... | @@ -7,6 +7,8 @@ import com.arronlong.httpclientutil.common.HttpHeader; |
| 7 | import com.arronlong.httpclientutil.common.HttpResult; | 7 | import com.arronlong.httpclientutil.common.HttpResult; |
| 8 | import com.arronlong.httpclientutil.common.SSLs; | 8 | import com.arronlong.httpclientutil.common.SSLs; |
| 9 | import com.arronlong.httpclientutil.exception.HttpProcessException; | 9 | import com.arronlong.httpclientutil.exception.HttpProcessException; |
| 10 | +import com.erry.iclear.dateInterface.api.request.Basfc; | ||
| 11 | +import com.erry.iclear.dateInterface.api.request.BasfcDetail; | ||
| 10 | import com.erry.iclear.dateInterface.api.request.Mawb; | 12 | import com.erry.iclear.dateInterface.api.request.Mawb; |
| 11 | import com.erry.iclear.dateInterface.api.request.MawbDetail; | 13 | import com.erry.iclear.dateInterface.api.request.MawbDetail; |
| 12 | import com.erry.iclear.dateInterface.util.SHA256Util; | 14 | import com.erry.iclear.dateInterface.util.SHA256Util; |
| ... | @@ -21,26 +23,26 @@ import java.util.*; | ... | @@ -21,26 +23,26 @@ import java.util.*; |
| 21 | public class HttpClientTest { | 23 | public class HttpClientTest { |
| 22 | public static void main(String[] args) throws HttpProcessException, FileNotFoundException { | 24 | public static void main(String[] args) throws HttpProcessException, FileNotFoundException { |
| 23 | // System.out.println(HttpClientUtil.get(HttpConfig.custom().url("https://40.73.78.157:8780/system/healthCheck"))); | 25 | // System.out.println(HttpClientUtil.get(HttpConfig.custom().url("https://40.73.78.157:8780/system/healthCheck"))); |
| 24 | -// System.out.println(HttpClientUtil.post(HttpConfig.custom().url("https://40.73.78.157:8780/customs/sendMawb"))); | 26 | + //System.out.println(HttpClientUtil.post(HttpConfig.custom().url("https://40.73.78.157:8780/customs/sendMawbBasf"))); |
| 27 | + //String masbJson ="{\"ieFlag\":\"I\",\"type\":\" 0\",\"agentCode\":\"1111980005\",\"agentName\":\"联邦快递\",\"billNo\":\"774597567332\",\"contrNo\":\"3006635555/3006636664\",\"customMaster\":\"0207\",\"cutMode\":\"1\",\"declTrnRel\":\"0\",\"distinatePort\":\"DEU000\",\"ediId\":\"1\",\"feeCurr\":\"EUR\",\"feeMark\":\"3\",\"feeRate\":110.9,\"grossWet\":4.6,\"iePort\":\"0207\",\"insurCurr\":\"EUR\",\"insurMark\":\"\",\"insurRate\":0.74,\"netWt\":32,\"ownerCode\":\"9112011660\",\"ownerName\":\"西门子电气传动有限公司\",\"packNo\":1,\"tradeCountry\":\"USA\",\"tradeMode\":\"0110\",\"tradeCode\":\"9112011660\",\"trafMode\":\"5\",\"tradeName\":\"西门子电气传动有限公司\",\"transMode\":\"1\",\"wrapType\":\"23\",\"tradeCodeScc\":\"91120116600587482L\",\"ownerCodeScc\":\"91120116600587482L\",\"tradeAreaCode\":\"DEU\",\"entyPortCode\":\"110101\",\"goodsPlace\":\"\",\"declareName\":\"Jimmy shen\",\"overseasConsigneeEname\":\"PRYSMIAN KABEL UND SYSTEME GMBH\",\"mawbDetailList\":[{\"detailId\":\"495\",\"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\":\"11010\",\"gno\":1,\"gname\":\"其他未列名静止式变流器\",\"gmodel\":\"4|0|控制电机用|240KW|西门子/SIEMENS|6RA8081-6GV62-0AA0|||\",\"gqty\":1,\"gunit\":\"007\"},{\"detailId\":\"496\",\"classMark\":\"\",\"codeTS\":\"8504409999\",\"declPrice\":9369,\"declTotal\":9369,\"dutyMode\":\"1\",\"exgNo\":\"\",\"exgVersion\":\"\",\"firstUnit\":\"007\",\"firstQty\":3,\"originCountry\":\"CHN\",\"secondUnit\":\"035\",\"secondQty\":1,\"tradeCurr\":\"EUR\",\"useTo\":\"03\",\"destinationCountry\":\"DEU\",\"ciqCode\":\"\",\"destCode\":\"110102\",\"districtCode\":\"11010\",\"gno\":2,\"gname\":\"其他未列名静止式变流器\",\"gmodel\":\"4|0|控制电机用|36KW|西门子/SIEMENS|6RA8081-6GV62-0BB0|||\",\"gqty\":3,\"gunit\":\"007\"}]}"; | ||
| 28 | + String basfJson = "{\"consignmentCode\":\"287598603852\",\"consignmentId\":221121505595,\"consType\":\"C\",\"sender\":\"巴斯夫(中国)有限公司\",\"shipperCustomsCode\":\"3122241734\",\"shipperSCC\":\"913100007109210071\",\"operateUnitName\":\"巴斯夫(中国)有限公司\",\"operateUnitCode\":\"3122241734\",\"operateSCC\":\"913100007109210071\",\"EANNo\":\"\",\"consignmentList\":[{\"consignmentDetailId\":83013414,\"skuCode\":\"3909500000\",\"skuName\":\"热塑性聚氨酯弹性体\",\"model\":\"品名:热塑性聚氨酯弹性体|品牌类型:0|出口享惠情况:0|外观[形状;透明度;颜色等]:热塑性聚氨酯99-100%|成分含量:多元醇70-90%,异氰酸酯0-20%,其他二元醇0-10%|单体单元的种类和比例:非塑料再生料|底料来源[再生料、瓶片料、新料、副牌料]:DEVELOPMENT|品牌[中文或外文名称]:ELASTOLLAN|型号:见合同|签约日期:制造聚氨酯塑料用|用途:|GTIN:|CAS:|其他[非必报要素,请根据实际情况填报]:|\",\"knockdownNumber\":40.0000,\"knockdownUnit\":\"035\",\"qtyLegalFirst\":40.0000,\"unitLegalFirst\":\"NULL\",\"qtyLegalSecond\":40.0000,\"unitLegalSecond\":\"NULL\",\"declaredAmount\":1200.0,\"currency\":\"USD\",\"declaredWeight\":40.0000}]}"; | ||
| 29 | + //String basfJson = "{\"consignmentCode\":\"796565081410\",\"consignmentId\":221112408858,\"consType\":\"C\",\"sender\":\"巴斯夫新材料有限公司\",\"shipperCustomsCode\":\"3122240631\",\"shipperSCC\":\"91310115607299125B\",\"operateUnitName\":\"巴斯夫新材料有限公司\",\"operateUnitCode\":\"3122240631\",\"operateSCC\":\"91310115607299125B\",\"EANNo\":\"\",\"consignmentList\":[{\"consignmentDetailId\":30787356,\"skuCode\":\"3402900090\",\"skuName\":\"表面活性剂制品 683 LT\",\"model\":\"1|0|表面活性剂,用于化工技术工业的原材料|非零售包装|异丙基苯磺酸钠5-15%,低聚D-吡喃葡糖C10-16-烷基苷25-50%,水40-60%|巴斯夫Glucopon|683 LT\",\"knockdownNumber\":0.5000,\"knockdownUnit\":\"035\",\"qtyLegalFirst\":0.5000,\"unitLegalFirst\":\"035\",\"qtyLegalSecond\":null,\"unitLegalSecond\":null,\"declaredAmount\":2.5,\"currency\":\"USD\",\"declaredWeight\":0.5000}]}"; | ||
| 30 | + //String basfJson = "{\"consignmentCode\":\"794650129680\",\"consignmentId\":220062201115,\"consType\":\"C\",\"sender\":\"巴斯夫植物保护(江苏)有限公司\",\"shipperCustomsCode\":\"3206946236\",\"shipperSCC\":\"913206230645013066\",\"operateUnitName\":\"巴斯夫植物保护(江苏)有限公司\",\"operateUnitCode\":\"3206946236\",\"operateSCC\":\"913206230645013066\",\"EANNo\":\"\",\"consignmentList\":[{\"consignmentDetailId\":50285469,\"skuCode\":\"2926909090\",\"skuName\":\"丙腈水溶液\",\"model\":\"0|0|||\",\"knockdownNumber\":2.0000,\"knockdownUnit\":\"035\",\"qtyLegalFirst\":2.0000,\"unitLegalFirst\":\"035\",\"qtyLegalSecond\":null,\"unitLegalSecond\":null,\"declaredAmount\":23.0000,\"currency\":\"USD\",\"declaredWeight\":2.0000}]}"; | ||
| 25 | 31 | ||
| 26 | - | 32 | + String timeStamp = "1638254683000"; |
| 27 | - | ||
| 28 | - String masbJson ="{\"ieFlag\":\"I\",\"type\":\" 0\",\"agentCode\":\"1111980005\",\"agentName\":\"联邦快递\",\"billNo\":\"774597567332\",\"contrNo\":\"3006635555/3006636664\",\"customMaster\":\"0207\",\"cutMode\":\"1\",\"declTrnRel\":\"0\",\"distinatePort\":\"DEU000\",\"ediId\":\"1\",\"feeCurr\":\"EUR\",\"feeMark\":\"3\",\"feeRate\":110.9,\"grossWet\":4.6,\"iePort\":\"0207\",\"insurCurr\":\"EUR\",\"insurMark\":\"\",\"insurRate\":0.74,\"netWt\":32,\"ownerCode\":\"9112011660\",\"ownerName\":\"西门子电气传动有限公司\",\"packNo\":1,\"tradeCountry\":\"USA\",\"tradeMode\":\"0110\",\"tradeCode\":\"9112011660\",\"trafMode\":\"5\",\"tradeName\":\"西门子电气传动有限公司\",\"transMode\":\"1\",\"wrapType\":\"23\",\"tradeCodeScc\":\"91120116600587482L\",\"ownerCodeScc\":\"91120116600587482L\",\"tradeAreaCode\":\"DEU\",\"entyPortCode\":\"110101\",\"goodsPlace\":\"\",\"declareName\":\"Jimmy shen\",\"overseasConsigneeEname\":\"PRYSMIAN KABEL UND SYSTEME GMBH\",\"mawbDetailList\":[{\"detailId\":\"495\",\"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\":\"11010\",\"gno\":1,\"gname\":\"其他未列名静止式变流器\",\"gmodel\":\"4|0|控制电机用|240KW|西门子/SIEMENS|6RA8081-6GV62-0AA0|||\",\"gqty\":1,\"gunit\":\"007\"},{\"detailId\":\"496\",\"classMark\":\"\",\"codeTS\":\"8504409999\",\"declPrice\":9369,\"declTotal\":9369,\"dutyMode\":\"1\",\"exgNo\":\"\",\"exgVersion\":\"\",\"firstUnit\":\"007\",\"firstQty\":3,\"originCountry\":\"CHN\",\"secondUnit\":\"035\",\"secondQty\":1,\"tradeCurr\":\"EUR\",\"useTo\":\"03\",\"destinationCountry\":\"DEU\",\"ciqCode\":\"\",\"destCode\":\"110102\",\"districtCode\":\"11010\",\"gno\":2,\"gname\":\"其他未列名静止式变流器\",\"gmodel\":\"4|0|控制电机用|36KW|西门子/SIEMENS|6RA8081-6GV62-0BB0|||\",\"gqty\":3,\"gunit\":\"007\"}]}"; | ||
| 29 | - | ||
| 30 | - | ||
| 31 | - | ||
| 32 | - | ||
| 33 | - String timeStamp = "1623971478192"; | ||
| 34 | //String timeStamp = "1624263798669"; | 33 | //String timeStamp = "1624263798669"; |
| 35 | System.out.println(new Date(Long.valueOf(timeStamp))); | 34 | System.out.println(new Date(Long.valueOf(timeStamp))); |
| 36 | - String token = SHA256Util.getSHA256String("IDE" + "iClearExport" + "b92131f03f19a348" + timeStamp); | 35 | + //String token = SHA256Util.getSHA256String("IDE" + "iClearExport" + "b92131f03f19a348" + timeStamp); |
| 36 | + String token = SHA256Util.getSHA256String("BASF" + "iClearExportC" + "6db193cb4165a71b" + timeStamp); | ||
| 37 | System.out.println(token); | 37 | System.out.println(token); |
| 38 | 38 | ||
| 39 | 39 | ||
| 40 | Header[] headers = HttpHeader.custom() | 40 | Header[] headers = HttpHeader.custom() |
| 41 | .other("Content-Type", "application/json") | 41 | .other("Content-Type", "application/json") |
| 42 | - .other("Appid", "IDE") | 42 | + //.other("Appid", "IDE") |
| 43 | - .other("appKey", "iClearExport") | 43 | + //.other("appKey", "iClearExport") |
| 44 | + .other("Appid", "BASF") | ||
| 45 | + .other("appKey", "iClearExportC") | ||
| 44 | .other("TimeStamp", timeStamp) | 46 | .other("TimeStamp", timeStamp) |
| 45 | .other("token", token) | 47 | .other("token", token) |
| 46 | .build(); | 48 | .build(); |
| ... | @@ -53,14 +55,15 @@ public class HttpClientTest { | ... | @@ -53,14 +55,15 @@ public class HttpClientTest { |
| 53 | .retry(3); | 55 | .retry(3); |
| 54 | 56 | ||
| 55 | //String url = "https://40.73.78.157:8780/customs/sendMawb"; | 57 | //String url = "https://40.73.78.157:8780/customs/sendMawb"; |
| 56 | - String url = "https://127.0.0.1:8780/customs/sendMawb"; | 58 | + String url = "https://127.0.0.1:8780/basf/sendMawbBasf"; |
| 57 | HttpConfig config = HttpConfig.custom() | 59 | HttpConfig config = HttpConfig.custom() |
| 58 | .headers(headers) | 60 | .headers(headers) |
| 59 | .url(url) | 61 | .url(url) |
| 60 | .encoding("utf-8") | 62 | .encoding("utf-8") |
| 61 | .client(hcb.build()) | 63 | .client(hcb.build()) |
| 62 | // .json(new Gson().toJson(createMawb())); | 64 | // .json(new Gson().toJson(createMawb())); |
| 63 | - .json(masbJson); | 65 | + .json(basfJson); |
| 66 | + System.out.println("111111111111111111111111111111111111111111111"); | ||
| 64 | System.out.println(HttpClientUtil.post(config)); | 67 | System.out.println(HttpClientUtil.post(config)); |
| 65 | } | 68 | } |
| 66 | 69 | ||
| ... | @@ -185,5 +188,38 @@ public class HttpClientTest { | ... | @@ -185,5 +188,38 @@ public class HttpClientTest { |
| 185 | return mawb; | 188 | return mawb; |
| 186 | } | 189 | } |
| 187 | 190 | ||
| 191 | + private Basfc createNewBasf(){ | ||
| 192 | + List<BasfcDetail> basfcDetailList = new ArrayList<>(); | ||
| 193 | + BasfcDetail basfcDetail = new BasfcDetail(); | ||
| 194 | + basfcDetail.setConsignmentDetailId(123L); | ||
| 195 | + basfcDetail.setSkuCode("29262000"); | ||
| 196 | + basfcDetail.setSkuName("210908001测试"); | ||
| 197 | + basfcDetail.setModel("0|0|1|1||||||||"); | ||
| 198 | + basfcDetail.setUnitLegalFirst("035"); | ||
| 199 | + basfcDetail.setQtyLegalFirst(BigDecimal.valueOf(1)); | ||
| 200 | + basfcDetail.setKnockdownUnit("035"); | ||
| 201 | + basfcDetail.setKnockdownNumber(BigDecimal.valueOf(1)); | ||
| 202 | + basfcDetail.setUnitLegalSecond("007"); | ||
| 203 | + basfcDetail.setQtyLegalSecond(BigDecimal.valueOf(1)); | ||
| 204 | + basfcDetail.setDeclaredAmount(BigDecimal.valueOf(1)); | ||
| 205 | + basfcDetail.setCurrency("USD"); | ||
| 206 | + basfcDetail.setDeclaredWeight(BigDecimal.valueOf(1)); | ||
| 207 | + basfcDetailList.add(basfcDetail); | ||
| 208 | + | ||
| 209 | + Basfc basfc = new Basfc(); | ||
| 210 | + basfc.setConsignmentCode("210908003"); | ||
| 211 | + basfc.setConsignmentId(1L); | ||
| 212 | + basfc.setConsType("C"); | ||
| 213 | + basfc.setSender("天津知行博创科技有限公司"); | ||
| 214 | + basfc.setShipperCustomsCode("11119608L9"); | ||
| 215 | + basfc.setShipperSCC("123456789012345678"); | ||
| 216 | + basfc.setOperateUnitName("天津丰铭佳业科贸有限公司"); | ||
| 217 | + basfc.setOperateUnitCode(""); | ||
| 218 | + basfc.setOperateSCC(""); | ||
| 219 | + basfc.setEanNo("1"); | ||
| 220 | + basfc.setConsignmentList(basfcDetailList); | ||
| 221 | + return basfc; | ||
| 222 | + } | ||
| 223 | + | ||
| 188 | 224 | ||
| 189 | } | 225 | } | ... | ... |
| 1 | package com.erry.iclear.dateInterface; | 1 | package com.erry.iclear.dateInterface; |
| 2 | 2 | ||
| 3 | + | ||
| 4 | +import com.alibaba.fastjson.JSONObject; | ||
| 5 | +import com.arronlong.httpclientutil.HttpClientUtil; | ||
| 6 | +import com.arronlong.httpclientutil.builder.HCB; | ||
| 7 | +import com.arronlong.httpclientutil.common.HttpConfig; | ||
| 8 | +import com.arronlong.httpclientutil.common.HttpHeader; | ||
| 9 | +import com.arronlong.httpclientutil.common.SSLs; | ||
| 10 | +import com.arronlong.httpclientutil.exception.HttpProcessException; | ||
| 11 | +import com.erry.iclear.dateInterface.api.request.ConsignmentCode; | ||
| 12 | +import com.erry.iclear.dateInterface.util.SHA256Util; | ||
| 13 | +import com.google.gson.Gson; | ||
| 14 | +import org.apache.http.Header; | ||
| 3 | import org.junit.Test; | 15 | import org.junit.Test; |
| 4 | import org.junit.runner.RunWith; | 16 | import org.junit.runner.RunWith; |
| 5 | import org.springframework.boot.test.context.SpringBootTest; | 17 | import org.springframework.boot.test.context.SpringBootTest; |
| ... | @@ -7,14 +19,74 @@ import org.springframework.test.context.ActiveProfiles; | ... | @@ -7,14 +19,74 @@ import org.springframework.test.context.ActiveProfiles; |
| 7 | import org.springframework.test.context.junit4.SpringRunner; | 19 | import org.springframework.test.context.junit4.SpringRunner; |
| 8 | import org.springframework.test.context.web.WebAppConfiguration; | 20 | import org.springframework.test.context.web.WebAppConfiguration; |
| 9 | 21 | ||
| 22 | +import java.util.*; | ||
| 23 | + | ||
| 10 | @RunWith(SpringRunner.class) | 24 | @RunWith(SpringRunner.class) |
| 11 | @SpringBootTest | 25 | @SpringBootTest |
| 12 | @WebAppConfiguration | 26 | @WebAppConfiguration |
| 13 | @ActiveProfiles("dev") | 27 | @ActiveProfiles("dev") |
| 14 | class IClearApiApplicationTests { | 28 | class IClearApiApplicationTests { |
| 15 | 29 | ||
| 16 | - @Test | 30 | + |
| 17 | - public void contextLoads() { | 31 | + public static void main(String[] args) throws HttpProcessException { |
| 32 | + Gson gson = new Gson(); | ||
| 33 | + String str = "{\"consignmentCode\":\"" + | ||
| 34 | + "201907105," + | ||
| 35 | + "202018092," + | ||
| 36 | + "202108026," + | ||
| 37 | + "192770847591," + | ||
| 38 | + "201907099," + | ||
| 39 | + "202017062," + | ||
| 40 | + "770194186721," + | ||
| 41 | + "201907109," + | ||
| 42 | + "201907092," + | ||
| 43 | + "201907096," + | ||
| 44 | + "201907103," + | ||
| 45 | + "201907093," + | ||
| 46 | + "774439601," + | ||
| 47 | + "774439602," + | ||
| 48 | + "201907097," + | ||
| 49 | + "281382086345," + | ||
| 50 | + "202108100," + | ||
| 51 | + "192770847477," + | ||
| 52 | + "192770847478," + | ||
| 53 | + "149148215190\"}"; | ||
| 54 | + | ||
| 55 | +// String str = "{\"consignmentCode\":\"110000011\"}"; | ||
| 56 | + String timeStamp = "1634697153697"; | ||
| 57 | + //String timeStamp = "1624263798669"; | ||
| 58 | + System.out.println(new Date(Long.valueOf(timeStamp))); | ||
| 59 | + //String token = SHA256Util.getSHA256String("IDE" + "iClearExport" + "b92131f03f19a348" + timeStamp); | ||
| 60 | + String token = SHA256Util.getSHA256String("BASF" + "iClearExportC" + "6db193cb4165a71b" + timeStamp); | ||
| 61 | + System.out.println(token); | ||
| 62 | + | ||
| 63 | + Header[] headers = HttpHeader.custom() | ||
| 64 | + .other("Content-Type", "application/json") | ||
| 65 | + .other("Appid", "BASF") | ||
| 66 | + .other("appKey", "iClearExportC") | ||
| 67 | + .other("TimeStamp", timeStamp) | ||
| 68 | + .other("token", "2D9F60B9ACE7A559CF1C21F34D543522F3520C7FF0F4A94FEC5A9700BC8589B8") | ||
| 69 | + .build(); | ||
| 70 | + | ||
| 71 | + HCB hcb = HCB.custom() | ||
| 72 | + .timeout(20000) | ||
| 73 | + .pool(100, 10) | ||
| 74 | + .sslpv(SSLs.SSLProtocolVersion.TLSv1_2) | ||
| 75 | + .ssl() | ||
| 76 | + .retry(3); | ||
| 77 | + | ||
| 78 | + //String url = "https://40.73.78.157:8780/customs/sendMawb"; | ||
| 79 | + String url = "https://40.73.78.157:8780/basf/selectDecListBasf"; | ||
| 80 | + //String url = "https://40.73.78.157:8780/basf/selectChmListBasf"; | ||
| 81 | + | ||
| 82 | + HttpConfig config = HttpConfig.custom() | ||
| 83 | + .headers(headers) | ||
| 84 | + .url(url) | ||
| 85 | + .encoding("utf-8") | ||
| 86 | + .client(hcb.build()) | ||
| 87 | +// .json(new Gson().toJson(createMawb())); | ||
| 88 | + .json(str); | ||
| 89 | + System.out.println(HttpClientUtil.post(config)); | ||
| 18 | } | 90 | } |
| 19 | 91 | ||
| 20 | } | 92 | } | ... | ... |
| 1 | -package com.erry.iclear.dateInterface; | 1 | +//package com.erry.iclear.dateInterface; |
| 2 | - | 2 | +// |
| 3 | -import com.arronlong.httpclientutil.HttpClientUtil; | 3 | +//import com.arronlong.httpclientutil.HttpClientUtil; |
| 4 | -import com.arronlong.httpclientutil.common.HttpConfig; | 4 | +//import com.arronlong.httpclientutil.common.HttpConfig; |
| 5 | -import com.arronlong.httpclientutil.common.HttpHeader; | 5 | +//import com.arronlong.httpclientutil.common.HttpHeader; |
| 6 | -import com.erry.iclear.dateInterface.util.JsonToJava; | 6 | +//import com.erry.iclear.dateInterface.util.JsonToJava; |
| 7 | -import org.apache.http.Header; | 7 | +//import org.apache.http.Header; |
| 8 | - | 8 | +// |
| 9 | -public class IClearCheckTest { | 9 | +//public class IClearCheckTest { |
| 10 | - public static void main(String[] args) throws Exception{ | 10 | +// public static void main(String[] args) throws Exception{ |
| 11 | - //调用IClear接口进行运单数据校验 | 11 | +// //调用IClear接口进行运单数据校验 |
| 12 | - String objJson = "{\"chmConsignmentDetailList\":[{\"amount\":3365,\"chmConsignment\":{\"$ref\":\"$\"},\"contentDescription\":null,\"currency\":\"欧元\",\"currencyDic\":{\"chineseName\":\"欧元\",\"code\":\"currencySystem_EUR\",\"dictCode\":\"currencySystem\",\"ext2\":\"EUR\",\"ext3\":\"GBR\",\"ext6\":\"300\",\"id\":84605},\"destinationCountry\":\"德意志联邦共和国\",\"destinationCountryDic\":{\"chineseName\":\"德意志联邦共和国\",\"code\":\"Country_DE\",\"dictCode\":\"Country\",\"ext2\":\"DE\",\"ext3\":\"DEU\",\"ext6\":\"304\",\"id\":84415},\"detailId\":\"204\",\"domesticDestination\":null,\"domesticDestinationMapping\":null,\"habitat\":\"中华人民共和国\",\"habitatDic\":{\"chineseName\":\"中华人民共和国\",\"code\":\"Country_CN\",\"dictCode\":\"Country\",\"ext2\":\"CN\",\"ext3\":\"CHN\",\"ext6\":\"142\",\"id\":84355},\"id\":null,\"knockdownNumber\":1.0,\"knockdownUnit\":\"个\",\"knockdownUnitDic\":{\"chineseName\":\"个\",\"code\":\"transactionUnit_007\",\"dictCode\":\"transactionUnit\",\"ext2\":\"007\",\"ext3\":\"GBR\",\"ext6\":\"EA\",\"id\":84139},\"levyType\":\"照章征税\",\"levyTypeDic\":{\"chineseName\":\"照章征税\",\"code\":\"levyType_1\",\"dictCode\":\"levyType\",\"ext2\":\"1\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":84515},\"model\":\"4|0|控制电机用|240KW|西门子/SIEMENS|6RA8081-6GV62-0AA0|||\",\"oriRegion\":3365,\"origplacecode\":\"\",\"origplacecodeMapping\":null,\"qtyLegalFirst\":1.0,\"qtyLegalSecond\":1.0,\"skuCode\":\"8504409999\",\"skuName\":\"变频调速装置\",\"unitLegalFirst\":\"千克\",\"unitLegalFirstId\":{\"chineseName\":\"千克\",\"code\":\"transactionUnit_035\",\"dictCode\":\"transactionUnit\",\"ext2\":\"035\",\"ext3\":\"GBR\",\"ext6\":\"KGS\",\"id\":84148},\"unitLegalSecond\":\"千克\",\"unitLegalSecondId\":{\"$ref\":\"$.chmConsignmentDetailList[0].unitLegalFirstId\"}}],\"consStatus\":\"待申报海关\",\"consStatusDic\":{\"chineseName\":\"待申报海关\",\"code\":\"transferWaybillStatus_5\",\"dictCode\":\"transferWaybillStatus\",\"ext2\":\"5\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":84492},\"consType\":\"D\",\"consTypeId\":{\"chineseName\":\"D\",\"code\":\"consType_D\",\"dictCode\":\"consType\",\"ext2\":\"D\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":84512},\"consignmentCode\":\"774426960555\",\"consignmentHeadCode\":null,\"contractCode\":\"3006622200\",\"counts\":1,\"createTime\":1628681350830,\"creator\":\"IDE-ICLEAR-API\",\"customsNo\":null,\"dealMode\":\"CIF、CIP、DDP、DDU、DAP\",\"dealModeDic\":{\"chineseName\":\"CIF、CIP、DDP、DDU、DAP\",\"code\":\"ClinchType_CIF\",\"dictCode\":\"ClinchType\",\"ext2\":\"CIF\",\"ext3\":\"GBR\",\"ext6\":\"1\",\"id\":83977},\"declaredDocType\":null,\"declaredDocTypeDic\":null,\"declaredPort\":null,\"declaredRemark\":null,\"declaredUnitName\":\"Jimmy shen\",\"enteringNo\":null,\"fromCountry\":\"美国\",\"fromCountryDic\":{\"chineseName\":\"美国\",\"code\":\"Country_US\",\"dictCode\":\"Country\",\"ext2\":\"US\",\"ext3\":\"USA\",\"ext6\":\"502\",\"id\":84653},\"grossWeight\":4.6,\"id\":null,\"insuranceCost\":0.74,\"insuranceCostCurrency\":\"欧元\",\"insuranceCostCurrencyDic\":{\"$ref\":\"$.chmConsignmentDetailList[0].currencyDic\"},\"netWeight\":32,\"operateUnitName\":\"西门子电气传动有限公司\",\"otherCost\":null,\"otherCurrency\":null,\"otherCurrencyDic\":null,\"overseasConsignorCode\":null,\"overseasConsignorFnCname\":\"PRYSMIAN KABEL UND SYSTEME GMBH\",\"ownerCode\":\"91120116600587482L\",\"ownerCodeScc\":\"91120116600587482L\",\"ownerName\":\"西门子电气传动有限公司\",\"packageType\":\"木制或竹藤等植物性材料制盒/箱\",\"packageTypeDic\":{\"chineseName\":\"木制或竹藤等植物性材料制盒/箱\",\"code\":\"NewPackageType_23\",\"dictCode\":\"NewPackageType\",\"ext2\":\"23\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":83934},\"portId\":{\"chineseName\":\"TSN\",\"code\":\"port_tsn\",\"dictCode\":\"port\",\"ext2\":null,\"ext3\":null,\"ext6\":null,\"id\":125028},\"portName\":\"TSN\",\"recordCode\":null,\"taxNature\":\"中外合资\",\"taxNatureDic\":{\"chineseName\":\"中外合资\",\"code\":\"natureExemption_601\",\"dictCode\":\"natureExemption\",\"ext2\":\"601\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":84122},\"throughStopPort\":\"304\",\"throughStopPortDic\":{\"createName\":\"ADMIN\",\"createTime\":\"\",\"id\":5457,\"pcCode\":\"DEU000\",\"portEngName\":\"Germany\",\"portName\":\"德国\",\"portNo\":\"304\"},\"tradeAreaCode\":\"德意志联邦共和国\",\"tradeAreaCodeDic\":{\"$ref\":\"$.chmConsignmentDetailList[0].destinationCountryDic\"},\"tradeCoSCC\":\"91120116600587482L\",\"tradeMode\":\"一般贸易\",\"tradeModeDic\":{\"chineseName\":\"一般贸易\",\"code\":\"supervisionMode_110\",\"dictCode\":\"supervisionMode\",\"ext2\":\"0110\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":84000},\"transCost\":110.9,\"transCurrency\":\"欧元\",\"transCurrencyDic\":{\"$ref\":\"$.chmConsignmentDetailList[0].currencyDic\"},\"updateTime\":null,\"vehicleWay\":{\"chineseName\":\"航空运输\",\"code\":\"VehicleWayCode_5\",\"dictCode\":\"VehicleWayCode\",\"ext2\":\"5\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":83986},\"vehicleWayCode\":\"VehicleWayCode_5\"}"; | 12 | +// String objJson = "{\"chmConsignmentDetailList\":[{\"amount\":3365,\"chmConsignment\":{\"$ref\":\"$\"},\"contentDescription\":null,\"currency\":\"欧元\",\"currencyDic\":{\"chineseName\":\"欧元\",\"code\":\"currencySystem_EUR\",\"dictCode\":\"currencySystem\",\"ext2\":\"EUR\",\"ext3\":\"GBR\",\"ext6\":\"300\",\"id\":84605},\"destinationCountry\":\"德意志联邦共和国\",\"destinationCountryDic\":{\"chineseName\":\"德意志联邦共和国\",\"code\":\"Country_DE\",\"dictCode\":\"Country\",\"ext2\":\"DE\",\"ext3\":\"DEU\",\"ext6\":\"304\",\"id\":84415},\"detailId\":\"204\",\"domesticDestination\":null,\"domesticDestinationMapping\":null,\"habitat\":\"中华人民共和国\",\"habitatDic\":{\"chineseName\":\"中华人民共和国\",\"code\":\"Country_CN\",\"dictCode\":\"Country\",\"ext2\":\"CN\",\"ext3\":\"CHN\",\"ext6\":\"142\",\"id\":84355},\"id\":null,\"knockdownNumber\":1.0,\"knockdownUnit\":\"个\",\"knockdownUnitDic\":{\"chineseName\":\"个\",\"code\":\"transactionUnit_007\",\"dictCode\":\"transactionUnit\",\"ext2\":\"007\",\"ext3\":\"GBR\",\"ext6\":\"EA\",\"id\":84139},\"levyType\":\"照章征税\",\"levyTypeDic\":{\"chineseName\":\"照章征税\",\"code\":\"levyType_1\",\"dictCode\":\"levyType\",\"ext2\":\"1\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":84515},\"model\":\"4|0|控制电机用|240KW|西门子/SIEMENS|6RA8081-6GV62-0AA0|||\",\"oriRegion\":3365,\"origplacecode\":\"\",\"origplacecodeMapping\":null,\"qtyLegalFirst\":1.0,\"qtyLegalSecond\":1.0,\"skuCode\":\"8504409999\",\"skuName\":\"变频调速装置\",\"unitLegalFirst\":\"千克\",\"unitLegalFirstId\":{\"chineseName\":\"千克\",\"code\":\"transactionUnit_035\",\"dictCode\":\"transactionUnit\",\"ext2\":\"035\",\"ext3\":\"GBR\",\"ext6\":\"KGS\",\"id\":84148},\"unitLegalSecond\":\"千克\",\"unitLegalSecondId\":{\"$ref\":\"$.chmConsignmentDetailList[0].unitLegalFirstId\"}}],\"consStatus\":\"待申报海关\",\"consStatusDic\":{\"chineseName\":\"待申报海关\",\"code\":\"transferWaybillStatus_5\",\"dictCode\":\"transferWaybillStatus\",\"ext2\":\"5\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":84492},\"consType\":\"D\",\"consTypeId\":{\"chineseName\":\"D\",\"code\":\"consType_D\",\"dictCode\":\"consType\",\"ext2\":\"D\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":84512},\"consignmentCode\":\"774426960555\",\"consignmentHeadCode\":null,\"contractCode\":\"3006622200\",\"counts\":1,\"createTime\":1628681350830,\"creator\":\"IDE-ICLEAR-API\",\"customsNo\":null,\"dealMode\":\"CIF、CIP、DDP、DDU、DAP\",\"dealModeDic\":{\"chineseName\":\"CIF、CIP、DDP、DDU、DAP\",\"code\":\"ClinchType_CIF\",\"dictCode\":\"ClinchType\",\"ext2\":\"CIF\",\"ext3\":\"GBR\",\"ext6\":\"1\",\"id\":83977},\"declaredDocType\":null,\"declaredDocTypeDic\":null,\"declaredPort\":null,\"declaredRemark\":null,\"declaredUnitName\":\"Jimmy shen\",\"enteringNo\":null,\"fromCountry\":\"美国\",\"fromCountryDic\":{\"chineseName\":\"美国\",\"code\":\"Country_US\",\"dictCode\":\"Country\",\"ext2\":\"US\",\"ext3\":\"USA\",\"ext6\":\"502\",\"id\":84653},\"grossWeight\":4.6,\"id\":null,\"insuranceCost\":0.74,\"insuranceCostCurrency\":\"欧元\",\"insuranceCostCurrencyDic\":{\"$ref\":\"$.chmConsignmentDetailList[0].currencyDic\"},\"netWeight\":32,\"operateUnitName\":\"西门子电气传动有限公司\",\"otherCost\":null,\"otherCurrency\":null,\"otherCurrencyDic\":null,\"overseasConsignorCode\":null,\"overseasConsignorFnCname\":\"PRYSMIAN KABEL UND SYSTEME GMBH\",\"ownerCode\":\"91120116600587482L\",\"ownerCodeScc\":\"91120116600587482L\",\"ownerName\":\"西门子电气传动有限公司\",\"packageType\":\"木制或竹藤等植物性材料制盒/箱\",\"packageTypeDic\":{\"chineseName\":\"木制或竹藤等植物性材料制盒/箱\",\"code\":\"NewPackageType_23\",\"dictCode\":\"NewPackageType\",\"ext2\":\"23\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":83934},\"portId\":{\"chineseName\":\"TSN\",\"code\":\"port_tsn\",\"dictCode\":\"port\",\"ext2\":null,\"ext3\":null,\"ext6\":null,\"id\":125028},\"portName\":\"TSN\",\"recordCode\":null,\"taxNature\":\"中外合资\",\"taxNatureDic\":{\"chineseName\":\"中外合资\",\"code\":\"natureExemption_601\",\"dictCode\":\"natureExemption\",\"ext2\":\"601\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":84122},\"throughStopPort\":\"304\",\"throughStopPortDic\":{\"createName\":\"ADMIN\",\"createTime\":\"\",\"id\":5457,\"pcCode\":\"DEU000\",\"portEngName\":\"Germany\",\"portName\":\"德国\",\"portNo\":\"304\"},\"tradeAreaCode\":\"德意志联邦共和国\",\"tradeAreaCodeDic\":{\"$ref\":\"$.chmConsignmentDetailList[0].destinationCountryDic\"},\"tradeCoSCC\":\"91120116600587482L\",\"tradeMode\":\"一般贸易\",\"tradeModeDic\":{\"chineseName\":\"一般贸易\",\"code\":\"supervisionMode_110\",\"dictCode\":\"supervisionMode\",\"ext2\":\"0110\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":84000},\"transCost\":110.9,\"transCurrency\":\"欧元\",\"transCurrencyDic\":{\"$ref\":\"$.chmConsignmentDetailList[0].currencyDic\"},\"updateTime\":null,\"vehicleWay\":{\"chineseName\":\"航空运输\",\"code\":\"VehicleWayCode_5\",\"dictCode\":\"VehicleWayCode\",\"ext2\":\"5\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":83986},\"vehicleWayCode\":\"VehicleWayCode_5\"}"; |
| 13 | - | 13 | +// |
| 14 | - String url = "http://40.73.78.157:8081/chmConsignmentController/checkChmAndDetaliD"; | 14 | +// String url = "http://40.73.78.157:8081/chmConsignmentController/checkChmAndDetaliD"; |
| 15 | - | 15 | +// |
| 16 | - Header[] headers = HttpHeader.custom() | 16 | +// Header[] headers = HttpHeader.custom() |
| 17 | - .other("Content-Type", "application/json") | 17 | +// .other("Content-Type", "application/json") |
| 18 | - .build(); | 18 | +// .build(); |
| 19 | - //推送海关回执数据 | 19 | +// //推送海关回执数据 |
| 20 | - HttpConfig config = HttpConfig.custom() | 20 | +// HttpConfig config = HttpConfig.custom() |
| 21 | - .headers(headers) | 21 | +// .headers(headers) |
| 22 | - .url(url) | 22 | +// .url(url) |
| 23 | - .encoding("utf-8") | 23 | +// .encoding("utf-8") |
| 24 | - .json(objJson); | 24 | +// .json(objJson); |
| 25 | - String json = HttpClientUtil.post(config); | 25 | +// String json = HttpClientUtil.post(config); |
| 26 | - System.out.println(json); | 26 | +// System.out.println(json); |
| 27 | - } | 27 | +// } |
| 28 | -} | 28 | +//} | ... | ... |
| ... | @@ -7,6 +7,8 @@ import com.erry.iclear.dateInterface.util.HttpUtils; | ... | @@ -7,6 +7,8 @@ import com.erry.iclear.dateInterface.util.HttpUtils; |
| 7 | import com.erry.iclear.dateInterface.util.JsonToJava; | 7 | import com.erry.iclear.dateInterface.util.JsonToJava; |
| 8 | import org.junit.Test; | 8 | import org.junit.Test; |
| 9 | import org.springframework.beans.factory.annotation.Value; | 9 | import org.springframework.beans.factory.annotation.Value; |
| 10 | + | ||
| 11 | +import java.text.SimpleDateFormat; | ||
| 10 | import java.util.HashMap; | 12 | import java.util.HashMap; |
| 11 | import java.util.Map; | 13 | import java.util.Map; |
| 12 | 14 | ||
| ... | @@ -50,7 +52,7 @@ public class TokenTest extends IClearApiApplicationTests { | ... | @@ -50,7 +52,7 @@ public class TokenTest extends IClearApiApplicationTests { |
| 50 | System.out.println(rs); | 52 | System.out.println(rs); |
| 51 | } | 53 | } |
| 52 | 54 | ||
| 53 | - public static void main(String[] args) throws Exception{ | 55 | + /* public static void main(String[] args) throws Exception{ |
| 54 | String url = "https://apictm.iclrccd-fedex.com/login"; | 56 | String url = "https://apictm.iclrccd-fedex.com/login"; |
| 55 | Map<String,String> map = new HashMap<String,String>(); | 57 | Map<String,String> map = new HashMap<String,String>(); |
| 56 | map.put("username", "iclear_export_prod"); | 58 | map.put("username", "iclear_export_prod"); |
| ... | @@ -66,7 +68,9 @@ public class TokenTest extends IClearApiApplicationTests { | ... | @@ -66,7 +68,9 @@ public class TokenTest extends IClearApiApplicationTests { |
| 66 | map.put("token","eyJhbGciOiJSUzI1NiJ9.eyJleHBpcmVBdCI6MTY0Njg4MDc3NzY0NSwidXNlcklkIjoiaWNsZWFyX2V4cG9ydF9wcm9kIn0.fey8YVWL0wcxvCUMQR-ePyCXIh9AdoztIixtcYgGjtaUCxO3VVf9Jmut3ZVVelxigvTDzv-Iz097R2fgBSOBzStICTZGqxmRV7Av6R41HCTTQ8BL6aSPle2QszSkTt5T95cYiFYSv9CHmxSKBU_MrJk5WhCJb5XOAmWmdV94McFWTBi1oTIjVfgiczu0pzgA1berR1lfUIEDVEUxUoduVARzwUcDDljq0pf-rPhpAj-Iqbhc4fint4Th-BlO6Rg4ZWYB08-3Id9krl92TMJJ_rXMrhbna6833r8PcpdbXIFPkuopbrv9GL1Ds_vWL7Sd5BTSYtMRn2ku0GhAP6GNPg"); | 68 | map.put("token","eyJhbGciOiJSUzI1NiJ9.eyJleHBpcmVBdCI6MTY0Njg4MDc3NzY0NSwidXNlcklkIjoiaWNsZWFyX2V4cG9ydF9wcm9kIn0.fey8YVWL0wcxvCUMQR-ePyCXIh9AdoztIixtcYgGjtaUCxO3VVf9Jmut3ZVVelxigvTDzv-Iz097R2fgBSOBzStICTZGqxmRV7Av6R41HCTTQ8BL6aSPle2QszSkTt5T95cYiFYSv9CHmxSKBU_MrJk5WhCJb5XOAmWmdV94McFWTBi1oTIjVfgiczu0pzgA1berR1lfUIEDVEUxUoduVARzwUcDDljq0pf-rPhpAj-Iqbhc4fint4Th-BlO6Rg4ZWYB08-3Id9krl92TMJJ_rXMrhbna6833r8PcpdbXIFPkuopbrv9GL1Ds_vWL7Sd5BTSYtMRn2ku0GhAP6GNPg"); |
| 67 | String rs = httpUtils.doPost(url,map); | 69 | String rs = httpUtils.doPost(url,map); |
| 68 | System.out.println(rs); | 70 | System.out.println(rs); |
| 69 | - } | 71 | + }*/ |
| 70 | 72 | ||
| 71 | private static HttpUtils httpUtils = new HttpUtils(); | 73 | private static HttpUtils httpUtils = new HttpUtils(); |
| 74 | + | ||
| 75 | + | ||
| 72 | } | 76 | } | ... | ... |
-
Please register or login to post a comment