Commit 597fe678 by wuzhe

camt10700101修改52B域

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