作者 shenhailong

生成报文

正在显示 26 个修改的文件 包含 631 行增加217 行删除
... ... @@ -110,7 +110,6 @@ pagehelper:
reasonable: true
support-methods-arguments: true
params: count=countSql
#debug配置,debug或者为true的时候,logback才会记录和写入日志文件
trace: false
debug: true
... ...
... ... @@ -29,14 +29,7 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
... ...
... ... @@ -2,10 +2,9 @@ package com.sunyo.wlpt.message.builder;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@SpringBootApplication
@EnableDiscoveryClient
//@EnableDiscoveryClient
public class BuilderApplication {
public static void main(String[] args) {
... ...
package com.sunyo.wlpt.message.builder.controller;
import com.sunyo.wlpt.message.builder.service.MT1201Service;
import com.sunyo.wlpt.message.builder.service.MT3201Service;
import com.sunyo.wlpt.message.builder.service.MT4201Service;
import com.sunyo.wlpt.message.builder.service.MT520XService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RestController
@RequestMapping("/mtcreate")
public class CreateftlxController {
@Autowired
MT520XService mt520XService;
@Autowired
MT1201Service mt1201Service;
@Autowired
MT3201Service mt3201Service;
@Autowired
MT4201Service mt4201Service;
/**
* 进出港理货
* @param map
* @return
*/
@RequestMapping("/520xcreate")
public Boolean create(@RequestBody Map<String, Object> map){
try {
return mt520XService.create(map);
}catch (Exception e){
e.printStackTrace();
return false;
}
}
/**
* 原始 FFm
* @param map
* @return
*/
@RequestMapping("/1201create")
public Boolean ffmcreate(@RequestBody Map<String, Object> map){
try {
return true;
}catch (Exception e){
e.printStackTrace();
return false;
}
}
@RequestMapping("/3201create")
public Boolean fohcreate(@RequestBody Map<String, Object> map){
try {
return mt3201Service.fohcreate(map);
}catch (Exception e){
e.printStackTrace();
return false;
}
}
@RequestMapping("/4201create")
public Boolean pffmcreate(@RequestBody Map<String, Object> map){
try {
return mt4201Service.pffmcreate(map);
}catch (Exception e){
e.printStackTrace();
return false;
}
}
}
... ...
package com.sunyo.wlpt.message.builder.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "/")
public class IndexController {
@GetMapping("index")
public String index(){
return "11";
// return "数据仓库接收,落地报文给新舱单";
}
}
package com.sunyo.wlpt.message.builder.controller;
import com.sunyo.wlpt.message.builder.util.CustomXmlMaker;
import freemarker.template.Configuration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RestController
@RequestMapping("/mt1201")
public class MT1201Controller extends CustomXmlMaker {
private static String businessType = "MT1201";
@Autowired
private Configuration freemakerTemplate;
@RequestMapping("/send")
public Boolean mt1201New(@RequestBody Map awb_manifest) throws Exception{
}
}
package com.sunyo.wlpt.message.builder.controller;
import com.sunyo.wlpt.message.builder.model.CUSTOM_RESPONSE;
import com.sunyo.wlpt.message.builder.util.CustomXmlMaker;
import freemarker.template.Configuration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.Map;
@RestController
@RequestMapping("/mt2201")
public class MT2201Controller extends CustomXmlMaker {
@Autowired
private Configuration freemakerTemplate;
private static String businessType = "MT2201";
/**
* MAP包含运单实体与舱单实体
* @param awb_manifest {awb:AWB_AWBINFO,man:}
* @return
* @throws Exception
*/
@RequestMapping("/send")
public Boolean mt1201New(@RequestBody Map awb_manifest) throws Exception{
try {
CUSTOM_RESPONSE response = new CUSTOM_RESPONSE();
response.setAwbano("17212345678");
response.setCusfunctioncode("2");
response.setCusreciverid("4604");
response.setCusversion("1.2");
response.setBusdate(new Date());
response.setBustype(businessType);
String msgId = makeMsgID(businessType,"460470678920X","17212345678");
response.setCusmsgid(msgId);
response.setCussenderid(makeSenderID("4604","460470678920X"));
String filename = response.getCusmsgid()+".xml";
makeXmlToFile("/manifest/MT2201.ftlx",filename,awb_manifest);
}catch (Exception e){
e.printStackTrace();
return false;
}
return true;
}
}
package com.sunyo.wlpt.message.builder.service;
public interface MT1201Service {
}
... ...
package com.sunyo.wlpt.message.builder.service;
import java.io.IOException;
import java.util.Map;
public interface MT3201Service {
Boolean fohcreate(Map<String, Object> map) throws IOException;
}
... ...
package com.sunyo.wlpt.message.builder.service;
import java.io.IOException;
import java.util.Map;
public interface MT4201Service {
Boolean pffmcreate(Map<String, Object> map) throws IOException;
}
... ...
package com.sunyo.wlpt.message.builder.service;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.Map;
public interface MakeXml1201Service {
boolean makeXml1201_new(@RequestBody Map awb_manifest) throws Exception;
public interface MT520XService {
public Boolean create(Map<String, Object> map);
}
... ...
package com.sunyo.wlpt.message.builder.service.imp;
import com.sunyo.wlpt.message.builder.service.MT1201Service;
import org.springframework.stereotype.Service;
@Service
public class MT1201ServiceImp implements MT1201Service{
}
... ...
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.message.builder.service.MT3201Service;
import com.sunyo.wlpt.message.builder.util.CustomXmlMaker;
import com.tianbo.util.Date.DateUtil;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@Service
public class MT3201ServiceImp extends CustomXmlMaker implements MT3201Service {
@Override
public Boolean fohcreate(Map<String, Object> map) throws IOException {
ObjectMapper objectMapper = new ObjectMapper();
NMMS_CUSTOM_MT3201 customMt3201 = objectMapper.convertValue(map.get("mt3201"), NMMS_CUSTOM_MT3201.class);
// 关区代码
String customCode = customMt3201.getCustomcode();
// 报文头时间 精确到毫秒
map.put("sendTime", DateUtil.getCurrentTime17());
// 封装实体
map.put("mt", customMt3201);
// 生成报文头部
String msgId = makeMsgID("MT3201", "460470678920X", customMt3201.getAwba());
String msessageType = "MT3201";
String senderId = makeSenderID(customCode, "460470678920X", "DXPENT0000460002");
String receiverID = customCode;
map.put("msgId", msgId);
map.put("msessageType", msessageType);
map.put("senderId", senderId);
map.put("receiverID", receiverID);
if (makeXmlToFile("/manifest/MT3201.ftlx", msgId+".xml", map)>0){
return true;
}else {
return false;
}
}
}
... ...
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.message.builder.service.MT4201Service;
import com.sunyo.wlpt.message.builder.util.CustomXmlMaker;
import com.tianbo.util.Date.DateUtil;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.Map;
@Service
public class MT4201ServiceImp extends CustomXmlMaker implements MT4201Service {
@Override
public Boolean pffmcreate(Map<String, Object> map) throws IOException {
ObjectMapper objectMapper = new ObjectMapper();
NMMS_CUSTOM_MT4201 customMt4201 = objectMapper.convertValue(map.get("mt4201"), NMMS_CUSTOM_MT4201.class);
// 关区代码
String customCode = customMt4201.getCustomcode();
// 报文头时间 精确到毫秒
map.put("sendTime", DateUtil.getCurrentTime17());
// 封装实体
map.put("mt", customMt4201);
// 生成报文头部
String msgId = makeMsgID("MT4201", "460470678920X", customMt4201.getAwba());
String msessageType = "MT4201";
String senderId = makeSenderID(customCode, "460470678920X", "DXPENT0000460002");
String receiverID = customCode;
map.put("msgId", msgId);
map.put("msessageType", msessageType);
map.put("senderId", senderId);
map.put("receiverID", receiverID);
if (makeXmlToFile("/manifest/MT4201.ftlx", msgId+".xml", map)>0){
return true;
}else {
return false;
}
}
}
... ...
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.message.builder.service.MT520XService;
import com.sunyo.wlpt.message.builder.util.CustomXmlMaker;
import com.tianbo.util.Date.DateUtil;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@Service
public class MT520XServiceImp extends CustomXmlMaker implements MT520XService{
@Override
public Boolean create(Map<String, Object> map) {
try {
ObjectMapper objectMapper = new ObjectMapper();
NMMS_CUSTOM_MT520X customMt520X = objectMapper.convertValue(map.get("mt520x"), NMMS_CUSTOM_MT520X.class);
Map<String, Object> hashMap = new HashMap();
// 关区代码
String customCode = customMt520X.getCustomcode();
// 报文头时间 精确到毫秒
hashMap.put("sendTime", DateUtil.getCurrentTime17());
// 封装实体
hashMap.put("mt", customMt520X);
if ("5201".equals(customMt520X.getExt1())){
// 生成报文头部
String msgId = makeMsgID("MT5201", "460470678920X", customMt520X.getAwba());
String msessageType = "MT5201";
String senderId = makeSenderID(customCode, "460470678920X", "DXPENT0000460002");
String receiverID = customCode;
hashMap.put("msgId", msgId);
hashMap.put("msessageType", msessageType);
hashMap.put("senderId", senderId);
hashMap.put("receiverID", receiverID);
if (makeXmlToFile("/manifest/MT5201.ftlx", msgId+".xml", hashMap)>0){
return true;
}else {
return false;
}
}else {
// 生成报文头部
String msgId = makeMsgID("MT5202", "460470678920X", customMt520X.getAwba());
String msessageType = "MT5202";
String senderId = makeSenderID(customCode, "460470678920X", "DXPENT0000460002");
String receiverID = customCode;
hashMap.put("msgId", msgId);
hashMap.put("msessageType", msessageType);
hashMap.put("senderId", senderId);
hashMap.put("receiverID", receiverID);
if (makeXmlToFile("/manifest/MT5202.ftlx", msgId+".xml", hashMap)>0){
return true;
}else {
return false;
}
}
}catch (Exception e){
e.printStackTrace();
return false;
}
}
}
... ...
package com.sunyo.wlpt.message.builder.service.imp;
import com.sunyo.wlpt.base.model.AWB_AWBINFO;
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT1201;
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_RESPONSE;
import com.sunyo.wlpt.message.builder.model.CUSTOM_RESPONSE;
import com.sunyo.wlpt.message.builder.service.MakeXml1201Service;
import com.sunyo.wlpt.message.builder.util.CustomXmlMaker;
import freemarker.template.Configuration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class MakeXml1201ServiceImp extends CustomXmlMaker implements MakeXml1201Service {
private static String businessType = "MT1201";
@Autowired
private Configuration freemakerTemplate;
/**
* MAP包含运单实体与舱单实体
* @param awb_manifest {awb:AWB_AWBINFO,man:NMMS_CUSTOM_MT1201}
* @return
* @throws Exception
*/
@Override
public boolean makeXml1201_new(@RequestBody Map awb_manifest) throws Exception{
try {
NMMS_CUSTOM_MT1201 mt1201 = new NMMS_CUSTOM_MT1201();
AWB_AWBINFO awb = new AWB_AWBINFO();
NMMS_CUSTOM_RESPONSE customResponse = new NMMS_CUSTOM_RESPONSE();
Map<String,Object> xmlmap = new HashMap<>();
xmlmap.put("awb",awb);
xmlmap.put("man",mt1201);
xmlmap.put("res",customResponse);
mt1201.setAwba("17212345678");
mt1201.setCarrier("CV");
mt1201.setCustomcode("4604");
mt1201.setFlightno("9733");
mt1201.setFlightdate(new Date());
mt1201.setDestinationstation("CGO");
String msgId = makeMsgID(businessType,"460470678920X","17212345678");
makeXmlToFile("/manifest/MT2201.ftlx",filename,awb_manifest);
}catch (Exception e){
e.printStackTrace();
return false;
}
return true;
}
}
... ... @@ -12,7 +12,6 @@ import org.springframework.ui.freemarker.FreeMarkerTemplateUtils;
import java.io.File;
import java.io.IOException;
import java.util.Map;
@Component
public class CustomXmlMaker {
... ... @@ -25,6 +24,12 @@ public class CustomXmlMaker {
@Value("${tcs.mq-number}")
private static String TCSMQNumber;
public CustomXmlMaker() {
if (freemakerTemplate==null){
this.freemakerTemplate = new Configuration();
}
}
/**
* 所有填制项中不得出现“<”、“&”符号,如有实际需要,请填写对应的转义符“&lt;”、“&amp;”。
十、报文中不允许出现空节点,如<Consignee></Consignee>或<Consignee/>。
... ... @@ -34,7 +39,7 @@ public class CustomXmlMaker {
* @return 0失败,1成功
* @throws IOException
*/
public int makeXmlToFile(String tplName,String fileName,Map manifestMap) throws IOException{
public int makeXmlToFile(String tplName,String fileName,Object manifestMap) throws IOException{
try {
Template template = freemakerTemplate.getTemplate(tplName);
String content = FreeMarkerTemplateUtils.processTemplateIntoString(template,manifestMap);
... ...
package com.sunyo.wlpt.message.builder.util;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* @ProjectName:
* @Package: com.backstage.config
* @ClassName: ApplicationContextProvider
* @Description: 获取bean对象的工具类
* @Author: wangzhilong
* @CreateDate: 2018/8/31 13:26
* @Version: 1.0
*/
/**
* Author:ZhuShangJin
* Date:2018/7/3
*/
@Component
public class SpringBeanUtitl implements ApplicationContextAware{
private static ApplicationContext applicationContext = null;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws
BeansException {
// TODO Auto-generated method stub
SpringBeanUtitl.applicationContext = applicationContext;
}
/**
* 从静态变量applicationContext中得到Bean, 自动转型为所赋值对象的类型.
*/
@SuppressWarnings("unchecked")
public static <T> T getBean(String name) {
if(name == null || applicationContext == null){
return null;
}
return (T) applicationContext.getBean(name);
}
/**
* 从静态变量applicationContext中得到Bean, 自动转型为所赋值对象的类型.
*/
public static <T> T getBean(Class<T> clazz) {
return applicationContext.getBean(clazz);
}
}
... ...
<Manifest xmlns="urn:Declaration:datamodel:standard:CN:MT5202:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Head>
<MessageID>${t.awba}</MessageID>
<FunctionCode>${t.customeCode}</FunctionCode>
<MessageType>MT5202</MessageType>
<SenderID>460470678920X_DXPENT0000460002</SenderID>
<ReceiverID>4620</ReceiverID>
<SendTime>20190523103927763</SendTime>
<Version>1.0</Version>
</Head>
<!--<Declaration>-->
<!--<DeclarationOfficeID>4620</DeclarationOfficeID>-->
<!--<BorderTransportMeans>-->
<!--<JourneyID>CX051/20190523</JourneyID>-->
<!--<TypeCode>4</TypeCode>-->
<!--<ID>CX051</ID>-->
<!--<Name>CX051</Name>-->
<!--<ActualDateTime>201905230820086</ActualDateTime>-->
<!--<CompletedDateTime>201905230835086</CompletedDateTime>-->
<!--<LoadingLocation>-->
<!--<ID>CGO/4620</ID>-->
<!--</LoadingLocation>-->
<!--</BorderTransportMeans>-->
<!--<TallyParty>-->
<!--<ID>70678920X</ID>-->
<!--</TallyParty>-->
<!--<Consignment>-->
<!--<TransportContractDocument>-->
<!--<ID>16006939951</ID>-->
<!--</TransportContractDocument>-->
<!--<AssociatedTransportDocument>-->
<!--<ID>16006939951_TYN00072745</ID>-->
<!--</AssociatedTransportDocument>-->
<!--<ConsignmentPackaging>-->
<!--<QuantityQuantity>1</QuantityQuantity>-->
<!--</ConsignmentPackaging>-->
<!--<TotalGrossMassMeasure>26</TotalGrossMassMeasure>-->
<!--</Consignment>-->
<!--</Declaration>-->
</Manifest>
\ No newline at end of file
... ...
<Manifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:Declaration:datamodel:standard:CN:MT1201:1">
<Head>
<MessageID>CN_MT1201_1P0_460470678920X_20190918220458427</MessageID>
<FunctionCode>9</FunctionCode>
<MessageType>MT1201</MessageType>
<SenderID>460470678920X_DXPENT0000460002</SenderID>
<ReceiverID>4604</ReceiverID>
<SendTime>20190918220458427</SendTime>
<MessageID>${msgId}</MessageID>
<FunctionCode>2</FunctionCode>
<MessageType>${msessageType}</MessageType>
<SenderID>${senderId}</SenderID>
<ReceiverID>${receiverID}</ReceiverID>
<SendTime>${sendTime}</SendTime>
<Version>1.0</Version>
</Head>
<Declaration>
<RepresentativePerson>
<Name>9141010070678920XJ</Name>
<Name>???</Name>
</RepresentativePerson>
<ExitCustomsOffice>
<ID>KUL</ID>
<ID>${mt.originstation}</ID>
</ExitCustomsOffice>
<Carrier>
<ID>CV</ID>
<ID>${mt.carrier}</ID>
</Carrier>
<BorderTransportMeans>
<JourneyID>CV7303/20190919</JourneyID>
<JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID>
<TypeCode>4</TypeCode>
<FirstArrivalLocationID>CGO</FirstArrivalLocationID>
<ArrivalDateTime>20190919010458086</ArrivalDateTime>
<DepartureDateTime>20190918230458086</DepartureDateTime>
<#if (mt.destinationstation)??>
<FirstArrivalLocationID>${mt.destinationstation}</FirstArrivalLocationID>
</#if>
<ArrivalDateTime>${arrivaldate}</ArrivalDateTime><!--+2-->
<DepartureDateTime>${departuredate}</DepartureDateTime><#--+1-->
</BorderTransportMeans>
<Consignment>
<TransportContractDocument>
<ID>17236633273</ID>
<ConditionCode>10</ConditionCode>
<ID>${mt.awba}</ID>
<#if conditioncode??>
<ConditionCode>${conditioncode}</ConditionCode>
</#if>
</TransportContractDocument>
<LoadingLocation>
<ID>KUL</ID>
<ID>HKG</ID>
</LoadingLocation>
<UnloadingLocation>
<ID>CGO/4604</ID>
<ArrivalDate>20190919</ArrivalDate>
<ArrivalDate>20190523</ArrivalDate>
</UnloadingLocation>
<TransitDestination>
<ID>CGN</ID>
</TransitDestination>
<CustomsStatusCode>002</CustomsStatusCode>
<TransportSplitIndicator>0</TransportSplitIndicator>
<FreightPayment>
<MethodCode>PP</MethodCode>
</FreightPayment>
<ConsignmentPackaging>
<QuantityQuantity>3</QuantityQuantity>
<QuantityQuantity>11</QuantityQuantity>
</ConsignmentPackaging>
<TotalGrossMassMeasure>24.0</TotalGrossMassMeasure>
<TotalGrossMassMeasure>90</TotalGrossMassMeasure>
<Consignee>
<ID>8888+NONE</ID>
<Name>SCHENKER DEUTSCHLAND AG</Name>
<ID>USCI+NONE</ID>
<Name>GUANGZHOU NANLAND</Name>
<Address>
<Line>NEUER WEYERSTRASSERWEG 120 122</Line>
<Line>AIR CATERING CO LTD ZHENGZHOU BR</Line>
<CountryCode>CN</CountryCode>
</Address>
<Communication>
<ID>00000000</ID>
<ID>8637168518853</ID>
<TypeID>TE</TypeID>
</Communication>
<Contact>
<Name>NONE</Name>
<Communication>
<ID>00000000</ID>
<ID>8637168518853</ID>
<TypeID>TE</TypeID>
</Communication>
</Contact>
</Consignee>
<Consignor>
<ID>9999+NONE</ID>
<Name>SCHENKER LOGISTICS MALAYSIA SDN BHD</Name>
<Name>CATHAY PACIFIC AIRWAYS LTD</Name>
<Address>
<Line>B 10 MAS FREIGHT FOWARDERS COMPLEX</Line>
<CountryCode>MY</CountryCode>
<Line>CX COMMERCIAL STORE HK INTL APT</Line>
<CountryCode>HK</CountryCode>
</Address>
<Communication>
<ID>60387757888</ID>
<ID>85227471779KLWONG</ID>
<TypeID>TE</TypeID>
</Communication>
</Consignor>
<ConsignmentItem>
<SequenceNumeric>1</SequenceNumeric>
<ConsignmentItemPackaging>
<QuantityQuantity>3</QuantityQuantity>
<QuantityQuantity>11</QuantityQuantity>
</ConsignmentItemPackaging>
<Commodity>
<CargoDescription>CONSOL</CargoDescription>
<CargoDescription>CATERING SUPPLIES/B</CargoDescription>
</Commodity>
<GoodsMeasure>
<GrossMassMeasure>24</GrossMassMeasure>
<GrossMassMeasure>90</GrossMassMeasure>
</GoodsMeasure>
</ConsignmentItem>
</Consignment>
... ...
<Manifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:Declaration:datamodel:standard:CN:MT1201:1">
<Head>
<MessageID>${cusmsgid}</MessageID>
<FunctionCode>${cusfunctioncode}</FunctionCode>
<MessageType>${bustype}</MessageType>
<SenderID>${cussenderid}</SenderID>
<ReceiverID>${cusreciverid}</ReceiverID>
<SendTime>${busdate?string('ddMMyyyyHHmmssSSS')}</SendTime>
<Version>${cusversion}</Version>
</Head>
</Manifest>
<Manifest xmlns="urn:Declaration:datamodel:standard:CN:MT3201:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Head>
<MessageID>${msgId}</MessageID>
<FunctionCode>2</FunctionCode>
<MessageType>${msessageType}</MessageType>
<SenderID>${senderId}</SenderID>
<ReceiverID>${receiverID}</ReceiverID>
<SendTime>${sendTime}</SendTime>
<Version>1.0</Version>
</Head>
<Declaration>
<DeclarationOfficeID>${mt.customcode}</DeclarationOfficeID>
<BorderTransportMeans>
<JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID>
<TypeCode>4</TypeCode>
<ID>${mt.carrier}${mt.flightno}</ID>
<Name>${mt.carrier}${mt.flightno}</Name>
</BorderTransportMeans>
<UnloadingLocation>
<ID>${mt.destinationstation}/${mt.customcode}</ID>
<ArrivalDate>${mt.arrivetime?string('yyyyMMdd')}</ArrivalDate>
</UnloadingLocation>
<Consignment>
<TransportContractDocument>
<ID>${mt.awba}<#if (mt.awbh)??>_${mt.awbh}</#if></ID>
</TransportContractDocument>
<ConsignmentPackaging>
<QuantityQuantity>${mt.piece}</QuantityQuantity>
</ConsignmentPackaging>
<TotalGrossMassMeasure>${mt.weight}</TotalGrossMassMeasure>
<ConsignmentItem>
<SequenceNumeric>${sequencenumeric}</SequenceNumeric>
<Commodity>
<CargoDescription>${mt.goodsname}</CargoDescription>
</Commodity>
</ConsignmentItem>
</Consignment>
</Declaration>
</Manifest>
\ No newline at end of file
... ...
<Manifest xmlns="urn:Declaration:datamodel:standard:CN:MT4201:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Head>
<MessageID>${msgId}</MessageID>
<FunctionCode>2</FunctionCode>
<MessageType>${msessageType}</MessageType>
<SenderID>${senderId}</SenderID>
<ReceiverID>${receiverID}</ReceiverID>
<SendTime>${sendTime}</SendTime>
<Version>1.0</Version>
</Head>
<Declaration>
<Carrier>
<ID>${mt.carrier}</ID>
</Carrier>
<BorderTransportMeans>
<JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID>
<TypeCode>4</TypeCode>
<ID>${mt.carrier}${mt.flightno}</ID>
<Name>${mt.carrier}${mt.flightno}</Name>
</BorderTransportMeans>
<Consignment>
<TransportContractDocument>
<ID>${mt.awba}</ID>
</TransportContractDocument>
<LoadingLocation>
<ID>${mt.destinationstation}/${mt.customcode}</ID>
<LoadingDate>${mt.loadingtime?string('yyyyMMddHHmmssSSS')}</LoadingDate>
</LoadingLocation>
<ConsignmentPackaging>
<QuantityQuantity>${mt.lodingpiece}</QuantityQuantity>
</ConsignmentPackaging>
<TotalGrossMassMeasure>${mt.lodingweight}</TotalGrossMassMeasure>
<TransportSplitIndicator>???<#--0整皮 1分批--></TransportSplitIndicator>
<ConsignmentItem>
<Commodity>
<CargoDescription>${mt.goodsname}</CargoDescription>
</Commodity>
</ConsignmentItem>
</Consignment>
</Declaration>
</Manifest>
\ No newline at end of file
... ...
<Manifest xmlns="urn:Declaration:datamodel:standard:CN:MT5201:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Head>
<MessageID>${msgId}</MessageID>
<FunctionCode>2</FunctionCode>
<MessageType>${msessageType}</MessageType>
<SenderID>${senderId}</SenderID>
<ReceiverID>${receiverID}</ReceiverID>
<SendTime>${sendTime}</SendTime>
<Version>1.0</Version>
</Head>
<Declaration>
<DeclarationOfficeID>${mt.customcode}</DeclarationOfficeID>
<BorderTransportMeans>
<JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID>
<TypeCode>4</TypeCode>
<ID>${mt.carrier}${mt.flightno}</ID>
<Name>${mt.carrier}${mt.flightno}</Name>
<ActualDateTime>${mt.starttime?string('yyyyMMddHHmmssSSS')}</ActualDateTime>
<CompletedDateTime>${mt.endtime?string('yyyyMMddHHmmssSSS')}</CompletedDateTime>
<UnloadingLocation>
<ID>${mt.destinationstation}/${mt.customcode}</ID>
</UnloadingLocation>
</BorderTransportMeans>
<TallyParty>
<ID>???</ID>
</TallyParty>
<Consignment>
<TransportContractDocument>
<ID>${mt.awba}</ID>
</TransportContractDocument>
<AssociatedTransportDocument>
<ID>${mt.awba}_${mt.awbh}</ID>
</AssociatedTransportDocument>
<ConsignmentPackaging>
<QuantityQuantity>${mt.piece}</QuantityQuantity>
</ConsignmentPackaging>
<TotalGrossMassMeasure>${mt.weight}</TotalGrossMassMeasure>
</Consignment>
</Declaration>
</Manifest>
\ No newline at end of file
... ...
<Manifest xmlns="urn:Declaration:datamodel:standard:CN:MT5202:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Head>
<MessageID>${msgId}</MessageID>
<FunctionCode>2</FunctionCode>
<MessageType>${msessageType}</MessageType>
<SenderID>${senderId}</SenderID>
<ReceiverID>${receiverID}</ReceiverID>
<SendTime>${sendTime}</SendTime>
<Version>1.0</Version>
</Head>
<Declaration>
<DeclarationOfficeID>${mt.customcode}</DeclarationOfficeID>
<BorderTransportMeans>
<JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID>
<TypeCode>4</TypeCode>
<ID>${mt.carrier}${mt.flightno}</ID>
<Name>${mt.carrier}${mt.flightno}</Name>
<ActualDateTime>${mt.starttime?string('yyyyMMddHHmmssSSS')}</ActualDateTime>
<CompletedDateTime>${mt.endtime?string('yyyyMMddHHmmssSSS')}</CompletedDateTime>
<LoadingLocation>
<ID>${mt.originstation}/${mt.customcode}</ID>
</LoadingLocation>
</BorderTransportMeans>
<TallyParty>
<ID>???</ID>
</TallyParty>
<Consignment>
<TransportContractDocument>
<ID>${mt.awba}</ID>
</TransportContractDocument>
<AssociatedTransportDocument>
<ID>${mt.awba}_${mt.awbh}</ID>
</AssociatedTransportDocument>
<ConsignmentPackaging>
<QuantityQuantity>${mt.piece}</QuantityQuantity>
</ConsignmentPackaging>
<TotalGrossMassMeasure>${mt.weight}</TotalGrossMassMeasure>
</Consignment>
</Declaration>
</Manifest>
\ No newline at end of file
... ...
<Manifest xmlns="urn:Declaration:datamodel:standard:CN:MT6202:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Head>
<MessageID>${msgId}</MessageID>
<FunctionCode>2</FunctionCode>
<MessageType>${msessageType}</MessageType>
<SenderID>${senderId}</SenderID>
<ReceiverID>${receiverID}</ReceiverID>
<SendTime>${sendTime}</SendTime>
<Version>1.0</Version>
</Head>
<Declaration>
<BorderTransportMeans>
<JourneyID>${mt.carrier}${mt.flightno}/${mt.flightdate?string('yyyyMMdd')}</JourneyID>
<TypeCode>4</TypeCode>
<CargoFacilityLocation>${mt.turnunloading}/${mt.customcode}</CargoFacilityLocation>
<UnloadingLocation>
<ID>${destinationstation}/4620</ID>
</UnloadingLocation>
</BorderTransportMeans>
<Consignment>
<TransportContractDocument>
<ID>${mt.awba}</ID>
</TransportContractDocument>
<ConsignmentPackaging>
<QuantityQuantity>${mt.turnpiece}</QuantityQuantity>
</ConsignmentPackaging>
<TotalGrossMassMeasure>${mt.turnweight}</TotalGrossMassMeasure>
<BorderTransportMeans>
<JourneyID>${mt.carrier}${mt.flightno}</JourneyID>
<TypeCode>3</TypeCode>
<Carrier>
<Name>${mt.carrier}</Name>
</Carrier>
</BorderTransportMeans>
</Consignment>
</Declaration>
</Manifest>
\ No newline at end of file
... ...