DemoApplication.java
10.5 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
package com.example.demo;
import com.example.demo.util.XML.XMLParse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import java.util.List;
import java.util.Map;
@SpringBootApplication
@EnableEurekaClient
@MapperScan("com.example.demo.mapper")//将项目中对应的mapper类的路径加进来就可以了
public class DemoApplication {
public static void main(String[] args) {
Logger logger = LoggerFactory.getLogger(DemoApplication.class);
SpringApplication.run(DemoApplication.class, args);
String testMsg= "<MSG>\n" +
"\t<META>\n" +
"\t\t<SNDR>TXD</SNDR>\n" +
"\t\t<DDTM>20181109021010</DDTM>\n" +
"\t\t<TYPE>DFME</TYPE>\n" +
"\t\t<STYP>FWB</STYP>\n" +
"\t\t<SEQN>4638010</SEQN>\n" +
"\t</META>\n" +
"\t<MasterConsignment>\n" +
"\t\t<ID>479-77229622</ID>\n" +
"\t\t<TypeCode>741</TypeCode>\n" +
"\t\t<NilCarriageValueIndicator>false</NilCarriageValueIndicator>\n" +
"\t\t<DeclaredValueForCarriageAmount currencyID=\"CNY\">0</DeclaredValueForCarriageAmount>\n" +
"\t\t<NilCustomsValueIndicator>true</NilCustomsValueIndicator>\n" +
"\t\t<DeclaredValueForCustomsAmount currencyID=\"CNY\">NCV</DeclaredValueForCustomsAmount>\n" +
"\t\t<NilInsuranceValueIndicator>true</NilInsuranceValueIndicator>\n" +
"\t\t<InsuranceValueAmount currencyID=\"CNY\">XXX</InsuranceValueAmount>\n" +
"\t\t<TotalChargePrepaidIndicator>true</TotalChargePrepaidIndicator>\n" +
"\t\t<WeightTotalChargeAmount currencyID=\"CNY\">1153</WeightTotalChargeAmount>\n" +
"\t\t<ValuationTotalChargeAmount currencyID=\"CNY\">0.00</ValuationTotalChargeAmount>\n" +
"\t\t<TotalDisbursementPrepaidIndicator>true</TotalDisbursementPrepaidIndicator>\n" +
"\t\t<TotalPrepaidChargeAmount currencyID=\"CNY\">1384.00</TotalPrepaidChargeAmount>\n" +
"\t\t<TotalCollectChargeAmount currencyID=\"CNY\">0</TotalCollectChargeAmount>\n" +
"\t\t<DestinationCurrencyTotalCollectChargeAmount currencyID=\"CNY\">0</DestinationCurrencyTotalCollectChargeAmount>\n" +
"\t\t<IncludedTareGrossWeightMeasure unitCode=\"KGM\">1153.0</IncludedTareGrossWeightMeasure>\n" +
"\t\t<NetWeightMeasure/>\n" +
"\t\t<GrossVolumeMeasure unitCode=\"MTQ\">2.7</GrossVolumeMeasure>\n" +
"\t\t<TotalChargeableWeightMeasure unitCode=\"KGM\">1153.0</TotalChargeableWeightMeasure>\n" +
"\t\t<ConsignmentItemQuantity>1</ConsignmentItemQuantity>\n" +
"\t\t<TotalPieceQuantity>45</TotalPieceQuantity>\n" +
"\t\t<TotalLoadedPackageQuantity>45</TotalLoadedPackageQuantity>\n" +
"\t\t<PackageInfo>编织袋</PackageInfo>\n" +
"\t\t<FreightRateTypeCode>Q</FreightRateTypeCode>\n" +
"\t\t<ConsignorParty>\n" +
"\t\t\t<PrimaryID schemeAgencyID=\"1\">FY</PrimaryID>\n" +
"\t\t\t<Name>郑州飞鹰货运服务有限公司</Name>\n" +
"\t\t\t<AccountID>INFOSKY:NULL</AccountID>\n" +
"\t\t\t<PostalStructuredAddress>\n" +
"\t\t\t\t<StreetName>郑州</StreetName>\n" +
"\t\t\t\t<CityName>CGO</CityName>\n" +
"\t\t\t\t<CountryID>CN</CountryID>\n" +
"\t\t\t\t<SpecifiedAddressLocation/>\n" +
"\t\t\t</PostalStructuredAddress>\n" +
"\t\t\t<SpecifiedCargoAgentLocation/>\n" +
"\t\t\t<DefinedTradeContact>\n" +
"\t\t\t\t<DirectTelephoneCommunication>\n" +
"\t\t\t\t\t<CompleteNumber>13633854441</CompleteNumber>\n" +
"\t\t\t\t</DirectTelephoneCommunication>\n" +
"\t\t\t</DefinedTradeContact>\n" +
"\t\t</ConsignorParty>\n" +
"\t\t<ConsigneeParty>\n" +
"\t\t\t<PrimaryID schemeAgencyID=\"2\">SK</PrimaryID>\n" +
"\t\t\t<Name>深圳市联运通</Name>\n" +
"\t\t\t<AccountID>INFOSKY:NULL</AccountID>\n" +
"\t\t\t<PostalStructuredAddress>\n" +
"\t\t\t\t<StreetName>机场自提</StreetName>\n" +
"\t\t\t\t<CityName>SZX</CityName>\n" +
"\t\t\t\t<CountryID>CN</CountryID>\n" +
"\t\t\t\t<SpecifiedAddressLocation/>\n" +
"\t\t\t</PostalStructuredAddress>\n" +
"\t\t\t<SpecifiedCargoAgentLocation/>\n" +
"\t\t\t<DefinedTradeContact/>\n" +
"\t\t</ConsigneeParty>\n" +
"\t\t<FreightForwarderParty>\n" +
"\t\t\t<Name>80210200</Name>\n" +
"\t\t\t<AccountID>INFOSKY:NULL</AccountID>\n" +
"\t\t\t<PostalStructuredAddress>\n" +
"\t\t\t\t<CityName>CGO</CityName>\n" +
"\t\t\t\t<CountryID>CN</CountryID>\n" +
"\t\t\t\t<SpecifiedAddressLocation/>\n" +
"\t\t\t</PostalStructuredAddress>\n" +
"\t\t\t<SpecifiedCargoAgentLocation/>\n" +
"\t\t\t<DefinedTradeContact/>\n" +
"\t\t</FreightForwarderParty>\n" +
"\t\t<AssociatedParty>\n" +
"\t\t\t<PrimaryID/>\n" +
"\t\t\t<Name>CGO</Name>\n" +
"\t\t\t<AccountID>INFOSKY:NULL</AccountID>\n" +
"\t\t\t<RoleCode>AGT</RoleCode>\n" +
"\t\t\t<Role>Agent</Role>\n" +
"\t\t\t<PostalStructuredAddress>\n" +
"\t\t\t\t<CityName>CGO</CityName>\n" +
"\t\t\t\t<CountryID>CN</CountryID>\n" +
"\t\t\t\t<SpecifiedAddressLocation/>\n" +
"\t\t\t</PostalStructuredAddress>\n" +
"\t\t\t<SpecifiedCargoAgentLocation/>\n" +
"\t\t\t<DefinedTradeContact/>\n" +
"\t\t</AssociatedParty>\n" +
"\t\t<AssociatedParty>\n" +
"\t\t\t<PrimaryID/>\n" +
"\t\t\t<Name>CGOHA</Name>\n" +
"\t\t\t<AccountID>INFOSKY:NULL</AccountID>\n" +
"\t\t\t<RoleCode>GHA</RoleCode>\n" +
"\t\t\t<Role>Ground Handling Agent</Role>\n" +
"\t\t\t<PostalStructuredAddress>\n" +
"\t\t\t\t<CityName>CGO</CityName>\n" +
"\t\t\t\t<CountryID>CN</CountryID>\n" +
"\t\t\t\t<SpecifiedAddressLocation/>\n" +
"\t\t\t</PostalStructuredAddress>\n" +
"\t\t\t<SpecifiedCargoAgentLocation/>\n" +
"\t\t\t<DefinedTradeContact/>\n" +
"\t\t</AssociatedParty>\n" +
"\t\t<OriginLocation>\n" +
"\t\t\t<ID>CGO</ID>\n" +
"\t\t</OriginLocation>\n" +
"\t\t<FinalDestinationLocation>\n" +
"\t\t\t<ID>SZX</ID>\n" +
"\t\t</FinalDestinationLocation>\n" +
"\t\t<SpecifiedLogisticsTransportMovement>\n" +
"\t\t\t<StageCode>ZH9306/Nov09</StageCode>\n" +
"\t\t\t<ModeCode>4</ModeCode>\n" +
"\t\t\t<Mode>Air Transport</Mode>\n" +
"\t\t\t<ID>ZH9306</ID>\n" +
"\t\t\t<SequenceNumeric>1</SequenceNumeric>\n" +
"\t\t\t<UsedLogisticsTransportMeans/>\n" +
"\t\t\t<ArrivalEvent>\n" +
"\t\t\t\t<OccurrenceArrivalLocation>\n" +
"\t\t\t\t\t<ID>SZX</ID>\n" +
"\t\t\t\t</OccurrenceArrivalLocation>\n" +
"\t\t\t</ArrivalEvent>\n" +
"\t\t\t<DepartureEvent>\n" +
"\t\t\t\t<ScheduledOccurrenceDateTime>2018-11-09T00:00:00+08:00</ScheduledOccurrenceDateTime>\n" +
"\t\t\t\t<OccurrenceDepartureLocation>\n" +
"\t\t\t\t\t<ID>CGO</ID>\n" +
"\t\t\t\t</OccurrenceDepartureLocation>\n" +
"\t\t\t</DepartureEvent>\n" +
"\t\t</SpecifiedLogisticsTransportMovement>\n" +
"\t\t<HandlingInstructions>\n" +
"\t\t\t<Description>ELI</Description>\n" +
"\t\t\t<DescriptionCode>ELI</DescriptionCode>\n" +
"\t\t</HandlingInstructions>\n" +
"\t\t<AssociatedConsignmentCustomsProcedure/>\n" +
"\t\t<ApplicableTradeCurrencyExchange>\n" +
"\t\t\t<SourceCurrencyCode>CNY</SourceCurrencyCode>\n" +
"\t\t\t<TargetCurrencyCode>CNY</TargetCurrencyCode>\n" +
"\t\t\t<MarketID>S</MarketID>\n" +
"\t\t\t<ConversionRate>1</ConversionRate>\n" +
"\t\t</ApplicableTradeCurrencyExchange>\n" +
"\t\t<ApplicableLogisticsServiceCharge/>\n" +
"\t\t<ApplicableLogisticsAllowanceCharge>\n" +
"\t\t\t<ID>MY</ID>\n" +
"\t\t\t<Reason>燃油费</Reason>\n" +
"\t\t\t<ActualAmount currencyID=\"CNY\">231</ActualAmount>\n" +
"\t\t\t<PartyTypeCode>C</PartyTypeCode>\n" +
"\t\t</ApplicableLogisticsAllowanceCharge>\n" +
"\t\t<SignatoryCarrierAuthentication>\n" +
"\t\t\t<ActualDateTime>2018-11-09T02:07:00</ActualDateTime>\n" +
"\t\t\t<Signatory>郑天祥</Signatory>\n" +
"\t\t\t<IssueAuthenticationLocation>\n" +
"\t\t\t\t<Name>郑州</Name>\n" +
"\t\t\t</IssueAuthenticationLocation>\n" +
"\t\t</SignatoryCarrierAuthentication>\n" +
"\t\t<IncludedMasterConsignmentItem>\n" +
"\t\t\t<SequenceNumeric>1</SequenceNumeric>\n" +
"\t\t\t<TypeCode listAgencyID=\"1\">SJ</TypeCode>\n" +
"\t\t\t<GrossWeightMeasure unitCode=\"KGM\">1153.0</GrossWeightMeasure>\n" +
"\t\t\t<GrossVolumeMeasure unitCode=\"MTQ\">2.7</GrossVolumeMeasure>\n" +
"\t\t\t<PieceQuantity>45</PieceQuantity>\n" +
"\t\t\t<TareWeightMeasure unitCode=\"KGM\">1153.0</TareWeightMeasure>\n" +
"\t\t\t<NatureIdentificationTransportCargo>\n" +
"\t\t\t\t<Identification>手机(内含锂离子电池符合包装说明PI967第二部分要求)</Identification>\n" +
"\t\t\t</NatureIdentificationTransportCargo>\n" +
"\t\t\t<OriginCountry/>\n" +
"\t\t\t<AssociatedUnitLoadTransportEquipment>\n" +
"\t\t\t\t<OperatingParty/>\n" +
"\t\t\t</AssociatedUnitLoadTransportEquipment>\n" +
"\t\t\t<TransportLogisticsPackage>\n" +
"\t\t\t\t<ItemQuantity>45</ItemQuantity>\n" +
"\t\t\t\t<LinearSpatialDimension>\n" +
"\t\t\t\t\t<Description>true</Description>\n" +
"\t\t\t\t\t<WidthMeasure unitCode=\"CMT\">40</WidthMeasure>\n" +
"\t\t\t\t\t<LengthMeasure unitCode=\"CMT\">30</LengthMeasure>\n" +
"\t\t\t\t\t<HeightMeasure unitCode=\"CMT\">50</HeightMeasure>\n" +
"\t\t\t\t</LinearSpatialDimension>\n" +
"\t\t\t</TransportLogisticsPackage>\n" +
"\t\t\t<ApplicableFreightRateServiceCharge>\n" +
"\t\t\t\t<CategoryCode>Q</CategoryCode>\n" +
"\t\t\t\t<CommodityItemID>D2</CommodityItemID>\n" +
"\t\t\t\t<ChargeableWeightMeasure unitCode=\"KGM\">1153.0</ChargeableWeightMeasure>\n" +
"\t\t\t\t<AppliedRate>1</AppliedRate>\n" +
"\t\t\t\t<AppliedAmount currencyID=\"CNY\">1153</AppliedAmount>\n" +
"\t\t\t</ApplicableFreightRateServiceCharge>\n" +
"\t\t\t<SpecifiedRateCombinationPointLocation/>\n" +
"\t\t</IncludedMasterConsignmentItem>\n" +
"\t\t<ReportedStatus>\n" +
"\t\t\t<ReasonCode>FWB</ReasonCode>\n" +
"\t\t\t<EventTime>\n" +
"\t\t\t\t<OccurrenceDateTime>2018-11-09T02:07:15+08:00</OccurrenceDateTime>\n" +
"\t\t\t\t<DateTimeTypeCode>Actual</DateTimeTypeCode>\n" +
"\t\t\t</EventTime>\n" +
"\t\t\t<SpecifiedLocation>\n" +
"\t\t\t\t<ID>CGO</ID>\n" +
"\t\t\t</SpecifiedLocation>\n" +
"\t\t</ReportedStatus>\n" +
"\t</MasterConsignment>\n" +
"</MSG>";
try {
XMLParse xmlParse = new XMLParse(testMsg, "/MSG/MasterConsignment/AssociatedParty");
List<Map> stype_value =xmlParse.getNodeValuesFromXmlString();
logger.info(stype_value.toString());
}catch (Exception var7){
System.out.print("there something wrong");
}
}
}