Commit 844c8594 by zhanghou

修改了mt210,mt192292,mt196296,mt940的异常警告

parent 23175acb
...@@ -72,18 +72,18 @@ public class Mx2Mtn92Creator extends AbstractMx2MtCreator { ...@@ -72,18 +72,18 @@ public class Mx2Mtn92Creator extends AbstractMx2MtCreator {
String orgMsgNameIdentification = getXmlNodeValue(bodyParentPath, document, "Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId"); String orgMsgNameIdentification = getXmlNodeValue(bodyParentPath, document, "Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId");
String mtType = Mx2MtConstants.MT_TYPE_292; String mtType = Mx2MtConstants.MT_TYPE_292;
if (StringUtil.isNotEmpty(orgMsgNameIdentification)) { if (StringUtil.isNotEmpty(orgMsgNameIdentification)) {
if (orgMsgNameIdentification.startsWith("pacs.008") if (orgMsgNameIdentification.contains("pacs.008")
|| orgMsgNameIdentification.startsWith("pacs.003")) { || orgMsgNameIdentification.contains("pacs.003")) {
mtType = Mx2MtConstants.MT_TYPE_192; mtType = Mx2MtConstants.MT_TYPE_192;
} else if (orgMsgNameIdentification.startsWith("pacs.009") } else if (orgMsgNameIdentification.contains("pacs.009")
|| orgMsgNameIdentification.startsWith("pacs.010")) { || orgMsgNameIdentification.contains("pacs.010")) {
mtType = Mx2MtConstants.MT_TYPE_292; mtType = Mx2MtConstants.MT_TYPE_292;
} else if (orgMsgNameIdentification.matches("MT10[0-9]{1}")) { } else if (orgMsgNameIdentification.matches("MT10[0-9]{1}")) {
mtType = Mx2MtConstants.MT_TYPE_192; mtType = Mx2MtConstants.MT_TYPE_192;
} 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(ERROR.T20092,null,null); buildSTErrorInfo(ERROR.T20092,"BLOCK2/:mtType:",orgMsgNameIdentification);
} }
} }
return mtType; return mtType;
......
...@@ -40,7 +40,7 @@ public class Field11SGenerate extends AbstractMx2MtTagsGenerate { ...@@ -40,7 +40,7 @@ public class Field11SGenerate extends AbstractMx2MtTagsGenerate {
orgnlMsgNmId = mtType.substring(2); orgnlMsgNmId = mtType.substring(2);
}else { }else {
orgnlMsgNmId = "202"; orgnlMsgNmId = "202";
buildSTErrorInfo(ERROR.T20083,null,null); buildSTErrorInfo(ERROR.T20083,"BLOCK4/:11S:",null);
} }
} }
} }
......
...@@ -27,14 +27,16 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate { ...@@ -27,14 +27,16 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
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");
if (StringUtil.isNotEmpty(messageId)) { if (StringUtil.isNotEmpty(messageId)) {
if (messageId.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:20:", messageId);
messageId = messageId.substring(0, 15) + "+";
}
String value = messageId; String value = messageId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
buildSTErrorInfo(ERROR.T20080, "BLOCK4/:20:", messageId); buildSTErrorInfo(ERROR.T20080, "BLOCK4/:20:", messageId);
tags.add(new Tag(name, value));
return;
}
if (value.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:20:", value);
value = value.substring(0, 15) + "+";
} }
tags.add(new Tag(name, value)); tags.add(new Tag(name, value));
} }
......
...@@ -24,14 +24,16 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate { ...@@ -24,14 +24,16 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
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");
if (StringUtil.isNotEmpty(orgnlInstrId)) { if (StringUtil.isNotEmpty(orgnlInstrId)) {
if (orgnlInstrId.length() > 16) {
orgnlInstrId = orgnlInstrId.substring(0, 15) + "+";
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:21:", orgnlInstrId);
}
String value = orgnlInstrId; String value = orgnlInstrId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
buildSTErrorInfo(ERROR.T20081, "BLOCK4/:21:", orgnlInstrId); buildSTErrorInfo(ERROR.T20081, "BLOCK4/:21:", orgnlInstrId);
tags.add(new Tag(name, value));
return;
}
if (value.length() > 16) {
value = value.substring(0, 15) + "+";
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:21:", value);
} }
tags.add(new Tag(name, value)); tags.add(new Tag(name, value));
}else { }else {
......
...@@ -72,18 +72,18 @@ public class Mx2Mtn96Creator extends AbstractMx2MtCreator { ...@@ -72,18 +72,18 @@ public class Mx2Mtn96Creator extends AbstractMx2MtCreator {
String orgMsgNameIdentification = getXmlNodeValue(bodyParentPath, document, "CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId"); String orgMsgNameIdentification = getXmlNodeValue(bodyParentPath, document, "CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId");
String mtType = Mx2MtConstants.MT_TYPE_296; String mtType = Mx2MtConstants.MT_TYPE_296;
if (StringUtil.isNotEmpty(orgMsgNameIdentification)) { if (StringUtil.isNotEmpty(orgMsgNameIdentification)) {
if (orgMsgNameIdentification.startsWith("pacs.008") if (orgMsgNameIdentification.contains("pacs.008")
|| orgMsgNameIdentification.startsWith("pacs.003")) { || orgMsgNameIdentification.contains("pacs.003")) {
mtType = Mx2MtConstants.MT_TYPE_196; mtType = Mx2MtConstants.MT_TYPE_196;
} else if (orgMsgNameIdentification.startsWith("pacs.009") } else if (orgMsgNameIdentification.contains("pacs.009")
|| orgMsgNameIdentification.startsWith("pacs.010")) { || orgMsgNameIdentification.contains("pacs.010")) {
mtType = Mx2MtConstants.MT_TYPE_296; mtType = Mx2MtConstants.MT_TYPE_296;
} else if (orgMsgNameIdentification.matches("MT10[0-9]{1}")) { } else if (orgMsgNameIdentification.matches("MT10[0-9]{1}")) {
mtType = Mx2MtConstants.MT_TYPE_196; mtType = Mx2MtConstants.MT_TYPE_196;
} 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(ERROR.T20092,null,null); buildSTErrorInfo(ERROR.T20092,"BLOCK2/:mtType:",orgMsgNameIdentification);
} }
} }
return mtType; return mtType;
......
...@@ -60,7 +60,7 @@ public class Field11RGenerate extends AbstractMx2MtTagsGenerate { ...@@ -60,7 +60,7 @@ public class Field11RGenerate extends AbstractMx2MtTagsGenerate {
}else { }else {
tags.add(new Tag(name, orgnlMsgNmId+Mx2MtConstants.NEW_LINE+date)); tags.add(new Tag(name, orgnlMsgNmId+Mx2MtConstants.NEW_LINE+date));
if(boolean1){ if(boolean1){
buildSTErrorInfo(ERROR.T20083,null,null); buildSTErrorInfo(ERROR.T20083,"BLOCK4/:11R:",null);
} }
} }
......
...@@ -23,14 +23,16 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate { ...@@ -23,14 +23,16 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
List<Tag> tags = swiftMessage.getBlock4().getTags(); List<Tag> tags = swiftMessage.getBlock4().getTags();
String messageId = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.CxlStsId"); String messageId = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.CxlStsId");
if (StringUtil.isNotEmpty(messageId)) { if (StringUtil.isNotEmpty(messageId)) {
if (messageId.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:20:", messageId);
messageId = messageId.substring(0, 15) + "+";
}
String value = messageId; String value = messageId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
buildSTErrorInfo(ERROR.T20090, "BLOCK4/:20:", messageId); buildSTErrorInfo(ERROR.T20090, "BLOCK4/:20:", value);
tags.add(new Tag(name, value));
return;
}
if (value.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:20:", value);
value = value.substring(0, 15) + "+";
} }
tags.add(new Tag(name, value)); tags.add(new Tag(name, value));
} }
......
...@@ -23,14 +23,17 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate { ...@@ -23,14 +23,17 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
List<Tag> tags = swiftMessage.getBlock4().getTags(); List<Tag> tags = swiftMessage.getBlock4().getTags();
String orgnlInstrId = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.RslvdCase.Id"); String orgnlInstrId = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.RslvdCase.Id");
if (StringUtil.isNotEmpty(orgnlInstrId)) { if (StringUtil.isNotEmpty(orgnlInstrId)) {
if (orgnlInstrId.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:21:", orgnlInstrId);
orgnlInstrId = orgnlInstrId.substring(0, 15) + "+";
}
String value = orgnlInstrId; String value = orgnlInstrId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
buildSTErrorInfo(ERROR.T20091, "BLOCK4/:21:", orgnlInstrId); buildSTErrorInfo(ERROR.T20091, "BLOCK4/:21:", value);
tags.add(new Tag(name, value));
return;
}
if (value.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:21:", value);
value = value.substring(0, 15) + "+";
} }
tags.add(new Tag(name, value)); tags.add(new Tag(name, value));
} }
......
...@@ -23,15 +23,15 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate { ...@@ -23,15 +23,15 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
List<Tag> tags = swiftMessage.getBlock4().getTags(); List<Tag> tags = swiftMessage.getBlock4().getTags();
String messageId = getXmlNodeValue(grpHdrParentElementName, document, "GrpHdr.MsgId"); String messageId = getXmlNodeValue(grpHdrParentElementName, document, "GrpHdr.MsgId");
if (StringUtil.isNotEmpty(messageId)) { if (StringUtil.isNotEmpty(messageId)) {
if (messageId.length() > 16) {
messageId = messageId.substring(0, 15) + "+";
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:20:", messageId);
}
String value = messageId; String value = messageId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
buildSTErrorInfo(ERROR.T20051, "BLOCK4/:20:", messageId); buildSTErrorInfo(ERROR.T20051, "BLOCK4/:20:", messageId);
} }
if (value.length() > 16) {
value = value.substring(0, 15) + "+";
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:20:", value);
}
tags.add(new Tag(name, value)); tags.add(new Tag(name, value));
} }
} }
......
...@@ -29,14 +29,16 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate { ...@@ -29,14 +29,16 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
filed21 = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.Itm("+0+").Id"); filed21 = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.Itm("+0+").Id");
} }
if (StringUtil.isNotEmpty(filed21)) { if (StringUtil.isNotEmpty(filed21)) {
if (filed21.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:21:", endToEndId);
filed21 = filed21.substring(0, 15) + "+";
}
String value = filed21; String value = filed21;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
buildSTErrorInfo(ERROR.T20055, "BLOCK4/:21:", endToEndId); buildSTErrorInfo(ERROR.T20055, "BLOCK4/:21:", value);
tags.add(new Tag(name, value));
return;
}
if (value.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:21:", value);
value = value.substring(0, 15) + "+";
} }
tags.add(new Tag(name, value)); tags.add(new Tag(name, value));
} }
......
...@@ -31,7 +31,7 @@ public class Field30Generate extends AbstractMx2MtTagsGenerate { ...@@ -31,7 +31,7 @@ public class Field30Generate extends AbstractMx2MtTagsGenerate {
if(StringUtil.isNotEmpty(mxDate)){ if(StringUtil.isNotEmpty(mxDate)){
mtDate = mXToMTDate(mxDate); mtDate = mXToMTDate(mxDate);
}else { }else {
mtDate = mXToMTDate("991231"); mtDate = "991231";
buildSTErrorInfo(ERROR.T20062, "BLOCK4/:30:",""); buildSTErrorInfo(ERROR.T20062, "BLOCK4/:30:","");
} }
tags.add(new Tag(name, mtDate)); tags.add(new Tag(name, mtDate));
......
...@@ -97,10 +97,7 @@ public class Field50aGenerate extends AbstractMx2MtTagsGenerate { ...@@ -97,10 +97,7 @@ public class Field50aGenerate extends AbstractMx2MtTagsGenerate {
String mtNameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(partyPath); String mtNameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(partyPath);
tags.add(new Tag(name_F, account + Mx2MtConstants.NEW_LINE + mtNameAddress)); tags.add(new Tag(name_F, account + Mx2MtConstants.NEW_LINE + mtNameAddress));
} }
}else { } else if(counts3>0||counts4>0) {
buildSTErrorInfo(ERROR.T20102, "BLOCK4/:50a:","");
}
if(counts3>0||counts4>0) {
if (StringUtil.isNotEmpty(bicCode)) { if (StringUtil.isNotEmpty(bicCode)) {
tags.add(new Tag(name_C, bicCode)); tags.add(new Tag(name_C, bicCode));
} else if (StringUtil.isNotEmpty(country)) { } else if (StringUtil.isNotEmpty(country)) {
...@@ -110,11 +107,9 @@ public class Field50aGenerate extends AbstractMx2MtTagsGenerate { ...@@ -110,11 +107,9 @@ public class Field50aGenerate extends AbstractMx2MtTagsGenerate {
String nameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(partyPath); String nameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(partyPath);
tags.add(new Tag(name_, nameAddress)); tags.add(new Tag(name_, nameAddress));
} else if (StringUtil.isNotEmpty(clearSystemId)) { } else if (StringUtil.isNotEmpty(clearSystemId)) {
buildSTErrorInfo(ERROR.T20097, "BLOCK4/:50K:","");
tags.add(new Tag(name_, clearSystemId)); tags.add(new Tag(name_, clearSystemId));
buildSTErrorInfo(ERROR.T20097, "BLOCK4/:50a:","");
} }
}else {
buildSTErrorInfo(ERROR.T20102, "BLOCK4/:50a:","");
} }
} }
} }
package com.brilliance.swift.mx2mt.mt210.impl; package com.brilliance.swift.mx2mt.mt210.impl;
import com.brilliance.swift.constants.ERROR;
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;
...@@ -24,6 +25,7 @@ public class Field52aGenerate extends AbstractMx2MtTagsGenerate { ...@@ -24,6 +25,7 @@ public class Field52aGenerate extends AbstractMx2MtTagsGenerate {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/52a"); context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/52a");
String s = (String)context.get(Mx2MtContextIdentifier.MT_TYPE_210_50_FLAG); String s = (String)context.get(Mx2MtContextIdentifier.MT_TYPE_210_50_FLAG);
if(Mx2MtConstants.YES.equals(s)){ if(Mx2MtConstants.YES.equals(s)){
buildSTErrorInfo(ERROR.T20102, "BLOCK4/:52a:","");
return; return;
} }
SwiftMessage swiftMessage = context.get(SwiftMessage.class); SwiftMessage swiftMessage = context.get(SwiftMessage.class);
......
...@@ -23,14 +23,16 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate { ...@@ -23,14 +23,16 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
List<Tag> tags = swiftMessage.getBlock4().getTags(); List<Tag> tags = swiftMessage.getBlock4().getTags();
String messageId = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Id"); String messageId = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Id");
if (StringUtil.isNotEmpty(messageId)) { if (StringUtil.isNotEmpty(messageId)) {
if (messageId.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:20:", messageId);
messageId = messageId.substring(0, 15) + "+";
}
String value = messageId; String value = messageId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
buildSTErrorInfo(ERROR.T20115, "BLOCK4/:20:", messageId); buildSTErrorInfo(ERROR.T20115, "BLOCK4/:20:", value);
tags.add(new Tag(name, value));
return;
}
if (value.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:20:", value);
value = value.substring(0, 15) + "+";
} }
tags.add(new Tag(name, value)); tags.add(new Tag(name, value));
} }
......
...@@ -24,7 +24,7 @@ public class Field28CGenerate extends AbstractMx2MtTagsGenerate { ...@@ -24,7 +24,7 @@ public class Field28CGenerate extends AbstractMx2MtTagsGenerate {
if(StringUtil.isEmpty(num)||num.length()>5){ if(StringUtil.isEmpty(num)||num.length()>5){
num = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.ElctrncSeqNb"); num = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.ElctrncSeqNb");
if(StringUtil.isEmpty(num)||num.length()>5){ if(StringUtil.isEmpty(num)||num.length()>5){
buildSTErrorInfo(ERROR.T20103, "BLOCK4/:28:", bodyHdrParentElementName+"Rpt.ElctrncSeqNb"); buildSTErrorInfo(ERROR.T20103, "BLOCK4/:28C:", bodyHdrParentElementName+"Rpt.ElctrncSeqNb");
return; return;
} }
} }
......
...@@ -19,7 +19,6 @@ public class Field34FGenerate extends AbstractMx2MtTagsGenerate { ...@@ -19,7 +19,6 @@ public class Field34FGenerate 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 currency = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Acct.Ccy"); String currency = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Acct.Ccy");
tags.add(new Tag(name,currency+"D"+"0,")); tags.add(new Tag(name,currency+"0,"));
tags.add(new Tag(name,currency+"C"+"0,"));
} }
} }
...@@ -37,7 +37,7 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate { ...@@ -37,7 +37,7 @@ public class Field61Generate 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();
int entryCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Ntry"); int entryCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Ntry");
if(entryCount>189){ if(entryCount>190){
buildSTErrorInfo(ERROR.T20110, "BLOCK4/:61:",entryCount+""); buildSTErrorInfo(ERROR.T20110, "BLOCK4/:61:",entryCount+"");
return; return;
} }
......
...@@ -27,15 +27,13 @@ public class Field90CGenerate extends AbstractMx2MtTagsGenerate { ...@@ -27,15 +27,13 @@ public class Field90CGenerate extends AbstractMx2MtTagsGenerate {
if(StringUtil.isNotEmpty(sumc)&&StringUtil.isNotEmpty(nbOfNtries)) { if(StringUtil.isNotEmpty(sumc)&&StringUtil.isNotEmpty(nbOfNtries)) {
String currency = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Acct.Ccy"); String currency = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Acct.Ccy");
String amt = NumberUtil.formatAmt(new BigDecimal(sumc), currency); String amt = NumberUtil.formatAmt(new BigDecimal(sumc), currency);
if(amt.length()>15){ if(nbOfNtries.length()>5){
buildSTErrorInfo(ERROR.T20120, "BLOCK4/:90C:", amt);
}else if(nbOfNtries.length()>5){
buildSTErrorInfo(ERROR.T20119, "BLOCK4/:90C:", nbOfNtries); buildSTErrorInfo(ERROR.T20119, "BLOCK4/:90C:", nbOfNtries);
} else { } else {
tags.add(new Tag(name,nbOfNtries+currency+amt)); tags.add(new Tag(name,nbOfNtries+currency+amt));
} }
}else { }else {
buildSTErrorInfo(ERROR.T20122, "BLOCK4/:90D:",""); buildSTErrorInfo(ERROR.T20122, "BLOCK4/:90C:","");
} }
} }
} }
...@@ -27,9 +27,7 @@ public class Field90DGenerate extends AbstractMx2MtTagsGenerate { ...@@ -27,9 +27,7 @@ public class Field90DGenerate extends AbstractMx2MtTagsGenerate {
if(StringUtil.isNotEmpty(sumd)&&StringUtil.isNotEmpty(nbOfNtries)) { if(StringUtil.isNotEmpty(sumd)&&StringUtil.isNotEmpty(nbOfNtries)) {
String currency = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Acct.Ccy"); String currency = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Acct.Ccy");
String amt = NumberUtil.formatAmt(new BigDecimal(sumd), currency); String amt = NumberUtil.formatAmt(new BigDecimal(sumd), currency);
if(amt.length()>15){ if(nbOfNtries.length()>5){
buildSTErrorInfo(ERROR.T20120, "BLOCK4/:90D:", amt);
} else if(nbOfNtries.length()>5){
buildSTErrorInfo(ERROR.T20119, "BLOCK4/:90D:", nbOfNtries); buildSTErrorInfo(ERROR.T20119, "BLOCK4/:90D:", nbOfNtries);
} else { } else {
tags.add(new Tag(name,nbOfNtries+currency+amt)); tags.add(new Tag(name,nbOfNtries+currency+amt));
......
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