Commit 597fe678 by wuzhe

camt10700101修改52B域

parent 0c2a1f03
......@@ -3,7 +3,6 @@ package com.brilliance.swift.mx2mt.mt110.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;
import java.util.List;
......@@ -23,20 +22,24 @@ public class Field52aGenerate extends AbstractMx2MtTagsGenerate {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/52a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String cheDrwrAgt = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.DrwrAgt");
String cheDrwrAgtAcct = bodyHdrParentElementName + ".Chq.DrwrAgtAcct";
int cheDrwrAgt = getXmlNodeCounts(bodyHdrParentElementName, document, "Chq.DrwrAgt");
int cheDrwrAgtAcct = getXmlNodeCounts(bodyHdrParentElementName, document, "Chq.DrwrAgtAcct");
String account = "";
if (StringUtil.isEmpty(cheDrwrAgt)){
account = mx_to_mtAccount(bodyHdrParentElementName + ".Chq.DrwrAgtAcct");
tags.add(new Tag(name_52B, account));
} else {
Tag tag = mx_to_mtAgentGeneric(name, cheDrwrAgt, cheDrwrAgtAcct, true, false, false, null);
if (tag != null) {
if (name_52D.equals(tag.getName())) {
String value = mx_to_mtStartingLineCharacter(tag.getValue(), "Block4/:" + name_52D + ":");
tag.setValue(value);
if (cheDrwrAgt > 0 || cheDrwrAgtAcct > 0) {
String cheDrwrAgtPath = bodyHdrParentElementName + ".Chq.DrwrAgt";
String cheDrwrAgtAcctPath = bodyHdrParentElementName + ".Chq.DrwrAgtAcct";
if (cheDrwrAgt == 0 ) {
account = mx_to_mtAccount(bodyHdrParentElementName + ".Chq.DrwrAgtAcct");
// tags.add(new Tag(name_52B, account));
} else {
Tag tag = mx_to_mtAgentGeneric(name, cheDrwrAgtPath, cheDrwrAgtAcctPath, true, false, false, null);
if (tag != null) {
if (name_52D.equals(tag.getName())) {
String value = mx_to_mtStartingLineCharacter(tag.getValue(), "Block4/:" + name_52D + ":");
tag.setValue(value);
}
tags.add(tag);
}
tags.add(tag);
}
}
}
......
......@@ -2,8 +2,6 @@ package com.brilliance.swift.mx2mt.mt110.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;
import java.util.List;
......@@ -19,9 +17,10 @@ public class Field53BGenerate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int cheDrwrAgtAcct = getXmlNodeCounts(bodyHdrParentElementName, document, "Chq.DrwrAgtAcct");
String accountPath = bodyHdrParentElementName +".Chq.DrwrAgtAcct";
String account = mx_to_mtSettlementAccount("INDA", accountPath);
if (StringUtil.isNotEmpty(account)) {
if (cheDrwrAgtAcct > 0) {
tags.add(new Tag(name_53B, account));
}
}
......
......@@ -57,9 +57,11 @@
<IBAN>SSSS</IBAN>
</Id>
</PyerAcct>
<DrwrAgt>
<FinInstnId>QWERTYOII</FinInstnId>
</DrwrAgt>
<DrwrAgtAcct>
<Id>
<!--52B-->
<IBAN>OBHHIO</IBAN>
</Id>
</DrwrAgtAcct>
......
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