Commit d55b01d6 by wuzhe

camt10700101修改50A换行

parent c2a1a717
......@@ -23,29 +23,31 @@ public class Field50aGenerate extends AbstractMx2MtTagsGenerate {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/50a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String cheBIC = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.Pyer.Id.OrgId.AnyBIC");
String chePyerAcct = bodyHdrParentElementName + ".Chq.PyerAcct";
String chePyerPstCtry = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.Pyer.PstlAdr.Ctry");
int cheBIC = getXmlNodeCounts(bodyHdrParentElementName, document, "Chq.Pyer.Id.OrgId.AnyBIC");
int chePyerAcct = getXmlNodeCounts(bodyHdrParentElementName, document, "Chq.PyerAcct");
int chePyerPstCtry = getXmlNodeCounts(bodyHdrParentElementName, document, "Chq.Pyer.PstlAdr.Ctry");
String payerPath = bodyHdrParentElementName + ".Chq.Pyer";
String orgidOthr = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.Pyer.Id.OrgId.Othr");
String prvtidOthr = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.Pyer.Id.PrvtId.Othr");
int addressLineCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Chq.Pyer.PstlAdr.AdrLine");
String pstladrAdrline = "";
String pyerNm = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.Pyer.Nm");
int pyerNm = getXmlNodeCounts(bodyHdrParentElementName, document, "Chq.Pyer.Nm");
String account = "";
String nameAddress = "";
if (addressLineCount > 0){
pstladrAdrline = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.Pyer.PstlAdr.AdrLine(0)");
}
if (StringUtil.isNotEmpty(cheBIC)) {
if (cheBIC > 0) {
String bicCode = mx_to_mtAnyBIC(payerPath);
if (StringUtil.isNotEmpty(chePyerAcct)){
if (chePyerAcct > 0){
account = mx_to_mtAccount(bodyHdrParentElementName + ".Chq.PyerAcct");
}
tags.add(new Tag(name_50A, account + Mx2MtConstants.NEW_LINE + bicCode));
} else if (StringUtil.isNotEmpty(chePyerPstCtry)){
}else {
tags.add(new Tag(name_50A, bicCode));
}
} else if (chePyerPstCtry > 0){
nameAddress = mx_to_mtFATFNameAndAddress(payerPath);
if (StringUtil.isNotEmpty(chePyerAcct)) {
if (chePyerAcct > 0) {
account = mx_to_mtAccount(bodyHdrParentElementName + ".Chq.PyerAcct");
} else if (StringUtil.isNotEmpty(orgidOthr) || StringUtil.isNotEmpty(prvtidOthr)){
account = mx_to_mtFATFIdentification(payerPath, false);
......@@ -61,7 +63,7 @@ public class Field50aGenerate extends AbstractMx2MtTagsGenerate {
boolean structuredAddressIndicator = mx_to_mtAddressLineType(payerPath);
if (structuredAddressIndicator) {
nameAddress = mx_to_mtFATFNameAndAddress2(payerPath);
if (StringUtil.isNotEmpty(chePyerAcct)) {
if (chePyerAcct > 0) {
account = mx_to_mtAccount(bodyHdrParentElementName + ".Chq.PyerAcct");
} else if (StringUtil.isNotEmpty(orgidOthr) || StringUtil.isNotEmpty(prvtidOthr)){
account = mx_to_mtFATFIdentification(payerPath, true);
......@@ -75,14 +77,14 @@ public class Field50aGenerate extends AbstractMx2MtTagsGenerate {
tags.add(new Tag(name_50F, account + Mx2MtConstants.NEW_LINE + nameAddress));
} else {
nameAddress = mx_to_mtPartyNameAndUnstructuredAddress(payerPath);
if (StringUtil.isNotEmpty(chePyerAcct)){
if (chePyerAcct > 0){
account = mx_to_mtAccount(bodyHdrParentElementName + ".Chq.PyerAcct");
}
tags.add(new Tag(name_50K, account + Mx2MtConstants.NEW_LINE + nameAddress));
}
}else if (StringUtil.isNotEmpty(pyerNm)){
}else if (pyerNm > 0){
nameAddress = mx_to_mtPartyNameAndUnstructuredAddress(payerPath);
if (StringUtil.isNotEmpty(chePyerAcct)){
if (chePyerAcct > 0){
account = mx_to_mtAccount(bodyHdrParentElementName + ".Chq.PyerAcct");
}
tags.add(new Tag(name_50K, account + Mx2MtConstants.NEW_LINE + nameAddress));
......
......@@ -52,11 +52,12 @@
<!-- <Ctry>WEQWE</Ctry>-->
<!-- </PstlAdr>-->
</Pyer>
<PyerAcct>
<Id>
<IBAN>SSSS</IBAN>
</Id>
</PyerAcct>
<!--50A account-->
<!-- <PyerAcct>-->
<!-- <Id>-->
<!-- <IBAN>SSSS</IBAN>-->
<!-- </Id>-->
<!-- </PyerAcct>-->
<DrwrAgt>
<FinInstnId>QWERTYOII</FinInstnId>
</DrwrAgt>
......
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