作者 shenhailong

生成报文 。。。。。。。。。。

正在显示 23 个修改的文件 包含 364 行增加33 行删除
@@ -20,14 +20,14 @@ public class MT1201Controller { @@ -20,14 +20,14 @@ public class MT1201Controller {
20 */ 20 */
21 @RequestMapping("/createMt1201") 21 @RequestMapping("/createMt1201")
22 @ResponseBody 22 @ResponseBody
23 - public int ffmcreate(@RequestBody Map<String, Object> map){ 23 + public Map<String, Object> ffmcreate(@RequestBody Map<String, Object> map){
24 24
25 try { 25 try {
26 26
27 return mt1201Service.ffmcreate(map); 27 return mt1201Service.ffmcreate(map);
28 }catch (Exception e){ 28 }catch (Exception e){
29 e.printStackTrace(); 29 e.printStackTrace();
30 - return 0; 30 + return null;
31 } 31 }
32 } 32 }
33 33
@@ -39,28 +39,28 @@ public class MT1201Controller { @@ -39,28 +39,28 @@ public class MT1201Controller {
39 */ 39 */
40 @PutMapping("/editMt1201") 40 @PutMapping("/editMt1201")
41 @ResponseBody 41 @ResponseBody
42 - public int editMt1201(@RequestBody Map<String, Object> map){ 42 + public Map<String, Object> editMt1201(@RequestBody Map<String, Object> map){
43 43
44 try { 44 try {
45 45
46 return mt1201Service.editMt1201(map); 46 return mt1201Service.editMt1201(map);
47 }catch (Exception e){ 47 }catch (Exception e){
48 e.printStackTrace(); 48 e.printStackTrace();
49 - return 0; 49 + return null;
50 } 50 }
51 } 51 }
52 52
53 53
54 @PutMapping("/removeMt1201") 54 @PutMapping("/removeMt1201")
55 @ResponseBody 55 @ResponseBody
56 - public int removeMt1201(@RequestBody Map<String, Object> map){ 56 + public Map<String, Object> removeMt1201(@RequestBody Map<String, Object> map){
57 57
58 try { 58 try {
59 59
60 return mt1201Service.removeMt1201(map); 60 return mt1201Service.removeMt1201(map);
61 }catch (Exception e){ 61 }catch (Exception e){
62 e.printStackTrace(); 62 e.printStackTrace();
63 - return 0; 63 + return null;
64 } 64 }
65 } 65 }
66 66
  1 +package com.sunyo.wlpt.message.builder.controller;
  2 +
  3 +import com.sunyo.wlpt.message.builder.service.MT3202Service;
  4 +import org.springframework.beans.factory.annotation.Autowired;
  5 +import org.springframework.web.bind.annotation.*;
  6 +
  7 +import java.util.Map;
  8 +
  9 +@RestController
  10 +@RequestMapping(value = "/mt3202")
  11 +public class MT3202Controller {
  12 +
  13 + @Autowired
  14 + private MT3202Service mt3202Service;
  15 +
  16 + @PostMapping("/createMt3202")
  17 + @ResponseBody
  18 + public Map<String, Object> createMt3201(@RequestBody Map<String, Object> map){
  19 +
  20 + try {
  21 +
  22 + return mt3202Service.createMt3202(map);
  23 + }catch (Exception e){
  24 + e.printStackTrace();
  25 + return null;
  26 + }
  27 +
  28 + }
  29 +
  30 + @PutMapping("/removeMt3202")
  31 + @ResponseBody
  32 + public Map<String, Object> remove(@RequestBody Map<String, Object> map){
  33 +
  34 + try {
  35 +
  36 + return mt3202Service.removeMt3202(map);
  37 + }catch (Exception e){
  38 + e.printStackTrace();
  39 + return null;
  40 + }
  41 +
  42 + }
  43 +
  44 +}
@@ -20,7 +20,7 @@ public class MT520XController { @@ -20,7 +20,7 @@ public class MT520XController {
20 * @param map 20 * @param map
21 * @return 21 * @return
22 */ 22 */
23 - @RequestMapping("/createMt520x") 23 + @PostMapping("/createMt520x")
24 @ResponseBody 24 @ResponseBody
25 public Map<String, Object> create(@RequestBody Map<String, Object> map){ 25 public Map<String, Object> create(@RequestBody Map<String, Object> map){
26 26
@@ -15,7 +15,7 @@ public class MT6202Controller { @@ -15,7 +15,7 @@ public class MT6202Controller {
15 @Autowired 15 @Autowired
16 private MT6202Service mt6202Service; 16 private MT6202Service mt6202Service;
17 17
18 - @PostMapping(value = "/creatMt6202") 18 + @PostMapping(value = "/createMt6202")
19 @ResponseBody 19 @ResponseBody
20 public Map<String, Object> creatMt8205(@RequestBody Map<String, Object> map) throws IOException, ParseException { 20 public Map<String, Object> creatMt8205(@RequestBody Map<String, Object> map) throws IOException, ParseException {
21 21
1 package com.sunyo.wlpt.message.builder.service; 1 package com.sunyo.wlpt.message.builder.service;
2 2
3 import java.io.IOException; 3 import java.io.IOException;
  4 +import java.text.ParseException;
4 import java.util.Map; 5 import java.util.Map;
5 6
6 public interface MT1201Service { 7 public interface MT1201Service {
7 8
8 9
9 - int ffmcreate (Map<String, Object> map) throws IOException; 10 + Map<String, Object> ffmcreate (Map<String, Object> map) throws IOException, ParseException;
10 11
11 - int editMt1201 (Map<String, Object> map) throws IOException; 12 + Map<String, Object> editMt1201 (Map<String, Object> map) throws IOException, ParseException;
12 13
13 - int removeMt1201 (Map<String, Object> map) throws IOException; 14 + Map<String, Object> removeMt1201 (Map<String, Object> map) throws IOException, ParseException;
14 15
15 } 16 }
  1 +package com.sunyo.wlpt.message.builder.service;
  2 +
  3 +import java.io.IOException;
  4 +import java.text.ParseException;
  5 +import java.util.Map;
  6 +
  7 +public interface MT3202Service {
  8 +
  9 + Map<String, Object> createMt3202(Map<String, Object> map) throws ParseException, IOException;
  10 +
  11 + Map<String, Object> removeMt3202(Map<String, Object> map) throws IOException, ParseException;
  12 +
  13 +}
  1 +package com.sunyo.wlpt.message.builder.service;
  2 +
  3 +import java.io.IOException;
  4 +import java.text.ParseException;
  5 +import java.util.Map;
  6 +
  7 +public interface MT6202Service {
  8 +
  9 + Map<String, Object> creatMt6202(Map<String, Object> map) throws IOException, ParseException;
  10 +
  11 + Map<String, Object> removeMt6202(Map<String, Object> map) throws IOException, ParseException;
  12 +
  13 +}
1 package com.sunyo.wlpt.message.builder.service; 1 package com.sunyo.wlpt.message.builder.service;
2 2
3 import java.io.IOException; 3 import java.io.IOException;
  4 +import java.text.ParseException;
4 import java.util.Map; 5 import java.util.Map;
5 6
6 public interface MT8205Service { 7 public interface MT8205Service {
7 8
8 - Boolean create8205(Map<String, Object> map) throws IOException; 9 + Map<String, Object> create8205(Map<String, Object> map) throws IOException, ParseException;
9 10
10 } 11 }
@@ -3,13 +3,17 @@ package com.sunyo.wlpt.message.builder.service.imp; @@ -3,13 +3,17 @@ package com.sunyo.wlpt.message.builder.service.imp;
3 import com.fasterxml.jackson.databind.ObjectMapper; 3 import com.fasterxml.jackson.databind.ObjectMapper;
4 import com.sunyo.wlpt.base.model.AWB_AWBINFO; 4 import com.sunyo.wlpt.base.model.AWB_AWBINFO;
5 import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT1201; 5 import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT1201;
  6 +import com.sunyo.wlpt.base.model.NMMS_CUSTOM_RESPONSE;
6 import com.sunyo.wlpt.message.builder.service.MT1201Service; 7 import com.sunyo.wlpt.message.builder.service.MT1201Service;
7 import com.sunyo.wlpt.message.builder.util.CustomXmlMaker; 8 import com.sunyo.wlpt.message.builder.util.CustomXmlMaker;
  9 +import com.sunyo.wlpt.message.builder.util.ReturnUtil;
8 import com.tianbo.util.Date.DateUtil; 10 import com.tianbo.util.Date.DateUtil;
9 import org.springframework.beans.factory.annotation.Value; 11 import org.springframework.beans.factory.annotation.Value;
10 import org.springframework.stereotype.Service; 12 import org.springframework.stereotype.Service;
11 13
12 import java.io.IOException; 14 import java.io.IOException;
  15 +import java.text.ParseException;
  16 +import java.util.Date;
13 import java.util.HashMap; 17 import java.util.HashMap;
14 import java.util.Map; 18 import java.util.Map;
15 19
@@ -23,7 +27,7 @@ public class MT1201ServiceImp extends CustomXmlMaker implements MT1201Service{ @@ -23,7 +27,7 @@ public class MT1201ServiceImp extends CustomXmlMaker implements MT1201Service{
23 private String orgCode; 27 private String orgCode;
24 28
25 @Override 29 @Override
26 - public int ffmcreate(Map<String, Object> map) throws IOException { 30 + public Map<String, Object> ffmcreate(Map<String, Object> map) throws IOException, ParseException {
27 31
28 map.put("templatePath", "/manifest/MT1201.ftlx"); 32 map.put("templatePath", "/manifest/MT1201.ftlx");
29 map.put("sendPath", "./send/add/"); 33 map.put("sendPath", "./send/add/");
@@ -31,7 +35,7 @@ public class MT1201ServiceImp extends CustomXmlMaker implements MT1201Service{ @@ -31,7 +35,7 @@ public class MT1201ServiceImp extends CustomXmlMaker implements MT1201Service{
31 } 35 }
32 36
33 @Override 37 @Override
34 - public int editMt1201(Map<String, Object> map) throws IOException { 38 + public Map<String, Object> editMt1201(Map<String, Object> map) throws IOException, ParseException {
35 39
36 map.put("templatePath", "/edit/MT1201.ftlx"); 40 map.put("templatePath", "/edit/MT1201.ftlx");
37 map.put("sendPath", "./send/edit/"); 41 map.put("sendPath", "./send/edit/");
@@ -39,7 +43,7 @@ public class MT1201ServiceImp extends CustomXmlMaker implements MT1201Service{ @@ -39,7 +43,7 @@ public class MT1201ServiceImp extends CustomXmlMaker implements MT1201Service{
39 } 43 }
40 44
41 @Override 45 @Override
42 - public int removeMt1201(Map<String, Object> map) throws IOException { 46 + public Map<String, Object> removeMt1201(Map<String, Object> map) throws IOException, ParseException {
43 47
44 String customCode = map.get("customCode").toString(); 48 String customCode = map.get("customCode").toString();
45 // 生成报文头部 49 // 生成报文头部
@@ -54,15 +58,27 @@ public class MT1201ServiceImp extends CustomXmlMaker implements MT1201Service{ @@ -54,15 +58,27 @@ public class MT1201ServiceImp extends CustomXmlMaker implements MT1201Service{
54 // 舱单传输人名称 58 // 舱单传输人名称
55 map.put("orgCode", orgCode); 59 map.put("orgCode", orgCode);
56 // 生成报文 60 // 生成报文
  61 + Map<String, Object> hashMap = new HashMap<>();
  62 + // 生成报文
57 if (makeXmlToFile("/remove/MT1201.ftlx", msgId+".xml", map, "./send/remove/")>0){ 63 if (makeXmlToFile("/remove/MT1201.ftlx", msgId+".xml", map, "./send/remove/")>0){
58 - return 1; 64 + map.put("functionCode", "3");
  65 + map.put("busType","MT1201");
  66 + NMMS_CUSTOM_RESPONSE nmmsCustomResponse = ReturnUtil.nmmsCustomResponse(map);
  67 + // 操作类型
  68 + nmmsCustomResponse.setOpertype("删除");
  69 + nmmsCustomResponse.setCusrescode("24");
  70 + nmmsCustomResponse.setCusrestext("删除报发送成功");
  71 + hashMap.put("status", "1");
  72 + hashMap.put("customResponse", nmmsCustomResponse);
  73 + return hashMap;
59 }else { 74 }else {
60 - return 0; 75 + hashMap.put("staus", "0");
  76 + return hashMap;
61 } 77 }
62 } 78 }
63 79
64 80
65 - public int mt1201(Map<String, Object> map) throws IOException { 81 + public Map<String, Object> mt1201(Map<String, Object> map) throws IOException, ParseException {
66 ObjectMapper objectMapper = new ObjectMapper(); 82 ObjectMapper objectMapper = new ObjectMapper();
67 // 预配 83 // 预配
68 NMMS_CUSTOM_MT1201 customMt1201 = objectMapper.convertValue(map.get("mt1201"), NMMS_CUSTOM_MT1201.class); 84 NMMS_CUSTOM_MT1201 customMt1201 = objectMapper.convertValue(map.get("mt1201"), NMMS_CUSTOM_MT1201.class);
@@ -72,6 +88,13 @@ public class MT1201ServiceImp extends CustomXmlMaker implements MT1201Service{ @@ -72,6 +88,13 @@ public class MT1201ServiceImp extends CustomXmlMaker implements MT1201Service{
72 String customCode = customMt1201.getCustomcode(); 88 String customCode = customMt1201.getCustomcode();
73 // 报文头时间 精确到毫秒 89 // 报文头时间 精确到毫秒
74 map.put("sendTime", DateUtil.getCurrentTime17()); 90 map.put("sendTime", DateUtil.getCurrentTime17());
  91 + // 航班起飞时间 sendTime(海关接受时间) + 1小时
  92 + String s = DateUtil.addDateMinut(new Date(), 1);
  93 + // 航班到达时间 航班起飞时间 + 2小时
  94 + String ss = DateUtil.addDateMinut(new Date(), 3);
  95 + map.put("arrivalDateTime", s);
  96 + map.put("departureDateTime", ss);
  97 +
75 // 封装实体 98 // 封装实体
76 map.put("mt", customMt1201); 99 map.put("mt", customMt1201);
77 map.put("awbAwbinfo", awbAwbinfo); 100 map.put("awbAwbinfo", awbAwbinfo);
@@ -84,11 +107,73 @@ public class MT1201ServiceImp extends CustomXmlMaker implements MT1201Service{ @@ -84,11 +107,73 @@ public class MT1201ServiceImp extends CustomXmlMaker implements MT1201Service{
84 map.put("receiverID", receiverID); 107 map.put("receiverID", receiverID);
85 // 舱单传输人名称 108 // 舱单传输人名称
86 map.put("orgCode", orgCode); 109 map.put("orgCode", orgCode);
  110 + Map<String, Object> maps = new HashMap<>();
87 // 生成报文 111 // 生成报文
88 if (makeXmlToFile(map.get("templatePath").toString(), msgId+".xml", map, map.get("sendPath").toString())>0){ 112 if (makeXmlToFile(map.get("templatePath").toString(), msgId+".xml", map, map.get("sendPath").toString())>0){
89 - return 1; 113 + if (!map.containsKey("reason")){
  114 + map.put("functionCode", "9");
  115 + map.put("busType","MT1201");
  116 + NMMS_CUSTOM_RESPONSE nmmsCustomResponse = ReturnUtil.nmmsCustomResponse(map);
  117 + // 航班日期
  118 + nmmsCustomResponse.setFlightdate(customMt1201.getFlightdate());
  119 + // 航班号
  120 + nmmsCustomResponse.setFlightno(customMt1201.getFlightno());
  121 + // 航班承运人
  122 + nmmsCustomResponse.setCarrier(customMt1201.getCarrier());
  123 + // 主单号
  124 + nmmsCustomResponse.setAwbano(customMt1201.getAwba());
  125 + if (!"".equals(customMt1201.getAwbh())){
  126 + // 分单号
  127 + nmmsCustomResponse.setAwbhno(customMt1201.getAwbh());
  128 + }else {
  129 + nmmsCustomResponse.setAwbhno(null);
  130 + }
  131 + // 件数
  132 + nmmsCustomResponse.setBuspiece(Integer.valueOf(customMt1201.getPiece().toString()));
  133 + // 重量
  134 + nmmsCustomResponse.setBusweight(Long.valueOf(customMt1201.getWeight().toString()));
  135 + // 操作类型
  136 + nmmsCustomResponse.setOpertype("新增");
  137 + nmmsCustomResponse.setCusrescode("23");
  138 + nmmsCustomResponse.setCusrestext("新增报发送成功");
  139 + maps.put("status", "1");
  140 + maps.put("customResponse", nmmsCustomResponse);
  141 +
  142 + return maps;
  143 + }else {
  144 + map.put("functionCode", "5");
  145 + map.put("busType","MT1201");
  146 + NMMS_CUSTOM_RESPONSE nmmsCustomResponse = ReturnUtil.nmmsCustomResponse(map);
  147 + // 航班日期
  148 + nmmsCustomResponse.setFlightdate(customMt1201.getFlightdate());
  149 + // 航班号
  150 + nmmsCustomResponse.setFlightno(customMt1201.getFlightno());
  151 + // 航班承运人
  152 + nmmsCustomResponse.setCarrier(customMt1201.getCarrier());
  153 + // 主单号
  154 + nmmsCustomResponse.setAwbano(customMt1201.getAwba());
  155 + if (!"".equals(customMt1201.getAwbh())){
  156 + // 分单号
  157 + nmmsCustomResponse.setAwbhno(customMt1201.getAwbh());
  158 + }else {
  159 + nmmsCustomResponse.setAwbhno(null);
  160 + }
  161 + // 件数
  162 + nmmsCustomResponse.setBuspiece(Integer.valueOf(customMt1201.getPiece().toString()));
  163 + // 重量
  164 + nmmsCustomResponse.setBusweight(Long.valueOf(customMt1201.getWeight().toString()));
  165 + // 操作类型
  166 + nmmsCustomResponse.setOpertype("修改");
  167 + nmmsCustomResponse.setCusrescode("25");
  168 + nmmsCustomResponse.setCusrestext("修改报发送成功");
  169 + maps.put("status", "1");
  170 + maps.put("customResponse", nmmsCustomResponse);
  171 +
  172 + return maps;
  173 + }
90 }else { 174 }else {
91 - return 0; 175 + maps.put("status", "0");
  176 + return maps;
92 } 177 }
93 } 178 }
94 } 179 }
  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_RESPONSE;
  5 +import com.sunyo.wlpt.base.model.NMMS_CUSTOM_TRANS;
  6 +import com.sunyo.wlpt.message.builder.service.MT3202Service;
  7 +import com.sunyo.wlpt.message.builder.util.CustomXmlMaker;
  8 +import com.sunyo.wlpt.message.builder.util.ReturnUtil;
  9 +import com.tianbo.util.Date.DateUtil;
  10 +import org.springframework.beans.factory.annotation.Value;
  11 +import org.springframework.stereotype.Service;
  12 +
  13 +import java.io.IOException;
  14 +import java.text.ParseException;
  15 +import java.util.HashMap;
  16 +import java.util.Map;
  17 +
  18 +@Service
  19 +public class MT3202ServiceImp extends CustomXmlMaker implements MT3202Service {
  20 +
  21 + @Value("${custom.custom-code}")
  22 + private String orgsn;
  23 +
  24 + @Override
  25 + public Map<String, Object> createMt3202(Map<String, Object> map) throws ParseException, IOException {
  26 +
  27 + ObjectMapper objectMapper = new ObjectMapper();
  28 + // 转运记录
  29 + NMMS_CUSTOM_TRANS nmmsCustomTrans = objectMapper.convertValue(map.get("mt3202"), NMMS_CUSTOM_TRANS.class);
  30 + // 关区代码
  31 + String customCode = nmmsCustomTrans.getCustomcode();
  32 + // 报文头时间 精确到毫秒
  33 + map.put("sendTime", DateUtil.getCurrentTime17());
  34 + // 封装实体
  35 + map.put("mt", nmmsCustomTrans);
  36 + // 生成报文头部
  37 + String msgId = makeMsgID("MT3202", orgsn, nmmsCustomTrans.getAwba());
  38 + String msessageType = "MT3202";
  39 + String senderId = makeSenderID(customCode, orgsn, "");
  40 + String receiverID = customCode;
  41 + map.put("msgId", msgId);
  42 + map.put("msessageType", msessageType);
  43 + map.put("senderId", senderId);
  44 + map.put("receiverID", receiverID);
  45 +
  46 + Map<String, Object> map3202 = new HashMap<>();
  47 +
  48 + if (makeXmlToFile("/manifest/MT3202.ftlx", msgId+".xml", map, "./send/add/")>0){
  49 + map.put("functionCode", "2");
  50 + map.put("busType","MT3202");
  51 + NMMS_CUSTOM_RESPONSE nmmsCustomResponse = ReturnUtil.nmmsCustomResponse(map);
  52 + // 航班日期
  53 + nmmsCustomResponse.setFlightdate(nmmsCustomTrans.getFlightdate());
  54 + // 航班号
  55 + nmmsCustomResponse.setFlightno(nmmsCustomTrans.getFlightno());
  56 + // 航班承运人
  57 + nmmsCustomResponse.setCarrier(nmmsCustomTrans.getCarrier());
  58 + // 主单号
  59 + nmmsCustomResponse.setAwbano(nmmsCustomTrans.getAwba());
  60 + // 件数
  61 + nmmsCustomResponse.setBuspiece(Integer.valueOf(nmmsCustomTrans.getTurnpiece().toString()));
  62 + // 重量
  63 + nmmsCustomResponse.setBusweight(Long.valueOf(nmmsCustomTrans.getTurnweight().toString()));
  64 + // 操作类型
  65 + nmmsCustomResponse.setOpertype("新增");
  66 + nmmsCustomResponse.setCusrescode("23");
  67 + nmmsCustomResponse.setCusrestext("新增报发送成功");
  68 + map3202.put("status", "1");
  69 + map3202.put("customResponse", nmmsCustomResponse);
  70 +
  71 + return map3202;
  72 + }else {
  73 + map3202.put("status", "0");
  74 + return map3202;
  75 + }
  76 + }
  77 +
  78 + @Override
  79 + public Map<String, Object> removeMt3202(Map<String, Object> map) throws IOException, ParseException {
  80 + // 关区代码
  81 + String customCode = map.get("customCode").toString();
  82 + // 报文头时间 精确到毫秒
  83 + map.put("sendTime", DateUtil.getCurrentTime17());
  84 + // 生成报文头部
  85 + String msgId = makeMsgID("MT3202", orgsn, map.get("awba").toString());
  86 + String senderId = makeSenderID(customCode, orgsn, "");
  87 + String receiverID = customCode;
  88 + map.put("msgId", msgId);
  89 + map.put("senderId", senderId);
  90 + map.put("receiverID", receiverID);
  91 + Map<String, Object> map3201 = new HashMap<>();
  92 + if (makeXmlToFile("/remove/MT3202.ftlx", msgId+".xml", map,"./send/remove/")>0){
  93 + map.put("functionCode", "3");
  94 + map.put("busType","MT3202");
  95 + NMMS_CUSTOM_RESPONSE nmmsCustomResponse = ReturnUtil.nmmsCustomResponse(map);
  96 + // 操作类型
  97 + nmmsCustomResponse.setOpertype("删除");
  98 + nmmsCustomResponse.setCusrescode("24");
  99 + nmmsCustomResponse.setCusrestext("删除报发送成功");
  100 + map3201.put("status", "1");
  101 + map3201.put("customResponse", nmmsCustomResponse);
  102 + return map3201;
  103 + }else {
  104 + map3201.put("staus", "0");
  105 + return map3201;
  106 + }
  107 + }
  108 +}
@@ -66,7 +66,6 @@ public class MT4201ServiceImp extends CustomXmlMaker implements MT4201Service { @@ -66,7 +66,6 @@ public class MT4201ServiceImp extends CustomXmlMaker implements MT4201Service {
66 // 分单号 66 // 分单号
67 nmmsCustomResponse.setAwbhno(null); 67 nmmsCustomResponse.setAwbhno(null);
68 } 68 }
69 -  
70 // 件数 69 // 件数
71 nmmsCustomResponse.setBuspiece(Integer.valueOf(customMt4201.getLodingpiece().toString())); 70 nmmsCustomResponse.setBuspiece(Integer.valueOf(customMt4201.getLodingpiece().toString()));
72 // 重量 71 // 重量
@@ -42,7 +42,7 @@ public class MT520XServiceImp extends CustomXmlMaker implements MT520XService{ @@ -42,7 +42,7 @@ public class MT520XServiceImp extends CustomXmlMaker implements MT520XService{
42 // 封装实体 42 // 封装实体
43 hashMap.put("mt", customMt520X); 43 hashMap.put("mt", customMt520X);
44 hashMap.put("orgCode", orgCode); 44 hashMap.put("orgCode", orgCode);
45 - if ("5201".equals(customMt520X.getRcfdep())){ 45 + if ("MT5201".equals(customMt520X.getRcfdep())){
46 // 生成报文头部 46 // 生成报文头部
47 String msgId = makeMsgID("MT5201", orgsn, customMt520X.getAwba()); 47 String msgId = makeMsgID("MT5201", orgsn, customMt520X.getAwba());
48 String msessageType = "MT5201"; 48 String msessageType = "MT5201";
@@ -150,7 +150,7 @@ public class MT520XServiceImp extends CustomXmlMaker implements MT520XService{ @@ -150,7 +150,7 @@ public class MT520XServiceImp extends CustomXmlMaker implements MT520XService{
150 map.put("customCode", customCode); 150 map.put("customCode", customCode);
151 // 报文头时间 精确到毫秒 151 // 报文头时间 精确到毫秒
152 map.put("sendTime", DateUtil.getCurrentTime17()); 152 map.put("sendTime", DateUtil.getCurrentTime17());
153 - if ("5201".equals(map.get("rcfdep").toString())){ 153 + if ("MT5201".equals(map.get("rcfdep").toString())){
154 // 生成报文头部 154 // 生成报文头部
155 String msgId = makeMsgID("MT5201", orgsn, map.get("awba").toString()); 155 String msgId = makeMsgID("MT5201", orgsn, map.get("awba").toString());
156 String senderId = makeSenderID(customCode, orgsn, ""); 156 String senderId = makeSenderID(customCode, orgsn, "");
@@ -66,6 +66,9 @@ public class ReturnUtil { @@ -66,6 +66,9 @@ public class ReturnUtil {
66 if (map.containsKey("flightNo")){ 66 if (map.containsKey("flightNo")){
67 nmmsCustomResponse.setFlightno(map.get("flightNo").toString()); 67 nmmsCustomResponse.setFlightno(map.get("flightNo").toString());
68 } 68 }
  69 + if (map.containsKey("carrier")){
  70 + nmmsCustomResponse.setCarrier(map.get("carrier").toString());
  71 + }
69 if (map.containsKey("flightDate")){ 72 if (map.containsKey("flightDate")){
70 String flightDate = map.get("flightDate").toString(); 73 String flightDate = map.get("flightDate").toString();
71 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); 74 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
@@ -22,8 +22,8 @@ @@ -22,8 +22,8 @@
22 <JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID> 22 <JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID>
23 <TypeCode>4</TypeCode> 23 <TypeCode>4</TypeCode>
24 <FirstArrivalLocationID>${mt.destinationstation}</FirstArrivalLocationID> 24 <FirstArrivalLocationID>${mt.destinationstation}</FirstArrivalLocationID>
25 - <ArrivalDateTime>20200224171901086</ArrivalDateTime>  
26 - <DepartureDateTime>20200224151901086</DepartureDateTime> 25 + <ArrivalDateTime>${arrivalDateTime}</ArrivalDateTime>
  26 + <DepartureDateTime>${departureDateTime}</DepartureDateTime>
27 </BorderTransportMeans> 27 </BorderTransportMeans>
28 <Consignment> 28 <Consignment>
29 <TransportContractDocument> 29 <TransportContractDocument>
@@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
49 </GoodsConsignedPlace> 49 </GoodsConsignedPlace>
50 <TransportSplitIndicator>${mt.splitcode}</TransportSplitIndicator> 50 <TransportSplitIndicator>${mt.splitcode}</TransportSplitIndicator>
51 <FreightPayment> 51 <FreightPayment>
52 - <MethodCode>${awbAwbinfo.paymodel}</MethodCode> 52 + <MethodCode>${awbAwbinfo.collected}</MethodCode>
53 </FreightPayment> 53 </FreightPayment>
54 <ConsignmentPackaging> 54 <ConsignmentPackaging>
55 <QuantityQuantity>${awbAwbinfo.pcs}</QuantityQuantity> 55 <QuantityQuantity>${awbAwbinfo.pcs}</QuantityQuantity>
@@ -22,8 +22,8 @@ @@ -22,8 +22,8 @@
22 <JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID> 22 <JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID>
23 <TypeCode>4</TypeCode> 23 <TypeCode>4</TypeCode>
24 <FirstArrivalLocationID>${mt.destinationstation}</FirstArrivalLocationID> 24 <FirstArrivalLocationID>${mt.destinationstation}</FirstArrivalLocationID>
25 - <ArrivalDateTime>20200121053117086</ArrivalDateTime>  
26 - <DepartureDateTime>20200121033117086</DepartureDateTime> 25 + <ArrivalDateTime>${arrivalDateTime}</ArrivalDateTime>
  26 + <DepartureDateTime>${departureDateTime}</DepartureDateTime>
27 </BorderTransportMeans> 27 </BorderTransportMeans>
28 <Consignment> 28 <Consignment>
29 <TransportContractDocument> 29 <TransportContractDocument>
@@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
45 <CustomsStatusCode>${awbAwbinfo.awbtype}</CustomsStatusCode> 45 <CustomsStatusCode>${awbAwbinfo.awbtype}</CustomsStatusCode>
46 <TransportSplitIndicator>${mt.splitcode}</TransportSplitIndicator> 46 <TransportSplitIndicator>${mt.splitcode}</TransportSplitIndicator>
47 <FreightPayment> 47 <FreightPayment>
48 - <MethodCode>${awbAwbinfo.paymodel}</MethodCode> 48 + <MethodCode>${awbAwbinfo.collected}</MethodCode>
49 </FreightPayment> 49 </FreightPayment>
50 <ConsignmentPackaging> 50 <ConsignmentPackaging>
51 <QuantityQuantity>${awbAwbinfo.pcs}</QuantityQuantity> 51 <QuantityQuantity>${awbAwbinfo.pcs}</QuantityQuantity>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<Manifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:Declaration:datamodel:standard:CN:MT3202:1">
  3 + <Head>
  4 + <MessageID>${msgId}</MessageID>
  5 + <FunctionCode>2</FunctionCode>
  6 + <MessageType>MT3202</MessageType>
  7 + <SenderID>${senderId}</SenderID>
  8 + <ReceiverID>${receiverID}</ReceiverID>
  9 + <SendTime>${sendTime}</SendTime>
  10 + <Version>1.0</Version>
  11 + </Head>
  12 + <Declaration>
  13 + <DeclarationOfficeID>${mt.customcode}</DeclarationOfficeID>
  14 + <BorderTransportMeans>
  15 + <JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID>
  16 + <TypeCode>4</TypeCode>
  17 + </BorderTransportMeans>
  18 + <UnloadingLocation>
  19 + <ID>${mt.turnunloading}</ID>
  20 + <ArrivalDate>${mt.flightno}</ArrivalDate>
  21 + </UnloadingLocation>
  22 + <Consignment>
  23 + <TransportContractDocument>
  24 + <ID>${mt.awba}</ID>
  25 + </TransportContractDocument>
  26 + <ConsignmentPackaging>
  27 + <QuantityQuantity>${mt.turnpiece}</QuantityQuantity>
  28 + </ConsignmentPackaging>
  29 + <TotalGrossMassMeasure>${mt.turnweight}</TotalGrossMassMeasure>
  30 + <ConsignmentItem>
  31 + <SequenceNumeric>1</SequenceNumeric>
  32 + <Commodity>
  33 + <CargoDescription>${mt.goodsname}</CargoDescription>
  34 + </Commodity>
  35 + </ConsignmentItem>
  36 + </Consignment>
  37 + </Declaration>
  38 +</Manifest>
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 </TransportContractDocument> 30 </TransportContractDocument>
31 <#if mt.awbh?length gt 1> 31 <#if mt.awbh?length gt 1>
32 <AssociatedTransportDocument> 32 <AssociatedTransportDocument>
33 - <ID>${mt.awba}_${mtawbh}</ID> 33 + <ID>${mt.awba}_${mt.awbh}</ID>
34 </AssociatedTransportDocument> 34 </AssociatedTransportDocument>
35 </#if> 35 </#if>
36 <ConsignmentPackaging> 36 <ConsignmentPackaging>
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 <TypeCode>4</TypeCode> 15 <TypeCode>4</TypeCode>
16 <CargoFacilityLocation>${mt.turnunloading}</CargoFacilityLocation> 16 <CargoFacilityLocation>${mt.turnunloading}</CargoFacilityLocation>
17 <UnloadingLocation> 17 <UnloadingLocation>
18 - <ID>CGO/${mt.customcode}</ID> 18 + <ID>${mt.ext2}</ID>
19 </UnloadingLocation> 19 </UnloadingLocation>
20 </BorderTransportMeans> 20 </BorderTransportMeans>
21 <Consignment> 21 <Consignment>
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 <Name>${orgCode}</Name> 14 <Name>${orgCode}</Name>
15 </RepresentativePerson> 15 </RepresentativePerson>
16 <BorderTransportMeans> 16 <BorderTransportMeans>
17 - <JourneyID>${flightNo}/${flightDate}</JourneyID> 17 + <JourneyID>${carrier}${flightNo}/${flightDate}</JourneyID>
18 </BorderTransportMeans> 18 </BorderTransportMeans>
19 <Consignment> 19 <Consignment>
20 <TransportContractDocument> 20 <TransportContractDocument>
  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>3</FunctionCode>
  5 + <MessageType>MT3202</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>${flightNo}/${flightDate}</JourneyID>
  14 + </BorderTransportMeans>
  15 + <Consignment>
  16 + <TransportContractDocument>
  17 + <ID>${awba}</ID>
  18 + </TransportContractDocument>
  19 + </Consignment>
  20 + <AdditionalInformation>
  21 + <Reason>${reason}</Reason>
  22 + <ContactName>${contactName}</ContactName>
  23 + <ContactTel>${contactTel}</ContactTel>
  24 + </AdditionalInformation>
  25 + </Declaration>
  26 +</Manifest>
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 <Declaration> 11 <Declaration>
12 <DeclarationOfficeID>${customCode}</DeclarationOfficeID> 12 <DeclarationOfficeID>${customCode}</DeclarationOfficeID>
13 <BorderTransportMeans> 13 <BorderTransportMeans>
14 - <JourneyID>${flightNo}/${flightDate}</JourneyID> 14 + <JourneyID>${carrier}${flightNo}/${flightDate}</JourneyID>
15 </BorderTransportMeans> 15 </BorderTransportMeans>
16 <Consignment> 16 <Consignment>
17 <TransportContractDocument> 17 <TransportContractDocument>