Commit 961ca0f0 by zhanghou

mt192292,mt196296,mt942的异常警告的定义

parent 3e32e0af
......@@ -1324,39 +1324,6 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
}
/**
* 判断xml节点的值如果值包含"pacs.008"则该字段赋值为"103",
* 包含"pacs.003"则赋值为"104",包含"MT10[0-9]{1}",
* 则根据正则表达式,截取3位为"10X",(X的取值为0-9),
* 值包含"pasc.009",赋值为"202",值包含"pasc.010"则赋值为"204",
* 包含"MT20[0-9]{1}",则根据正则表达式,截取3位为"20X",(X的取值为0-9),
* 最后如果上述条件均不满足则直接赋值为"202"。1类型的交给192处理,2类型的交给292处理
* 这是11s域的第一部分。
* @param mtType
* @return
*/
protected String getMtMsg(String mtType) {
if(StringUtil.isNotEmpty(mtType)){
if(mtType.startsWith("pacs.008")){
return "103";
}else if(mtType.startsWith("pacs.003")){
return "104";
}else if(mtType.startsWith("pacs.009")){
return "202";
}else if(mtType.startsWith("pacs.010")){
return "204";
}else if(mtType.matches("MT10[0-9]{1}")){
return mtType.substring(2);
}else if(mtType.matches("MT20[0-9]{1}")){
return mtType.substring(2);
}else {
return "202";
}
}else {
return "没有找到指定的类型";
}
}
/**
*MX_To_MT79CANC(MXOriginalUETR,MXCancellationReasonInformation)
* 参数一:MXOriginalUETR对应的xml节点
* FIToFIPmtCxlReq/Undrlyg/TxInf/OrgnlUETR
......
......@@ -56,6 +56,15 @@ public class Mx2Mtn92Creator extends AbstractMx2MtCreator {
fieldsGenerateList.add(new Field79Generate());
return fieldsGenerateList;
}
/**
* 判断xml节点的值如果值包含"pacs.008"则该字段赋值为"103",
* 包含"pacs.003"则赋值为"104",包含"MT10[0-9]{1}",
* 则根据正则表达式,截取3位为"10X",(X的取值为0-9),
* 值包含"pasc.009",赋值为"202",值包含"pasc.010"则赋值为"204",
* 包含"MT20[0-9]{1}",则根据正则表达式,截取3位为"20X",(X的取值为0-9),
* 最后如果上述条件均不满足则直接赋值为"202"。1类型的交给192处理,2类型的交给292处理
* @return
*/
@Override
protected String getMtType() {
Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT, true);
......@@ -74,7 +83,7 @@ public class Mx2Mtn92Creator extends AbstractMx2MtCreator {
} else if (orgMsgNameIdentification.matches("MT20[0-9]{1}")) {
mtType = Mx2MtConstants.MT_TYPE_292;
}else {
buildSTErrorInfo(ERROR.T20092,null,null);
buildSTErrorInfo(ERROR.T20092,"",bodyParentPath+"Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId");
}
}
return mtType;
......
......@@ -25,7 +25,6 @@ public class Field11SGenerate extends AbstractMx2MtTagsGenerate {
String mtType = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId");
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlGrpInf.OrgnlCreDtTm");
if (StringUtil.isNotEmpty(mtType)) {
orgnlMsgNmId = getMtMsg(mtType);
if(StringUtil.isNotEmpty(mtType)){
if(mtType.startsWith("pacs.008")){
orgnlMsgNmId = "103";
......@@ -41,12 +40,17 @@ public class Field11SGenerate extends AbstractMx2MtTagsGenerate {
orgnlMsgNmId = mtType.substring(2);
}else {
orgnlMsgNmId = "202";
buildSTErrorInfo(ERROR.T20083,null,null);
buildSTErrorInfo(ERROR.T20083,"","");
}
}
}
if(StringUtil.isNotEmpty(dateStr)){
if(dateStr.length()>0){
date = mXToMTDate(dateStr);
}else {
date = mXToMTDate("993112");
}
}
tags.add(new Tag(name, orgnlMsgNmId+Mx2MtConstants.NEW_LINE+date));
}
......
package com.brilliance.swift.mx2mt.mt196296;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtCreator;
......@@ -55,7 +56,15 @@ public class Mx2Mtn96Creator extends AbstractMx2MtCreator {
fieldsGenerateList.add(new Field11RGenerate());
return fieldsGenerateList;
}
/**
* 判断xml节点的值如果值包含"pacs.008"则该字段赋值为"103",
* 包含"pacs.003"则赋值为"104",包含"MT10[0-9]{1}",
* 则根据正则表达式,截取3位为"10X",(X的取值为0-9),
* 值包含"pasc.009",赋值为"202",值包含"pasc.010"则赋值为"204",
* 包含"MT20[0-9]{1}",则根据正则表达式,截取3位为"20X",(X的取值为0-9),
* 最后如果上述条件均不满足则直接赋值为"202"。1类型的交给192处理,2类型的交给292处理
* @return
*/
@Override
protected String getMtType() {
Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT, true);
......@@ -74,7 +83,7 @@ public class Mx2Mtn96Creator extends AbstractMx2MtCreator {
} else if (orgMsgNameIdentification.matches("MT20[0-9]{1}")) {
mtType = Mx2MtConstants.MT_TYPE_296;
}else {
//TODO,填入location:(mt196|mt296)/block3/:11R:,errorcode:T20083
buildSTErrorInfo(ERROR.T20092,"",bodyParentPath+"CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId");
}
}
return mtType;
......
package com.brilliance.swift.mx2mt.mt196296.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,46 @@ public class Field11RGenerate extends AbstractMx2MtTagsGenerate {
List<Tag> tags = swiftMessage.getBlock4().getTags();
String orgnlMsgNmId = "";
String date = "";
boolean boolean1 = false;
boolean boolean2 = false;
String mtType = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId");
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlCreDtTm");
if (StringUtil.isNotEmpty(mtType)) {
orgnlMsgNmId = getMtMsg(mtType);
if(StringUtil.isNotEmpty(mtType)){
if(mtType.startsWith("pacs.008")){
orgnlMsgNmId = "103";
}else if(mtType.startsWith("pacs.003")){
orgnlMsgNmId = "104";
}else if(mtType.startsWith("pacs.009")){
orgnlMsgNmId = "202";
}else if(mtType.startsWith("pacs.010")){
orgnlMsgNmId = "204";
}else if(mtType.matches("MT10[0-9]{1}")){
orgnlMsgNmId = mtType.substring(2);
}else if(mtType.matches("MT20[0-9]{1}")){
orgnlMsgNmId = mtType.substring(2);
}else {
orgnlMsgNmId = "202";
boolean1 = true;
}
}
}
if(StringUtil.isNotEmpty(dateStr)){
if(dateStr.length()>0){
date = mXToMTDate(dateStr);
}else {
date = mXToMTDate("993112");
boolean2 = true;
}
}
if(boolean1&&boolean2){
}else {
tags.add(new Tag(name, orgnlMsgNmId+Mx2MtConstants.NEW_LINE+date));
if(boolean1){
buildSTErrorInfo(ERROR.T20083,"","");
}
}
}
}
package com.brilliance.swift.mx2mt.mt196296.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;
......@@ -23,12 +24,13 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
String messageId = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.CxlStsId");
if (StringUtil.isNotEmpty(messageId)) {
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;
//TODO,填入location:(mt196|mt296)/block3/:20:,errorcode:T20090
buildSTErrorInfo(ERROR.T20090, "BLOCK4/:20:", messageId);
}
tags.add(new Tag(name, value));
}
......
package com.brilliance.swift.mx2mt.mt196296.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;
......@@ -23,12 +24,13 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
String orgnlInstrId = getXmlNodeValue(bodyHdrParentElementName, document, "CxlDtls.TxInfAndSts.RslvdCase.Id");
if (StringUtil.isNotEmpty(orgnlInstrId)) {
if (orgnlInstrId.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:21:", orgnlInstrId);
orgnlInstrId = orgnlInstrId.substring(0, 15) + "+";
}
String value = orgnlInstrId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
//TODO,填入location:(mt196|mt296)/block3/:21:,errorcode:T20091
buildSTErrorInfo(ERROR.T20091, "BLOCK4/:21:", orgnlInstrId);
}
tags.add(new Tag(name, value));
}
......
package com.brilliance.swift.mx2mt.mt941942;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.mx2mt.AbstractMx2MtCreator;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.mx2mt.Mx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.mt941942.impl.*;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.util.XmlUtil;
import org.dom4j.Document;
......@@ -46,13 +48,14 @@ public class Mx2Mt941942Creator extends AbstractMx2MtCreator {
@Override
protected String getMtType() {
Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT);
/*Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT);
String bodyParentPath = (String)context.get(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, true);
int balanceTypeCount = getXmlNodeCounts(bodyParentPath, document, "Rpt.Bal");
if(balanceTypeCount>0){
return Mx2MtConstants.MT_TYPE_941;
}else {
return Mx2MtConstants.MT_TYPE_942;
}
}*/
return Mx2MtConstants.MT_TYPE_942;
}
}
package com.brilliance.swift.mx2mt.mt941942.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;
......@@ -23,12 +24,13 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
String messageId = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Id");
if (StringUtil.isNotEmpty(messageId)) {
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;
//TODO,填入location:mt942/block3/:20:,errorcode:T20115
buildSTErrorInfo(ERROR.T20115, "BLOCK4/:20:", messageId);
}
tags.add(new Tag(name, value));
}
......
package com.brilliance.swift.mx2mt.mt941942.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.StringUtil;
......@@ -23,6 +24,10 @@ public class Field28CGenerate extends AbstractMx2MtTagsGenerate {
String mt = "";
if(StringUtil.isEmpty(leSeNum)||leSeNum.length()>5){
mt = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.ElctrncSeqNb");
if(StringUtil.isEmpty(mt)||mt.length()>5){
buildSTErrorInfo(ERROR.T20103, "BLOCK4/:28:", bodyHdrParentElementName+"Rpt.ElctrncSeqNb");
return;
}
}else {
String pageNum = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.RptPgntn.PgNb");
mt = leSeNum + "/" + pageNum;
......
......@@ -25,7 +25,7 @@ public class Field60FGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
/*SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
int index = -1;
......@@ -66,6 +66,6 @@ public class Field60FGenerate extends AbstractMx2MtTagsGenerate {
} catch (DatatypeConfigurationException e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
}*/
}
}
package com.brilliance.swift.mx2mt.mt941942.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.DateUtil;
import com.brilliance.swift.util.NumberUtil;
import com.brilliance.swift.util.StringUtil;
......@@ -30,11 +32,22 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
try {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
/*int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
if(balanceTypeCount>0){
return;
}
}*/
int entryCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Ntry");
if(entryCount>189){
buildSTErrorInfo(ERROR.T20110, "BLOCK4/:61:",bodyHdrParentElementName+"Rpt.Ntry");
return;
}
String sumc = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlCdtNtries.Sum");
String sumd = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlDbtNtries.Sum");
if(entryCount<0|| StringUtil.isEmpty(sumc)&&StringUtil.isEmpty(sumd)){
buildSTErrorInfo(ERROR.T20114, "BLOCK4/:61:","");
return;
}
String ccy2 = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Acct.Ccy");
if (entryCount > 0) {
for (int i = 0; i < entryCount; i++) {
String value = "";
......@@ -75,10 +88,21 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
String amt = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Ntry(" + i + ").Amt");
String ccy = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Ntry(" + i + ").Amt@Ccy");
if (StringUtil.isNotEmpty(amt) && StringUtil.isNotEmpty(ccy)) {
value += NumberUtil.formatAmt(new BigDecimal(amt), ccy);
String amount = NumberUtil.formatAmt(new BigDecimal(amt), ccy);
if(amount.length()>15){
buildSTErrorInfo(ERROR.T20113, "BLOCK4/:61:", amt);
return;
}
value += amount;
}
if(StringUtil.isNotEmpty(ccy)&&StringUtil.isNotEmpty(ccy2)){
if(ccy.equals(ccy2)){
buildSTErrorInfo(ERROR.T20116, "BLOCK4/:61:", ccy);
return;
}
}
if(amt.length()>15){
//TODO,填入location:mt942/block3/:61:,errorcode:T20113
if(amt.length()>14){
buildSTErrorInfo(ERROR.T20113, "BLOCK4/:61:", bodyHdrParentElementName+"Rpt.Ntry(" + i + ").Amt");
return;
}
value += "NTRF";
......
......@@ -25,7 +25,7 @@ public class Field62FGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
/*SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
int index = -1;
......@@ -66,6 +66,6 @@ public class Field62FGenerate extends AbstractMx2MtTagsGenerate {
} catch (DatatypeConfigurationException e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
}*/
}
}
......@@ -25,7 +25,7 @@ public class Field64Generate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
/*SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
int index = -1;
......@@ -66,6 +66,6 @@ public class Field64Generate extends AbstractMx2MtTagsGenerate {
} catch (DatatypeConfigurationException e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
}*/
}
}
......@@ -27,7 +27,7 @@ public class Field65Generate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
/* SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
if (balanceTypeCount > 0) {
......@@ -64,6 +64,6 @@ public class Field65Generate extends AbstractMx2MtTagsGenerate {
}
}
}
}
}*/
}
}
package com.brilliance.swift.mx2mt.mt941942.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;
......@@ -21,20 +22,26 @@ public class Field90CGenerate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String sum = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlCdtNtries.Sum");
String sumc = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlCdtNtries.Sum");
String nbOfNtries = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlCdtNtries.NbOfNtries");
if(StringUtil.isNotEmpty(sum)&&StringUtil.isNotEmpty(nbOfNtries)) {
int entryCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Ntry");
String sumd = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlDbtNtries.Sum");
if(entryCount<0|| StringUtil.isEmpty(sumc)&&StringUtil.isEmpty(sumd)){
buildSTErrorInfo(ERROR.T20114, "BLOCK4/:90C:",bodyHdrParentElementName+"Rpt.TxsSummry.TtlCdtNtries.Sum");
return;
}
if(StringUtil.isNotEmpty(sumc)&&StringUtil.isNotEmpty(nbOfNtries)) {
String currency = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Acct.Ccy");
String amt = NumberUtil.formatAmt(new BigDecimal(sum), currency);
String amt = NumberUtil.formatAmt(new BigDecimal(sumc), currency);
if(amt.length()>15){
//TODO,填入location:mt942/block3/:90C:,errorcode:T20120
buildSTErrorInfo(ERROR.T20120, "BLOCK4/:90C:", amt);
}else if(nbOfNtries.length()>5){
//TODO,填入location:mt942/block3/:90C:,errorcode:T20119
buildSTErrorInfo(ERROR.T20119, "BLOCK4/:90C:", nbOfNtries);
} else {
tags.add(new Tag(name,nbOfNtries+currency+amt));
}
}else {
//TODO,填入location:mt942/block3/:90C:,errorcode:T20122
buildSTErrorInfo(ERROR.T20122, "BLOCK4/:90D:","");
}
}
}
package com.brilliance.swift.mx2mt.mt941942.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;
......@@ -21,20 +22,26 @@ public class Field90DGenerate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String sum = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlDbtNtries.Sum");
String sumc = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlCdtNtries.Sum");
String sumd = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlDbtNtries.Sum");
String nbOfNtries = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlDbtNtries.NbOfNtries");
if(StringUtil.isNotEmpty(sum)&&StringUtil.isNotEmpty(nbOfNtries)) {
int entryCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Ntry");
if(entryCount<0|| StringUtil.isEmpty(sumc)&&StringUtil.isEmpty(sumd)){
buildSTErrorInfo(ERROR.T20114, "BLOCK4/:90D:",bodyHdrParentElementName+"Rpt.TxsSummry.TtlDbtNtries.Sum");
return;
}
if(StringUtil.isNotEmpty(sumd)&&StringUtil.isNotEmpty(nbOfNtries)) {
String currency = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Acct.Ccy");
String amt = NumberUtil.formatAmt(new BigDecimal(sum), currency);
String amt = NumberUtil.formatAmt(new BigDecimal(sumd), currency);
if(amt.length()>15){
//TODO,填入location:mt942/block3/:90D:,errorcode:T20120
buildSTErrorInfo(ERROR.T20120, "BLOCK4/:90D:", amt);
} else if(nbOfNtries.length()>5){
//TODO,填入location:mt942/block3/:90D:,errorcode:T20119
buildSTErrorInfo(ERROR.T20119, "BLOCK4/:90D:", nbOfNtries);
} else {
tags.add(new Tag(name,nbOfNtries+currency+amt));
}
}else {
//TODO,填入location:mt942/block3/:90D:,errorcode:T20121
buildSTErrorInfo(ERROR.T20121, "BLOCK4/:90D:","");
}
}
}
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