正在显示
10 个修改的文件
包含
855 行增加
和
67 行删除
1 | package com.example.demo.handle; | 1 | package com.example.demo.handle; |
2 | 2 | ||
3 | import com.example.demo.handle.nms.FSU_FOH_Handle; | 3 | import com.example.demo.handle.nms.FSU_FOH_Handle; |
4 | +import com.example.demo.handle.nms.FZE_FOH_Handle; | ||
4 | import com.example.demo.model.IMF_META; | 5 | import com.example.demo.model.IMF_META; |
5 | import com.example.demo.util.IO.FileTool; | 6 | import com.example.demo.util.IO.FileTool; |
6 | import com.example.demo.util.XML.XML2ENTITY; | 7 | import com.example.demo.util.XML.XML2ENTITY; |
@@ -42,6 +43,8 @@ public class IMF_Message_MainHandle { | @@ -42,6 +43,8 @@ public class IMF_Message_MainHandle { | ||
42 | FSU_FOH_Handle.handle(doc); | 43 | FSU_FOH_Handle.handle(doc); |
43 | break; | 44 | break; |
44 | case "EFOH": | 45 | case "EFOH": |
46 | + FZE_FOH_Handle fze_foh_handle = new FZE_FOH_Handle(); | ||
47 | + fze_foh_handle.handle(doc); | ||
45 | break; | 48 | break; |
46 | case "UDEP": | 49 | case "UDEP": |
47 | break; | 50 | break; |
@@ -90,7 +90,7 @@ public class FSU_FOH_Handle { | @@ -90,7 +90,7 @@ public class FSU_FOH_Handle { | ||
90 | Map AssociatedStatusConsignment = (Map) XML2ENTITY.getMap(ReportedStatus, "AssociatedStatusConsignment"); //航班信息节点 | 90 | Map AssociatedStatusConsignment = (Map) XML2ENTITY.getMap(ReportedStatus, "AssociatedStatusConsignment"); //航班信息节点 |
91 | Map SpecifiedLogisticsTransportMovement = (Map) XML2ENTITY.getMap(AssociatedStatusConsignment, "SpecifiedLogisticsTransportMovement"); | 91 | Map SpecifiedLogisticsTransportMovement = (Map) XML2ENTITY.getMap(AssociatedStatusConsignment, "SpecifiedLogisticsTransportMovement"); |
92 | String flight = (String) XML2ENTITY.getMap(SpecifiedLogisticsTransportMovement, "ID");//航班号 | 92 | String flight = (String) XML2ENTITY.getMap(SpecifiedLogisticsTransportMovement, "ID");//航班号 |
93 | - if (!flight.isEmpty() && !flight.equals(null)) { | 93 | + if (flight!=null && !flight.isEmpty()) { |
94 | String carrier_no = flight.substring(0, 2); | 94 | String carrier_no = flight.substring(0, 2); |
95 | String flight_no = flight.substring(2); | 95 | String flight_no = flight.substring(2); |
96 | fsu_foh.setFlightno(flight_no); | 96 | fsu_foh.setFlightno(flight_no); |
@@ -131,7 +131,7 @@ public class FSU_FOH_Handle { | @@ -131,7 +131,7 @@ public class FSU_FOH_Handle { | ||
131 | 131 | ||
132 | int resoult = fsu_foh_handle.fohService.insert(fsu_foh); | 132 | int resoult = fsu_foh_handle.fohService.insert(fsu_foh); |
133 | 133 | ||
134 | - FileTool.writeWaybill("FSU_FOH",document.asXML(),waybillNo); | 134 | + FileTool.writeWaybill(stype,document.asXML(),waybillNo); |
135 | 135 | ||
136 | 136 | ||
137 | }catch (Exception e){ | 137 | }catch (Exception e){ |
1 | +package com.example.demo.handle.nms; | ||
2 | + | ||
3 | +import com.example.demo.model.NMS_FZE_FOH; | ||
4 | +import com.example.demo.service.NMS_FZE_FOH_Service; | ||
5 | +import com.example.demo.util.Helper; | ||
6 | +import com.example.demo.util.IO.FileTool; | ||
7 | +import com.example.demo.util.XML.XMLXPath; | ||
8 | +import org.dom4j.Document; | ||
9 | +import org.springframework.beans.factory.annotation.Autowired; | ||
10 | +import org.springframework.stereotype.Component; | ||
11 | + | ||
12 | +import javax.annotation.PostConstruct; | ||
13 | +import java.time.ZonedDateTime; | ||
14 | +import java.util.Date; | ||
15 | + | ||
16 | +@Component | ||
17 | +public class FZE_FOH_Handle { | ||
18 | + @Autowired | ||
19 | + protected NMS_FZE_FOH_Service fzeService; | ||
20 | + private static FZE_FOH_Handle fze_foh_handle; | ||
21 | + private final static String stype = "FZE_FOH"; | ||
22 | + | ||
23 | + | ||
24 | + public final static String SNDR = "//MSG/META/SNDR"; | ||
25 | + | ||
26 | + public final static String RCVR = "//MSG/META/RCVR"; | ||
27 | + | ||
28 | + public final static String DDTM = "//MSG/META/DDTM"; | ||
29 | + | ||
30 | + public final static String TYPE = "//MSG/META/TYPE"; | ||
31 | + | ||
32 | + public final static String STYP = "//MSG/META/STYP"; | ||
33 | + | ||
34 | + public final static String SEQN = "//MSG/META/SEQN"; | ||
35 | + | ||
36 | + public final static String TID = "//MSG/ConsignmentStatus/MasterConsignment/TransportContractDocument/ID"; | ||
37 | + | ||
38 | + public final static String TName = "//MSG/ConsignmentStatus/MasterConsignment/TransportContractDocument/Name"; | ||
39 | + | ||
40 | + public final static String TTypeCode = "//MSG/ConsignmentStatus/MasterConsignment/TransportContractDocument/TypeCode"; | ||
41 | + | ||
42 | + public final static String OID = "//MSG/ConsignmentStatus/MasterConsignment/OriginLocation/ID"; | ||
43 | + | ||
44 | + public final static String OName = "//MSG/ConsignmentStatus/MasterConsignment/OriginLocation/Name"; | ||
45 | + | ||
46 | + public final static String FID = "//MSG/ConsignmentStatus/MasterConsignment/FinalDestinationLocation/ID"; | ||
47 | + | ||
48 | + public final static String FName = "//MSG/ConsignmentStatus/MasterConsignment/FinalDestinationLocation/Name"; | ||
49 | + | ||
50 | + public final static String GrossWeightMeasure = "//MSG/ConsignmentStatus/MasterConsignment/ReportedStatus/AssociatedStatusConsignment/GrossWeightMeasure"; | ||
51 | + | ||
52 | + public final static String GrossWeightMeasureUc = "//MSG/ConsignmentStatus/MasterConsignment/ReportedStatus/AssociatedStatusConsignment/GrossWeightMeasure/@unitCode"; | ||
53 | + | ||
54 | + public final static String TotalGrossWeightMeasureUc = "//MSG/ConsignmentStatus/MasterConsignment/ReportedStatus/AssociatedStatusConsignment/IncludedCustomsNote/IncludedHouseConsignment/TotalGrossWeightMeasure/@unitCode"; | ||
55 | + | ||
56 | + public final static String TotalGrossWeightMeasure = "//MSG/ConsignmentStatus/MasterConsignment/ReportedStatus/AssociatedStatusConsignment/IncludedCustomsNote/IncludedHouseConsignment/TotalGrossWeightMeasure"; | ||
57 | + | ||
58 | + public final static String PieceQuantity = "//MSG/ConsignmentStatus/MasterConsignment/ReportedStatus/AssociatedStatusConsignment/PieceQuantity"; | ||
59 | + | ||
60 | + public final static String SLTM_IDxml = "//MSG/ConsignmentStatus/MasterConsignment/ReportedStatus/AssociatedStatusConsignment/SpecifiedLogisticsTransportMovement/ID"; | ||
61 | + | ||
62 | + public final static String OccurrenceDateTimexml = "//MSG/ConsignmentStatus/MasterConsignment/ReportedStatus/AssociatedStatusConsignment/SpecifiedLogisticsTransportMovement/DepartureEvent/DepartureOccurrenceDateTime"; | ||
63 | + | ||
64 | + public final static String IMCT_TypeCodexml = "//MSG/ConsignmentStatus/MasterConsignment/ReportedStatus/AssociatedStatusConsignment/IncludedMasterConsignmentItem/TypeCode"; | ||
65 | + | ||
66 | + | ||
67 | + public final static String TCDIDxml = "//MSG/ConsignmentStatus/MasterConsignment/ReportedStatus/AssociatedStatusConsignment/IncludedCustomsNote/IncludedHouseConsignment/TransportContractDocument/ID"; | ||
68 | + | ||
69 | + public final static String SLTM_DepartureOccurrenceDateTimexml = "//MSG/ConsignmentStatus/MasterConsignment/ReportedStatus/EventTime/OccurrenceDateTime"; | ||
70 | + | ||
71 | + public final static String Location = "//MSG/ConsignmentStatus/MasterConsignment/ReportedStatus/AssociatedStatusConsignment/IncludedCustomsNote/Content"; | ||
72 | + | ||
73 | + | ||
74 | + @PostConstruct | ||
75 | + public void init(){ | ||
76 | + fze_foh_handle = this; | ||
77 | + fze_foh_handle.fzeService = this.fzeService; | ||
78 | + } | ||
79 | + | ||
80 | + public void handle(Document document) throws Exception{ | ||
81 | + try{ | ||
82 | + | ||
83 | + | ||
84 | + String autoId = Helper.getUUID(); | ||
85 | + | ||
86 | + NMS_FZE_FOH fzeFoh = new NMS_FZE_FOH(); | ||
87 | + | ||
88 | + fzeFoh.setAutoid(autoId); | ||
89 | + fzeFoh.setoId(XMLXPath.getSingleValueByPath(document,OID)); | ||
90 | + fzeFoh.setoName(XMLXPath.getSingleValueByPath(document,OName)); | ||
91 | + fzeFoh.setFdId(XMLXPath.getSingleValueByPath(document,FID)); | ||
92 | + fzeFoh.setFdName(XMLXPath.getSingleValueByPath(document,FName)); | ||
93 | + | ||
94 | + String waybillMasterNo = XMLXPath.getSingleValueByPath(document,TID); | ||
95 | + fzeFoh.setWaybillnomaster(waybillMasterNo); | ||
96 | + | ||
97 | + if ("406-92658204".equals(waybillMasterNo)){//TXD1542736608590 消息ID | ||
98 | + System.out.print(waybillMasterNo); | ||
99 | + } | ||
100 | + | ||
101 | + String waybillSecondNo = XMLXPath.getSingleValueByPath(document,TCDIDxml); | ||
102 | + fzeFoh.setWaybillnosecondary(waybillSecondNo); | ||
103 | + | ||
104 | + if ("WE6718TW8CK".equals(waybillSecondNo)){ | ||
105 | + System.out.print(waybillSecondNo); | ||
106 | + } | ||
107 | + | ||
108 | + fzeFoh.setTcdName(XMLXPath.getSingleValueByPath(document,TName)); | ||
109 | + fzeFoh.setTcdTypecode(XMLXPath.getSingleValueByPath(document,TTypeCode)); | ||
110 | + | ||
111 | + | ||
112 | + String flight = XMLXPath.getSingleValueByPath(document,SLTM_IDxml); | ||
113 | + String flightNo = ""; | ||
114 | + String carrier = ""; | ||
115 | + | ||
116 | + if(flight!=null && !flight.isEmpty()){ | ||
117 | + String carrier_no = flight.substring(0, 2); | ||
118 | + String flight_no = flight.substring(2); | ||
119 | + fzeFoh.setFlightno(flight_no); | ||
120 | + fzeFoh.setCarrier(carrier_no); | ||
121 | + } | ||
122 | + | ||
123 | + String flightDateStr = XMLXPath.getSingleValueByPath(document,OccurrenceDateTimexml); | ||
124 | + ZonedDateTime depZoneTime = ZonedDateTime.parse(flightDateStr); | ||
125 | + Date flightDate = Date.from(depZoneTime.toInstant()); //这个是入库航班日期格式 | ||
126 | + fzeFoh.setFlightdate(flightDate); | ||
127 | + | ||
128 | + fzeFoh.setArrivedtotalpiece(XMLXPath.getSingleValueByPath(document,PieceQuantity)); | ||
129 | + fzeFoh.setTotalpiecequantity(XMLXPath.getSingleValueByPath(document,PieceQuantity)); | ||
130 | + fzeFoh.setArrivedtotalweight(XMLXPath.getSingleValueByPath(document,GrossWeightMeasure)); | ||
131 | + fzeFoh.setGrossweightmeasureuc(XMLXPath.getSingleValueByPath(document,GrossWeightMeasureUc)); | ||
132 | + fzeFoh.setTotalgrossweightmeasure(XMLXPath.getSingleValueByPath(document,TotalGrossWeightMeasure)); | ||
133 | + fzeFoh.setTotalgrossweightmeasureuc(XMLXPath.getSingleValueByPath(document,TotalGrossWeightMeasureUc)); | ||
134 | + fzeFoh.setChargeableweightmeasure(XMLXPath.getSingleValueByPath(document,GrossWeightMeasure)); | ||
135 | + fzeFoh.setChargeableweightmeasureuc(""); | ||
136 | + | ||
137 | + | ||
138 | + String OccurrenceDateTime = XMLXPath.getSingleValueByPath(document,SLTM_DepartureOccurrenceDateTimexml); | ||
139 | + ZonedDateTime arrZoneTime = ZonedDateTime.parse(OccurrenceDateTime); | ||
140 | + Date arriv_time = Date.from(arrZoneTime.toInstant()); //这个是入库航班日期格式 | ||
141 | + fzeFoh.setArriveddate(arriv_time); | ||
142 | + | ||
143 | + String customCode = "4604"; | ||
144 | + String location = XMLXPath.getSingleValueByPath(document,Location); | ||
145 | + if (location.contains("ZBQ")){ | ||
146 | + customCode = "4620"; | ||
147 | + } | ||
148 | + fzeFoh.setCustomscode(customCode); | ||
149 | + | ||
150 | + fzeFoh.setProductname(XMLXPath.getSingleValueByPath(document,IMCT_TypeCodexml)); | ||
151 | + fzeFoh.setCreatedate(new Date()); | ||
152 | + fzeFoh.setArrivedmasterid(""); | ||
153 | + fzeFoh.setTransportsplitdescription(""); | ||
154 | + fzeFoh.setStatus("01"); | ||
155 | + fzeFoh.setReceiption(""); | ||
156 | + | ||
157 | + int i = fze_foh_handle.fzeService.insert(fzeFoh); | ||
158 | + | ||
159 | + FileTool.writeWaybill(stype,document.asXML(),waybillMasterNo+"_"+waybillSecondNo); | ||
160 | + }catch (Exception e){ | ||
161 | + e.printStackTrace(); | ||
162 | + FileTool.writeFile(stype,e.toString()+"\n"+document.asXML(),false); | ||
163 | + } | ||
164 | + | ||
165 | + } | ||
166 | + | ||
167 | + | ||
168 | + | ||
169 | +} |
1 | +package com.example.demo.mapper; | ||
2 | + | ||
3 | +import com.example.demo.model.NMS_FZE_FOH; | ||
4 | + | ||
5 | +import java.util.List; | ||
6 | + | ||
7 | +public interface NMS_FZE_FOHMapper { | ||
8 | + int insert(NMS_FZE_FOH record); | ||
9 | + | ||
10 | + int insertSelective(NMS_FZE_FOH record); | ||
11 | + | ||
12 | + List<NMS_FZE_FOH> selecSecondWaybillList(NMS_FZE_FOH record); | ||
13 | + | ||
14 | + int updateByPrimaryKey(NMS_FZE_FOH record); | ||
15 | +} |
1 | +package com.example.demo.model; | ||
2 | + | ||
3 | +import java.util.Date; | ||
4 | + | ||
5 | +public class NMS_FZE_FOH { | ||
6 | + private String autoid; | ||
7 | + | ||
8 | + private String waybillnomaster; | ||
9 | + | ||
10 | + private String tcdName; | ||
11 | + | ||
12 | + private String tcdTypecode; | ||
13 | + | ||
14 | + private String waybillnosecondary; | ||
15 | + | ||
16 | + private String carrier; | ||
17 | + | ||
18 | + private String oId; | ||
19 | + | ||
20 | + private String oName; | ||
21 | + | ||
22 | + private String fdId; | ||
23 | + | ||
24 | + private String fdName; | ||
25 | + | ||
26 | + private String flightno; | ||
27 | + | ||
28 | + private Date flightdate; | ||
29 | + | ||
30 | + private String arrivedtotalpiece; | ||
31 | + | ||
32 | + private String totalpiecequantity; | ||
33 | + | ||
34 | + private String arrivedtotalweight; | ||
35 | + | ||
36 | + private String grossweightmeasureuc; | ||
37 | + | ||
38 | + private String totalgrossweightmeasure; | ||
39 | + | ||
40 | + private String totalgrossweightmeasureuc; | ||
41 | + | ||
42 | + private String chargeableweightmeasure; | ||
43 | + | ||
44 | + private String chargeableweightmeasureuc; | ||
45 | + | ||
46 | + private Date arriveddate; | ||
47 | + | ||
48 | + private String customscode; | ||
49 | + | ||
50 | + private String productname; | ||
51 | + | ||
52 | + private Date createdate; | ||
53 | + | ||
54 | + private String arrivedmasterid; | ||
55 | + | ||
56 | + private String transportsplitdescription; | ||
57 | + | ||
58 | + private String receiption; | ||
59 | + | ||
60 | + private String status; | ||
61 | + | ||
62 | + public String getAutoid() { | ||
63 | + return autoid; | ||
64 | + } | ||
65 | + | ||
66 | + public void setAutoid(String autoid) { | ||
67 | + this.autoid = autoid == null ? null : autoid.trim(); | ||
68 | + } | ||
69 | + | ||
70 | + public String getWaybillnomaster() { | ||
71 | + return waybillnomaster; | ||
72 | + } | ||
73 | + | ||
74 | + public void setWaybillnomaster(String waybillnomaster) { | ||
75 | + this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim(); | ||
76 | + } | ||
77 | + | ||
78 | + public String getTcdName() { | ||
79 | + return tcdName; | ||
80 | + } | ||
81 | + | ||
82 | + public void setTcdName(String tcdName) { | ||
83 | + this.tcdName = tcdName == null ? null : tcdName.trim(); | ||
84 | + } | ||
85 | + | ||
86 | + public String getTcdTypecode() { | ||
87 | + return tcdTypecode; | ||
88 | + } | ||
89 | + | ||
90 | + public void setTcdTypecode(String tcdTypecode) { | ||
91 | + this.tcdTypecode = tcdTypecode == null ? null : tcdTypecode.trim(); | ||
92 | + } | ||
93 | + | ||
94 | + public String getWaybillnosecondary() { | ||
95 | + return waybillnosecondary; | ||
96 | + } | ||
97 | + | ||
98 | + public void setWaybillnosecondary(String waybillnosecondary) { | ||
99 | + this.waybillnosecondary = waybillnosecondary == null ? null : waybillnosecondary.trim(); | ||
100 | + } | ||
101 | + | ||
102 | + public String getCarrier() { | ||
103 | + return carrier; | ||
104 | + } | ||
105 | + | ||
106 | + public void setCarrier(String carrier) { | ||
107 | + this.carrier = carrier == null ? null : carrier.trim(); | ||
108 | + } | ||
109 | + | ||
110 | + public String getoId() { | ||
111 | + return oId; | ||
112 | + } | ||
113 | + | ||
114 | + public void setoId(String oId) { | ||
115 | + this.oId = oId == null ? null : oId.trim(); | ||
116 | + } | ||
117 | + | ||
118 | + public String getoName() { | ||
119 | + return oName; | ||
120 | + } | ||
121 | + | ||
122 | + public void setoName(String oName) { | ||
123 | + this.oName = oName == null ? null : oName.trim(); | ||
124 | + } | ||
125 | + | ||
126 | + public String getFdId() { | ||
127 | + return fdId; | ||
128 | + } | ||
129 | + | ||
130 | + public void setFdId(String fdId) { | ||
131 | + this.fdId = fdId == null ? null : fdId.trim(); | ||
132 | + } | ||
133 | + | ||
134 | + public String getFdName() { | ||
135 | + return fdName; | ||
136 | + } | ||
137 | + | ||
138 | + public void setFdName(String fdName) { | ||
139 | + this.fdName = fdName == null ? null : fdName.trim(); | ||
140 | + } | ||
141 | + | ||
142 | + public String getFlightno() { | ||
143 | + return flightno; | ||
144 | + } | ||
145 | + | ||
146 | + public void setFlightno(String flightno) { | ||
147 | + this.flightno = flightno == null ? null : flightno.trim(); | ||
148 | + } | ||
149 | + | ||
150 | + public Date getFlightdate() { | ||
151 | + return flightdate; | ||
152 | + } | ||
153 | + | ||
154 | + public void setFlightdate(Date flightdate) { | ||
155 | + this.flightdate = flightdate; | ||
156 | + } | ||
157 | + | ||
158 | + public String getArrivedtotalpiece() { | ||
159 | + return arrivedtotalpiece; | ||
160 | + } | ||
161 | + | ||
162 | + public void setArrivedtotalpiece(String arrivedtotalpiece) { | ||
163 | + this.arrivedtotalpiece = arrivedtotalpiece == null ? null : arrivedtotalpiece.trim(); | ||
164 | + } | ||
165 | + | ||
166 | + public String getTotalpiecequantity() { | ||
167 | + return totalpiecequantity; | ||
168 | + } | ||
169 | + | ||
170 | + public void setTotalpiecequantity(String totalpiecequantity) { | ||
171 | + this.totalpiecequantity = totalpiecequantity == null ? null : totalpiecequantity.trim(); | ||
172 | + } | ||
173 | + | ||
174 | + public String getArrivedtotalweight() { | ||
175 | + return arrivedtotalweight; | ||
176 | + } | ||
177 | + | ||
178 | + public void setArrivedtotalweight(String arrivedtotalweight) { | ||
179 | + this.arrivedtotalweight = arrivedtotalweight == null ? null : arrivedtotalweight.trim(); | ||
180 | + } | ||
181 | + | ||
182 | + public String getGrossweightmeasureuc() { | ||
183 | + return grossweightmeasureuc; | ||
184 | + } | ||
185 | + | ||
186 | + public void setGrossweightmeasureuc(String grossweightmeasureuc) { | ||
187 | + this.grossweightmeasureuc = grossweightmeasureuc == null ? null : grossweightmeasureuc.trim(); | ||
188 | + } | ||
189 | + | ||
190 | + public String getTotalgrossweightmeasure() { | ||
191 | + return totalgrossweightmeasure; | ||
192 | + } | ||
193 | + | ||
194 | + public void setTotalgrossweightmeasure(String totalgrossweightmeasure) { | ||
195 | + this.totalgrossweightmeasure = totalgrossweightmeasure == null ? null : totalgrossweightmeasure.trim(); | ||
196 | + } | ||
197 | + | ||
198 | + public String getTotalgrossweightmeasureuc() { | ||
199 | + return totalgrossweightmeasureuc; | ||
200 | + } | ||
201 | + | ||
202 | + public void setTotalgrossweightmeasureuc(String totalgrossweightmeasureuc) { | ||
203 | + this.totalgrossweightmeasureuc = totalgrossweightmeasureuc == null ? null : totalgrossweightmeasureuc.trim(); | ||
204 | + } | ||
205 | + | ||
206 | + public String getChargeableweightmeasure() { | ||
207 | + return chargeableweightmeasure; | ||
208 | + } | ||
209 | + | ||
210 | + public void setChargeableweightmeasure(String chargeableweightmeasure) { | ||
211 | + this.chargeableweightmeasure = chargeableweightmeasure == null ? null : chargeableweightmeasure.trim(); | ||
212 | + } | ||
213 | + | ||
214 | + public String getChargeableweightmeasureuc() { | ||
215 | + return chargeableweightmeasureuc; | ||
216 | + } | ||
217 | + | ||
218 | + public void setChargeableweightmeasureuc(String chargeableweightmeasureuc) { | ||
219 | + this.chargeableweightmeasureuc = chargeableweightmeasureuc == null ? null : chargeableweightmeasureuc.trim(); | ||
220 | + } | ||
221 | + | ||
222 | + public Date getArriveddate() { | ||
223 | + return arriveddate; | ||
224 | + } | ||
225 | + | ||
226 | + public void setArriveddate(Date arriveddate) { | ||
227 | + this.arriveddate = arriveddate; | ||
228 | + } | ||
229 | + | ||
230 | + public String getCustomscode() { | ||
231 | + return customscode; | ||
232 | + } | ||
233 | + | ||
234 | + public void setCustomscode(String customscode) { | ||
235 | + this.customscode = customscode == null ? null : customscode.trim(); | ||
236 | + } | ||
237 | + | ||
238 | + public String getProductname() { | ||
239 | + return productname; | ||
240 | + } | ||
241 | + | ||
242 | + public void setProductname(String productname) { | ||
243 | + this.productname = productname == null ? null : productname.trim(); | ||
244 | + } | ||
245 | + | ||
246 | + public Date getCreatedate() { | ||
247 | + return createdate; | ||
248 | + } | ||
249 | + | ||
250 | + public void setCreatedate(Date createdate) { | ||
251 | + this.createdate = createdate; | ||
252 | + } | ||
253 | + | ||
254 | + public String getArrivedmasterid() { | ||
255 | + return arrivedmasterid; | ||
256 | + } | ||
257 | + | ||
258 | + public void setArrivedmasterid(String arrivedmasterid) { | ||
259 | + this.arrivedmasterid = arrivedmasterid == null ? null : arrivedmasterid.trim(); | ||
260 | + } | ||
261 | + | ||
262 | + public String getTransportsplitdescription() { | ||
263 | + return transportsplitdescription; | ||
264 | + } | ||
265 | + | ||
266 | + public void setTransportsplitdescription(String transportsplitdescription) { | ||
267 | + this.transportsplitdescription = transportsplitdescription == null ? null : transportsplitdescription.trim(); | ||
268 | + } | ||
269 | + | ||
270 | + public String getReceiption() { | ||
271 | + return receiption; | ||
272 | + } | ||
273 | + | ||
274 | + public void setReceiption(String receiption) { | ||
275 | + this.receiption = receiption == null ? null : receiption.trim(); | ||
276 | + } | ||
277 | + | ||
278 | + public String getStatus() { | ||
279 | + return status; | ||
280 | + } | ||
281 | + | ||
282 | + public void setStatus(String status) { | ||
283 | + this.status = status == null ? null : status.trim(); | ||
284 | + } | ||
285 | +} |
1 | +package com.example.demo.service; | ||
2 | + | ||
3 | +import com.example.demo.model.NMS_FZE_FOH; | ||
4 | + | ||
5 | +import java.util.List; | ||
6 | + | ||
7 | +public interface NMS_FZE_FOH_Service { | ||
8 | + | ||
9 | + int insert(NMS_FZE_FOH record); | ||
10 | + | ||
11 | + int insertSelective(NMS_FZE_FOH record); | ||
12 | + | ||
13 | + List<NMS_FZE_FOH> selecSecondWaybillList(NMS_FZE_FOH record); | ||
14 | + | ||
15 | + int updateByPrimaryKey(NMS_FZE_FOH record); | ||
16 | +} |
1 | +package com.example.demo.service.imp; | ||
2 | + | ||
3 | +import com.example.demo.mapper.NMS_FZE_FOHMapper; | ||
4 | +import com.example.demo.model.NMS_FZE_FOH; | ||
5 | +import com.example.demo.service.NMS_FZE_FOH_Service; | ||
6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
7 | +import org.springframework.stereotype.Service; | ||
8 | + | ||
9 | +import java.util.List; | ||
10 | + | ||
11 | +@Service("fzefohservice") | ||
12 | +public class NMS_FZE_FOH_ServiceImp implements NMS_FZE_FOH_Service{ | ||
13 | + | ||
14 | + @Autowired | ||
15 | + NMS_FZE_FOHMapper fzeFohMapper; | ||
16 | + | ||
17 | + public int insert(NMS_FZE_FOH record){ | ||
18 | + int i=0; | ||
19 | + List<NMS_FZE_FOH> masterList = selecSecondWaybillList(record); | ||
20 | + if(masterList!=null && masterList.size()>0){ | ||
21 | + for (NMS_FZE_FOH master:masterList) { | ||
22 | + updateByPrimaryKey(master); | ||
23 | + } | ||
24 | + }else { | ||
25 | + | ||
26 | + i= fzeFohMapper.insert(record); | ||
27 | + } | ||
28 | + return i; | ||
29 | + } | ||
30 | + | ||
31 | + public int insertSelective(NMS_FZE_FOH record){ | ||
32 | + return fzeFohMapper.insertSelective(record); | ||
33 | + } | ||
34 | + | ||
35 | + public List<NMS_FZE_FOH> selecSecondWaybillList(NMS_FZE_FOH record){ | ||
36 | + return fzeFohMapper.selecSecondWaybillList(record); | ||
37 | + } | ||
38 | + | ||
39 | + | ||
40 | + public int updateByPrimaryKey(NMS_FZE_FOH record){ | ||
41 | + return fzeFohMapper.updateByPrimaryKey(record); | ||
42 | + } | ||
43 | +} |
@@ -42,6 +42,6 @@ | @@ -42,6 +42,6 @@ | ||
42 | <property name="enableSubPackages" value="true"/> | 42 | <property name="enableSubPackages" value="true"/> |
43 | </javaClientGenerator> | 43 | </javaClientGenerator> |
44 | <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名--> | 44 | <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名--> |
45 | - <table tableName="ARRIVEDMASTER" domainObjectName="NMS_FSU_FOH" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> | 45 | + <table tableName="ARRIVEDSECONDARY" domainObjectName="NMS_FZE_FOH" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> |
46 | </context> | 46 | </context> |
47 | </generatorConfiguration> | 47 | </generatorConfiguration> |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | ||
3 | +<mapper namespace="com.example.demo.mapper.NMS_FZE_FOHMapper" > | ||
4 | + <resultMap id="BaseResultMap" type="com.example.demo.model.NMS_FZE_FOH" > | ||
5 | + <result column="AUTOID" property="autoid" jdbcType="VARCHAR" /> | ||
6 | + <result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR" /> | ||
7 | + <result column="TCD_NAME" property="tcdName" jdbcType="VARCHAR" /> | ||
8 | + <result column="TCD_TYPECODE" property="tcdTypecode" jdbcType="VARCHAR" /> | ||
9 | + <result column="WAYBILLNOSECONDARY" property="waybillnosecondary" jdbcType="VARCHAR" /> | ||
10 | + <result column="CARRIER" property="carrier" jdbcType="VARCHAR" /> | ||
11 | + <result column="O_ID" property="oId" jdbcType="VARCHAR" /> | ||
12 | + <result column="O_NAME" property="oName" jdbcType="VARCHAR" /> | ||
13 | + <result column="FD_ID" property="fdId" jdbcType="VARCHAR" /> | ||
14 | + <result column="FD_NAME" property="fdName" jdbcType="VARCHAR" /> | ||
15 | + <result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR" /> | ||
16 | + <result column="FLIGHTDATE" property="flightdate" jdbcType="TIMESTAMP" /> | ||
17 | + <result column="ARRIVEDTOTALPIECE" property="arrivedtotalpiece" jdbcType="VARCHAR" /> | ||
18 | + <result column="TOTALPIECEQUANTITY" property="totalpiecequantity" jdbcType="VARCHAR" /> | ||
19 | + <result column="ARRIVEDTOTALWEIGHT" property="arrivedtotalweight" jdbcType="VARCHAR" /> | ||
20 | + <result column="GROSSWEIGHTMEASUREUC" property="grossweightmeasureuc" jdbcType="VARCHAR" /> | ||
21 | + <result column="TOTALGROSSWEIGHTMEASURE" property="totalgrossweightmeasure" jdbcType="VARCHAR" /> | ||
22 | + <result column="TOTALGROSSWEIGHTMEASUREUC" property="totalgrossweightmeasureuc" jdbcType="VARCHAR" /> | ||
23 | + <result column="CHARGEABLEWEIGHTMEASURE" property="chargeableweightmeasure" jdbcType="VARCHAR" /> | ||
24 | + <result column="CHARGEABLEWEIGHTMEASUREUC" property="chargeableweightmeasureuc" jdbcType="VARCHAR" /> | ||
25 | + <result column="ARRIVEDDATE" property="arriveddate" jdbcType="TIMESTAMP" /> | ||
26 | + <result column="CUSTOMSCODE" property="customscode" jdbcType="VARCHAR" /> | ||
27 | + <result column="PRODUCTNAME" property="productname" jdbcType="VARCHAR" /> | ||
28 | + <result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP" /> | ||
29 | + <result column="ARRIVEDMASTERID" property="arrivedmasterid" jdbcType="VARCHAR" /> | ||
30 | + <result column="TRANSPORTSPLITDESCRIPTION" property="transportsplitdescription" jdbcType="VARCHAR" /> | ||
31 | + <result column="RECEIPTION" property="receiption" jdbcType="VARCHAR" /> | ||
32 | + <result column="STATUS" property="status" jdbcType="VARCHAR" /> | ||
33 | + </resultMap> | ||
34 | + <insert id="insert" parameterType="com.example.demo.model.NMS_FZE_FOH" > | ||
35 | + insert into ARRIVEDSECONDARY (AUTOID, WAYBILLNOMASTER, TCD_NAME, | ||
36 | + TCD_TYPECODE, WAYBILLNOSECONDARY, CARRIER, | ||
37 | + O_ID, O_NAME, FD_ID, FD_NAME, | ||
38 | + FLIGHTNO, FLIGHTDATE, ARRIVEDTOTALPIECE, | ||
39 | + TOTALPIECEQUANTITY, ARRIVEDTOTALWEIGHT, | ||
40 | + GROSSWEIGHTMEASUREUC, TOTALGROSSWEIGHTMEASURE, | ||
41 | + TOTALGROSSWEIGHTMEASUREUC, CHARGEABLEWEIGHTMEASURE, | ||
42 | + CHARGEABLEWEIGHTMEASUREUC, ARRIVEDDATE, | ||
43 | + CUSTOMSCODE, PRODUCTNAME, CREATEDATE, | ||
44 | + ARRIVEDMASTERID, TRANSPORTSPLITDESCRIPTION, | ||
45 | + RECEIPTION, STATUS) | ||
46 | + values (#{autoid,jdbcType=VARCHAR}, #{waybillnomaster,jdbcType=VARCHAR}, #{tcdName,jdbcType=VARCHAR}, | ||
47 | + #{tcdTypecode,jdbcType=VARCHAR}, #{waybillnosecondary,jdbcType=VARCHAR}, #{carrier,jdbcType=VARCHAR}, | ||
48 | + #{oId,jdbcType=VARCHAR}, #{oName,jdbcType=VARCHAR}, #{fdId,jdbcType=VARCHAR}, #{fdName,jdbcType=VARCHAR}, | ||
49 | + #{flightno,jdbcType=VARCHAR}, #{flightdate,jdbcType=TIMESTAMP}, #{arrivedtotalpiece,jdbcType=VARCHAR}, | ||
50 | + #{totalpiecequantity,jdbcType=VARCHAR}, #{arrivedtotalweight,jdbcType=VARCHAR}, | ||
51 | + #{grossweightmeasureuc,jdbcType=VARCHAR}, #{totalgrossweightmeasure,jdbcType=VARCHAR}, | ||
52 | + #{totalgrossweightmeasureuc,jdbcType=VARCHAR}, #{chargeableweightmeasure,jdbcType=VARCHAR}, | ||
53 | + #{chargeableweightmeasureuc,jdbcType=VARCHAR}, #{arriveddate,jdbcType=TIMESTAMP}, | ||
54 | + #{customscode,jdbcType=VARCHAR}, #{productname,jdbcType=VARCHAR}, #{createdate,jdbcType=TIMESTAMP}, | ||
55 | + #{arrivedmasterid,jdbcType=VARCHAR}, #{transportsplitdescription,jdbcType=VARCHAR}, | ||
56 | + #{receiption,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}) | ||
57 | + </insert> | ||
58 | + <insert id="insertSelective" parameterType="com.example.demo.model.NMS_FZE_FOH" > | ||
59 | + insert into ARRIVEDSECONDARY | ||
60 | + <trim prefix="(" suffix=")" suffixOverrides="," > | ||
61 | + <if test="autoid != null" > | ||
62 | + AUTOID, | ||
63 | + </if> | ||
64 | + <if test="waybillnomaster != null" > | ||
65 | + WAYBILLNOMASTER, | ||
66 | + </if> | ||
67 | + <if test="tcdName != null" > | ||
68 | + TCD_NAME, | ||
69 | + </if> | ||
70 | + <if test="tcdTypecode != null" > | ||
71 | + TCD_TYPECODE, | ||
72 | + </if> | ||
73 | + <if test="waybillnosecondary != null" > | ||
74 | + WAYBILLNOSECONDARY, | ||
75 | + </if> | ||
76 | + <if test="carrier != null" > | ||
77 | + CARRIER, | ||
78 | + </if> | ||
79 | + <if test="oId != null" > | ||
80 | + O_ID, | ||
81 | + </if> | ||
82 | + <if test="oName != null" > | ||
83 | + O_NAME, | ||
84 | + </if> | ||
85 | + <if test="fdId != null" > | ||
86 | + FD_ID, | ||
87 | + </if> | ||
88 | + <if test="fdName != null" > | ||
89 | + FD_NAME, | ||
90 | + </if> | ||
91 | + <if test="flightno != null" > | ||
92 | + FLIGHTNO, | ||
93 | + </if> | ||
94 | + <if test="flightdate != null" > | ||
95 | + FLIGHTDATE, | ||
96 | + </if> | ||
97 | + <if test="arrivedtotalpiece != null" > | ||
98 | + ARRIVEDTOTALPIECE, | ||
99 | + </if> | ||
100 | + <if test="totalpiecequantity != null" > | ||
101 | + TOTALPIECEQUANTITY, | ||
102 | + </if> | ||
103 | + <if test="arrivedtotalweight != null" > | ||
104 | + ARRIVEDTOTALWEIGHT, | ||
105 | + </if> | ||
106 | + <if test="grossweightmeasureuc != null" > | ||
107 | + GROSSWEIGHTMEASUREUC, | ||
108 | + </if> | ||
109 | + <if test="totalgrossweightmeasure != null" > | ||
110 | + TOTALGROSSWEIGHTMEASURE, | ||
111 | + </if> | ||
112 | + <if test="totalgrossweightmeasureuc != null" > | ||
113 | + TOTALGROSSWEIGHTMEASUREUC, | ||
114 | + </if> | ||
115 | + <if test="chargeableweightmeasure != null" > | ||
116 | + CHARGEABLEWEIGHTMEASURE, | ||
117 | + </if> | ||
118 | + <if test="chargeableweightmeasureuc != null" > | ||
119 | + CHARGEABLEWEIGHTMEASUREUC, | ||
120 | + </if> | ||
121 | + <if test="arriveddate != null" > | ||
122 | + ARRIVEDDATE, | ||
123 | + </if> | ||
124 | + <if test="customscode != null" > | ||
125 | + CUSTOMSCODE, | ||
126 | + </if> | ||
127 | + <if test="productname != null" > | ||
128 | + PRODUCTNAME, | ||
129 | + </if> | ||
130 | + <if test="createdate != null" > | ||
131 | + CREATEDATE, | ||
132 | + </if> | ||
133 | + <if test="arrivedmasterid != null" > | ||
134 | + ARRIVEDMASTERID, | ||
135 | + </if> | ||
136 | + <if test="transportsplitdescription != null" > | ||
137 | + TRANSPORTSPLITDESCRIPTION, | ||
138 | + </if> | ||
139 | + <if test="receiption != null" > | ||
140 | + RECEIPTION, | ||
141 | + </if> | ||
142 | + <if test="status != null" > | ||
143 | + STATUS, | ||
144 | + </if> | ||
145 | + </trim> | ||
146 | + <trim prefix="values (" suffix=")" suffixOverrides="," > | ||
147 | + <if test="autoid != null" > | ||
148 | + #{autoid,jdbcType=VARCHAR}, | ||
149 | + </if> | ||
150 | + <if test="waybillnomaster != null" > | ||
151 | + #{waybillnomaster,jdbcType=VARCHAR}, | ||
152 | + </if> | ||
153 | + <if test="tcdName != null" > | ||
154 | + #{tcdName,jdbcType=VARCHAR}, | ||
155 | + </if> | ||
156 | + <if test="tcdTypecode != null" > | ||
157 | + #{tcdTypecode,jdbcType=VARCHAR}, | ||
158 | + </if> | ||
159 | + <if test="waybillnosecondary != null" > | ||
160 | + #{waybillnosecondary,jdbcType=VARCHAR}, | ||
161 | + </if> | ||
162 | + <if test="carrier != null" > | ||
163 | + #{carrier,jdbcType=VARCHAR}, | ||
164 | + </if> | ||
165 | + <if test="oId != null" > | ||
166 | + #{oId,jdbcType=VARCHAR}, | ||
167 | + </if> | ||
168 | + <if test="oName != null" > | ||
169 | + #{oName,jdbcType=VARCHAR}, | ||
170 | + </if> | ||
171 | + <if test="fdId != null" > | ||
172 | + #{fdId,jdbcType=VARCHAR}, | ||
173 | + </if> | ||
174 | + <if test="fdName != null" > | ||
175 | + #{fdName,jdbcType=VARCHAR}, | ||
176 | + </if> | ||
177 | + <if test="flightno != null" > | ||
178 | + #{flightno,jdbcType=VARCHAR}, | ||
179 | + </if> | ||
180 | + <if test="flightdate != null" > | ||
181 | + #{flightdate,jdbcType=TIMESTAMP}, | ||
182 | + </if> | ||
183 | + <if test="arrivedtotalpiece != null" > | ||
184 | + #{arrivedtotalpiece,jdbcType=VARCHAR}, | ||
185 | + </if> | ||
186 | + <if test="totalpiecequantity != null" > | ||
187 | + #{totalpiecequantity,jdbcType=VARCHAR}, | ||
188 | + </if> | ||
189 | + <if test="arrivedtotalweight != null" > | ||
190 | + #{arrivedtotalweight,jdbcType=VARCHAR}, | ||
191 | + </if> | ||
192 | + <if test="grossweightmeasureuc != null" > | ||
193 | + #{grossweightmeasureuc,jdbcType=VARCHAR}, | ||
194 | + </if> | ||
195 | + <if test="totalgrossweightmeasure != null" > | ||
196 | + #{totalgrossweightmeasure,jdbcType=VARCHAR}, | ||
197 | + </if> | ||
198 | + <if test="totalgrossweightmeasureuc != null" > | ||
199 | + #{totalgrossweightmeasureuc,jdbcType=VARCHAR}, | ||
200 | + </if> | ||
201 | + <if test="chargeableweightmeasure != null" > | ||
202 | + #{chargeableweightmeasure,jdbcType=VARCHAR}, | ||
203 | + </if> | ||
204 | + <if test="chargeableweightmeasureuc != null" > | ||
205 | + #{chargeableweightmeasureuc,jdbcType=VARCHAR}, | ||
206 | + </if> | ||
207 | + <if test="arriveddate != null" > | ||
208 | + #{arriveddate,jdbcType=TIMESTAMP}, | ||
209 | + </if> | ||
210 | + <if test="customscode != null" > | ||
211 | + #{customscode,jdbcType=VARCHAR}, | ||
212 | + </if> | ||
213 | + <if test="productname != null" > | ||
214 | + #{productname,jdbcType=VARCHAR}, | ||
215 | + </if> | ||
216 | + <if test="createdate != null" > | ||
217 | + #{createdate,jdbcType=TIMESTAMP}, | ||
218 | + </if> | ||
219 | + <if test="arrivedmasterid != null" > | ||
220 | + #{arrivedmasterid,jdbcType=VARCHAR}, | ||
221 | + </if> | ||
222 | + <if test="transportsplitdescription != null" > | ||
223 | + #{transportsplitdescription,jdbcType=VARCHAR}, | ||
224 | + </if> | ||
225 | + <if test="receiption != null" > | ||
226 | + #{receiption,jdbcType=VARCHAR}, | ||
227 | + </if> | ||
228 | + <if test="status != null" > | ||
229 | + #{status,jdbcType=VARCHAR}, | ||
230 | + </if> | ||
231 | + </trim> | ||
232 | + </insert> | ||
233 | + | ||
234 | + <select id="selecSecondWaybillList" resultMap="BaseResultMap" parameterType="com.example.demo.model.NMS_FZE_FOH" >-- resultType="com.example.demo.model.NMS_FSU_FOH" | ||
235 | + SELECT | ||
236 | + | ||
237 | + AUTOID,WAYBILLNOMASTER,WAYBILLNOSECONDARY | ||
238 | + | ||
239 | + FROM | ||
240 | + | ||
241 | + ARRIVEDSECONDARY | ||
242 | + | ||
243 | + WHERE WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR} | ||
244 | + | ||
245 | + AND WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR} | ||
246 | + </select> | ||
247 | + | ||
248 | + <update id="updateByPrimaryKey" parameterType="com.example.demo.model.NMS_FZE_FOH" > | ||
249 | + update ARRIVEDSECONDARY | ||
250 | + set | ||
251 | + WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}, | ||
252 | + TCD_NAME = #{tcdName,jdbcType=VARCHAR}, | ||
253 | + TCD_TYPECODE = #{tcdTypecode,jdbcType=VARCHAR}, | ||
254 | + WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR}, | ||
255 | + CARRIER = #{carrier,jdbcType=VARCHAR}, | ||
256 | + O_ID = #{oId,jdbcType=VARCHAR}, | ||
257 | + O_NAME = #{oName,jdbcType=VARCHAR}, | ||
258 | + FD_ID = #{fdId,jdbcType=VARCHAR}, | ||
259 | + FD_NAME = #{fdName,jdbcType=VARCHAR}, | ||
260 | + FLIGHTNO = #{flightno,jdbcType=VARCHAR}, | ||
261 | + FLIGHTDATE = #{flightdate,jdbcType=TIMESTAMP}, | ||
262 | + ARRIVEDTOTALPIECE = #{arrivedtotalpiece,jdbcType=VARCHAR}, | ||
263 | + TOTALPIECEQUANTITY = #{totalpiecequantity,jdbcType=VARCHAR}, | ||
264 | + ARRIVEDTOTALWEIGHT = #{arrivedtotalweight,jdbcType=VARCHAR}, | ||
265 | + GROSSWEIGHTMEASUREUC = #{grossweightmeasureuc,jdbcType=VARCHAR}, | ||
266 | + TOTALGROSSWEIGHTMEASURE = #{totalgrossweightmeasure,jdbcType=VARCHAR}, | ||
267 | + TOTALGROSSWEIGHTMEASUREUC = #{totalgrossweightmeasureuc,jdbcType=VARCHAR}, | ||
268 | + CHARGEABLEWEIGHTMEASURE = #{chargeableweightmeasure,jdbcType=VARCHAR}, | ||
269 | + CHARGEABLEWEIGHTMEASUREUC = #{chargeableweightmeasureuc,jdbcType=VARCHAR}, | ||
270 | + ARRIVEDDATE = #{arriveddate,jdbcType=TIMESTAMP}, | ||
271 | + CUSTOMSCODE = #{customscode,jdbcType=VARCHAR}, | ||
272 | + PRODUCTNAME = #{productname,jdbcType=VARCHAR}, | ||
273 | + CREATEDATE = #{customscode,jdbcType=TIMESTAMP}, | ||
274 | + ARRIVEDMASTERID = #{arrivedmasterid,jdbcType=VARCHAR}, | ||
275 | + TRANSPORTSPLITDESCRIPTION = #{transportsplitdescription,jdbcType=VARCHAR}, | ||
276 | + RECEIPTION = #{receiption,jdbcType=VARCHAR}, | ||
277 | + STATUS = #{status,jdbcType=VARCHAR} | ||
278 | + | ||
279 | + where AUTOID = #{autoid,jdbcType=VARCHAR} | ||
280 | + </update> | ||
281 | +</mapper> |
1 | package com.example.demo; | 1 | package com.example.demo; |
2 | 2 | ||
3 | +import com.example.demo.handle.nms.FZE_FOH_Handle; | ||
3 | import com.example.demo.model.T_TXD_FWB; | 4 | import com.example.demo.model.T_TXD_FWB; |
4 | import com.example.demo.model.T_TXD_FWBPARTY; | 5 | import com.example.demo.model.T_TXD_FWBPARTY; |
5 | import com.example.demo.service.T_TXD_FWB_Service; | 6 | import com.example.demo.service.T_TXD_FWB_Service; |
@@ -11,6 +12,7 @@ import org.dom4j.DocumentHelper; | @@ -11,6 +12,7 @@ import org.dom4j.DocumentHelper; | ||
11 | import org.slf4j.Logger; | 12 | import org.slf4j.Logger; |
12 | import org.slf4j.LoggerFactory; | 13 | import org.slf4j.LoggerFactory; |
13 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
15 | +import org.springframework.stereotype.Component; | ||
14 | 16 | ||
15 | import java.io.IOException; | 17 | import java.io.IOException; |
16 | import java.math.BigDecimal; | 18 | import java.math.BigDecimal; |
@@ -20,6 +22,7 @@ import java.util.Date; | @@ -20,6 +22,7 @@ import java.util.Date; | ||
20 | import java.util.List; | 22 | import java.util.List; |
21 | import java.util.Map; | 23 | import java.util.Map; |
22 | 24 | ||
25 | +@Component | ||
23 | public class FWBDemo { | 26 | public class FWBDemo { |
24 | protected static final Logger logger = LoggerFactory.getLogger(FWBDemo.class); | 27 | protected static final Logger logger = LoggerFactory.getLogger(FWBDemo.class); |
25 | 28 | ||
@@ -38,22 +41,17 @@ public class FWBDemo { | @@ -38,22 +41,17 @@ public class FWBDemo { | ||
38 | 41 | ||
39 | String xml = "<MSG>\n" + | 42 | String xml = "<MSG>\n" + |
40 | "\t<META>\n" + | 43 | "\t<META>\n" + |
41 | - "\t\t<SNDR>TXD</SNDR>\n" + | ||
42 | - "\t\t<DDTM>20181210085229</DDTM>\n" + | ||
43 | - "\t\t<TYPE>DFME</TYPE>\n" + | ||
44 | - "\t\t<STYP>UFOH</STYP>\n" + | ||
45 | - "\t\t<SEQN>75532140</SEQN>\n" + | 44 | + "\t\t<SNDR>CFPS</SNDR>\n" + |
45 | + "\t\t<RCVR/>\n" + | ||
46 | + "\t\t<DDTM>20170714162918</DDTM>\n" + | ||
47 | + "\t\t<TYPE>ICUSTOMS</TYPE>\n" + | ||
48 | + "\t\t<STYP>FZE_FOH</STYP>\n" + | ||
49 | + "\t\t<SEQN>51077716</SEQN>\n" + | ||
46 | "\t</META>\n" + | 50 | "\t</META>\n" + |
47 | "\t<ConsignmentStatus>\n" + | 51 | "\t<ConsignmentStatus>\n" + |
48 | "\t\t<MasterConsignment>\n" + | 52 | "\t\t<MasterConsignment>\n" + |
49 | - "\t\t\t<GrossWeightMeasure unitCode=\"KGM\">3877</GrossWeightMeasure>\n" + | ||
50 | - "\t\t\t<TotalGrossWeightMeasure unitCode=\"KGM\">3877</TotalGrossWeightMeasure>\n" + | ||
51 | - "\t\t\t<ChargeableWeightMeasure unitCode=\"KGM\">4308.69</ChargeableWeightMeasure>\n" + | ||
52 | - "\t\t\t<PieceQuantity>12</PieceQuantity>\n" + | ||
53 | - "\t\t\t<TotalPieceQuantity>12</TotalPieceQuantity>\n" + | ||
54 | - "\t\t\t<TransportSplitDescription>T</TransportSplitDescription>\n" + | ||
55 | "\t\t\t<TransportContractDocument>\n" + | 53 | "\t\t\t<TransportContractDocument>\n" + |
56 | - "\t\t\t\t<ID>172-32971562</ID>\n" + | 54 | + "\t\t\t\t<ID>851-09067704</ID>\n" + |
57 | "\t\t\t\t<Name>Air Waybill</Name>\n" + | 55 | "\t\t\t\t<Name>Air Waybill</Name>\n" + |
58 | "\t\t\t\t<TypeCode>741</TypeCode>\n" + | 56 | "\t\t\t\t<TypeCode>741</TypeCode>\n" + |
59 | "\t\t\t</TransportContractDocument>\n" + | 57 | "\t\t\t</TransportContractDocument>\n" + |
@@ -62,13 +60,13 @@ public class FWBDemo { | @@ -62,13 +60,13 @@ public class FWBDemo { | ||
62 | "\t\t\t\t<Name>ZHENGZHOU</Name>\n" + | 60 | "\t\t\t\t<Name>ZHENGZHOU</Name>\n" + |
63 | "\t\t\t</OriginLocation>\n" + | 61 | "\t\t\t</OriginLocation>\n" + |
64 | "\t\t\t<FinalDestinationLocation>\n" + | 62 | "\t\t\t<FinalDestinationLocation>\n" + |
65 | - "\t\t\t\t<ID>ORD</ID>\n" + | ||
66 | - "\t\t\t\t<Name>Chicago</Name>\n" + | 63 | + "\t\t\t\t<ID>DAC</ID>\n" + |
64 | + "\t\t\t\t<Name>DHAKA</Name>\n" + | ||
67 | "\t\t\t</FinalDestinationLocation>\n" + | 65 | "\t\t\t</FinalDestinationLocation>\n" + |
68 | "\t\t\t<ReportedStatus>\n" + | 66 | "\t\t\t<ReportedStatus>\n" + |
69 | "\t\t\t\t<ReasonCode>FOH</ReasonCode>\n" + | 67 | "\t\t\t\t<ReasonCode>FOH</ReasonCode>\n" + |
70 | "\t\t\t\t<EventTime>\n" + | 68 | "\t\t\t\t<EventTime>\n" + |
71 | - "\t\t\t\t\t<OccurrenceDateTime>2018-12-09T17:48:10+08:00</OccurrenceDateTime>\n" + | 69 | + "\t\t\t\t\t<OccurrenceDateTime>2017-07-13T19:25:55+08:00</OccurrenceDateTime>\n" + |
72 | "\t\t\t\t\t<DateTimeTypeCode>Actual</DateTimeTypeCode>\n" + | 70 | "\t\t\t\t\t<DateTimeTypeCode>Actual</DateTimeTypeCode>\n" + |
73 | "\t\t\t\t</EventTime>\n" + | 71 | "\t\t\t\t</EventTime>\n" + |
74 | "\t\t\t\t<SpecifiedLocation>\n" + | 72 | "\t\t\t\t<SpecifiedLocation>\n" + |
@@ -77,62 +75,21 @@ public class FWBDemo { | @@ -77,62 +75,21 @@ public class FWBDemo { | ||
77 | "\t\t\t\t\t<TypeCode>Airport</TypeCode>\n" + | 75 | "\t\t\t\t\t<TypeCode>Airport</TypeCode>\n" + |
78 | "\t\t\t\t</SpecifiedLocation>\n" + | 76 | "\t\t\t\t</SpecifiedLocation>\n" + |
79 | "\t\t\t\t<AssociatedStatusConsignment>\n" + | 77 | "\t\t\t\t<AssociatedStatusConsignment>\n" + |
80 | - "\t\t\t\t\t<GrossWeightMeasure unitCode=\"KGM\">3877</GrossWeightMeasure>\n" + | ||
81 | - "\t\t\t\t\t<GrossVolumeMeasure unitCode=\"MTQ\">25.85</GrossVolumeMeasure>\n" + | ||
82 | - "\t\t\t\t\t<ChargeableWeightMeasure unitCode=\"KGM\">4308.69</ChargeableWeightMeasure>\n" + | ||
83 | - "\t\t\t\t\t<DensityGroupCode>MC</DensityGroupCode>\n" + | ||
84 | - "\t\t\t\t\t<PieceQuantity>12</PieceQuantity>\n" + | 78 | + "\t\t\t\t\t<GrossWeightMeasure unitCode=\"KGM\">811</GrossWeightMeasure>\n" + |
79 | + "\t\t\t\t\t<GrossVolumeMeasure unitCode=\"MTQ\">0</GrossVolumeMeasure>\n" + | ||
80 | + "\t\t\t\t\t<PieceQuantity>27</PieceQuantity>\n" + | ||
85 | "\t\t\t\t\t<TransportSplitDescription>T</TransportSplitDescription>\n" + | 81 | "\t\t\t\t\t<TransportSplitDescription>T</TransportSplitDescription>\n" + |
86 | "\t\t\t\t\t<SpecifiedLogisticsTransportMovement>\n" + | 82 | "\t\t\t\t\t<SpecifiedLogisticsTransportMovement>\n" + |
87 | - "\t\t\t\t\t\t<ID>CV9761</ID>\n" + | ||
88 | - "\t\t\t\t\t\t<UsedLogisticsTransportMeans>\n" + | ||
89 | - "\t\t\t\t\t\t\t<Name>B747E</Name>\n" + | ||
90 | - "\t\t\t\t\t\t\t<Type>XXX</Type>\n" + | ||
91 | - "\t\t\t\t\t\t</UsedLogisticsTransportMeans>\n" + | ||
92 | - "\t\t\t\t\t\t<ArrivalEvent>\n" + | ||
93 | - "\t\t\t\t\t\t\t<ArrivalOccurrenceDateTime>2018-12-11T12:30:00+08:00</ArrivalOccurrenceDateTime>\n" + | ||
94 | - "\t\t\t\t\t\t\t<ArrivalDateTimeTypeCode>Schedual</ArrivalDateTimeTypeCode>\n" + | ||
95 | - "\t\t\t\t\t\t\t<OccurrenceArrivalLocation>\n" + | ||
96 | - "\t\t\t\t\t\t\t\t<ID/>\n" + | ||
97 | - "\t\t\t\t\t\t\t\t<Name/>\n" + | ||
98 | - "\t\t\t\t\t\t\t\t<TypeCode>Airport</TypeCode>\n" + | ||
99 | - "\t\t\t\t\t\t\t\t<FirstArrivalCountryID/>\n" + | ||
100 | - "\t\t\t\t\t\t\t</OccurrenceArrivalLocation>\n" + | ||
101 | - "\t\t\t\t\t\t</ArrivalEvent>\n" + | 83 | + "\t\t\t\t\t\t<ID>HX9366</ID>\n" + |
102 | "\t\t\t\t\t\t<DepartureEvent>\n" + | 84 | "\t\t\t\t\t\t<DepartureEvent>\n" + |
103 | - "\t\t\t\t\t\t\t<DepartureOccurrenceDateTime>2018-12-11T04:30:00+08:00</DepartureOccurrenceDateTime>\n" + | 85 | + "\t\t\t\t\t\t\t<DepartureOccurrenceDateTime>2017-07-15T00:00:00+08:00</DepartureOccurrenceDateTime>\n" + |
104 | "\t\t\t\t\t\t\t<DepartureDateTimeTypeCode>Schedual</DepartureDateTimeTypeCode>\n" + | 86 | "\t\t\t\t\t\t\t<DepartureDateTimeTypeCode>Schedual</DepartureDateTimeTypeCode>\n" + |
105 | - "\t\t\t\t\t\t\t<OccurrenceDepartureLocation>\n" + | ||
106 | - "\t\t\t\t\t\t\t\t<ID>CGO</ID>\n" + | ||
107 | - "\t\t\t\t\t\t\t\t<Name>ZHENGZHOU</Name>\n" + | ||
108 | - "\t\t\t\t\t\t\t\t<TypeCode>Airport</TypeCode>\n" + | ||
109 | - "\t\t\t\t\t\t\t\t<FirstArrivalCountryID>CN</FirstArrivalCountryID>\n" + | ||
110 | - "\t\t\t\t\t\t\t</OccurrenceDepartureLocation>\n" + | ||
111 | "\t\t\t\t\t\t</DepartureEvent>\n" + | 87 | "\t\t\t\t\t\t</DepartureEvent>\n" + |
112 | - "\t\t\t\t\t\t<CarrierParty>\n" + | ||
113 | - "\t\t\t\t\t\t\t<PrimaryID schemeAgencyID=\"3\">CV</PrimaryID>\n" + | ||
114 | - "\t\t\t\t\t\t</CarrierParty>\n" + | ||
115 | - "\t\t\t\t\t\t<SpecifiedLocation>\n" + | ||
116 | - "\t\t\t\t\t\t\t<ID>CGO</ID>\n" + | ||
117 | - "\t\t\t\t\t\t\t<Name>ZHENGZHOU</Name>\n" + | ||
118 | - "\t\t\t\t\t\t\t<TypeCode>Airport</TypeCode>\n" + | ||
119 | - "\t\t\t\t\t\t</SpecifiedLocation>\n" + | ||
120 | - "\t\t\t\t\t\t<SpecifiedEvent>\n" + | ||
121 | - "\t\t\t\t\t\t\t<OccurrenceDateTime>2018-12-09T17:48:10+08:00</OccurrenceDateTime>\n" + | ||
122 | - "\t\t\t\t\t\t\t<DateTimeTypeCode>Actual</DateTimeTypeCode>\n" + | ||
123 | - "\t\t\t\t\t\t</SpecifiedEvent>\n" + | ||
124 | "\t\t\t\t\t</SpecifiedLogisticsTransportMovement>\n" + | 88 | "\t\t\t\t\t</SpecifiedLogisticsTransportMovement>\n" + |
125 | - "\t\t\t\t\t<StorageLocations>\n" + | ||
126 | - "\t\t\t\t\t\t<LocationInfomation>\n" + | ||
127 | - "\t\t\t\t\t\t\t<Location>KQ/KQ</Location>\n" + | ||
128 | - "\t\t\t\t\t\t\t<PieceQuantity>12</PieceQuantity>\n" + | ||
129 | - "\t\t\t\t\t\t\t<GrossWeightMeasure unitCode=\"KGM\">3877</GrossWeightMeasure>\n" + | ||
130 | - "\t\t\t\t\t\t</LocationInfomation>\n" + | ||
131 | - "\t\t\t\t\t</StorageLocations>\n" + | ||
132 | "\t\t\t\t\t<RecievedFromParty>\n" + | 89 | "\t\t\t\t\t<RecievedFromParty>\n" + |
133 | - "\t\t\t\t\t\t<Name>DSV AIR SEA CO LTD 1</Name>\n" + | 90 | + "\t\t\t\t\t\t<Name>ZHANGJIAGANG RONGYUE IM EXPORT CO</Name>\n" + |
134 | "\t\t\t\t\t\t<PostalStructuredAddress>\n" + | 91 | "\t\t\t\t\t\t<PostalStructuredAddress>\n" + |
135 | - "\t\t\t\t\t\t\t<StreetName/>\n" + | 92 | + "\t\t\t\t\t\t\t<StreetName>SHAZHOU WEST ROAD ZHANGJIAGANG CITY</StreetName>\n" + |
136 | "\t\t\t\t\t\t</PostalStructuredAddress>\n" + | 93 | "\t\t\t\t\t\t</PostalStructuredAddress>\n" + |
137 | "\t\t\t\t\t\t<DefinedTradeContact>\n" + | 94 | "\t\t\t\t\t\t<DefinedTradeContact>\n" + |
138 | "\t\t\t\t\t\t\t<DirectTelephoneCommunication>\n" + | 95 | "\t\t\t\t\t\t\t<DirectTelephoneCommunication>\n" + |
@@ -141,7 +98,7 @@ public class FWBDemo { | @@ -141,7 +98,7 @@ public class FWBDemo { | ||
141 | "\t\t\t\t\t\t</DefinedTradeContact>\n" + | 98 | "\t\t\t\t\t\t</DefinedTradeContact>\n" + |
142 | "\t\t\t\t\t</RecievedFromParty>\n" + | 99 | "\t\t\t\t\t</RecievedFromParty>\n" + |
143 | "\t\t\t\t\t<IncludedMasterConsignmentItem>\n" + | 100 | "\t\t\t\t\t<IncludedMasterConsignmentItem>\n" + |
144 | - "\t\t\t\t\t\t<TypeCode listAgencyID=\"1\">CONSOL</TypeCode>\n" + | 101 | + "\t\t\t\t\t\t<TypeCode listAgencyID=\"1\">FABRIC</TypeCode>\n" + |
145 | "\t\t\t\t\t</IncludedMasterConsignmentItem>\n" + | 102 | "\t\t\t\t\t</IncludedMasterConsignmentItem>\n" + |
146 | "\t\t\t\t\t<IncludedCustomsNote>\n" + | 103 | "\t\t\t\t\t<IncludedCustomsNote>\n" + |
147 | "\t\t\t\t\t\t<ContentCode>CD</ContentCode>\n" + | 104 | "\t\t\t\t\t\t<ContentCode>CD</ContentCode>\n" + |
@@ -149,6 +106,17 @@ public class FWBDemo { | @@ -149,6 +106,17 @@ public class FWBDemo { | ||
149 | "\t\t\t\t\t\t<SubjectCode/>\n" + | 106 | "\t\t\t\t\t\t<SubjectCode/>\n" + |
150 | "\t\t\t\t\t\t<CountryID/>\n" + | 107 | "\t\t\t\t\t\t<CountryID/>\n" + |
151 | "\t\t\t\t\t\t<UtilizedUnitLoadTransportEquipment/>\n" + | 108 | "\t\t\t\t\t\t<UtilizedUnitLoadTransportEquipment/>\n" + |
109 | + "\t\t\t\t\t\t<IncludedHouseConsignment>\n" + | ||
110 | + "\t\t\t\t\t\t\t<GrossWeightMeasure unitCode=\"KGM\">811</GrossWeightMeasure>\n" + | ||
111 | + "\t\t\t\t\t\t\t<TotalGrossWeightMeasure unitCode=\"KGM\">811</TotalGrossWeightMeasure>\n" + | ||
112 | + "\t\t\t\t\t\t\t<PieceQuantity>27</PieceQuantity>\n" + | ||
113 | + "\t\t\t\t\t\t\t<TotalPieceQuantity>27</TotalPieceQuantity>\n" + | ||
114 | + "\t\t\t\t\t\t\t<TransportSplitDescription>T</TransportSplitDescription>\n" + | ||
115 | + "\t\t\t\t\t\t\t<TransportContractDocument>\n" + | ||
116 | + "\t\t\t\t\t\t\t\t<ID>WIN70715739</ID>\n" + | ||
117 | + "\t\t\t\t\t\t\t\t<TypeCode>703</TypeCode>\n" + | ||
118 | + "\t\t\t\t\t\t\t</TransportContractDocument>\n" + | ||
119 | + "\t\t\t\t\t\t</IncludedHouseConsignment>\n" + | ||
152 | "\t\t\t\t\t</IncludedCustomsNote>\n" + | 120 | "\t\t\t\t\t</IncludedCustomsNote>\n" + |
153 | "\t\t\t\t</AssociatedStatusConsignment>\n" + | 121 | "\t\t\t\t</AssociatedStatusConsignment>\n" + |
154 | "\t\t\t</ReportedStatus>\n" + | 122 | "\t\t\t</ReportedStatus>\n" + |
@@ -158,6 +126,14 @@ public class FWBDemo { | @@ -158,6 +126,14 @@ public class FWBDemo { | ||
158 | 126 | ||
159 | Document doc = DocumentHelper.parseText(xml); | 127 | Document doc = DocumentHelper.parseText(xml); |
160 | 128 | ||
129 | + try{ | ||
130 | + FZE_FOH_Handle fze_foh_handle = new FZE_FOH_Handle(); | ||
131 | + fze_foh_handle.handle(doc); | ||
132 | + }catch (Exception e){ | ||
133 | + | ||
134 | + } | ||
135 | + | ||
136 | + | ||
161 | // String currencyID = XMLXPath.getSinglePathProperty(doc,"//MSG/MasterConsignment/DeclaredValueForCarriageAmount/@currencyID"); | 137 | // String currencyID = XMLXPath.getSinglePathProperty(doc,"//MSG/MasterConsignment/DeclaredValueForCarriageAmount/@currencyID"); |
162 | 138 | ||
163 | String measure = XMLXPath.getSingleValueByPath(doc,"//MSG/ConsignmentStatus/MasterConsignment/GrossWeightMeasure/@unitCode"); | 139 | String measure = XMLXPath.getSingleValueByPath(doc,"//MSG/ConsignmentStatus/MasterConsignment/GrossWeightMeasure/@unitCode"); |
-
请 注册 或 登录 后发表评论