Commit a44c6984 by zhanghou

修改mx2mt的53A逻辑

parent 149ac0d9
...@@ -990,13 +990,13 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate { ...@@ -990,13 +990,13 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
mtInstruction = "/TEMPREC/" + mtInstruction; mtInstruction = "/TEMPREC/" + mtInstruction;
} }
//提取 /GenericMax8c/ //提取 /GenericMax8c/
String mtType = context.get(SwiftMessage.class).getBlock2().getMessageType(); //String mtType = context.get(SwiftMessage.class).getBlock2().getMessageType();
String[] mxInstrInfs = StringUtil.splitAndKeepSeparator(mtInstruction, "/[A-Z0-9]{1,8}/"); String[] mxInstrInfs = StringUtil.splitAndKeepSeparator(mtInstruction, "/[A-Z0-9]{1,8}/");
for (int i=0; i<mxInstrInfs.length; i++) { for (int i=0; i<mxInstrInfs.length; i++) {
String mxIns = mxInstrInfs[i]; String mxIns = mxInstrInfs[i];
if (mxIns.startsWith("/FIN53/")) { if (mxIns.startsWith("/FIN53/")) {
String bicCode = mxIns.substring(7); String bicCode = mxIns.substring(7);
if (Mx2MtConstants.MT_TYPE_103.equals(mtType)) { //if (Mx2MtConstants.MT_TYPE_103.equals(mtType)) {
String acccount = mx_to_mtAccount(grpHdrParentElementName + ".GrpHdr.SttlmInf.SttlmAcct"); String acccount = mx_to_mtAccount(grpHdrParentElementName + ".GrpHdr.SttlmInf.SttlmAcct");
if (StringUtil.isEmpty(acccount)) { if (StringUtil.isEmpty(acccount)) {
String senderBic = (String)context.get(Mx2MtContextIdentifier.MX_SENDER_BIC, true); String senderBic = (String)context.get(Mx2MtContextIdentifier.MX_SENDER_BIC, true);
...@@ -1008,9 +1008,9 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate { ...@@ -1008,9 +1008,9 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
} else { } else {
bicCode53 = bicCode; bicCode53 = bicCode;
} }
} else { /*} else {
bicCode53 = bicCode; bicCode53 = bicCode;
} }*/
} }
} }
} }
......
...@@ -31,11 +31,12 @@ public class Field53AGenerate extends AbstractMx2MtTagsGenerate { ...@@ -31,11 +31,12 @@ public class Field53AGenerate 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 settlementMethod = getXmlNodeValue(grpHdrParentElementName, document, "GrpHdr.SttlmInf.SttlmMtd"); String settlementMethod = getXmlNodeValue(grpHdrParentElementName, document, "GrpHdr.SttlmInf.SttlmMtd");
if (SettlementMethodCode.INGA.value().equals(settlementMethod) String account = mx_to_mtSettlementAccount(settlementMethod, grpHdrParentElementName+".GrpHdr.SttlmInf.SttlmAcct");
|| SettlementMethodCode.INDA.value().equals(settlementMethod)) { if ((SettlementMethodCode.INGA.value().equals(settlementMethod)
String value = ""; || SettlementMethodCode.INDA.value().equals(settlementMethod))
String bicCode = mx_to_mt53A(bodyHdrParentElementName + ".CdtTrfTxInf.InstrForNxtAgt"); && StringUtil.isNotEmpty(account)) {
String account = mx_to_mtSettlementAccount(settlementMethod, grpHdrParentElementName+".GrpHdr.SttlmInf.SttlmAcct"); String value = "";
String bicCode = mx_to_mt53A(bodyHdrParentElementName + ".CdtTrfTxInf.InstrForNxtAgt");
if (StringUtil.isNotEmpty(bicCode)) { if (StringUtil.isNotEmpty(bicCode)) {
if (StringUtil.isNotEmpty(account)) { if (StringUtil.isNotEmpty(account)) {
value = account + Mx2MtConstants.NEW_LINE + bicCode; value = account + Mx2MtConstants.NEW_LINE + bicCode;
......
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