|
|
package com.sunyo.wlpt.message.builder.service.imp;
|
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT1201;
|
|
|
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT2201;
|
|
|
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT8205;
|
|
|
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_RESPONSE;
|
|
|
import com.sunyo.wlpt.base.model.*;
|
|
|
import com.sunyo.wlpt.message.builder.service.MT8205Service;
|
|
|
import com.sunyo.wlpt.message.builder.util.CustomXmlMaker;
|
|
|
import com.sunyo.wlpt.message.builder.util.ReturnUtil;
|
...
|
...
|
@@ -33,31 +30,20 @@ public class MT8205ServiceImp extends CustomXmlMaker implements MT8205Service { |
|
|
public Map<String, Object> create8205(Map<String, Object> map) throws IOException, ParseException {
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
// 转运记录
|
|
|
NMMS_CUSTOM_MT8205 customMt8205 = objectMapper.convertValue(map.get("mt8205"), NMMS_CUSTOM_MT8205.class);
|
|
|
// 进港原始
|
|
|
NMMS_CUSTOM_MT1201 customMt1201 = objectMapper.convertValue(map.get("mt1201"), NMMS_CUSTOM_MT1201.class);
|
|
|
// 出港预配
|
|
|
NMMS_CUSTOM_MT2201 customMt2201 = objectMapper.convertValue(map.get("mt2201"), NMMS_CUSTOM_MT2201.class);
|
|
|
CUSTOM_MT8205 customMt8205 = objectMapper.convertValue(map.get("mt8205"), CUSTOM_MT8205.class);
|
|
|
// 关区代码
|
|
|
String customCode = customMt8205.getCustomcode();
|
|
|
// 报文头时间 精确到毫秒
|
|
|
map.put("sendTime", DateUtil.getCurrentTime17());
|
|
|
// 封装实体
|
|
|
map.put("mt8205", customMt8205);
|
|
|
map.put("mt1201", customMt1201);
|
|
|
map.put("mt2201", customMt2201);
|
|
|
map.put("orgCode", orgCode);
|
|
|
|
|
|
// 处理主单号 -
|
|
|
String mt1201 = ReturnUtil.awbaReplace(customMt1201.getAwba());
|
|
|
map.put("mt1201", mt1201);
|
|
|
|
|
|
customMt8205.setOriginawbano(ReturnUtil.awbaReplace(customMt8205.getOriginawbano()));
|
|
|
// 处理主单号 -
|
|
|
String mt2201 = ReturnUtil.awbaReplace(customMt2201.getAwba());
|
|
|
map.put("mt2201", mt2201);
|
|
|
|
|
|
customMt8205.setTransawbano(ReturnUtil.awbaReplace(customMt8205.getTransawbano()));
|
|
|
// 生成报文头部
|
|
|
String msgId = makeMsgID("MT8205", orgsn, customMt1201.getAwba());
|
|
|
String msgId = makeMsgID("MT8205", orgsn, customMt8205.getOriginawbano());
|
|
|
String msessageType = "MT8205";
|
|
|
String senderId = makeSenderID(customCode, orgsn, "");
|
|
|
String receiverID = customCode;
|
...
|
...
|
@@ -74,22 +60,23 @@ public class MT8205ServiceImp extends CustomXmlMaker implements MT8205Service { |
|
|
NMMS_CUSTOM_RESPONSE nmmsCustomResponse = ReturnUtil.nmmsCustomResponse(map);
|
|
|
System.out.println();
|
|
|
// 航班日期
|
|
|
nmmsCustomResponse.setFlightdate(customMt1201.getFlightdate());
|
|
|
nmmsCustomResponse.setFlightdate(customMt8205.getOriginflightdate());
|
|
|
// 航班号
|
|
|
nmmsCustomResponse.setFlightno(customMt1201.getFlightno());
|
|
|
nmmsCustomResponse.setFlightno(customMt8205.getOriginflightno());
|
|
|
// 航班承运人
|
|
|
nmmsCustomResponse.setCarrier(customMt1201.getCarrier());
|
|
|
nmmsCustomResponse.setCarrier(customMt8205.getOrigincarrier());
|
|
|
// 主单号
|
|
|
nmmsCustomResponse.setAwbano(customMt1201.getAwba());
|
|
|
nmmsCustomResponse.setAwbano(customMt8205.getOriginawbano());
|
|
|
// 分单号
|
|
|
nmmsCustomResponse.setAwbhno(AwbaUtils.awbh(customMt1201.getAwbh()));
|
|
|
nmmsCustomResponse.setAwbhno(AwbaUtils.awbh(customMt8205.getOriginawbhno()));
|
|
|
// 件数
|
|
|
nmmsCustomResponse.setBuspiece(Integer.valueOf(customMt1201.getPiece().toString()));
|
|
|
nmmsCustomResponse.setBuspiece(Integer.valueOf(customMt8205.getTranspiece().toString()));
|
|
|
// 重量
|
|
|
nmmsCustomResponse.setBusweight(new BigDecimal(customMt1201.getWeight().toString()));
|
|
|
nmmsCustomResponse.setBusweight(new BigDecimal(customMt8205.getTransweight().toString()));
|
|
|
// 操作类型
|
|
|
nmmsCustomResponse.setOpertype("新增");
|
|
|
nmmsCustomResponse.setCusrescode("23");
|
|
|
nmmsCustomResponse.setOperusername(map.get("username").toString());
|
|
|
nmmsCustomResponse.setCusrestext("新增报发送成功");
|
|
|
map8205.put("status", "1");
|
|
|
map8205.put("customResponse", nmmsCustomResponse);
|
...
|
...
|
|