Commit cad27096 by chengzhuoshen

0822swift官网MX2MT更新

parent c19858b6
...@@ -45,6 +45,15 @@ public class SwiftTransfer { ...@@ -45,6 +45,15 @@ public class SwiftTransfer {
return str.getMessage(); 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 { public static SwiftTranslationReport mx2MtPlus(File file, String outPutFilePath, Map<String, Object> extraMap) throws SwiftException {
try{ try{
String xmlStr = FileUtils.readFileToString(file); String xmlStr = FileUtils.readFileToString(file);
...@@ -59,6 +68,15 @@ public class SwiftTransfer { ...@@ -59,6 +68,15 @@ public class SwiftTransfer {
return new Mx2MtCreatorManager().mx2Mt(xmlStr, outPutFilePath, extraMap); 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 * MT TRANSFER MX
*/ */
...@@ -76,6 +94,15 @@ public class SwiftTransfer { ...@@ -76,6 +94,15 @@ public class SwiftTransfer {
return str.getMessage(); 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 { public static SwiftTranslationReport mt2MxPlus(File file, String outPutFilePath, Map<String, Object> extraMap) throws SwiftException {
try{ try{
String mtStr = FileUtils.readFileToString(file); String mtStr = FileUtils.readFileToString(file);
...@@ -119,7 +146,15 @@ public class SwiftTransfer { ...@@ -119,7 +146,15 @@ public class SwiftTransfer {
} catch (DocumentException e) { } catch (DocumentException e) {
throw new SwiftException("ERROR", e.getMessage()); 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) { public static String mx2Gson(File file) {
...@@ -142,6 +177,15 @@ public class SwiftTransfer { ...@@ -142,6 +177,15 @@ public class SwiftTransfer {
return gsonStr; 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> * 将MX xml转换成Map<String, String>
* @param xmlStr * @param xmlStr
...@@ -152,6 +196,29 @@ public class SwiftTransfer { ...@@ -152,6 +196,29 @@ public class SwiftTransfer {
return new Mx2MapCreatorManager().mx2Map(xmlStr); 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) { public static boolean validateMx(File file) {
try{ try{
String mtStr = FileUtils.readFileToString(file); String mtStr = FileUtils.readFileToString(file);
...@@ -180,9 +247,9 @@ public class SwiftTransfer { ...@@ -180,9 +247,9 @@ public class SwiftTransfer {
if (namespace.isPresent()) { if (namespace.isPresent()) {
MxId appHdrMxId = new MxId(namespace.get()); MxId appHdrMxId = new MxId(namespace.get());
appHdrXsdName = appHdrMxId.getBusinessProcess().name() appHdrXsdName = appHdrMxId.getBusinessProcess().name()
+ appHdrMxId.getFunctionality() + appHdrMxId.getFunctionality()
+ appHdrMxId.getVariant() + appHdrMxId.getVariant()
+ appHdrMxId.getVersion(); + appHdrMxId.getVersion();
} }
if (StringUtil.isNotEmpty(appHdrXsdName) && StringUtil.isNotEmpty(appHdrXml)) { if (StringUtil.isNotEmpty(appHdrXsdName) && StringUtil.isNotEmpty(appHdrXml)) {
SwiftTransferUtil.schemaValidate(appHdrXsdName, appHdrXml); SwiftTransferUtil.schemaValidate(appHdrXsdName, appHdrXml);
...@@ -200,9 +267,9 @@ public class SwiftTransfer { ...@@ -200,9 +267,9 @@ public class SwiftTransfer {
if (namespace.isPresent()) { if (namespace.isPresent()) {
MxId documentMxId = new MxId(namespace.get()); MxId documentMxId = new MxId(namespace.get());
documentXsdName = documentMxId.getBusinessProcess().name() documentXsdName = documentMxId.getBusinessProcess().name()
+ documentMxId.getFunctionality() + documentMxId.getFunctionality()
+ documentMxId.getVariant() + documentMxId.getVariant()
+ documentMxId.getVersion(); + documentMxId.getVersion();
} }
if (StringUtil.isNotEmpty(documentXsdName) && StringUtil.isNotEmpty(documentXml)) { if (StringUtil.isNotEmpty(documentXsdName) && StringUtil.isNotEmpty(documentXml)) {
SwiftTransferUtil.schemaValidate(documentXsdName, documentXml); SwiftTransferUtil.schemaValidate(documentXsdName, documentXml);
...@@ -221,10 +288,19 @@ public class SwiftTransfer { ...@@ -221,10 +288,19 @@ public class SwiftTransfer {
public static String mx2Element(File file) { public static String mx2Element(File file) {
try { try {
String xmlStr = FileUtils.readFileToString(file); String xmlStr = FileUtils.readFileToString(file);
return mx2Element(xmlStr); return mx2Element(xmlStr);
} catch (IOException e) { } catch (IOException e) {
throw new SwiftException(e.getMessage()); 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; ...@@ -8,6 +8,7 @@ import com.brilliance.swift.util.SwiftTransferUtil;
import com.brilliance.swift.util.XmlUtil; import com.brilliance.swift.util.XmlUtil;
import com.brilliance.swift.vo.SwiftTranslationErrorInfo; import com.brilliance.swift.vo.SwiftTranslationErrorInfo;
import com.brilliance.swift.vo.SwiftTranslationReport; import com.brilliance.swift.vo.SwiftTranslationReport;
import com.brilliance.swift.vo.common.TranslationResultCode;
import com.prowidesoftware.swift.io.ConversionService; import com.prowidesoftware.swift.io.ConversionService;
import com.prowidesoftware.swift.io.IConversionService; import com.prowidesoftware.swift.io.IConversionService;
import com.prowidesoftware.swift.io.writer.SwiftWriter; import com.prowidesoftware.swift.io.writer.SwiftWriter;
...@@ -548,6 +549,7 @@ public abstract class AbstractMx2MtCreator implements Mx2MtCreator { ...@@ -548,6 +549,7 @@ public abstract class AbstractMx2MtCreator implements Mx2MtCreator {
} }
} }
} }
summaryTranslationResult(str);
} }
public void write(SwiftMessage swiftMessage, File file) throws SwiftException { public void write(SwiftMessage swiftMessage, File file) throws SwiftException {
...@@ -564,4 +566,51 @@ public abstract class AbstractMx2MtCreator implements Mx2MtCreator { ...@@ -564,4 +566,51 @@ public abstract class AbstractMx2MtCreator implements Mx2MtCreator {
throw new SwiftException(e.getMessage()); 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.*; ...@@ -10,8 +10,6 @@ import com.brilliance.swift.vo.common.*;
import com.prowidesoftware.swift.model.Tag; import com.prowidesoftware.swift.model.Tag;
import org.dom4j.Document; import org.dom4j.Document;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.ParseException; import java.text.ParseException;
import java.util.*; import java.util.*;
...@@ -1605,195 +1603,6 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate { ...@@ -1605,195 +1603,6 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
return mtRemittanceInfo; 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) { protected String mx_to_mtFATFIdentification(String partyPath, boolean structuredAddressIndicator) {
String identificationPath = partyPath + ".Id"; String identificationPath = partyPath + ".Id";
String countryCode = getXmlNodeValue(null, document, partyPath+".PstlAdr.Ctry"); String countryCode = getXmlNodeValue(null, document, partyPath+".PstlAdr.Ctry");
......
...@@ -29,6 +29,7 @@ public class Mx2MtCreatorManager { ...@@ -29,6 +29,7 @@ public class Mx2MtCreatorManager {
public SwiftTranslationReport mx2Mt(String xml, String fileOutputPath, Map<String, Object> extraMap) throws SwiftException { public SwiftTranslationReport mx2Mt(String xml, String fileOutputPath, Map<String, Object> extraMap) throws SwiftException {
try { try {
Document document1 = DocumentHelper.parseText(xml);
AbstractMX abstractMX = AbstractMX.parse(xml); AbstractMX abstractMX = AbstractMX.parse(xml);
String messageType = (abstractMX.getMxId().getBusinessProcess().name() String messageType = (abstractMX.getMxId().getBusinessProcess().name()
+ "." + "."
......
...@@ -55,7 +55,7 @@ public class Field71AGenerate extends AbstractMx2MtTagsGenerate { ...@@ -55,7 +55,7 @@ public class Field71AGenerate extends AbstractMx2MtTagsGenerate {
BigDecimal tmpAmt = new BigDecimal(getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.ChrgsInf("+i+").Amt")); BigDecimal tmpAmt = new BigDecimal(getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.ChrgsInf("+i+").Amt"));
sumAmt = sumAmt.add(tmpAmt); sumAmt = sumAmt.add(tmpAmt);
} else { } else {
buildSTErrorInfo(39, "block4/:"+name_G+":", null); buildSTErrorInfo(39, "Block4/:"+name_G+":", null);
return; return;
} }
} }
......
...@@ -81,7 +81,7 @@ public class Mx2Mtn92Creator extends AbstractMx2MtCreator { ...@@ -81,7 +81,7 @@ public class Mx2Mtn92Creator extends AbstractMx2MtCreator {
} else if (orgMsgNameIdentification.matches("MT20[0-9]{1}")) { } else if (orgMsgNameIdentification.matches("MT20[0-9]{1}")) {
mtType = Mx2MtConstants.MT_TYPE_292; mtType = Mx2MtConstants.MT_TYPE_292;
}else { }else {
buildSTErrorInfo(79,"Block2/:mtType:",orgMsgNameIdentification); buildSTErrorInfo(79,"Block2/MtType", orgMsgNameIdentification);
} }
} }
return mtType; return mtType;
......
...@@ -3,10 +3,14 @@ package com.brilliance.swift.mx2mt.mt192292.impl; ...@@ -3,10 +3,14 @@ package com.brilliance.swift.mx2mt.mt192292.impl;
import com.brilliance.swift.constants.Mx2MtConstants; import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException; import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate; import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.DateUtil;
import com.brilliance.swift.util.StringUtil; import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage; import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag; 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; import java.util.List;
/** /**
...@@ -20,38 +24,38 @@ public class Field11SGenerate extends AbstractMx2MtTagsGenerate { ...@@ -20,38 +24,38 @@ public class Field11SGenerate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException { public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class); SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags(); List<Tag> tags = swiftMessage.getBlock4().getTags();
String orgnlMsgNmId = ""; String mtNumber = "";
String date = ""; String orgnlMsgNm = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId");
String mtType = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId"); if (StringUtil.isNotEmpty(orgnlMsgNm)) {
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlGrpInf.OrgnlCreDtTm"); if (orgnlMsgNm.indexOf("pacs.008") > -1) {
if (StringUtil.isNotEmpty(mtType)) { mtNumber = "103";
if(StringUtil.isNotEmpty(mtType)){ } else if (orgnlMsgNm.indexOf("pacs.003") > -1) {
if(mtType.startsWith("pacs.008")){ mtNumber = "104";
orgnlMsgNmId = "103"; } else if (orgnlMsgNm.matches("MT10[0-9]{1}")) {
}else if(mtType.startsWith("pacs.003")){ mtNumber = orgnlMsgNm.substring(2);
orgnlMsgNmId = "104"; } else if (orgnlMsgNm.indexOf("pacs.009") > -1) {
}else if(mtType.startsWith("pacs.009")){ mtNumber = "202";
orgnlMsgNmId = "202"; } else if (orgnlMsgNm.indexOf("pacs.010") > -1) {
}else if(mtType.startsWith("pacs.010")){ mtNumber = "204";
orgnlMsgNmId = "204"; } else if (orgnlMsgNm.matches("MT20[0-9]{1}")) {
}else if(mtType.matches("MT10[0-9]{1}")){ mtNumber = orgnlMsgNm.substring(2);
orgnlMsgNmId = mtType.substring(2); } else {
}else if(mtType.matches("MT20[0-9]{1}")){ mtNumber = "202";
orgnlMsgNmId = mtType.substring(2); buildSTErrorInfo(75, "Block4/:11S:", orgnlMsgNm);
}else {
orgnlMsgNmId = "202";
buildSTErrorInfo(75,"Block4/:11S:",null);
}
} }
} }
if(StringUtil.isNotEmpty(dateStr)){ String mtDate = "991231";
if(dateStr.length()>0){ String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlGrpInf.OrgnlCreDtTm");
date = mXToMTDate(dateStr); if (StringUtil.isNotEmpty(dateStr)) {
}else { try {
date = "993112"; XMLGregorianCalendar date = DatatypeFactory.newInstance().newXMLGregorianCalendar(dateStr);
mtDate = DateUtil.format(date, "yyMMdd");
} catch (DatatypeConfigurationException e) {
throw new SwiftException(e.getMessage());
} }
} }
tags.add(new Tag(name, orgnlMsgNmId+Mx2MtConstants.NEW_LINE+date)); if (StringUtil.isNotEmpty(mtNumber)) {
tags.add(new Tag(name, mtNumber + Mx2MtConstants.NEW_LINE + mtDate));
}
} }
} }
...@@ -21,21 +21,16 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate { ...@@ -21,21 +21,16 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
SwiftMessage swiftMessage = context.get(SwiftMessage.class); SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags(); List<Tag> tags = swiftMessage.getBlock4().getTags();
String messageId = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.Case.Id"); String messageId = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.Case.Id");
String value = "";
if (StringUtil.isNotEmpty(messageId)) { if (StringUtil.isNotEmpty(messageId)) {
if (messageId.length() > 16) { if (messageId.length() > 16) {
buildSTErrorInfo(13, "Block4/:20:", messageId); buildSTErrorInfo(13, "Block4/:20:", messageId);
value = messageId.substring(0, 15) + "+"; messageId = messageId.substring(0, 15) + "+";
} else {
value = messageId;
} }
} if (messageId.startsWith("/") || messageId.endsWith("/") || messageId.contains("//")) {
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { buildSTErrorInfo(42, "Block4/:20:", messageId);
buildSTErrorInfo(42, "Block4/:20:", value); messageId = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; }
} tags.add(new Tag(name, messageId));
if (StringUtil.isNotEmpty(value)) {
tags.add(new Tag(name, value));
} }
} }
} }
...@@ -21,21 +21,16 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate { ...@@ -21,21 +21,16 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
SwiftMessage swiftMessage = context.get(SwiftMessage.class); SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags(); List<Tag> tags = swiftMessage.getBlock4().getTags();
String orgnlInstrId = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlInstrId"); String orgnlInstrId = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlInstrId");
String value = "";
if (StringUtil.isNotEmpty(orgnlInstrId)) { if (StringUtil.isNotEmpty(orgnlInstrId)) {
if (orgnlInstrId.length() > 16) { if (orgnlInstrId.length() > 16) {
buildSTErrorInfo(13, "Block4/:21:", orgnlInstrId); buildSTErrorInfo(13, "Block4/:21:", orgnlInstrId);
value = orgnlInstrId.substring(0, 15) + "+"; orgnlInstrId = orgnlInstrId.substring(0, 15) + "+";
} else {
value = orgnlInstrId;
} }
} }
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { if (StringUtil.isEmpty(orgnlInstrId) || (orgnlInstrId.startsWith("/") || orgnlInstrId.endsWith("/") || orgnlInstrId.contains("//"))) {
buildSTErrorInfo(73, "Block4/:21:", value); buildSTErrorInfo(73, "Block4/:21:", orgnlInstrId);
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; orgnlInstrId = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
if (StringUtil.isNotEmpty(value)) {
tags.add(new Tag(name, value));
} }
tags.add(new Tag(name, orgnlInstrId));
} }
} }
package com.brilliance.swift.mx2mt.mt192292.impl; package com.brilliance.swift.mx2mt.mt192292.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException; import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate; import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.DateUtil;
import com.brilliance.swift.util.NumberUtil; import com.brilliance.swift.util.NumberUtil;
import com.brilliance.swift.util.StringUtil; import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage; import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag; 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.math.BigDecimal;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -23,23 +29,76 @@ public class Field79Generate extends AbstractMx2MtTagsGenerate { ...@@ -23,23 +29,76 @@ public class Field79Generate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException { public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class); SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags(); 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 uetr = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlUETR");
String filed79 = mXToMT79CANC(uetr, "Undrlyg.TxInf.CxlRsnInf"); if (StringUtil.isEmpty(uetr)) {
filed79 = mx_to_mtStartingLineCharacter(filed79, "Block4/:79:"); if (StringUtil.isNotEmpty(mt32A)) {
if (StringUtil.isNotEmpty(filed79)) { tags.add(new Tag(name_32A, mt32A));
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));
} }
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 { ...@@ -81,7 +81,7 @@ public class Mx2Mtn96Creator extends AbstractMx2MtCreator {
} else if (orgMsgNameIdentification.matches("MT20[0-9]{1}")) { } else if (orgMsgNameIdentification.matches("MT20[0-9]{1}")) {
mtType = Mx2MtConstants.MT_TYPE_296; mtType = Mx2MtConstants.MT_TYPE_296;
}else { }else {
buildSTErrorInfo(79,"Block2/:mtType:",orgMsgNameIdentification); buildSTErrorInfo(79,"Block2/MtType",orgMsgNameIdentification);
} }
} }
return mtType; return mtType;
......
...@@ -3,10 +3,14 @@ package com.brilliance.swift.mx2mt.mt196296.impl; ...@@ -3,10 +3,14 @@ package com.brilliance.swift.mx2mt.mt196296.impl;
import com.brilliance.swift.constants.Mx2MtConstants; import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException; import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate; import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.DateUtil;
import com.brilliance.swift.util.StringUtil; import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage; import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag; 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; import java.util.List;
/** /**
...@@ -20,46 +24,48 @@ public class Field11RGenerate extends AbstractMx2MtTagsGenerate { ...@@ -20,46 +24,48 @@ public class Field11RGenerate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException { public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class); SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags(); List<Tag> tags = swiftMessage.getBlock4().getTags();
String orgnlMsgNmId = "";
String date = "";
boolean boolean1 = false; boolean boolean1 = false;
boolean boolean2 = false; boolean boolean2 = false;
String mtType = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId"); String mtNumber = "";
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlCreDtTm"); String orgnlMsgNm = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId");
if (StringUtil.isNotEmpty(mtType)) { if (StringUtil.isNotEmpty(orgnlMsgNm)) {
if(StringUtil.isNotEmpty(mtType)){ if(orgnlMsgNm.indexOf("pacs.008") > -1){
if(mtType.startsWith("pacs.008")){ mtNumber = "103";
orgnlMsgNmId = "103"; }else if(orgnlMsgNm.indexOf("pacs.003") > -1){
}else if(mtType.startsWith("pacs.003")){ mtNumber = "104";
orgnlMsgNmId = "104"; }else if(orgnlMsgNm.indexOf("pacs.009") > -1){
}else if(mtType.startsWith("pacs.009")){ mtNumber = "202";
orgnlMsgNmId = "202"; }else if(orgnlMsgNm.indexOf("pacs.010") > -1){
}else if(mtType.startsWith("pacs.010")){ mtNumber = "204";
orgnlMsgNmId = "204"; }else if(orgnlMsgNm.matches("MT10[0-9]{1}")){
}else if(mtType.matches("MT10[0-9]{1}")){ mtNumber = orgnlMsgNm.substring(2);
orgnlMsgNmId = mtType.substring(2); }else if(orgnlMsgNm.matches("MT20[0-9]{1}")){
}else if(mtType.matches("MT20[0-9]{1}")){ mtNumber = orgnlMsgNm.substring(2);
orgnlMsgNmId = mtType.substring(2); }else {
}else { mtNumber = "202";
orgnlMsgNmId = "202"; boolean1 = true;
boolean1 = true;
}
} }
} }
if(StringUtil.isNotEmpty(dateStr)){ String mtDate = "";
if(dateStr.length()>0){ String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlCreDtTm");
date = mXToMTDate(dateStr); if (StringUtil.isNotEmpty(dateStr)) {
}else { try {
date = "993112"; XMLGregorianCalendar date = DatatypeFactory.newInstance().newXMLGregorianCalendar(dateStr);
boolean2 = true; mtDate = DateUtil.format(date, "yyMMdd");
} catch (DatatypeConfigurationException e) {
throw new SwiftException(e.getMessage());
} }
} }
if(boolean1&&boolean2){ if (StringUtil.isEmpty(mtDate)) {
mtDate = "991231";
boolean2 = true;
}
if((boolean1 && boolean2) || StringUtil.isEmpty(mtNumber)){
return;
}else { }else {
tags.add(new Tag(name, orgnlMsgNmId+Mx2MtConstants.NEW_LINE+date)); tags.add(new Tag(name, mtNumber + Mx2MtConstants.NEW_LINE + mtDate));
if(boolean1){ if(boolean1){
buildSTErrorInfo(75,"BLOCK4/:11R:",null); buildSTErrorInfo(75,"Block4/:11R:",null);
} }
} }
......
...@@ -20,20 +20,17 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate { ...@@ -20,20 +20,17 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException { public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class); SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags(); List<Tag> tags = swiftMessage.getBlock4().getTags();
String messageId = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.CxlStsId"); String cxlStsId = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.CxlStsId");
if (StringUtil.isNotEmpty(messageId)) { if (StringUtil.isNotEmpty(cxlStsId)) {
String value = messageId; if (cxlStsId.length() > 16) {
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { buildSTErrorInfo(13, "Block4/:20:", cxlStsId);
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; cxlStsId = cxlStsId.substring(0, 15) + "+";
buildSTErrorInfo(42, "BLOCK4/:20:", value);
tags.add(new Tag(name, value));
return;
} }
if (value.length() > 16) { if (cxlStsId.startsWith("/") || cxlStsId.endsWith("/") || cxlStsId.contains("//")) {
buildSTErrorInfo(13, "BLOCK4/:20:", value); buildSTErrorInfo(42, "Block4/:20:", cxlStsId);
value = value.substring(0, 15) + "+"; 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 { ...@@ -20,21 +20,18 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException { public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class); SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags(); List<Tag> tags = swiftMessage.getBlock4().getTags();
String orgnlInstrId = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.RslvdCase.Id"); String rslvdCaseId = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.RslvdCase.Id");
if (StringUtil.isNotEmpty(orgnlInstrId)) { if (StringUtil.isNotEmpty(rslvdCaseId)) {
String value = orgnlInstrId; if (rslvdCaseId.length() > 16) {
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { buildSTErrorInfo(13, "Block4/:21:", rslvdCaseId);
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; rslvdCaseId = rslvdCaseId.substring(0, 15) + "+";
buildSTErrorInfo(42, "BLOCK4/:21:", value);
tags.add(new Tag(name, value));
return;
} }
if (value.length() > 16) { if (rslvdCaseId.startsWith("/") || rslvdCaseId.endsWith("/") || rslvdCaseId.contains("//")) {
buildSTErrorInfo(13, "BLOCK4/:21:", value); buildSTErrorInfo(42, "Block4/:21:", rslvdCaseId);
value = value.substring(0, 15) + "+"; 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; package com.brilliance.swift.mx2mt.mt196296.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException; import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate; import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.StringUtil; import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage; import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag; import com.prowidesoftware.swift.model.Tag;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -21,16 +23,76 @@ public class Field76Generate extends AbstractMx2MtTagsGenerate { ...@@ -21,16 +23,76 @@ public class Field76Generate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException { public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class); SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags(); List<Tag> tags = swiftMessage.getBlock4().getTags();
String uetr = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.OrgnlUETR"); String status = getXmlNodeValue(bodyHdrParentElementName, document, "Sts.Conf");
String sts = getXmlNodeValue(bodyHdrParentElementName, document, "Sts.Conf"); if (StringUtil.isEmpty(status)) return;
List<String> list = mXToMT76RCANC(sts,uetr, "CxlDtls.TxInfAndSts.CxlStsRsnInf"); String mxReasonCode = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.CxlStsRsnInf.Rsn.Cd");
if(list.size()>0&&StringUtil.isNotEmpty(list.get(0))){ int addtlInfCount = getXmlNodeCounts(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.CxlStsRsnInf.AddtlInf");
if(StringUtil.isNotEmpty(list.get(0))){ String mxAddtlInf = "";
tags.add(new Tag(name_76, list.get(0))); 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;
} }
if(StringUtil.isNotEmpty(list.get(1))){ } else if (StringUtil.isNotEmpty(mxAddtlInf)) {
tags.add(new Tag(name_77A, list.get(1))); 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");
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(mt77)) {
tags.add(new Tag(name_77A, mt77));
}
} }
} }
...@@ -14,6 +14,8 @@ public class SwiftTranslationReport { ...@@ -14,6 +14,8 @@ public class SwiftTranslationReport {
private String message; private String message;
private String translationResult;
public List<SwiftTranslationErrorInfo> getErrorInfos() { public List<SwiftTranslationErrorInfo> getErrorInfos() {
if (errorInfos == null) { if (errorInfos == null) {
errorInfos = new ArrayList<>(); errorInfos = new ArrayList<>();
...@@ -32,4 +34,12 @@ public class SwiftTranslationReport { ...@@ -32,4 +34,12 @@ public class SwiftTranslationReport {
public void setMessage(String message) { public void setMessage(String message) {
this.message = 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 @@ ...@@ -44,11 +44,11 @@
<Bal> <Bal>
<Tp> <Tp>
<CdOrPrtry> <CdOrPrtry>
<Cd>OPBD</Cd> <Cd>CLBD</Cd>
</CdOrPrtry> </CdOrPrtry>
</Tp> </Tp>
<Amt Ccy="EUR">6587.02</Amt> <Amt Ccy="EUR">58537.21</Amt>
<CdtDbtInd>DBIT</CdtDbtInd> <CdtDbtInd>CRDT</CdtDbtInd>
<Dt> <Dt>
<Dt>2020-08-04</Dt> <Dt>2020-08-04</Dt>
</Dt> </Dt>
...@@ -56,15 +56,16 @@ ...@@ -56,15 +56,16 @@
<Bal> <Bal>
<Tp> <Tp>
<CdOrPrtry> <CdOrPrtry>
<Cd>CLBD</Cd> <Cd>OPBD</Cd>
</CdOrPrtry> </CdOrPrtry>
</Tp> </Tp>
<Amt Ccy="EUR">58537.21</Amt> <Amt Ccy="EUR">6587.02</Amt>
<CdtDbtInd>CRDT</CdtDbtInd> <CdtDbtInd>DBIT</CdtDbtInd>
<Dt> <Dt>
<Dt>2020-08-04</Dt> <Dt>2020-08-04</Dt>
</Dt> </Dt>
</Bal> </Bal>
<Ntry> <Ntry>
<Amt Ccy="EUR">65124.23</Amt> <Amt Ccy="EUR">65124.23</Amt>
<CdtDbtInd>CRDT</CdtDbtInd> <CdtDbtInd>CRDT</CdtDbtInd>
......
<?xml version="1.0" encoding="UTF-8"?> <?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). 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).
========================================================================================================================================================================================= =========================================================================================================================================================================================
...@@ -11,77 +11,70 @@ Use Case c.56.1.1 Agent A RBS plc sends a camt.056 to Agent B Nordea Finland ...@@ -11,77 +11,70 @@ Use Case c.56.1.1 Agent A RBS plc sends a camt.056 to Agent B Nordea Finland
Change Log Change Log
2020-10-16 - Original version 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"> <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"> <AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.02">
<Fr> <Fr>
<FIId> <FIId>
<FinInstnId> <FinInstnId>
<BICFI>RBOSGB2L</BICFI> <BICFI>RBOSGB2L</BICFI>
</FinInstnId> </FinInstnId>
</FIId> </FIId>
</Fr> </Fr>
<To> <To>
<FIId> <FIId>
<FinInstnId> <FinInstnId>
<BICFI>NDEAFIHH</BICFI> <BICFI>NDEAFIHH</BICFI>
</FinInstnId> </FinInstnId>
</FIId> </FIId>
</To> </To>
<BizMsgIdr>cmt056bizmsgidr-001</BizMsgIdr> <BizMsgIdr>cmt056bizmsgidr-001</BizMsgIdr>
<MsgDefIdr>camt.056.001.08</MsgDefIdr> <MsgDefIdr>camt.056.001.08</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc> <BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2021-02-17T12:10:00+01:00</CreDt> <CreDt>2021-02-17T12:10:00+01:00</CreDt>
</AppHdr> </AppHdr>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.056.001.08"> <Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.056.001.08">
<FIToFIPmtCxlReq> <FIToFIPmtCxlReq>
<Assgnmt> <Assgnmt>
<Id>ASSNID-001</Id> <Id>ASSNID-001</Id>
<Assgnr> <Assgnr>
<Agt> <Agt>
<FinInstnId> <FinInstnId>
<BICFI>RBOSGB2L</BICFI> <BICFI>RBOSGB2L</BICFI>
</FinInstnId> </FinInstnId>
</Agt> </Agt>
</Assgnr> </Assgnr>
<Assgne> <Assgne>
<Agt> <Agt>
<FinInstnId> <FinInstnId>
<BICFI>NDEAFIHH</BICFI> <BICFI>NDEAFIHH</BICFI>
</FinInstnId> </FinInstnId>
</Agt> </Agt>
</Assgne> </Assgne>
<CreDtTm>2021-02-17T08:30:00+01:00</CreDtTm> <CreDtTm>2021-02-17T08:30:00+01:00</CreDtTm>
</Assgnmt> </Assgnmt>
<Undrlyg> <Undrlyg>
<TxInf> <TxInf>
<Case> <Case>
<Id>CSE-0011</Id> <Id>CSE-001</Id>
<Cretr> <Cretr>
<Agt> <Agt>
<FinInstnId> <FinInstnId>
<BICFI>RBOSGB2L</BICFI> <BICFI>RBOSGB2L</BICFI>
<Nm>zs</Nm>
<LEI>cd</LEI>
<PstlAdr>
<TwnLctnNm>zhangsan</TwnLctnNm>
<DstrctNm>lisi</DstrctNm>
<CtrySubDvsn>wangwu</CtrySubDvsn>
</PstlAdr>
</FinInstnId> </FinInstnId>
</Agt> </Agt>
</Cretr> </Cretr>
</Case> </Case>
<OrgnlGrpInf> <OrgnlGrpInf>
<OrgnlMsgId>pacs8bizmsgidr01</OrgnlMsgId> <OrgnlMsgId>pacs8bizmsgidr01</OrgnlMsgId>
<OrgnlMsgNmId>pacs.008.001.08</OrgnlMsgNmId> <OrgnlMsgNmId>pacs.008.001.08</OrgnlMsgNmId>
<OrgnlCreDtTm>2021-02-17T08:30:00+01:00</OrgnlCreDtTm> <OrgnlCreDtTm>2021-02-17T08:30:00+01:00</OrgnlCreDtTm>
</OrgnlGrpInf> </OrgnlGrpInf>
<OrgnlInstrId>pacs8bizmsgidr01</OrgnlInstrId> <OrgnlInstrId>pacs8bizmsgidr01</OrgnlInstrId>
<OrgnlEndToEndId>pacs008EndToEndId-001</OrgnlEndToEndId> <OrgnlEndToEndId>pacs008EndToEndId-001</OrgnlEndToEndId>
<OrgnlUETR>8a562c67-ca16-48ba-b074-65581be6f001</OrgnlUETR> <OrgnlUETR>8a562c67-ca16-48ba-b074-65581be6f001</OrgnlUETR>
<OrgnlIntrBkSttlmAmt Ccy="EUR">1500000</OrgnlIntrBkSttlmAmt> <OrgnlIntrBkSttlmAmt Ccy="EUR">1500000</OrgnlIntrBkSttlmAmt>
<OrgnlIntrBkSttlmDt>2021-02-17</OrgnlIntrBkSttlmDt> <OrgnlIntrBkSttlmDt>2021-02-17</OrgnlIntrBkSttlmDt>
<CxlRsnInf> <CxlRsnInf>
<Orgtr> <Orgtr>
<Nm>A Debiter</Nm> <Nm>A Debiter</Nm>
...@@ -89,20 +82,18 @@ Change Log ...@@ -89,20 +82,18 @@ Change Log
<StrtNm>280 Bishopsgate</StrtNm> <StrtNm>280 Bishopsgate</StrtNm>
<TwnNm>London</TwnNm> <TwnNm>London</TwnNm>
<Ctry>GB</Ctry> <Ctry>GB</Ctry>
<TwnLctnNm>zhangsan</TwnLctnNm>
<DstrctNm>lisi</DstrctNm>
<CtrySubDvsn>wangwu</CtrySubDvsn>
</PstlAdr> </PstlAdr>
</Orgtr> </Orgtr>
<Rsn> <Rsn>
<Cd>AM09</Cd> <Cd>AM09</Cd>
</Rsn> </Rsn>
<AddtlInf>HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO</AddtlInf> <AddtlInf>chengzhuoshen</AddtlInf>
<AddtlInf>NICE TO MEET YOU</AddtlInf> <AddtlInf>dashuaige</AddtlInf>
</CxlRsnInf> <AddtlInf>zhendeshuai</AddtlInf>
</TxInf> </CxlRsnInf>
</Undrlyg> </TxInf>
</FIToFIPmtCxlReq> </Undrlyg>
</Document> </FIToFIPmtCxlReq>
</Document>
</Envelope> </Envelope>
...@@ -17,132 +17,66 @@ Change Log ...@@ -17,132 +17,66 @@ Change Log
<Fr> <Fr>
<FIId> <FIId>
<FinInstnId> <FinInstnId>
<BICFI>CHASUS33XXX</BICFI> <BICFI>AABBGB2X</BICFI>
</FinInstnId> </FinInstnId>
</FIId> </FIId>
</Fr> </Fr>
<To> <To>
<FIId> <FIId>
<FinInstnId> <FinInstnId>
<BICFI>CHASGB2LXXX</BICFI> <BICFI>AABBIE2X</BICFI>
</FinInstnId> </FinInstnId>
</FIId> </FIId>
</To> </To>
<BizMsgIdr>P4B2A-006</BizMsgIdr> <BizMsgIdr>Buzmsgidr/pacc4</BizMsgIdr>
<MsgDefIdr>pacs.004.001.09</MsgDefIdr> <MsgDefIdr>Msgdefidr/acs.004/001</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc> <BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2020-01-11T13:00:00.960-05:00</CreDt> <CreDt>2022-03-10T09:24:41+01: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>
</AppHdr> </AppHdr>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pacs.004.001.09"> <Document xmlns="urn:iso:std:iso:20022:tech:xsd:pacs.004.001.09">
<PmtRtr> <PmtRtr>
<GrpHdr> <GrpHdr>
<MsgId>P4B2A-006</MsgId> <MsgId>Buzmsgidr/pacc4</MsgId>
<CreDtTm>2020-01-11T13:00:00.960-05:00</CreDtTm> <CreDtTm>2022-03-15T10:26:17+01:00</CreDtTm>
<NbOfTxs>1</NbOfTxs> <NbOfTxs>1</NbOfTxs>
<SttlmInf> <SttlmInf>
<SttlmMtd>INGA</SttlmMtd> <SttlmMtd>INDA</SttlmMtd>
</SttlmInf> </SttlmInf>
</GrpHdr> </GrpHdr>
<TxInf> <TxInf>
<OrgnlGrpInf> <OrgnlInstrId>pacs8gidr02</OrgnlInstrId>
<OrgnlMsgId>A2B0506272708</OrgnlMsgId> <OrgnlEndToEndId>Orgnle2eidpacs9</OrgnlEndToEndId>
<OrgnlMsgNmId>pacs.008.001.08</OrgnlMsgNmId> <OrgnlUETR>3f91d85a-48e0-4410-9b5c-8023c90eb587</OrgnlUETR>
</OrgnlGrpInf> <OrgnlIntrBkSttlmAmt Ccy="EUR">150.</OrgnlIntrBkSttlmAmt>
<OrgnlInstrId>A2B0506272708</OrgnlInstrId> <RtrdIntrBkSttlmAmt Ccy="EUR">100.</RtrdIntrBkSttlmAmt>
<OrgnlEndToEndId>E2E04044506271305</OrgnlEndToEndId> <IntrBkSttlmDt>2022-03-09+01:00</IntrBkSttlmDt>
<OrgnlUETR>174c245f-2682-4291-ad67-2a41e530cd27</OrgnlUETR> <RtrdInstdAmt Ccy="EUR">100.</RtrdInstdAmt>
<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>
<ChrgBr>SHAR</ChrgBr> <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> <InstgAgt>
<FinInstnId> <FinInstnId>
<BICFI>CHASUS33XXX</BICFI> <BICFI>AABBGB2X</BICFI>
</FinInstnId> </FinInstnId>
</InstgAgt> </InstgAgt>
<InstdAgt> <InstdAgt>
<FinInstnId> <FinInstnId>
<BICFI>CHASGB2LXXX</BICFI> <BICFI>AABBIE2X</BICFI>
</FinInstnId> </FinInstnId>
</InstdAgt> </InstdAgt>
<RtrChain> <RtrChain>
<Dbtr> <Dbtr>
<Pty> <Pty>
<Nm>Main Street Capital</Nm> <Nm>Mr Debtor </Nm>
<PstlAdr>
<StrtNm>Oak Blvd</StrtNm>
<TwnNm>Houston</TwnNm>
<Ctry>US</Ctry>
</PstlAdr>
</Pty> </Pty>
</Dbtr> </Dbtr>
<DbtrAgt>
<FinInstnId>
<BICFI>TEXSUS41XXX</BICFI>
</FinInstnId>
</DbtrAgt>
<PrvsInstgAgt1>
<FinInstnId>
<BICFI>WFBIUS6SDAL</BICFI>
</FinInstnId>
</PrvsInstgAgt1>
<CdtrAgt>
<FinInstnId>
<BICFI>CHASGB2LXXX</BICFI>
</FinInstnId>
</CdtrAgt>
<Cdtr> <Cdtr>
<Pty> <Pty>
<Nm>ABC Capital</Nm> <Nm>Mr. Creditor</Nm>
<PstlAdr>
<StrtNm>155 Bishopsgate</StrtNm>
<TwnNm>London</TwnNm>
<Ctry>GB</Ctry>
</PstlAdr>
</Pty> </Pty>
</Cdtr> </Cdtr>
</RtrChain> </RtrChain>
<RtrRsnInf> <RtrRsnInf>
<Rsn> <Rsn>
<Cd>AM09</Cd> <Cd>AC04</Cd>
</Rsn> </Rsn>
</RtrRsnInf> </RtrRsnInf>
</TxInf> </TxInf>
......
<?xml version="1.0" encoding="UTF-8" ?> <Request>
<RequestPayload> <AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.02">
<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Fr> <Fr>
<FIId> <FIId>
<FinInstnId> <FinInstnId>
<BICFI>TSPABEBBXXX</BICFI> <BICFI>AABBGB2X</BICFI>
</FinInstnId> </FinInstnId>
</FIId> </FIId>
</Fr> </Fr>
<To> <To>
<FIId> <FIId>
<FinInstnId> <FinInstnId>
<BICFI>TSPBBEBBXXX</BICFI> <BICFI>AABBIE2X</BICFI>
</FinInstnId> </FinInstnId>
</FIId> </FIId>
</To> </To>
<BizMsgIdr>MID/7703.0/eecf9</BizMsgIdr> <BizMsgIdr>Buzmsgidtfr/020322/001</BizMsgIdr>
<MsgDefIdr>pacs.008.001.08</MsgDefIdr> <MsgDefIdr>Msgidtfr/020322/001</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc> <BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2022-09-08T09:50:34.101+02:00</CreDt> <CreDt>2022-03-03T08:22:08+01:00</CreDt>
<PssblDplct>false</PssblDplct>
</AppHdr> </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> <FIToFICstmrCdtTrf>
<GrpHdr> <GrpHdr>
<MsgId>MID/7703.0/eecf9</MsgId> <MsgId>Msgidetfcn/02/03/2022/001</MsgId>
<CreDtTm>2022-09-08T09:50:34.101+02:00</CreDtTm> <CreDtTm>2022-03-02T09:24:16+01:00</CreDtTm>
<NbOfTxs>1</NbOfTxs> <NbOfTxs>1</NbOfTxs>
<SttlmInf> <SttlmInf>
<SttlmMtd>COVE</SttlmMtd> <SttlmMtd>INDA</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>
</SttlmInf> </SttlmInf>
</GrpHdr> </GrpHdr>
<CdtTrfTxInf> <CdtTrfTxInf>
<PmtId> <PmtId>
<InstrId>IID/7703.0/eecf9</InstrId> <InstrId>Instrid-001</InstrId>
<EndToEndId>E2E/7703.0/eecf9</EndToEndId> <EndToEndId>e2eid/02/03/2022/001</EndToEndId>
<TxId>TID/7703.0/eecf9</TxId> <UETR>5ddd156b-ba52-4d7d-a7ea-197cf311dc19</UETR>
<UETR>5489a37a-2227-47cf-9730-e6c39e108ecc</UETR>
</PmtId> </PmtId>
<PmtTpInf> <IntrBkSttlmAmt Ccy="EUR">100.</IntrBkSttlmAmt>
<SvcLvl> <IntrBkSttlmDt>2022-03-04+01:00</IntrBkSttlmDt>
<Cd>G001</Cd> <InstdAmt Ccy="EUR">110.</InstdAmt>
</SvcLvl> <ChrgBr>DEBT</ChrgBr>
</PmtTpInf>
<IntrBkSttlmAmt Ccy="EUR">1000.0</IntrBkSttlmAmt>
<IntrBkSttlmDt>2022-09-08</IntrBkSttlmDt>
<InstdAmt Ccy="EUR">1000.0</InstdAmt>
<ChrgBr>SHAR</ChrgBr>
<ChrgsInf> <ChrgsInf>
<Amt Ccy="EUR">0.0</Amt> <Amt Ccy="EUR">99999999999999.</Amt>
<Agt> <Agt>
<FinInstnId> <FinInstnId>PSBCCNBJ</FinInstnId>
<BICFI>TSPABEBBXXX</BICFI> </Agt>
</FinInstnId> </ChrgsInf>
<ChrgsInf>
<Amt Ccy="EUR">99999999999999.</Amt>
<Agt>
<FinInstnId>PSBCCNBJ</FinInstnId>
</Agt> </Agt>
</ChrgsInf> </ChrgsInf>
<InstgAgt> <InstgAgt>
<FinInstnId> <FinInstnId>
<BICFI>TSPABEBBXXX</BICFI> <BICFI>AABBGB2X</BICFI>
</FinInstnId> </FinInstnId>
</InstgAgt> </InstgAgt>
<InstdAgt> <InstdAgt>
<FinInstnId> <FinInstnId>
<BICFI>TSPBBEBBXXX</BICFI> <BICFI>AABBIE2X</BICFI>
</FinInstnId> </FinInstnId>
</InstdAgt> </InstdAgt>
<Dbtr> <Dbtr>
<Nm>Martin Unstrucutred Belgium</Nm> <Nm>Mr. Debtor </Nm>
<PstlAdr> <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> </PstlAdr>
</Dbtr> </Dbtr>
<DbtrAcct>
<Id>
<IBAN>BE15849613415938</IBAN>
</Id>
</DbtrAcct>
<DbtrAgt> <DbtrAgt>
<FinInstnId> <FinInstnId>
<BICFI>TSPABEBBXXX</BICFI> <BICFI>AABBGB2X</BICFI>
</FinInstnId> </FinInstnId>
</DbtrAgt> </DbtrAgt>
<CdtrAgt> <CdtrAgt>
<FinInstnId> <FinInstnId>
<BICFI>TSPBBEBBXXX</BICFI> <BICFI>AABBGB2X</BICFI>
<Nm>European Techsavy Bank</Nm>
<PstlAdr>
<AdrLine>Sample address</AdrLine>
</PstlAdr>
</FinInstnId> </FinInstnId>
</CdtrAgt> </CdtrAgt>
<Cdtr> <Cdtr>
<Nm>Marie Unstructured</Nm> <Nm>Mr. Creditor </Nm>
<PstlAdr> <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> </PstlAdr>
<Id>
<PrvtId>
<DtAndPlcOfBirth>
<BirthDt>1980-04-22</BirthDt>
<CityOfBirth>Liege</CityOfBirth>
<CtryOfBirth>BE</CtryOfBirth>
</DtAndPlcOfBirth>
</PrvtId>
</Id>
</Cdtr> </Cdtr>
<CdtrAcct>
<Id>
<Othr>
<Id>539-0075470-34</Id>
</Othr>
</Id>
</CdtrAcct>
<RmtInf>
<Ustrd>Invoice number A078900012020</Ustrd>
</RmtInf>
</CdtTrfTxInf> </CdtTrfTxInf>
</FIToFICstmrCdtTrf> </FIToFICstmrCdtTrf>
</Document> </Document>
</RequestPayload> </Request>
\ No newline at end of file \ 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