作者 shenhailong

修改生成报文 返回信息 response实体

... ... @@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.text.ParseException;
import java.util.Map;
@RestController
... ... @@ -23,7 +24,7 @@ public class MT2201Controller {
@PostMapping("/creatMt2201")
@ApiOperation(value = "生成报文")
@ResponseBody
public int creatMt2201(@RequestBody Map<String, Object> map) throws IOException {
public Map<String, Object> creatMt2201(@RequestBody Map<String, Object> map) throws IOException, ParseException {
return mt2201Service.creatMt2201(map);
}
... ... @@ -31,7 +32,7 @@ public class MT2201Controller {
@PutMapping("/editMt2201")
@ApiOperation(value = "修改报文")
@ResponseBody
public int editMt2201(@RequestBody Map<String, Object> map) throws IOException {
public Map<String, Object> editMt2201(@RequestBody Map<String, Object> map) throws IOException, ParseException {
return mt2201Service.editMt2201(map);
}
... ... @@ -39,7 +40,7 @@ public class MT2201Controller {
@PutMapping("/removeMt2201")
@ApiOperation(value = "删除报文")
@ResponseBody
public int removeMt2201(@RequestBody Map<String, Object> map) throws IOException {
public Map<String, Object> removeMt2201(@RequestBody Map<String, Object> map) throws IOException, ParseException {
return mt2201Service.removeMt2201(map);
}
... ...
... ... @@ -18,28 +18,28 @@ public class MT3201Controller {
@RequestMapping("/createMt3201")
@ResponseBody
public int fohcreate(@RequestBody Map<String, Object> map){
public Map<String, Object> fohcreate(@RequestBody Map<String, Object> map){
try {
return mt3201Service.fohcreate(map);
}catch (Exception e){
e.printStackTrace();
return 0;
return null;
}
}
@PutMapping("/removeMt3201")
@ResponseBody
public int remove(@RequestBody Map<String, Object> map){
public Map<String, Object> remove(@RequestBody Map<String, Object> map){
try {
return mt3201Service.remove(map);
}catch (Exception e){
e.printStackTrace();
return 0;
return null;
}
}
... ...
... ... @@ -19,7 +19,7 @@ public class MT4201Controller {
@PostMapping("/createMt4201")
@ResponseBody
public int pffmcreate(@RequestBody Map<String, Object> map) throws IOException {
public Map<String, Object> pffmcreate(@RequestBody Map<String, Object> map) throws IOException, ParseException {
return mt4201Service.pffmcreate(map);
... ... @@ -28,7 +28,7 @@ public class MT4201Controller {
@PutMapping("/removeMt4201")
@ResponseBody
public int remove4201(@RequestBody Map<String, Object> map) throws IOException, ParseException {
public Map<String, Object> remove4201(@RequestBody Map<String, Object> map) throws IOException, ParseException {
return mt4201Service.remove4201(map);
... ...
... ... @@ -22,7 +22,7 @@ public class MT520XController {
*/
@RequestMapping("/createMt520x")
@ResponseBody
public int create(@RequestBody Map<String, Object> map){
public Map<String, Object> create(@RequestBody Map<String, Object> map){
try {
... ... @@ -30,7 +30,7 @@ public class MT520XController {
}catch (Exception e){
e.printStackTrace();
return 0;
return null;
}
}
... ... @@ -42,7 +42,7 @@ public class MT520XController {
*/
@PutMapping("/removeMt520x")
@ResponseBody
public int remove520x(@RequestBody Map<String, Object> map){
public Map<String, Object> remove520x(@RequestBody Map<String, Object> map){
try {
... ... @@ -50,7 +50,7 @@ public class MT520XController {
}catch (Exception e){
e.printStackTrace();
return 0;
return null;
}
}
... ...
... ... @@ -4,6 +4,7 @@ import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT2201;
import org.omg.CORBA.OBJECT_NOT_EXIST;
import java.io.IOException;
import java.text.ParseException;
import java.util.Map;
public interface MT2201Service {
... ... @@ -20,10 +21,10 @@ public interface MT2201Service {
int updateByPrimaryKey(NMMS_CUSTOM_MT2201 record);
int creatMt2201(Map<String, Object> map) throws IOException;
Map<String, Object> creatMt2201(Map<String, Object> map) throws IOException, ParseException;
int editMt2201(Map<String, Object> map) throws IOException;
Map<String, Object> editMt2201(Map<String, Object> map) throws IOException, ParseException;
int removeMt2201(Map<String, Object> map) throws IOException;
Map<String, Object> removeMt2201(Map<String, Object> map) throws IOException, ParseException;
}
... ...
... ... @@ -3,11 +3,12 @@ package com.sunyo.wlpt.message.builder.service;
import sun.jvm.hotspot.oops.ObjectHeap;
import java.io.IOException;
import java.text.ParseException;
import java.util.Map;
public interface MT3201Service {
int fohcreate(Map<String, Object> map) throws IOException;
Map<String, Object> fohcreate(Map<String, Object> map) throws IOException, ParseException;
int remove(Map<String, Object> map) throws IOException;
Map<String, Object> remove(Map<String, Object> map) throws IOException, ParseException;
}
... ...
... ... @@ -6,8 +6,8 @@ import java.util.Map;
public interface MT4201Service {
int pffmcreate(Map<String, Object> map) throws IOException;
Map<String, Object> pffmcreate(Map<String, Object> map) throws IOException, ParseException;
int remove4201(Map<String, Object> map) throws IOException, ParseException;
Map<String, Object> remove4201(Map<String, Object> map) throws IOException, ParseException;
}
... ...
... ... @@ -3,13 +3,14 @@ package com.sunyo.wlpt.message.builder.service;
import java.io.IOException;
import java.text.ParseException;
import java.util.Map;
public interface MT520XService {
public int create(Map<String, Object> map);
public Map<String, Object> create(Map<String, Object> map);
public int remove520x(Map<String, Object> map) throws IOException;
public Map<String, Object> remove520x(Map<String, Object> map) throws IOException, ParseException;
}
... ...
... ... @@ -76,7 +76,7 @@ public class MT1201ServiceImp extends CustomXmlMaker implements MT1201Service{
map.put("mt", customMt1201);
map.put("awbAwbinfo", awbAwbinfo);
// 生成报文头部
String msgId = makeMsgID("MT2201", orgsn, customMt1201.getAwba());
String msgId = makeMsgID("MT1201", orgsn, customMt1201.getAwba());
String senderId = makeSenderID(customCode, orgsn, "");
String receiverID = customCode;
map.put("msgId", msgId);
... ...
... ... @@ -5,14 +5,19 @@ import com.fasterxml.jackson.databind.ObjectMapper;
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.service.MT2201Service;
import com.sunyo.wlpt.message.builder.util.CustomXmlMaker;
import com.sunyo.wlpt.message.builder.util.ReturnUtil;
import com.tianbo.util.Date.DateUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cglib.beans.BeanMap;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
@Service
... ... @@ -55,21 +60,21 @@ public class MT2201ServiceImp extends CustomXmlMaker implements MT2201Service {
private String orgCode;
@Override
public int creatMt2201(Map<String, Object> map) throws IOException{
public Map<String, Object> creatMt2201(Map<String, Object> map) throws IOException, ParseException {
map.put("templatePath", "/manifest/MT2201.ftlx");
map.put("sendPath", "./send/add/");
return mt2201(map);
}
@Override
public int editMt2201(Map<String, Object> map) throws IOException {
public Map<String, Object> editMt2201(Map<String, Object> map) throws IOException, ParseException {
map.put("templatePath", "/edit/MT2201.ftlx");
map.put("sendPath", "./send/edit/");
return mt2201(map);
}
@Override
public int removeMt2201(Map<String, Object> map) throws IOException {
public Map<String, Object> removeMt2201(Map<String, Object> map) throws IOException, ParseException {
String customCode = map.get("customCode").toString();
// 生成报文头部
... ... @@ -83,16 +88,25 @@ public class MT2201ServiceImp extends CustomXmlMaker implements MT2201Service {
map.put("sendTime", DateUtil.getCurrentTime17());
// 舱单传输人名称
map.put("orgCode", orgCode);
Map<String, Object> hashMap = new HashMap<>();
// 生成报文
if (makeXmlToFile("/remove/MT2201.ftlx", msgId+".xml", map, "./send/remove/")>0){
return 1;
map.put("functionCode", "3");
map.put("busType","MT2201");
System.out.println();
NMMS_CUSTOM_RESPONSE nmmsCustomResponse = ReturnUtil.nmmsCustomResponse(map);
hashMap.put("status", "1");
hashMap.put("customResponse", nmmsCustomResponse);
return hashMap;
}else {
return 0;
hashMap.put("staus", "0");
return hashMap;
}
}
public int mt2201(Map<String, Object> map) throws IOException {
public Map<String, Object> mt2201(Map<String, Object> map) throws IOException, ParseException {
ObjectMapper objectMapper = new ObjectMapper();
// 预配
NMMS_CUSTOM_MT2201 custom_mt2201 = objectMapper.convertValue(map.get("mt2201"), NMMS_CUSTOM_MT2201.class);
... ... @@ -114,11 +128,34 @@ public class MT2201ServiceImp extends CustomXmlMaker implements MT2201Service {
map.put("receiverID", receiverID);
// 舱单传输人名称
map.put("orgCode", orgCode);
Map<String, Object> maps = new HashMap<>();
// 生成报文
if (makeXmlToFile(map.get("templatePath").toString(), msgId+".xml", map, map.get("sendPath").toString())>0){
return 1;
map.put("functionCode", "9");
map.put("busType","MT2201");
NMMS_CUSTOM_RESPONSE nmmsCustomResponse = ReturnUtil.nmmsCustomResponse(map);
// 航班日期
nmmsCustomResponse.setFlightdate(custom_mt2201.getFlightdate());
// 航班号
nmmsCustomResponse.setFlightno(custom_mt2201.getFlightno());
// 航班承运人
nmmsCustomResponse.setCarrier(custom_mt2201.getCarrier());
// 主单号
nmmsCustomResponse.setAwbano(custom_mt2201.getAwba());
// 分单号
nmmsCustomResponse.setAwbhno(custom_mt2201.getAwbh());
// 件数
nmmsCustomResponse.setBuspiece(Integer.valueOf(custom_mt2201.getPiece().toString()));
// 重量
nmmsCustomResponse.setBusweight(Long.valueOf(custom_mt2201.getWeight().toString()));
maps.put("status", "1");
maps.put("customResponse", nmmsCustomResponse);
return maps;
}else {
return 0;
maps.put("status", "0");
return maps;
}
}
}
... ...
... ... @@ -2,13 +2,16 @@ package com.sunyo.wlpt.message.builder.service.imp;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT3201;
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_RESPONSE;
import com.sunyo.wlpt.message.builder.service.MT3201Service;
import com.sunyo.wlpt.message.builder.util.CustomXmlMaker;
import com.sunyo.wlpt.message.builder.util.ReturnUtil;
import com.tianbo.util.Date.DateUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
... ... @@ -22,7 +25,7 @@ public class MT3201ServiceImp extends CustomXmlMaker implements MT3201Service {
private String orgCode;
@Override
public int fohcreate(Map<String, Object> map) throws IOException {
public Map<String, Object> fohcreate(Map<String, Object> map) throws IOException, ParseException {
ObjectMapper objectMapper = new ObjectMapper();
... ... @@ -40,15 +43,39 @@ public class MT3201ServiceImp extends CustomXmlMaker implements MT3201Service {
map.put("msgId", msgId);
map.put("senderId", senderId);
map.put("receiverID", receiverID);
Map<String, Object> map3201= new HashMap<>();
if (makeXmlToFile("/manifest/MT3201.ftlx", msgId+".xml", map,"./send/add/")>0){
return 1;
map.put("functionCode", "9");
map.put("busType","MT3201");
NMMS_CUSTOM_RESPONSE nmmsCustomResponse = ReturnUtil.nmmsCustomResponse(map);
System.out.println();
// 航班日期
nmmsCustomResponse.setFlightdate(customMt3201.getFlightdate());
// 航班号
nmmsCustomResponse.setFlightno(customMt3201.getFlightno());
// 航班承运人
nmmsCustomResponse.setCarrier(customMt3201.getCarrier());
// 主单号
nmmsCustomResponse.setAwbano(customMt3201.getAwba());
// 分单号
nmmsCustomResponse.setAwbhno(customMt3201.getAwbh());
// 件数
nmmsCustomResponse.setBuspiece(Integer.valueOf(customMt3201.getPiece().toString()));
// 重量
nmmsCustomResponse.setBusweight(Long.valueOf(customMt3201.getWeight().toString()));
map3201.put("status", "1");
map3201.put("customResponse", nmmsCustomResponse);
return map3201;
}else {
return 0;
map3201.put("status", "0");
return map3201;
}
}
@Override
public int remove(Map<String, Object> map) throws IOException {
public Map<String, Object> remove(Map<String, Object> map) throws IOException, ParseException {
// 关区代码
String customCode = map.get("customCode").toString();
// 报文头时间 精确到毫秒
... ... @@ -60,10 +87,17 @@ public class MT3201ServiceImp extends CustomXmlMaker implements MT3201Service {
map.put("msgId", msgId);
map.put("senderId", senderId);
map.put("receiverID", receiverID);
Map<String, Object> map3201 = new HashMap<>();
if (makeXmlToFile("/remove/MT3201.ftlx", msgId+".xml", map,"./send/remove/")>0){
return 1;
map.put("functionCode", "3");
map.put("busType","MT3201");
NMMS_CUSTOM_RESPONSE nmmsCustomResponse = ReturnUtil.nmmsCustomResponse(map);
map3201.put("status", "1");
map3201.put("customResponse", nmmsCustomResponse);
return map3201;
}else {
return 0;
map3201.put("staus", "0");
return map3201;
}
}
... ...
... ... @@ -2,8 +2,10 @@ package com.sunyo.wlpt.message.builder.service.imp;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT4201;
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_RESPONSE;
import com.sunyo.wlpt.message.builder.service.MT4201Service;
import com.sunyo.wlpt.message.builder.util.CustomXmlMaker;
import com.sunyo.wlpt.message.builder.util.ReturnUtil;
import com.tianbo.util.Date.DateUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
... ... @@ -11,6 +13,7 @@ import org.springframework.stereotype.Service;
import javax.xml.crypto.Data;
import java.io.IOException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
@Service
... ... @@ -21,7 +24,7 @@ public class MT4201ServiceImp extends CustomXmlMaker implements MT4201Service {
private String orgsn;
@Override
public int pffmcreate(Map<String, Object> map) throws IOException {
public Map<String, Object> pffmcreate(Map<String, Object> map) throws IOException, ParseException {
ObjectMapper objectMapper = new ObjectMapper();
... ... @@ -41,23 +44,44 @@ public class MT4201ServiceImp extends CustomXmlMaker implements MT4201Service {
map.put("msgId", msgId);
map.put("senderId", senderId);
map.put("receiverID", receiverID);
Map<String, Object> map4201 = new HashMap<>();
if (makeXmlToFile("/manifest/MT4201.ftlx", msgId+".xml", map, "./send/add/")>0){
return 1;
map.put("functionCode", "2");
map.put("busType","MT4201");
NMMS_CUSTOM_RESPONSE nmmsCustomResponse = ReturnUtil.nmmsCustomResponse(map);
System.out.println();
// 航班日期
nmmsCustomResponse.setFlightdate(customMt4201.getFlightdate());
// 航班号
nmmsCustomResponse.setFlightno(customMt4201.getFlightno());
// 航班承运人
nmmsCustomResponse.setCarrier(customMt4201.getCarrier());
// 主单号
nmmsCustomResponse.setAwbano(customMt4201.getAwba());
// 分单号
nmmsCustomResponse.setAwbhno(customMt4201.getAwbh());
// 件数
nmmsCustomResponse.setBuspiece(Integer.valueOf(customMt4201.getLodingpiece().toString()));
// 重量
nmmsCustomResponse.setBusweight(Long.valueOf(customMt4201.getLodingweight().toString()));
map4201.put("status", "1");
map4201.put("customResponse", nmmsCustomResponse);
return map4201;
}else {
return 0;
map4201.put("status", "0");
return map4201;
}
}
@Override
public int remove4201(Map<String, Object> map) throws IOException, ParseException {
public Map<String, Object> remove4201(Map<String, Object> map) throws IOException, ParseException {
// 关区代码
String customCode = map.get("customCode").toString();
// 报文头时间 精确到毫秒
map.put("sendTime", DateUtil.getCurrentTime17());
String flightDate = DateUtil.get_yyyyMMdd(map.get("flightDate").toString());
map.put("flightDate",flightDate);
// 生成报文头部
String msgId = makeMsgID("MT4201", orgsn, map.get("awba").toString());
String senderId = makeSenderID(customCode, orgsn);
... ... @@ -65,10 +89,17 @@ public class MT4201ServiceImp extends CustomXmlMaker implements MT4201Service {
map.put("msgId", msgId);
map.put("senderId", senderId);
map.put("receiverID", receiverID);
Map<String, Object> map4201 = new HashMap<>();
if (makeXmlToFile("/remove/MT4201.ftlx", msgId+".xml", map, "./send/remove/")>0){
return 1;
map.put("functionCode", "3");
map.put("busType","MT4201");
NMMS_CUSTOM_RESPONSE nmmsCustomResponse = ReturnUtil.nmmsCustomResponse(map);
map4201.put("status", "1");
map4201.put("customResponse", nmmsCustomResponse);
return map4201;
}else {
return 0;
map4201.put("staus", "0");
return map4201;
}
}
}
... ...
... ... @@ -2,13 +2,16 @@ package com.sunyo.wlpt.message.builder.service.imp;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT520X;
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_RESPONSE;
import com.sunyo.wlpt.message.builder.service.MT520XService;
import com.sunyo.wlpt.message.builder.util.CustomXmlMaker;
import com.sunyo.wlpt.message.builder.util.ReturnUtil;
import com.tianbo.util.Date.DateUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
... ... @@ -22,7 +25,7 @@ public class MT520XServiceImp extends CustomXmlMaker implements MT520XService{
private String orgCode;
@Override
public int create(Map<String, Object> map) {
public Map<String, Object> create(Map<String, Object> map) {
try {
... ... @@ -51,11 +54,11 @@ public class MT520XServiceImp extends CustomXmlMaker implements MT520XService{
hashMap.put("msessageType", msessageType);
hashMap.put("senderId", senderId);
hashMap.put("receiverID", receiverID);
if (makeXmlToFile("/manifest/MT5201.ftlx", msgId+".xml", hashMap, "./send/add/")>0){
return 1;
}else {
return 0;
}
// if (makeXmlToFile("/manifest/MT5201.ftlx", msgId+".xml", hashMap, "./send/add/")>0){
// return 1;
// }else {
// return 0;
// }
}else {
// 生成报文头部
... ... @@ -67,22 +70,46 @@ public class MT520XServiceImp extends CustomXmlMaker implements MT520XService{
hashMap.put("msessageType", msessageType);
hashMap.put("senderId", senderId);
hashMap.put("receiverID", receiverID);
Map<String, Object> maps = new HashMap<>();
if (makeXmlToFile("/manifest/MT5202.ftlx", msgId+".xml", hashMap, "./send/add/")>0){
return 1;
hashMap.put("functionCode", "2");
hashMap.put("busType","MT5202");
NMMS_CUSTOM_RESPONSE nmmsCustomResponse = ReturnUtil.nmmsCustomResponse(hashMap);
// 航班日期
nmmsCustomResponse.setFlightdate(customMt520X.getFlightdate());
// 航班号
nmmsCustomResponse.setFlightno(customMt520X.getFlightno());
// 航班承运人
nmmsCustomResponse.setCarrier(customMt520X.getCarrier());
// 主单号
nmmsCustomResponse.setAwbano(customMt520X.getAwba());
// 分单号
nmmsCustomResponse.setAwbhno(customMt520X.getAwbh());
// 件数
nmmsCustomResponse.setBuspiece(customMt520X.getPiece());
// 重量
nmmsCustomResponse.setBusweight(customMt520X.getWeight());
maps.put("status", "1");
maps.put("customResponse", nmmsCustomResponse);
return maps;
}else {
return 0;
maps.put("staus", "0");
return maps;
}
}
}catch (Exception e){
e.printStackTrace();
return 0;
return null;
}
return null;
}
@Override
public int remove520x(Map<String, Object> map) throws IOException {
public Map<String, Object> remove520x(Map<String, Object> map) throws IOException, ParseException {
String customCode = map.get("customCode").toString();
map.put("customCode", customCode);
... ... @@ -96,11 +123,13 @@ public class MT520XServiceImp extends CustomXmlMaker implements MT520XService{
map.put("msgId", msgId);
map.put("senderId", senderId);
map.put("receiverID", receiverID);
if (makeXmlToFile("/remove/MT5201.ftlx", msgId+".xml", map, "./send/remove/")>0){
return 1;
}else {
return 0;
}
// if (makeXmlToFile("/remove/MT5201.ftlx", msgId+".xml", map, "./send/remove/")>0){
//
//
// return 1;
// }else {
// return 0;
// }
}else {
// 生成报文头部
String msgId = makeMsgID("MT5202", orgsn, map.get("awba").toString());
... ... @@ -109,12 +138,21 @@ public class MT520XServiceImp extends CustomXmlMaker implements MT520XService{
map.put("msgId", msgId);
map.put("senderId", senderId);
map.put("receiverID", receiverID);
Map<String, Object> maps = new HashMap<>();
if (makeXmlToFile("/remove/MT5202.ftlx", msgId+".xml", map, "./send/remove/")>0){
return 1;
map.put("functionCode", "3");
map.put("busType","MT5202");
NMMS_CUSTOM_RESPONSE nmmsCustomResponse = ReturnUtil.nmmsCustomResponse(map);
maps.put("status", "1");
maps.put("customResponse", nmmsCustomResponse);
return maps;
}else {
return 0;
maps.put("staus", "0");
return maps;
}
}
return null;
}
}
... ...
package com.sunyo.wlpt.message.builder.util;
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_RESPONSE;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
public class ReturnUtil {
/**
* 报文发送序号
* 回执发送者id
* 回执接送者id
* 对应海关的functioncode业务代码
* 业务件数
* 报文发送时间
* 业务重量
* 业务类型
* 主单号
* 分单号
* 航班号
* 航班日期
* @param map
* @return
* @throws ParseException
*/
public static NMMS_CUSTOM_RESPONSE nmmsCustomResponse(Map<String, Object> map) throws ParseException {
NMMS_CUSTOM_RESPONSE nmmsCustomResponse = new NMMS_CUSTOM_RESPONSE();
if (map.containsKey("msgId")){
nmmsCustomResponse.setCusmsgid(map.get("msgId").toString());
}
if (map.containsKey("senderId")){
nmmsCustomResponse.setCussenderid(map.get("senderId").toString());
}
if (map.containsKey("receiverID")){
nmmsCustomResponse.setCusreciverid(map.get("receiverID").toString());
}
if (map.containsKey("functionCode")){
nmmsCustomResponse.setCusfunctioncode(map.get("functionCode").toString());
}
nmmsCustomResponse.setCusversion("1.0");
nmmsCustomResponse.setBusdate(new Date());
if (map.containsKey("piece")){
nmmsCustomResponse.setBuspiece(Integer.valueOf(map.get("piece").toString()));
}
if (map.containsKey("weight")){
nmmsCustomResponse.setBusweight(Long.valueOf(map.get("weight").toString()));
}
nmmsCustomResponse.setBustype(map.get("busType").toString());
if (map.containsKey("awba")){
nmmsCustomResponse.setAwbano(map.get("awba").toString());
}
if (map.containsKey("awbh")){
nmmsCustomResponse.setAwbhno(map.get("awbh").toString());
}
if (map.containsKey("flightNo")){
nmmsCustomResponse.setFlightno(map.get("flightNo").toString());
}
if (map.containsKey("flightDate")){
String flightDate = map.get("flightDate").toString();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date parse = simpleDateFormat.parse(flightDate);
nmmsCustomResponse.setFlightdate(parse);
}
if (map.containsKey("reason")){
nmmsCustomResponse.setOperreason(map.get("reason").toString());
}
if (map.containsKey("contactName")){
nmmsCustomResponse.setOperperson(map.get("contactName").toString());
}
if (map.containsKey("contactTel")) {
nmmsCustomResponse.setOpertel(map.get("contactTel").toString());
}
return nmmsCustomResponse;
}
}
... ...
... ... @@ -31,7 +31,7 @@
<#if mt['awbh']??>
<#if mt.awbh?length gt 1>
<AssociatedTransportDocument>
<ID>${mt.awba}_${mtawbh}</ID>
<ID>${mt.awba}_${mt.awbh}</ID>
</AssociatedTransportDocument>
</#if>
</#if>
... ...
<Manifest xmlns="urn:Declaration:datamodel:standard:CN:MT5202:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Head>
<MessageID>${map.msgId}</MessageID>
<MessageID>${msgId}</MessageID>
<FunctionCode>3</FunctionCode>
<MessageType>MT5202</MessageType>
<SenderID>${map.senderId}</SenderID>
<ReceiverID>${map.receiverID}</ReceiverID>
<SendTime>${map.sendTime}</SendTime>
<SenderID>${senderId}</SenderID>
<ReceiverID>${receiverID}</ReceiverID>
<SendTime>${sendTime}</SendTime>
<Version>1.0</Version>
</Head>
<Declaration>
<DeclarationOfficeID>${map.customCode}</DeclarationOfficeID>
<DeclarationOfficeID>${customCode}</DeclarationOfficeID>
<BorderTransportMeans>
<JourneyID>${map.flightNo}/${map.flightDate}</JourneyID>
<JourneyID>${flightNo}/${flightDate}</JourneyID>
</BorderTransportMeans>
<Consignment>
<TransportContractDocument>
<ID>${map.awba}</ID>
<ID>${awba}</ID>
</TransportContractDocument>
<#if map.map['awbh']??>
<#if map.awbh?length gt 1>
<#if awbh?length gt 1>
<AssociatedTransportDocument>
<ID>${map.awba}_${map.awbh}</ID>
<ID>${awba}_${awbh}</ID>
</AssociatedTransportDocument>
</#if>
</#if>
</Consignment>
<AdditionalInformation>
<Reason>${map.reason}</Reason>
<ContactName>${map.contactName}</ContactName>
<ContactTel>${map.contactTel}</ContactTel>
<Reason>${reason}</Reason>
<ContactName>${contactName}</ContactName>
<ContactTel>${contactTel}</ContactTel>
<#if content?length gt 1>
<Content>${content}</Content>
</#if>
... ...