正在显示
26 个修改的文件
包含
631 行增加
和
217 行删除
@@ -110,7 +110,6 @@ pagehelper: | @@ -110,7 +110,6 @@ pagehelper: | ||
110 | reasonable: true | 110 | reasonable: true |
111 | support-methods-arguments: true | 111 | support-methods-arguments: true |
112 | params: count=countSql | 112 | params: count=countSql |
113 | - | ||
114 | #debug配置,debug或者为true的时候,logback才会记录和写入日志文件 | 113 | #debug配置,debug或者为true的时候,logback才会记录和写入日志文件 |
115 | trace: false | 114 | trace: false |
116 | debug: true | 115 | debug: true |
@@ -29,14 +29,7 @@ | @@ -29,14 +29,7 @@ | ||
29 | <groupId>org.springframework.boot</groupId> | 29 | <groupId>org.springframework.boot</groupId> |
30 | <artifactId>spring-boot-starter-web</artifactId> | 30 | <artifactId>spring-boot-starter-web</artifactId> |
31 | </dependency> | 31 | </dependency> |
32 | - <dependency> | ||
33 | - <groupId>org.springframework.cloud</groupId> | ||
34 | - <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> | ||
35 | - </dependency> | ||
36 | - <dependency> | ||
37 | - <groupId>org.springframework.cloud</groupId> | ||
38 | - <artifactId>spring-cloud-starter-openfeign</artifactId> | ||
39 | - </dependency> | 32 | + |
40 | 33 | ||
41 | <dependency> | 34 | <dependency> |
42 | <groupId>org.projectlombok</groupId> | 35 | <groupId>org.projectlombok</groupId> |
@@ -2,10 +2,9 @@ package com.sunyo.wlpt.message.builder; | @@ -2,10 +2,9 @@ package com.sunyo.wlpt.message.builder; | ||
2 | 2 | ||
3 | import org.springframework.boot.SpringApplication; | 3 | import org.springframework.boot.SpringApplication; |
4 | import org.springframework.boot.autoconfigure.SpringBootApplication; | 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
5 | -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; | ||
6 | 5 | ||
7 | @SpringBootApplication | 6 | @SpringBootApplication |
8 | -@EnableDiscoveryClient | 7 | +//@EnableDiscoveryClient |
9 | public class BuilderApplication { | 8 | public class BuilderApplication { |
10 | 9 | ||
11 | public static void main(String[] args) { | 10 | public static void main(String[] args) { |
1 | +package com.sunyo.wlpt.message.builder.controller; | ||
2 | + | ||
3 | +import com.sunyo.wlpt.message.builder.service.MT1201Service; | ||
4 | +import com.sunyo.wlpt.message.builder.service.MT3201Service; | ||
5 | +import com.sunyo.wlpt.message.builder.service.MT4201Service; | ||
6 | +import com.sunyo.wlpt.message.builder.service.MT520XService; | ||
7 | +import org.springframework.beans.factory.annotation.Autowired; | ||
8 | +import org.springframework.web.bind.annotation.RequestBody; | ||
9 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
10 | +import org.springframework.web.bind.annotation.RestController; | ||
11 | + | ||
12 | +import java.util.Map; | ||
13 | + | ||
14 | +@RestController | ||
15 | +@RequestMapping("/mtcreate") | ||
16 | +public class CreateftlxController { | ||
17 | + | ||
18 | + @Autowired | ||
19 | + MT520XService mt520XService; | ||
20 | + | ||
21 | + @Autowired | ||
22 | + MT1201Service mt1201Service; | ||
23 | + | ||
24 | + @Autowired | ||
25 | + MT3201Service mt3201Service; | ||
26 | + | ||
27 | + @Autowired | ||
28 | + MT4201Service mt4201Service; | ||
29 | + | ||
30 | + /** | ||
31 | + * 进出港理货 | ||
32 | + * @param map | ||
33 | + * @return | ||
34 | + */ | ||
35 | + @RequestMapping("/520xcreate") | ||
36 | + public Boolean create(@RequestBody Map<String, Object> map){ | ||
37 | + | ||
38 | + try { | ||
39 | + | ||
40 | + return mt520XService.create(map); | ||
41 | + | ||
42 | + }catch (Exception e){ | ||
43 | + e.printStackTrace(); | ||
44 | + return false; | ||
45 | + } | ||
46 | + | ||
47 | + } | ||
48 | + | ||
49 | + /** | ||
50 | + * 原始 FFm | ||
51 | + * @param map | ||
52 | + * @return | ||
53 | + */ | ||
54 | + @RequestMapping("/1201create") | ||
55 | + public Boolean ffmcreate(@RequestBody Map<String, Object> map){ | ||
56 | + | ||
57 | + try { | ||
58 | + | ||
59 | + return true; | ||
60 | + }catch (Exception e){ | ||
61 | + e.printStackTrace(); | ||
62 | + return false; | ||
63 | + } | ||
64 | + } | ||
65 | + | ||
66 | + @RequestMapping("/3201create") | ||
67 | + public Boolean fohcreate(@RequestBody Map<String, Object> map){ | ||
68 | + | ||
69 | + try { | ||
70 | + | ||
71 | + return mt3201Service.fohcreate(map); | ||
72 | + }catch (Exception e){ | ||
73 | + e.printStackTrace(); | ||
74 | + return false; | ||
75 | + } | ||
76 | + | ||
77 | + } | ||
78 | + | ||
79 | + @RequestMapping("/4201create") | ||
80 | + public Boolean pffmcreate(@RequestBody Map<String, Object> map){ | ||
81 | + | ||
82 | + try { | ||
83 | + | ||
84 | + return mt4201Service.pffmcreate(map); | ||
85 | + }catch (Exception e){ | ||
86 | + e.printStackTrace(); | ||
87 | + return false; | ||
88 | + } | ||
89 | + | ||
90 | + } | ||
91 | + | ||
92 | +} |
1 | -package com.sunyo.wlpt.message.builder.controller; | ||
2 | - | ||
3 | -import org.springframework.web.bind.annotation.GetMapping; | ||
4 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
5 | -import org.springframework.web.bind.annotation.RestController; | ||
6 | - | ||
7 | - | ||
8 | -@RestController | ||
9 | -@RequestMapping(value = "/") | ||
10 | -public class IndexController { | ||
11 | - | ||
12 | - @GetMapping("index") | ||
13 | - public String index(){ | ||
14 | - return "11"; | ||
15 | -// return "数据仓库接收,落地报文给新舱单"; | ||
16 | - } | ||
17 | - | ||
18 | - | ||
19 | - | ||
20 | -} |
1 | -package com.sunyo.wlpt.message.builder.controller; | ||
2 | - | ||
3 | -import com.sunyo.wlpt.message.builder.util.CustomXmlMaker; | ||
4 | -import freemarker.template.Configuration; | ||
5 | -import org.springframework.beans.factory.annotation.Autowired; | ||
6 | -import org.springframework.web.bind.annotation.RequestBody; | ||
7 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
8 | -import org.springframework.web.bind.annotation.RestController; | ||
9 | - | ||
10 | -import java.util.Map; | ||
11 | - | ||
12 | -@RestController | ||
13 | -@RequestMapping("/mt1201") | ||
14 | -public class MT1201Controller extends CustomXmlMaker { | ||
15 | - | ||
16 | - private static String businessType = "MT1201"; | ||
17 | - | ||
18 | - @Autowired | ||
19 | - private Configuration freemakerTemplate; | ||
20 | - | ||
21 | - @RequestMapping("/send") | ||
22 | - public Boolean mt1201New(@RequestBody Map awb_manifest) throws Exception{ | ||
23 | - | ||
24 | - } | ||
25 | -} |
1 | -package com.sunyo.wlpt.message.builder.controller; | ||
2 | - | ||
3 | -import com.sunyo.wlpt.message.builder.model.CUSTOM_RESPONSE; | ||
4 | -import com.sunyo.wlpt.message.builder.util.CustomXmlMaker; | ||
5 | -import freemarker.template.Configuration; | ||
6 | -import org.springframework.beans.factory.annotation.Autowired; | ||
7 | -import org.springframework.web.bind.annotation.RequestBody; | ||
8 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
9 | -import org.springframework.web.bind.annotation.RestController; | ||
10 | - | ||
11 | -import java.util.Date; | ||
12 | -import java.util.Map; | ||
13 | - | ||
14 | -@RestController | ||
15 | -@RequestMapping("/mt2201") | ||
16 | -public class MT2201Controller extends CustomXmlMaker { | ||
17 | - | ||
18 | - @Autowired | ||
19 | - private Configuration freemakerTemplate; | ||
20 | - | ||
21 | - private static String businessType = "MT2201"; | ||
22 | - | ||
23 | - /** | ||
24 | - * MAP包含运单实体与舱单实体 | ||
25 | - * @param awb_manifest {awb:AWB_AWBINFO,man:} | ||
26 | - * @return | ||
27 | - * @throws Exception | ||
28 | - */ | ||
29 | - @RequestMapping("/send") | ||
30 | - public Boolean mt1201New(@RequestBody Map awb_manifest) throws Exception{ | ||
31 | - try { | ||
32 | - CUSTOM_RESPONSE response = new CUSTOM_RESPONSE(); | ||
33 | - response.setAwbano("17212345678"); | ||
34 | - response.setCusfunctioncode("2"); | ||
35 | - | ||
36 | - response.setCusreciverid("4604"); | ||
37 | - response.setCusversion("1.2"); | ||
38 | - response.setBusdate(new Date()); | ||
39 | - response.setBustype(businessType); | ||
40 | - | ||
41 | - String msgId = makeMsgID(businessType,"460470678920X","17212345678"); | ||
42 | - response.setCusmsgid(msgId); | ||
43 | - response.setCussenderid(makeSenderID("4604","460470678920X")); | ||
44 | - | ||
45 | - String filename = response.getCusmsgid()+".xml"; | ||
46 | - makeXmlToFile("/manifest/MT2201.ftlx",filename,awb_manifest); | ||
47 | - }catch (Exception e){ | ||
48 | - e.printStackTrace(); | ||
49 | - return false; | ||
50 | - } | ||
51 | - return true; | ||
52 | - } | ||
53 | -} |
1 | package com.sunyo.wlpt.message.builder.service; | 1 | package com.sunyo.wlpt.message.builder.service; |
2 | 2 | ||
3 | -import org.springframework.web.bind.annotation.RequestBody; | 3 | + |
4 | 4 | ||
5 | import java.util.Map; | 5 | import java.util.Map; |
6 | 6 | ||
7 | -public interface MakeXml1201Service { | ||
8 | - boolean makeXml1201_new(@RequestBody Map awb_manifest) throws Exception; | 7 | +public interface MT520XService { |
8 | + | ||
9 | + | ||
10 | + public Boolean create(Map<String, Object> map); | ||
11 | + | ||
9 | } | 12 | } |
1 | +package com.sunyo.wlpt.message.builder.service.imp; | ||
2 | + | ||
3 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
4 | +import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT3201; | ||
5 | +import com.sunyo.wlpt.message.builder.service.MT3201Service; | ||
6 | +import com.sunyo.wlpt.message.builder.util.CustomXmlMaker; | ||
7 | +import com.tianbo.util.Date.DateUtil; | ||
8 | +import org.springframework.stereotype.Service; | ||
9 | + | ||
10 | +import java.io.IOException; | ||
11 | +import java.util.HashMap; | ||
12 | +import java.util.Map; | ||
13 | + | ||
14 | +@Service | ||
15 | +public class MT3201ServiceImp extends CustomXmlMaker implements MT3201Service { | ||
16 | + | ||
17 | + | ||
18 | + | ||
19 | + @Override | ||
20 | + public Boolean fohcreate(Map<String, Object> map) throws IOException { | ||
21 | + | ||
22 | + ObjectMapper objectMapper = new ObjectMapper(); | ||
23 | + | ||
24 | + NMMS_CUSTOM_MT3201 customMt3201 = objectMapper.convertValue(map.get("mt3201"), NMMS_CUSTOM_MT3201.class); | ||
25 | + | ||
26 | + // 关区代码 | ||
27 | + String customCode = customMt3201.getCustomcode(); | ||
28 | + // 报文头时间 精确到毫秒 | ||
29 | + map.put("sendTime", DateUtil.getCurrentTime17()); | ||
30 | + // 封装实体 | ||
31 | + map.put("mt", customMt3201); | ||
32 | + | ||
33 | + // 生成报文头部 | ||
34 | + String msgId = makeMsgID("MT3201", "460470678920X", customMt3201.getAwba()); | ||
35 | + String msessageType = "MT3201"; | ||
36 | + String senderId = makeSenderID(customCode, "460470678920X", "DXPENT0000460002"); | ||
37 | + String receiverID = customCode; | ||
38 | + map.put("msgId", msgId); | ||
39 | + map.put("msessageType", msessageType); | ||
40 | + map.put("senderId", senderId); | ||
41 | + map.put("receiverID", receiverID); | ||
42 | + if (makeXmlToFile("/manifest/MT3201.ftlx", msgId+".xml", map)>0){ | ||
43 | + return true; | ||
44 | + }else { | ||
45 | + return false; | ||
46 | + } | ||
47 | + } | ||
48 | + | ||
49 | +} |
1 | +package com.sunyo.wlpt.message.builder.service.imp; | ||
2 | + | ||
3 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
4 | +import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT4201; | ||
5 | +import com.sunyo.wlpt.message.builder.service.MT4201Service; | ||
6 | +import com.sunyo.wlpt.message.builder.util.CustomXmlMaker; | ||
7 | +import com.tianbo.util.Date.DateUtil; | ||
8 | +import org.springframework.stereotype.Service; | ||
9 | + | ||
10 | +import java.io.IOException; | ||
11 | +import java.util.Map; | ||
12 | + | ||
13 | +@Service | ||
14 | +public class MT4201ServiceImp extends CustomXmlMaker implements MT4201Service { | ||
15 | + | ||
16 | + @Override | ||
17 | + public Boolean pffmcreate(Map<String, Object> map) throws IOException { | ||
18 | + | ||
19 | + | ||
20 | + ObjectMapper objectMapper = new ObjectMapper(); | ||
21 | + | ||
22 | + NMMS_CUSTOM_MT4201 customMt4201 = objectMapper.convertValue(map.get("mt4201"), NMMS_CUSTOM_MT4201.class); | ||
23 | + | ||
24 | + // 关区代码 | ||
25 | + String customCode = customMt4201.getCustomcode(); | ||
26 | + // 报文头时间 精确到毫秒 | ||
27 | + map.put("sendTime", DateUtil.getCurrentTime17()); | ||
28 | + // 封装实体 | ||
29 | + map.put("mt", customMt4201); | ||
30 | + | ||
31 | + // 生成报文头部 | ||
32 | + String msgId = makeMsgID("MT4201", "460470678920X", customMt4201.getAwba()); | ||
33 | + String msessageType = "MT4201"; | ||
34 | + String senderId = makeSenderID(customCode, "460470678920X", "DXPENT0000460002"); | ||
35 | + String receiverID = customCode; | ||
36 | + map.put("msgId", msgId); | ||
37 | + map.put("msessageType", msessageType); | ||
38 | + map.put("senderId", senderId); | ||
39 | + map.put("receiverID", receiverID); | ||
40 | + if (makeXmlToFile("/manifest/MT4201.ftlx", msgId+".xml", map)>0){ | ||
41 | + return true; | ||
42 | + }else { | ||
43 | + return false; | ||
44 | + } | ||
45 | + } | ||
46 | +} |
1 | +package com.sunyo.wlpt.message.builder.service.imp; | ||
2 | + | ||
3 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
4 | +import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT520X; | ||
5 | +import com.sunyo.wlpt.message.builder.service.MT520XService; | ||
6 | +import com.sunyo.wlpt.message.builder.util.CustomXmlMaker; | ||
7 | +import com.tianbo.util.Date.DateUtil; | ||
8 | +import org.springframework.stereotype.Service; | ||
9 | + | ||
10 | +import java.io.IOException; | ||
11 | +import java.util.HashMap; | ||
12 | +import java.util.Map; | ||
13 | + | ||
14 | +@Service | ||
15 | +public class MT520XServiceImp extends CustomXmlMaker implements MT520XService{ | ||
16 | + | ||
17 | + | ||
18 | + @Override | ||
19 | + public Boolean create(Map<String, Object> map) { | ||
20 | + | ||
21 | + try { | ||
22 | + | ||
23 | + ObjectMapper objectMapper = new ObjectMapper(); | ||
24 | + | ||
25 | + NMMS_CUSTOM_MT520X customMt520X = objectMapper.convertValue(map.get("mt520x"), NMMS_CUSTOM_MT520X.class); | ||
26 | + | ||
27 | + Map<String, Object> hashMap = new HashMap(); | ||
28 | + | ||
29 | + // 关区代码 | ||
30 | + String customCode = customMt520X.getCustomcode(); | ||
31 | + // 报文头时间 精确到毫秒 | ||
32 | + hashMap.put("sendTime", DateUtil.getCurrentTime17()); | ||
33 | + // 封装实体 | ||
34 | + hashMap.put("mt", customMt520X); | ||
35 | + if ("5201".equals(customMt520X.getExt1())){ | ||
36 | + | ||
37 | + // 生成报文头部 | ||
38 | + String msgId = makeMsgID("MT5201", "460470678920X", customMt520X.getAwba()); | ||
39 | + String msessageType = "MT5201"; | ||
40 | + String senderId = makeSenderID(customCode, "460470678920X", "DXPENT0000460002"); | ||
41 | + String receiverID = customCode; | ||
42 | + hashMap.put("msgId", msgId); | ||
43 | + hashMap.put("msessageType", msessageType); | ||
44 | + hashMap.put("senderId", senderId); | ||
45 | + hashMap.put("receiverID", receiverID); | ||
46 | + if (makeXmlToFile("/manifest/MT5201.ftlx", msgId+".xml", hashMap)>0){ | ||
47 | + return true; | ||
48 | + }else { | ||
49 | + return false; | ||
50 | + } | ||
51 | + }else { | ||
52 | + | ||
53 | + // 生成报文头部 | ||
54 | + String msgId = makeMsgID("MT5202", "460470678920X", customMt520X.getAwba()); | ||
55 | + String msessageType = "MT5202"; | ||
56 | + String senderId = makeSenderID(customCode, "460470678920X", "DXPENT0000460002"); | ||
57 | + String receiverID = customCode; | ||
58 | + hashMap.put("msgId", msgId); | ||
59 | + hashMap.put("msessageType", msessageType); | ||
60 | + hashMap.put("senderId", senderId); | ||
61 | + hashMap.put("receiverID", receiverID); | ||
62 | + if (makeXmlToFile("/manifest/MT5202.ftlx", msgId+".xml", hashMap)>0){ | ||
63 | + return true; | ||
64 | + }else { | ||
65 | + return false; | ||
66 | + } | ||
67 | + } | ||
68 | + }catch (Exception e){ | ||
69 | + | ||
70 | + e.printStackTrace(); | ||
71 | + return false; | ||
72 | + } | ||
73 | + } | ||
74 | +} |
1 | -package com.sunyo.wlpt.message.builder.service.imp; | ||
2 | - | ||
3 | -import com.sunyo.wlpt.base.model.AWB_AWBINFO; | ||
4 | -import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT1201; | ||
5 | -import com.sunyo.wlpt.base.model.NMMS_CUSTOM_RESPONSE; | ||
6 | -import com.sunyo.wlpt.message.builder.model.CUSTOM_RESPONSE; | ||
7 | -import com.sunyo.wlpt.message.builder.service.MakeXml1201Service; | ||
8 | -import com.sunyo.wlpt.message.builder.util.CustomXmlMaker; | ||
9 | -import freemarker.template.Configuration; | ||
10 | -import org.springframework.beans.factory.annotation.Autowired; | ||
11 | -import org.springframework.web.bind.annotation.RequestBody; | ||
12 | - | ||
13 | -import java.util.Date; | ||
14 | -import java.util.HashMap; | ||
15 | -import java.util.Map; | ||
16 | - | ||
17 | -public class MakeXml1201ServiceImp extends CustomXmlMaker implements MakeXml1201Service { | ||
18 | - | ||
19 | - private static String businessType = "MT1201"; | ||
20 | - | ||
21 | - @Autowired | ||
22 | - private Configuration freemakerTemplate; | ||
23 | - | ||
24 | - | ||
25 | - /** | ||
26 | - * MAP包含运单实体与舱单实体 | ||
27 | - * @param awb_manifest {awb:AWB_AWBINFO,man:NMMS_CUSTOM_MT1201} | ||
28 | - * @return | ||
29 | - * @throws Exception | ||
30 | - */ | ||
31 | - @Override | ||
32 | - public boolean makeXml1201_new(@RequestBody Map awb_manifest) throws Exception{ | ||
33 | - try { | ||
34 | - NMMS_CUSTOM_MT1201 mt1201 = new NMMS_CUSTOM_MT1201(); | ||
35 | - AWB_AWBINFO awb = new AWB_AWBINFO(); | ||
36 | - NMMS_CUSTOM_RESPONSE customResponse = new NMMS_CUSTOM_RESPONSE(); | ||
37 | - Map<String,Object> xmlmap = new HashMap<>(); | ||
38 | - xmlmap.put("awb",awb); | ||
39 | - xmlmap.put("man",mt1201); | ||
40 | - xmlmap.put("res",customResponse); | ||
41 | - | ||
42 | - mt1201.setAwba("17212345678"); | ||
43 | - mt1201.setCarrier("CV"); | ||
44 | - mt1201.setCustomcode("4604"); | ||
45 | - mt1201.setFlightno("9733"); | ||
46 | - mt1201.setFlightdate(new Date()); | ||
47 | - mt1201.setDestinationstation("CGO"); | ||
48 | - | ||
49 | - String msgId = makeMsgID(businessType,"460470678920X","17212345678"); | ||
50 | - makeXmlToFile("/manifest/MT2201.ftlx",filename,awb_manifest); | ||
51 | - }catch (Exception e){ | ||
52 | - e.printStackTrace(); | ||
53 | - return false; | ||
54 | - } | ||
55 | - return true; | ||
56 | - } | ||
57 | -} |
@@ -12,7 +12,6 @@ import org.springframework.ui.freemarker.FreeMarkerTemplateUtils; | @@ -12,7 +12,6 @@ import org.springframework.ui.freemarker.FreeMarkerTemplateUtils; | ||
12 | 12 | ||
13 | import java.io.File; | 13 | import java.io.File; |
14 | import java.io.IOException; | 14 | import java.io.IOException; |
15 | -import java.util.Map; | ||
16 | 15 | ||
17 | @Component | 16 | @Component |
18 | public class CustomXmlMaker { | 17 | public class CustomXmlMaker { |
@@ -25,6 +24,12 @@ public class CustomXmlMaker { | @@ -25,6 +24,12 @@ public class CustomXmlMaker { | ||
25 | @Value("${tcs.mq-number}") | 24 | @Value("${tcs.mq-number}") |
26 | private static String TCSMQNumber; | 25 | private static String TCSMQNumber; |
27 | 26 | ||
27 | + public CustomXmlMaker() { | ||
28 | + if (freemakerTemplate==null){ | ||
29 | + this.freemakerTemplate = new Configuration(); | ||
30 | + } | ||
31 | + } | ||
32 | + | ||
28 | /** | 33 | /** |
29 | * 所有填制项中不得出现“<”、“&”符号,如有实际需要,请填写对应的转义符“<”、“&”。 | 34 | * 所有填制项中不得出现“<”、“&”符号,如有实际需要,请填写对应的转义符“<”、“&”。 |
30 | 十、报文中不允许出现空节点,如<Consignee></Consignee>或<Consignee/>。 | 35 | 十、报文中不允许出现空节点,如<Consignee></Consignee>或<Consignee/>。 |
@@ -34,7 +39,7 @@ public class CustomXmlMaker { | @@ -34,7 +39,7 @@ public class CustomXmlMaker { | ||
34 | * @return 0失败,1成功 | 39 | * @return 0失败,1成功 |
35 | * @throws IOException | 40 | * @throws IOException |
36 | */ | 41 | */ |
37 | - public int makeXmlToFile(String tplName,String fileName,Map manifestMap) throws IOException{ | 42 | + public int makeXmlToFile(String tplName,String fileName,Object manifestMap) throws IOException{ |
38 | try { | 43 | try { |
39 | Template template = freemakerTemplate.getTemplate(tplName); | 44 | Template template = freemakerTemplate.getTemplate(tplName); |
40 | String content = FreeMarkerTemplateUtils.processTemplateIntoString(template,manifestMap); | 45 | String content = FreeMarkerTemplateUtils.processTemplateIntoString(template,manifestMap); |
1 | +package com.sunyo.wlpt.message.builder.util; | ||
2 | +import org.springframework.beans.BeansException; | ||
3 | +import org.springframework.context.ApplicationContext; | ||
4 | +import org.springframework.context.ApplicationContextAware; | ||
5 | +import org.springframework.stereotype.Component; | ||
6 | + | ||
7 | +/** | ||
8 | + * @ProjectName: | ||
9 | + * @Package: com.backstage.config | ||
10 | + * @ClassName: ApplicationContextProvider | ||
11 | + * @Description: 获取bean对象的工具类 | ||
12 | + * @Author: wangzhilong | ||
13 | + * @CreateDate: 2018/8/31 13:26 | ||
14 | + * @Version: 1.0 | ||
15 | + */ | ||
16 | + | ||
17 | +/** | ||
18 | + * Author:ZhuShangJin | ||
19 | + * Date:2018/7/3 | ||
20 | + */ | ||
21 | +@Component | ||
22 | +public class SpringBeanUtitl implements ApplicationContextAware{ | ||
23 | + | ||
24 | + private static ApplicationContext applicationContext = null; | ||
25 | + @Override | ||
26 | + public void setApplicationContext(ApplicationContext applicationContext) throws | ||
27 | + BeansException { | ||
28 | + // TODO Auto-generated method stub | ||
29 | + SpringBeanUtitl.applicationContext = applicationContext; | ||
30 | + } | ||
31 | + | ||
32 | + /** | ||
33 | + * 从静态变量applicationContext中得到Bean, 自动转型为所赋值对象的类型. | ||
34 | + */ | ||
35 | + @SuppressWarnings("unchecked") | ||
36 | + public static <T> T getBean(String name) { | ||
37 | + if(name == null || applicationContext == null){ | ||
38 | + return null; | ||
39 | + } | ||
40 | + | ||
41 | + return (T) applicationContext.getBean(name); | ||
42 | + } | ||
43 | + | ||
44 | + /** | ||
45 | + * 从静态变量applicationContext中得到Bean, 自动转型为所赋值对象的类型. | ||
46 | + */ | ||
47 | + public static <T> T getBean(Class<T> clazz) { | ||
48 | + return applicationContext.getBean(clazz); | ||
49 | + } | ||
50 | + | ||
51 | +} | ||
52 | + |
src/main/resources/templates/demo.ftlx
0 → 100644
1 | +<Manifest xmlns="urn:Declaration:datamodel:standard:CN:MT5202:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
2 | + <Head> | ||
3 | + <MessageID>${t.awba}</MessageID> | ||
4 | + <FunctionCode>${t.customeCode}</FunctionCode> | ||
5 | + <MessageType>MT5202</MessageType> | ||
6 | + <SenderID>460470678920X_DXPENT0000460002</SenderID> | ||
7 | + <ReceiverID>4620</ReceiverID> | ||
8 | + <SendTime>20190523103927763</SendTime> | ||
9 | + <Version>1.0</Version> | ||
10 | + </Head> | ||
11 | + <!--<Declaration>--> | ||
12 | + <!--<DeclarationOfficeID>4620</DeclarationOfficeID>--> | ||
13 | + <!--<BorderTransportMeans>--> | ||
14 | + <!--<JourneyID>CX051/20190523</JourneyID>--> | ||
15 | + <!--<TypeCode>4</TypeCode>--> | ||
16 | + <!--<ID>CX051</ID>--> | ||
17 | + <!--<Name>CX051</Name>--> | ||
18 | + <!--<ActualDateTime>201905230820086</ActualDateTime>--> | ||
19 | + <!--<CompletedDateTime>201905230835086</CompletedDateTime>--> | ||
20 | + <!--<LoadingLocation>--> | ||
21 | + <!--<ID>CGO/4620</ID>--> | ||
22 | + <!--</LoadingLocation>--> | ||
23 | + <!--</BorderTransportMeans>--> | ||
24 | + <!--<TallyParty>--> | ||
25 | + <!--<ID>70678920X</ID>--> | ||
26 | + <!--</TallyParty>--> | ||
27 | + <!--<Consignment>--> | ||
28 | + <!--<TransportContractDocument>--> | ||
29 | + <!--<ID>16006939951</ID>--> | ||
30 | + <!--</TransportContractDocument>--> | ||
31 | + <!--<AssociatedTransportDocument>--> | ||
32 | + <!--<ID>16006939951_TYN00072745</ID>--> | ||
33 | + <!--</AssociatedTransportDocument>--> | ||
34 | + <!--<ConsignmentPackaging>--> | ||
35 | + <!--<QuantityQuantity>1</QuantityQuantity>--> | ||
36 | + <!--</ConsignmentPackaging>--> | ||
37 | + <!--<TotalGrossMassMeasure>26</TotalGrossMassMeasure>--> | ||
38 | + <!--</Consignment>--> | ||
39 | + <!--</Declaration>--> | ||
40 | +</Manifest> |
1 | <Manifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:Declaration:datamodel:standard:CN:MT1201:1"> | 1 | <Manifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:Declaration:datamodel:standard:CN:MT1201:1"> |
2 | <Head> | 2 | <Head> |
3 | - <MessageID>CN_MT1201_1P0_460470678920X_20190918220458427</MessageID> | ||
4 | - <FunctionCode>9</FunctionCode> | ||
5 | - <MessageType>MT1201</MessageType> | ||
6 | - <SenderID>460470678920X_DXPENT0000460002</SenderID> | ||
7 | - <ReceiverID>4604</ReceiverID> | ||
8 | - <SendTime>20190918220458427</SendTime> | 3 | + <MessageID>${msgId}</MessageID> |
4 | + <FunctionCode>2</FunctionCode> | ||
5 | + <MessageType>${msessageType}</MessageType> | ||
6 | + <SenderID>${senderId}</SenderID> | ||
7 | + <ReceiverID>${receiverID}</ReceiverID> | ||
8 | + <SendTime>${sendTime}</SendTime> | ||
9 | <Version>1.0</Version> | 9 | <Version>1.0</Version> |
10 | </Head> | 10 | </Head> |
11 | <Declaration> | 11 | <Declaration> |
12 | <RepresentativePerson> | 12 | <RepresentativePerson> |
13 | - <Name>9141010070678920XJ</Name> | 13 | + <Name>???</Name> |
14 | </RepresentativePerson> | 14 | </RepresentativePerson> |
15 | <ExitCustomsOffice> | 15 | <ExitCustomsOffice> |
16 | - <ID>KUL</ID> | 16 | + <ID>${mt.originstation}</ID> |
17 | </ExitCustomsOffice> | 17 | </ExitCustomsOffice> |
18 | <Carrier> | 18 | <Carrier> |
19 | - <ID>CV</ID> | 19 | + <ID>${mt.carrier}</ID> |
20 | </Carrier> | 20 | </Carrier> |
21 | <BorderTransportMeans> | 21 | <BorderTransportMeans> |
22 | - <JourneyID>CV7303/20190919</JourneyID> | 22 | + <JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID> |
23 | <TypeCode>4</TypeCode> | 23 | <TypeCode>4</TypeCode> |
24 | - <FirstArrivalLocationID>CGO</FirstArrivalLocationID> | ||
25 | - <ArrivalDateTime>20190919010458086</ArrivalDateTime> | ||
26 | - <DepartureDateTime>20190918230458086</DepartureDateTime> | 24 | + <#if (mt.destinationstation)??> |
25 | + <FirstArrivalLocationID>${mt.destinationstation}</FirstArrivalLocationID> | ||
26 | + </#if> | ||
27 | + <ArrivalDateTime>${arrivaldate}</ArrivalDateTime><!--+2--> | ||
28 | + <DepartureDateTime>${departuredate}</DepartureDateTime><#--+1--> | ||
27 | </BorderTransportMeans> | 29 | </BorderTransportMeans> |
28 | <Consignment> | 30 | <Consignment> |
29 | <TransportContractDocument> | 31 | <TransportContractDocument> |
30 | - <ID>17236633273</ID> | ||
31 | - <ConditionCode>10</ConditionCode> | 32 | + <ID>${mt.awba}</ID> |
33 | + <#if conditioncode??> | ||
34 | + <ConditionCode>${conditioncode}</ConditionCode> | ||
35 | + </#if> | ||
32 | </TransportContractDocument> | 36 | </TransportContractDocument> |
33 | <LoadingLocation> | 37 | <LoadingLocation> |
34 | - <ID>KUL</ID> | 38 | + <ID>HKG</ID> |
35 | </LoadingLocation> | 39 | </LoadingLocation> |
36 | <UnloadingLocation> | 40 | <UnloadingLocation> |
37 | <ID>CGO/4604</ID> | 41 | <ID>CGO/4604</ID> |
38 | - <ArrivalDate>20190919</ArrivalDate> | 42 | + <ArrivalDate>20190523</ArrivalDate> |
39 | </UnloadingLocation> | 43 | </UnloadingLocation> |
40 | - <TransitDestination> | ||
41 | - <ID>CGN</ID> | ||
42 | - </TransitDestination> | ||
43 | - <CustomsStatusCode>002</CustomsStatusCode> | ||
44 | <TransportSplitIndicator>0</TransportSplitIndicator> | 44 | <TransportSplitIndicator>0</TransportSplitIndicator> |
45 | <FreightPayment> | 45 | <FreightPayment> |
46 | <MethodCode>PP</MethodCode> | 46 | <MethodCode>PP</MethodCode> |
47 | </FreightPayment> | 47 | </FreightPayment> |
48 | <ConsignmentPackaging> | 48 | <ConsignmentPackaging> |
49 | - <QuantityQuantity>3</QuantityQuantity> | 49 | + <QuantityQuantity>11</QuantityQuantity> |
50 | </ConsignmentPackaging> | 50 | </ConsignmentPackaging> |
51 | - <TotalGrossMassMeasure>24.0</TotalGrossMassMeasure> | 51 | + <TotalGrossMassMeasure>90</TotalGrossMassMeasure> |
52 | <Consignee> | 52 | <Consignee> |
53 | - <ID>8888+NONE</ID> | ||
54 | - <Name>SCHENKER DEUTSCHLAND AG</Name> | 53 | + <ID>USCI+NONE</ID> |
54 | + <Name>GUANGZHOU NANLAND</Name> | ||
55 | <Address> | 55 | <Address> |
56 | - <Line>NEUER WEYERSTRASSERWEG 120 122</Line> | 56 | + <Line>AIR CATERING CO LTD ZHENGZHOU BR</Line> |
57 | <CountryCode>CN</CountryCode> | 57 | <CountryCode>CN</CountryCode> |
58 | </Address> | 58 | </Address> |
59 | <Communication> | 59 | <Communication> |
60 | - <ID>00000000</ID> | 60 | + <ID>8637168518853</ID> |
61 | <TypeID>TE</TypeID> | 61 | <TypeID>TE</TypeID> |
62 | </Communication> | 62 | </Communication> |
63 | <Contact> | 63 | <Contact> |
64 | <Name>NONE</Name> | 64 | <Name>NONE</Name> |
65 | <Communication> | 65 | <Communication> |
66 | - <ID>00000000</ID> | 66 | + <ID>8637168518853</ID> |
67 | <TypeID>TE</TypeID> | 67 | <TypeID>TE</TypeID> |
68 | </Communication> | 68 | </Communication> |
69 | </Contact> | 69 | </Contact> |
70 | </Consignee> | 70 | </Consignee> |
71 | <Consignor> | 71 | <Consignor> |
72 | <ID>9999+NONE</ID> | 72 | <ID>9999+NONE</ID> |
73 | - <Name>SCHENKER LOGISTICS MALAYSIA SDN BHD</Name> | 73 | + <Name>CATHAY PACIFIC AIRWAYS LTD</Name> |
74 | <Address> | 74 | <Address> |
75 | - <Line>B 10 MAS FREIGHT FOWARDERS COMPLEX</Line> | ||
76 | - <CountryCode>MY</CountryCode> | 75 | + <Line>CX COMMERCIAL STORE HK INTL APT</Line> |
76 | + <CountryCode>HK</CountryCode> | ||
77 | </Address> | 77 | </Address> |
78 | <Communication> | 78 | <Communication> |
79 | - <ID>60387757888</ID> | 79 | + <ID>85227471779KLWONG</ID> |
80 | <TypeID>TE</TypeID> | 80 | <TypeID>TE</TypeID> |
81 | </Communication> | 81 | </Communication> |
82 | </Consignor> | 82 | </Consignor> |
83 | <ConsignmentItem> | 83 | <ConsignmentItem> |
84 | <SequenceNumeric>1</SequenceNumeric> | 84 | <SequenceNumeric>1</SequenceNumeric> |
85 | <ConsignmentItemPackaging> | 85 | <ConsignmentItemPackaging> |
86 | - <QuantityQuantity>3</QuantityQuantity> | 86 | + <QuantityQuantity>11</QuantityQuantity> |
87 | </ConsignmentItemPackaging> | 87 | </ConsignmentItemPackaging> |
88 | <Commodity> | 88 | <Commodity> |
89 | - <CargoDescription>CONSOL</CargoDescription> | 89 | + <CargoDescription>CATERING SUPPLIES/B</CargoDescription> |
90 | </Commodity> | 90 | </Commodity> |
91 | <GoodsMeasure> | 91 | <GoodsMeasure> |
92 | - <GrossMassMeasure>24</GrossMassMeasure> | 92 | + <GrossMassMeasure>90</GrossMassMeasure> |
93 | </GoodsMeasure> | 93 | </GoodsMeasure> |
94 | </ConsignmentItem> | 94 | </ConsignmentItem> |
95 | </Consignment> | 95 | </Consignment> |
1 | -<Manifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:Declaration:datamodel:standard:CN:MT1201:1"> | ||
2 | - <Head> | ||
3 | - <MessageID>${cusmsgid}</MessageID> | ||
4 | - <FunctionCode>${cusfunctioncode}</FunctionCode> | ||
5 | - <MessageType>${bustype}</MessageType> | ||
6 | - <SenderID>${cussenderid}</SenderID> | ||
7 | - <ReceiverID>${cusreciverid}</ReceiverID> | ||
8 | - <SendTime>${busdate?string('ddMMyyyyHHmmssSSS')}</SendTime> | ||
9 | - <Version>${cusversion}</Version> | ||
10 | - </Head> | ||
11 | -</Manifest> |
1 | +<Manifest xmlns="urn:Declaration:datamodel:standard:CN:MT3201:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
2 | + <Head> | ||
3 | + <MessageID>${msgId}</MessageID> | ||
4 | + <FunctionCode>2</FunctionCode> | ||
5 | + <MessageType>${msessageType}</MessageType> | ||
6 | + <SenderID>${senderId}</SenderID> | ||
7 | + <ReceiverID>${receiverID}</ReceiverID> | ||
8 | + <SendTime>${sendTime}</SendTime> | ||
9 | + <Version>1.0</Version> | ||
10 | + </Head> | ||
11 | + <Declaration> | ||
12 | + <DeclarationOfficeID>${mt.customcode}</DeclarationOfficeID> | ||
13 | + <BorderTransportMeans> | ||
14 | + <JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID> | ||
15 | + <TypeCode>4</TypeCode> | ||
16 | + <ID>${mt.carrier}${mt.flightno}</ID> | ||
17 | + <Name>${mt.carrier}${mt.flightno}</Name> | ||
18 | + </BorderTransportMeans> | ||
19 | + <UnloadingLocation> | ||
20 | + <ID>${mt.destinationstation}/${mt.customcode}</ID> | ||
21 | + <ArrivalDate>${mt.arrivetime?string('yyyyMMdd')}</ArrivalDate> | ||
22 | + </UnloadingLocation> | ||
23 | + <Consignment> | ||
24 | + <TransportContractDocument> | ||
25 | + <ID>${mt.awba}<#if (mt.awbh)??>_${mt.awbh}</#if></ID> | ||
26 | + </TransportContractDocument> | ||
27 | + <ConsignmentPackaging> | ||
28 | + <QuantityQuantity>${mt.piece}</QuantityQuantity> | ||
29 | + </ConsignmentPackaging> | ||
30 | + <TotalGrossMassMeasure>${mt.weight}</TotalGrossMassMeasure> | ||
31 | + <ConsignmentItem> | ||
32 | + <SequenceNumeric>${sequencenumeric}</SequenceNumeric> | ||
33 | + <Commodity> | ||
34 | + <CargoDescription>${mt.goodsname}</CargoDescription> | ||
35 | + </Commodity> | ||
36 | + </ConsignmentItem> | ||
37 | + </Consignment> | ||
38 | + </Declaration> | ||
39 | +</Manifest> |
1 | +<Manifest xmlns="urn:Declaration:datamodel:standard:CN:MT4201:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
2 | + <Head> | ||
3 | + <MessageID>${msgId}</MessageID> | ||
4 | + <FunctionCode>2</FunctionCode> | ||
5 | + <MessageType>${msessageType}</MessageType> | ||
6 | + <SenderID>${senderId}</SenderID> | ||
7 | + <ReceiverID>${receiverID}</ReceiverID> | ||
8 | + <SendTime>${sendTime}</SendTime> | ||
9 | + <Version>1.0</Version> | ||
10 | + </Head> | ||
11 | + <Declaration> | ||
12 | + <Carrier> | ||
13 | + <ID>${mt.carrier}</ID> | ||
14 | + </Carrier> | ||
15 | + <BorderTransportMeans> | ||
16 | + <JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID> | ||
17 | + <TypeCode>4</TypeCode> | ||
18 | + <ID>${mt.carrier}${mt.flightno}</ID> | ||
19 | + <Name>${mt.carrier}${mt.flightno}</Name> | ||
20 | + </BorderTransportMeans> | ||
21 | + <Consignment> | ||
22 | + <TransportContractDocument> | ||
23 | + <ID>${mt.awba}</ID> | ||
24 | + </TransportContractDocument> | ||
25 | + <LoadingLocation> | ||
26 | + <ID>${mt.destinationstation}/${mt.customcode}</ID> | ||
27 | + <LoadingDate>${mt.loadingtime?string('yyyyMMddHHmmssSSS')}</LoadingDate> | ||
28 | + </LoadingLocation> | ||
29 | + <ConsignmentPackaging> | ||
30 | + <QuantityQuantity>${mt.lodingpiece}</QuantityQuantity> | ||
31 | + </ConsignmentPackaging> | ||
32 | + <TotalGrossMassMeasure>${mt.lodingweight}</TotalGrossMassMeasure> | ||
33 | + <TransportSplitIndicator>???<#--0整皮 1分批--></TransportSplitIndicator> | ||
34 | + <ConsignmentItem> | ||
35 | + <Commodity> | ||
36 | + <CargoDescription>${mt.goodsname}</CargoDescription> | ||
37 | + </Commodity> | ||
38 | + </ConsignmentItem> | ||
39 | + </Consignment> | ||
40 | + </Declaration> | ||
41 | +</Manifest> |
1 | +<Manifest xmlns="urn:Declaration:datamodel:standard:CN:MT5201:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
2 | + <Head> | ||
3 | + <MessageID>${msgId}</MessageID> | ||
4 | + <FunctionCode>2</FunctionCode> | ||
5 | + <MessageType>${msessageType}</MessageType> | ||
6 | + <SenderID>${senderId}</SenderID> | ||
7 | + <ReceiverID>${receiverID}</ReceiverID> | ||
8 | + <SendTime>${sendTime}</SendTime> | ||
9 | + <Version>1.0</Version> | ||
10 | + </Head> | ||
11 | + <Declaration> | ||
12 | + <DeclarationOfficeID>${mt.customcode}</DeclarationOfficeID> | ||
13 | + <BorderTransportMeans> | ||
14 | + <JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID> | ||
15 | + <TypeCode>4</TypeCode> | ||
16 | + <ID>${mt.carrier}${mt.flightno}</ID> | ||
17 | + <Name>${mt.carrier}${mt.flightno}</Name> | ||
18 | + <ActualDateTime>${mt.starttime?string('yyyyMMddHHmmssSSS')}</ActualDateTime> | ||
19 | + <CompletedDateTime>${mt.endtime?string('yyyyMMddHHmmssSSS')}</CompletedDateTime> | ||
20 | + <UnloadingLocation> | ||
21 | + <ID>${mt.destinationstation}/${mt.customcode}</ID> | ||
22 | + </UnloadingLocation> | ||
23 | + </BorderTransportMeans> | ||
24 | + <TallyParty> | ||
25 | + <ID>???</ID> | ||
26 | + </TallyParty> | ||
27 | + <Consignment> | ||
28 | + <TransportContractDocument> | ||
29 | + <ID>${mt.awba}</ID> | ||
30 | + </TransportContractDocument> | ||
31 | + <AssociatedTransportDocument> | ||
32 | + <ID>${mt.awba}_${mt.awbh}</ID> | ||
33 | + </AssociatedTransportDocument> | ||
34 | + <ConsignmentPackaging> | ||
35 | + <QuantityQuantity>${mt.piece}</QuantityQuantity> | ||
36 | + </ConsignmentPackaging> | ||
37 | + <TotalGrossMassMeasure>${mt.weight}</TotalGrossMassMeasure> | ||
38 | + </Consignment> | ||
39 | + </Declaration> | ||
40 | +</Manifest> |
1 | +<Manifest xmlns="urn:Declaration:datamodel:standard:CN:MT5202:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
2 | + <Head> | ||
3 | + <MessageID>${msgId}</MessageID> | ||
4 | + <FunctionCode>2</FunctionCode> | ||
5 | + <MessageType>${msessageType}</MessageType> | ||
6 | + <SenderID>${senderId}</SenderID> | ||
7 | + <ReceiverID>${receiverID}</ReceiverID> | ||
8 | + <SendTime>${sendTime}</SendTime> | ||
9 | + <Version>1.0</Version> | ||
10 | + </Head> | ||
11 | + <Declaration> | ||
12 | + <DeclarationOfficeID>${mt.customcode}</DeclarationOfficeID> | ||
13 | + <BorderTransportMeans> | ||
14 | + <JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID> | ||
15 | + <TypeCode>4</TypeCode> | ||
16 | + <ID>${mt.carrier}${mt.flightno}</ID> | ||
17 | + <Name>${mt.carrier}${mt.flightno}</Name> | ||
18 | + <ActualDateTime>${mt.starttime?string('yyyyMMddHHmmssSSS')}</ActualDateTime> | ||
19 | + <CompletedDateTime>${mt.endtime?string('yyyyMMddHHmmssSSS')}</CompletedDateTime> | ||
20 | + <LoadingLocation> | ||
21 | + <ID>${mt.originstation}/${mt.customcode}</ID> | ||
22 | + </LoadingLocation> | ||
23 | + </BorderTransportMeans> | ||
24 | + <TallyParty> | ||
25 | + <ID>???</ID> | ||
26 | + </TallyParty> | ||
27 | + <Consignment> | ||
28 | + <TransportContractDocument> | ||
29 | + <ID>${mt.awba}</ID> | ||
30 | + </TransportContractDocument> | ||
31 | + <AssociatedTransportDocument> | ||
32 | + <ID>${mt.awba}_${mt.awbh}</ID> | ||
33 | + </AssociatedTransportDocument> | ||
34 | + <ConsignmentPackaging> | ||
35 | + <QuantityQuantity>${mt.piece}</QuantityQuantity> | ||
36 | + </ConsignmentPackaging> | ||
37 | + <TotalGrossMassMeasure>${mt.weight}</TotalGrossMassMeasure> | ||
38 | + </Consignment> | ||
39 | + </Declaration> | ||
40 | +</Manifest> |
1 | +<Manifest xmlns="urn:Declaration:datamodel:standard:CN:MT6202:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
2 | + <Head> | ||
3 | + <MessageID>${msgId}</MessageID> | ||
4 | + <FunctionCode>2</FunctionCode> | ||
5 | + <MessageType>${msessageType}</MessageType> | ||
6 | + <SenderID>${senderId}</SenderID> | ||
7 | + <ReceiverID>${receiverID}</ReceiverID> | ||
8 | + <SendTime>${sendTime}</SendTime> | ||
9 | + <Version>1.0</Version> | ||
10 | + </Head> | ||
11 | + <Declaration> | ||
12 | + <BorderTransportMeans> | ||
13 | + <JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID> | ||
14 | + <TypeCode>4</TypeCode> | ||
15 | + <CargoFacilityLocation>${mt.turnunloading}/${mt.customcode}</CargoFacilityLocation> | ||
16 | + <UnloadingLocation> | ||
17 | + <ID>${destinationstation}/4620</ID> | ||
18 | + </UnloadingLocation> | ||
19 | + </BorderTransportMeans> | ||
20 | + <Consignment> | ||
21 | + <TransportContractDocument> | ||
22 | + <ID>${mt.awba}</ID> | ||
23 | + </TransportContractDocument> | ||
24 | + <ConsignmentPackaging> | ||
25 | + <QuantityQuantity>${mt.turnpiece}</QuantityQuantity> | ||
26 | + </ConsignmentPackaging> | ||
27 | + <TotalGrossMassMeasure>${mt.turnweight}</TotalGrossMassMeasure> | ||
28 | + <BorderTransportMeans> | ||
29 | + <JourneyID>${mt.carrier}${mt.flightno}</JourneyID> | ||
30 | + <TypeCode>3</TypeCode> | ||
31 | + <Carrier> | ||
32 | + <Name>${mt.carrier}</Name> | ||
33 | + </Carrier> | ||
34 | + </BorderTransportMeans> | ||
35 | + </Consignment> | ||
36 | + </Declaration> | ||
37 | +</Manifest> |
-
请 注册 或 登录 后发表评论