Commit c6bd0fb7 by miniphoto

202、202cov合并代码

parent bd4d2a15
package com.prowidesoftware.brilliance.mx2mt.mt202cov202; package com.prowidesoftware.brilliance.mx2mt.mt202cov202;
import com.prowidesoftware.brilliance.constants.Mx2MtConstants;
import com.prowidesoftware.brilliance.mx2mt.AbstractMx2MtCreator; import com.prowidesoftware.brilliance.mx2mt.AbstractMx2MtCreator;
import com.prowidesoftware.brilliance.mx2mt.Mx2MtFieldsGenerate; import com.prowidesoftware.brilliance.mx2mt.Mx2MtFieldsGenerate;
import com.prowidesoftware.brilliance.mx2mt.mt202cov202.impl.*; import com.prowidesoftware.brilliance.mx2mt.mt202cov202.impl.*;
...@@ -30,24 +28,14 @@ public class Mx2Mt202Creator extends AbstractMx2MtCreator { ...@@ -30,24 +28,14 @@ public class Mx2Mt202Creator extends AbstractMx2MtCreator {
fieldsGenerateList.add(new Field13CGenerate()); fieldsGenerateList.add(new Field13CGenerate());
fieldsGenerateList.add(new Field32AGenerate()); fieldsGenerateList.add(new Field32AGenerate());
fieldsGenerateList.add(new Field52AGenerate()); fieldsGenerateList.add(new Field52AGenerate());
fieldsGenerateList.add(new Field52DGenerate());
fieldsGenerateList.add(new Field53AGenerate()); fieldsGenerateList.add(new Field53AGenerate());
fieldsGenerateList.add(new Field53BGenerate());
fieldsGenerateList.add(new Field53DGenerate());
fieldsGenerateList.add(new Field54AGenerate()); fieldsGenerateList.add(new Field54AGenerate());
fieldsGenerateList.add(new Field54DGenerate());
fieldsGenerateList.add(new Field56AGenerate()); fieldsGenerateList.add(new Field56AGenerate());
fieldsGenerateList.add(new Field56DGenerate());
fieldsGenerateList.add(new Field57AGenerate()); fieldsGenerateList.add(new Field57AGenerate());
fieldsGenerateList.add(new Field57DGenerate());
fieldsGenerateList.add(new Field58AGenerate()); fieldsGenerateList.add(new Field58AGenerate());
fieldsGenerateList.add(new Field58DGenerate());
fieldsGenerateList.add(new Field72Generate()); fieldsGenerateList.add(new Field72Generate());
fieldsGenerateList.add(new Field50AGenerate()); fieldsGenerateList.add(new Field50AGenerate());
fieldsGenerateList.add(new Field50FGenerate());
fieldsGenerateList.add(new Field50KGenerate());
fieldsGenerateList.add(new FieldB52AGenerate()); fieldsGenerateList.add(new FieldB52AGenerate());
fieldsGenerateList.add(new FieldB52DGenerate());
fieldsGenerateList.add(new FieldB56Generate()); fieldsGenerateList.add(new FieldB56Generate());
fieldsGenerateList.add(new FieldB57Generate()); fieldsGenerateList.add(new FieldB57Generate());
fieldsGenerateList.add(new FieldB59Generate()); fieldsGenerateList.add(new FieldB59Generate());
...@@ -59,16 +47,15 @@ public class Mx2Mt202Creator extends AbstractMx2MtCreator { ...@@ -59,16 +47,15 @@ public class Mx2Mt202Creator extends AbstractMx2MtCreator {
@Override @Override
public String generateMtMsg() { public String generateMtMsg() {
map.forEach((key,value)->{ map.forEach((key,value)->{
if (!Mx2MtConstants.MX_OBJECT.equals(key)) { System.out.println(key + "-" + value);
logger.info(key + "-" + value);
}
}); });
if (getMtCov()){ if (getMtCov()){
map.put("isCov","202cov"); map.put("isCov","O202cov");
map.put("cov","{119:COV}");
}else{ }else{
map.put("isCov","202"); map.put("isCov","O202");
} }
String outPutFilePath = (String)map.get(Mx2MtConstants.OUT_PUT_FILE_PATH); String outPutFilePath = (String)map.get("outFilePath");
String msg = TemplateUtil.makeFileByTemplate("swift_mt_202cov.vm", map, outPutFilePath, "utf-8"); String msg = TemplateUtil.makeFileByTemplate("swift_mt_202cov.vm", map, outPutFilePath, "utf-8");
return msg; return msg;
} }
...@@ -92,19 +79,19 @@ public class Mx2Mt202Creator extends AbstractMx2MtCreator { ...@@ -92,19 +79,19 @@ public class Mx2Mt202Creator extends AbstractMx2MtCreator {
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getId() != null && cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getId() != null
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getId().getOrgId() != null && cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getId().getOrgId() != null
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getId().getOrgId().getBICOrBEI() != null){ && cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getId().getOrgId().getBICOrBEI() != null){
msg = true; msg = true;
} }
if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr() != null if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr() != null
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getId() != null && cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getId() != null
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getId().getOrgId() != null && cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getId().getOrgId() != null
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getId().getOrgId().getBICOrBEI() != null) { && cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getId().getOrgId().getBICOrBEI() != null) {
msg = true; msg = true;
} }
if (cdtTrfTxInf != null && cdtTrfTxInf.size() > 0 if (cdtTrfTxInf != null && cdtTrfTxInf.size() > 0
&& cdtTrfTxInf.get(0) != null && cdtTrfTxInf.get(0) != null
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf() != null && cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf() != null
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getNm() != null){ && cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getNm() != null){
msg = true; msg = true;
} }
return msg; return msg;
} catch(Exception e) { } catch(Exception e) {
...@@ -112,5 +99,5 @@ public class Mx2Mt202Creator extends AbstractMx2MtCreator { ...@@ -112,5 +99,5 @@ public class Mx2Mt202Creator extends AbstractMx2MtCreator {
return msg; return msg;
} }
} }
}
}
\ No newline at end of file
package com.prowidesoftware.brilliance.mx2mt.mt202cov202.impl; package com.prowidesoftware.brilliance.mx2mt.mt202cov202.impl;
import com.prowidesoftware.brilliance.exception.SwiftException; import com.prowidesoftware.brilliance.exception.SwiftException;
import com.prowidesoftware.brilliance.mx2mt.AbstractMx2MtFieldsGenerate; import com.prowidesoftware.brilliance.mx2mt.AbstractMx2MtFieldsGenerate;
import com.prowidesoftware.swift.model.mx.MxPacs00900102; import com.prowidesoftware.swift.model.mx.MxPacs00900102;
...@@ -21,7 +22,7 @@ import java.util.List; ...@@ -21,7 +22,7 @@ import java.util.List;
*/ */
public class Field52AGenerate extends AbstractMx2MtFieldsGenerate { public class Field52AGenerate extends AbstractMx2MtFieldsGenerate {
private static final Logger logger = LoggerFactory.getLogger(com.prowidesoftware.brilliance.mx2mt.mt202cov202.impl.Field52AGenerate.class); private static final Logger logger = LoggerFactory.getLogger(Field52AGenerate.class);
@Override @Override
public void fieldsGenerate() throws SwiftException { public void fieldsGenerate() throws SwiftException {
...@@ -40,20 +41,34 @@ public class Field52AGenerate extends AbstractMx2MtFieldsGenerate { ...@@ -40,20 +41,34 @@ public class Field52AGenerate extends AbstractMx2MtFieldsGenerate {
&& cdtTrfTxInf.get(0).getDbtr().getFinInstnId().getBIC() != null){ && cdtTrfTxInf.get(0).getDbtr().getFinInstnId().getBIC() != null){
map.put("field52Key","A"); map.put("field52Key","A");
map.put("field52A",cdtTrfTxInf.get(0).getDbtr().getFinInstnId().getBIC()); map.put("field52A",cdtTrfTxInf.get(0).getDbtr().getFinInstnId().getBIC());
if (cdtTrfTxInf.get(0) != null }else if (cdtTrfTxInf.get(0) != null
&& cdtTrfTxInf.get(0).getDbtrAcct() != null && cdtTrfTxInf.get(0).getDbtr() != null
&& cdtTrfTxInf.get(0).getDbtrAcct().getId() != null){ && cdtTrfTxInf.get(0).getDbtr().getFinInstnId() != null
if (cdtTrfTxInf.get(0).getDbtrAcct().getId().getIBAN() != null){ && cdtTrfTxInf.get(0).getDbtr().getFinInstnId().getNm() != null){
map.put("field52Account",cdtTrfTxInf.get(0).getDbtrAcct().getId().getIBAN()); map.put("field52Key","D");
}else if (cdtTrfTxInf.get(0).getDbtrAcct().getId().getOthr() != null if (cdtTrfTxInf.get(0).getDbtr().getFinInstnId().getPstlAdr() != null
&& cdtTrfTxInf.get(0).getDbtrAcct().getId().getOthr().getSchmeNm() != null && cdtTrfTxInf.get(0).getDbtr().getFinInstnId().getPstlAdr().getAdrLine() != null){
&& cdtTrfTxInf.get(0).getDbtrAcct().getId().getOthr().getSchmeNm().getCd() != null){ List<String> adrList = cdtTrfTxInf.get(0).getDbtr().getFinInstnId().getPstlAdr().getAdrLine();
if (cdtTrfTxInf.get(0).getDbtrAcct().getId().getOthr().getId() != null){ String adStr = "";
map.put("field52Account","//CH" + cdtTrfTxInf.get(0).getDbtrAcct().getId().getOthr().getId()); for (int i = 0; i<adrList.size(); i++){
} adStr = adStr + adrList.get(i);
}else if (cdtTrfTxInf.get(0).getDbtrAcct().getId().getOthr().getId() != null){ }
map.put("field52Account",cdtTrfTxInf.get(0).getDbtrAcct().getId().getOthr().getId()); map.put("field52DAdr",adStr);
}
}
if (cdtTrfTxInf.get(0) != null
&& cdtTrfTxInf.get(0).getDbtrAcct() != null
&& cdtTrfTxInf.get(0).getDbtrAcct().getId() != null){
if (cdtTrfTxInf.get(0).getDbtrAcct().getId().getIBAN() != null){
map.put("field52Account",cdtTrfTxInf.get(0).getDbtrAcct().getId().getIBAN());
}else if (cdtTrfTxInf.get(0).getDbtrAcct().getId().getOthr() != null
&& cdtTrfTxInf.get(0).getDbtrAcct().getId().getOthr().getSchmeNm() != null
&& cdtTrfTxInf.get(0).getDbtrAcct().getId().getOthr().getSchmeNm().getCd() != null){
if (cdtTrfTxInf.get(0).getDbtrAcct().getId().getOthr().getId() != null){
map.put("field52Account","//CH" + cdtTrfTxInf.get(0).getDbtrAcct().getId().getOthr().getId());
} }
}else if (cdtTrfTxInf.get(0).getDbtrAcct().getId().getOthr().getId() != null){
map.put("field52Account",cdtTrfTxInf.get(0).getDbtrAcct().getId().getOthr().getId());
} }
} }
} }
......
package com.prowidesoftware.brilliance.mx2mt.mt202cov202.impl; package com.prowidesoftware.brilliance.mx2mt.mt202cov202.impl;
import com.prowidesoftware.brilliance.exception.SwiftException; import com.prowidesoftware.brilliance.exception.SwiftException;
import com.prowidesoftware.brilliance.mx2mt.AbstractMx2MtFieldsGenerate; import com.prowidesoftware.brilliance.mx2mt.AbstractMx2MtFieldsGenerate;
import com.prowidesoftware.swift.model.mx.MxPacs00900102; import com.prowidesoftware.swift.model.mx.MxPacs00900102;
...@@ -8,6 +9,8 @@ import com.prowidesoftware.swift.model.mx.dic.GroupHeader35; ...@@ -8,6 +9,8 @@ import com.prowidesoftware.swift.model.mx.dic.GroupHeader35;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.util.List;
/** /**
* 1,若节点<BICFI>有值,则设置53 option为“A”,同时BIC取此栏位; * 1,若节点<BICFI>有值,则设置53 option为“A”,同时BIC取此栏位;
* 2,若节点<IBAN>有值,则作为53A的账号; * 2,若节点<IBAN>有值,则作为53A的账号;
...@@ -15,11 +18,20 @@ import org.slf4j.LoggerFactory; ...@@ -15,11 +18,20 @@ import org.slf4j.LoggerFactory;
* <GrpHdr><SttlmInf><InstgRmbrsmntAgt><FinInstnId><BICFI> * <GrpHdr><SttlmInf><InstgRmbrsmntAgt><FinInstnId><BICFI>
* <GrpHdr><SttlmInf><InstgRmbrsmntAgtAcct><Id><IBAN> * <GrpHdr><SttlmInf><InstgRmbrsmntAgtAcct><Id><IBAN>
* <GrpHdr><SttlmInf><InstgRmbrsmntAgtAcct><Id><Othr><Id> * <GrpHdr><SttlmInf><InstgRmbrsmntAgtAcct><Id><Othr><Id>
* <GrpHdr><SttlmInf><InstgRmbrsmntAgtAcct><Id><Othr><SchmeNm><Cd> * <GrpHdr><SttlmInf><InstgRmbrsmntAgtAcct><Id><Othr><SchmeNm><Cd> * 如果<SttlmAcct><Id><IBAN>或<SttlmAcct><Id><Othr><Id>有值,则设置53 option为“B”:
* * 1)若节点<IBAN>有值,则作为53B的账号;
* * 2)若节点<Othr><Id>有值,则作为53B的账号;
* * <GrpHdr><SttlmInf><SttlmAcct><Id><IBAN>
* * <GrpHdr><SttlmInf><SttlmAcct><Id><Othr><Id>
* * <GrpHdr><SttlmInf><SttlmAcct><Id><Othr><SchmeNm><Cd>
* * 1,若节点<Nm>有值,则设置53 option为“D”,且名称取自此节点,而地址需要合并截取???
* * 2,账号取值规则和节点与53A相同
* * <GrpHdr><SttlmInf><InstgRmbrsmntAgt><FinInstnId><Nm>
* * <GrpHdr><SttlmInf><InstgRmbrsmntAgt><FinInstnId><PstlAdr><AdrLine>[1],<AdrLine>[2],<AdrLine>[3]
*/ */
public class Field53AGenerate extends AbstractMx2MtFieldsGenerate { public class Field53AGenerate extends AbstractMx2MtFieldsGenerate {
private static final Logger logger = LoggerFactory.getLogger(com.prowidesoftware.brilliance.mx2mt.mt202cov202.impl.Field53AGenerate.class); private static final Logger logger = LoggerFactory.getLogger(Field53AGenerate.class);
@Override @Override
public void fieldsGenerate() throws SwiftException { public void fieldsGenerate() throws SwiftException {
...@@ -31,15 +43,48 @@ public class Field53AGenerate extends AbstractMx2MtFieldsGenerate { ...@@ -31,15 +43,48 @@ public class Field53AGenerate extends AbstractMx2MtFieldsGenerate {
} }
FinancialInstitutionCreditTransferV02 finInstnCdtTrf = obj.getFinInstnCdtTrf(); FinancialInstitutionCreditTransferV02 finInstnCdtTrf = obj.getFinInstnCdtTrf();
GroupHeader35 grpHdr = finInstnCdtTrf.getGrpHdr(); GroupHeader35 grpHdr = finInstnCdtTrf.getGrpHdr();
if (grpHdr != null){ if (grpHdr != null && grpHdr.getSttlmInf() != null){
if (grpHdr.getSttlmInf() != null if (grpHdr.getSttlmInf().getInstdRmbrsmntAgt() != null
&& grpHdr.getSttlmInf().getInstdRmbrsmntAgt() != null
&& grpHdr.getSttlmInf().getInstdRmbrsmntAgt().getFinInstnId() != null && grpHdr.getSttlmInf().getInstdRmbrsmntAgt().getFinInstnId() != null
&& grpHdr.getSttlmInf().getInstdRmbrsmntAgt().getFinInstnId().getBIC() != null){ && grpHdr.getSttlmInf().getInstdRmbrsmntAgt().getFinInstnId().getBIC() != null){
map.put("field53AKey","A"); map.put("field53AKey","A");
map.put("field53A",grpHdr.getSttlmInf().getInstgRmbrsmntAgt().getFinInstnId().getBIC()); map.put("field53A",grpHdr.getSttlmInf().getInstgRmbrsmntAgt().getFinInstnId().getBIC());
if (grpHdr.getSttlmInf() != null if (grpHdr.getSttlmInf().getInstgRmbrsmntAgtAcct() != null
&& grpHdr.getSttlmInf().getInstgRmbrsmntAgtAcct() != null && grpHdr.getSttlmInf().getInstgRmbrsmntAgtAcct().getId() != null){
if (grpHdr.getSttlmInf().getInstgRmbrsmntAgtAcct().getId().getIBAN() != null){
map.put("field53Account",grpHdr.getSttlmInf().getInstgRmbrsmntAgtAcct().getId().getIBAN());
}else if (grpHdr.getSttlmInf().getInstgRmbrsmntAgtAcct().getId().getOthr() != null
&& grpHdr.getSttlmInf().getInstgRmbrsmntAgtAcct().getId().getOthr().getId() != null){
map.put("field53Account",grpHdr.getSttlmInf().getInstgRmbrsmntAgtAcct().getId().getOthr().getId());
}
}
}else if (grpHdr.getSttlmInf().getSttlmAcct() != null
&& grpHdr.getSttlmInf().getSttlmAcct().getId() != null){
if (grpHdr.getSttlmInf().getSttlmAcct().getId().getIBAN() != null
|| (grpHdr.getSttlmInf().getSttlmAcct().getId().getOthr() != null
&& grpHdr.getSttlmInf().getSttlmAcct().getId().getOthr().getId() != null)){
map.put("field53BKey","B");
}
if (grpHdr.getSttlmInf().getSttlmAcct().getId().getIBAN() != null){
map.put("field53Account",grpHdr.getSttlmInf().getSttlmAcct().getId().getIBAN());
}else if (grpHdr.getSttlmInf().getSttlmAcct().getId().getOthr() != null
&& grpHdr.getSttlmInf().getSttlmAcct().getId().getOthr().getId() != null){
map.put("field53Account",grpHdr.getSttlmInf().getSttlmAcct().getId().getOthr().getId());
}
}else if (grpHdr.getSttlmInf().getInstgRmbrsmntAgt() != null
&& grpHdr.getSttlmInf().getInstgRmbrsmntAgt().getFinInstnId() != null
&& grpHdr.getSttlmInf().getInstgRmbrsmntAgt().getFinInstnId().getNm() != null){
map.put("field53DKey","D");
if (grpHdr.getSttlmInf().getInstgRmbrsmntAgt().getFinInstnId().getPstlAdr() != null
&& grpHdr.getSttlmInf().getInstgRmbrsmntAgt().getFinInstnId().getPstlAdr().getAdrLine() != null){
List<String> adrList = grpHdr.getSttlmInf().getInstgRmbrsmntAgt().getFinInstnId().getPstlAdr().getAdrLine();
String adStr = "";
for (int i = 0; i<adrList.size(); i++){
adStr = adStr + adrList.get(i);
}
map.put("field53Adr",adStr);
}
if (grpHdr.getSttlmInf().getInstgRmbrsmntAgtAcct() != null
&& grpHdr.getSttlmInf().getInstgRmbrsmntAgtAcct().getId() != null){ && grpHdr.getSttlmInf().getInstgRmbrsmntAgtAcct().getId() != null){
if (grpHdr.getSttlmInf().getInstgRmbrsmntAgtAcct().getId().getIBAN() != null){ if (grpHdr.getSttlmInf().getInstgRmbrsmntAgtAcct().getId().getIBAN() != null){
map.put("field53Account",grpHdr.getSttlmInf().getInstgRmbrsmntAgtAcct().getId().getIBAN()); map.put("field53Account",grpHdr.getSttlmInf().getInstgRmbrsmntAgtAcct().getId().getIBAN());
...@@ -49,6 +94,7 @@ public class Field53AGenerate extends AbstractMx2MtFieldsGenerate { ...@@ -49,6 +94,7 @@ public class Field53AGenerate extends AbstractMx2MtFieldsGenerate {
} }
} }
} }
} }
} catch(Exception e) { } catch(Exception e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
......
...@@ -8,6 +8,8 @@ import com.prowidesoftware.swift.model.mx.dic.GroupHeader35; ...@@ -8,6 +8,8 @@ import com.prowidesoftware.swift.model.mx.dic.GroupHeader35;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.util.List;
/** /**
* 1,若节点<BICFI>有值,则设置54 option为“A”,同时BIC取此栏位; * 1,若节点<BICFI>有值,则设置54 option为“A”,同时BIC取此栏位;
* 2,若节点<IBAN>有值,则作为54A的账号; * 2,若节点<IBAN>有值,则作为54A的账号;
...@@ -16,10 +18,15 @@ import org.slf4j.LoggerFactory; ...@@ -16,10 +18,15 @@ import org.slf4j.LoggerFactory;
* <GrpHdr><SttlmInf><InstdRmbrsmntAgtAcct><Id><IBAN> * <GrpHdr><SttlmInf><InstdRmbrsmntAgtAcct><Id><IBAN>
* <GrpHdr><SttlmInf><InstdRmbrsmntAgtAcct><Id><Othr><Id> * <GrpHdr><SttlmInf><InstdRmbrsmntAgtAcct><Id><Othr><Id>
* <GrpHdr><SttlmInf><InstdRmbrsmntAgtAcct><Id><Othr><SchmeNm><Cd> * <GrpHdr><SttlmInf><InstdRmbrsmntAgtAcct><Id><Othr><SchmeNm><Cd>
* 1,若节点<Nm>有值,则设置54 option为“D”,且名称取自此节点,而地址需要合并截取???
* * 2,账号取值规则和节点与54A相同
* * <GrpHdr><SttlmInf><InstdRmbrsmntAgt><FinInstnId><Nm>
* * <GrpHdr><SttlmInf><InstdRmbrsmntAgt><FinInstnId><PstlAdr><AdrLine>[1],<AdrLine>[2],<AdrLine>[3]
*
*/ */
public class Field54AGenerate extends AbstractMx2MtFieldsGenerate { public class Field54AGenerate extends AbstractMx2MtFieldsGenerate {
private static final Logger logger = LoggerFactory.getLogger(com.prowidesoftware.brilliance.mx2mt.mt202cov202.impl.Field54AGenerate.class); private static final Logger logger = LoggerFactory.getLogger(Field54AGenerate.class);
@Override @Override
public void fieldsGenerate() throws SwiftException { public void fieldsGenerate() throws SwiftException {
...@@ -31,22 +38,33 @@ public class Field54AGenerate extends AbstractMx2MtFieldsGenerate { ...@@ -31,22 +38,33 @@ public class Field54AGenerate extends AbstractMx2MtFieldsGenerate {
} }
FinancialInstitutionCreditTransferV02 finInstnCdtTrf = obj.getFinInstnCdtTrf(); FinancialInstitutionCreditTransferV02 finInstnCdtTrf = obj.getFinInstnCdtTrf();
GroupHeader35 grpHdr = finInstnCdtTrf.getGrpHdr(); GroupHeader35 grpHdr = finInstnCdtTrf.getGrpHdr();
if (grpHdr != null){ if (grpHdr != null && grpHdr.getSttlmInf() != null){
if (grpHdr.getSttlmInf() != null if (grpHdr.getSttlmInf().getInstdRmbrsmntAgt() != null
&& grpHdr.getSttlmInf().getInstdRmbrsmntAgt() != null
&& grpHdr.getSttlmInf().getInstdRmbrsmntAgt().getFinInstnId() != null && grpHdr.getSttlmInf().getInstdRmbrsmntAgt().getFinInstnId() != null
&& grpHdr.getSttlmInf().getInstdRmbrsmntAgt().getFinInstnId().getBIC() != null){ && grpHdr.getSttlmInf().getInstdRmbrsmntAgt().getFinInstnId().getBIC() != null){
map.put("field54AKey","A"); map.put("field54AKey","A");
map.put("field54A",grpHdr.getSttlmInf().getInstdRmbrsmntAgt().getFinInstnId().getBIC()); map.put("field54A",grpHdr.getSttlmInf().getInstdRmbrsmntAgt().getFinInstnId().getBIC());
if (grpHdr.getSttlmInf() != null }else if (grpHdr.getSttlmInf().getInstdRmbrsmntAgt() != null
&& grpHdr.getSttlmInf().getInstdRmbrsmntAgtAcct() != null && grpHdr.getSttlmInf().getInstdRmbrsmntAgt().getFinInstnId() != null
&& grpHdr.getSttlmInf().getInstdRmbrsmntAgtAcct().getId() != null){ && grpHdr.getSttlmInf().getInstdRmbrsmntAgt().getFinInstnId().getNm() != null){
if (grpHdr.getSttlmInf().getInstdRmbrsmntAgtAcct().getId().getIBAN() != null){ map.put("field54DKey","D");
map.put("field54Account",grpHdr.getSttlmInf().getInstdRmbrsmntAgtAcct().getId().getIBAN()); if (grpHdr.getSttlmInf().getInstdRmbrsmntAgt().getFinInstnId().getPstlAdr() != null
}else if (grpHdr.getSttlmInf().getInstdRmbrsmntAgtAcct().getId().getOthr() != null && grpHdr.getSttlmInf().getInstdRmbrsmntAgt().getFinInstnId().getPstlAdr().getAdrLine() != null){
&& grpHdr.getSttlmInf().getInstdRmbrsmntAgtAcct().getId().getOthr().getId() != null){ List<String> adrList = grpHdr.getSttlmInf().getInstdRmbrsmntAgt().getFinInstnId().getPstlAdr().getAdrLine();
map.put("field54Account",grpHdr.getSttlmInf().getInstdRmbrsmntAgtAcct().getId().getOthr().getId()); String adStr = "";
for (int i = 0; i<adrList.size(); i++){
adStr = adStr + adrList.get(i);
} }
map.put("field54Adr",adStr);
}
}
if (grpHdr.getSttlmInf().getInstdRmbrsmntAgtAcct() != null
&& grpHdr.getSttlmInf().getInstdRmbrsmntAgtAcct().getId() != null){
if (grpHdr.getSttlmInf().getInstdRmbrsmntAgtAcct().getId().getIBAN() != null){
map.put("field54Account",grpHdr.getSttlmInf().getInstdRmbrsmntAgtAcct().getId().getIBAN());
}else if (grpHdr.getSttlmInf().getInstdRmbrsmntAgtAcct().getId().getOthr() != null
&& grpHdr.getSttlmInf().getInstdRmbrsmntAgtAcct().getId().getOthr().getId() != null){
map.put("field54Account",grpHdr.getSttlmInf().getInstdRmbrsmntAgtAcct().getId().getOthr().getId());
} }
} }
} }
......
...@@ -2,7 +2,6 @@ package com.prowidesoftware.brilliance.mx2mt.mt202cov202.impl; ...@@ -2,7 +2,6 @@ package com.prowidesoftware.brilliance.mx2mt.mt202cov202.impl;
import com.prowidesoftware.brilliance.exception.SwiftException; import com.prowidesoftware.brilliance.exception.SwiftException;
import com.prowidesoftware.brilliance.mx2mt.AbstractMx2MtFieldsGenerate; import com.prowidesoftware.brilliance.mx2mt.AbstractMx2MtFieldsGenerate;
import com.prowidesoftware.brilliance.mx2mt.AbstractMx2MtFieldsGenerate;
import com.prowidesoftware.swift.model.mx.MxPacs00900102; import com.prowidesoftware.swift.model.mx.MxPacs00900102;
import com.prowidesoftware.swift.model.mx.dic.CreditTransferTransactionInformation13; import com.prowidesoftware.swift.model.mx.dic.CreditTransferTransactionInformation13;
import com.prowidesoftware.swift.model.mx.dic.FinancialInstitutionCreditTransferV02; import com.prowidesoftware.swift.model.mx.dic.FinancialInstitutionCreditTransferV02;
...@@ -19,10 +18,14 @@ import java.util.List; ...@@ -19,10 +18,14 @@ import java.util.List;
* <CdtTrfTxInf>[1]<IntrmyAgt1Acct><Id><IBAN> * <CdtTrfTxInf>[1]<IntrmyAgt1Acct><Id><IBAN>
* <CdtTrfTxInf>[1]<IntrmyAgt1Acct><Id><Othr><Id> * <CdtTrfTxInf>[1]<IntrmyAgt1Acct><Id><Othr><Id>
* <CdtTrfTxInf>[1]<IntrmyAgt1Acct><Id><Othr><SchmeNm><Cd> * <CdtTrfTxInf>[1]<IntrmyAgt1Acct><Id><Othr><SchmeNm><Cd>
* * 1,若节点<Nm>有值,则设置56 option为“D”,且名称取自此节点,而地址需要合并截取???
* * 2,账号取值规则和节点与56A相同
* * <CdtTrfTxInf>[1]<IntrmyAgt1><FinInstnId><Nm>
* * <CdtTrfTxInf>[1]<IntrmyAgt1><FinInstnId><PstlAdr><AdrLine>[1],<AdrLine>[2],<AdrLine>[3]
*/ */
public class Field56AGenerate extends AbstractMx2MtFieldsGenerate { public class Field56AGenerate extends AbstractMx2MtFieldsGenerate {
private static final Logger logger = LoggerFactory.getLogger(com.prowidesoftware.brilliance.mx2mt.mt202cov202.impl.Field56AGenerate.class); private static final Logger logger = LoggerFactory.getLogger(Field56AGenerate.class);
@Override @Override
public void fieldsGenerate() throws SwiftException { public void fieldsGenerate() throws SwiftException {
...@@ -42,15 +45,29 @@ public class Field56AGenerate extends AbstractMx2MtFieldsGenerate { ...@@ -42,15 +45,29 @@ public class Field56AGenerate extends AbstractMx2MtFieldsGenerate {
map.put("field56AKey","A"); map.put("field56AKey","A");
map.put("field56A",cdtTrfTxInf.get(0).getIntrmyAgt1().getFinInstnId().getBIC()); map.put("field56A",cdtTrfTxInf.get(0).getIntrmyAgt1().getFinInstnId().getBIC());
} }
if (cdtTrfTxInf.get(0) != null }else if (cdtTrfTxInf.get(0) != null
&& cdtTrfTxInf.get(0).getIntrmyAgt1Acct() != null && cdtTrfTxInf.get(0).getIntrmyAgt1() != null
&& cdtTrfTxInf.get(0).getIntrmyAgt1Acct().getId() != null){ && cdtTrfTxInf.get(0).getIntrmyAgt1().getFinInstnId() != null
if (cdtTrfTxInf.get(0).getIntrmyAgt1Acct().getId().getIBAN() != null){ && cdtTrfTxInf.get(0).getIntrmyAgt1().getFinInstnId().getNm() != null){
map.put("field56Account",cdtTrfTxInf.get(0).getIntrmyAgt1Acct().getId().getIBAN()); map.put("field56DKey","D");
}else if (cdtTrfTxInf.get(0).getIntrmyAgt1Acct().getId().getOthr() != null if (cdtTrfTxInf.get(0).getIntrmyAgt1().getFinInstnId().getPstlAdr() != null
&& cdtTrfTxInf.get(0).getIntrmyAgt1Acct().getId().getOthr().getId() != null){ && cdtTrfTxInf.get(0).getIntrmyAgt1().getFinInstnId().getPstlAdr().getAdrLine() != null){
map.put("field56Account",cdtTrfTxInf.get(0).getIntrmyAgt1Acct().getId().getOthr().getId()); List<String> adrList = cdtTrfTxInf.get(0).getIntrmyAgt1().getFinInstnId().getPstlAdr().getAdrLine();
String adStr = "";
for (int i = 0; i<adrList.size(); i++){
adStr = adStr + adrList.get(i);
} }
map.put("field56Adr",adStr);
}
}
if (cdtTrfTxInf.get(0) != null
&& cdtTrfTxInf.get(0).getIntrmyAgt1Acct() != null
&& cdtTrfTxInf.get(0).getIntrmyAgt1Acct().getId() != null){
if (cdtTrfTxInf.get(0).getIntrmyAgt1Acct().getId().getIBAN() != null){
map.put("field56Account",cdtTrfTxInf.get(0).getIntrmyAgt1Acct().getId().getIBAN());
}else if (cdtTrfTxInf.get(0).getIntrmyAgt1Acct().getId().getOthr() != null
&& cdtTrfTxInf.get(0).getIntrmyAgt1Acct().getId().getOthr().getId() != null){
map.put("field56Account",cdtTrfTxInf.get(0).getIntrmyAgt1Acct().getId().getOthr().getId());
} }
} }
} catch(Exception e) { } catch(Exception e) {
......
...@@ -18,10 +18,14 @@ import java.util.List; ...@@ -18,10 +18,14 @@ import java.util.List;
* <CdtTrfTxInf>[1]<CdtrAgtAcct><Id><IBAN> * <CdtTrfTxInf>[1]<CdtrAgtAcct><Id><IBAN>
* <CdtTrfTxInf>[1]<CdtrAgtAcct><Id><Othr><Id> * <CdtTrfTxInf>[1]<CdtrAgtAcct><Id><Othr><Id>
* <CdtTrfTxInf>[1]<CdtrAgtAcct><Id><Othr><SchmeNm><Cd> * <CdtTrfTxInf>[1]<CdtrAgtAcct><Id><Othr><SchmeNm><Cd>
* * 1,若节点<Nm>有值,则设置57 option为“D”,且名称取自此节点,而地址需要合并截取???
* * 2,账号取值规则和节点与57A相同
* * <CdtTrfTxInf>[1]<CdtrAgt><FinInstnId><Nm>
* * <CdtTrfTxInf>[1]<CdtrAgt><FinInstnId><PstlAdr><AdrLine>[1],<AdrLine>[2],<AdrLine>[3]
*/ */
public class Field57AGenerate extends AbstractMx2MtFieldsGenerate { public class Field57AGenerate extends AbstractMx2MtFieldsGenerate {
private static final Logger logger = LoggerFactory.getLogger(com.prowidesoftware.brilliance.mx2mt.mt202cov202.impl.Field57AGenerate.class); private static final Logger logger = LoggerFactory.getLogger(Field57AGenerate.class);
@Override @Override
public void fieldsGenerate() throws SwiftException { public void fieldsGenerate() throws SwiftException {
...@@ -40,15 +44,29 @@ public class Field57AGenerate extends AbstractMx2MtFieldsGenerate { ...@@ -40,15 +44,29 @@ public class Field57AGenerate extends AbstractMx2MtFieldsGenerate {
&& cdtTrfTxInf.get(0).getCdtrAgt().getFinInstnId().getBIC() != null){ && cdtTrfTxInf.get(0).getCdtrAgt().getFinInstnId().getBIC() != null){
map.put("field57AKey","A"); map.put("field57AKey","A");
map.put("field57A",cdtTrfTxInf.get(0).getCdtrAgt().getFinInstnId().getBIC()); map.put("field57A",cdtTrfTxInf.get(0).getCdtrAgt().getFinInstnId().getBIC());
if (cdtTrfTxInf.get(0) != null }else if (cdtTrfTxInf.get(0) != null
&& cdtTrfTxInf.get(0).getCdtrAgtAcct() != null && cdtTrfTxInf.get(0).getCdtrAgt() != null
&& cdtTrfTxInf.get(0).getCdtrAgtAcct().getId() != null){ && cdtTrfTxInf.get(0).getCdtrAgt().getFinInstnId() != null
if (cdtTrfTxInf.get(0).getCdtrAgtAcct().getId().getIBAN() != null){ && cdtTrfTxInf.get(0).getCdtrAgt().getFinInstnId().getNm() != null){
map.put("field57Account",cdtTrfTxInf.get(0).getCdtrAgtAcct().getId().getIBAN()); map.put("field57DKey","D");
}else if (cdtTrfTxInf.get(0).getCdtrAgtAcct().getId().getOthr() != null if (cdtTrfTxInf.get(0).getCdtrAgt().getFinInstnId().getPstlAdr() != null
&& cdtTrfTxInf.get(0).getCdtrAgtAcct().getId().getOthr().getId() != null){ && cdtTrfTxInf.get(0).getCdtrAgt().getFinInstnId().getPstlAdr().getAdrLine() != null){
map.put("field57Account",cdtTrfTxInf.get(0).getCdtrAgtAcct().getId().getOthr().getId()); List<String> adrList = cdtTrfTxInf.get(0).getCdtrAgt().getFinInstnId().getPstlAdr().getAdrLine();
String adStr = "";
for (int i = 0; i<adrList.size(); i++){
adStr = adStr + adrList.get(i);
} }
map.put("field57Adr",adStr);
}
}
if (cdtTrfTxInf.get(0) != null
&& cdtTrfTxInf.get(0).getCdtrAgtAcct() != null
&& cdtTrfTxInf.get(0).getCdtrAgtAcct().getId() != null){
if (cdtTrfTxInf.get(0).getCdtrAgtAcct().getId().getIBAN() != null){
map.put("field57Account",cdtTrfTxInf.get(0).getCdtrAgtAcct().getId().getIBAN());
}else if (cdtTrfTxInf.get(0).getCdtrAgtAcct().getId().getOthr() != null
&& cdtTrfTxInf.get(0).getCdtrAgtAcct().getId().getOthr().getId() != null){
map.put("field57Account",cdtTrfTxInf.get(0).getCdtrAgtAcct().getId().getOthr().getId());
} }
} }
} }
......
...@@ -18,10 +18,14 @@ import java.util.List; ...@@ -18,10 +18,14 @@ import java.util.List;
* <CdtTrfTxInf>[1]<CdtrAcct><Id><IBAN> * <CdtTrfTxInf>[1]<CdtrAcct><Id><IBAN>
* <CdtTrfTxInf>[1]<CdtrAcct><Id><Othr><Id> * <CdtTrfTxInf>[1]<CdtrAcct><Id><Othr><Id>
* <CdtTrfTxInf>[1]<CdtrAcct><Id><Othr><SchmeNm><Cd> * <CdtTrfTxInf>[1]<CdtrAcct><Id><Othr><SchmeNm><Cd>
* * 1,若节点<Nm>有值,则设置58 option为“D”,且名称取自此节点,而地址需要合并截取???
* * 2,账号取值规则和节点与58A相同
* * <CdtTrfTxInf>[1]<Cdtr><FinInstnId><Nm>
* * <CdtTrfTxInf>[1]<Cdtr><FinInstnId><PstlAdr><AdrLine>[1],<AdrLine>[2],<AdrLine>[3]
*/ */
public class Field58AGenerate extends AbstractMx2MtFieldsGenerate { public class Field58AGenerate extends AbstractMx2MtFieldsGenerate {
private static final Logger logger = LoggerFactory.getLogger(com.prowidesoftware.brilliance.mx2mt.mt202cov202.impl.Field58AGenerate.class); private static final Logger logger = LoggerFactory.getLogger(Field58AGenerate.class);
@Override @Override
public void fieldsGenerate() throws SwiftException { public void fieldsGenerate() throws SwiftException {
...@@ -40,15 +44,29 @@ public class Field58AGenerate extends AbstractMx2MtFieldsGenerate { ...@@ -40,15 +44,29 @@ public class Field58AGenerate extends AbstractMx2MtFieldsGenerate {
&& cdtTrfTxInf.get(0).getCdtr().getFinInstnId().getBIC() != null){ && cdtTrfTxInf.get(0).getCdtr().getFinInstnId().getBIC() != null){
map.put("field58AKey","A"); map.put("field58AKey","A");
map.put("field58A",cdtTrfTxInf.get(0).getCdtr().getFinInstnId().getBIC()); map.put("field58A",cdtTrfTxInf.get(0).getCdtr().getFinInstnId().getBIC());
if (cdtTrfTxInf.get(0) != null }else if (cdtTrfTxInf.get(0) != null
&& cdtTrfTxInf.get(0).getCdtrAcct() != null && cdtTrfTxInf.get(0).getCdtr() != null
&& cdtTrfTxInf.get(0).getCdtrAcct().getId() != null){ && cdtTrfTxInf.get(0).getCdtr().getFinInstnId() != null
if (cdtTrfTxInf.get(0).getCdtrAcct().getId().getIBAN() != null){ && cdtTrfTxInf.get(0).getCdtr().getFinInstnId().getNm() != null){
map.put("field58Account",cdtTrfTxInf.get(0).getCdtrAcct().getId().getIBAN()); map.put("field58DKey","D");
}else if (cdtTrfTxInf.get(0).getCdtrAcct().getId().getOthr() != null if (cdtTrfTxInf.get(0).getCdtr().getFinInstnId().getPstlAdr() != null
&& cdtTrfTxInf.get(0).getCdtrAcct().getId().getOthr().getId() != null){ && cdtTrfTxInf.get(0).getCdtr().getFinInstnId().getPstlAdr().getAdrLine() != null){
map.put("field58Account",cdtTrfTxInf.get(0).getCdtrAcct().getId().getOthr().getId()); List<String> adrList = cdtTrfTxInf.get(0).getCdtr().getFinInstnId().getPstlAdr().getAdrLine();
String adStr = "";
for (int i = 0; i<adrList.size(); i++){
adStr = adStr + adrList.get(i);
} }
map.put("field58Adr",adStr);
}
}
if (cdtTrfTxInf.get(0) != null
&& cdtTrfTxInf.get(0).getCdtrAcct() != null
&& cdtTrfTxInf.get(0).getCdtrAcct().getId() != null){
if (cdtTrfTxInf.get(0).getCdtrAcct().getId().getIBAN() != null){
map.put("field58Account",cdtTrfTxInf.get(0).getCdtrAcct().getId().getIBAN());
}else if (cdtTrfTxInf.get(0).getCdtrAcct().getId().getOthr() != null
&& cdtTrfTxInf.get(0).getCdtrAcct().getId().getOthr().getId() != null){
map.put("field58Account",cdtTrfTxInf.get(0).getCdtrAcct().getId().getOthr().getId());
} }
} }
} }
......
...@@ -13,7 +13,7 @@ public class SenderBicFieldGenerate extends AbstractMx2MtFieldsGenerate { ...@@ -13,7 +13,7 @@ public class SenderBicFieldGenerate extends AbstractMx2MtFieldsGenerate {
private static final Logger logger = LoggerFactory.getLogger(ReceiverBicFieldGenerate.class); private static final Logger logger = LoggerFactory.getLogger(ReceiverBicFieldGenerate.class);
/** /**
* <GrpHdr><InstgAgt><FinInstnId><BICFI> * <GrpHdr><InstdAgt><FinInstnId><BICFI>
*/ */
@Override @Override
public void fieldsGenerate() { public void fieldsGenerate() {
...@@ -26,9 +26,9 @@ public class SenderBicFieldGenerate extends AbstractMx2MtFieldsGenerate { ...@@ -26,9 +26,9 @@ public class SenderBicFieldGenerate extends AbstractMx2MtFieldsGenerate {
GroupHeader35 grpHdr = obj.getFinInstnCdtTrf().getGrpHdr(); GroupHeader35 grpHdr = obj.getFinInstnCdtTrf().getGrpHdr();
if (grpHdr != null) { if (grpHdr != null) {
if (grpHdr.getInstgAgt() != null if (grpHdr.getInstgAgt() != null
&& grpHdr.getInstgAgt().getFinInstnId() != null && grpHdr.getInstdAgt().getFinInstnId() != null
&& grpHdr.getInstgAgt().getFinInstnId().getBIC() != null){ && grpHdr.getInstdAgt().getFinInstnId().getBIC() != null){
String receiverBic = grpHdr.getInstgAgt().getFinInstnId().getBIC(); String receiverBic = grpHdr.getInstdAgt().getFinInstnId().getBIC();
logger.info("Sender Bic : " + receiverBic); logger.info("Sender Bic : " + receiverBic);
if (!StringUtil.isEmpty(receiverBic)) { if (!StringUtil.isEmpty(receiverBic)) {
String mtsenderBic = ""; String mtsenderBic = "";
......
...@@ -18,6 +18,12 @@ import java.util.List; ...@@ -18,6 +18,12 @@ import java.util.List;
* <CdtTrfTxInf>[1]<UndrlygCstmrCdtTrf><DbtrAcct><Id><IBAN> * <CdtTrfTxInf>[1]<UndrlygCstmrCdtTrf><DbtrAcct><Id><IBAN>
* <CdtTrfTxInf>[1]<UndrlygCstmrCdtTrf><DbtrAcct><Id><Othr><Id> * <CdtTrfTxInf>[1]<UndrlygCstmrCdtTrf><DbtrAcct><Id><Othr><Id>
* <CdtTrfTxInf>[1]<UndrlygCstmrCdtTrf><DbtrAcct><Id><Othr><SchmeNm><Cd> * <CdtTrfTxInf>[1]<UndrlygCstmrCdtTrf><DbtrAcct><Id><Othr><SchmeNm><Cd>
* * 1,待补充???
* * 2,账号取值规则与B\50A相同
* * 1,若<Dbtr><Nm>有录入,则设置B\50 option为“K”,且名称取自此节点,而地址需要合并截取???
* * 2,账号取值规则与B\50A相同
* * <CdtTrfTxInf>[1]<UndrlygCstmrCdtTrf><Dbtr><Nm>
* * <CdtTrfTxInf>[1]<UndrlygCstmrCdtTrf><Dbtr><PstlAdr><AdrLine>
*/ */
public class Field50AGenerate extends AbstractMx2MtFieldsGenerate { public class Field50AGenerate extends AbstractMx2MtFieldsGenerate {
...@@ -25,6 +31,7 @@ public class Field50AGenerate extends AbstractMx2MtFieldsGenerate { ...@@ -25,6 +31,7 @@ public class Field50AGenerate extends AbstractMx2MtFieldsGenerate {
@Override @Override
public void fieldsGenerate() throws SwiftException { public void fieldsGenerate() throws SwiftException {
// TODO 50F取值待补充
logger.info("Field50AGenerate start."); logger.info("Field50AGenerate start.");
try { try {
MxPacs00900102 obj = (MxPacs00900102)map.get("mxObj"); MxPacs00900102 obj = (MxPacs00900102)map.get("mxObj");
...@@ -42,6 +49,18 @@ public class Field50AGenerate extends AbstractMx2MtFieldsGenerate { ...@@ -42,6 +49,18 @@ public class Field50AGenerate extends AbstractMx2MtFieldsGenerate {
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getId().getOrgId().getBICOrBEI() != null){ && cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getId().getOrgId().getBICOrBEI() != null){
map.put("fieldB50Option","A"); map.put("fieldB50Option","A");
map.put("fieldB50A",cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getId().getOrgId().getBICOrBEI()); map.put("fieldB50A",cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getId().getOrgId().getBICOrBEI());
}else if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr() != null
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getNm() != null){
map.put("fieldB50Option","K");
if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getPstlAdr() != null
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getPstlAdr().getAdrLine() != null){
List<String> adrList = cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtr().getPstlAdr().getAdrLine();
String adStr = "";
for (int i = 0; i<adrList.size(); i++){
adStr = adStr + adrList.get(i);
}
map.put("fieldB50K",adStr);
}
} }
if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAcct() != null if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAcct() != null
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAcct().getId() != null){ && cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAcct().getId() != null){
......
...@@ -18,6 +18,10 @@ import java.util.List; ...@@ -18,6 +18,10 @@ import java.util.List;
* <CdtTrfTxInf>[1]<UndrlygCstmrCdtTrf><DbtrAgtAcct><Id><IBAN> * <CdtTrfTxInf>[1]<UndrlygCstmrCdtTrf><DbtrAgtAcct><Id><IBAN>
* <CdtTrfTxInf>[1]<UndrlygCstmrCdtTrf><DbtrAgtAcct><Id><Othr><Id> * <CdtTrfTxInf>[1]<UndrlygCstmrCdtTrf><DbtrAgtAcct><Id><Othr><Id>
* <CdtTrfTxInf>[1]<UndrlygCstmrCdtTrf><DbtrAgtAcct><Id><Othr><SchmeNm><Cd> * <CdtTrfTxInf>[1]<UndrlygCstmrCdtTrf><DbtrAgtAcct><Id><Othr><SchmeNm><Cd>
* * 1,若节点<Nm>有值,则设置B\52 option为“D”,且名称取自此节点,而地址需要合并截取???
* * 2,账号取值规则和节点与B\52A相同
* * <CdtTrfTxInf>[1]<UndrlygCstmrCdtTrf><DbtrAgt><FinInstnId><Nm>
* * <CdtTrfTxInf>[1]<UndrlygCstmrCdtTrf><DbtrAgt><FinInstnId><PstlAdr><AdrLine>[1],<AdrLine>[2],<AdrLine>[3]
*/ */
public class FieldB52AGenerate extends AbstractMx2MtFieldsGenerate { public class FieldB52AGenerate extends AbstractMx2MtFieldsGenerate {
...@@ -41,19 +45,32 @@ public class FieldB52AGenerate extends AbstractMx2MtFieldsGenerate { ...@@ -41,19 +45,32 @@ public class FieldB52AGenerate extends AbstractMx2MtFieldsGenerate {
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgt().getFinInstnId().getBIC() != null){ && cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgt().getFinInstnId().getBIC() != null){
map.put("fieldB52Option","A"); map.put("fieldB52Option","A");
map.put("fieldB52A",cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgt().getFinInstnId().getBIC()); map.put("fieldB52A",cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgt().getFinInstnId().getBIC());
if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct() != null }else if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgt() != null
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId() != null){ && cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgt().getFinInstnId() != null
if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAcct().getId().getIBAN() != null){ && cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgt().getFinInstnId().getNm() != null){
map.put("fieldB52Account","/"+cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getIBAN()); map.put("fieldB52Option","D");
}else if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getOthr() != null if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgt().getFinInstnId().getPstlAdr() != null
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getOthr().getSchmeNm() != null && cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgt().getFinInstnId().getPstlAdr().getAdrLine() != null) {
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getOthr().getSchmeNm().getCd() != null){ List<String> adrList = cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgt().getFinInstnId().getPstlAdr().getAdrLine();
if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getOthr().getId() != null) { String adStr = "";
map.put("fieldB52Account", "//CH" + cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getOthr().getId()); for (int i = 0; i < adrList.size(); i++) {
} adStr = adStr + adrList.get(i);
}else if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getOthr().getId() != null){ }
map.put("fieldB52Account",cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getOthr().getId()); map.put("fieldB52D", adStr);
}
}
if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct() != null
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId() != null){
if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getIBAN() != null){
map.put("fieldB52Account","/"+cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getIBAN());
}else if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getOthr() != null
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getOthr().getSchmeNm() != null
&& cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getOthr().getSchmeNm().getCd() != null){
if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getOthr().getId() != null) {
map.put("fieldB52Account", "//CH" + cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getOthr().getId());
} }
}else if (cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getOthr().getId() != null){
map.put("fieldB52Account",cdtTrfTxInf.get(0).getUndrlygCstmrCdtTrf().getDbtrAgtAcct().getId().getOthr().getId());
} }
} }
} }
......
...@@ -68,6 +68,17 @@ ...@@ -68,6 +68,17 @@
</OrgId> </OrgId>
</Id> </Id>
</Dbtr> </Dbtr>
<DbtrAgtAcct>
<Id>
<IBAN>S15612345678012345</IBAN>
<Othr>
<Id>789465123132165</Id>
<SchmeNm>
<Cd>741852</Cd>
</SchmeNm>
</Othr>
</Id>
</DbtrAgtAcct>
<DbtrAgt> <DbtrAgt>
<FinInstnId> <FinInstnId>
<BIC>77777777777</BIC> <BIC>77777777777</BIC>
...@@ -97,6 +108,17 @@ ...@@ -97,6 +108,17 @@
</ClrSysMmbId> </ClrSysMmbId>
</FinInstnId> </FinInstnId>
</IntrmyAgt1> </IntrmyAgt1>
<IntrmyAgt1Acct>
<Id>
<IBAN>S15612345678012345</IBAN>
<Othr>
<Id>789465123132165</Id>
<SchmeNm>
<Cd>741852</Cd>
</SchmeNm>
</Othr>
</Id>
</IntrmyAgt1Acct>
<CdtrAgtAcct> <CdtrAgtAcct>
<Id> <Id>
<IBAN>S15612345678012345</IBAN> <IBAN>S15612345678012345</IBAN>
...@@ -158,6 +180,28 @@ ...@@ -158,6 +180,28 @@
</RmtInf> </RmtInf>
<InstdAmt Ccy="USD">393.17</InstdAmt> <InstdAmt Ccy="USD">393.17</InstdAmt>
</UndrlygCstmrCdtTrf> </UndrlygCstmrCdtTrf>
<CdtrAgtAcct>
<Id>
<IBAN>S15612345678012345</IBAN>
<Othr>
<Id>789465123132165</Id>
<SchmeNm>
<Cd>741852</Cd>
</SchmeNm>
</Othr>
</Id>
</CdtrAgtAcct>
<CdtrAcct>
<Id>
<IBAN>S15612345678012345</IBAN>
<Othr>
<Id>789465123132165</Id>
<SchmeNm>
<Cd>741852</Cd>
</SchmeNm>
</Othr>
</Id>
</CdtrAcct>
<PrvsInstgAgt> <PrvsInstgAgt>
<FinInstnId> <FinInstnId>
<BIC>5555555</BIC> <BIC>5555555</BIC>
......
{1:F01${vm.receiverBic}0001000001}{2:${vm.isCov}${vm.createTime}${vm.createDate}${vm.senderBic}0002000001${vm.outDate}${vm.outTime}N}{3:{108:178908658RSC1}{111:001}{121:9bc16ba2-76e0-4651-b225-3bae8552f17a}}{4: {1:F01${vm.receiverBic}0001000001}{2:${vm.isCov}${vm.createTime}${vm.createDate}${vm.senderBic}0002000001${vm.outDate}${vm.outTime}N}{3:{108:178908658RSC1}{111:001}{121:9bc16ba2-76e0-4651-b225-3bae8552f17a}#if(${vm.cov})
${vm.cov}#end}{4:
:20:$vm.field20 :20:$vm.field20
:21:$vm.field21 :21:$vm.field21
#if(!$null.isNull($vm.filed13CList) && $vm.filed13CList.size()!=0) #if(!$null.isNull($vm.filed13CList) && $vm.filed13CList.size()!=0)
...@@ -96,34 +97,34 @@ $vm.field58Account ...@@ -96,34 +97,34 @@ $vm.field58Account
#end #end
#if($vm.fieldB50Option=='A') #if($vm.fieldB50Option=='A')
#if($vm.field50A) #if($vm.field50A)
:B\50A:$vm.fieldB50A :50A:$vm.fieldB50A
#end #end
#if($vm.fieldB50Account) #if($vm.fieldB50Account)
$vm.fieldB50Account $vm.fieldB50Account
#end #end
#elseif($vm.fieldB50Option == 'F') #elseif($vm.fieldB50Option == 'F')
#if($vm.fieldB50F) #if($vm.fieldB50F)
:B\50F:$vm.fieldB50F :50F:$vm.fieldB50F
#end #end
#if($vm.fieldB50Account) #if($vm.fieldB50Account)
$vm.fieldB50Account $vm.fieldB50Account
#end #end
#elseif($vm.fieldB50Option == 'K') #elseif($vm.fieldB50Option == 'K')
#if($vm.fieldB50K) #if($vm.fieldB50K)
:B\50K:$vm.fieldB50K :50K:$vm.fieldB50K
#end #end
#if($vm.fieldB50Account) #if($vm.fieldB50Account)
$vm.fieldB50Account $vm.fieldB50Account
#end #end
#end #end
#if($vm.fieldB52Option=='A') #if($vm.fieldB52Option=='A')
:B\52A:$vm.fieldB52A :52A:$vm.fieldB52A
#if($vm.fieldB52Account) #if($vm.fieldB52Account)
$vm.fieldB52Account $vm.fieldB52Account
#end #end
#elseif($vm.fieldB52Option == 'D') #elseif($vm.fieldB52Option == 'D')
#if($vm.fieldB52D) #if($vm.fieldB52D)
:B\52D:$vm.fieldB52D :52D:$vm.fieldB52D
#end #end
#if($vm.fieldB52Account) #if($vm.fieldB52Account)
$vm.fieldB52Account $vm.fieldB52Account
...@@ -131,18 +132,18 @@ $vm.fieldB52Account ...@@ -131,18 +132,18 @@ $vm.fieldB52Account
#end #end
#if($vm.fieldB56Option=='A') #if($vm.fieldB56Option=='A')
#if($vm.fieldB56A) #if($vm.fieldB56A)
:B\56A:$vm.fieldB56A :56A:$vm.fieldB56A
#end #end
#if($vm.fieldB56Account) #if($vm.fieldB56Account)
$vm.fieldB56Account $vm.fieldB56Account
#end #end
#elseif($vm.fieldB56Option == 'C') #elseif($vm.fieldB56Option == 'C')
#if($vm.fieldB50Account) #if($vm.fieldB56Account)
:B\56C:$vm.fieldB50Account :56C:$vm.fieldB56Account
#end #end
#elseif($vm.fieldB56Option == 'D') #elseif($vm.fieldB56Option == 'D')
#if($vm.fieldB56D) #if($vm.fieldB56D)
:B\56K:$vm.fieldB56D :56K:$vm.fieldB56D
#end #end
#if($vm.fieldB56Account) #if($vm.fieldB56Account)
$vm.fieldB56Account $vm.fieldB56Account
...@@ -150,31 +151,31 @@ $vm.fieldB56Account ...@@ -150,31 +151,31 @@ $vm.fieldB56Account
#end #end
#if($vm.fieldB57Option=='A') #if($vm.fieldB57Option=='A')
#if($vm.fieldB57) #if($vm.fieldB57)
:B\57A:$vm.fieldB57 :57A:$vm.fieldB57
#end #end
#if($vm.fieldB57Account) #if($vm.fieldB57Account)
$vm.fieldB57Account $vm.fieldB57Account
#end #end
#elseif($vm.fieldB57Option == 'C') #elseif($vm.fieldB57Option == 'C')
#if($vm.fieldB57Account) #if($vm.fieldB57Account)
:B\57C:$vm.fieldB57Account :57C:$vm.fieldB57Account
#end #end
#elseif($vm.fieldB57Option == 'D') #elseif($vm.fieldB57Option == 'D')
#if($vm.fieldB57D) #if($vm.fieldB57D)
:B\57D:$vm.fieldB57D :57D:$vm.fieldB57D
#end #end
#if($vm.fieldB57Account) #if($vm.fieldB57Account)
$vm.fieldB57Account $vm.fieldB57Account
#end #end
#end #end
#if($vm.fieldB59Option=='') #if($vm.fieldB59Option=='')
:B\59:$vm.fieldB59 :59:$vm.fieldB59
#if($vm.fieldB59Account) #if($vm.fieldB59Account)
$vm.fieldB59Account $vm.fieldB59Account
#end #end
#elseif($vm.fieldB59Option == 'A') #elseif($vm.fieldB59Option == 'A')
#if($vm.fieldB59A) #if($vm.fieldB59A)
:B\59A:$vm.fieldB59A :59A:$vm.fieldB59A
#end #end
#if($vm.fieldB59Account) #if($vm.fieldB59Account)
$vm.fieldB59Account $vm.fieldB59Account
......
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