ApiTest.java
6.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
package com.erry.iclear.dateInterface;
import com.erry.iclear.dateInterface.api.request.Mawb;
import com.erry.iclear.dateInterface.api.request.MawbDetail;
import com.erry.iclear.dateInterface.api.response.ResultRS;
import com.google.gson.Gson;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class ApiTest {
public static void main(String[] args) {
//{"IEFlag":"E","type":"EX","agentCode":"1111980005","agentName":"联邦快递(中国)有限公司","billNo":"202105210784","contrNo":"NO.565733","customMaster":"0101","cutMode":"101","declTrnRel":"0","distinatePort":"ASM000","ediId":"001","entryId":"25512456","feeCurr":"USD","feeMark":"3","feeRate":100.58,"grossWet":500,"IEPort":"0101","inputerName":"","insurCurr":"MOP","insurMark":"3","insurRate":23.44,"manualNo":"备案号","netWt":80,"otherCurr":"001","otherRate":10,"otherMark":"","ownerCode":"Z321654987","ownerName":"上海保险","packNo":1,"preEntryId":"","tradeCountry":"USA","tradeMode":"0200","tradeCode":"Z321654987","trafMode":"1","tradeName":"上海铢怡国际货物运输代理有限公司","transMode":"3","wrapType":"22","tradeCodeScc":"A74125896321456987","ownerCodeScc":"A74125896321456987","tradeAreaCode":"USA","markNo":"N/M","entyPortCode":"310302","goodsPlace":"","declareName":"张安","overseasConsignorCode":"Z785421","overseasConsigneeCode":"Z785421","overseasConsigneeEname":"出口时必填收件人公司名(原)","mawbDetailList":[{"classMark":"","codeTS":"69125472","declPrice":111.123,"declTotal":788,"dutyMode":"1","exgNo":"","exgVersion":"","firstUnit":"","firstQty":11,"GUnit":"007","GModel":"商品规格、型号","GName":"餐桌","GNo":"1","GQty":1,"originCountry":"USA","secondUnit":"007","secondQty":2,"tradeCurr":"USA","useTo":"","ciqCode":"","destinationCountry":"CHN","declGoodsEname":"","destCode":"","districtCode":"4408W"},{"classMark":"","codeTS":"69125472","declPrice":45.72,"declTotal":33,"dutyMode":"1","exgNo":"","exgVersion":"","firstUnit":"","firstQty":11,"GUnit":"007","GModel":"商品规格、型号","GName":"餐桌","GNo":"2","GQty":22,"originCountry":"USA","secondUnit":"007","secondQty":3,"tradeCurr":"USA","useTo":"","ciqCode":"","destinationCountry":"CHN","declGoodsEname":"","destCode":"","districtCode":"4408W"}]}
MawbDetail d1 = new MawbDetail();
d1.setClassMark("");
d1.setCodeTS("69125472");
d1.setDeclPrice(BigDecimal.valueOf(111.123));
d1.setDeclTotal(BigDecimal.valueOf(788));
d1.setDutyMode("1");
d1.setExgNo("");
d1.setExgVersion("");
d1.setFirstUnit("");
d1.setFirstQty(11);
d1.setGUnit("007");
d1.setGModel("商品规格、型号");
d1.setGName("餐桌");
d1.setGNo("1");
d1.setGQty(1);
d1.setOriginCountry("USA");
d1.setSecondUnit("007");
d1.setSecondQty(2);
d1.setTradeCurr("USA");
d1.setUseTo("");
d1.setWorkUsd(null);
d1.setDestinationCountry("CHN");
d1.setCiqCode("");
d1.setDeclGoodsEname("");
d1.setDestCode("");
d1.setDistrictCode("4408W");
MawbDetail d2 = new MawbDetail();
d2.setClassMark("");
d2.setCodeTS("69125472");
d2.setDeclPrice(BigDecimal.valueOf(45.72));
d2.setDeclTotal(BigDecimal.valueOf(33));
d2.setDutyMode("1");
d2.setExgNo("");
d2.setExgVersion("");
d2.setFirstUnit("");
d2.setFirstQty(11);
d2.setGUnit("007");
d2.setGModel("商品规格、型号");
d2.setGName("餐桌");
d2.setGNo("2");
d2.setGQty(22);
d2.setOriginCountry("USA");
d2.setSecondUnit("007");
d2.setSecondQty(3);
d2.setTradeCurr("USA");
d2.setUseTo("");
d2.setWorkUsd(null);
d2.setDestinationCountry("CHN");
d2.setCiqCode("");
d2.setDeclGoodsEname("");
d2.setDestCode("");
d2.setDistrictCode("4408W");
List<MawbDetail> mawbDetailList = new ArrayList<MawbDetail>();
mawbDetailList.add(d1);
mawbDetailList.add(d2);
Mawb mawb = new Mawb();
mawb.setIEFlag("E");
mawb.setType("EX");
mawb.setAgentCode("1111980005");
mawb.setAgentName("联邦快递(中国)有限公司");
mawb.setBillNo("202105210784");
mawb.setContrNo("NO.565733");
mawb.setCustomMaster("0101");
mawb.setCutMode("101");
mawb.setDeclTrnRel("0");
mawb.setDistinatePort("ASM000");
mawb.setEdiId("001");
mawb.setEntryId("25512456");
mawb.setFeeCurr("USD");
mawb.setFeeMark("3");
mawb.setFeeRate(BigDecimal.valueOf(100.58));
mawb.setGrossWet(500);
mawb.setIEPort("0101");
mawb.setInputerName("");
mawb.setInsurCurr("MOP");
mawb.setInsurMark("3");
mawb.setInsurRate(BigDecimal.valueOf(23.44));
mawb.setManualNo("备案号");
mawb.setNetWt(BigDecimal.valueOf(80));
mawb.setOtherCurr("001");
mawb.setOtherRate(BigDecimal.valueOf(10));
mawb.setOtherMark("");
mawb.setOwnerCode("Z321654987");
mawb.setOwnerName("上海保险");
mawb.setPackNo(1);
mawb.setPreEntryId("");
mawb.setTradeCountry("USA");
mawb.setTradeMode("0200");
mawb.setTradeCode("Z321654987");
mawb.setTrafMode("1");
mawb.setTradeName("上海铢怡国际货物运输代理有限公司");
mawb.setTransMode("3");
mawb.setWrapType("22");
mawb.setTradeCodeScc("A74125896321456987");
mawb.setOwnerCodeScc("A74125896321456987");
mawb.setTradeAreaCode("USA");
mawb.setMarkNo("N/M");
mawb.setEntyPortCode("310302");
mawb.setGoodsPlace("");
mawb.setDeclareName("张安");
mawb.setOverseasConsignorCode("Z785421");
mawb.setOverseasConsigneeCode("Z785421");
mawb.setOverseasConsigneeEname("出口时必填收件人公司名(原)");
mawb.setMawbDetailList(mawbDetailList);
// List list=(List<MawbDetail>) mawb.getMawbDetailList();
// list.forEach(d->{
// System.out.println(d.toString());
// });
ResultRS rs = new ResultRS(true,"200","操作成功");
Gson gson = new Gson();
System.out.println(gson.toJson(mawb));
System.out.println(gson.toJson(rs));
}
}