1
|
package com.sunyo.wlpt.message.builder.service.imp;
|
1
|
package com.sunyo.wlpt.message.builder.service.imp;
|
2
|
|
2
|
|
3
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
3
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
4
|
-import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT1201;
|
|
|
5
|
-import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT2201;
|
|
|
6
|
-import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT8205;
|
|
|
7
|
-import com.sunyo.wlpt.base.model.NMMS_CUSTOM_RESPONSE;
|
4
|
+import com.sunyo.wlpt.base.model.*;
|
8
|
import com.sunyo.wlpt.message.builder.service.MT8205Service;
|
5
|
import com.sunyo.wlpt.message.builder.service.MT8205Service;
|
9
|
import com.sunyo.wlpt.message.builder.util.CustomXmlMaker;
|
6
|
import com.sunyo.wlpt.message.builder.util.CustomXmlMaker;
|
10
|
import com.sunyo.wlpt.message.builder.util.ReturnUtil;
|
7
|
import com.sunyo.wlpt.message.builder.util.ReturnUtil;
|
|
@@ -33,31 +30,20 @@ public class MT8205ServiceImp extends CustomXmlMaker implements MT8205Service { |
|
@@ -33,31 +30,20 @@ public class MT8205ServiceImp extends CustomXmlMaker implements MT8205Service { |
33
|
public Map<String, Object> create8205(Map<String, Object> map) throws IOException, ParseException {
|
30
|
public Map<String, Object> create8205(Map<String, Object> map) throws IOException, ParseException {
|
34
|
ObjectMapper objectMapper = new ObjectMapper();
|
31
|
ObjectMapper objectMapper = new ObjectMapper();
|
35
|
// 转运记录
|
32
|
// 转运记录
|
36
|
- NMMS_CUSTOM_MT8205 customMt8205 = objectMapper.convertValue(map.get("mt8205"), NMMS_CUSTOM_MT8205.class);
|
|
|
37
|
- // 进港原始
|
|
|
38
|
- NMMS_CUSTOM_MT1201 customMt1201 = objectMapper.convertValue(map.get("mt1201"), NMMS_CUSTOM_MT1201.class);
|
|
|
39
|
- // 出港预配
|
|
|
40
|
- NMMS_CUSTOM_MT2201 customMt2201 = objectMapper.convertValue(map.get("mt2201"), NMMS_CUSTOM_MT2201.class);
|
33
|
+ CUSTOM_MT8205 customMt8205 = objectMapper.convertValue(map.get("mt8205"), CUSTOM_MT8205.class);
|
41
|
// 关区代码
|
34
|
// 关区代码
|
42
|
String customCode = customMt8205.getCustomcode();
|
35
|
String customCode = customMt8205.getCustomcode();
|
43
|
// 报文头时间 精确到毫秒
|
36
|
// 报文头时间 精确到毫秒
|
44
|
map.put("sendTime", DateUtil.getCurrentTime17());
|
37
|
map.put("sendTime", DateUtil.getCurrentTime17());
|
45
|
// 封装实体
|
38
|
// 封装实体
|
46
|
map.put("mt8205", customMt8205);
|
39
|
map.put("mt8205", customMt8205);
|
47
|
- map.put("mt1201", customMt1201);
|
|
|
48
|
- map.put("mt2201", customMt2201);
|
|
|
49
|
map.put("orgCode", orgCode);
|
40
|
map.put("orgCode", orgCode);
|
50
|
-
|
|
|
51
|
// 处理主单号 -
|
41
|
// 处理主单号 -
|
52
|
- String mt1201 = ReturnUtil.awbaReplace(customMt1201.getAwba());
|
|
|
53
|
- map.put("mt1201", mt1201);
|
|
|
54
|
-
|
42
|
+ customMt8205.setOriginawbano(ReturnUtil.awbaReplace(customMt8205.getOriginawbano()));
|
55
|
// 处理主单号 -
|
43
|
// 处理主单号 -
|
56
|
- String mt2201 = ReturnUtil.awbaReplace(customMt2201.getAwba());
|
|
|
57
|
- map.put("mt2201", mt2201);
|
|
|
58
|
-
|
44
|
+ customMt8205.setTransawbano(ReturnUtil.awbaReplace(customMt8205.getTransawbano()));
|
59
|
// 生成报文头部
|
45
|
// 生成报文头部
|
60
|
- String msgId = makeMsgID("MT8205", orgsn, customMt1201.getAwba());
|
46
|
+ String msgId = makeMsgID("MT8205", orgsn, customMt8205.getOriginawbano());
|
61
|
String msessageType = "MT8205";
|
47
|
String msessageType = "MT8205";
|
62
|
String senderId = makeSenderID(customCode, orgsn, "");
|
48
|
String senderId = makeSenderID(customCode, orgsn, "");
|
63
|
String receiverID = customCode;
|
49
|
String receiverID = customCode;
|
|
@@ -74,22 +60,23 @@ public class MT8205ServiceImp extends CustomXmlMaker implements MT8205Service { |
|
@@ -74,22 +60,23 @@ public class MT8205ServiceImp extends CustomXmlMaker implements MT8205Service { |
74
|
NMMS_CUSTOM_RESPONSE nmmsCustomResponse = ReturnUtil.nmmsCustomResponse(map);
|
60
|
NMMS_CUSTOM_RESPONSE nmmsCustomResponse = ReturnUtil.nmmsCustomResponse(map);
|
75
|
System.out.println();
|
61
|
System.out.println();
|
76
|
// 航班日期
|
62
|
// 航班日期
|
77
|
- nmmsCustomResponse.setFlightdate(customMt1201.getFlightdate());
|
63
|
+ nmmsCustomResponse.setFlightdate(customMt8205.getOriginflightdate());
|
78
|
// 航班号
|
64
|
// 航班号
|
79
|
- nmmsCustomResponse.setFlightno(customMt1201.getFlightno());
|
65
|
+ nmmsCustomResponse.setFlightno(customMt8205.getOriginflightno());
|
80
|
// 航班承运人
|
66
|
// 航班承运人
|
81
|
- nmmsCustomResponse.setCarrier(customMt1201.getCarrier());
|
67
|
+ nmmsCustomResponse.setCarrier(customMt8205.getOrigincarrier());
|
82
|
// 主单号
|
68
|
// 主单号
|
83
|
- nmmsCustomResponse.setAwbano(customMt1201.getAwba());
|
69
|
+ nmmsCustomResponse.setAwbano(customMt8205.getOriginawbano());
|
84
|
// 分单号
|
70
|
// 分单号
|
85
|
- nmmsCustomResponse.setAwbhno(AwbaUtils.awbh(customMt1201.getAwbh()));
|
71
|
+ nmmsCustomResponse.setAwbhno(AwbaUtils.awbh(customMt8205.getOriginawbhno()));
|
86
|
// 件数
|
72
|
// 件数
|
87
|
- nmmsCustomResponse.setBuspiece(Integer.valueOf(customMt1201.getPiece().toString()));
|
73
|
+ nmmsCustomResponse.setBuspiece(Integer.valueOf(customMt8205.getTranspiece().toString()));
|
88
|
// 重量
|
74
|
// 重量
|
89
|
- nmmsCustomResponse.setBusweight(new BigDecimal(customMt1201.getWeight().toString()));
|
75
|
+ nmmsCustomResponse.setBusweight(new BigDecimal(customMt8205.getTransweight().toString()));
|
90
|
// 操作类型
|
76
|
// 操作类型
|
91
|
nmmsCustomResponse.setOpertype("新增");
|
77
|
nmmsCustomResponse.setOpertype("新增");
|
92
|
nmmsCustomResponse.setCusrescode("23");
|
78
|
nmmsCustomResponse.setCusrescode("23");
|
|
|
79
|
+ nmmsCustomResponse.setOperusername(map.get("username").toString());
|
93
|
nmmsCustomResponse.setCusrestext("新增报发送成功");
|
80
|
nmmsCustomResponse.setCusrestext("新增报发送成功");
|
94
|
map8205.put("status", "1");
|
81
|
map8205.put("status", "1");
|
95
|
map8205.put("customResponse", nmmsCustomResponse);
|
82
|
map8205.put("customResponse", nmmsCustomResponse);
|