Commit a44c6984 by zhanghou

修改mx2mt的53A逻辑

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