正在显示
34 个修改的文件
包含
503 行增加
和
235 行删除
@@ -54,6 +54,7 @@ | @@ -54,6 +54,7 @@ | ||
54 | <jackson.version>2.8.9</jackson.version> | 54 | <jackson.version>2.8.9</jackson.version> |
55 | <junit.version>4.12</junit.version> | 55 | <junit.version>4.12</junit.version> |
56 | <ehcache.version>2.6.8</ehcache.version> | 56 | <ehcache.version>2.6.8</ehcache.version> |
57 | + <fastjosn.version>1.2.16</fastjosn.version> | ||
57 | </properties> | 58 | </properties> |
58 | 59 | ||
59 | <dependencies> | 60 | <dependencies> |
@@ -72,6 +73,12 @@ | @@ -72,6 +73,12 @@ | ||
72 | </dependency> | 73 | </dependency> |
73 | 74 | ||
74 | <dependency> | 75 | <dependency> |
76 | + <groupId>com.alibaba</groupId> | ||
77 | + <artifactId>fastjson</artifactId> | ||
78 | + <version>${fastjosn.version}</version> | ||
79 | + </dependency> | ||
80 | + | ||
81 | + <dependency> | ||
75 | <groupId>org.springframework</groupId> | 82 | <groupId>org.springframework</groupId> |
76 | <artifactId>spring-oxm</artifactId> | 83 | <artifactId>spring-oxm</artifactId> |
77 | <version>${spring.version}</version> | 84 | <version>${spring.version}</version> |
@@ -4,6 +4,7 @@ import java.util.Date; | @@ -4,6 +4,7 @@ import java.util.Date; | ||
4 | import java.util.HashMap; | 4 | import java.util.HashMap; |
5 | import java.util.List; | 5 | import java.util.List; |
6 | import java.util.Map; | 6 | import java.util.Map; |
7 | +import java.util.UUID; | ||
7 | 8 | ||
8 | import javax.servlet.http.HttpServletRequest; | 9 | import javax.servlet.http.HttpServletRequest; |
9 | 10 | ||
@@ -21,7 +22,6 @@ import com.tianbo.util.DateUtils; | @@ -21,7 +22,6 @@ import com.tianbo.util.DateUtils; | ||
21 | import com.tianbo.util.json.AjaxJson; | 22 | import com.tianbo.util.json.AjaxJson; |
22 | import com.tianbo.util.json.JsonConversion; | 23 | import com.tianbo.util.json.JsonConversion; |
23 | import com.tianbo.util.xml.XmlGen; | 24 | import com.tianbo.util.xml.XmlGen; |
24 | -import com.tianbo.xml.lost.AdditionalInformation; | ||
25 | import com.tianbo.xml.lost.AssociatedTransportDocument; | 25 | import com.tianbo.xml.lost.AssociatedTransportDocument; |
26 | import com.tianbo.xml.lost.BorderTransportMeans; | 26 | import com.tianbo.xml.lost.BorderTransportMeans; |
27 | import com.tianbo.xml.lost.Consignment; | 27 | import com.tianbo.xml.lost.Consignment; |
@@ -52,6 +52,12 @@ public class LostApplyController { | @@ -52,6 +52,12 @@ public class LostApplyController { | ||
52 | return "lost/edit"; | 52 | return "lost/edit"; |
53 | } | 53 | } |
54 | 54 | ||
55 | + @RequestMapping(value ="toGetSendLog") | ||
56 | + public String toGetSendLog(ModelMap model,HttpServletRequest request) { | ||
57 | + model.put("id", request.getParameter("id")); | ||
58 | + return "lost/sendLog"; | ||
59 | + } | ||
60 | + | ||
55 | @ResponseBody | 61 | @ResponseBody |
56 | @RequestMapping(value = "getList") | 62 | @RequestMapping(value = "getList") |
57 | public String getList(HttpServletRequest request,int page,int limit){ | 63 | public String getList(HttpServletRequest request,int page,int limit){ |
@@ -98,6 +104,28 @@ public class LostApplyController { | @@ -98,6 +104,28 @@ public class LostApplyController { | ||
98 | } | 104 | } |
99 | 105 | ||
100 | /** | 106 | /** |
107 | + * 获取运抵回执 | ||
108 | + */ | ||
109 | + | ||
110 | + @ResponseBody | ||
111 | + @RequestMapping(value = "getSendLog") | ||
112 | + public String getList(HttpServletRequest request){ | ||
113 | + String id = request.getParameter("id"); | ||
114 | + List<Sendlog> sendLog = sendLogService.getSendLogByMessageId(id); | ||
115 | + Map<String,Object> map = new HashMap<>(); | ||
116 | + if(!sendLog.isEmpty()){ | ||
117 | + map.put("code", 0); | ||
118 | + map.put("msg", "success"); | ||
119 | + map.put("data", sendLog); | ||
120 | + }else { | ||
121 | + map.put("code", -1); | ||
122 | + map.put("msg", "无此单运抵回执"); | ||
123 | + map.put("data", ""); | ||
124 | + } | ||
125 | + return JsonConversion.writeMapJSON(map); | ||
126 | + } | ||
127 | + | ||
128 | + /** | ||
101 | * 编辑或新增 | 129 | * 编辑或新增 |
102 | * @param lost | 130 | * @param lost |
103 | * @param redirectAttributes | 131 | * @param redirectAttributes |
@@ -221,10 +249,11 @@ public class LostApplyController { | @@ -221,10 +249,11 @@ public class LostApplyController { | ||
221 | try { | 249 | try { |
222 | //保存至sendLog表 | 250 | //保存至sendLog表 |
223 | Sendlog sendlog = new Sendlog(); | 251 | Sendlog sendlog = new Sendlog(); |
224 | - sendlog.setAutoid(id); | 252 | + sendlog.setAutoid(UUID.randomUUID().toString()); |
253 | + sendlog.setMessageautoid(id); | ||
225 | sendlog.setCreatedate(new Date()); | 254 | sendlog.setCreatedate(new Date()); |
226 | sendlog.setMessagetype("MT8202"); | 255 | sendlog.setMessagetype("MT8202"); |
227 | - sendlog.setReceiption("发送分拨申请"); | 256 | + sendlog.setReceiption("发送落装申请"); |
228 | sendLogService.save(sendlog); | 257 | sendLogService.save(sendlog); |
229 | //生成报文并发送至文件夹 | 258 | //生成报文并发送至文件夹 |
230 | ManifestXmlEntity manifestXml = new ManifestXmlEntity(); | 259 | ManifestXmlEntity manifestXml = new ManifestXmlEntity(); |
@@ -252,28 +281,27 @@ public class LostApplyController { | @@ -252,28 +281,27 @@ public class LostApplyController { | ||
252 | * @param remark | 281 | * @param remark |
253 | * @param manifestXml | 282 | * @param manifestXml |
254 | */ | 283 | */ |
255 | - public void setParam(String flightno, String flightdate, String waybillnomaster, String waybillnosecondary, | ||
256 | - String remark, ManifestXmlEntity manifestXml) { | 284 | + public void setParam(String flightno, String flightdate, String waybillnomaster, String waybillnosecondary,String remark, ManifestXmlEntity manifestXml) { |
257 | HeadXmlEntity headXml = new HeadXmlEntity(); | 285 | HeadXmlEntity headXml = new HeadXmlEntity(); |
258 | DeclarationXmlEntity declarationXml = new DeclarationXmlEntity(); | 286 | DeclarationXmlEntity declarationXml = new DeclarationXmlEntity(); |
259 | BorderTransportMeans transportMeans = new BorderTransportMeans(); | 287 | BorderTransportMeans transportMeans = new BorderTransportMeans(); |
260 | transportMeans.setJourneyID(flightno+"/"+flightdate.substring(0,10).replace("-", ""));//航次航班 | 288 | transportMeans.setJourneyID(flightno+"/"+flightdate.substring(0,10).replace("-", ""));//航次航班 |
261 | - AdditionalInformation information = new AdditionalInformation(); | ||
262 | - information.setContent(remark); | ||
263 | Consignment consignment = new Consignment(); | 289 | Consignment consignment = new Consignment(); |
264 | TransportContractDocument transportContractDocument = new TransportContractDocument(); | 290 | TransportContractDocument transportContractDocument = new TransportContractDocument(); |
265 | transportContractDocument.setId(waybillnomaster.replace("-", ""));//主单号 | 291 | transportContractDocument.setId(waybillnomaster.replace("-", ""));//主单号 |
266 | AssociatedTransportDocument associatedTransportDocument = new AssociatedTransportDocument(); | 292 | AssociatedTransportDocument associatedTransportDocument = new AssociatedTransportDocument(); |
267 | if(waybillnosecondary==""||waybillnosecondary==null){ | 293 | if(waybillnosecondary==""||waybillnosecondary==null){ |
268 | - associatedTransportDocument.setId("");//分单号 | 294 | + |
269 | }else{ | 295 | }else{ |
270 | associatedTransportDocument.setId(waybillnomaster.replace("-", "")+"_"+waybillnosecondary);//分单号 | 296 | associatedTransportDocument.setId(waybillnomaster.replace("-", "")+"_"+waybillnosecondary);//分单号 |
271 | - } | ||
272 | consignment.setAssociatedTransportDocument(associatedTransportDocument ); | 297 | consignment.setAssociatedTransportDocument(associatedTransportDocument ); |
298 | + } | ||
299 | + | ||
273 | consignment.setTransportContractDocument(transportContractDocument ); | 300 | consignment.setTransportContractDocument(transportContractDocument ); |
274 | - declarationXml.setAdditionalInformation(information); | 301 | + |
275 | declarationXml.setBorderTransportMeans(transportMeans); | 302 | declarationXml.setBorderTransportMeans(transportMeans); |
276 | declarationXml.setConsignment(consignment); | 303 | declarationXml.setConsignment(consignment); |
304 | + | ||
277 | manifestXml.setHeadXml(headXml); | 305 | manifestXml.setHeadXml(headXml); |
278 | manifestXml.setDeclarationXml(declarationXml); | 306 | manifestXml.setDeclarationXml(declarationXml); |
279 | } | 307 | } |
@@ -3,10 +3,12 @@ package com.tianbo.controller.lost; | @@ -3,10 +3,12 @@ package com.tianbo.controller.lost; | ||
3 | import java.lang.reflect.InvocationTargetException; | 3 | import java.lang.reflect.InvocationTargetException; |
4 | import java.text.ParseException; | 4 | import java.text.ParseException; |
5 | import java.text.SimpleDateFormat; | 5 | import java.text.SimpleDateFormat; |
6 | +import java.util.ArrayList; | ||
6 | import java.util.Date; | 7 | import java.util.Date; |
7 | import java.util.HashMap; | 8 | import java.util.HashMap; |
8 | import java.util.List; | 9 | import java.util.List; |
9 | import java.util.Map; | 10 | import java.util.Map; |
11 | +import java.util.UUID; | ||
10 | 12 | ||
11 | import javax.servlet.http.HttpServletRequest; | 13 | import javax.servlet.http.HttpServletRequest; |
12 | 14 | ||
@@ -26,17 +28,25 @@ import com.tianbo.model.Sendlog; | @@ -26,17 +28,25 @@ import com.tianbo.model.Sendlog; | ||
26 | import com.tianbo.service.ItemService; | 28 | import com.tianbo.service.ItemService; |
27 | import com.tianbo.service.LostChangeService; | 29 | import com.tianbo.service.LostChangeService; |
28 | import com.tianbo.service.SendLogService; | 30 | import com.tianbo.service.SendLogService; |
31 | +import com.tianbo.util.DateUtils; | ||
29 | import com.tianbo.util.json.AjaxJson; | 32 | import com.tianbo.util.json.AjaxJson; |
30 | import com.tianbo.util.json.JsonConversion; | 33 | import com.tianbo.util.json.JsonConversion; |
31 | import com.tianbo.util.xml.XmlGen; | 34 | import com.tianbo.util.xml.XmlGen; |
32 | -import com.tianbo.xml.lost.AdditionalInformation; | ||
33 | import com.tianbo.xml.lost.AssociatedTransportDocument; | 35 | import com.tianbo.xml.lost.AssociatedTransportDocument; |
34 | import com.tianbo.xml.lost.BorderTransportMeans; | 36 | import com.tianbo.xml.lost.BorderTransportMeans; |
35 | import com.tianbo.xml.lost.Consignment; | 37 | import com.tianbo.xml.lost.Consignment; |
36 | -import com.tianbo.xml.lost.DeclarationXmlEntity; | ||
37 | -import com.tianbo.xml.lost.HeadXmlEntity; | ||
38 | -import com.tianbo.xml.lost.ManifestXmlEntity; | ||
39 | import com.tianbo.xml.lost.TransportContractDocument; | 38 | import com.tianbo.xml.lost.TransportContractDocument; |
39 | +import com.tianbo.xml.lostChange.AssociatedTransport; | ||
40 | +import com.tianbo.xml.lostChange.ChangeBorderTransportMeans; | ||
41 | +import com.tianbo.xml.lostChange.ChangeConsignment; | ||
42 | +import com.tianbo.xml.lostChange.Commodity; | ||
43 | +import com.tianbo.xml.lostChange.ConsignmentItem; | ||
44 | +import com.tianbo.xml.lostChange.ConsignmentItemPackaging; | ||
45 | +import com.tianbo.xml.lostChange.DeclarationXml; | ||
46 | +import com.tianbo.xml.lostChange.GoodsMeasure; | ||
47 | +import com.tianbo.xml.lostChange.HeadXml; | ||
48 | +import com.tianbo.xml.lostChange.ManifestXml; | ||
49 | +import com.tianbo.xml.lostChange.TransportContract; | ||
40 | 50 | ||
41 | @Controller | 51 | @Controller |
42 | @RequestMapping("/lost/change") | 52 | @RequestMapping("/lost/change") |
@@ -116,10 +126,14 @@ public class LostChangeController { | @@ -116,10 +126,14 @@ public class LostChangeController { | ||
116 | map.put("data", ltem); | 126 | map.put("data", ltem); |
117 | }else { | 127 | }else { |
118 | map.put("code", 0); | 128 | map.put("code", 0); |
119 | - map.put("msg", ""); | 129 | + map.put("msg", "success"); |
120 | map.put("data", ""); | 130 | map.put("data", ""); |
121 | } | 131 | } |
122 | 132 | ||
133 | + }else{ | ||
134 | + map.put("code", 0); | ||
135 | + map.put("msg", "success"); | ||
136 | + map.put("data", ""); | ||
123 | } | 137 | } |
124 | } catch (Exception e) { | 138 | } catch (Exception e) { |
125 | map.put("code", -1); | 139 | map.put("code", -1); |
@@ -339,30 +353,98 @@ public class LostChangeController { | @@ -339,30 +353,98 @@ public class LostChangeController { | ||
339 | * @param lost | 353 | * @param lost |
340 | * @param redirectAttributes | 354 | * @param redirectAttributes |
341 | * @return | 355 | * @return |
356 | + * @throws InvocationTargetException | ||
357 | + * @throws IllegalAccessException | ||
342 | */ | 358 | */ |
343 | @ResponseBody | 359 | @ResponseBody |
344 | @RequestMapping(value = "send") | 360 | @RequestMapping(value = "send") |
345 | - public AjaxJson send(ModelMap model,HttpServletRequest request) { | 361 | + public AjaxJson send(ModelMap model,HttpServletRequest request,@RequestParam Map<String, Object> params) throws IllegalAccessException, InvocationTargetException { |
346 | String id = request.getParameter("id"); | 362 | String id = request.getParameter("id"); |
347 | - String flightno = request.getParameter("flightno"); | ||
348 | - String flightdate = request.getParameter("flightdate"); | ||
349 | - String waybillnomaster = request.getParameter("waybillnomaster"); | ||
350 | - String waybillnosecondary = request.getParameter("waybillnosecondary"); | ||
351 | - String remark = request.getParameter("remark"); | 363 | + ManifestLostChange mf = new ManifestLostChange(); |
364 | + DateConvert();//日期转化 | ||
365 | + BeanUtils.populate(mf, params); | ||
366 | + | ||
367 | + List<ManifestItem> iteamList = itemService.getIteamList(mf.getWaybillnomaster()); | ||
368 | + | ||
369 | + List<ConsignmentItem> consignmentItem = new ArrayList<>(); | ||
370 | + | ||
371 | + for (ManifestItem manifestItem : iteamList) { | ||
372 | + | ||
373 | + ConsignmentItemPackaging consignmentItemPackaging = new ConsignmentItemPackaging(); | ||
374 | + consignmentItemPackaging.setQuantityQuantity(manifestItem.getPiece()); //件数 | ||
375 | + consignmentItemPackaging.setTypeCode(manifestItem.getPackageCode()); //包装代码 | ||
376 | + | ||
377 | + GoodsMeasure goodsMeasure = new GoodsMeasure(); | ||
378 | + goodsMeasure.setGrossMassMeasure(manifestItem.getWeight()); //重量 | ||
379 | + | ||
380 | + Commodity commodity = new Commodity(); | ||
381 | + commodity.setCargoDescription(manifestItem.getDescription());//货物描述 | ||
382 | + | ||
383 | + ConsignmentItem item = new ConsignmentItem(); | ||
384 | + item.setSequenceNumeric(manifestItem.getOrderNumber());//商品序号 | ||
385 | + item.setConsignmentItemPackaging(consignmentItemPackaging);//包装项信息 | ||
386 | + item.setGoodsMeasure(goodsMeasure);//货物毛重 | ||
387 | + item.setCommodity(commodity ); | ||
388 | + consignmentItem.add(item); | ||
389 | + } | ||
390 | + | ||
391 | + | ||
352 | String message = null; | 392 | String message = null; |
353 | AjaxJson j = new AjaxJson(); | 393 | AjaxJson j = new AjaxJson(); |
354 | try { | 394 | try { |
355 | //保存至sendLog表 | 395 | //保存至sendLog表 |
356 | Sendlog sendlog = new Sendlog(); | 396 | Sendlog sendlog = new Sendlog(); |
357 | - sendlog.setAutoid(id); | 397 | + sendlog.setAutoid(UUID.randomUUID().toString()); |
398 | + sendlog.setMessageautoid(id); | ||
358 | sendlog.setCreatedate(new Date()); | 399 | sendlog.setCreatedate(new Date()); |
359 | sendlog.setMessagetype("MT8203"); | 400 | sendlog.setMessagetype("MT8203"); |
360 | sendlog.setReceiption("发送落装改配申请"); | 401 | sendlog.setReceiption("发送落装改配申请"); |
361 | sendLogService.save(sendlog); | 402 | sendLogService.save(sendlog); |
362 | - //生成报文并发送至文件夹 | ||
363 | - ManifestXmlEntity manifestXml = new ManifestXmlEntity(); | ||
364 | - setParam(flightno, flightdate, waybillnomaster, waybillnosecondary, remark, manifestXml); | ||
365 | - XmlGen.genLostXmlAndSend(manifestXml); | 403 | + //生成报文并发送 |
404 | + ManifestXml manifestXml = new ManifestXml(); | ||
405 | + | ||
406 | + HeadXml headXml = new HeadXml(); | ||
407 | + DeclarationXml declaration = new DeclarationXml(); | ||
408 | + Consignment consign = new Consignment(); | ||
409 | + | ||
410 | + TransportContractDocument transportContractDocument = new TransportContractDocument(); | ||
411 | + AssociatedTransportDocument associatedTransportDocument = new AssociatedTransportDocument(); | ||
412 | + TransportContract transportContract= new TransportContract(); | ||
413 | + AssociatedTransport associatedTransport = new AssociatedTransport(); | ||
414 | + | ||
415 | + transportContractDocument.setId(mf.getWaybillnomaster());//改配前主单号 | ||
416 | + associatedTransportDocument.setId(mf.getWaybillnomaster()+"_"+mf.getWaybillnosecondary()); //改配前分单号 | ||
417 | + | ||
418 | + consign.setTransportContractDocument(transportContractDocument); | ||
419 | + consign.setAssociatedTransportDocument(associatedTransportDocument); | ||
420 | + | ||
421 | + ChangeConsignment changeConsignment = new ChangeConsignment(); | ||
422 | + | ||
423 | + transportContract.setId(mf.getCwaybillnomaster());//改配后主单号 | ||
424 | + associatedTransport.setId(mf.getCwaybillnomaster()+"_"+mf.getCwaybillnosecondary()); //改配分单号 | ||
425 | + | ||
426 | + changeConsignment.setTransportContractDocument(transportContract); | ||
427 | + changeConsignment.setAssociatedTransportDocument(associatedTransport); | ||
428 | + | ||
429 | + | ||
430 | + changeConsignment.setConsignmentItem(consignmentItem); | ||
431 | + | ||
432 | + consign.setChangeConsignment(changeConsignment); | ||
433 | + | ||
434 | + BorderTransportMeans borderTransportMeans = new BorderTransportMeans(); | ||
435 | + borderTransportMeans.setJourneyID(mf.getFlightno()+"/"+DateUtils.DateToString(mf.getFlightdate(), "yyyy-MM-dd HH:mm:ss").substring(0,10).replace("-", ""));//航次航班 | ||
436 | + | ||
437 | + ChangeBorderTransportMeans changeBorderTransportMeans = new ChangeBorderTransportMeans(); | ||
438 | + changeBorderTransportMeans.setJourneyID(mf.getCflightno()+"/"+DateUtils.DateToString(mf.getCflightdate(), "yyyy-MM-dd HH:mm:ss").substring(0,10).replace("-", ""));//航次航班 | ||
439 | + | ||
440 | + declaration.setBorderTransportMeans(borderTransportMeans); | ||
441 | + declaration.setChangeBorderTransportMeans(changeBorderTransportMeans ); | ||
442 | + declaration.setConsignment(consign); | ||
443 | + | ||
444 | + manifestXml.setHeadXml(headXml); | ||
445 | + manifestXml.setDeclarationXml(declaration); | ||
446 | + | ||
447 | + XmlGen.genLostChangeXmlAndSend(manifestXml); | ||
366 | j.setSuccess(true); | 448 | j.setSuccess(true); |
367 | message = "已发送申报报文"; | 449 | message = "已发送申报报文"; |
368 | ManifestLostChange lost = lostChangeService.selectByPrimaryKey(id); | 450 | ManifestLostChange lost = lostChangeService.selectByPrimaryKey(id); |
@@ -377,35 +459,4 @@ public class LostChangeController { | @@ -377,35 +459,4 @@ public class LostChangeController { | ||
377 | return j; | 459 | return j; |
378 | } | 460 | } |
379 | 461 | ||
380 | - /** | ||
381 | - * @param flightno | ||
382 | - * @param flightdate | ||
383 | - * @param waybillnomaster | ||
384 | - * @param waybillnosecondary | ||
385 | - * @param remark | ||
386 | - * @param manifestXml | ||
387 | - */ | ||
388 | - public void setParam(String flightno, String flightdate, String waybillnomaster, String waybillnosecondary, | ||
389 | - String remark, ManifestXmlEntity manifestXml) { | ||
390 | - HeadXmlEntity headXml = new HeadXmlEntity(); | ||
391 | - DeclarationXmlEntity declarationXml = new DeclarationXmlEntity(); | ||
392 | - BorderTransportMeans transportMeans = new BorderTransportMeans(); | ||
393 | - transportMeans.setJourneyID(flightno+"/"+flightdate.substring(0,10).replace("-", ""));//航次航班 | ||
394 | - AdditionalInformation information = new AdditionalInformation(); | ||
395 | - information.setContent(remark); | ||
396 | - Consignment consignment = new Consignment(); | ||
397 | - TransportContractDocument transportContractDocument = new TransportContractDocument(); | ||
398 | - transportContractDocument.setId(waybillnomaster);//主单号 | ||
399 | - AssociatedTransportDocument associatedTransportDocument = new AssociatedTransportDocument(); | ||
400 | - associatedTransportDocument.setId(waybillnomaster+"_"+waybillnosecondary);//分单号 | ||
401 | - consignment.setAssociatedTransportDocument(associatedTransportDocument ); | ||
402 | - consignment.setTransportContractDocument(transportContractDocument ); | ||
403 | - declarationXml.setAdditionalInformation(information); | ||
404 | - declarationXml.setBorderTransportMeans(transportMeans); | ||
405 | - declarationXml.setConsignment(consignment); | ||
406 | - manifestXml.setHeadXml(headXml); | ||
407 | - manifestXml.setDeclarationXml(declarationXml); | ||
408 | - } | ||
409 | - | ||
410 | - | ||
411 | } | 462 | } |
@@ -14,4 +14,6 @@ public interface SendLogService { | @@ -14,4 +14,6 @@ public interface SendLogService { | ||
14 | public List<Sendlog> getSendLogSecondByMain(String billNo); | 14 | public List<Sendlog> getSendLogSecondByMain(String billNo); |
15 | 15 | ||
16 | public void save(Sendlog sendlog); | 16 | public void save(Sendlog sendlog); |
17 | + | ||
18 | + public List<Sendlog> getSendLogByMessageId(String id); | ||
17 | } | 19 | } |
@@ -38,4 +38,10 @@ public class SendLogServiceImpl implements SendLogService { | @@ -38,4 +38,10 @@ public class SendLogServiceImpl implements SendLogService { | ||
38 | sendlogDao.insert(sendlog); | 38 | sendlogDao.insert(sendlog); |
39 | } | 39 | } |
40 | 40 | ||
41 | + @Override | ||
42 | + public List<Sendlog> getSendLogByMessageId(String id) { | ||
43 | + // TODO Auto-generated method stub | ||
44 | + return sendlogDao.getSendLogByMessageId(id); | ||
45 | + } | ||
46 | + | ||
41 | } | 47 | } |
1 | +package com.tianbo.util.xml; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.XStream; | ||
4 | +import com.thoughtworks.xstream.io.xml.DomDriver; | ||
5 | +import com.thoughtworks.xstream.mapper.MapperWrapper; | ||
6 | + | ||
7 | +public class XStreamEx extends XStream { | ||
8 | + public XStreamEx(DomDriver domDriver) { | ||
9 | + super(); | ||
10 | + } | ||
11 | + | ||
12 | + @Override | ||
13 | + protected MapperWrapper wrapMapper(MapperWrapper next) { | ||
14 | + return new MapperWrapper(next) { | ||
15 | + @Override | ||
16 | + public boolean shouldSerializeMember(@SuppressWarnings("rawtypes") Class definedIn, | ||
17 | + String fieldName) { | ||
18 | + if (definedIn == Object.class) { | ||
19 | + return false; | ||
20 | + } | ||
21 | + return super.shouldSerializeMember(definedIn, fieldName); | ||
22 | + } | ||
23 | + }; | ||
24 | + } | ||
25 | + | ||
26 | +} |
@@ -11,10 +11,11 @@ import java.nio.charset.Charset; | @@ -11,10 +11,11 @@ import java.nio.charset.Charset; | ||
11 | import org.springframework.stereotype.Component; | 11 | import org.springframework.stereotype.Component; |
12 | 12 | ||
13 | import com.thoughtworks.xstream.XStream; | 13 | import com.thoughtworks.xstream.XStream; |
14 | +import com.thoughtworks.xstream.io.xml.DomDriver; | ||
14 | import com.tianbo.util.DateUtils; | 15 | import com.tianbo.util.DateUtils; |
15 | -import com.tianbo.util.NullConverter; | ||
16 | import com.tianbo.util.PropertiesUtils; | 16 | import com.tianbo.util.PropertiesUtils; |
17 | import com.tianbo.xml.lost.ManifestXmlEntity; | 17 | import com.tianbo.xml.lost.ManifestXmlEntity; |
18 | +import com.tianbo.xml.lostChange.ManifestXml; | ||
18 | 19 | ||
19 | @Component | 20 | @Component |
20 | public class XmlGen { | 21 | public class XmlGen { |
@@ -25,11 +26,13 @@ public class XmlGen { | @@ -25,11 +26,13 @@ public class XmlGen { | ||
25 | */ | 26 | */ |
26 | public static String genLostXmlAndSend(ManifestXmlEntity xmlVO){ | 27 | public static String genLostXmlAndSend(ManifestXmlEntity xmlVO){ |
27 | 28 | ||
28 | - String xmlFileName = "CN_MT8202_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS") + ".xml"; | ||
29 | 29 | ||
30 | - XStream xstream = new XStream(); | 30 | + String xmlFileName = xmlVO.getHeadXml().getMessageId() + ".xml"; |
31 | + | ||
32 | + XStreamEx xstream = new XStreamEx(new DomDriver()); | ||
33 | + | ||
31 | xstream.autodetectAnnotations(true); | 34 | xstream.autodetectAnnotations(true); |
32 | - xstream.registerConverter(new NullConverter()); | 35 | + /*xstream.registerConverter(new NullConverter());*/ |
33 | 36 | ||
34 | String xml = xstream.toXML(xmlVO); | 37 | String xml = xstream.toXML(xmlVO); |
35 | 38 | ||
@@ -48,20 +51,20 @@ public class XmlGen { | @@ -48,20 +51,20 @@ public class XmlGen { | ||
48 | * 生成落装改配申请报文 | 51 | * 生成落装改配申请报文 |
49 | * @param entity | 52 | * @param entity |
50 | */ | 53 | */ |
51 | - public static String genLostChangeXmlAndSend(ManifestXmlEntity xmlVO){ | 54 | + public static String genLostChangeXmlAndSend(ManifestXml xmlVO){ |
52 | 55 | ||
53 | - String xmlFileName = "CN_MT8202_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS") + ".xml"; | 56 | + String xmlFileName = "CN_MT8203_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS") + ".xml"; |
54 | 57 | ||
55 | XStream xstream = new XStream(); | 58 | XStream xstream = new XStream(); |
56 | xstream.autodetectAnnotations(true); | 59 | xstream.autodetectAnnotations(true); |
57 | - xstream.registerConverter(new NullConverter()); | 60 | + /* xstream.registerConverter(new NullConverter());*/ |
58 | 61 | ||
59 | String xml = xstream.toXML(xmlVO); | 62 | String xml = xstream.toXML(xmlVO); |
60 | 63 | ||
61 | xml="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+xml; | 64 | xml="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+xml; |
62 | xml=xml.replace("__", "_"); | 65 | xml=xml.replace("__", "_"); |
63 | 66 | ||
64 | - String xmlPath =PropertiesUtils.readProperty("MT8202Path")+xmlFileName; | 67 | + String xmlPath =PropertiesUtils.readProperty("MT8203Path")+xmlFileName; |
65 | 68 | ||
66 | xml2File(xmlVO, xmlFileName, xstream,xmlPath); | 69 | xml2File(xmlVO, xmlFileName, xstream,xmlPath); |
67 | 70 | ||
@@ -75,7 +78,7 @@ public class XmlGen { | @@ -75,7 +78,7 @@ public class XmlGen { | ||
75 | * @param xmlFileName | 78 | * @param xmlFileName |
76 | * @param xstream | 79 | * @param xstream |
77 | */ | 80 | */ |
78 | - public static void xml2File(ManifestXmlEntity xmlVO, String xmlFileName, XStream xstream,String xmlPath) { | 81 | + public static void xml2File(Object xmlVO, String xmlFileName, XStream xstream,String xmlPath) { |
79 | File file = new File(xmlPath); | 82 | File file = new File(xmlPath); |
80 | if (!file.exists()) { | 83 | if (!file.exists()) { |
81 | try { | 84 | try { |
@@ -13,7 +13,7 @@ import org.junit.Test; | @@ -13,7 +13,7 @@ import org.junit.Test; | ||
13 | import com.thoughtworks.xstream.XStream; | 13 | import com.thoughtworks.xstream.XStream; |
14 | import com.thoughtworks.xstream.io.xml.DomDriver; | 14 | import com.thoughtworks.xstream.io.xml.DomDriver; |
15 | 15 | ||
16 | -public class xmlUtils { | 16 | +public class XmlUtils { |
17 | 17 | ||
18 | private Object obj; | 18 | private Object obj; |
19 | 19 |
@@ -2,6 +2,7 @@ package com.tianbo.xml.lost; | @@ -2,6 +2,7 @@ package com.tianbo.xml.lost; | ||
2 | 2 | ||
3 | import com.thoughtworks.xstream.annotations.XStreamAlias; | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; |
4 | 4 | ||
5 | +@XStreamAlias("AssociatedTransportDocument") | ||
5 | public class AssociatedTransportDocument { | 6 | public class AssociatedTransportDocument { |
6 | 7 | ||
7 | @XStreamAlias("ID") | 8 | @XStreamAlias("ID") |
1 | package com.tianbo.xml.lost; | 1 | package com.tianbo.xml.lost; |
2 | 2 | ||
3 | import com.thoughtworks.xstream.annotations.XStreamAlias; | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; |
4 | +import com.tianbo.xml.lostChange.ChangeConsignment; | ||
4 | 5 | ||
5 | public class Consignment { | 6 | public class Consignment { |
6 | 7 | ||
@@ -10,6 +11,9 @@ public class Consignment { | @@ -10,6 +11,9 @@ public class Consignment { | ||
10 | @XStreamAlias("AssociatedTransportDocument") | 11 | @XStreamAlias("AssociatedTransportDocument") |
11 | private AssociatedTransportDocument associatedTransportDocument; | 12 | private AssociatedTransportDocument associatedTransportDocument; |
12 | 13 | ||
14 | + @XStreamAlias("ChangeConsignment") | ||
15 | + private ChangeConsignment changeConsignment; | ||
16 | + | ||
13 | public TransportContractDocument getTransportContractDocument() { | 17 | public TransportContractDocument getTransportContractDocument() { |
14 | return transportContractDocument; | 18 | return transportContractDocument; |
15 | } | 19 | } |
@@ -26,4 +30,12 @@ public class Consignment { | @@ -26,4 +30,12 @@ public class Consignment { | ||
26 | this.associatedTransportDocument = associatedTransportDocument; | 30 | this.associatedTransportDocument = associatedTransportDocument; |
27 | } | 31 | } |
28 | 32 | ||
33 | + public ChangeConsignment getChangeConsignment() { | ||
34 | + return changeConsignment; | ||
35 | + } | ||
36 | + | ||
37 | + public void setChangeConsignment(ChangeConsignment changeConsignment) { | ||
38 | + this.changeConsignment = changeConsignment; | ||
39 | + } | ||
40 | + | ||
29 | } | 41 | } |
@@ -2,11 +2,20 @@ package com.tianbo.xml.lost; | @@ -2,11 +2,20 @@ package com.tianbo.xml.lost; | ||
2 | 2 | ||
3 | 3 | ||
4 | import com.thoughtworks.xstream.annotations.XStreamAlias; | 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; |
5 | +import com.thoughtworks.xstream.annotations.XStreamAsAttribute; | ||
5 | import com.tianbo.util.xml.XmlGen; | 6 | import com.tianbo.util.xml.XmlGen; |
6 | 7 | ||
7 | @XStreamAlias("Manifest") | 8 | @XStreamAlias("Manifest") |
8 | public class ManifestXmlEntity { | 9 | public class ManifestXmlEntity { |
9 | 10 | ||
11 | +/* @XStreamAlias("Head") | ||
12 | + @XStreamAsAttribute | ||
13 | + private String xmlxsd; | ||
14 | + | ||
15 | + @XStreamAlias("Head") | ||
16 | + @XStreamAsAttribute | ||
17 | + private String xmlns;*/ | ||
18 | + | ||
10 | @XStreamAlias("Head") | 19 | @XStreamAlias("Head") |
11 | private HeadXmlEntity headXml; | 20 | private HeadXmlEntity headXml; |
12 | 21 |
@@ -2,6 +2,7 @@ package com.tianbo.xml.lost; | @@ -2,6 +2,7 @@ package com.tianbo.xml.lost; | ||
2 | 2 | ||
3 | import com.thoughtworks.xstream.annotations.XStreamAlias; | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; |
4 | 4 | ||
5 | +@XStreamAlias("TransportContractDocument") | ||
5 | public class TransportContractDocument { | 6 | public class TransportContractDocument { |
6 | 7 | ||
7 | @XStreamAlias("ID") | 8 | @XStreamAlias("ID") |
1 | -package com.tianbo.xml.lostChange; | ||
2 | - | ||
3 | -import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | - | ||
5 | -public class AdditionalInformation { | ||
6 | - | ||
7 | - @XStreamAlias("Content") | ||
8 | - private String content; | ||
9 | - | ||
10 | - public String getContent() { | ||
11 | - return content; | ||
12 | - } | ||
13 | - | ||
14 | - public void setContent(String content) { | ||
15 | - this.content = content; | ||
16 | - } | ||
17 | - | ||
18 | -} |
1 | package com.tianbo.xml.lostChange; | 1 | package com.tianbo.xml.lostChange; |
2 | 2 | ||
3 | import com.thoughtworks.xstream.annotations.XStreamAlias; | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; |
4 | -/** | ||
5 | - * 运输合同信息 | ||
6 | - * @author Promise | ||
7 | - * | ||
8 | - */ | ||
9 | -public class TransportContractDocument { | 4 | + |
5 | + | ||
6 | +public class AssociatedTransport { | ||
10 | 7 | ||
11 | @XStreamAlias("ID") | 8 | @XStreamAlias("ID") |
12 | private String id; | 9 | private String id; |
@@ -18,4 +15,5 @@ public class TransportContractDocument { | @@ -18,4 +15,5 @@ public class TransportContractDocument { | ||
18 | public void setId(String id) { | 15 | public void setId(String id) { |
19 | this.id = id; | 16 | this.id = id; |
20 | } | 17 | } |
18 | + | ||
21 | } | 19 | } |
1 | -package com.tianbo.xml.lostChange; | ||
2 | - | ||
3 | -import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | - | ||
5 | -public class BorderTransportMeans { | ||
6 | - | ||
7 | - @XStreamAlias("JourneyID") | ||
8 | - private String journeyID; | ||
9 | - | ||
10 | - public String getJourneyID() { | ||
11 | - return journeyID; | ||
12 | - } | ||
13 | - | ||
14 | - public void setJourneyID(String journeyID) { | ||
15 | - this.journeyID = journeyID; | ||
16 | - } | ||
17 | -} |
1 | package com.tianbo.xml.lostChange; | 1 | package com.tianbo.xml.lostChange; |
2 | 2 | ||
3 | +import java.util.List; | ||
4 | + | ||
3 | import com.thoughtworks.xstream.annotations.XStreamAlias; | 5 | import com.thoughtworks.xstream.annotations.XStreamAlias; |
6 | +import com.thoughtworks.xstream.annotations.XStreamImplicit; | ||
4 | 7 | ||
5 | /** | 8 | /** |
6 | * 变更后提(运)单信息 | 9 | * 变更后提(运)单信息 |
@@ -10,36 +13,38 @@ import com.thoughtworks.xstream.annotations.XStreamAlias; | @@ -10,36 +13,38 @@ import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
10 | public class ChangeConsignment { | 13 | public class ChangeConsignment { |
11 | 14 | ||
12 | @XStreamAlias("TransportContractDocument") | 15 | @XStreamAlias("TransportContractDocument") |
13 | - private TransportContractDocument transportContractDocument; | 16 | + private TransportContract transportContractDocument; |
14 | 17 | ||
15 | - @XStreamAlias("TransportContractDocument") | ||
16 | - private AssociatedTransportDocument associatedTransportDocument; | 18 | + @XStreamAlias("AssociatedTransportDocument") |
19 | + private AssociatedTransport associatedTransportDocument; | ||
17 | 20 | ||
18 | - @XStreamAlias("TransportEquipment") | ||
19 | - private TransportEquipment transportEquipment; | 21 | + @XStreamImplicit(itemFieldName = "ConsignmentItem") |
22 | + private List<ConsignmentItem> consignmentItem; | ||
20 | 23 | ||
21 | - public TransportContractDocument getTransportContractDocument() { | ||
22 | - return transportContractDocument; | 24 | + |
25 | + | ||
26 | + public List<ConsignmentItem> getConsignmentItem() { | ||
27 | + return consignmentItem; | ||
23 | } | 28 | } |
24 | 29 | ||
25 | - public void setTransportContractDocument(TransportContractDocument transportContractDocument) { | ||
26 | - this.transportContractDocument = transportContractDocument; | 30 | + public void setConsignmentItem(List<ConsignmentItem> consignmentItem) { |
31 | + this.consignmentItem = consignmentItem; | ||
27 | } | 32 | } |
28 | 33 | ||
29 | - public AssociatedTransportDocument getAssociatedTransportDocument() { | ||
30 | - return associatedTransportDocument; | 34 | + public TransportContract getTransportContractDocument() { |
35 | + return transportContractDocument; | ||
31 | } | 36 | } |
32 | 37 | ||
33 | - public void setAssociatedTransportDocument(AssociatedTransportDocument associatedTransportDocument) { | ||
34 | - this.associatedTransportDocument = associatedTransportDocument; | 38 | + public void setTransportContractDocument(TransportContract transportContractDocument) { |
39 | + this.transportContractDocument = transportContractDocument; | ||
35 | } | 40 | } |
36 | 41 | ||
37 | - public TransportEquipment getTransportEquipment() { | ||
38 | - return transportEquipment; | 42 | + public AssociatedTransport getAssociatedTransportDocument() { |
43 | + return associatedTransportDocument; | ||
39 | } | 44 | } |
40 | 45 | ||
41 | - public void setTransportEquipment(TransportEquipment transportEquipment) { | ||
42 | - this.transportEquipment = transportEquipment; | 46 | + public void setAssociatedTransportDocument(AssociatedTransport associatedTransportDocument) { |
47 | + this.associatedTransportDocument = associatedTransportDocument; | ||
43 | } | 48 | } |
44 | 49 | ||
45 | } | 50 | } |
1 | +package com.tianbo.xml.lostChange; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | + | ||
5 | +public class Commodity { //商品项简要描述 | ||
6 | + | ||
7 | + @XStreamAlias("CargoDescription") | ||
8 | + private String cargoDescription; | ||
9 | + | ||
10 | + public String getCargoDescription() { | ||
11 | + return cargoDescription; | ||
12 | + } | ||
13 | + | ||
14 | + public void setCargoDescription(String cargoDescription) { | ||
15 | + this.cargoDescription = cargoDescription; | ||
16 | + } | ||
17 | + | ||
18 | + | ||
19 | +} |
1 | -package com.tianbo.xml.lostChange; | ||
2 | - | ||
3 | -import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | - | ||
5 | -public class Consignment { | ||
6 | - | ||
7 | - @XStreamAlias("TransportContractDocument") | ||
8 | - private TransportContractDocument transportContractDocument; | ||
9 | - | ||
10 | - @XStreamAlias("AssociatedTransportDocument") | ||
11 | - private AssociatedTransportDocument associatedTransportDocument; | ||
12 | - | ||
13 | - @XStreamAlias("ChangeConsignment") | ||
14 | - private ChangeConsignment changeConsignment; | ||
15 | - | ||
16 | - public TransportContractDocument getTransportContractDocument() { | ||
17 | - return transportContractDocument; | ||
18 | - } | ||
19 | - | ||
20 | - public void setTransportContractDocument(TransportContractDocument transportContractDocument) { | ||
21 | - this.transportContractDocument = transportContractDocument; | ||
22 | - } | ||
23 | - | ||
24 | - public AssociatedTransportDocument getAssociatedTransportDocument() { | ||
25 | - return associatedTransportDocument; | ||
26 | - } | ||
27 | - | ||
28 | - public void setAssociatedTransportDocument(AssociatedTransportDocument associatedTransportDocument) { | ||
29 | - this.associatedTransportDocument = associatedTransportDocument; | ||
30 | - } | ||
31 | - | ||
32 | - public ChangeConsignment getChangeConsignment() { | ||
33 | - return changeConsignment; | ||
34 | - } | ||
35 | - | ||
36 | - public void setChangeConsignment(ChangeConsignment changeConsignment) { | ||
37 | - this.changeConsignment = changeConsignment; | ||
38 | - } | ||
39 | - | ||
40 | -} |
1 | +package com.tianbo.xml.lostChange; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | + | ||
5 | +public class ConsignmentItem { | ||
6 | + | ||
7 | + @XStreamAlias("SequenceNumeric") | ||
8 | + private String SequenceNumeric; | ||
9 | + | ||
10 | + @XStreamAlias("ConsignmentItemPackaging") | ||
11 | + private ConsignmentItemPackaging consignmentItemPackaging; | ||
12 | + | ||
13 | + @XStreamAlias("Commodity") | ||
14 | + private Commodity commodity; | ||
15 | + | ||
16 | + @XStreamAlias("GoodsMeasure") | ||
17 | + private GoodsMeasure goodsMeasure; | ||
18 | + | ||
19 | + public String getSequenceNumeric() { | ||
20 | + return SequenceNumeric; | ||
21 | + } | ||
22 | + | ||
23 | + public void setSequenceNumeric(String sequenceNumeric) { | ||
24 | + SequenceNumeric = sequenceNumeric; | ||
25 | + } | ||
26 | + | ||
27 | + public ConsignmentItemPackaging getConsignmentItemPackaging() { | ||
28 | + return consignmentItemPackaging; | ||
29 | + } | ||
30 | + | ||
31 | + public void setConsignmentItemPackaging(ConsignmentItemPackaging consignmentItemPackaging) { | ||
32 | + this.consignmentItemPackaging = consignmentItemPackaging; | ||
33 | + } | ||
34 | + | ||
35 | + public Commodity getCommodity() { | ||
36 | + return commodity; | ||
37 | + } | ||
38 | + | ||
39 | + public void setCommodity(Commodity commodity) { | ||
40 | + this.commodity = commodity; | ||
41 | + } | ||
42 | + | ||
43 | + public GoodsMeasure getGoodsMeasure() { | ||
44 | + return goodsMeasure; | ||
45 | + } | ||
46 | + | ||
47 | + public void setGoodsMeasure(GoodsMeasure goodsMeasure) { | ||
48 | + this.goodsMeasure = goodsMeasure; | ||
49 | + } | ||
50 | + | ||
51 | +} |
1 | +package com.tianbo.xml.lostChange; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | + | ||
5 | +public class ConsignmentItemPackaging { | ||
6 | + | ||
7 | + @XStreamAlias("QuantityQuantity") | ||
8 | + private String quantityQuantity; | ||
9 | + | ||
10 | + @XStreamAlias("TypeCode") | ||
11 | + private String typeCode; | ||
12 | + | ||
13 | + public String getQuantityQuantity() { | ||
14 | + return quantityQuantity; | ||
15 | + } | ||
16 | + | ||
17 | + public void setQuantityQuantity(String quantityQuantity) { | ||
18 | + this.quantityQuantity = quantityQuantity; | ||
19 | + } | ||
20 | + | ||
21 | + public String getTypeCode() { | ||
22 | + return typeCode; | ||
23 | + } | ||
24 | + | ||
25 | + public void setTypeCode(String typeCode) { | ||
26 | + this.typeCode = typeCode; | ||
27 | + } | ||
28 | + | ||
29 | + | ||
30 | +} |
@@ -3,8 +3,11 @@ package com.tianbo.xml.lostChange; | @@ -3,8 +3,11 @@ package com.tianbo.xml.lostChange; | ||
3 | import java.util.List; | 3 | import java.util.List; |
4 | 4 | ||
5 | import com.thoughtworks.xstream.annotations.XStreamAlias; | 5 | import com.thoughtworks.xstream.annotations.XStreamAlias; |
6 | +import com.tianbo.xml.lost.AdditionalInformation; | ||
7 | +import com.tianbo.xml.lost.BorderTransportMeans; | ||
8 | +import com.tianbo.xml.lost.Consignment; | ||
6 | 9 | ||
7 | -public class DeclarationXmlEntity { | 10 | +public class DeclarationXml { |
8 | 11 | ||
9 | @XStreamAlias("BorderTransportMeans") | 12 | @XStreamAlias("BorderTransportMeans") |
10 | private BorderTransportMeans borderTransportMeans; | 13 | private BorderTransportMeans borderTransportMeans; |
@@ -13,7 +16,7 @@ public class DeclarationXmlEntity { | @@ -13,7 +16,7 @@ public class DeclarationXmlEntity { | ||
13 | private ChangeBorderTransportMeans changeBorderTransportMeans; | 16 | private ChangeBorderTransportMeans changeBorderTransportMeans; |
14 | 17 | ||
15 | @XStreamAlias("Consignment") | 18 | @XStreamAlias("Consignment") |
16 | - private List<Consignment> consignment; | 19 | + private Consignment consignment; |
17 | 20 | ||
18 | @XStreamAlias("AdditionalInformation") | 21 | @XStreamAlias("AdditionalInformation") |
19 | private AdditionalInformation additionalInformation; | 22 | private AdditionalInformation additionalInformation; |
@@ -35,11 +38,20 @@ public class DeclarationXmlEntity { | @@ -35,11 +38,20 @@ public class DeclarationXmlEntity { | ||
35 | this.additionalInformation = additionalInformation; | 38 | this.additionalInformation = additionalInformation; |
36 | } | 39 | } |
37 | 40 | ||
38 | - public List<Consignment> getConsignment() { | 41 | + |
42 | + public ChangeBorderTransportMeans getChangeBorderTransportMeans() { | ||
43 | + return changeBorderTransportMeans; | ||
44 | + } | ||
45 | + | ||
46 | + public void setChangeBorderTransportMeans(ChangeBorderTransportMeans changeBorderTransportMeans) { | ||
47 | + this.changeBorderTransportMeans = changeBorderTransportMeans; | ||
48 | + } | ||
49 | + | ||
50 | + public Consignment getConsignment() { | ||
39 | return consignment; | 51 | return consignment; |
40 | } | 52 | } |
41 | 53 | ||
42 | - public void setConsignment(List<Consignment> consignment) { | 54 | + public void setConsignment(Consignment consignment) { |
43 | this.consignment = consignment; | 55 | this.consignment = consignment; |
44 | } | 56 | } |
45 | 57 |
1 | +package com.tianbo.xml.lostChange; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | + | ||
5 | +public class GoodsMeasure { | ||
6 | + | ||
7 | + @XStreamAlias("GrossMassMeasure") | ||
8 | + private String grossMassMeasure; //商品项货物毛重 | ||
9 | + | ||
10 | + public String getGrossMassMeasure() { | ||
11 | + return grossMassMeasure; | ||
12 | + } | ||
13 | + | ||
14 | + public void setGrossMassMeasure(String grossMassMeasure) { | ||
15 | + this.grossMassMeasure = grossMassMeasure; | ||
16 | + } | ||
17 | + | ||
18 | +} |
@@ -3,7 +3,7 @@ package com.tianbo.xml.lostChange; | @@ -3,7 +3,7 @@ package com.tianbo.xml.lostChange; | ||
3 | import com.thoughtworks.xstream.annotations.XStreamAlias; | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; |
4 | import com.tianbo.util.DateUtils; | 4 | import com.tianbo.util.DateUtils; |
5 | 5 | ||
6 | -public class HeadXmlEntity { | 6 | +public class HeadXml { |
7 | 7 | ||
8 | @XStreamAlias("MessageID") | 8 | @XStreamAlias("MessageID") |
9 | private String messageId="CN_MT8203_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS"); | 9 | private String messageId="CN_MT8203_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS"); |
@@ -85,7 +85,7 @@ public class HeadXmlEntity { | @@ -85,7 +85,7 @@ public class HeadXmlEntity { | ||
85 | this.sendTime = sendTime; | 85 | this.sendTime = sendTime; |
86 | } | 86 | } |
87 | public static void main(String[] args) { | 87 | public static void main(String[] args) { |
88 | - HeadXmlEntity hd = new HeadXmlEntity(); | 88 | + HeadXml hd = new HeadXml(); |
89 | System.out.println(hd); | 89 | System.out.println(hd); |
90 | } | 90 | } |
91 | } | 91 | } |
1 | +package com.tianbo.xml.lostChange; | ||
2 | + | ||
3 | + | ||
4 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
5 | + | ||
6 | +@XStreamAlias("Manifest") | ||
7 | +public class ManifestXml { | ||
8 | + | ||
9 | + @XStreamAlias("Head") | ||
10 | + private HeadXml headXml; | ||
11 | + | ||
12 | + @XStreamAlias("Declaration") | ||
13 | + private DeclarationXml declarationXml; | ||
14 | + | ||
15 | + | ||
16 | + | ||
17 | + public DeclarationXml getDeclarationXml() { | ||
18 | + return declarationXml; | ||
19 | + } | ||
20 | + | ||
21 | + public void setDeclarationXml(DeclarationXml declarationXml) { | ||
22 | + this.declarationXml = declarationXml; | ||
23 | + } | ||
24 | + | ||
25 | + public HeadXml getHeadXml() { | ||
26 | + return headXml; | ||
27 | + } | ||
28 | + | ||
29 | + public void setHeadXml(HeadXml headXml) { | ||
30 | + this.headXml = headXml; | ||
31 | + } | ||
32 | + | ||
33 | +} |
@@ -2,13 +2,13 @@ package com.tianbo.xml.lostChange; | @@ -2,13 +2,13 @@ package com.tianbo.xml.lostChange; | ||
2 | 2 | ||
3 | import com.thoughtworks.xstream.annotations.XStreamAlias; | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; |
4 | /** | 4 | /** |
5 | - * 运输合同附加信息 | 5 | + * 运输合同信息 |
6 | * @author Promise | 6 | * @author Promise |
7 | * | 7 | * |
8 | */ | 8 | */ |
9 | -public class AssociatedTransportDocument { | 9 | +public class TransportContract { |
10 | 10 | ||
11 | - @XStreamAlias("ID") | 11 | + @XStreamAlias("ID") //总提(运)单号 |
12 | private String id; | 12 | private String id; |
13 | 13 | ||
14 | public String getId() { | 14 | public String getId() { |
@@ -18,5 +18,4 @@ public class AssociatedTransportDocument { | @@ -18,5 +18,4 @@ public class AssociatedTransportDocument { | ||
18 | public void setId(String id) { | 18 | public void setId(String id) { |
19 | this.id = id; | 19 | this.id = id; |
20 | } | 20 | } |
21 | - | ||
22 | } | 21 | } |
1 | -package com.tianbo.xml.lostChange; | ||
2 | - | ||
3 | -import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | - | ||
5 | -/** | ||
6 | - * 集装箱(器)信息 | ||
7 | - * @author Promise | ||
8 | - * | ||
9 | - */ | ||
10 | -public class TransportEquipment { | ||
11 | - | ||
12 | - @XStreamAlias("EquipmentIdentification") //集装箱(器)编号信息 | ||
13 | - private String equipmentIdentification; | ||
14 | - | ||
15 | - @XStreamAlias("CharacteristicCode") | ||
16 | - private String characteristicCode; //集装箱(器)尺寸和类型 | ||
17 | - | ||
18 | - @XStreamAlias("SupplierPartyTypeCode") | ||
19 | - private String supplierPartyTypeCode; //集装箱(器)尺寸和类型 | ||
20 | - | ||
21 | - public String getEquipmentIdentification() { | ||
22 | - return equipmentIdentification; | ||
23 | - } | ||
24 | - | ||
25 | - public void setEquipmentIdentification(String equipmentIdentification) { | ||
26 | - this.equipmentIdentification = equipmentIdentification; | ||
27 | - } | ||
28 | - | ||
29 | - public String getCharacteristicCode() { | ||
30 | - return characteristicCode; | ||
31 | - } | ||
32 | - | ||
33 | - public void setCharacteristicCode(String characteristicCode) { | ||
34 | - this.characteristicCode = characteristicCode; | ||
35 | - } | ||
36 | -} |
@@ -96,7 +96,7 @@ | @@ -96,7 +96,7 @@ | ||
96 | insert into SENDLOG (AUTOID, CREATEDATE, OPAUTHOR, | 96 | insert into SENDLOG (AUTOID, CREATEDATE, OPAUTHOR, |
97 | SENDPEICE, SENDWEIGHT, RECEIPTION, | 97 | SENDPEICE, SENDWEIGHT, RECEIPTION, |
98 | MESSAGETYPE, MESSAGEAUTOID) | 98 | MESSAGETYPE, MESSAGEAUTOID) |
99 | - values (#{autoid,jdbcType=VARCHAR}, #{createdate,jdbcType=DATE}, #{opauthor,jdbcType=VARCHAR}, | 99 | + values (#{autoid,jdbcType=VARCHAR}, sysdate, #{opauthor,jdbcType=VARCHAR}, |
100 | #{sendpeice,jdbcType=DECIMAL}, #{sendweight,jdbcType=DECIMAL}, #{receiption,jdbcType=VARCHAR}, | 100 | #{sendpeice,jdbcType=DECIMAL}, #{sendweight,jdbcType=DECIMAL}, #{receiption,jdbcType=VARCHAR}, |
101 | #{messagetype,jdbcType=VARCHAR}, #{messageautoid,jdbcType=VARCHAR}) | 101 | #{messagetype,jdbcType=VARCHAR}, #{messageautoid,jdbcType=VARCHAR}) |
102 | </insert> | 102 | </insert> |
@@ -271,4 +271,18 @@ | @@ -271,4 +271,18 @@ | ||
271 | WHERE | 271 | WHERE |
272 | a.AUTOID = b.MESSAGEAUTOID | 272 | a.AUTOID = b.MESSAGEAUTOID |
273 | </select> | 273 | </select> |
274 | + | ||
275 | + <select id="getSendLogByMessageId" parameterType="Map" | ||
276 | + resultType="com.tianbo.model.Sendlog"> | ||
277 | + SELECT | ||
278 | + * | ||
279 | + FROM | ||
280 | + SENDLOG | ||
281 | + WHERE | ||
282 | + MESSAGEAUTOID = #{id} | ||
283 | + ORDER BY CREATEDATE | ||
284 | + </select> | ||
285 | + | ||
286 | + | ||
287 | + | ||
274 | </mapper> | 288 | </mapper> |
@@ -83,7 +83,9 @@ | @@ -83,7 +83,9 @@ | ||
83 | <div class="layui-inline"> | 83 | <div class="layui-inline"> |
84 | <label class="layui-form-label">包装种类代码</label> | 84 | <label class="layui-form-label">包装种类代码</label> |
85 | <div class="layui-input-block"> | 85 | <div class="layui-input-block"> |
86 | - <input type="text" name="packageCode" id="packageCode" autocomplete="off" class="layui-input"> | 86 | + <select name="packageCode" id="packageCode"> |
87 | + <option value="PK">箱</option> | ||
88 | + </select> | ||
87 | </div> | 89 | </div> |
88 | </div> | 90 | </div> |
89 | </div> | 91 | </div> |
@@ -170,17 +170,7 @@ | @@ -170,17 +170,7 @@ | ||
170 | }); | 170 | }); |
171 | return false; | 171 | return false; |
172 | } | 172 | } |
173 | - }else{ | ||
174 | - billNo = billNo.substring(0,3)+'-'+billNo.substring(3) | ||
175 | - if(billNo.length!=12){ | ||
176 | - $("#waybillnomaster").focus(); | ||
177 | - layer.tips('主单号必须为11位', '#waybillnomaster', { | ||
178 | - tips: [1, '#0FA6D8'] //还可配置颜色 | ||
179 | - }); | ||
180 | - return false; | ||
181 | - } | ||
182 | } | 173 | } |
183 | - $("#waybillnomaster").val(billNo); | ||
184 | return true; | 174 | return true; |
185 | } | 175 | } |
186 | } | 176 | } |
@@ -256,6 +256,7 @@ | @@ -256,6 +256,7 @@ | ||
256 | alert("请选择运单") | 256 | alert("请选择运单") |
257 | } | 257 | } |
258 | }else if(obj.event === 'shoufa'){ | 258 | }else if(obj.event === 'shoufa'){ |
259 | + var id = data.id; | ||
259 | if (data) { | 260 | if (data) { |
260 | var id = data.id; | 261 | var id = data.id; |
261 | layer.open({ | 262 | layer.open({ |
@@ -269,12 +270,12 @@ | @@ -269,12 +270,12 @@ | ||
269 | /* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */ | 270 | /* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */ |
270 | area: ['692px', '372px'], | 271 | area: ['692px', '372px'], |
271 | maxmin: true, //开启最大化最小化按钮 | 272 | maxmin: true, //开启最大化最小化按钮 |
272 | - content: "<%=basePath %>/lost/edit?id="+id, | 273 | + content: "<%=basePath %>/lost/toGetSendLog?id="+id, |
273 | success: function (layero, index) { | 274 | success: function (layero, index) { |
274 | // 获取子页面的iframe | 275 | // 获取子页面的iframe |
275 | var iframe = window['layui-layer-iframe' + index]; | 276 | var iframe = window['layui-layer-iframe' + index]; |
276 | // 向子页面的全局函数child传参 | 277 | // 向子页面的全局函数child传参 |
277 | - iframe.child(data); | 278 | + // iframe.child(data); |
278 | } | 279 | } |
279 | }) | 280 | }) |
280 | } else { | 281 | } else { |
@@ -343,17 +344,7 @@ | @@ -343,17 +344,7 @@ | ||
343 | }); | 344 | }); |
344 | return false; | 345 | return false; |
345 | } | 346 | } |
346 | - }else{ | ||
347 | - billNo = billNo.substring(0,3)+'-'+billNo.substring(3) | ||
348 | - if(billNo.length!=12){ | ||
349 | - $("#waybillnomaster").focus(); | ||
350 | - layer.tips('主单号必须为11位', '#waybillnomaster', { | ||
351 | - tips: [1, '#0FA6D8'] //还可配置颜色 | ||
352 | - }); | ||
353 | - return false; | ||
354 | - } | ||
355 | } | 347 | } |
356 | - $("#waybillnomaster").val(billNo); | ||
357 | return true; | 348 | return true; |
358 | } | 349 | } |
359 | } | 350 | } |
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" | ||
2 | + pageEncoding="UTF-8"%> | ||
3 | +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> | ||
4 | +<%@ page isELIgnored="false"%> | ||
5 | +<% | ||
6 | + String path = request.getContextPath(); | ||
7 | + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; | ||
8 | +%> | ||
9 | +<!DOCTYPE html> | ||
10 | +<html> | ||
11 | +<head> | ||
12 | + <meta charset="utf-8"> | ||
13 | + <title>运抵回执查询</title> | ||
14 | + <link rel="stylesheet" href="<%=basePath %>static/layui/css/layui.css" media="all"> | ||
15 | + <script src="<%=basePath %>static/layui/layui.js"></script> | ||
16 | + <script src="<%=basePath %>static/easyui/jquery.min.js"></script> | ||
17 | +</head> | ||
18 | + | ||
19 | +<body> | ||
20 | +<div class="layui-inline" > | ||
21 | + <table class="layui-hide" id="main" lay-filter="flight" style="width:99%; text-align="center"></table> | ||
22 | + </div> | ||
23 | + <input type="hidden" id="id" value="${id}"> | ||
24 | +</body> | ||
25 | + | ||
26 | +<script> | ||
27 | +$(document).ready(function(){ | ||
28 | + var id = $("#id").val() | ||
29 | + //if(!billNo == "" || !billNo == null || !billNo == undefined){ | ||
30 | + layui.use('table', function(){ | ||
31 | + var table = layui.table; | ||
32 | + //第一个实例 | ||
33 | + table.render({ | ||
34 | + elem: '#main' | ||
35 | + ,height: 'full-20' | ||
36 | + ,url: '/statistics/lost/getSendLog?id='+id | ||
37 | + ,page: false //开启分页 | ||
38 | + ,cols: [[ //表头 | ||
39 | + {field: 'createdate', title: '发送时间', width:180} | ||
40 | + ,{field: 'receiption', title: '回执内容', width:5800 ,templet: function(d){ | ||
41 | + var text = d.receiption; | ||
42 | + if(text.indexOf("成功")!=-1){ | ||
43 | + return '<span style="color: green;">'+ d.receiption +'</span>' | ||
44 | + }else if(text.indexOf("发送落装申请")!=-1){ | ||
45 | + return d.receiption | ||
46 | + }else{ | ||
47 | + return '<span style="color: red;">'+ d.receiption +'</span>' | ||
48 | + } | ||
49 | + } | ||
50 | + } | ||
51 | + ]] | ||
52 | + }); | ||
53 | + }); | ||
54 | + }) | ||
55 | + | ||
56 | + function loading(){ | ||
57 | + //var index = layer.load(0, {shade: 0.01}) | ||
58 | + var index = layer.msg('查询中', { | ||
59 | + icon: 16 | ||
60 | + ,shade: 0.01 | ||
61 | + }); | ||
62 | + } | ||
63 | + function unloading(){ | ||
64 | + //var index = layer.load(0, {shade: 0.01}) | ||
65 | + layer.closeAll(); | ||
66 | + } | ||
67 | +</script> | ||
68 | +</html> |
-
请 注册 或 登录 后发表评论