...
|
...
|
@@ -6,6 +6,8 @@ import com.sunyo.wlpt.base.model.AWB_AWBINFO; |
|
|
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT2201;
|
|
|
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT4201;
|
|
|
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_RESPONSE;
|
|
|
import com.sunyo.wlpt.message.builder.factory.CustomsXmlFactory;
|
|
|
import com.sunyo.wlpt.message.builder.factory.CustomsXmlHeader;
|
|
|
import com.sunyo.wlpt.message.builder.service.MT2201Service;
|
|
|
import com.sunyo.wlpt.message.builder.util.CustomXmlMaker;
|
|
|
import com.sunyo.wlpt.message.builder.util.ReturnUtil;
|
...
|
...
|
@@ -79,27 +81,23 @@ public class MT2201ServiceImp extends CustomXmlMaker implements MT2201Service { |
|
|
public Map<String, Object> removeMt2201(Map<String, Object> map) throws IOException, ParseException {
|
|
|
|
|
|
String customCode = map.get("customCode").toString();
|
|
|
// 生成报文头部
|
|
|
String msgId = makeMsgID("MT2201", orgsn, map.get("awba").toString());
|
|
|
String senderId = makeSenderID(customCode, orgsn, "");
|
|
|
String receiverID = customCode;
|
|
|
map.put("msgId", msgId);
|
|
|
map.put("senderId", senderId);
|
|
|
map.put("receiverID", receiverID);
|
|
|
// 报文头时间 精确到毫秒
|
|
|
map.put("sendTime", DateUtil.getCurrentTime17());
|
|
|
|
|
|
// 生成报文头部信息
|
|
|
CustomsXmlFactory customsXmlFactory = new CustomsXmlFactory();
|
|
|
CustomsXmlHeader message = customsXmlFactory.getCustomsXmlHeader("MESSAGE");
|
|
|
Map<String, Object> mt2201 = message.makeHeader(customCode, orgsn, map.get("awba").toString(), orgCode, "", "MT2201");
|
|
|
map.put("map", mt2201);
|
|
|
|
|
|
// 舱单传输人名称
|
|
|
map.put("orgCode", orgCode);
|
|
|
// 处理主单号-
|
|
|
String awba = ReturnUtil.awbaReplace(map.get("awba").toString());
|
|
|
map.put("awbas", awba);
|
|
|
|
|
|
String flightDate = ReturnUtil.awbaReplace(map.get("flightDate").toString());
|
|
|
map.put("flightDates",flightDate);
|
|
|
|
|
|
Map<String, Object> hashMap = new HashMap<>();
|
|
|
// 生成报文
|
|
|
if (makeXmlToFile("/remove/MT2201.ftlx", msgId+".xml", map, "./send/remove/")>0){
|
|
|
if (makeXmlToFile("/remove/MT2201.ftlx", mt2201.get("messageID").toString()+".xml", map, "./send/remove/")>0){
|
|
|
map.put("functionCode", "3");
|
|
|
map.put("busType","MT2201");
|
|
|
System.out.println();
|
...
|
...
|
@@ -126,16 +124,6 @@ public class MT2201ServiceImp extends CustomXmlMaker implements MT2201Service { |
|
|
AWB_AWBINFO awbAwbinfo = custom_mt2201.getAwbinfo();
|
|
|
// 关区代码
|
|
|
String customCode = custom_mt2201.getCustomcode();
|
|
|
// 报文头时间 精确到毫秒
|
|
|
map.put("sendTime", DateUtil.getCurrentTime17());
|
|
|
// 处理 预付0 PP 到付 1 CC
|
|
|
if(awbAwbinfo.getCollected() != null && awbAwbinfo.getCollected() != ""){
|
|
|
if ("0".equals(awbAwbinfo.getCollected())){
|
|
|
awbAwbinfo.setCollected("PP");
|
|
|
}else {
|
|
|
awbAwbinfo.setCollected("CC");
|
|
|
}
|
|
|
}
|
|
|
// 封装实体
|
|
|
map.put("mt", custom_mt2201);
|
|
|
map.put("awbAwbinfo", awbAwbinfo);
|
...
|
...
|
@@ -143,13 +131,12 @@ public class MT2201ServiceImp extends CustomXmlMaker implements MT2201Service { |
|
|
String awba = ReturnUtil.awbaReplace(custom_mt2201.getAwba());
|
|
|
map.put("awba", awba);
|
|
|
|
|
|
// 生成报文头部
|
|
|
String msgId = makeMsgID("MT2201", orgsn, custom_mt2201.getAwba());
|
|
|
String senderId = makeSenderID(customCode, orgsn, "");
|
|
|
String receiverID = customCode;
|
|
|
map.put("msgId", msgId);
|
|
|
map.put("senderId", senderId);
|
|
|
map.put("receiverID", receiverID);
|
|
|
// 生成报文头部信息
|
|
|
CustomsXmlFactory customsXmlFactory = new CustomsXmlFactory();
|
|
|
CustomsXmlHeader message = customsXmlFactory.getCustomsXmlHeader("MESSAGE");
|
|
|
Map<String, Object> mt2201 = message.makeHeader(customCode, orgsn, custom_mt2201.getAwba(), orgCode, "", "MT2201");
|
|
|
map.put("map", mt2201);
|
|
|
|
|
|
String s = DateUtil.addDateMinut(new Date(), 6);
|
|
|
// 货物装卸时间
|
|
|
map.put("loadingDate",s);
|
...
|
...
|
@@ -158,7 +145,7 @@ public class MT2201ServiceImp extends CustomXmlMaker implements MT2201Service { |
|
|
|
|
|
Map<String, Object> maps = new HashMap<>();
|
|
|
// 生成报文
|
|
|
if (makeXmlToFile(map.get("templatePath").toString(), msgId+".xml", map, map.get("sendPath").toString())>0){
|
|
|
if (makeXmlToFile(map.get("templatePath").toString(), mt2201.get("messageID")+".xml", map, map.get("sendPath").toString())>0){
|
|
|
if (!map.containsKey("reason")){
|
|
|
map.put("functionCode", "9");
|
|
|
map.put("busType","MT2201");
|
...
|
...
|
|