Commit 8e808049 by chengzhuoshen

Mx转103retn,202,202cov,202retn的转换详细报告

parent 844c8594
......@@ -2048,8 +2048,13 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
}
}
protected String subFunctionIDTruncation(String mxId) {
protected String subFunctionIDTruncation(String mxId, boolean isInstructionId) {
if (StringUtil.isEmpty(mxId)) {
if (isInstructionId) {
buildSTErrorInfo(ERROR.T20072, null, null);
} else {
buildSTErrorInfo(ERROR.T20073, null, null);
}
return Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
if (mxId.length() > 16) {
......@@ -2058,6 +2063,11 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
}
String mtId = mxId;
if (mtId.startsWith("/") || mtId.endsWith("/") || mtId.contains("//")) {
if (isInstructionId) {
buildSTErrorInfo(ERROR.T20095, null, null);
} else {
buildSTErrorInfo(ERROR.T20035, null, null);
}
mtId = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
return mtId;
......@@ -2066,6 +2076,7 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
protected String subFunctionChargeCalculation(String chargesInfoPath) {
BigDecimal totalAmt = BigDecimal.ZERO;
String ccy = "";
boolean errorFlag = false;
int chrgsInfCount = XmlUtil.getChildrenCount(document, chargesInfoPath, null);
if (chrgsInfCount > 0) {
ccy = XmlUtil.getXmlNodeValue(document, chargesInfoPath + "(0).Amt@Ccy");
......@@ -2076,11 +2087,15 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
if (ccy.equals(getXmlNodeValue(bodyHdrParentElementName, document, "TxInf.ChrgsInf(" + i + ").Amt@Ccy"))) {
BigDecimal tmpAmt = new BigDecimal(getXmlNodeValue(bodyHdrParentElementName, document, "TxInf.ChrgsInf(" + i + ").Amt"));
totalAmt = totalAmt.add(tmpAmt);
} else {
errorFlag = true;
buildSTErrorInfo(ERROR.T22003, null, null);
break;
}
}
}
}
if (totalAmt.compareTo(BigDecimal.ZERO) > 0) {
if (totalAmt.compareTo(BigDecimal.ZERO) > 0 && !errorFlag) {
return "/CHGS/" + ccy + NumberUtil.formatAmt(totalAmt, ccy);
} else {
return null;
......
......@@ -122,11 +122,11 @@ public class Mx2MtCreatorManager {
String grpParentElementName = parentElementMaps.get("OrgnlGrpInf");
String orgMessageNameId = XmlUtil.getXmlNodeValue(document, grpParentElementName + "OrgnlGrpInf.OrgnlMsgNmId");
if (StringUtil.isNotEmpty(orgMessageNameId)) {
if (orgMessageNameId.startsWith("pacs.008") || orgMessageNameId.startsWith("MT103")) {
if (orgMessageNameId.indexOf("pacs.008") > -1 || orgMessageNameId.startsWith("MT103")) {
messageType += ".MT103";
} else if (orgMessageNameId.startsWith("pacs.009") || orgMessageNameId.startsWith("MT202")) {
} else if (orgMessageNameId.indexOf("pacs.009") > -1 || orgMessageNameId.startsWith("MT202")) {
messageType += ".MT202";
} else if (orgMessageNameId.startsWith("pacs.009") || orgMessageNameId.startsWith("MT205")) {
} else if (orgMessageNameId.indexOf("pacs.009") > -1 || orgMessageNameId.startsWith("MT205")) {
messageType += ".MT205";
}
} else {
......
package com.brilliance.swift.mx2mt.mt103.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.StringUtil;
......@@ -30,6 +31,10 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
messageId = getXmlNodeValue(appHdrParentElementName, document, "AppHdr.BizMsgIdr");
}
if (StringUtil.isNotEmpty(messageId)) {
if (messageId.startsWith("/") || messageId.endsWith("/") || messageId.contains("//")) {
buildSTErrorInfo(ERROR.T20051, "Block4/:20:", messageId);
messageId = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
if (messageId.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "Block4/:20:", messageId);
messageId = messageId.substring(0, 15) + "+";
......
package com.brilliance.swift.mx2mt.mt103Retn;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtCreator;
......@@ -29,6 +30,11 @@ public class Mx2Mt103RetnCreator extends AbstractMx2MtCreator {
context.set(Mx2MtContextIdentifier.APPHDR_PARENT_ELEMENT_NAME, parentElementMaps.get("AppHdr"));
context.set(Mx2MtContextIdentifier.GRPHDR_PARENT_ELEMENT_NAME, parentElementMaps.get("GrpHdr"));
context.set(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, parentElementMaps.get("TxInf"));
String bodyParentPath = parentElementMaps.get("TxInf");
int counts = getXmlNodeCounts(bodyParentPath, document, "TxInf");
if (counts > 1) {
buildSTErrorInfo(ERROR.T20053, bodyParentPath+".TxInf", null);
}
}
@Override
......
package com.brilliance.swift.mx2mt.mt103Retn.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
......@@ -22,14 +23,15 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
messageId = getXmlNodeValue(appHdrParentElementName, document, "AppHdr.BizMsgIdr");
}
if (StringUtil.isNotEmpty(messageId)) {
if (messageId.startsWith("/") || messageId.endsWith("/") || messageId.contains("//")) {
buildSTErrorInfo(ERROR.T20051, "Block4/:20:", messageId);
messageId = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
if (messageId.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "Block4/:20:", messageId);
messageId = messageId.substring(0, 15) + "+";
}
String value = messageId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
tags.add(new Tag(name, value));
tags.add(new Tag(name, messageId));
}
}
}
package com.brilliance.swift.mx2mt.mt103Retn.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.DateUtil;
......@@ -33,6 +34,10 @@ public class Field32AGenerate extends AbstractMx2MtTagsGenerate {
}
String amt = getXmlNodeValue(bodyHdrParentElementName, document, "TxInf.RtrdIntrBkSttlmAmt");
String ccy = getXmlNodeValue(bodyHdrParentElementName, document, "TxInf.RtrdIntrBkSttlmAmt@Ccy");
if ("XAU".equalsIgnoreCase(ccy) || "XAG".equalsIgnoreCase(ccy)
|| "XPD".equalsIgnoreCase(ccy) || "XPT".equalsIgnoreCase(ccy)) {
buildSTErrorInfo(ERROR.T20054, bodyHdrParentElementName+".TxInf.RtrdIntrBkSttlmAmt", null);
}
if (StringUtil.isNotEmpty(amt) && StringUtil.isNotEmpty(ccy)) {
intrBkSttlmAmt = NumberUtil.formatAmt(new BigDecimal(amt), ccy);
intrBkSttlmccy = ccy;
......
package com.brilliance.swift.mx2mt.mt103Retn.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
......@@ -32,6 +33,7 @@ public class Field33BGenerate extends AbstractMx2MtTagsGenerate {
amt = getXmlNodeValue(bodyHdrParentElementName, document, "TxInf.RtrdIntrBkSttlmAmt");
ccy = getXmlNodeValue(bodyHdrParentElementName, document, "TxInf.RtrdIntrBkSttlmAmt@Ccy");
if (StringUtil.isNotEmpty(amt) && StringUtil.isNotEmpty(ccy)) {
buildSTErrorInfo(ERROR.T20025, "Block4/:"+name+":", null);
tags.add(new Tag(name, ccy+NumberUtil.formatAmt(new BigDecimal(amt), ccy)));
}
}
......
package com.brilliance.swift.mx2mt.mt103Retn.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
......@@ -22,6 +24,7 @@ public class Field50AGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/50a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String value = "";
......@@ -36,12 +39,16 @@ public class Field50AGenerate extends AbstractMx2MtTagsGenerate {
tags.add(new Tag(name_A, value));
} else if (StringUtil.isNotEmpty(countryCode)) {
value = mx_to_mtFinancialInstitutionNameAndStructuredAddress(agtPath + ".FinInstnId", false);
value = mx_to_mtStartingLineCharacter(value, "Block4/:50k:");
tags.add(new Tag(name_K, value));
} else if (addressLineCount > 0 || StringUtil.isNotEmpty(agtName)) {
value = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(agtPath + ".FinInstnId");
value = mx_to_mtStartingLineCharacter(value, "Block4/:50k:");
tags.add(new Tag(name_K, value));
} else if (StringUtil.isNotEmpty(clearingMemberId)) {
buildSTErrorInfo(ERROR.T20097, "Block4/:50k:", null);
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE + Mx2MtConstants.NEW_LINE + mx_to_mtClearingIdentifier(agtPath);
value = mx_to_mtStartingLineCharacter(value, "Block4/:50k:");
tags.add(new Tag(name_K, value));
}
if (StringUtil.isEmpty(value)) {
......@@ -78,10 +85,12 @@ public class Field50AGenerate extends AbstractMx2MtTagsGenerate {
tags.add(new Tag(name_F, value));
} else {
String mtNameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(partyPath);
mtNameAddress = mx_to_mtStartingLineCharacter(mtNameAddress, "Block4/:50k:");
tags.add(new Tag(name_K, mtNameAddress));
}
} else if (StringUtil.isNotEmpty(name)) {
String mtNameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(partyPath);
mtNameAddress = mx_to_mtStartingLineCharacter(mtNameAddress, "Block4/:50k:");
tags.add(new Tag(name_K, mtNameAddress));
} else {
tags.add(new Tag(name_K, Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE));
......
......@@ -3,6 +3,7 @@ package com.brilliance.swift.mx2mt.mt103Retn.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
......@@ -21,6 +22,7 @@ public class Field52AGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/52a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String bicCode = mx_to_mtBICFI(bodyHdrParentElementName + ".TxInf.RtrChain.DbtrAgt");
......@@ -51,6 +53,7 @@ public class Field52AGenerate extends AbstractMx2MtTagsGenerate {
} else {
value = mtNameAddress;
}
value = mx_to_mtStartingLineCharacter(value, "Block4/:52D:");
tags.add(new Tag(name_D, value));
}
}
......
......@@ -2,6 +2,7 @@ package com.brilliance.swift.mx2mt.mt103Retn.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
......@@ -18,6 +19,7 @@ public class Field53AGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/53a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String settlementMethod = getXmlNodeValue(grpHdrParentElementName, document, "GrpHdr.SttlmInf.SttlmMtd");
......
......@@ -3,6 +3,7 @@ package com.brilliance.swift.mx2mt.mt103Retn.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
......@@ -21,6 +22,7 @@ public class Field56AGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/56a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String bicCode = mx_to_mtBICFI(bodyHdrParentElementName + ".TxInf.RtrChain.IntrmyAgt1");
......@@ -51,6 +53,7 @@ public class Field56AGenerate extends AbstractMx2MtTagsGenerate {
} else {
value = mtNameAddress;
}
value = mx_to_mtStartingLineCharacter(value, "Block4/:56D:");
tags.add(new Tag(name_D, value));
}
}
......
......@@ -3,6 +3,7 @@ package com.brilliance.swift.mx2mt.mt103Retn.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
......@@ -21,6 +22,7 @@ public class Field57AGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/57a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String bicCode = mx_to_mtBICFI(bodyHdrParentElementName + ".TxInf.RtrChain.CdtrAgt");
......@@ -45,13 +47,41 @@ public class Field57AGenerate extends AbstractMx2MtTagsGenerate {
} else if (StringUtil.isNotEmpty(name)) {
mtNameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(bodyHdrParentElementName+ ".TxInf.RtrChain.CdtrAgt.FinInstnId");
}
//mapping转换文档 Translation Post Conditions -> POSTC004
boolean exist56aFlag = exist56a(tags);
if (StringUtil.isEmpty(mtNameAddress) && exist56aFlag) {
mtNameAddress = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
if (StringUtil.isEmpty(mtClearSystemId)) {
mtClearSystemId = "/" + Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
}
if (StringUtil.isEmpty(mtNameAddress)) return;//如果name和地址不存在,返回。
if (StringUtil.isNotEmpty(mtClearSystemId)) {
value = mtClearSystemId + Mx2MtConstants.NEW_LINE + mtNameAddress;
} else {
value = mtNameAddress;
}
value = mx_to_mtStartingLineCharacter(value, "Block4/:57D:");
tags.add(new Tag(name_D, value));
}
}
/**
* 56a 是否存在
* @param tags
* @return
*/
private boolean exist56a(List<Tag> tags) {
boolean flag = false;
if (tags != null && tags.size() > 0) {
for (int i=0; i<tags.size(); i++) {
Tag tag = tags.get(i);
if ("56A".equals(tag.getName()) || "56D".equals(tag.getName())) {
flag = true;
break;
}
}
}
return flag;
}
}
package com.brilliance.swift.mx2mt.mt103Retn.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
......@@ -28,6 +30,7 @@ public class Field59Generate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/59a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String agtPath = bodyHdrParentElementName + "TxInf.RtrChain.Cdtr.Agt";
......@@ -42,12 +45,16 @@ public class Field59Generate extends AbstractMx2MtTagsGenerate {
tags.add(new Tag(name_A, value));
} else if (StringUtil.isNotEmpty(countryCode)) {
value = mx_to_mtFinancialInstitutionNameAndStructuredAddress(agtPath + ".FinInstnId", false);
value = mx_to_mtStartingLineCharacter(value, "Block4/:59:");
tags.add(new Tag(name, value));
} else if (addressLineCount > 0 || StringUtil.isNotEmpty(agtName)) {
value = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(agtPath + ".FinInstnId");
value = mx_to_mtStartingLineCharacter(value, "Block4/:59:");
tags.add(new Tag(name, value));
} else if (StringUtil.isNotEmpty(clearingMemberId)) {
buildSTErrorInfo(ERROR.T20098, "Block4/:59:", null);
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE + Mx2MtConstants.NEW_LINE + mx_to_mtClearingIdentifier(agtPath);
value = mx_to_mtStartingLineCharacter(value, "Block4/:59:");
tags.add(new Tag(name, value));
}
if (StringUtil.isEmpty(value)) {
......@@ -68,10 +75,12 @@ public class Field59Generate extends AbstractMx2MtTagsGenerate {
tags.add(new Tag(name_F, nameAddress));
} else {
String nameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(partyPath);
nameAddress = mx_to_mtStartingLineCharacter(nameAddress, "Block4/:59:");
tags.add(new Tag(name, nameAddress));
}
} else if (StringUtil.isNotEmpty(partyName)){
String nameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(partyPath);
nameAddress = mx_to_mtStartingLineCharacter(nameAddress, "Block4/:59:");
tags.add(new Tag(name, nameAddress));
} else {
tags.add(new Tag(name, Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE));
......
package com.brilliance.swift.mx2mt.mt103Retn.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
......@@ -22,31 +24,57 @@ public class Field70Generate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/:70:");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String mt70FullString = "";
String mtUltimateCreditor = mx_to_mtUltimateParty(bodyHdrParentElementName + ".TxInf.RtrChain.UltmtCdtr");
if (StringUtil.isNotEmpty(mtUltimateCreditor)) {
String str = "/ULTB/" + mtUltimateCreditor;
if (str.length() > 140) str = str.substring(0, 139) + "+";
if (StringUtil.isEmpty(mt70FullString)) {
mt70FullString += str;
int remainLength = 140 - mt70FullString.length() - 6;
if (remainLength > 0) {
if (mtUltimateCreditor.length() > remainLength) {
buildSTErrorInfo(ERROR.T0000T, "Block4/:70:/ULTB/", mtUltimateCreditor);
mtUltimateCreditor = mtUltimateCreditor.substring(0, remainLength-1) + "+";
}
mt70FullString += "/ULTB/" + mtUltimateCreditor;
}
} else {
mt70FullString += "//" + str;
int remainLength = 140 - mt70FullString.length() - 8;
if (remainLength > 0) {
if (mtUltimateCreditor.length() > remainLength) {
buildSTErrorInfo(ERROR.T0000T, "Block4/:70:///ULTB/", mtUltimateCreditor);
mtUltimateCreditor = mtUltimateCreditor.substring(0, remainLength-1) + "+";
}
mt70FullString += "///ULTB/" + mtUltimateCreditor;
}
}
}
String mtUltimateDebtor = mx_to_mtUltimateParty(bodyHdrParentElementName + ".TxInf.RtrChain.UltmtDbtr");
if (StringUtil.isNotEmpty(mtUltimateDebtor)) {
String str = "/ULTD/" + mtUltimateDebtor;
if (str.length() > 140) str = str.substring(0, 139) + "+";
if (StringUtil.isEmpty(mt70FullString)) {
mt70FullString += str;
int remainLength = 140 - mt70FullString.length() - 6;
if (remainLength > 0) {
if (mtUltimateDebtor.length() > remainLength) {
buildSTErrorInfo(ERROR.T0000T, "Block4/:70:/ULTD/", mtUltimateDebtor);
mtUltimateDebtor = mtUltimateDebtor.substring(0, remainLength-1) + "+";
}
mt70FullString += "/ULTD/" + mtUltimateDebtor;
}
} else {
mt70FullString += "//" + str;
int remainLength = 140 - mt70FullString.length() - 8;
if (remainLength > 0) {
if (mtUltimateDebtor.length() > remainLength) {
buildSTErrorInfo(ERROR.T0000T, "Block4/:70:///ULTD/", mtUltimateDebtor);
mtUltimateDebtor = mtUltimateDebtor.substring(0, remainLength-1) + "+";
}
mt70FullString += "///ULTD/" + mtUltimateDebtor;
}
}
}
if (StringUtil.isNotEmpty(mt70FullString)) {
String value = StringUtil.getStringByEnter(mt70FullString, 35, 4);
value = mx_to_mtStartingLineCharacter(value, "Block4/:70:");
tags.add(new Tag(name, value));
}
}
......
package com.brilliance.swift.mx2mt.mt103Retn.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.NumberUtil;
......@@ -56,10 +57,18 @@ public class Field71AGenerate extends AbstractMx2MtTagsGenerate {
if (ccy.equals(getXmlNodeValue(bodyHdrParentElementName, document, "TxInf.ChrgsInf("+i+").Amt@Ccy"))) {
BigDecimal tmpAmt = new BigDecimal(getXmlNodeValue(bodyHdrParentElementName, document, "TxInf.ChrgsInf("+i+").Amt"));
sumAmt = sumAmt.add(tmpAmt);
} else {
buildSTErrorInfo(ERROR.T20045, "block4/:"+name_G+":", null);
}
}
}
tags.add(new Tag(name_G, ccy + NumberUtil.formatAmt(sumAmt, ccy)));
//mapping转换文档 Translation Post Conditions -> POSTC003
String intrBkSttlmAmtCcy = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.IntrBkSttlmAmt@Ccy");
if (ccy.equals(intrBkSttlmAmtCcy)) {
tags.add(new Tag(name_G, ccy + NumberUtil.formatAmt(sumAmt, ccy)));
} else {
buildSTErrorInfo(ERROR.T20042, "Block4/:"+name_G+":", null);
}
}
}
}
......
......@@ -3,6 +3,7 @@ package com.brilliance.swift.mx2mt.mt103Retn.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.util.SwiftTransferUtil;
import com.brilliance.swift.vo.MxMtReasonCodeInfo;
......@@ -33,6 +34,7 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/:72:");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
List<String> mt72List = new ArrayList<>();
......@@ -94,11 +96,11 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
mt72List.add(mtLine2);
}
String orgInstructionId = getXmlNodeValue(bodyHdrParentElementName, document, "TxInf.OrgnlInstrId");
String mtLine3 = "/MREF/" + subFunctionIDTruncation(orgInstructionId);
String mtLine3 = "/MREF/" + subFunctionIDTruncation(orgInstructionId, true);
mt72List.add(mtLine3);
String orgEndToEndId = getXmlNodeValue(bodyHdrParentElementName, document, "TxInf.OrgnlEndToEndId");
if (StringUtil.isNotEmpty(orgEndToEndId)) {
String mtLine4 = "/TREF/" + subFunctionIDTruncation(orgEndToEndId);
String mtLine4 = "/TREF/" + subFunctionIDTruncation(orgEndToEndId, false);
mt72List.add(mtLine4);
}
//没有mtLine5
......@@ -121,6 +123,7 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
value += Mx2MtConstants.NEW_LINE + list.get(i);
}
}
value = mx_to_mtStartingLineCharacter(value, "Block4/:72:");
tags.add(new Tag(name, value));
}
}
......
......@@ -49,6 +49,7 @@ public class Field77BGenerate extends AbstractMx2MtTagsGenerate {
}
}
if (StringUtil.isNotEmpty(value)) {
value = mx_to_mtStartingLineCharacter(value, "Block4/:77B:");
tags.add(new Tag(name, value));
}
}
......
package com.brilliance.swift.mx2mt.mt202Retn;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtCreator;
......@@ -29,6 +30,11 @@ public class Mx2Mt202RetnCreator extends AbstractMx2MtCreator {
context.set(Mx2MtContextIdentifier.APPHDR_PARENT_ELEMENT_NAME, parentElementMaps.get("AppHdr"));
context.set(Mx2MtContextIdentifier.GRPHDR_PARENT_ELEMENT_NAME, parentElementMaps.get("GrpHdr"));
context.set(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, parentElementMaps.get("TxInf"));
String bodyParentPath = parentElementMaps.get("TxInf");
int counts = getXmlNodeCounts(bodyParentPath, document, "TxInf");
if (counts > 1) {
buildSTErrorInfo(ERROR.T20053, bodyParentPath+".TxInf", null);
}
}
@Override
......
package com.brilliance.swift.mx2mt.mt202Retn.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
......@@ -25,14 +26,15 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
List<Tag> tags = swiftMessage.getBlock4().getTags();
String endToEndId = getXmlNodeValue(bodyHdrParentElementName, document, "TxInf.OrgnlEndToEndId");
if (StringUtil.isNotEmpty(endToEndId)) {
if (endToEndId.startsWith("/") || endToEndId.endsWith("/") || endToEndId.contains("//")) {
buildSTErrorInfo(ERROR.T20035, "Block4/:21:", endToEndId);
endToEndId = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
if (endToEndId.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "Block4/:21:", endToEndId);
endToEndId = endToEndId.substring(0, 15) + "+";
}
String value = endToEndId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
tags.add(new Tag(name, value));
tags.add(new Tag(name, endToEndId));
}
}
}
package com.brilliance.swift.mx2mt.mt202Retn.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
......@@ -21,8 +23,13 @@ public class Field52AGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/52a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int dbtrPartyCount = getXmlNodeCounts(bodyHdrParentElementName, document, "TxInf.RtrChain.Dbtr.Pty");
if (dbtrPartyCount > 0) {
buildSTErrorInfo(ERROR.T20048, null, null);
}
String agtPath = bodyHdrParentElementName + ".TxInf.RtrChain.Dbtr.Agt";
String bicCode = mx_to_mtBICFI(agtPath);
String mtClearSystemId = mx_to_mtClearingIdentifier(agtPath);
......@@ -52,6 +59,7 @@ public class Field52AGenerate extends AbstractMx2MtTagsGenerate {
} else {
value = mtNameAddress;
}
value = mx_to_mtStartingLineCharacter(value, "Block4/:52D:");
tags.add(new Tag(name_D, value));
}
}
......
package com.brilliance.swift.mx2mt.mt202Retn.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
......@@ -20,8 +22,13 @@ public class Field58AGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/58a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int cdtrPartyCount = getXmlNodeCounts(bodyHdrParentElementName, document, "TxInf.RtrChain.Cdtr.Pty");
if (cdtrPartyCount > 0) {
buildSTErrorInfo(ERROR.T20049, null, null);
}
String agtPath = bodyHdrParentElementName + ".TxInf.RtrChain.Cdtr.Agt";
String bicCode = mx_to_mtBICFI(agtPath);
String mtClearSystemId = mx_to_mtClearingIdentifier(agtPath);
......@@ -51,6 +58,7 @@ public class Field58AGenerate extends AbstractMx2MtTagsGenerate {
} else {
value = mtNameAddress;
}
value = mx_to_mtStartingLineCharacter(value, "Block4/:58D:");
tags.add(new Tag(name_D, value));
}
}
......
......@@ -3,6 +3,7 @@ package com.brilliance.swift.mx2mt.mt202Retn.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.util.SwiftTransferUtil;
import com.brilliance.swift.vo.MxMtReasonCodeInfo;
......@@ -33,6 +34,7 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/:72:");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
List<String> mt72List = new ArrayList<>();
......@@ -94,11 +96,11 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
mt72List.add(mtLine2);
}
String orgInstructionId = getXmlNodeValue(bodyHdrParentElementName, document, "TxInf.OrgnlInstrId");
String mtLine3 = "/MREF/" + subFunctionIDTruncation(orgInstructionId);
String mtLine3 = "/MREF/" + subFunctionIDTruncation(orgInstructionId, true);
mt72List.add(mtLine3);
String orgEndToEndId = getXmlNodeValue(bodyHdrParentElementName, document, "TxInf.OrgnlEndToEndId");
if (StringUtil.isNotEmpty(orgEndToEndId)) {
String mtLine4 = "/TREF/" + subFunctionIDTruncation(orgEndToEndId);
String mtLine4 = "/TREF/" + subFunctionIDTruncation(orgEndToEndId, false);
mt72List.add(mtLine4);
}
String mtLine5 = subFunctionChargeCalculation(bodyHdrParentElementName + ".TxInf.ChrgsInf");
......@@ -124,6 +126,7 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
value += Mx2MtConstants.NEW_LINE + list.get(i);
}
}
value = mx_to_mtStartingLineCharacter(value, "Block4/:72:");
tags.add(new Tag(name, value));
}
}
......
package com.brilliance.swift.mx2mt.mt202cov202.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
......@@ -25,14 +26,15 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
List<Tag> tags = swiftMessage.getBlock4().getTags();
String endToEndId = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtId.EndToEndId");
if (StringUtil.isNotEmpty(endToEndId)) {
if (endToEndId.startsWith("/") || endToEndId.endsWith("/") || endToEndId.contains("//")) {
buildSTErrorInfo(ERROR.T20035, "Block4/:21:", endToEndId);
endToEndId = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
if (endToEndId.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "Block4/:21:", endToEndId);
endToEndId = endToEndId.substring(0, 15) + "+";
}
String value = endToEndId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
tags.add(new Tag(name, value));
tags.add(new Tag(name, endToEndId));
}
}
}
......@@ -4,6 +4,7 @@ package com.brilliance.swift.mx2mt.mt202cov202.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
......@@ -21,6 +22,7 @@ public class Field52AGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/52a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String bicCode = mx_to_mtBICFI(bodyHdrParentElementName + ".CdtTrfTxInf.Dbtr");
......@@ -63,6 +65,7 @@ public class Field52AGenerate extends AbstractMx2MtTagsGenerate {
} else {
value = mtNameAddress;
}
value = mx_to_mtStartingLineCharacter(value, "Block4/:52D:");
tags.add(new Tag(name_D, value));
}
}
......
package com.brilliance.swift.mx2mt.mt202cov202.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
......@@ -20,8 +22,10 @@ public class Field58AGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/58a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
boolean flag = exist56a57aStartWithFWRT(tags);
String bicCode = mx_to_mtBICFI(bodyHdrParentElementName + ".CdtTrfTxInf.Cdtr");
String account = mx_to_mtAccount(bodyHdrParentElementName + ".CdtTrfTxInf.CdtrAcct");
String mtClearSystemId = mx_to_mtClearingIdentifier(bodyHdrParentElementName + ".CdtTrfTxInf.Cdtr");
......@@ -36,6 +40,15 @@ public class Field58AGenerate extends AbstractMx2MtTagsGenerate {
} else {
mtAccount = mtClearSystemId;
}
//mapping转换文档 Translation Post Conditions -> POSTC004
if (flag && StringUtil.isNotEmpty(mtAccount) && (mtAccount.startsWith("//FW") || mtAccount.startsWith("//RT"))) {
if (StringUtil.isEmpty(mtClearSystemId) || mtClearSystemId.startsWith("//FW")) {
mtAccount = "";
buildSTErrorInfo(ERROR.T20224, "Block4/:"+name_A+":", null);
} else {
mtAccount = mtClearSystemId;
}
}
if (StringUtil.isNotEmpty(mtAccount)) {
value = mtAccount + Mx2MtConstants.NEW_LINE + bicCode;
} else {
......@@ -62,14 +75,60 @@ public class Field58AGenerate extends AbstractMx2MtTagsGenerate {
} else {
mtAccount = account;
}
//mapping转换文档 Translation Post Conditions -> POSTC004
if (flag && StringUtil.isNotEmpty(mtAccount) && (mtAccount.startsWith("//FW") || mtAccount.startsWith("//RT"))) {
if (StringUtil.isEmpty(mtClearSystemId) || mtClearSystemId.startsWith("//FW")) {
mtAccount = "";
buildSTErrorInfo(ERROR.T20224, "Block4/:"+name_A+":", null);
} else {
mtAccount = mtClearSystemId;
}
}
if (StringUtil.isNotEmpty(mtAccount)) {
value = mtAccount + Mx2MtConstants.NEW_LINE + mtNameAddress;
} else {
value = mtNameAddress;
}
value = mx_to_mtStartingLineCharacter(value, "Block4/:58D:");
tags.add(new Tag(name_D, value));
}
}
/**
* 56a 是否以 //FW or //RT 开始
* 否则 57a 是否以 //FW or //RT 开始
* @param tags
* @return
*/
private boolean exist56a57aStartWithFWRT(List<Tag> tags) {
boolean flag = false;
if (tags != null && tags.size() > 0) {
for (int i=0; i<tags.size(); i++) {
Tag tag = tags.get(i);
if ("56A".equals(tag.getName()) || "56D".equals(tag.getName())) {
String value = tag.getValue();
if (value.startsWith("//FW") || value.startsWith("//RT")) {
flag = true;
break;
}
}
}
}
if (!flag) {
if (tags != null && tags.size() > 0) {
for (int i=0; i<tags.size(); i++) {
Tag tag = tags.get(i);
if ("57A".equals(tag.getName()) || "57D".equals(tag.getName())) {
String value = tag.getValue();
if (value.startsWith("//FW") || value.startsWith("//RT")) {
flag = true;
break;
}
}
}
}
}
return flag;
}
}
......@@ -3,6 +3,7 @@ package com.brilliance.swift.mx2mt.mt202cov202.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.vo.common.CategoryPurposeCode;
import com.brilliance.swift.vo.common.ServiceLevelCode;
......@@ -47,6 +48,7 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/:72:");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
List<String> mt72List = new ArrayList<>();
......@@ -159,6 +161,7 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
value += Mx2MtConstants.NEW_LINE + list.get(i);
}
}
value = mx_to_mtStartingLineCharacter(value, "Block4/:72:");
tags.add(new Tag(name, value));
}
}
......
......@@ -3,6 +3,7 @@ package com.brilliance.swift.mx2mt.mt202cov202.impl.cov;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftBlock3;
import com.prowidesoftware.swift.model.SwiftMessage;
......@@ -22,6 +23,7 @@ public class Field50AGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/SequenceB/50a");
boolean covFlag = false;
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
......@@ -77,6 +79,7 @@ public class Field50AGenerate extends AbstractMx2MtTagsGenerate {
} else {
value = mtNameAddress;
}
value = mx_to_mtStartingLineCharacter(value, "Block4/SequenceB/:50K:");
tags.add(new Tag(name_K, value));
covFlag = true;
}
......@@ -87,6 +90,7 @@ public class Field50AGenerate extends AbstractMx2MtTagsGenerate {
} else {
value = mtNameAddress;
}
value = mx_to_mtStartingLineCharacter(value, "Block4/SequenceB/:50K:");
tags.add(new Tag(name_K, value));
covFlag = true;
}
......
......@@ -3,6 +3,7 @@ package com.brilliance.swift.mx2mt.mt202cov202.impl.cov;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
......@@ -17,6 +18,7 @@ public class Field52AGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/SequenceB/52a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String bicCode = mx_to_mtBICFI(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.DbtrAgt");
......@@ -59,6 +61,7 @@ public class Field52AGenerate extends AbstractMx2MtTagsGenerate {
} else {
value = mtNameAddress;
}
value = mx_to_mtStartingLineCharacter(value, "Block4/SequenceB/:52D:");
tags.add(new Tag(name_D, value));
}
}
......
......@@ -3,6 +3,7 @@ package com.brilliance.swift.mx2mt.mt202cov202.impl.cov;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
......@@ -18,6 +19,7 @@ public class Field56AGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/SequenceB/56a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String bicCode = mx_to_mtBICFI(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.IntrmyAgt1");
......@@ -60,6 +62,7 @@ public class Field56AGenerate extends AbstractMx2MtTagsGenerate {
} else {
value = mtNameAddress;
}
value = mx_to_mtStartingLineCharacter(value, "Block4/SequenceB/:56D:");
tags.add(new Tag(name_D, value));
}
}
......
......@@ -3,6 +3,7 @@ package com.brilliance.swift.mx2mt.mt202cov202.impl.cov;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
......@@ -18,6 +19,7 @@ public class Field57AGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/SequenceB/57a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String bicCode = mx_to_mtBICFI(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.CdtrAgt");
......@@ -60,6 +62,7 @@ public class Field57AGenerate extends AbstractMx2MtTagsGenerate {
} else {
value = mtNameAddress;
}
value = mx_to_mtStartingLineCharacter(value, "Block4/SequenceB/:57D:");
tags.add(new Tag(name_D, value));
}
}
......
......@@ -3,6 +3,7 @@ package com.brilliance.swift.mx2mt.mt202cov202.impl.cov;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
......@@ -20,6 +21,7 @@ public class Field59AGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/SequenceB/59a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String partyPath = bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.Cdtr";
......@@ -62,6 +64,7 @@ public class Field59AGenerate extends AbstractMx2MtTagsGenerate {
} else {
value = nameAddress;
}
value = mx_to_mtStartingLineCharacter(value, "Block4/SequenceB/:59:");
tags.add(new Tag(name, value));
}
} else if (StringUtil.isNotEmpty(partyName)){
......@@ -71,6 +74,7 @@ public class Field59AGenerate extends AbstractMx2MtTagsGenerate {
} else {
value = nameAddress;
}
value = mx_to_mtStartingLineCharacter(value, "Block4/SequenceB/:59:");
tags.add(new Tag(name, value));
}
}
......
package com.brilliance.swift.mx2mt.mt202cov202.impl.cov;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
......@@ -14,35 +16,71 @@ public class Field70Generate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/SequenceB/:70:");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String mt70FullString = "";
String mtUltimateCreditor = mx_to_mtUltimateParty(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.UltmtCdtr");
if (StringUtil.isNotEmpty(mtUltimateCreditor)) {
String str = "/ULTB/" + mtUltimateCreditor;
if (str.length() > 140) str = str.substring(0, 139) + "+";
if (StringUtil.isEmpty(mt70FullString)) {
mt70FullString += str;
int remainLength = 140 - mt70FullString.length() - 6;
if (remainLength > 0) {
if (mtUltimateCreditor.length() > remainLength) {
buildSTErrorInfo(ERROR.T0000T, "Block4/SequenceB/:70:/ULTB/", mtUltimateCreditor);
mtUltimateCreditor = mtUltimateCreditor.substring(0, remainLength-1) + "+";
}
mt70FullString += "/ULTB/" + mtUltimateCreditor;
}
} else {
mt70FullString += "//" + str;
int remainLength = 140 - mt70FullString.length() - 8;
if (remainLength > 0) {
if (mtUltimateCreditor.length() > remainLength) {
buildSTErrorInfo(ERROR.T0000T, "Block4/SequenceB/:70:///ULTB/", mtUltimateCreditor);
mtUltimateCreditor = mtUltimateCreditor.substring(0, remainLength-1) + "+";
}
mt70FullString += "///ULTB/" + mtUltimateCreditor;
}
}
}
String mtUltimateDebtor = mx_to_mtUltimateParty(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.UltmtDbtr");
if (StringUtil.isNotEmpty(mtUltimateDebtor)) {
String str = "/ULTD/" + mtUltimateDebtor;
if (str.length() > 140) str = str.substring(0, 139) + "+";
if (StringUtil.isEmpty(mt70FullString)) {
mt70FullString += str;
int remainLength = 140 - mt70FullString.length() - 6;
if (remainLength > 0) {
if (mtUltimateDebtor.length() > remainLength) {
buildSTErrorInfo(ERROR.T0000T, "Block4/SequenceB/:70:/ULTD/", mtUltimateDebtor);
mtUltimateDebtor = mtUltimateDebtor.substring(0, remainLength-1) + "+";
}
mt70FullString += "/ULTD/" + mtUltimateDebtor;
}
} else {
mt70FullString += "//" + str;
int remainLength = 140 - mt70FullString.length() - 8;
if (remainLength > 0) {
if (mtUltimateDebtor.length() > remainLength) {
buildSTErrorInfo(ERROR.T0000T, "Block4/SequenceB/:70:///ULTD/", mtUltimateDebtor);
mtUltimateDebtor = mtUltimateDebtor.substring(0, remainLength-1) + "+";
}
mt70FullString += "///ULTD/" + mtUltimateDebtor;
}
}
}
String remittanceInfoUnstructured = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.UndrlygCstmrCdtTrf.RmtInf.Ustrd");
if (StringUtil.isNotEmpty(remittanceInfoUnstructured)) {
if (StringUtil.isEmpty(mt70FullString)) {
mt70FullString += "/URI/" + remittanceInfoUnstructured;
if (remittanceInfoUnstructured.length() > 140) {
buildSTErrorInfo(ERROR.T0000T, "Block4/SequenceB/:70:", remittanceInfoUnstructured);
remittanceInfoUnstructured = remittanceInfoUnstructured.substring(0, 139) + "+";
}
mt70FullString += remittanceInfoUnstructured;
} else {
mt70FullString += "///URI/" + remittanceInfoUnstructured;
int remainLength = 140 - mt70FullString.length() - 7;
if (remainLength > 0) {
if (remittanceInfoUnstructured.length() > remainLength) {
buildSTErrorInfo(ERROR.T0000T, "Block4/SequenceB/:70:///URI/", remittanceInfoUnstructured);
remittanceInfoUnstructured = remittanceInfoUnstructured.substring(0, remainLength-1) + "+";
}
mt70FullString += "///URI/" + remittanceInfoUnstructured;
}
}
}
int remittanceInfoStructuredCount = getXmlNodeCounts(bodyHdrParentElementName, document, "CdtTrfTxInf.UndrlygCstmrCdtTrf.RmtInf.Strd");
......@@ -55,6 +93,7 @@ public class Field70Generate extends AbstractMx2MtTagsGenerate {
}
if (StringUtil.isNotEmpty(mt70FullString)) {
String value = StringUtil.getStringByEnter(mt70FullString, 35, 4);
value = mx_to_mtStartingLineCharacter(value, "Block4/SequenceB/:70:");
tags.add(new Tag(name, value));
}
}
......
......@@ -3,6 +3,7 @@ package com.brilliance.swift.mx2mt.mt202cov202.impl.cov;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.vo.common.SettlementMethodCode;
import com.prowidesoftware.swift.model.SwiftMessage;
......@@ -17,6 +18,7 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/SequenceB/:72:");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
List<String> mt72List = new ArrayList<>();
......@@ -62,6 +64,7 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
value += Mx2MtConstants.NEW_LINE + list.get(i);
}
}
value = mx_to_mtStartingLineCharacter(value, "Block4/SequenceB/:72:");
tags.add(new Tag(name, value));
}
}
......
......@@ -27,9 +27,9 @@ public class Field12Generate extends AbstractMx2MtTagsGenerate {
String msgNameId = getXmlNodeValue(bodyHdrParentElementName, document, "RptgReq(" + index + ").ReqdMsgNmId");
if (StringUtil.isNotEmpty(msgNameId)) {
String value = "";
if (msgNameId.startsWith("camt.053")) {
if (msgNameId.indexOf("camt.053") > -1) {
value = Mx2MtConstants.MT_TYPE_950;
} else if (msgNameId.startsWith("camt.052")) {
} else if (msgNameId.indexOf("camt.052") > -1) {
value = Mx2MtConstants.MT_TYPE_942;
} else if (msgNameId.contains(Mx2MtConstants.MT_TYPE_941)) {
value = Mx2MtConstants.MT_TYPE_941;
......
package com.brilliance.swift.mx2mt.mt920.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.StringUtil;
......@@ -21,6 +23,13 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
messageId = getXmlNodeValue(appHdrParentElementName, document, "AppHdr.BizMsgIdr");
}
if (StringUtil.isNotEmpty(messageId)) {
if (messageId.startsWith("/") || messageId.endsWith("/") || messageId.contains("//")) {
buildSTErrorInfo(ERROR.T20051, "Block4/:20:", messageId);
messageId = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
if (messageId.length() > 16) {
messageId = messageId.substring(0, 15) + "+";
}
tags.add(new Tag(NAME, messageId));
}
}
......
......@@ -60,11 +60,11 @@ public class Mx2MtN99Creator extends AbstractMx2MtCreator {
String orgMsgNameIdentification = getXmlNodeValue(bodyParentPath, document, "TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId");
String mtType = Mx2MtConstants.MT_TYPE_299;
if (StringUtil.isNotEmpty(orgMsgNameIdentification)) {
if (orgMsgNameIdentification.startsWith("pacs.008")
|| orgMsgNameIdentification.startsWith("pacs.003")) {
if (orgMsgNameIdentification.indexOf("pacs.008") > -1
|| orgMsgNameIdentification.indexOf("pacs.003") > -1) {
mtType = Mx2MtConstants.MT_TYPE_199;
} else if (orgMsgNameIdentification.startsWith("pacs.009")
|| orgMsgNameIdentification.startsWith("pacs.010")) {
} else if (orgMsgNameIdentification.indexOf("pacs.009") > -1
|| orgMsgNameIdentification.indexOf("pacs.010") > -1) {
mtType = Mx2MtConstants.MT_TYPE_299;
} else if (orgMsgNameIdentification.matches("MT10[0-9]{1}")) {
mtType = Mx2MtConstants.MT_TYPE_199;
......
......@@ -14,13 +14,13 @@ import java.util.List;
public class Field79Generate extends AbstractMx2MtTagsGenerate {
private static String name = "21";
private static String name = "79";
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
List<String> mt72List = new ArrayList<>();
List<String> mt79List = new ArrayList<>();
List<MxMtReasonCodeInfo> mxMtReasonCodeInfos = SwiftTransferUtil.getMxMtReasonCodes();
String mxAddtlInf = "";
int addtlInfCount = getXmlNodeCounts(bodyHdrParentElementName, document, "TxInfAndSts.StsRsnInf.AddtlInf");
......@@ -38,7 +38,7 @@ public class Field79Generate extends AbstractMx2MtTagsGenerate {
}
}
}
mt72List.add("/REJT/99");
mt79List.add("/REJT/99");
String mtLine2 = "";
String mtLine6 = "";
String mxReasonCode = getXmlNodeValue(bodyHdrParentElementName, document, "TxInfAndSts.StsRsnInf.Rsn.Cd");
......@@ -54,15 +54,15 @@ public class Field79Generate extends AbstractMx2MtTagsGenerate {
mtLine2 = mtLine2.substring(0, 50);
}
if (StringUtil.isNotEmpty(mtLine2)) {
mt72List.add(mtLine2);
mt79List.add(mtLine2);
}
String orgMsgId = getXmlNodeValue(bodyHdrParentElementName, document, "TxInfAndSts.OrgnlGrpInf.OrgnlMsgId");
String mtLine3 = "/MREF/" + subFunctionIDTruncation(orgMsgId);
mt72List.add(mtLine3);
String mtLine3 = "/MREF/" + subFunctionIDTruncation(orgMsgId, true);
mt79List.add(mtLine3);
String orgEndToEndId = getXmlNodeValue(bodyHdrParentElementName, document, "TxInfAndSts.OrgnlEndToEndId");
if (StringUtil.isNotEmpty(orgEndToEndId)) {
String mtLine4 = "/TREF/" + subFunctionIDTruncation(orgEndToEndId);
mt72List.add(mtLine4);
String mtLine4 = "/TREF/" + subFunctionIDTruncation(orgEndToEndId, false);
mt79List.add(mtLine4);
}
//没有mtLine5
String mtUetr = "";
......@@ -72,17 +72,17 @@ public class Field79Generate extends AbstractMx2MtTagsGenerate {
mtUetr = "/UETR/" + uetr;
}
if (StringUtil.isNotEmpty(mtLine6)) {
mt72List.add(mtLine6);
mt79List.add(mtLine6);
if (StringUtil.isNotEmpty(mtUetr)) {
mt72List.add("//" + mtUetr);
mt79List.add("//" + mtUetr);
}
} else {
mt72List.add("/TEXT/" + mtUetr);
mt79List.add("/TEXT/" + mtUetr);
}
if (mt72List.size() > 0) {
if (mt79List.size() > 0) {
List<String> list = new ArrayList<>();
for (int i=0; i<mt72List.size(); i++) {
String mt72FullField = mt72List.get(i);
for (int i=0; i<mt79List.size(); i++) {
String mt72FullField = mt79List.get(i);
List<String> tmplist = StringUtil.outStringList(mt72FullField, 50, "//");
list.addAll(tmplist);
}
......
package com.brilliance.mx2mt.mt103.retn;
import com.brilliance.swift.SwiftTransfer;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.vo.SwiftTranslationErrorInfo;
import com.brilliance.swift.vo.SwiftTranslationReport;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.List;
public class Test {
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs004001_Pacs008.xml");
String xmlStr = FileUtils.readFileToString(file);
String mt103Retn = SwiftTransfer.mx2Mt(xmlStr, null, null);
System.out.println(mt103Retn);
SwiftTranslationReport str = SwiftTransfer.mx2MtPlus(xmlStr, null, null);
if (str != null) {
List<SwiftTranslationErrorInfo> errorInfos = str.getErrorInfos();
if (errorInfos != null && errorInfos.size() > 0) {
for (int i=0; i<errorInfos.size(); i++) {
SwiftTranslationErrorInfo errorInfo = errorInfos.get(i);
String location = errorInfo.getLocation();
String errorType = errorInfo.getErrorType();
String description = errorInfo.getDescription();
System.out.println(location + Mx2MtConstants.NEW_LINE + "-" + errorType + ":" + description);
String originalValue = errorInfo.getOriginalValue();
if (StringUtil.isNotEmpty(originalValue)) {
System.out.println(originalValue);
}
}
}
System.out.println(str.getMessage());
}
}
}
package com.brilliance.mx2mt.mt202;
import com.brilliance.swift.SwiftTransfer;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.vo.SwiftTranslationErrorInfo;
import com.brilliance.swift.vo.SwiftTranslationReport;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.List;
public class TestMx2MtFor202 {
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs00900108.xml");
String xmlStr = FileUtils.readFileToString(file);
String mt202 = SwiftTransfer.mx2Mt(xmlStr, null, null);
System.out.println(mt202);
SwiftTranslationReport str = SwiftTransfer.mx2MtPlus(xmlStr, null, null);
if (str != null) {
List<SwiftTranslationErrorInfo> errorInfos = str.getErrorInfos();
if (errorInfos != null && errorInfos.size() > 0) {
for (int i=0; i<errorInfos.size(); i++) {
SwiftTranslationErrorInfo errorInfo = errorInfos.get(i);
String location = errorInfo.getLocation();
String errorType = errorInfo.getErrorType();
String description = errorInfo.getDescription();
System.out.println(location + Mx2MtConstants.NEW_LINE + "-" + errorType + ":" + description);
String originalValue = errorInfo.getOriginalValue();
if (StringUtil.isNotEmpty(originalValue)) {
System.out.println(originalValue);
}
}
}
System.out.println(str.getMessage());
}
}
}
package com.brilliance.mx2mt.mt202;
import com.brilliance.swift.SwiftTransfer;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.vo.SwiftTranslationErrorInfo;
import com.brilliance.swift.vo.SwiftTranslationReport;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.List;
public class TestMx2MtFor202COV {
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs00900108_COV.xml");
String xmlStr = FileUtils.readFileToString(file);
String mt202 = SwiftTransfer.mx2Mt(xmlStr, null, null);
System.out.println(mt202);
SwiftTranslationReport str = SwiftTransfer.mx2MtPlus(xmlStr, null, null);
if (str != null) {
List<SwiftTranslationErrorInfo> errorInfos = str.getErrorInfos();
if (errorInfos != null && errorInfos.size() > 0) {
for (int i=0; i<errorInfos.size(); i++) {
SwiftTranslationErrorInfo errorInfo = errorInfos.get(i);
String location = errorInfo.getLocation();
String errorType = errorInfo.getErrorType();
String description = errorInfo.getDescription();
System.out.println(location + Mx2MtConstants.NEW_LINE + "-" + errorType + ":" + description);
String originalValue = errorInfo.getOriginalValue();
if (StringUtil.isNotEmpty(originalValue)) {
System.out.println(originalValue);
}
}
}
System.out.println(str.getMessage());
}
}
}
package com.brilliance.mx2mt.mt202.retn;
import com.brilliance.swift.SwiftTransfer;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.vo.SwiftTranslationErrorInfo;
import com.brilliance.swift.vo.SwiftTranslationReport;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.List;
public class Test {
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs004001_Pacs009.xml");
String xmlStr = FileUtils.readFileToString(file);
String mt202Retn = SwiftTransfer.mx2Mt(xmlStr, null, null);
System.out.println(mt202Retn);
SwiftTranslationReport str = SwiftTransfer.mx2MtPlus(xmlStr, null, null);
if (str != null) {
List<SwiftTranslationErrorInfo> errorInfos = str.getErrorInfos();
if (errorInfos != null && errorInfos.size() > 0) {
for (int i=0; i<errorInfos.size(); i++) {
SwiftTranslationErrorInfo errorInfo = errorInfos.get(i);
String location = errorInfo.getLocation();
String errorType = errorInfo.getErrorType();
String description = errorInfo.getDescription();
System.out.println(location + Mx2MtConstants.NEW_LINE + "-" + errorType + ":" + description);
String originalValue = errorInfo.getOriginalValue();
if (StringUtil.isNotEmpty(originalValue)) {
System.out.println(originalValue);
}
}
}
System.out.println(str.getMessage());
}
}
}
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