Commit 1535e731 by chengzhuoshen

增加pacs009001平铺要素配置代码

parent a141ab2f
......@@ -10,6 +10,7 @@ import com.prowidesoftware.swift.model.mx.AbstractMX;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
......@@ -51,41 +52,24 @@ public abstract class AbstractMx2ElementCreator implements Mx2ElementCreator{
@Override
public Map<String, Object> buildElement() {
//AbstractMX abstractMX = AbstractMX.parse(xmlStr);
String messageType = abstractMX.getMxId().getBusinessProcess().name()
+ abstractMX.getMxId().getFunctionality()
+ abstractMX.getMxId().getVariant()
+ abstractMX.getMxId().getVersion();
maps.put("messageType", messageType);
String gsonStr = abstractMX.toJson();
Map<String, Object> mxGsonMaps = JSON.parseObject(gsonStr);
String fileName = "/template/"+messageType+".properties";
InputStream resourceAsStream = AbstractMx2ElementCreator.class.getResourceAsStream(fileName);
if (resourceAsStream == null) {
int versionLength = abstractMX.getMxId().getVersion().length();
fileName = "/template/"+messageType.substring(0, messageType.length()-versionLength)+".properties";
resourceAsStream = AbstractMx2ElementCreator.class.getResourceAsStream(fileName);
}
List<String> properties = StringUtil.inputStreamToLines(resourceAsStream);
if (properties.size() > 0) {
for (String property : properties) {
if (property.startsWith("#")) {
continue;//过滤注释
}
String[] strArr = property.split("=");
if (strArr.length != 2) {
continue;//过滤掉不符合规则的配置
}
String key = strArr[0];
String path = strArr[1];
Object value = getXmlValue(mxGsonMaps, path);
if (value != null) {
maps.put(key, value);
}
}
}
//AbstractMX abstractMX = AbstractMX.parse(xmlStr);
String messageType = abstractMX.getMxId().getBusinessProcess().name()
+ abstractMX.getMxId().getFunctionality()
+ abstractMX.getMxId().getVariant()
+ abstractMX.getMxId().getVersion();
maps.put("messageType", messageType);
String gsonStr = abstractMX.toJson();
Map<String, Object> mxGsonMaps = JSON.parseObject(gsonStr);
String fileName = "/template/"+messageType+".properties";
InputStream resourceAsStream = AbstractMx2ElementCreator.class.getResourceAsStream(fileName);
if (resourceAsStream == null) {
int versionLength = abstractMX.getMxId().getVersion().length();
fileName = "/template/"+messageType.substring(0, messageType.length()-versionLength)+".properties";
resourceAsStream = AbstractMx2ElementCreator.class.getResourceAsStream(fileName);
}
List<String> properties = StringUtil.inputStreamToLines(resourceAsStream);
readPropertyFile(mxGsonMaps, maps, properties);
return maps;
}
......@@ -114,33 +98,114 @@ public abstract class AbstractMx2ElementCreator implements Mx2ElementCreator{
Map<String, Object> tmpMaps = jsonMaps;
for (int i=0; i<paths.length; i++) {
String p = paths[i];
String subPropName = "";
if (p.indexOf("#") > -1) { //判断是否存在子配置文件的引用
int symbolIndex = p.indexOf("#");
subPropName = p.substring(symbolIndex + 1);
p = p.substring(0, symbolIndex);
}
Object obj = tmpMaps.get(p);
if (obj == null) return null;
if (obj instanceof JSONArray) {
JSONArray jsonArray = (JSONArray)obj;
if (i == paths.length-1) {
return jsonArray;
} else {
obj = jsonArray.get(0);
if (obj instanceof JSONObject) {
tmpMaps = (Map<String, Object>)obj; //不是最后一层
} else {
if (StringUtil.isNotEmpty(subPropName)) {
return readSubProp(obj, subPropName);
} else {
if (obj instanceof JSONArray) {
JSONArray jsonArray = (JSONArray)obj;
if (i == paths.length-1) {
return jsonArray;
} else { //不是最后一层
obj = jsonArray.get(0);
if (obj instanceof JSONObject) {
tmpMaps = (Map<String, Object>)obj;
} else {
return jsonArray;
}
}
}
} else if (obj instanceof JSONObject) {
tmpMaps = (Map<String, Object>)obj;
} else {
if ("bigdecimal".equals(type)) {
value = new BigDecimal(String.valueOf(obj));
} else if ("boolean".equals(type)) {
value = Boolean.valueOf(String.valueOf(obj));
} else if (obj instanceof JSONObject) {
tmpMaps = (Map<String, Object>)obj;
} else {
value = String.valueOf(obj);
if ("bigdecimal".equals(type)) {
value = new BigDecimal(String.valueOf(obj));
} else if ("boolean".equals(type)) {
value = Boolean.valueOf(String.valueOf(obj));
} else {
value = String.valueOf(obj);
}
break;
}
break;
}
}
return value;
}
/**
* 根据子配置文件名称读取相应的配置文件
* @param obj
* @param subPropName
* @return
*/
protected Object readSubProp(Object obj, String subPropName) {
String fileName = "/template/"+subPropName+".properties";
InputStream resourceAsStream = AbstractMx2ElementCreator.class.getResourceAsStream(fileName);
if (resourceAsStream == null) {
//找不到子配置文件 默认取subPropName节点的值
if (obj instanceof JSONArray) { //当前obj是JSONARRAY,需要循环获取subPropName节点值
JSONArray jsonArray = (JSONArray)obj;
List<String> list = new ArrayList<>();
for (int i=0; i<jsonArray.size(); i++) {
Object jsonObj = jsonArray.get(i);
if (jsonObj instanceof JSONObject) {
obj = ((Map<String, Object>)jsonObj).get(subPropName);
if (obj instanceof String) {
list.add(String.valueOf(obj));
}
}
}
return list;
}
return null;
}
List<String> properties = StringUtil.inputStreamToLines(resourceAsStream);
if (obj instanceof JSONArray) { //当前obj是JSONARRAY,需要循环获取子配置文件
JSONArray jsonArray = (JSONArray)obj;
List<Map<String, Object>> subMapList = new ArrayList<>();
for (int i=0; i<jsonArray.size(); i++) {
Object jsonObj = jsonArray.get(i);
if (jsonObj instanceof JSONObject) {
Map<String, Object> subMaps = new LinkedHashMap<>();
readPropertyFile((Map<String, Object>)jsonObj, subMaps, properties);
if (subMaps.size() > 0) {
subMapList.add(subMaps);
}
}
}
return subMapList;
} else if (obj instanceof JSONObject) { //当前对象是JSONOBJECT
Map<String, Object> subMaps = new LinkedHashMap<>();
readPropertyFile((Map<String, Object>)obj, subMaps, properties);
return subMaps;
}
return null;
}
protected void readPropertyFile(Map<String, Object> mxGsonMaps, Map<String, Object> targetMaps, List<String> properties) {
if (properties != null && properties.size() > 0) {
for (String property : properties) {
if (property.startsWith("#")) {
continue;//过滤注释
}
String[] strArr = property.split("=");
if (strArr.length != 2) {
continue;//过滤掉不符合规则的配置
}
String key = strArr[0].trim();
String path = strArr[1].trim();
Object value = getXmlValue(mxGsonMaps, path);
if (value != null) {
targetMaps.put(key, value);
}
}
}
}
}
......@@ -6,6 +6,7 @@ import com.brilliance.swift.mx2element.camt053001.Mx2ElementCamt053001Creator;
import com.brilliance.swift.mx2element.camt054001.Mx2ElementCamt054001Creator;
import com.brilliance.swift.mx2element.camt056001.Mx2ElementCamt056001Creator;
import com.brilliance.swift.mx2element.pacs008001.Mx2ElementPacs008001Creator;
import com.brilliance.swift.mx2element.pacs009001.Mx2ElementPacs009001Creator;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.prowidesoftware.swift.model.mx.AbstractMX;
......@@ -37,15 +38,16 @@ public class Mx2ElementCreatorManager {
return new Mx2ElementPacs008001Creator();
} else if("camt.054.001".equals(messageType)){
return new Mx2ElementCamt054001Creator();
}else if("camt.053.001".equals(messageType)){
} else if("camt.053.001".equals(messageType)){
return new Mx2ElementCamt053001Creator();
}else if("camt.029.001".equals(messageType)){
} else if("camt.029.001".equals(messageType)){
return new Mx2ElementCamt029001Creator();
}else if("camt.056.001".equals(messageType)){
} else if("camt.056.001".equals(messageType)){
return new Mx2ElementCamt056001Creator();
}
else {
throw new SwiftException("Invalid message type");
} else if("pacs.009.001".equals(messageType)){
return new Mx2ElementPacs009001Creator();
} else {
return new Mx2ElementDefaultCreator();
}
}
}
package com.brilliance.swift.mx2element;
public class Mx2ElementDefaultCreator extends AbstractMx2ElementCreator{
}
......@@ -102,7 +102,7 @@ public class Mx2ElementPacs008001Creator extends AbstractMx2ElementCreator {
}
}
public Object buildRmtInfStrdAddtlRmtInf() {
public Object buildStrdAddtlRmtInf() {
try {
Document document = DocumentHelper.parseText(xmlStr);
Map<String, String> parentElementMaps = XmlUtil.getParentElementMaps(document);
......
package com.brilliance.swift.mx2element.pacs009001;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2element.AbstractMx2ElementCreator;
import com.brilliance.swift.util.XmlUtil;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class Mx2ElementPacs009001Creator extends AbstractMx2ElementCreator {
@Override
public Map<String, Object> buildElement() {
return super.buildElement();
}
public Object buildStrdAddtlRmtInf() {
try {
Document document = DocumentHelper.parseText(xmlStr);
Map<String, String> parentElementMaps = XmlUtil.getParentElementMaps(document);
String bodyParentPath = parentElementMaps.get("CdtTrfTxInf");
List<String> list = new ArrayList<>();
int strdCount = XmlUtil.getChildrenCount(document, bodyParentPath+".CdtTrfTxInf.UndrlygCstmrCdtTrf.RmtInf.Strd", null);
if (strdCount > 0) {
for (int i=0; i<strdCount; i++) {
int addtlRmtInfCount = XmlUtil.getChildrenCount(document,bodyParentPath+".CdtTrfTxInf.UndrlygCstmrCdtTrf.RmtInf.Strd("+i+").AddtlRmtInf", null);
if (addtlRmtInfCount > 0) {
for (int j=0; j<addtlRmtInfCount; j++) {
String inf = XmlUtil.getXmlNodeValue(document, bodyParentPath+".CdtTrfTxInf.UndrlygCstmrCdtTrf.RmtInf.Strd("+i+").AddtlRmtInf("+j+")");
list.add(inf);
}
}
}
}
if (list.size() > 0) {
return list;
} else {
return null;
}
} catch (DocumentException e) {
throw new SwiftException(e.getMessage());
}
}
}
......@@ -81,6 +81,13 @@ Change Log
</Othr>
</Id>
</Acct>
<AcctOwnr>
<Agt>
<FinInstnId>
<BICFI>ABNANL2A</BICFI>
</FinInstnId>
</Agt>
</AcctOwnr>
<ReqdTxTp>
<Sts>
<Cd>PDNG</Cd>
......
......@@ -87,6 +87,11 @@ Change Log
</ChrgsInf>
<ChrgsInf>
<Amt Ccy="EUR">123</Amt>
<Agt>
<FinInstnId>
<BICFI>PSBCCNBJ</BICFI>
</FinInstnId>
</Agt>
</ChrgsInf>
<InstgAgt>
<FinInstnId>
......
......@@ -111,6 +111,15 @@ Change Log
<Ctry>FI</Ctry>
</PstlAdr>
</Cdtr>
<RmtInf>
<Strd>
<AddtlRmtInf>123</AddtlRmtInf>
<AddtlRmtInf>456</AddtlRmtInf>
</Strd>
<Strd>
<AddtlRmtInf>234</AddtlRmtInf>
</Strd>
</RmtInf>
</UndrlygCstmrCdtTrf>
</CdtTrfTxInf>
</FICdtTrf>
......
#61?????????list??,#entry?#?????????????(???)
#entry.propertie????????????????????????????????61?#?????
#??????????xml??????
#60,62,64???????bal?????????????????????????????????????????????????
#OPBD?60?CLBD?62?CLAV?64
#tp.cdOrPrtry.cd??????????????????OPBD????????
#APPLICATION HEADER
frBic=appHdr.fr.fiId.finInstnId.bicfi?appHdr.fr.orgId.id.orgId.anyBIC
toBic=appHdr.to.fiId.finInstnId.bicfi?appHdr.to.orgId.id.orgId.anyBIC
......
#case???????????????????
#APPLICATION HEADER
frBic=appHdr.fr.fiId.finInstnId.bicfi?appHdr.fr.orgId.id.orgId.anyBIC
toBic=appHdr.to.fiId.finInstnId.bicfi?appHdr.to.orgId.id.orgId.anyBIC
......
amt=amt.value&bigdecimal
ccy=amt.ccy
\ No newline at end of file
......@@ -40,7 +40,7 @@ instdAmt=fiToFICstmrCdtTrf.cdtTrfTxInf.instdAmt.value&bigdecimal
instdAmtCcy=fiToFICstmrCdtTrf.cdtTrfTxInf.instdAmt.ccy
xchgRate=fiToFICstmrCdtTrf.cdtTrfTxInf.xchgRate&bigdecimal
chrgBr=fiToFICstmrCdtTrf.cdtTrfTxInf.chrgBr
chrgInfo=@buildChrgInfo
chrgsInf=fiToFICstmrCdtTrf.cdtTrfTxInf.chrgsInf#chrgsInf
dbtrNm=fiToFICstmrCdtTrf.cdtTrfTxInf.dbtr.nm
dbtrOrgAnyBIC=fiToFICstmrCdtTrf.cdtTrfTxInf.dbtr.id.orgId.anyBIC
dbtrOrgLei=fiToFICstmrCdtTrf.cdtTrfTxInf.dbtr.id.orgId.lei
......@@ -387,14 +387,6 @@ prvsInstgAgt1BrnchPstlAdrTwnNm=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt1.brnch
prvsInstgAgt1BrnchPstlAdrPstBx=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt1.brnchId.pstlAdr.pstBx
prvsInstgAgt1BrnchPstlAdrPstCd=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt1.brnchId.pstlAdr.pstCd
prvsInstgAgt1BrnchAdrLines=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt1.brnchId.pstlAdr.adrLine
prvsInstgAgt1AcctIdIban=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt1Acct.id.iban
prvsInstgAgt1AcctId=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt1Acctid.othr.id
prvsInstgAgt1AcctIdType=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt1Acct.id.othr.schmeNm.cd
prvsInstgAgt1AcctIdTypePrtry=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt1Acct.id.othr.schmeNm.prtry
prvsInstgAgt1AcctType=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt1Acct.tp.cd
prvsInstgAgt1AcctTypePrtry=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt1Acct.tp.prtry
prvsInstgAgt1AcctCcy=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt1Acct.ccy
prvsInstgAgt1AcctNm=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt1Acct.nm
prvsInstgAgt2Bicfi=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt2.finInstnId.bicfi
prvsInstgAgt2ClrSysId=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt2.finInstnId.clrSysMmbId.mmbId
prvsInstgAgt2ClrSysIdType=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt2.finInstnId.clrSysMmbId.clrSysId.cd
......@@ -433,14 +425,6 @@ prvsInstgAgt2BrnchPstlAdrTwnNm=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt2.brnch
prvsInstgAgt2BrnchPstlAdrPstBx=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt2.brnchId.pstlAdr.pstBx
prvsInstgAgt2BrnchPstlAdrPstCd=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt2.brnchId.pstlAdr.pstCd
prvsInstgAgt2BrnchAdrLines=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt2.brnchId.pstlAdr.adrLine
prvsInstgAgt2AcctIdIban=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt2Acct.id.iban
prvsInstgAgt2AcctId=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt2Acctid.othr.id
prvsInstgAgt2AcctIdType=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt2Acct.id.othr.schmeNm.cd
prvsInstgAgt2AcctIdTypePrtry=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt2Acct.id.othr.schmeNm.prtry
prvsInstgAgt2AcctType=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt2Acct.tp.cd
prvsInstgAgt2AcctTypePrtry=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt2Acct.tp.prtry
prvsInstgAgt2AcctCcy=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt2Acct.ccy
prvsInstgAgt2AcctNm=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt2Acct.nm
prvsInstgAgt3Bicfi=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt3.finInstnId.bicfi
prvsInstgAgt3ClrSysId=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt3.finInstnId.clrSysMmbId.mmbId
prvsInstgAgt3ClrSysIdType=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt3.finInstnId.clrSysMmbId.clrSysId.cd
......@@ -479,14 +463,6 @@ prvsInstgAgt3BrnchPstlAdrTwnNm=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt3.brnch
prvsInstgAgt3BrnchPstlAdrPstBx=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt3.brnchId.pstlAdr.pstBx
prvsInstgAgt3BrnchPstlAdrPstCd=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt3.brnchId.pstlAdr.pstCd
prvsInstgAgt3BrnchAdrLines=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt3.brnchId.pstlAdr.adrLine
prvsInstgAgt3AcctIdIban=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt3Acct.id.iban
prvsInstgAgt3AcctId=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt3Acctid.othr.id
prvsInstgAgt3AcctIdType=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt3Acct.id.othr.schmeNm.cd
prvsInstgAgt3AcctIdTypePrtry=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt3Acct.id.othr.schmeNm.prtry
prvsInstgAgt3AcctType=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt3Acct.tp.cd
prvsInstgAgt3AcctTypePrtry=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt3Acct.tp.prtry
prvsInstgAgt3AcctCcy=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt3Acct.ccy
prvsInstgAgt3AcctNm=fiToFICstmrCdtTrf.cdtTrfTxInf.prvsInstgAgt3Acct.nm
intrmyAgt1Bicfi=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt1.finInstnId.bicfi
intrmyAgt1ClrSysId=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt1.finInstnId.clrSysMmbId.mmbId
intrmyAgt1ClrSysIdType=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt1.finInstnId.clrSysMmbId.clrSysId.cd
......@@ -525,14 +501,6 @@ intrmyAgt1BrnchPstlAdrTwnNm=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt1.brnchId.pst
intrmyAgt1BrnchPstlAdrPstBx=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt1.brnchId.pstlAdr.pstBx
intrmyAgt1BrnchPstlAdrPstCd=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt1.brnchId.pstlAdr.pstCd
intrmyAgt1BrnchAdrLines=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt1.brnchId.pstlAdr.adrLine
intrmyAgt1AcctIdIban=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt1Acct.id.iban
intrmyAgt1AcctId=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt1Acctid.othr.id
intrmyAgt1AcctIdType=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt1Acct.id.othr.schmeNm.cd
intrmyAgt1AcctIdTypePrtry=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt1Acct.id.othr.schmeNm.prtry
intrmyAgt1AcctType=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt1Acct.tp.cd
intrmyAgt1AcctTypePrtry=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt1Acct.tp.prtry
intrmyAgt1AcctCcy=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt1Acct.ccy
intrmyAgt1AcctNm=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt1Acct.nm
intrmyAgt2Bicfi=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt2.finInstnId.bicfi
intrmyAgt2ClrSysId=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt2.finInstnId.clrSysMmbId.mmbId
intrmyAgt2ClrSysIdType=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt2.finInstnId.clrSysMmbId.clrSysId.cd
......@@ -571,14 +539,6 @@ intrmyAgt2BrnchPstlAdrTwnNm=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt2.brnchId.pst
intrmyAgt2BrnchPstlAdrPstBx=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt2.brnchId.pstlAdr.pstBx
intrmyAgt2BrnchPstlAdrPstCd=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt2.brnchId.pstlAdr.pstCd
intrmyAgt2BrnchAdrLines=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt2.brnchId.pstlAdr.adrLine
intrmyAgt2AcctIdIban=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt2Acct.id.iban
intrmyAgt2AcctId=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt2Acctid.othr.id
intrmyAgt2AcctIdType=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt2Acct.id.othr.schmeNm.cd
intrmyAgt2AcctIdTypePrtry=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt2Acct.id.othr.schmeNm.prtry
intrmyAgt2AcctType=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt2Acct.tp.cd
intrmyAgt2AcctTypePrtry=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt2Acct.tp.prtry
intrmyAgt2AcctCcy=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt2Acct.ccy
intrmyAgt2AcctNm=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt2Acct.nm
intrmyAgt3Bicfi=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt3.finInstnId.bicfi
intrmyAgt3ClrSysId=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt3.finInstnId.clrSysMmbId.mmbId
intrmyAgt3ClrSysIdType=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt3.finInstnId.clrSysMmbId.clrSysId.cd
......@@ -617,14 +577,6 @@ intrmyAgt3BrnchPstlAdrTwnNm=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt3.brnchId.pst
intrmyAgt3BrnchPstlAdrPstBx=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt3.brnchId.pstlAdr.pstBx
intrmyAgt3BrnchPstlAdrPstCd=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt3.brnchId.pstlAdr.pstCd
intrmyAgt3BrnchAdrLines=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt3.brnchId.pstlAdr.adrLine
intrmyAgt3AcctIdIban=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt3Acct.id.iban
intrmyAgt3AcctId=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt3Acctid.othr.id
intrmyAgt3AcctIdType=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt3Acct.id.othr.schmeNm.cd
intrmyAgt3AcctIdTypePrtry=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt3Acct.id.othr.schmeNm.prtry
intrmyAgt3AcctType=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt3Acct.tp.cd
intrmyAgt3AcctTypePrtry=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt3Acct.tp.prtry
intrmyAgt3AcctCcy=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt3Acct.ccy
intrmyAgt3AcctNm=fiToFICstmrCdtTrf.cdtTrfTxInf.intrmyAgt3Acct.nm
ultmtDbtrNm=fiToFICstmrCdtTrf.cdtTrfTxInf.ultmtDbtr.nm
ultmtDbtrOrgAnyBIC=fiToFICstmrCdtTrf.cdtTrfTxInf.ultmtDbtr.id.orgId.anyBIC
ultmtDbtrOrgLei=fiToFICstmrCdtTrf.cdtTrfTxInf.ultmtDbtr.id.orgId.lei
......@@ -692,6 +644,6 @@ instrForNxtAgt=fiToFICstmrCdtTrf.cdtTrfTxInf.instrForNxtAgt
purp=fiToFICstmrCdtTrf.cdtTrfTxInf.purp.cd
purpPrtry=fiToFICstmrCdtTrf.cdtTrfTxInf.purp.prtry
rgltryRptg=@buildRgltryRptg
rltdRmtInf=@buildRltdRmtInf
rltdRmtInf=fiToFICstmrCdtTrf.cdtTrfTxInf.rltdRmtInf#rmtId
rmtInfUstrd=fiToFICstmrCdtTrf.cdtTrfTxInf.rmtInf.ustrd
rmtInfStrdAddtlRmtInf=@buildRmtInfStrdAddtlRmtInf
\ No newline at end of file
strdAddtlRmtInf=@buildStrdAddtlRmtInf
\ No newline at end of file
package com.brilliance.mx2element.pacs009001;
import com.brilliance.swift.SwiftTransfer;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;
public class Test {
public static void main(String[] args) throws IOException {
//File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05400108_CREDIT.xml");
File file = new File("d:/test/MxPacs00900108.xml");
String xmlStr = FileUtils.readFileToString(file);
String jsonStr = SwiftTransfer.mx2Element(xmlStr);
System.out.println(jsonStr);
}
}
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