Commit cad27096 by chengzhuoshen

0822swift官网MX2MT更新

parent c19858b6
......@@ -45,6 +45,15 @@ public class SwiftTransfer {
return str.getMessage();
}
public static String mx2Mt(String xmlFilePath, boolean filePathFlag, String outPutFilePath, Map<String, Object> extraMap) throws SwiftException {
if (filePathFlag) {
File file = new File(xmlFilePath);
return mx2Mt(file, outPutFilePath, extraMap);
} else {
return mx2Mt(xmlFilePath, outPutFilePath, extraMap);
}
}
public static SwiftTranslationReport mx2MtPlus(File file, String outPutFilePath, Map<String, Object> extraMap) throws SwiftException {
try{
String xmlStr = FileUtils.readFileToString(file);
......@@ -59,6 +68,15 @@ public class SwiftTransfer {
return new Mx2MtCreatorManager().mx2Mt(xmlStr, outPutFilePath, extraMap);
}
public static SwiftTranslationReport mx2MtPlus(String xmlFilePath, boolean filePathFlag, String outPutFilePath, Map<String, Object> extraMap) throws SwiftException {
if (filePathFlag) {
File file = new File(xmlFilePath);
return mx2MtPlus(file, outPutFilePath, extraMap);
} else {
return mx2MtPlus(xmlFilePath, outPutFilePath, extraMap);
}
}
/**
* MT TRANSFER MX
*/
......@@ -76,6 +94,15 @@ public class SwiftTransfer {
return str.getMessage();
}
public static String mt2Mx(String mtFilePath, boolean filePathFlag, String outPutFilePath, Map<String, Object> extraMap) throws SwiftException {
if (filePathFlag) {
File file = new File(mtFilePath);
return mt2Mx(file, outPutFilePath, extraMap);
} else {
return mt2Mx(mtFilePath, outPutFilePath, extraMap);
}
}
public static SwiftTranslationReport mt2MxPlus(File file, String outPutFilePath, Map<String, Object> extraMap) throws SwiftException {
try{
String mtStr = FileUtils.readFileToString(file);
......@@ -119,7 +146,15 @@ public class SwiftTransfer {
} catch (DocumentException e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
public static SwiftTranslationReport mt2MxPlus(String mtFilePath, boolean filePathFlag, String outPutFilePath, Map<String, Object> extraMap) throws SwiftException {
if (filePathFlag) {
File file = new File(mtFilePath);
return mt2MxPlus(file, outPutFilePath, extraMap);
} else {
return mt2MxPlus(mtFilePath, outPutFilePath, extraMap);
}
}
public static String mx2Gson(File file) {
......@@ -142,6 +177,15 @@ public class SwiftTransfer {
return gsonStr;
}
public static String mx2Gson(String xmlFilePath, boolean filePathFlag) {
if (filePathFlag) {
File file = new File(xmlFilePath);
return mx2Gson(file);
} else {
return mx2Gson(xmlFilePath);
}
}
/**
* 将MX xml转换成Map<String, String>
* @param xmlStr
......@@ -152,6 +196,29 @@ public class SwiftTransfer {
return new Mx2MapCreatorManager().mx2Map(xmlStr);
}
public static Map<String, String> mx2Map(String xmlFilePath, boolean filePathFlag) {
try {
if (filePathFlag) {
File file = new File(xmlFilePath);
String mxStr = FileUtils.readFileToString(file);
return mx2Map(mxStr);
} else {
return mx2Map(xmlFilePath);
}
} catch (IOException e) {
throw new SwiftException(e.getMessage());
}
}
public static boolean validateMx(String xmlFilePath, boolean filePathFlag) {
if (filePathFlag) {
File file = new File(xmlFilePath);
return validateMx(file);
} else {
return validateMx(xmlFilePath);
}
}
public static boolean validateMx(File file) {
try{
String mtStr = FileUtils.readFileToString(file);
......@@ -227,4 +294,13 @@ public class SwiftTransfer {
throw new SwiftException(e.getMessage());
}
}
public static String mx2Element(String xmlFilePath, boolean filePathFlag) {
if (filePathFlag) {
File file = new File(xmlFilePath);
return mx2Element(file);
} else {
return mx2Element(xmlFilePath);
}
}
}
......@@ -8,6 +8,7 @@ import com.brilliance.swift.util.SwiftTransferUtil;
import com.brilliance.swift.util.XmlUtil;
import com.brilliance.swift.vo.SwiftTranslationErrorInfo;
import com.brilliance.swift.vo.SwiftTranslationReport;
import com.brilliance.swift.vo.common.TranslationResultCode;
import com.prowidesoftware.swift.io.ConversionService;
import com.prowidesoftware.swift.io.IConversionService;
import com.prowidesoftware.swift.io.writer.SwiftWriter;
......@@ -548,6 +549,7 @@ public abstract class AbstractMx2MtCreator implements Mx2MtCreator {
}
}
}
summaryTranslationResult(str);
}
public void write(SwiftMessage swiftMessage, File file) throws SwiftException {
......@@ -564,4 +566,51 @@ public abstract class AbstractMx2MtCreator implements Mx2MtCreator {
throw new SwiftException(e.getMessage());
}
}
/**
* 根据转换报告总结最终的转换结果
* TRNK 出现failure
* TRFR 引用字段出现截取
* TRNR 非引用字段出现截取
* TRAK 出现IGNORED.T0000M(转换过程中存在忽略的xml节点(非必填))
* TROK 只出现warning
* @param str
*/
public void summaryTranslationResult(SwiftTranslationReport str) {
List<SwiftTranslationErrorInfo> errorInfos = str.getErrorInfos();
if (errorInfos == null || errorInfos.size() == 0) {
str.setTranslationResult(TranslationResultCode.TROK.value());
} else {
boolean failureFlag = false;
boolean truncRFlag = false;
boolean truncNFlag = false;
boolean ignoredFlag = false;
for (SwiftTranslationErrorInfo errorInfo : errorInfos) {
String category = errorInfo.getCategory();
if ("FAILURE".equals(category)) {
failureFlag = true;
}
if ("TRUNC_R".equals(category)) {
truncRFlag = true;
}
if ("TRUNC_N".equals(category)) {
truncNFlag = true;
}
if ("IGNORED".equals(category)) {
ignoredFlag = true;
}
}
if (failureFlag) {
str.setTranslationResult(TranslationResultCode.TRNK.value());
} else if (truncRFlag) {
str.setTranslationResult(TranslationResultCode.TRFR.value());
} else if (truncNFlag) {
str.setTranslationResult(TranslationResultCode.TRNR.value());
} else if (ignoredFlag) {
str.setTranslationResult(TranslationResultCode.TRAK.value());
} else {
str.setTranslationResult(TranslationResultCode.TROK.value());
}
}
}
}
......@@ -10,8 +10,6 @@ import com.brilliance.swift.vo.common.*;
import com.prowidesoftware.swift.model.Tag;
import org.dom4j.Document;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.*;
......@@ -1605,195 +1603,6 @@ 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){
throw new SwiftException(e.getMessage());
}
}
/**
*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/conf
* 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>1){
count = (filed76.length()-35)/33+1;
countInt = (filed76.length()-35)%33;
}
if(count==0){
sb76.append(filed76);
String str = "/UETR/" + uetr;
if(str.length()>35){
sb77A.append(str.substring(0, 35)).append(Mx2MtConstants.NEW_LINE).append("//").append(str.substring(35));
}
}else{
for (int i = 0; i < count; i++) {
if (i == 0) {
String substring = filed76.substring(0, 35);
sb76.append(substring);
}
if (i == 1) {
String substring = filed76.substring(35, 68);
sb76.append(Mx2MtConstants.NEW_LINE).append("//").append(substring);
}
if (i > 1 && i<6) {
String substring = filed76.substring(68 + (i - 2) * 33, 68 + (i - 1) * 33);
sb76.append(Mx2MtConstants.NEW_LINE).append("//").append(substring);
} else if (i > 5) {
String substring = filed76.substring(68 + (i - 2) * 33, 68 + (i - 1) * 33);
sb77A.append(Mx2MtConstants.NEW_LINE).append("//").append(substring);
}
if (i + 1 == count && countInt != 0) {
String substring = filed76.substring(68 + (i - 1) * 33);
if (count <= 5) {
sb76.append(Mx2MtConstants.NEW_LINE).append("//").append(substring);
} else {
sb77A.append(Mx2MtConstants.NEW_LINE).append("//").append(substring);
}
}
}
if(StringUtil.isNotEmpty(uetr)){
if(sb77A.toString().length()>0){
sb77A.append(Mx2MtConstants.NEW_LINE);
}
String str = "/UETR/" + uetr;
if(str.length()>35){
sb77A.append(str.substring(0, 35)).append(Mx2MtConstants.NEW_LINE).append("//").append(str.substring(35));
}
}
}
}
list.add(sb76.toString());
list.add(sb77A.toString());
return list;
}
protected String mx_to_mtFATFIdentification(String partyPath, boolean structuredAddressIndicator) {
String identificationPath = partyPath + ".Id";
String countryCode = getXmlNodeValue(null, document, partyPath+".PstlAdr.Ctry");
......
......@@ -29,6 +29,7 @@ public class Mx2MtCreatorManager {
public SwiftTranslationReport mx2Mt(String xml, String fileOutputPath, Map<String, Object> extraMap) throws SwiftException {
try {
Document document1 = DocumentHelper.parseText(xml);
AbstractMX abstractMX = AbstractMX.parse(xml);
String messageType = (abstractMX.getMxId().getBusinessProcess().name()
+ "."
......
......@@ -55,7 +55,7 @@ public class Field71AGenerate extends AbstractMx2MtTagsGenerate {
BigDecimal tmpAmt = new BigDecimal(getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.ChrgsInf("+i+").Amt"));
sumAmt = sumAmt.add(tmpAmt);
} else {
buildSTErrorInfo(39, "block4/:"+name_G+":", null);
buildSTErrorInfo(39, "Block4/:"+name_G+":", null);
return;
}
}
......
......@@ -81,7 +81,7 @@ public class Mx2Mtn92Creator extends AbstractMx2MtCreator {
} else if (orgMsgNameIdentification.matches("MT20[0-9]{1}")) {
mtType = Mx2MtConstants.MT_TYPE_292;
}else {
buildSTErrorInfo(79,"Block2/:mtType:",orgMsgNameIdentification);
buildSTErrorInfo(79,"Block2/MtType", orgMsgNameIdentification);
}
}
return mtType;
......
......@@ -3,10 +3,14 @@ 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.DateUtil;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.util.List;
/**
......@@ -20,38 +24,38 @@ public class Field11SGenerate extends AbstractMx2MtTagsGenerate {
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, "Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId");
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlGrpInf.OrgnlCreDtTm");
if (StringUtil.isNotEmpty(mtType)) {
if(StringUtil.isNotEmpty(mtType)){
if(mtType.startsWith("pacs.008")){
orgnlMsgNmId = "103";
}else if(mtType.startsWith("pacs.003")){
orgnlMsgNmId = "104";
}else if(mtType.startsWith("pacs.009")){
orgnlMsgNmId = "202";
}else if(mtType.startsWith("pacs.010")){
orgnlMsgNmId = "204";
}else if(mtType.matches("MT10[0-9]{1}")){
orgnlMsgNmId = mtType.substring(2);
}else if(mtType.matches("MT20[0-9]{1}")){
orgnlMsgNmId = mtType.substring(2);
}else {
orgnlMsgNmId = "202";
buildSTErrorInfo(75,"Block4/:11S:",null);
String mtNumber = "";
String orgnlMsgNm = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId");
if (StringUtil.isNotEmpty(orgnlMsgNm)) {
if (orgnlMsgNm.indexOf("pacs.008") > -1) {
mtNumber = "103";
} else if (orgnlMsgNm.indexOf("pacs.003") > -1) {
mtNumber = "104";
} else if (orgnlMsgNm.matches("MT10[0-9]{1}")) {
mtNumber = orgnlMsgNm.substring(2);
} else if (orgnlMsgNm.indexOf("pacs.009") > -1) {
mtNumber = "202";
} else if (orgnlMsgNm.indexOf("pacs.010") > -1) {
mtNumber = "204";
} else if (orgnlMsgNm.matches("MT20[0-9]{1}")) {
mtNumber = orgnlMsgNm.substring(2);
} else {
mtNumber = "202";
buildSTErrorInfo(75, "Block4/:11S:", orgnlMsgNm);
}
}
String mtDate = "991231";
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlGrpInf.OrgnlCreDtTm");
if (StringUtil.isNotEmpty(dateStr)) {
try {
XMLGregorianCalendar date = DatatypeFactory.newInstance().newXMLGregorianCalendar(dateStr);
mtDate = DateUtil.format(date, "yyMMdd");
} catch (DatatypeConfigurationException e) {
throw new SwiftException(e.getMessage());
}
if(StringUtil.isNotEmpty(dateStr)){
if(dateStr.length()>0){
date = mXToMTDate(dateStr);
}else {
date = "993112";
}
if (StringUtil.isNotEmpty(mtNumber)) {
tags.add(new Tag(name, mtNumber + Mx2MtConstants.NEW_LINE + mtDate));
}
tags.add(new Tag(name, orgnlMsgNmId+Mx2MtConstants.NEW_LINE+date));
}
}
......@@ -21,21 +21,16 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String messageId = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.Case.Id");
String value = "";
if (StringUtil.isNotEmpty(messageId)) {
if (messageId.length() > 16) {
buildSTErrorInfo(13, "Block4/:20:", messageId);
value = messageId.substring(0, 15) + "+";
} else {
value = messageId;
messageId = messageId.substring(0, 15) + "+";
}
if (messageId.startsWith("/") || messageId.endsWith("/") || messageId.contains("//")) {
buildSTErrorInfo(42, "Block4/:20:", messageId);
messageId = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
buildSTErrorInfo(42, "Block4/:20:", value);
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
if (StringUtil.isNotEmpty(value)) {
tags.add(new Tag(name, value));
tags.add(new Tag(name, messageId));
}
}
}
......@@ -21,21 +21,16 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String orgnlInstrId = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlInstrId");
String value = "";
if (StringUtil.isNotEmpty(orgnlInstrId)) {
if (orgnlInstrId.length() > 16) {
buildSTErrorInfo(13, "Block4/:21:", orgnlInstrId);
value = orgnlInstrId.substring(0, 15) + "+";
} else {
value = orgnlInstrId;
orgnlInstrId = orgnlInstrId.substring(0, 15) + "+";
}
}
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
buildSTErrorInfo(73, "Block4/:21:", value);
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
if (StringUtil.isNotEmpty(value)) {
tags.add(new Tag(name, value));
if (StringUtil.isEmpty(orgnlInstrId) || (orgnlInstrId.startsWith("/") || orgnlInstrId.endsWith("/") || orgnlInstrId.contains("//"))) {
buildSTErrorInfo(73, "Block4/:21:", orgnlInstrId);
orgnlInstrId = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
tags.add(new Tag(name, orgnlInstrId));
}
}
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.DateUtil;
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 javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -23,23 +29,76 @@ public class Field79Generate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String mt32A = "";
try {
String intrBkSttlmDtStr = "";
String intrBkSttlmAmt = "";
String intrBkSttlmccy = "";
String intrBkSttlmDtValue = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlIntrBkSttlmDt");
if (StringUtil.isNotEmpty(intrBkSttlmDtValue)) {
XMLGregorianCalendar intrBkSttlmDt = DatatypeFactory.newInstance().newXMLGregorianCalendar(intrBkSttlmDtValue);
intrBkSttlmDtStr = DateUtil.format(intrBkSttlmDt, "yyMMdd");
}
String amt = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlIntrBkSttlmAmt");
String ccy = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlIntrBkSttlmAmt@Ccy");
if (StringUtil.isNotEmpty(amt) && StringUtil.isNotEmpty(ccy)) {
intrBkSttlmAmt = NumberUtil.formatAmt(new BigDecimal(amt), ccy);
intrBkSttlmccy = ccy;
mt32A = intrBkSttlmDtStr + intrBkSttlmccy + intrBkSttlmAmt;
}
}catch (DatatypeConfigurationException e) {
throw new SwiftException(e.getMessage());
}
String uetr = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlUETR");
String filed79 = mXToMT79CANC(uetr, "Undrlyg.TxInf.CxlRsnInf");
filed79 = mx_to_mtStartingLineCharacter(filed79, "Block4/:79:");
if (StringUtil.isNotEmpty(filed79)) {
tags.add(new Tag(name_79, filed79));
String dt = "";
String amt = "";
String ccy = "";
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlIntrBkSttlmDt");
dt = mXToMTDate(dateStr);
String amtStr = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlIntrBkSttlmAmt");
String ccyStr = getXmlNodeValue(bodyHdrParentElementName, document, "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));
if (StringUtil.isEmpty(uetr)) {
if (StringUtil.isNotEmpty(mt32A)) {
tags.add(new Tag(name_32A, mt32A));
}
return;
}
String mxReasonCode = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.CxlRsnInf.Rsn.Cd");
int addtlInfCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Undrlyg.TxInf.CxlRsnInf.AddtlInf");
String mxAddtlInf = "";
if (addtlInfCount > 0) {
for (int i=0; i<addtlInfCount; i++) {
if (i == 2) break;
String addtlInf = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.CxlRsnInf.AddtlInf("+i+")");
if (i == 0) {
mxAddtlInf += addtlInf;
} else {
if (getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.CxlRsnInf.AddtlInf("+(i-1)+")").length() > 104) {
mxAddtlInf += addtlInf;
} else {
mxAddtlInf += " " + addtlInf;
}
}
}
}
String mt79 = "";
if (StringUtil.isNotEmpty(mxReasonCode)) {
mt79 += "/" + mxReasonCode + "/";
}
if (StringUtil.isNotEmpty(mxAddtlInf)) {
mt79 += mxAddtlInf;
}
List<String> list = new ArrayList<>();
if (StringUtil.isNotEmpty(mt79)) {
list.addAll(StringUtil.outStringList(mt79, 50, "//"));
}
list.add("/UETR/" + uetr);
String value = "";
for (int i=0; i<list.size(); i++) {
if (i == 35) break;
if (i == 0) {
value = list.get(i);
} else {
value += Mx2MtConstants.NEW_LINE + list.get(i);
}
}
value = mx_to_mtStartingLineCharacter(value, "Block4/:79:");
tags.add(new Tag(name_79, value));
if (StringUtil.isNotEmpty(mt32A)) {
tags.add(new Tag(name_32A, mt32A));
}
}
}
......@@ -81,7 +81,7 @@ public class Mx2Mtn96Creator extends AbstractMx2MtCreator {
} else if (orgMsgNameIdentification.matches("MT20[0-9]{1}")) {
mtType = Mx2MtConstants.MT_TYPE_296;
}else {
buildSTErrorInfo(79,"Block2/:mtType:",orgMsgNameIdentification);
buildSTErrorInfo(79,"Block2/MtType",orgMsgNameIdentification);
}
}
return mtType;
......
......@@ -3,10 +3,14 @@ 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.DateUtil;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.util.List;
/**
......@@ -20,46 +24,48 @@ public class Field11RGenerate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String orgnlMsgNmId = "";
String date = "";
boolean boolean1 = false;
boolean boolean2 = false;
String mtType = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId");
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlCreDtTm");
if (StringUtil.isNotEmpty(mtType)) {
if(StringUtil.isNotEmpty(mtType)){
if(mtType.startsWith("pacs.008")){
orgnlMsgNmId = "103";
}else if(mtType.startsWith("pacs.003")){
orgnlMsgNmId = "104";
}else if(mtType.startsWith("pacs.009")){
orgnlMsgNmId = "202";
}else if(mtType.startsWith("pacs.010")){
orgnlMsgNmId = "204";
}else if(mtType.matches("MT10[0-9]{1}")){
orgnlMsgNmId = mtType.substring(2);
}else if(mtType.matches("MT20[0-9]{1}")){
orgnlMsgNmId = mtType.substring(2);
String mtNumber = "";
String orgnlMsgNm = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId");
if (StringUtil.isNotEmpty(orgnlMsgNm)) {
if(orgnlMsgNm.indexOf("pacs.008") > -1){
mtNumber = "103";
}else if(orgnlMsgNm.indexOf("pacs.003") > -1){
mtNumber = "104";
}else if(orgnlMsgNm.indexOf("pacs.009") > -1){
mtNumber = "202";
}else if(orgnlMsgNm.indexOf("pacs.010") > -1){
mtNumber = "204";
}else if(orgnlMsgNm.matches("MT10[0-9]{1}")){
mtNumber = orgnlMsgNm.substring(2);
}else if(orgnlMsgNm.matches("MT20[0-9]{1}")){
mtNumber = orgnlMsgNm.substring(2);
}else {
orgnlMsgNmId = "202";
mtNumber = "202";
boolean1 = true;
}
}
String mtDate = "";
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlCreDtTm");
if (StringUtil.isNotEmpty(dateStr)) {
try {
XMLGregorianCalendar date = DatatypeFactory.newInstance().newXMLGregorianCalendar(dateStr);
mtDate = DateUtil.format(date, "yyMMdd");
} catch (DatatypeConfigurationException e) {
throw new SwiftException(e.getMessage());
}
if(StringUtil.isNotEmpty(dateStr)){
if(dateStr.length()>0){
date = mXToMTDate(dateStr);
}else {
date = "993112";
boolean2 = true;
}
if (StringUtil.isEmpty(mtDate)) {
mtDate = "991231";
boolean2 = true;
}
if(boolean1&&boolean2){
if((boolean1 && boolean2) || StringUtil.isEmpty(mtNumber)){
return;
}else {
tags.add(new Tag(name, orgnlMsgNmId+Mx2MtConstants.NEW_LINE+date));
tags.add(new Tag(name, mtNumber + Mx2MtConstants.NEW_LINE + mtDate));
if(boolean1){
buildSTErrorInfo(75,"BLOCK4/:11R:",null);
buildSTErrorInfo(75,"Block4/:11R:",null);
}
}
......
......@@ -20,20 +20,17 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String messageId = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.CxlStsId");
if (StringUtil.isNotEmpty(messageId)) {
String value = messageId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
buildSTErrorInfo(42, "BLOCK4/:20:", value);
tags.add(new Tag(name, value));
return;
String cxlStsId = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.CxlStsId");
if (StringUtil.isNotEmpty(cxlStsId)) {
if (cxlStsId.length() > 16) {
buildSTErrorInfo(13, "Block4/:20:", cxlStsId);
cxlStsId = cxlStsId.substring(0, 15) + "+";
}
if (value.length() > 16) {
buildSTErrorInfo(13, "BLOCK4/:20:", value);
value = value.substring(0, 15) + "+";
if (cxlStsId.startsWith("/") || cxlStsId.endsWith("/") || cxlStsId.contains("//")) {
buildSTErrorInfo(42, "Block4/:20:", cxlStsId);
cxlStsId = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
tags.add(new Tag(name, value));
tags.add(new Tag(name, cxlStsId));
}
}
}
......@@ -20,21 +20,18 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String orgnlInstrId = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.RslvdCase.Id");
if (StringUtil.isNotEmpty(orgnlInstrId)) {
String value = orgnlInstrId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
buildSTErrorInfo(42, "BLOCK4/:21:", value);
tags.add(new Tag(name, value));
return;
String rslvdCaseId = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.RslvdCase.Id");
if (StringUtil.isNotEmpty(rslvdCaseId)) {
if (rslvdCaseId.length() > 16) {
buildSTErrorInfo(13, "Block4/:21:", rslvdCaseId);
rslvdCaseId = rslvdCaseId.substring(0, 15) + "+";
}
if (value.length() > 16) {
buildSTErrorInfo(13, "BLOCK4/:21:", value);
value = value.substring(0, 15) + "+";
if (rslvdCaseId.startsWith("/") || rslvdCaseId.endsWith("/") || rslvdCaseId.contains("//")) {
buildSTErrorInfo(42, "Block4/:21:", rslvdCaseId);
rslvdCaseId = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
tags.add(new Tag(name, value));
tags.add(new Tag(name, rslvdCaseId));
}
}
}
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.ArrayList;
import java.util.List;
/**
......@@ -21,16 +23,76 @@ public class Field76Generate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String status = getXmlNodeValue(bodyHdrParentElementName, document, "Sts.Conf");
if (StringUtil.isEmpty(status)) return;
String mxReasonCode = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.CxlStsRsnInf.Rsn.Cd");
int addtlInfCount = getXmlNodeCounts(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.CxlStsRsnInf.AddtlInf");
String mxAddtlInf = "";
if (addtlInfCount > 0) {
for (int i=0; i<addtlInfCount; i++) {
if (i == 2) break;
String addtlInf = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.CxlStsRsnInf.AddtlInf("+i+")");
if (i == 0) {
mxAddtlInf += addtlInf;
} else {
if (getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.CxlStsRsnInf.AddtlInf("+(i-1)+")").length() > 104) {
mxAddtlInf += addtlInf;
} else {
mxAddtlInf += " " + addtlInf;
}
}
}
}
String mxString76 = "/" + status + "/";
if (StringUtil.isNotEmpty(mxReasonCode)) {
if (StringUtil.isNotEmpty(mxAddtlInf)) {
mxString76 += mxReasonCode + "/" + mxAddtlInf;
} else {
mxString76 += mxReasonCode;
}
} else if (StringUtil.isNotEmpty(mxAddtlInf)) {
mxString76 += mxAddtlInf;
}
List<String> list = StringUtil.outStringList(mxString76, 35, "//");
String mt76 = "";
String moreStr = "";
if (list != null && list.size() > 0) {
for (int i=0; i<list.size(); i++) {
String str = list.get(i);
if (i < 6) {
if (i == 0) {
mt76 = str;
} else {
mt76 += Mx2MtConstants.NEW_LINE + str;
}
} else {
moreStr += str.substring(2);
}
}
}
if (StringUtil.isNotEmpty(mt76)) {
tags.add(new Tag(name_76, mt76));
}
List<String> listMt77 = new ArrayList<>();
if (StringUtil.isNotEmpty(moreStr)) {
listMt77.addAll(StringUtil.outStringList(moreStr, 35, "//"));
}
String uetr = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.OrgnlUETR");
String sts = getXmlNodeValue(bodyHdrParentElementName, document, "Sts.Conf");
List<String> list = mXToMT76RCANC(sts,uetr, "CxlDtls.TxInfAndSts.CxlStsRsnInf");
if(list.size()>0&&StringUtil.isNotEmpty(list.get(0))){
if(StringUtil.isNotEmpty(list.get(0))){
tags.add(new Tag(name_76, list.get(0)));
if (StringUtil.isNotEmpty(uetr)) {
listMt77.addAll(StringUtil.outStringList("/UETR/"+uetr, 35, "//"));
}
String mt77 = "";
for (int i=0; i<listMt77.size(); i++) {
if (i == 20) break;
String str = listMt77.get(i);
if (i == 0) {
mt77 = str;
} else {
mt77 += Mx2MtConstants.NEW_LINE + str;
}
if(StringUtil.isNotEmpty(list.get(1))){
tags.add(new Tag(name_77A, list.get(1)));
}
if (StringUtil.isNotEmpty(mt77)) {
tags.add(new Tag(name_77A, mt77));
}
}
}
......@@ -14,6 +14,8 @@ public class SwiftTranslationReport {
private String message;
private String translationResult;
public List<SwiftTranslationErrorInfo> getErrorInfos() {
if (errorInfos == null) {
errorInfos = new ArrayList<>();
......@@ -32,4 +34,12 @@ public class SwiftTranslationReport {
public void setMessage(String message) {
this.message = message;
}
public String getTranslationResult() {
return translationResult;
}
public void setTranslationResult(String translationResult) {
this.translationResult = translationResult;
}
}
package com.brilliance.swift.vo.common;
public enum TranslationResultCode {
TRNK("Failure to translate"),
TRFR("Truncation or character replacement occurred in reference fields present in the MT"),
TRNR("Truncation or character replacement occurred in non-reference fields"),
TRAK("Translation Almost OK"),
TROK("Success where the full ISO 20022 message is translated");
TranslationResultCode(String s) {}
public String value() {
return name();
}
}
<?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>
<RjctdMod>
<Cd>UM01</Cd>
</RjctdMod>
<DplctOf>
<Id>CS001</Id>
<Cretr>
<Agt>
<FinInstnId>
<BICFI>RBOSGB2L</BICFI>
<Nm>zs</Nm>
<LEI>cd</LEI>
<PstlAdr>
<TwnLctnNm>zhangsan</TwnLctnNm>
<DstrctNm>lisi</DstrctNm>
<CtrySubDvsn>wangwu</CtrySubDvsn>
</PstlAdr>
</FinInstnId>
</Agt>
</Cretr>
</DplctOf>
<AssgnmtCxlConf>true</AssgnmtCxlConf>
</Sts>
<CxlDtls>
<TxInfAndSts>
<CxlStsId>CNCL-ID001</CxlStsId>
<RslvdCase>
<Id>CSE-001</Id>
<Cretr>
<Agt>
<FinInstnId>
<BICFI>RBOSGB2L</BICFI>
<Nm>zs</Nm>
<LEI>cd</LEI>
<PstlAdr>
<TwnLctnNm>zhangsan</TwnLctnNm>
<DstrctNm>lisi</DstrctNm>
<CtrySubDvsn>wangwu</CtrySubDvsn>
</PstlAdr>
</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>
<Orgtr>
<Nm>A Debiter</Nm>
<PstlAdr>
<StrtNm>280 Bishopsgate</StrtNm>
<TwnNm>London</TwnNm>
<Ctry>GB</Ctry>
<TwnLctnNm>zhangsan</TwnLctnNm>
<DstrctNm>lisi</DstrctNm>
<CtrySubDvsn>wangwu</CtrySubDvsn>
</PstlAdr>
</Orgtr>
<Rsn>
<Cd>AGNT</Cd>
</Rsn>
<AddtlInf>HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO</AddtlInf>
<AddtlInf>NICE TO MEET YOU</AddtlInf>
</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.29.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.09</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>cmt056bizmsgidr-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>cmt029bizmsgidr-002</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>
<Orgtr>
<Nm>Z Krediter</Nm>
<PstlAdr>
<StrtNm>Antinkatu 11</StrtNm>
<TwnNm>Pori</TwnNm>
<Ctry>FI</Ctry>
</PstlAdr>
</Orgtr>
<Rsn>
<Cd>AGNT</Cd>
</Rsn>
</CxlStsRsnInf>
</TxInfAndSts>
</CxlDtls>
</RsltnOfInvstgtn>
</Document>
</Envelope>
......@@ -44,11 +44,11 @@
<Bal>
<Tp>
<CdOrPrtry>
<Cd>OPBD</Cd>
<Cd>CLBD</Cd>
</CdOrPrtry>
</Tp>
<Amt Ccy="EUR">6587.02</Amt>
<CdtDbtInd>DBIT</CdtDbtInd>
<Amt Ccy="EUR">58537.21</Amt>
<CdtDbtInd>CRDT</CdtDbtInd>
<Dt>
<Dt>2020-08-04</Dt>
</Dt>
......@@ -56,15 +56,16 @@
<Bal>
<Tp>
<CdOrPrtry>
<Cd>CLBD</Cd>
<Cd>OPBD</Cd>
</CdOrPrtry>
</Tp>
<Amt Ccy="EUR">58537.21</Amt>
<CdtDbtInd>CRDT</CdtDbtInd>
<Amt Ccy="EUR">6587.02</Amt>
<CdtDbtInd>DBIT</CdtDbtInd>
<Dt>
<Dt>2020-08-04</Dt>
</Dt>
</Bal>
<Ntry>
<Amt Ccy="EUR">65124.23</Amt>
<CdtDbtInd>CRDT</CdtDbtInd>
......
......@@ -56,18 +56,11 @@ Change Log
<Undrlyg>
<TxInf>
<Case>
<Id>CSE-0011</Id>
<Id>CSE-001</Id>
<Cretr>
<Agt>
<FinInstnId>
<BICFI>RBOSGB2L</BICFI>
<Nm>zs</Nm>
<LEI>cd</LEI>
<PstlAdr>
<TwnLctnNm>zhangsan</TwnLctnNm>
<DstrctNm>lisi</DstrctNm>
<CtrySubDvsn>wangwu</CtrySubDvsn>
</PstlAdr>
</FinInstnId>
</Agt>
</Cretr>
......@@ -89,16 +82,14 @@ Change Log
<StrtNm>280 Bishopsgate</StrtNm>
<TwnNm>London</TwnNm>
<Ctry>GB</Ctry>
<TwnLctnNm>zhangsan</TwnLctnNm>
<DstrctNm>lisi</DstrctNm>
<CtrySubDvsn>wangwu</CtrySubDvsn>
</PstlAdr>
</Orgtr>
<Rsn>
<Cd>AM09</Cd>
</Rsn>
<AddtlInf>HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO</AddtlInf>
<AddtlInf>NICE TO MEET YOU</AddtlInf>
<AddtlInf>chengzhuoshen</AddtlInf>
<AddtlInf>dashuaige</AddtlInf>
<AddtlInf>zhendeshuai</AddtlInf>
</CxlRsnInf>
</TxInf>
</Undrlyg>
......
......@@ -17,132 +17,66 @@ Change Log
<Fr>
<FIId>
<FinInstnId>
<BICFI>CHASUS33XXX</BICFI>
<BICFI>AABBGB2X</BICFI>
</FinInstnId>
</FIId>
</Fr>
<To>
<FIId>
<FinInstnId>
<BICFI>CHASGB2LXXX</BICFI>
<BICFI>AABBIE2X</BICFI>
</FinInstnId>
</FIId>
</To>
<BizMsgIdr>P4B2A-006</BizMsgIdr>
<MsgDefIdr>pacs.004.001.09</MsgDefIdr>
<BizMsgIdr>Buzmsgidr/pacc4</BizMsgIdr>
<MsgDefIdr>Msgdefidr/acs.004/001</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2020-01-11T13:00:00.960-05:00</CreDt>
<Rltd>
<Fr>
<FIId>
<FinInstnId>
<BICFI>CHASGB2LXXX</BICFI>
</FinInstnId>
</FIId>
</Fr>
<To>
<FIId>
<FinInstnId>
<BICFI>CHASUS33XXX</BICFI>
</FinInstnId>
</FIId>
</To>
<BizMsgIdr>A2B0506272708</BizMsgIdr>
<MsgDefIdr>pacs.008.001.08</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2020-01-11T12:43:41.960+00:00</CreDt>
</Rltd>
<CreDt>2022-03-10T09:24:41+01:00</CreDt>
</AppHdr>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pacs.004.001.09">
<PmtRtr>
<GrpHdr>
<MsgId>P4B2A-006</MsgId>
<CreDtTm>2020-01-11T13:00:00.960-05:00</CreDtTm>
<MsgId>Buzmsgidr/pacc4</MsgId>
<CreDtTm>2022-03-15T10:26:17+01:00</CreDtTm>
<NbOfTxs>1</NbOfTxs>
<SttlmInf>
<SttlmMtd>INGA</SttlmMtd>
<SttlmMtd>INDA</SttlmMtd>
</SttlmInf>
</GrpHdr>
<TxInf>
<OrgnlGrpInf>
<OrgnlMsgId>A2B0506272708</OrgnlMsgId>
<OrgnlMsgNmId>pacs.008.001.08</OrgnlMsgNmId>
</OrgnlGrpInf>
<OrgnlInstrId>A2B0506272708</OrgnlInstrId>
<OrgnlEndToEndId>E2E04044506271305</OrgnlEndToEndId>
<OrgnlUETR>174c245f-2682-4291-ad67-2a41e530cd27</OrgnlUETR>
<OrgnlIntrBkSttlmAmt Ccy="USD">45000</OrgnlIntrBkSttlmAmt>
<OrgnlIntrBkSttlmDt>2021-02-09</OrgnlIntrBkSttlmDt>
<RtrdIntrBkSttlmAmt Ccy="USD">15000</RtrdIntrBkSttlmAmt>
<IntrBkSttlmDt>2021-02-09</IntrBkSttlmDt>
<RtrdInstdAmt Ccy="USD">15000</RtrdInstdAmt>
<OrgnlInstrId>pacs8gidr02</OrgnlInstrId>
<OrgnlEndToEndId>Orgnle2eidpacs9</OrgnlEndToEndId>
<OrgnlUETR>3f91d85a-48e0-4410-9b5c-8023c90eb587</OrgnlUETR>
<OrgnlIntrBkSttlmAmt Ccy="EUR">150.</OrgnlIntrBkSttlmAmt>
<RtrdIntrBkSttlmAmt Ccy="EUR">100.</RtrdIntrBkSttlmAmt>
<IntrBkSttlmDt>2022-03-09+01:00</IntrBkSttlmDt>
<RtrdInstdAmt Ccy="EUR">100.</RtrdInstdAmt>
<ChrgBr>SHAR</ChrgBr>
<ChrgsInf>
<Amt Ccy="USD">0</Amt>
<Agt>
<FinInstnId>
<BICFI>CHASUS33XXX</BICFI>
</FinInstnId>
</Agt>
</ChrgsInf>
<ChrgsInf>
<Amt Ccy="USD">0</Amt>
<Agt>
<FinInstnId>
<BICFI>WFBIUS6SDAL</BICFI>
</FinInstnId>
</Agt>
</ChrgsInf>
<InstgAgt>
<FinInstnId>
<BICFI>CHASUS33XXX</BICFI>
<BICFI>AABBGB2X</BICFI>
</FinInstnId>
</InstgAgt>
<InstdAgt>
<FinInstnId>
<BICFI>CHASGB2LXXX</BICFI>
<BICFI>AABBIE2X</BICFI>
</FinInstnId>
</InstdAgt>
<RtrChain>
<Dbtr>
<Pty>
<Nm>Main Street Capital</Nm>
<PstlAdr>
<StrtNm>Oak Blvd</StrtNm>
<TwnNm>Houston</TwnNm>
<Ctry>US</Ctry>
</PstlAdr>
<Nm>Mr Debtor </Nm>
</Pty>
</Dbtr>
<DbtrAgt>
<FinInstnId>
<BICFI>TEXSUS41XXX</BICFI>
</FinInstnId>
</DbtrAgt>
<PrvsInstgAgt1>
<FinInstnId>
<BICFI>WFBIUS6SDAL</BICFI>
</FinInstnId>
</PrvsInstgAgt1>
<CdtrAgt>
<FinInstnId>
<BICFI>CHASGB2LXXX</BICFI>
</FinInstnId>
</CdtrAgt>
<Cdtr>
<Pty>
<Nm>ABC Capital</Nm>
<PstlAdr>
<StrtNm>155 Bishopsgate</StrtNm>
<TwnNm>London</TwnNm>
<Ctry>GB</Ctry>
</PstlAdr>
<Nm>Mr. Creditor</Nm>
</Pty>
</Cdtr>
</RtrChain>
<RtrRsnInf>
<Rsn>
<Cd>AM09</Cd>
<Cd>AC04</Cd>
</Rsn>
</RtrRsnInf>
</TxInf>
......
<?xml version="1.0" encoding="UTF-8" ?>
<RequestPayload>
<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Request>
<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.02">
<Fr>
<FIId>
<FinInstnId>
<BICFI>TSPABEBBXXX</BICFI>
<BICFI>AABBGB2X</BICFI>
</FinInstnId>
</FIId>
</Fr>
<To>
<FIId>
<FinInstnId>
<BICFI>TSPBBEBBXXX</BICFI>
<BICFI>AABBIE2X</BICFI>
</FinInstnId>
</FIId>
</To>
<BizMsgIdr>MID/7703.0/eecf9</BizMsgIdr>
<MsgDefIdr>pacs.008.001.08</MsgDefIdr>
<BizMsgIdr>Buzmsgidtfr/020322/001</BizMsgIdr>
<MsgDefIdr>Msgidtfr/020322/001</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2022-09-08T09:50:34.101+02:00</CreDt>
<PssblDplct>false</PssblDplct>
<CreDt>2022-03-03T08:22:08+01:00</CreDt>
</AppHdr>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pacs.008.001.08" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pacs.008.001.08">
<FIToFICstmrCdtTrf>
<GrpHdr>
<MsgId>MID/7703.0/eecf9</MsgId>
<CreDtTm>2022-09-08T09:50:34.101+02:00</CreDtTm>
<MsgId>Msgidetfcn/02/03/2022/001</MsgId>
<CreDtTm>2022-03-02T09:24:16+01:00</CreDtTm>
<NbOfTxs>1</NbOfTxs>
<SttlmInf>
<SttlmMtd>COVE</SttlmMtd>
<InstgRmbrsmntAgt>
<FinInstnId>
<BICFI>TSPEBEBBXXX</BICFI>
<Nm>Callisto Bank and Trust</Nm>
<PstlAdr>
<StrtNm>Stars Boulevard</StrtNm>
<BldgNb>55</BldgNb>
<PstBx>11</PstBx>
<PstCd>1000</PstCd>
<TwnNm>Brussels</TwnNm>
<Ctry>BE</Ctry>
</PstlAdr>
</FinInstnId>
</InstgRmbrsmntAgt>
<InstdRmbrsmntAgt>
<FinInstnId>
<BICFI>JZCBCNBJXXX</BICFI>
</FinInstnId>
</InstdRmbrsmntAgt>
<SttlmMtd>INDA</SttlmMtd>
</SttlmInf>
</GrpHdr>
<CdtTrfTxInf>
<PmtId>
<InstrId>IID/7703.0/eecf9</InstrId>
<EndToEndId>E2E/7703.0/eecf9</EndToEndId>
<TxId>TID/7703.0/eecf9</TxId>
<UETR>5489a37a-2227-47cf-9730-e6c39e108ecc</UETR>
<InstrId>Instrid-001</InstrId>
<EndToEndId>e2eid/02/03/2022/001</EndToEndId>
<UETR>5ddd156b-ba52-4d7d-a7ea-197cf311dc19</UETR>
</PmtId>
<PmtTpInf>
<SvcLvl>
<Cd>G001</Cd>
</SvcLvl>
</PmtTpInf>
<IntrBkSttlmAmt Ccy="EUR">1000.0</IntrBkSttlmAmt>
<IntrBkSttlmDt>2022-09-08</IntrBkSttlmDt>
<InstdAmt Ccy="EUR">1000.0</InstdAmt>
<ChrgBr>SHAR</ChrgBr>
<IntrBkSttlmAmt Ccy="EUR">100.</IntrBkSttlmAmt>
<IntrBkSttlmDt>2022-03-04+01:00</IntrBkSttlmDt>
<InstdAmt Ccy="EUR">110.</InstdAmt>
<ChrgBr>DEBT</ChrgBr>
<ChrgsInf>
<Amt Ccy="EUR">0.0</Amt>
<Amt Ccy="EUR">99999999999999.</Amt>
<Agt>
<FinInstnId>
<BICFI>TSPABEBBXXX</BICFI>
</FinInstnId>
<FinInstnId>PSBCCNBJ</FinInstnId>
</Agt>
</ChrgsInf>
<ChrgsInf>
<Amt Ccy="EUR">99999999999999.</Amt>
<Agt>
<FinInstnId>PSBCCNBJ</FinInstnId>
</Agt>
</ChrgsInf>
<InstgAgt>
<FinInstnId>
<BICFI>TSPABEBBXXX</BICFI>
<BICFI>AABBGB2X</BICFI>
</FinInstnId>
</InstgAgt>
<InstdAgt>
<FinInstnId>
<BICFI>TSPBBEBBXXX</BICFI>
<BICFI>AABBIE2X</BICFI>
</FinInstnId>
</InstdAgt>
<Dbtr>
<Nm>Martin Unstrucutred Belgium</Nm>
<Nm>Mr. Debtor </Nm>
<PstlAdr>
<AdrLine>Grote Markt 123 appt 5</AdrLine>
<StrtNm>EAST 45TH ST</StrtNm>
<BldgNb>25</BldgNb>
<PstCd>834009</PstCd>
<TwnNm>Manhattan</TwnNm>
<Ctry>US</Ctry>
</PstlAdr>
</Dbtr>
<DbtrAcct>
<Id>
<IBAN>BE15849613415938</IBAN>
</Id>
</DbtrAcct>
<DbtrAgt>
<FinInstnId>
<BICFI>TSPABEBBXXX</BICFI>
<BICFI>AABBGB2X</BICFI>
</FinInstnId>
</DbtrAgt>
<CdtrAgt>
<FinInstnId>
<BICFI>TSPBBEBBXXX</BICFI>
<Nm>European Techsavy Bank</Nm>
<PstlAdr>
<AdrLine>Sample address</AdrLine>
</PstlAdr>
<BICFI>AABBGB2X</BICFI>
</FinInstnId>
</CdtrAgt>
<Cdtr>
<Nm>Marie Unstructured</Nm>
<Nm>Mr. Creditor </Nm>
<PstlAdr>
<AdrLine>79&amp; Cl&lt;os d&gt;e l&apos;Argi&quot;liere</AdrLine>
<StrtNm>Cable Walk </StrtNm>
<BldgNb>89</BldgNb>
<PstCd>SE120</PstCd>
<TwnNm>California</TwnNm>
<Ctry>US</Ctry>
</PstlAdr>
<Id>
<PrvtId>
<DtAndPlcOfBirth>
<BirthDt>1980-04-22</BirthDt>
<CityOfBirth>Liege</CityOfBirth>
<CtryOfBirth>BE</CtryOfBirth>
</DtAndPlcOfBirth>
</PrvtId>
</Id>
</Cdtr>
<CdtrAcct>
<Id>
<Othr>
<Id>539-0075470-34</Id>
</Othr>
</Id>
</CdtrAcct>
<RmtInf>
<Ustrd>Invoice number A078900012020</Ustrd>
</RmtInf>
</CdtTrfTxInf>
</FIToFICstmrCdtTrf>
</Document>
</RequestPayload>
\ No newline at end of file
</Request>
\ No newline at end of file
AppHdr
CxlDtls.TxInfAndSts.RslvdCase.Cretr.Pty
CxlDtls.TxInfAndSts.RslvdCase.Cretr.Agt
\ No newline at end of file
AppHdr
Undrlyg.TxInf.Case.Cretr.Pty
Undrlyg.TxInf.Case.Cretr.Agt
\ No newline at end of file
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