Commit 5c9c19bf by zhanghou

192,292,196,296基本域的mx转mt格式完成

parent 7d7472e9
......@@ -7,9 +7,9 @@
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="swiftMt" />
<module name="swiftMx" />
<module name="swiftCore" />
<module name="swiftMt" />
</profile>
</annotationProcessing>
</component>
......
......@@ -16,5 +16,10 @@
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public" />
</remote-repository>
</component>
</project>
\ No newline at end of file
......@@ -31,6 +31,14 @@ public class Mx2MtConstants {
public static final String MT_TYPE_202 = "202";
public static final String MT_TYPE_192 = "192";
public static final String MT_TYPE_292 = "292";
public static final String MT_TYPE_196 = "196";
public static final String MT_TYPE_296 = "296";
public static final String OUT_PUT_FILE_PATH = "outPutFilePath";
public static final String MX_OBJECT = "mxObj";
......
package com.brilliance.swift.mx2mt;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.util.DateUtil;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.util.SwiftTransferUtil;
import com.brilliance.swift.util.XmlUtil;
import com.brilliance.swift.vo.common.*;
import org.dom4j.Document;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
......@@ -1303,5 +1306,229 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
}
return mtRemittanceInfo;
}
//mx格式日期转化为mt格式
protected String mXToMTDate(String xmlDate){
try {
XMLGregorianCalendar dateDt = DatatypeFactory.newInstance().newXMLGregorianCalendar(xmlDate);
return DateUtil.format(dateDt, "yyMMdd");
}catch (Exception e){
e.printStackTrace();
}
return "日期格式转化失败";
}
/**
* 判断xml节点的值如果值包含"pacs.008"则该字段赋值为"103",
* 包含"pacs.003"则赋值为"104",包含"MT10[0-9]{1}",
* 则根据正则表达式,截取3位为"10X",(X的取值为0-9),
* 值包含"pasc.009",赋值为"202",值包含"pasc.010"则赋值为"204",
* 包含"MT20[0-9]{1}",则根据正则表达式,截取3位为"20X",(X的取值为0-9),
* 最后如果上述条件均不满足则直接赋值为"202"。1类型的交给192处理,2类型的交给292处理
* 这是11s域的第一部分。
* @param mtType
* @return
*/
protected String getMtMsg(String mtType) {
if(StringUtil.isNotEmpty(mtType)){
if(mtType.startsWith("pacs.008")){
return "103";
}else if(mtType.startsWith("pacs.003")){
return "104";
}else if(mtType.startsWith("pacs.009")){
return "202";
}else if(mtType.startsWith("pacs.010")){
return "204";
}else if(mtType.matches("/MT10[0-9]{1}/")){
return mtType.substring(2);
}else if(mtType.matches("/MT20[0-9]{1}/")){
return mtType.substring(2);
}else {
return "202";
}
}else {
return "没有找到指定的类型";
}
}
/**
*MX_To_MT79CANC(MXOriginalUETR,MXCancellationReasonInformation)
* 参数一:MXOriginalUETR对应的xml节点
* FIToFIPmtCxlReq/Undrlyg/TxInf/OrgnlUETR
* 参数二: MXCancellationReasonInformation对应的xml节点FIToFIPmtCxlReq/Undrlyg/TxInf/CxlRsnInf
* 参数二下/AddtlInf值的取值规则为 这是个集合,第一行数据存在则直接赋值,第二行存在且第一行长度大于104就直接与第一行直接拼接,
* 小于的话则中间加一个空格再与第二行拼接 79String = Concatenate(“/”,MXReasonCode,”/’,MXAdditioanlInformation)
* MXReasonCoded的值对应的xml节点为FIToFIPmtCxlReq/Undrlyg/TxInf/CxlRsnInf/Rsn/Cd
* MXAdditioanlInformation的值对应的节点 FIToFIPmtCxlReq/Undrlyg/TxInf/CxlRsnInf/AddtlInf
* 拼接之后为/MXReasonCode/MXAdditioanlInformation
* 如果需要下一行,则必须以" // "开头,后面有多行都是以"//"开头
* 字段79的结构如下:35*50x,其中:
* Line 1 : /4!c/[AdditionalInformation]
* Line 2-35 //Continuation of Additional Information
* Line [Last] : /UETR/UETRNumber最后一行的如果决定不将UETR转换为Field79, 那么最后一行将被初始化为一个空字符串
* 否则最后一行为"/UETR/参数一的值"
* @param uetr
* @param xmlNote
* @return
*/
protected String mXToMT79CANC(String uetr,String xmlNote){
String additioanlInformation = getAdditioanlInformation(xmlNote);
String reasonCoded = getXmlNodeValue(bodyHdrParentElementName, document, xmlNote+".Rsn.Cd");
String filed79String = "/"+reasonCoded+"/"+ additioanlInformation;
filed79String = appendComplexMT79(filed79String, uetr);
return filed79String;
}
protected String getAdditioanlInformation(String xmlNote){
String addtlInf = xmlNote + ".AddtlInf";
int count = getXmlNodeCounts(bodyHdrParentElementName, document, addtlInf);
String additioanlInformation = "";
if(count>0){
for (int i = 0; i < count; i++) {
String additioanl = getXmlNodeValue(bodyHdrParentElementName, document, addtlInf+"("+i+")");
if(i==0){
additioanlInformation = additioanl;
}
if(i==1){
if(additioanlInformation.length()>104){
additioanlInformation = additioanlInformation + additioanl;
}else {
additioanlInformation = additioanlInformation + " "+additioanl;
}
}
}
}
return additioanlInformation;
}
protected String appendComplexMT79(String filed79, String uetr){
StringBuilder sb = new StringBuilder();
if (filed79.length()>0){
int count = filed79.length()/50;
int countInt = filed79.length()%50;
if(count==0){
sb.append(filed79);
sb.append(Mx2MtConstants.NEW_LINE).append("/UETR/").append(uetr);
}else {
for (int i = 0; i < count; i++) {
if(i==0){
String substring = filed79.substring(0, 50);
sb.append(substring).append(Mx2MtConstants.NEW_LINE);
}
if(i==1){
String substring = filed79.substring(50, 98);
sb.append("//").append(substring).append(Mx2MtConstants.NEW_LINE);
}
if(i>1){
String substring = filed79.substring(98+(i-2)*48, 98+(i-1)*48);
sb.append("//").append(substring).append(Mx2MtConstants.NEW_LINE);
}
if(i+1 == count&&countInt!=0){
String substring = filed79.substring(98+(i-1)*48);
sb.append("//").append(substring).append(Mx2MtConstants.NEW_LINE);
}
}
sb.append("/UETR/").append(uetr);
}
}
return sb.toString();
}
/**
*MX_To_MT76RCANC (MXStatus, MXCancellationStatusReasonInformation, MXUETR; MT76, MT77A)
* MXStatus对应的xml节点的值RsltnOfInvstgtn/Sts
* MXCancellationStatusReasonInformation对应xml节点的值 RsltnOfInvstgtn/CxlDtls/TxInfAndSts/CxlStsRsnInf
* MXUETR对应的xml节点的值 RsltnOfInvstgtn/CxlDtls/TxInfAndSts/OrgnlUETR
* RsltnOfInvstgtn/CxlDtls/TxInfAndSts/CxlStsRsnInf/Rsn/Cd 节点值值存在则赋值给MXReasonCode
* RsltnOfInvstgtn/CxlDtls/TxInfAndSts/CxlStsRsnInf/AddtlInf节点下的值 是个集合。赋值给MXAdditionalInformation
* 第一行数据存在则直接赋值,第二行存在且第一行长度大于104就直接与第一行直接拼接,小于的话则中间加一个空格再与第二行拼接
* MXReasonCode和MXAdditionalInformation值都存在/MXStatus/MXReasonCode/MXAdditionalInformation
* MXReasonCode和MXAdditionalInformation值都不存在 /MXStatus/
* 其中有一个值存在/MXStatus/MXReasonCode(MXReasonCode的值存在)
* /MXStatus/MXAdditionalInformation(MXAdditionalInformation的值存在)
* MXString76每行最大为35,延续行以"//"开头
* 76域最大为6*35,如果超过过则是使用77A域赋值格式为
* / MXUETR/(超出部分的值)
* @param sts
* @param xmlNote
* @param uetr
* @return
*/
protected List<String> mXToMT76RCANC(String sts, String uetr,String xmlNote){
String additioanlInformation = getAdditioanlInformation(xmlNote);
String reasonCoded = getXmlNodeValue(bodyHdrParentElementName, document, xmlNote+".Rsn.Cd");
String string76 = "/" + sts + "/";
if(StringUtil.isNotEmpty(reasonCoded)){
if(StringUtil.isNotEmpty(additioanlInformation)){
string76 = string76 +reasonCoded+"/"+additioanlInformation;
}else {
string76 = string76 + reasonCoded;
}
}else{
if(StringUtil.isNotEmpty(additioanlInformation)){
string76 = string76 + additioanlInformation;
}
}
return splitInLines(string76, uetr);
}
protected List<String> splitInLines(String filed76, String uetr){
List<String> list = new ArrayList<>();
StringBuilder sb76 = new StringBuilder();
StringBuilder sb77A = new StringBuilder();
if (filed76.length()>0){
int count = filed76.length()/35;
int countInt = filed76.length()%35;
if(count==0){
sb76.append(filed76);
sb76.append(Mx2MtConstants.NEW_LINE).append("/UETR/").append(uetr);
}else{
for (int i = 0; i < count; i++) {
if (i == 0) {
String substring = filed76.substring(0, 35);
sb76.append(substring).append(Mx2MtConstants.NEW_LINE);
}
if (i == 1) {
String substring = filed76.substring(35, 68);
sb76.append("//").append(substring).append(Mx2MtConstants.NEW_LINE);
}
if (i > 1 && count <= 6) {
String substring = filed76.substring(68 + (i - 2) * 33, 68 + (i - 1) * 33);
if(i+1 == 6){
sb76.append("//").append(substring);
}else {
sb76.append("//").append(substring).append(Mx2MtConstants.NEW_LINE);
}
} else if (i > 5) {
String substring = filed76.substring(68 + (i - 2) * 33, 68 + (i - 1) * 33);
sb77A.append("//").append(substring).append(Mx2MtConstants.NEW_LINE);
}
if (i + 1 == count && countInt != 0) {
String substring = filed76.substring(68 + (i - 1) * 33);
if (count <= 5) {
if(count==5){
sb76.append("//").append(substring);
}else {
sb76.append("//").append(substring).append(Mx2MtConstants.NEW_LINE);
}
} else {
sb77A.append("//").append(substring).append(Mx2MtConstants.NEW_LINE);
}
}
}
if(count<=5){
if(count==5&&countInt!=0){
sb77A.append("/UETR/").append(uetr);
}else {
sb76.append("/UETR/").append(uetr);
}
}else {
sb77A.append("/UETR/").append(uetr);
}
}
}
list.add(sb76.toString());
list.add(sb77A.toString());
return list;
}
//转换函数方法区结束
}
......@@ -3,6 +3,8 @@ package com.brilliance.swift.mx2mt;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.mt103.Mx2Mt103Creator;
import com.brilliance.swift.mx2mt.mt192292.Mx2Mtn92Creator;
import com.brilliance.swift.mx2mt.mt196296.Mx2Mtn96Creator;
import com.brilliance.swift.mx2mt.mt202cov202.Mx2Mt202Creator;
import com.brilliance.swift.mx2mt.mt900910.Mx2Mt900910Creator;
import com.brilliance.swift.mx2mt.mt940950.Mx2Mt940950Creator;
......@@ -70,6 +72,10 @@ public class Mx2MtCreatorManager {
return new Mx2Mt900910Creator();
} else if("camt.053.001".equals(messageType)){
return new Mx2Mt940950Creator();
} else if("camt.056.001".equals(messageType)){
return new Mx2Mtn92Creator();
} else if("camt.029.001".equals(messageType)){
return new Mx2Mtn96Creator();
}
else {
throw new SwiftException("Invalid message type");
......
package com.brilliance.swift.mx2mt.mt192292;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtCreator;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.mx2mt.Mx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.mt192292.impl.Field11SGenerate;
import com.brilliance.swift.mx2mt.mt192292.impl.Field20Generate;
import com.brilliance.swift.mx2mt.mt192292.impl.Field21Generate;
import com.brilliance.swift.mx2mt.mt192292.impl.Field79Generate;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.util.XmlUtil;
import com.prowidesoftware.swift.model.SwiftBlock3;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import org.dom4j.Document;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class Mx2Mtn92Creator extends AbstractMx2MtCreator {
@Override
public void preProcess() {
super.preProcess();
Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT, true);
Map<String, String> parentElementMaps = XmlUtil.getParentElementMaps(document);
context.set(Mx2MtContextIdentifier.APPHDR_PARENT_ELEMENT_NAME, parentElementMaps.get("AppHdr"));
context.set(Mx2MtContextIdentifier.GRPHDR_PARENT_ELEMENT_NAME, parentElementMaps.get("GrpHdr"));
context.set(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, parentElementMaps.get("FIToFIPmtCxlReq"));
}
@Override
public void withBlock3() throws SwiftException {
super.withBlock3();
SwiftBlock3 block3 = context.get(SwiftMessage.class).getBlock3();
Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT, true);
String bodyParentPath = (String)context.get(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, true);
String uetr = getXmlNodeValue(bodyParentPath, document, "FIToFIPmtCxlReq.Undrlyg.TxInf.OrgnlUETR");
if (StringUtil.isNotEmpty(uetr)) {
block3.getTags().add(new Tag("121", uetr));
}
}
@Override
public List<Mx2MtTagsGenerate> getGenerateTagList() {
List<Mx2MtTagsGenerate> fieldsGenerateList = new ArrayList<>();
fieldsGenerateList.add(new Field11SGenerate());
fieldsGenerateList.add(new Field20Generate());
fieldsGenerateList.add(new Field21Generate());
fieldsGenerateList.add(new Field79Generate());
return fieldsGenerateList;
}
@Override
protected String getMtType() {
Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT, true);
String bodyParentPath = (String)context.get(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, true);
String mtType = getXmlNodeValue(bodyParentPath, document, "FIToFIPmtCxlReq.Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId");
String msgType = "";
if(StringUtil.isNotEmpty(mtType)){
if(mtType.startsWith("pacs.008")){
msgType = "103";
}else if(mtType.startsWith("pacs.003")){
msgType = "104";
}else if(mtType.startsWith("pacs.009")){
msgType = "202";
}else if(mtType.startsWith("pacs.010")){
msgType = "204";
}else if(mtType.matches("/MT10[0-9]{1}/")){
msgType = mtType.substring(2);
}else if(mtType.matches("/MT20[0-9]{1}/")){
msgType = mtType.substring(2);
}else {
msgType = "202";
}
}
if (msgType.startsWith("1")) {
return Mx2MtConstants.MT_TYPE_192;
} else if(msgType.startsWith("2")){
return Mx2MtConstants.MT_TYPE_292;
}else {
return "类型错误";
}
}
}
package com.brilliance.swift.mx2mt.mt192292.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import java.util.List;
/**
*
*/
public class Field11SGenerate extends AbstractMx2MtTagsGenerate {
private static String name = "11S";
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String orgnlMsgNmId = "";
String date = "";
String mtType = getXmlNodeValue(bodyHdrParentElementName, document, "FIToFIPmtCxlReq.Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId");
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "FIToFIPmtCxlReq.Undrlyg.TxInf.OrgnlGrpInf.OrgnlCreDtTm");
if (StringUtil.isNotEmpty(mtType)) {
orgnlMsgNmId = getMtMsg(mtType);
}
if(StringUtil.isNotEmpty(dateStr)){
date = mXToMTDate(dateStr);
}
tags.add(new Tag(name, orgnlMsgNmId+Mx2MtConstants.NEW_LINE+date));
}
}
package com.brilliance.swift.mx2mt.mt192292.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import java.util.List;
/**
*/
public class Field20Generate extends AbstractMx2MtTagsGenerate {
private static String name = "20";
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String messageId = getXmlNodeValue(bodyHdrParentElementName, document, "FIToFIPmtCxlReq.Undrlyg.TxInf.Case.Id");
if (StringUtil.isNotEmpty(messageId)) {
tags.add(new Tag(name, messageId));
}
}
}
package com.brilliance.swift.mx2mt.mt192292.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import java.util.List;
/**
*/
public class Field21Generate extends AbstractMx2MtTagsGenerate {
private static String name = "21";
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String orgnlInstrId = getXmlNodeValue(bodyHdrParentElementName, document, "FIToFIPmtCxlReq.Undrlyg.TxInf.OrgnlInstrId ");
if (StringUtil.isNotEmpty(orgnlInstrId)) {
tags.add(new Tag(name, orgnlInstrId));
}
}
}
package com.brilliance.swift.mx2mt.mt192292.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.NumberUtil;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import java.math.BigDecimal;
import java.util.List;
/**
*/
public class Field79Generate extends AbstractMx2MtTagsGenerate {
private static String name_79 = "79";
private static String name_32A = "32A";
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String uetr = getXmlNodeValue(bodyHdrParentElementName, document, "FIToFIPmtCxlReq.Undrlyg.TxInf.OrgnlUETR");
String filed79 = mXToMT79CANC(uetr, "FIToFIPmtCxlReq.Undrlyg.TxInf.CxlRsnInf");
if (StringUtil.isNotEmpty(filed79)) {
tags.add(new Tag(name_79, filed79));
String dt = "";
String amt = "";
String ccy = "";
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "FIToFIPmtCxlReq.Undrlyg.TxInf.OrgnlIntrBkSttlmDt");
dt = mXToMTDate(dateStr);
String amtStr = getXmlNodeValue(bodyHdrParentElementName, document, "FIToFIPmtCxlReq.Undrlyg.TxInf.OrgnlIntrBkSttlmAmt");
String ccyStr = getXmlNodeValue(bodyHdrParentElementName, document, "FIToFIPmtCxlReq.Undrlyg.TxInf.OrgnlIntrBkSttlmAmt@Ccy");
if (StringUtil.isNotEmpty(amtStr)&&StringUtil.isNotEmpty(ccyStr)) {
amt = NumberUtil.formatAmt(new BigDecimal(amtStr), ccyStr);
ccy = ccyStr;
tags.add(new Tag(name_32A, dt+ccy+amt));
}
}
}
}
package com.brilliance.swift.mx2mt.mt196296;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtCreator;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.mx2mt.Mx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.mt196296.impl.Field11RGenerate;
import com.brilliance.swift.mx2mt.mt196296.impl.Field20Generate;
import com.brilliance.swift.mx2mt.mt196296.impl.Field21Generate;
import com.brilliance.swift.mx2mt.mt196296.impl.Field76Generate;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.util.XmlUtil;
import com.prowidesoftware.swift.model.SwiftBlock3;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import org.dom4j.Document;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class Mx2Mtn96Creator extends AbstractMx2MtCreator {
@Override
public void preProcess() {
super.preProcess();
Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT, true);
Map<String, String> parentElementMaps = XmlUtil.getParentElementMaps(document);
context.set(Mx2MtContextIdentifier.APPHDR_PARENT_ELEMENT_NAME, parentElementMaps.get("AppHdr"));
context.set(Mx2MtContextIdentifier.GRPHDR_PARENT_ELEMENT_NAME, parentElementMaps.get("GrpHdr"));
context.set(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, parentElementMaps.get("RsltnOfInvstgtn"));
}
@Override
public void withBlock3() throws SwiftException {
super.withBlock3();
SwiftBlock3 block3 = context.get(SwiftMessage.class).getBlock3();
Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT, true);
String bodyParentPath = (String)context.get(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, true);
String uetr = getXmlNodeValue(bodyParentPath, document, "RsltnOfInvstgtn.CxlDtls.TxInfAndSts.OrgnlUETR");
if (StringUtil.isNotEmpty(uetr)) {
block3.getTags().add(new Tag("121", uetr));
}
}
@Override
public List<Mx2MtTagsGenerate> getGenerateTagList() {
List<Mx2MtTagsGenerate> fieldsGenerateList = new ArrayList<>();
fieldsGenerateList.add(new Field11RGenerate());
fieldsGenerateList.add(new Field20Generate());
fieldsGenerateList.add(new Field21Generate());
fieldsGenerateList.add(new Field76Generate());
return fieldsGenerateList;
}
public String getMtMsg() {
Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT, true);
String bodyParentPath = (String)context.get(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, true);
String mtType = getXmlNodeValue(bodyParentPath, document, "RsltnOfInvstgtn.CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId");
if(StringUtil.isNotEmpty(mtType)){
if("pacs.008".equals(mtType)){
return "103";
}else if("pacs.003".equals(mtType)){
return "104";
}else if("pacs.009".equals(mtType)){
return "202";
}else if("pacs.010".equals(mtType)){
return "204";
}else if(mtType.matches("/MT10[0-9]{1}/")){
return mtType.substring(2);
}else if(mtType.matches("/MT20[0-9]{1}/")){
return mtType.substring(2);
}else {
return "202";
}
}else {
return "没有找到指定的类型";
}
}
@Override
protected String getMtType() {
Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT, true);
String bodyParentPath = (String)context.get(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, true);
String mtType = getXmlNodeValue(bodyParentPath, document, "RsltnOfInvstgtn.CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId");
String msgType = "";
if(StringUtil.isNotEmpty(mtType)){
if(mtType.startsWith("pacs.008")){
msgType = "103";
}else if(mtType.startsWith("pacs.003")){
msgType = "104";
}else if(mtType.startsWith("pacs.009")){
msgType = "202";
}else if(mtType.startsWith("pacs.010")){
msgType = "204";
}else if(mtType.matches("/MT10[0-9]{1}/")){
msgType = mtType.substring(2);
}else if(mtType.matches("/MT20[0-9]{1}/")){
msgType = mtType.substring(2);
}else {
msgType = "202";
}
}
if (msgType.startsWith("1")) {
return Mx2MtConstants.MT_TYPE_196;
} else if(msgType.startsWith("2")){
return Mx2MtConstants.MT_TYPE_296;
}else {
return "类型错误";
}
}
}
package com.brilliance.swift.mx2mt.mt196296.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import java.util.List;
/**
*
*/
public class Field11RGenerate extends AbstractMx2MtTagsGenerate {
private static String name = "11R";
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String orgnlMsgNmId = "";
String date = "";
String mtType = getXmlNodeValue(bodyHdrParentElementName, document, "RsltnOfInvstgtn.CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId");
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "RsltnOfInvstgtn.CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlCreDtTm");
if (StringUtil.isNotEmpty(mtType)) {
orgnlMsgNmId = getMtMsg(mtType);
}
if(StringUtil.isNotEmpty(dateStr)){
date = mXToMTDate(dateStr);
}
tags.add(new Tag(name, orgnlMsgNmId+Mx2MtConstants.NEW_LINE+date));
}
}
package com.brilliance.swift.mx2mt.mt196296.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import java.util.List;
/**
*/
public class Field20Generate extends AbstractMx2MtTagsGenerate {
private static String name = "20";
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String messageId = getXmlNodeValue(bodyHdrParentElementName, document, "RsltnOfInvstgtn.CxlDtls.TxInfAndSts.CxlStsId");
if (StringUtil.isNotEmpty(messageId)) {
tags.add(new Tag(name, messageId));
}
}
}
package com.brilliance.swift.mx2mt.mt196296.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import java.util.List;
/**
*/
public class Field21Generate extends AbstractMx2MtTagsGenerate {
private static String name = "21";
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String orgnlInstrId = getXmlNodeValue(bodyHdrParentElementName, document, "RsltnOfInvstgtn.CxlDtls.TxInfAndSts.RslvdCase.Id");
if (StringUtil.isNotEmpty(orgnlInstrId)) {
tags.add(new Tag(name, orgnlInstrId));
}
}
}
package com.brilliance.swift.mx2mt.mt196296.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import java.util.List;
/**
*/
public class Field76Generate extends AbstractMx2MtTagsGenerate {
private static String name_76 = "76";
private static String name_77A = "77A";
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String uetr = getXmlNodeValue(bodyHdrParentElementName, document, "RsltnOfInvstgtn.CxlDtls.TxInfAndSts.OrgnlUETR");
String sts = getXmlNodeValue(bodyHdrParentElementName, document, "RsltnOfInvstgtn.Sts.Conf");
List<String> list = mXToMT76RCANC(sts,uetr, "RsltnOfInvstgtn.CxlDtls.TxInfAndSts.CxlStsRsnInf");
if(list.size()>0&&StringUtil.isNotEmpty(list.get(0))){
tags.add(new Tag(name_76, list.get(0)));
if(StringUtil.isNotEmpty(list.get(1))){
tags.add(new Tag(name_77A, list.get(1)));
}
}
}
}
package com.brilliance.swift.vo;
import com.brilliance.swift.vo.common.CcyFormatAmount;
import com.brilliance.swift.vo.common.TransactionReference;
import java.util.Date;
/**
* @author zh
* @create 2022-05-26 17:12
*/
public class FIToFIPaymentCancellationRequest extends SwiftDto{
protected TransactionReference txnRef;
protected String OrgnlMsgNmId;
protected Date date;
protected Date valueDate;
protected CcyFormatAmount valueAmount;
protected String cancellationReasonInformation;
public TransactionReference getTxnRef() {
return txnRef;
}
public void setTxnRef(TransactionReference txnRef) {
this.txnRef = txnRef;
}
public String getOrgnlMsgNmId() {
return OrgnlMsgNmId;
}
public void setOrgnlMsgNmId(String orgnlMsgNmId) {
OrgnlMsgNmId = orgnlMsgNmId;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public Date getValueDate() {
return valueDate;
}
public void setValueDate(Date valueDate) {
this.valueDate = valueDate;
}
public CcyFormatAmount getValueAmount() {
return valueAmount;
}
public void setValueAmount(CcyFormatAmount valueAmount) {
this.valueAmount = valueAmount;
}
public String getCancellationReasonInformation() {
return cancellationReasonInformation;
}
public void setCancellationReasonInformation(String cancellationReasonInformation) {
this.cancellationReasonInformation = cancellationReasonInformation;
}
}
package com.brilliance.swift.vo;
import com.brilliance.swift.vo.common.CcyFormatAmount;
import com.brilliance.swift.vo.common.TransactionReference;
import java.util.Date;
/**
* @author zh
* @create 2022-05-26 17:16
*/
public class ResolutionOfInvestigation extends SwiftDto{
protected TransactionReference txnRef;
protected String OrgnlMsgNmId;
protected Date date;
protected String cancellationStatusReasonInformation;
public TransactionReference getTxnRef() {
return txnRef;
}
public void setTxnRef(TransactionReference txnRef) {
this.txnRef = txnRef;
}
public String getOrgnlMsgNmId() {
return OrgnlMsgNmId;
}
public void setOrgnlMsgNmId(String orgnlMsgNmId) {
OrgnlMsgNmId = orgnlMsgNmId;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public String getCancellationStatusReasonInformation() {
return cancellationStatusReasonInformation;
}
public void setCancellationStatusReasonInformation(String cancellationStatusReasonInformation) {
this.cancellationStatusReasonInformation = cancellationStatusReasonInformation;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
THE MESSAGE WILL WORK “AS IS” IN THE READINESS PORTAL. IT IS ESSENTIAL THAT USERS REMOVE THE ENVELOPE AND REPLACE IT WITH THEIR OWN TRANSPORT HEADER (FOR EXAMPLE FOR ALLIANCE ACCESS YOU WOULD USE THE XML V2 HEADERS).
=========================================================================================================================================================================================
SWIFT © 2020. All rights reserved.
This publication contains SWIFT or third-party confidential information. Do not disclose this publication outside your organisation without SWIFT’s prior written consent.
The use of this document is governed by the legal notices appearing at the end of this document. By using this document, you will be deemed to have accepted those legal notices.
====================================================================================================================================================================
Use Case c.56.1.1 Agent C Danske Bank sends a camt.029 to Agent B Nordea Finland
=============================================================================================================================
Change Log
2020-10-16 - Original version
=============================
-->
<Envelope xmlns="urn:swift:xsd:envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:swift:xsd:envelope ../../../../March21Schemas/Translator_envelope.xsd">
<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Fr>
<FIId>
<FinInstnId>
<BICFI>HELSFIHH</BICFI>
</FinInstnId>
</FIId>
</Fr>
<To>
<FIId>
<FinInstnId>
<BICFI>NDEAFIHH</BICFI>
</FinInstnId>
</FIId>
</To>
<BizMsgIdr>cmt029bizmsgidr-002</BizMsgIdr>
<MsgDefIdr>camt.029.001.08</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2021-02-17T16:15:00+01:00</CreDt>
<Rltd>
<Fr>
<FIId>
<FinInstnId>
<BICFI>NDEAFIHH</BICFI>
</FinInstnId>
</FIId>
</Fr>
<To>
<FIId>
<FinInstnId>
<BICFI>HELSFIHH</BICFI>
</FinInstnId>
</FIId>
</To>
<BizMsgIdr>cmt029bizmsgidr-002</BizMsgIdr>
<MsgDefIdr>camt.056.001.08</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2021-02-17T12:15:00+01:00</CreDt>
</Rltd>
</AppHdr>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.029.001.09">
<RsltnOfInvstgtn>
<Assgnmt>
<Id>ASSNID-001</Id>
<Assgnr>
<Agt>
<FinInstnId>
<BICFI>HELSFIHH</BICFI>
</FinInstnId>
</Agt>
</Assgnr>
<Assgne>
<Agt>
<FinInstnId>
<BICFI>NDEAFIHH</BICFI>
</FinInstnId>
</Agt>
</Assgne>
<CreDtTm>2021-02-17T16:15:00+01:00</CreDtTm>
</Assgnmt>
<Sts>
<Conf>CNCL</Conf>
</Sts>
<CxlDtls>
<TxInfAndSts>
<CxlStsId>CNCL-ID001</CxlStsId>
<RslvdCase>
<Id>CSE-001</Id>
<Cretr>
<Agt>
<FinInstnId>
<BICFI>RBOSGB2L</BICFI>
</FinInstnId>
</Agt>
</Cretr>
</RslvdCase>
<OrgnlGrpInf>
<OrgnlMsgId>pacs8bizmsgidr01</OrgnlMsgId>
<OrgnlMsgNmId>pacs.008.001.08</OrgnlMsgNmId>
<OrgnlCreDtTm>2021-02-17T08:30:00+01:00</OrgnlCreDtTm>
</OrgnlGrpInf>
<OrgnlInstrId>pacs8bizmsgidr01</OrgnlInstrId>
<OrgnlEndToEndId>pacs008EndToEndId-001</OrgnlEndToEndId>
<OrgnlUETR>8a562c67-ca16-48ba-b074-65581be6f001</OrgnlUETR>
<CxlStsRsnInf>
<AddtlInf>WORLDHELLO,WORLDHELLOWORLDHELLO,WORLDHELLOWORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLD</AddtlInf>
<AddtlInf>NI,HAO</AddtlInf>
<Orgtr>
<Nm>A Debiter</Nm>
<PstlAdr>
<StrtNm>280 Bishopsgate</StrtNm>
<TwnNm>London</TwnNm>
<Ctry>GB</Ctry>
</PstlAdr>
</Orgtr>
<Rsn>
<Cd>AGNT</Cd>
</Rsn>
</CxlStsRsnInf>
</TxInfAndSts>
</CxlDtls>
</RsltnOfInvstgtn>
</Document>
</Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<!--
THE MESSAGE WILL WORK “AS IS” IN THE READINESS PORTAL. IT IS ESSENTIAL THAT USERS REMOVE THE ENVELOPE AND REPLACE IT WITH THEIR OWN TRANSPORT HEADER (FOR EXAMPLE FOR ALLIANCE ACCESS YOU WOULD USE THE XML V2 HEADERS).
=========================================================================================================================================================================================
SWIFT © 2020. All rights reserved.
This publication contains SWIFT or third-party confidential information. Do not disclose this publication outside your organisation without SWIFT’s prior written consent.
The use of this document is governed by the legal notices appearing at the end of this document. By using this document, you will be deemed to have accepted those legal notices.
====================================================================================================================================================================
Use Case c.56.1.1 Agent C Danske Bank sends a camt.029 to Agent B Nordea Finland
=============================================================================================================================
Change Log
2020-10-16 - Original version
=============================
-->
<Envelope xmlns="urn:swift:xsd:envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:swift:xsd:envelope ../../../../March21Schemas/Translator_envelope.xsd">
<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Fr>
<FIId>
<FinInstnId>
<BICFI>HELSFIHH</BICFI>
</FinInstnId>
</FIId>
</Fr>
<To>
<FIId>
<FinInstnId>
<BICFI>NDEAFIHH</BICFI>
</FinInstnId>
</FIId>
</To>
<BizMsgIdr>cmt029bizmsgidr-002</BizMsgIdr>
<MsgDefIdr>camt.029.001.08</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2021-02-17T16:15:00+01:00</CreDt>
<Rltd>
<Fr>
<FIId>
<FinInstnId>
<BICFI>NDEAFIHH</BICFI>
</FinInstnId>
</FIId>
</Fr>
<To>
<FIId>
<FinInstnId>
<BICFI>HELSFIHH</BICFI>
</FinInstnId>
</FIId>
</To>
<BizMsgIdr>cmt029bizmsgidr-002</BizMsgIdr>
<MsgDefIdr>camt.056.001.08</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2021-02-17T12:15:00+01:00</CreDt>
</Rltd>
</AppHdr>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.029.001.09">
<RsltnOfInvstgtn>
<Assgnmt>
<Id>ASSNID-001</Id>
<Assgnr>
<Agt>
<FinInstnId>
<BICFI>HELSFIHH</BICFI>
</FinInstnId>
</Agt>
</Assgnr>
<Assgne>
<Agt>
<FinInstnId>
<BICFI>NDEAFIHH</BICFI>
</FinInstnId>
</Agt>
</Assgne>
<CreDtTm>2021-02-17T16:15:00+01:00</CreDtTm>
</Assgnmt>
<Sts>
<Conf>CNCL</Conf>
</Sts>
<CxlDtls>
<TxInfAndSts>
<CxlStsId>CNCL-ID001</CxlStsId>
<RslvdCase>
<Id>CSE-001</Id>
<Cretr>
<Agt>
<FinInstnId>
<BICFI>RBOSGB2L</BICFI>
</FinInstnId>
</Agt>
</Cretr>
</RslvdCase>
<OrgnlGrpInf>
<OrgnlMsgId>pacs8bizmsgidr01</OrgnlMsgId>
<OrgnlMsgNmId>pacs.009.001.08</OrgnlMsgNmId>
<OrgnlCreDtTm>2021-02-17T08:30:00+01:00</OrgnlCreDtTm>
</OrgnlGrpInf>
<OrgnlInstrId>pacs8bizmsgidr01</OrgnlInstrId>
<OrgnlEndToEndId>pacs008EndToEndId-001</OrgnlEndToEndId>
<OrgnlUETR>8a562c67-ca16-48ba-b074-65581be6f001</OrgnlUETR>
<CxlStsRsnInf>
<AddtlInf>ORLDHELLO,WORLDWORLDHORLDHELLO,WORLDWORLDHORLDHELLO,WORLDWORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLD</AddtlInf>
<AddtlInf>NI,HAO</AddtlInf>
<Orgtr>
<Nm>A Debiter</Nm>
<PstlAdr>
<StrtNm>280 Bishopsgate</StrtNm>
<TwnNm>London</TwnNm>
<Ctry>GB</Ctry>
</PstlAdr>
</Orgtr>
<Rsn>
<Cd>AGNT</Cd>
</Rsn>
</CxlStsRsnInf>
</TxInfAndSts>
</CxlDtls>
</RsltnOfInvstgtn>
</Document>
</Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<!--
THE MESSAGE WILL WORK “AS IS” IN THE READINESS PORTAL. IT IS ESSENTIAL THAT USERS REMOVE THE ENVELOPE AND REPLACE IT WITH THEIR OWN TRANSPORT HEADER (FOR EXAMPLE FOR ALLIANCE ACCESS YOU WOULD USE THE XML V2 HEADERS).
=========================================================================================================================================================================================
SWIFT © 2020. All rights reserved.
This publication contains SWIFT or third-party confidential information. Do not disclose this publication outside your organisation without SWIFT’s prior written consent.
The use of this document is governed by the legal notices appearing at the end of this document. By using this document, you will be deemed to have accepted those legal notices.
====================================================================================================================================================================
Use Case c.56.1.1 Agent A RBS plc sends a camt.056 to Agent B Nordea Finland
========================================================================================================================
Change Log
2020-10-16 - Original version
=============================
-->
<Envelope xmlns="urn:swift:xsd:envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:swift:xsd:envelope ../../../../March21Schemas_COV/Translator_envelope.xsd">
<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.02">
<Fr>
<FIId>
<FinInstnId>
<BICFI>RBOSGB2L</BICFI>
</FinInstnId>
</FIId>
</Fr>
<To>
<FIId>
<FinInstnId>
<BICFI>NDEAFIHH</BICFI>
</FinInstnId>
</FIId>
</To>
<BizMsgIdr>cmt056bizmsgidr-001</BizMsgIdr>
<MsgDefIdr>camt.056.001.08</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2021-02-17T12:10:00+01:00</CreDt>
</AppHdr>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.056.001.08">
<FIToFIPmtCxlReq>
<Assgnmt>
<Id>ASSNID-001</Id>
<Assgnr>
<Agt>
<FinInstnId>
<BICFI>RBOSGB2L</BICFI>
</FinInstnId>
</Agt>
</Assgnr>
<Assgne>
<Agt>
<FinInstnId>
<BICFI>NDEAFIHH</BICFI>
</FinInstnId>
</Agt>
</Assgne>
<CreDtTm>2021-02-17T08:30:00+01:00</CreDtTm>
</Assgnmt>
<Undrlyg>
<TxInf>
<Case>
<Id>CSE-001</Id>
<Cretr>
<Agt>
<FinInstnId>
<BICFI>RBOSGB2L</BICFI>
</FinInstnId>
</Agt>
</Cretr>
</Case>
<OrgnlGrpInf>
<OrgnlMsgId>pacs8bizmsgidr01</OrgnlMsgId>
<OrgnlMsgNmId>pacs.008.001.08</OrgnlMsgNmId>
<OrgnlCreDtTm>2021-02-17T08:30:00+01:00</OrgnlCreDtTm>
</OrgnlGrpInf>
<OrgnlInstrId>pacs8bizmsgidr01</OrgnlInstrId>
<OrgnlEndToEndId>pacs008EndToEndId-001</OrgnlEndToEndId>
<OrgnlUETR>8a562c67-ca16-48ba-b074-65581be6f001</OrgnlUETR>
<OrgnlIntrBkSttlmAmt Ccy="EUR">1500000</OrgnlIntrBkSttlmAmt>
<OrgnlIntrBkSttlmDt>2021-02-17</OrgnlIntrBkSttlmDt>
<CxlRsnInf>
<AddtlInf>HELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLD</AddtlInf>
<AddtlInf>NI,HAO</AddtlInf>
<Orgtr>
<Nm>A Debiter</Nm>
<PstlAdr>
<StrtNm>280 Bishopsgate</StrtNm>
<TwnNm>London</TwnNm>
<Ctry>GB</Ctry>
</PstlAdr>
</Orgtr>
<Rsn>
<Cd>AM09</Cd>
</Rsn>
</CxlRsnInf>
</TxInf>
</Undrlyg>
</FIToFIPmtCxlReq>
</Document>
</Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<!--
THE MESSAGE WILL WORK “AS IS” IN THE READINESS PORTAL. IT IS ESSENTIAL THAT USERS REMOVE THE ENVELOPE AND REPLACE IT WITH THEIR OWN TRANSPORT HEADER (FOR EXAMPLE FOR ALLIANCE ACCESS YOU WOULD USE THE XML V2 HEADERS).
=========================================================================================================================================================================================
SWIFT © 2020. All rights reserved.
This publication contains SWIFT or third-party confidential information. Do not disclose this publication outside your organisation without SWIFT’s prior written consent.
The use of this document is governed by the legal notices appearing at the end of this document. By using this document, you will be deemed to have accepted those legal notices.
====================================================================================================================================================================
Use Case c.56.1.1 Agent A RBS plc sends a camt.056 to Agent B Nordea Finland
========================================================================================================================
Change Log
2020-10-16 - Original version
=============================
-->
<Envelope xmlns="urn:swift:xsd:envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:swift:xsd:envelope ../../../../March21Schemas_COV/Translator_envelope.xsd">
<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.02">
<Fr>
<FIId>
<FinInstnId>
<BICFI>RBOSGB2L</BICFI>
</FinInstnId>
</FIId>
</Fr>
<To>
<FIId>
<FinInstnId>
<BICFI>NDEAFIHH</BICFI>
</FinInstnId>
</FIId>
</To>
<BizMsgIdr>cmt056bizmsgidr-001</BizMsgIdr>
<MsgDefIdr>camt.056.001.08</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2021-02-17T12:10:00+01:00</CreDt>
</AppHdr>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.056.001.08">
<FIToFIPmtCxlReq>
<Assgnmt>
<Id>ASSNID-001</Id>
<Assgnr>
<Agt>
<FinInstnId>
<BICFI>RBOSGB2L</BICFI>
</FinInstnId>
</Agt>
</Assgnr>
<Assgne>
<Agt>
<FinInstnId>
<BICFI>NDEAFIHH</BICFI>
</FinInstnId>
</Agt>
</Assgne>
<CreDtTm>2021-02-17T08:30:00+01:00</CreDtTm>
</Assgnmt>
<Undrlyg>
<TxInf>
<Case>
<Id>CSE-001</Id>
<Cretr>
<Agt>
<FinInstnId>
<BICFI>RBOSGB2L</BICFI>
</FinInstnId>
</Agt>
</Cretr>
</Case>
<OrgnlGrpInf>
<OrgnlMsgId>pacs8bizmsgidr01</OrgnlMsgId>
<OrgnlMsgNmId>pacs.009.001.08</OrgnlMsgNmId>
<OrgnlCreDtTm>2021-02-17T08:30:00+01:00</OrgnlCreDtTm>
</OrgnlGrpInf>
<OrgnlInstrId>pacs8bizmsgidr01</OrgnlInstrId>
<OrgnlEndToEndId>pacs008EndToEndId-001</OrgnlEndToEndId>
<OrgnlUETR>8a562c67-ca16-48ba-b074-65581be6f001</OrgnlUETR>
<OrgnlIntrBkSttlmAmt Ccy="EUR">1500000</OrgnlIntrBkSttlmAmt>
<OrgnlIntrBkSttlmDt>2021-02-17</OrgnlIntrBkSttlmDt>
<CxlRsnInf>
<AddtlInf>ORLDHELLO,WORLDWORLDHORLDHELLO,WORLDWORLDHORLDHELLO,WORLDWORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLD</AddtlInf>
<AddtlInf>NI,HAO</AddtlInf>
<Orgtr>
<Nm>A Debiter</Nm>
<PstlAdr>
<StrtNm>280 Bishopsgate</StrtNm>
<TwnNm>London</TwnNm>
<Ctry>GB</Ctry>
</PstlAdr>
</Orgtr>
<Rsn>
<Cd>AM09</Cd>
</Rsn>
</CxlRsnInf>
</TxInf>
</Undrlyg>
</FIToFIPmtCxlReq>
</Document>
</Envelope>
package com.brilliance.mx2mt.mt192;
import com.brilliance.swift.mx2mt.Mx2MtCreatorManager;
import org.apache.commons.io.FileUtils;
import java.io.File;
public class TestMx2MtFor192 {
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\Mxcamt05600108_192.xml");
String xmlStr = FileUtils.readFileToString(file);
String mt192 = new Mx2MtCreatorManager().mx2Mt(xmlStr, null, null);
System.out.println(mt192);
}
}
package com.brilliance.mx2mt.mt196;
import com.brilliance.swift.mx2mt.Mx2MtCreatorManager;
import org.apache.commons.io.FileUtils;
import java.io.File;
public class TestMx2MtFor196 {
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\Mxcamt02900108_196.xml");
String xmlStr = FileUtils.readFileToString(file);
String mt196 = new Mx2MtCreatorManager().mx2Mt(xmlStr, null, null);
System.out.println(mt196);
}
}
package com.brilliance.mx2mt.mt292;
import com.brilliance.swift.mx2mt.Mx2MtCreatorManager;
import org.apache.commons.io.FileUtils;
import java.io.File;
public class TestMx2MtFor292 {
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\Mxcamt05600108_292.xml");
String xmlStr = FileUtils.readFileToString(file);
String mt292 = new Mx2MtCreatorManager().mx2Mt(xmlStr, null, null);
System.out.println(mt292);
}
}
package com.brilliance.mx2mt.mt296;
import com.brilliance.swift.mx2mt.Mx2MtCreatorManager;
import org.apache.commons.io.FileUtils;
import java.io.File;
public class TestMx2MtFor296 {
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\Mxcamt02900108_296.xml");
String xmlStr = FileUtils.readFileToString(file);
String mt296 = new Mx2MtCreatorManager().mx2Mt(xmlStr, null, null);
System.out.println(mt296);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment