Commit c45d9c2a by chengzhuoshen

1.根据官方mapping文档完成camt053001转MT940950

2.mx2MtMap增加key:endToEndId
3.完善mx2Map功能
parent 97c75817
...@@ -69,5 +69,11 @@ ...@@ -69,5 +69,11 @@
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
<version>1.2.83</version> <version>1.2.83</version>
</dependency> </dependency>
<!-- SwiftTransfer.mx2MtMap() MessageReader依赖的jar包 -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -5,17 +5,22 @@ import com.alibaba.fastjson.JSONArray; ...@@ -5,17 +5,22 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.brilliance.swift.exception.SwiftException; import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2SwiftDto.Mt2SwiftDtoCreateManager; import com.brilliance.swift.mt2SwiftDto.Mt2SwiftDtoCreateManager;
import com.brilliance.swift.mx2mt.Mx2MtCreatorManager;
import com.brilliance.swift.mx2swiftdto.Mx2SwiftDtoCreatorManager; import com.brilliance.swift.mx2swiftdto.Mx2SwiftDtoCreatorManager;
import com.brilliance.swift.swiftdto2mt.SwiftDto2MtCreatorManager; import com.brilliance.swift.swiftdto2mt.SwiftDto2MtCreatorManager;
import com.brilliance.swift.swiftdto2mx.SwiftDto2MxCreatorManager; import com.brilliance.swift.swiftdto2mx.SwiftDto2MxCreatorManager;
import com.brilliance.swift.util.StringUtil; import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.util.XmlUtil;
import com.brilliance.swift.vo.SwiftDto; import com.brilliance.swift.vo.SwiftDto;
import com.prowidesoftware.swift.model.mx.AbstractMX; import com.prowidesoftware.swift.model.mx.AbstractMX;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
...@@ -154,14 +159,28 @@ public class SwiftTransfer { ...@@ -154,14 +159,28 @@ public class SwiftTransfer {
* @throws SwiftException * @throws SwiftException
*/ */
public static Map<String, String> mx2MtMap(String xmlStr, Map<String, Object> extraMap) throws SwiftException { public static Map<String, String> mx2MtMap(String xmlStr, Map<String, Object> extraMap) throws SwiftException {
SwiftDto swiftDto = new Mx2SwiftDtoCreatorManager().convert(xmlStr, null, null); try {
String mtStr = new SwiftDto2MtCreatorManager().swiftDto2Mt(swiftDto, null, extraMap); String mtStr = new Mx2MtCreatorManager().mx2Mt(xmlStr, null, extraMap);
Map<String, String> maps = MessageReader.getSwfMsgInfoViaMsg(mtStr); Map<String, String> maps = MessageReader.getSwfMsgInfoViaMsg(mtStr);
AbstractMX abstractMx = AbstractMX.parse(xmlStr); AbstractMX abstractMx = AbstractMX.parse(xmlStr);
if (abstractMx != null) { if (abstractMx != null) {
maps.put("xty", abstractMx.getMxId().id());//ISO20022类型 String messageType = abstractMx.getMxId().id();
maps.put("xty", messageType);//ISO20022类型
if (messageType.startsWith("pacs.008.001") || messageType.startsWith("pacs.009.001")) {
Document document = DocumentHelper.parseText(xmlStr);
Map<String, String> parentElementMaps = XmlUtil.getParentElementMaps(document);
String bodyParentElementName = parentElementMaps.get("CdtTrfTxInf");
String endToEndId = XmlUtil.getXmlNodeValue(document, bodyParentElementName + ".CdtTrfTxInf.PmtId.EndToEndId");
if (StringUtil.isNotEmpty(endToEndId)) {
maps.put("endToEndId", endToEndId);
}
}
}
return maps;
} catch (DocumentException e) {
throw new SwiftException("ERROR", e.getMessage());
} }
return maps;
} }
/** /**
...@@ -183,7 +202,7 @@ public class SwiftTransfer { ...@@ -183,7 +202,7 @@ public class SwiftTransfer {
*/ */
public static Map<String, String> mx2Map(String xmlStr) { public static Map<String, String> mx2Map(String xmlStr) {
if (StringUtil.isEmpty(xmlStr)) return null; if (StringUtil.isEmpty(xmlStr)) return null;
Map<String, String> maps = new HashMap<>(); Map<String, String> maps = new LinkedHashMap<>();
AbstractMX abstractMX = AbstractMX.parse(xmlStr); AbstractMX abstractMX = AbstractMX.parse(xmlStr);
String gsonStr = abstractMX.toJson(); String gsonStr = abstractMX.toJson();
Map<String, Object> mxGsonMaps = (Map<String, Object>) JSON.parseObject(gsonStr); Map<String, Object> mxGsonMaps = (Map<String, Object>) JSON.parseObject(gsonStr);
...@@ -227,7 +246,7 @@ public class SwiftTransfer { ...@@ -227,7 +246,7 @@ public class SwiftTransfer {
/** /**
* jsonArray 是json数组格式 回调函数 * jsonArray 是json数组格式 回调函数
* 如果长度只有1,那么就不需要下标 * 如果长度只有1,那么就不需要下标
* 否则需要下标[0] [1] [2] [3] * 否则需要下标(0) (1) (2) (3)
* @param maps * @param maps
* @param jsonArray * @param jsonArray
* @param prefix * @param prefix
...@@ -247,9 +266,9 @@ public class SwiftTransfer { ...@@ -247,9 +266,9 @@ public class SwiftTransfer {
for (int i=0; i<jsonArrays.length; i++) { for (int i=0; i<jsonArrays.length; i++) {
Object object = jsonArrays[i]; Object object = jsonArrays[i];
if (object instanceof JSONArray) { if (object instanceof JSONArray) {
parseMxGsonArray(maps, (JSONArray)object, prefix+"["+i+"]"); parseMxGsonArray(maps, (JSONArray)object, prefix+"("+i+")");
} else if (object instanceof JSONObject) { } else if (object instanceof JSONObject) {
parseMxGsonMap(maps, (Map<String, Object>)object, prefix+"["+i+"]"); parseMxGsonMap(maps, (Map<String, Object>)object, prefix+"("+i+")");
} else { } else {
maps.put(prefix+"["+i+"]", String.valueOf(object)); maps.put(prefix+"["+i+"]", String.valueOf(object));
} }
......
...@@ -128,4 +128,8 @@ public class Mx2MtConstants { ...@@ -128,4 +128,8 @@ public class Mx2MtConstants {
public static final String BLOCK5_TNG = "Block5_TNG"; public static final String BLOCK5_TNG = "Block5_TNG";
public static final String BLOCK5_PDE = "Block5_PDE"; public static final String BLOCK5_PDE = "Block5_PDE";
public static final String YES = "Y";
public static final String NO = "N";
} }
...@@ -10,6 +10,7 @@ import com.prowidesoftware.swift.io.ConversionService; ...@@ -10,6 +10,7 @@ import com.prowidesoftware.swift.io.ConversionService;
import com.prowidesoftware.swift.io.IConversionService; import com.prowidesoftware.swift.io.IConversionService;
import com.prowidesoftware.swift.io.writer.SwiftWriter; import com.prowidesoftware.swift.io.writer.SwiftWriter;
import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.model.*;
import com.prowidesoftware.swift.model.field.*;
import com.prowidesoftware.swift.model.mx.AbstractMX; import com.prowidesoftware.swift.model.mx.AbstractMX;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import org.dom4j.Document; import org.dom4j.Document;
...@@ -158,28 +159,31 @@ public abstract class AbstractMx2MtCreator implements Mx2MtCreator { ...@@ -158,28 +159,31 @@ public abstract class AbstractMx2MtCreator implements Mx2MtCreator {
@Override @Override
public void withBlock3() throws SwiftException { public void withBlock3() throws SwiftException {
List<Tag> tags = new ArrayList<>();
SwiftBlock3 block3 = new SwiftBlock3(); SwiftBlock3 block3 = new SwiftBlock3();
block3.setTags(tags);
String block3_103 = (String)context.get(Mx2MtConstants.BLOCK3_103, true); String block3_103 = (String)context.get(Mx2MtConstants.BLOCK3_103, true);
if (StringUtil.isNotEmpty(block3_103)) { if (StringUtil.isNotEmpty(block3_103)) {
tags.add(new Tag("103", block3_103)); Field103 field103 = new Field103(block3_103);
block3.builder().setField103(field103);
} }
String block3_108 = (String)context.get(Mx2MtConstants.BLOCK3_108, true); String block3_108 = (String)context.get(Mx2MtConstants.BLOCK3_108, true);
if (StringUtil.isNotEmpty(block3_108)) { if (StringUtil.isNotEmpty(block3_108)) {
tags.add(new Tag("108", block3_108)); Field108 field108 = new Field108(block3_108);
block3.builder().setField108(field108);
} }
String block3_165 = (String)context.get(Mx2MtConstants.BLOCK3_165, true); String block3_165 = (String)context.get(Mx2MtConstants.BLOCK3_165, true);
if (StringUtil.isNotEmpty(block3_165)) { if (StringUtil.isNotEmpty(block3_165)) {
tags.add(new Tag("165", block3_165)); Field165 field165 = new Field165(block3_165);
block3.builder().setField165(field165);
} }
String block3_433 = (String)context.get(Mx2MtConstants.BLOCK3_433, true); String block3_433 = (String)context.get(Mx2MtConstants.BLOCK3_433, true);
if (StringUtil.isNotEmpty(block3_433)) { if (StringUtil.isNotEmpty(block3_433)) {
tags.add(new Tag("433", block3_433)); Field433 field433 = new Field433(block3_433);
block3.builder().setField433(field433);
} }
String block3_434 = (String)context.get(Mx2MtConstants.BLOCK3_434, true); String block3_434 = (String)context.get(Mx2MtConstants.BLOCK3_434, true);
if (StringUtil.isNotEmpty(block3_434)) { if (StringUtil.isNotEmpty(block3_434)) {
tags.add(new Tag("434", block3_434)); Field434 field434 = new Field434(block3_434);
block3.builder().setField434(field434);
} }
context.get(SwiftMessage.class).setBlock3(block3); context.get(SwiftMessage.class).setBlock3(block3);
} }
......
...@@ -20,4 +20,6 @@ public class Mx2MtContextIdentifier { ...@@ -20,4 +20,6 @@ public class Mx2MtContextIdentifier {
public static final String MX_RECEIVER_BIC = "mx.receiver.bic"; public static final String MX_RECEIVER_BIC = "mx.receiver.bic";
public static final String MT_TYPE_940_FLAG = "mt.type.940.flag";
} }
...@@ -12,6 +12,7 @@ import com.brilliance.swift.vo.common.ServiceLevelCode; ...@@ -12,6 +12,7 @@ import com.brilliance.swift.vo.common.ServiceLevelCode;
import com.prowidesoftware.swift.model.SwiftBlock3; import com.prowidesoftware.swift.model.SwiftBlock3;
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 com.prowidesoftware.swift.model.field.*;
import org.dom4j.Document; import org.dom4j.Document;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -51,11 +52,13 @@ public class Mx2Mt103Creator extends AbstractMx2MtCreator { ...@@ -51,11 +52,13 @@ public class Mx2Mt103Creator extends AbstractMx2MtCreator {
} }
} }
if (StringUtil.isNotEmpty(serviceType)) { if (StringUtil.isNotEmpty(serviceType)) {
block3.getTags().add(new Tag("111", serviceType)); Field111 field111 = new Field111(serviceType);
block3.builder().setField111(field111);
} }
String uetr = getXmlNodeValue(bodyParentPath, document, "CdtTrfTxInf.PmtId.UETR"); String uetr = getXmlNodeValue(bodyParentPath, document, "CdtTrfTxInf.PmtId.UETR");
if (StringUtil.isNotEmpty(uetr)) { if (StringUtil.isNotEmpty(uetr)) {
block3.getTags().add(new Tag("121", uetr)); Field121 field121 = new Field121(uetr);
block3.builder().setField121(field121);
} }
} }
...@@ -87,7 +90,109 @@ public class Mx2Mt103Creator extends AbstractMx2MtCreator { ...@@ -87,7 +90,109 @@ public class Mx2Mt103Creator extends AbstractMx2MtCreator {
} }
@Override @Override
public void postProcess() throws SwiftException {
if (isStp()) {
SwiftMessage swiftMessage = (SwiftMessage)context.get(SwiftMessage.class);
Field119 field119 = new Field119("STP");
swiftMessage.getBlock3().builder().setField119(field119);
}
super.postProcess();
}
@Override
protected String getMtType() { protected String getMtType() {
return Mx2MtConstants.MT_TYPE_103; return Mx2MtConstants.MT_TYPE_103;
} }
private boolean isStp() {
boolean stpFlag = true;
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
//所有代理行都是optionA
List<Tag> tags = swiftMessage.getBlock4().getTags();
for (int i=0; i<tags.size(); i++) {
Tag tag = tags.get(i);
if ("52D".equals(tag.getName())) {
stpFlag = false;
break;
}
if ("53D".equals(tag.getName())) {
stpFlag = false;
break;
}
if ("54D".equals(tag.getName())) {
stpFlag = false;
break;
}
if ("55D".equals(tag.getName())) {
stpFlag = false;
break;
}
if ("56D".equals(tag.getName())) {
stpFlag = false;
break;
}
if ("57D".equals(tag.getName())) {
stpFlag = false;
break;
}
if ("59".equals(tag.getName())) {
Field59 field59 = (Field59)tag.asField();
if (StringUtil.isEmpty(field59.getAccount())) {
stpFlag = false;
break;
}
}
if ("59A".equals(tag.getName())) {
Field59A field59A = (Field59A)tag.asField();
if (StringUtil.isEmpty(field59A.getAccount())) {
stpFlag = false;
break;
}
}
if ("59F".equals(tag.getName())) {
Field59F field59F = (Field59F)tag.asField();
if (StringUtil.isEmpty(field59F.getAccount())) {
stpFlag = false;
break;
}
}
}
Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT, true);
String bodyHdrParentElementName = (String)context.get(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, true);
int svcLvlCount = getXmlNodeCounts(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.SvcLvl");
if (svcLvlCount > 0) {
for (int i=0; i<svcLvlCount; i++) {
String svcLvlProprietary = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.SvcLvl(" + i + ").Prtry");
if (StringUtil.isNotEmpty(svcLvlProprietary)) {
stpFlag = false;
break;
}
}
}
String localInstrumentProprietary = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.LclInstrm.Prtry");
if (StringUtil.isNotEmpty(localInstrumentProprietary)) {
stpFlag = false;
}
String ctgyPurpProprietary = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.CtgyPurp.Prtry");
if (StringUtil.isNotEmpty(ctgyPurpProprietary)) {
stpFlag = false;
}
String proprietary = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.Purp.Prtry");
if (StringUtil.isNotEmpty(proprietary)) {
stpFlag = false;
}
int instrForCdtrAgtCount = getXmlNodeCounts(bodyHdrParentElementName, document, "CdtTrfTxInf.InstrForCdtrAgt");
if (instrForCdtrAgtCount > 0 ) {
stpFlag = false;
}
int instrForNxtAgtCount = getXmlNodeCounts(bodyHdrParentElementName, document, "CdtTrfTxInf.InstrForNxtAgt");
if (instrForNxtAgtCount > 0 ) {
stpFlag = false;
}
int rmtInfStrdCount = getXmlNodeCounts(bodyHdrParentElementName, document, "CdtTrfTxInf.RmtInf.Strd");
if (rmtInfStrdCount > 0 ) {
stpFlag = false;
}
return stpFlag;
}
} }
...@@ -9,6 +9,7 @@ import com.brilliance.swift.vo.common.ServiceLevelCode; ...@@ -9,6 +9,7 @@ import com.brilliance.swift.vo.common.ServiceLevelCode;
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.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -42,13 +43,13 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate { ...@@ -42,13 +43,13 @@ public class Field72Generate 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();
String mt72FullField = ""; List<String> mt72List = new ArrayList<>();
String mtIntrmyAgt = mx_to_mtAgent(bodyHdrParentElementName + ".CdtTrfTxInf.IntrmyAgt2", 6); String mtIntrmyAgt = mx_to_mtAgent(bodyHdrParentElementName + ".CdtTrfTxInf.IntrmyAgt2", 6);
if (StringUtil.isEmpty(mtIntrmyAgt)) { if (StringUtil.isEmpty(mtIntrmyAgt)) {
mtIntrmyAgt = mx_to_mtAgent(bodyHdrParentElementName + ".CdtTrfTxInf.IntrmyAgt3", 6); mtIntrmyAgt = mx_to_mtAgent(bodyHdrParentElementName + ".CdtTrfTxInf.IntrmyAgt3", 6);
} }
if (StringUtil.isNotEmpty(mtIntrmyAgt)) { if (StringUtil.isNotEmpty(mtIntrmyAgt)) {
mt72FullField += "/INTA/" + mtIntrmyAgt; mt72List.add("/INTA/" + mtIntrmyAgt);
} }
int svcLvlCount = getXmlNodeCounts(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.SvcLvl"); int svcLvlCount = getXmlNodeCounts(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.SvcLvl");
if (svcLvlCount > 0) { if (svcLvlCount > 0) {
...@@ -57,10 +58,10 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate { ...@@ -57,10 +58,10 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
String svcLvlCode = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.SvcLvl(" + i + ").Cd"); String svcLvlCode = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.SvcLvl(" + i + ").Cd");
String svcLvlProprietary = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.SvcLvl(" + i + ").Prtry"); String svcLvlProprietary = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.SvcLvl(" + i + ").Prtry");
if (StringUtil.isNotEmpty(svcLvlProprietary)) { if (StringUtil.isNotEmpty(svcLvlProprietary)) {
mt72FullField += "/SVCLVL/" + svcLvlProprietary; mt72List.add("/SVCLVL/" + svcLvlProprietary);
} else { } else {
if (!ServiceLevelCode.SDVA.value().equals(svcLvlCode) && svcLvlCode.indexOf("G00") == -1) { if (!ServiceLevelCode.SDVA.value().equals(svcLvlCode) && svcLvlCode.indexOf("G00") == -1) {
mt72FullField += "/SVCLVL/" + svcLvlCode; mt72List.add("/SVCLVL/" + svcLvlCode);
} }
} }
} }
...@@ -73,9 +74,9 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate { ...@@ -73,9 +74,9 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
&& !"SPAY".equalsIgnoreCase(localInstrumentProprietary) && !"SPAY".equalsIgnoreCase(localInstrumentProprietary)
&& !"SPRI".equalsIgnoreCase(localInstrumentProprietary) && !"SPRI".equalsIgnoreCase(localInstrumentProprietary)
&& !"SSTD".equalsIgnoreCase(localInstrumentProprietary)) { && !"SSTD".equalsIgnoreCase(localInstrumentProprietary)) {
mt72FullField += "/LOCINS/" + localInstrumentProprietary; mt72List.add("/LOCINS/" + localInstrumentProprietary);
} else if (StringUtil.isNotEmpty(localInstrumentCode)){ } else if (StringUtil.isNotEmpty(localInstrumentCode)){
mt72FullField += "/LOCINS/" + localInstrumentCode; mt72List.add("/LOCINS/" + localInstrumentCode);
} }
String ctgyPurpCode = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.CtgyPurp.Cd"); String ctgyPurpCode = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.CtgyPurp.Cd");
...@@ -84,20 +85,20 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate { ...@@ -84,20 +85,20 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
&& !"INTC CORT".equalsIgnoreCase(ctgyPurpProprietary) && !"INTC CORT".equalsIgnoreCase(ctgyPurpProprietary)
&& !"INTC".equalsIgnoreCase(ctgyPurpProprietary) && !"INTC".equalsIgnoreCase(ctgyPurpProprietary)
&& !"CORT".equalsIgnoreCase(ctgyPurpProprietary)) { && !"CORT".equalsIgnoreCase(ctgyPurpProprietary)) {
mt72FullField += "/CATPURP/" + ctgyPurpProprietary; mt72List.add("/CATPURP/" + ctgyPurpProprietary);
} else if (StringUtil.isNotEmpty(ctgyPurpCode) } else if (StringUtil.isNotEmpty(ctgyPurpCode)
&& !CategoryPurposeCode.INTC.value().equalsIgnoreCase(ctgyPurpCode) && !CategoryPurposeCode.INTC.value().equalsIgnoreCase(ctgyPurpCode)
&& !CategoryPurposeCode.CORT.value().equalsIgnoreCase(ctgyPurpCode)) { && !CategoryPurposeCode.CORT.value().equalsIgnoreCase(ctgyPurpCode)) {
mt72FullField += "/CATPURP/" + ctgyPurpCode; mt72List.add("/CATPURP/" + ctgyPurpCode);
} }
String mtCreditorAgt = subFunctionInstructionForCreditorAgentAndJP(bodyHdrParentElementName + ".CdtTrfTxInf.InstrForCdtrAgt"); String mtCreditorAgt = subFunctionInstructionForCreditorAgentAndJP(bodyHdrParentElementName + ".CdtTrfTxInf.InstrForCdtrAgt");
if (StringUtil.isNotEmpty(mtCreditorAgt)) { if (StringUtil.isNotEmpty(mtCreditorAgt)) {
mt72FullField += mtCreditorAgt; mt72List.add(mtCreditorAgt);
} }
String settlementMethod = getXmlNodeValue(grpHdrParentElementName, document, "GrpHdr.SttlmInf.SttlmMtd"); String settlementMethod = getXmlNodeValue(grpHdrParentElementName, document, "GrpHdr.SttlmInf.SttlmMtd");
String mtNextAgt = subFunctionInstructionForNextAgent(bodyHdrParentElementName + ".CdtTrfTxInf.InstrForNxtAgt", settlementMethod); String mtNextAgt = subFunctionInstructionForNextAgent(bodyHdrParentElementName + ".CdtTrfTxInf.InstrForNxtAgt", settlementMethod);
if (StringUtil.isNotEmpty(mtNextAgt)) { if (StringUtil.isNotEmpty(mtNextAgt)) {
mt72FullField += mtNextAgt; mt72List.add(mtNextAgt);
} }
String mtPrvsInstgAgt = mx_to_mtBICNameAgent(bodyHdrParentElementName + ".CdtTrfTxInf.PrvsInstgAgt1", 210); String mtPrvsInstgAgt = mx_to_mtBICNameAgent(bodyHdrParentElementName + ".CdtTrfTxInf.PrvsInstgAgt1", 210);
if (StringUtil.isEmpty(mtPrvsInstgAgt)) { if (StringUtil.isEmpty(mtPrvsInstgAgt)) {
...@@ -107,10 +108,15 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate { ...@@ -107,10 +108,15 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
mtPrvsInstgAgt = mx_to_mtBICNameAgent(bodyHdrParentElementName + ".CdtTrfTxInf.PrvsInstgAgt3", 210); mtPrvsInstgAgt = mx_to_mtBICNameAgent(bodyHdrParentElementName + ".CdtTrfTxInf.PrvsInstgAgt3", 210);
} }
if (StringUtil.isNotEmpty(mtPrvsInstgAgt)) { if (StringUtil.isNotEmpty(mtPrvsInstgAgt)) {
mt72FullField += "/INS/" + mtPrvsInstgAgt; mt72List.add("/INS/" + mtPrvsInstgAgt);
} }
if (StringUtil.isNotEmpty(mt72FullField)) { if (mt72List.size() > 0) {
List<String> list = StringUtil.outStringList(mt72FullField, 35, "//"); List<String> list = new ArrayList<>();
for (int i=0; i<mt72List.size(); i++) {
String mt72FullField = mt72List.get(i);
List<String> tmplist = StringUtil.outStringList(mt72FullField, 35, "//");
list.addAll(tmplist);
}
String value = ""; String value = "";
for (int i=0; i<list.size(); i++) { for (int i=0; i<list.size(); i++) {
if (i == 6) break; if (i == 6) break;
......
...@@ -11,7 +11,8 @@ import com.brilliance.swift.util.XmlUtil; ...@@ -11,7 +11,8 @@ import com.brilliance.swift.util.XmlUtil;
import com.brilliance.swift.vo.common.ServiceLevelCode; import com.brilliance.swift.vo.common.ServiceLevelCode;
import com.prowidesoftware.swift.model.SwiftBlock3; import com.prowidesoftware.swift.model.SwiftBlock3;
import com.prowidesoftware.swift.model.SwiftMessage; import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag; import com.prowidesoftware.swift.model.field.Field111;
import com.prowidesoftware.swift.model.field.Field121;
import org.dom4j.Document; import org.dom4j.Document;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -51,11 +52,13 @@ public class Mx2Mt202Creator extends AbstractMx2MtCreator { ...@@ -51,11 +52,13 @@ public class Mx2Mt202Creator extends AbstractMx2MtCreator {
} }
} }
if (StringUtil.isNotEmpty(serviceType)) { if (StringUtil.isNotEmpty(serviceType)) {
block3.getTags().add(new Tag("111", serviceType)); Field111 field111 = new Field111(serviceType);
block3.builder().setField111(field111);
} }
String uetr = getXmlNodeValue(bodyParentPath, document, "CdtTrfTxInf.PmtId.UETR"); String uetr = getXmlNodeValue(bodyParentPath, document, "CdtTrfTxInf.PmtId.UETR");
if (StringUtil.isNotEmpty(uetr)) { if (StringUtil.isNotEmpty(uetr)) {
block3.getTags().add(new Tag("121", uetr)); Field121 field121 = new Field121(uetr);
block3.builder().setField121(field121);
} }
} }
......
...@@ -25,10 +25,10 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate { ...@@ -25,10 +25,10 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
List<Tag> tags = swiftMessage.getBlock4().getTags(); List<Tag> tags = swiftMessage.getBlock4().getTags();
String endToEndId = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtId.EndToEndId"); String endToEndId = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtId.EndToEndId");
if (StringUtil.isNotEmpty(endToEndId)) { if (StringUtil.isNotEmpty(endToEndId)) {
String value = "";
if (endToEndId.length() > 16) { if (endToEndId.length() > 16) {
value = endToEndId.substring(0, 15) + "+"; endToEndId = endToEndId.substring(0, 15) + "+";
} }
String value = endToEndId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MT_21_DEFAULT_VALUE; value = Mx2MtConstants.MT_21_DEFAULT_VALUE;
} }
......
...@@ -9,6 +9,7 @@ import com.brilliance.swift.vo.common.ServiceLevelCode; ...@@ -9,6 +9,7 @@ import com.brilliance.swift.vo.common.ServiceLevelCode;
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.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -48,14 +49,14 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate { ...@@ -48,14 +49,14 @@ public class Field72Generate 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();
String mt72FullField = ""; List<String> mt72List = new ArrayList<>();
//参数1 //参数1
String mtIntrmyAgt = mx_to_mtAgent(bodyHdrParentElementName + ".CdtTrfTxInf.IntrmyAgt2", 6); String mtIntrmyAgt = mx_to_mtAgent(bodyHdrParentElementName + ".CdtTrfTxInf.IntrmyAgt2", 6);
if (StringUtil.isEmpty(mtIntrmyAgt)) { if (StringUtil.isEmpty(mtIntrmyAgt)) {
mtIntrmyAgt = mx_to_mtAgent(bodyHdrParentElementName + ".CdtTrfTxInf.IntrmyAgt3", 6); mtIntrmyAgt = mx_to_mtAgent(bodyHdrParentElementName + ".CdtTrfTxInf.IntrmyAgt3", 6);
} }
if (StringUtil.isNotEmpty(mtIntrmyAgt)) { if (StringUtil.isNotEmpty(mtIntrmyAgt)) {
mt72FullField += "/INTA/" + mtIntrmyAgt; mt72List.add("/INTA/" + mtIntrmyAgt);
} }
//参数2 //参数2
int svcLvlCount = getXmlNodeCounts(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.SvcLvl"); int svcLvlCount = getXmlNodeCounts(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.SvcLvl");
...@@ -65,10 +66,10 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate { ...@@ -65,10 +66,10 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
String svcLvlCode = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.SvcLvl(" + i + ").Cd"); String svcLvlCode = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.SvcLvl(" + i + ").Cd");
String svcLvlProprietary = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.SvcLvl(" + i + ").Prtry"); String svcLvlProprietary = getXmlNodeValue(bodyHdrParentElementName, document, "CdtTrfTxInf.PmtTpInf.SvcLvl(" + i + ").Prtry");
if (StringUtil.isNotEmpty(svcLvlProprietary)) { if (StringUtil.isNotEmpty(svcLvlProprietary)) {
mt72FullField += "/SVCLVL/" + svcLvlProprietary; mt72List.add("/SVCLVL/" + svcLvlProprietary);
} else { } else {
if (!ServiceLevelCode.SDVA.value().equals(svcLvlCode) && svcLvlCode.indexOf("G00") == -1) { if (!ServiceLevelCode.SDVA.value().equals(svcLvlCode) && svcLvlCode.indexOf("G00") == -1) {
mt72FullField += "/SVCLVL/" + svcLvlCode; mt72List.add("/SVCLVL/" + svcLvlCode);
} }
} }
} }
...@@ -82,9 +83,9 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate { ...@@ -82,9 +83,9 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
&& !"SPAY".equalsIgnoreCase(localInstrumentProprietary) && !"SPAY".equalsIgnoreCase(localInstrumentProprietary)
&& !"SPRI".equalsIgnoreCase(localInstrumentProprietary) && !"SPRI".equalsIgnoreCase(localInstrumentProprietary)
&& !"SSTD".equalsIgnoreCase(localInstrumentProprietary)) { && !"SSTD".equalsIgnoreCase(localInstrumentProprietary)) {
mt72FullField += "/LOCINS/" + localInstrumentProprietary; mt72List.add("/LOCINS/" + localInstrumentProprietary);
} else if (StringUtil.isNotEmpty(localInstrumentCode)){ } else if (StringUtil.isNotEmpty(localInstrumentCode)){
mt72FullField += "/LOCINS/" + localInstrumentCode; mt72List.add("/LOCINS/" + localInstrumentCode);
} }
//参数4 //参数4
...@@ -94,36 +95,36 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate { ...@@ -94,36 +95,36 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
&& !"INTC CORT".equalsIgnoreCase(ctgyPurpProprietary) && !"INTC CORT".equalsIgnoreCase(ctgyPurpProprietary)
&& !"INTC".equalsIgnoreCase(ctgyPurpProprietary) && !"INTC".equalsIgnoreCase(ctgyPurpProprietary)
&& !"CORT".equalsIgnoreCase(ctgyPurpProprietary)) { && !"CORT".equalsIgnoreCase(ctgyPurpProprietary)) {
mt72FullField += "/CATPURP/" + ctgyPurpProprietary; mt72List.add("/CATPURP/" + ctgyPurpProprietary);
} else if (StringUtil.isNotEmpty(ctgyPurpCode) } else if (StringUtil.isNotEmpty(ctgyPurpCode)
&& !CategoryPurposeCode.INTC.value().equalsIgnoreCase(ctgyPurpCode) && !CategoryPurposeCode.INTC.value().equalsIgnoreCase(ctgyPurpCode)
&& !CategoryPurposeCode.CORT.value().equalsIgnoreCase(ctgyPurpCode)) { && !CategoryPurposeCode.CORT.value().equalsIgnoreCase(ctgyPurpCode)) {
mt72FullField += "/CATPURP/" + ctgyPurpCode; mt72List.add("/CATPURP/" + ctgyPurpCode);
} }
//参数5 //参数5
String mtCreditorAgt = subFunctionInstructionForCreditorAgent(bodyHdrParentElementName + ".CdtTrfTxInf.InstrForCdtrAgt"); String mtCreditorAgt = subFunctionInstructionForCreditorAgent(bodyHdrParentElementName + ".CdtTrfTxInf.InstrForCdtrAgt");
if (StringUtil.isNotEmpty(mtCreditorAgt)) { if (StringUtil.isNotEmpty(mtCreditorAgt)) {
mt72FullField += mtCreditorAgt; mt72List.add(mtCreditorAgt);
} }
//参数6 //参数6
String mxPurposeCode = getXmlNodeValue(bodyHdrParentElementName, document, ".CdtTrfTxInf.Purp.Cd"); String mxPurposeCode = getXmlNodeValue(bodyHdrParentElementName, document, ".CdtTrfTxInf.Purp.Cd");
String mxPurposeProprietary = getXmlNodeValue(bodyHdrParentElementName, document, ".CdtTrfTxInf.Purp.Prtry"); String mxPurposeProprietary = getXmlNodeValue(bodyHdrParentElementName, document, ".CdtTrfTxInf.Purp.Prtry");
if (StringUtil.isNotEmpty(mxPurposeProprietary)) { if (StringUtil.isNotEmpty(mxPurposeProprietary)) {
mt72FullField += "/PURP/" + mxPurposeProprietary; mt72List.add("/PURP/" + mxPurposeProprietary);
} else if (StringUtil.isNotEmpty(mxPurposeCode)) { } else if (StringUtil.isNotEmpty(mxPurposeCode)) {
mt72FullField += "/PURP/" + mxPurposeCode; mt72List.add("/PURP/" + mxPurposeCode);
} }
//参数7 //参数7
String settlementMethod = getXmlNodeValue(grpHdrParentElementName, document, "GrpHdr.SttlmInf.SttlmMtd"); String settlementMethod = getXmlNodeValue(grpHdrParentElementName, document, "GrpHdr.SttlmInf.SttlmMtd");
String mtNextAgt = subFunctionInstructionForNextAgent(bodyHdrParentElementName + ".CdtTrfTxInf.InstrForNxtAgt", settlementMethod); String mtNextAgt = subFunctionInstructionForNextAgent(bodyHdrParentElementName + ".CdtTrfTxInf.InstrForNxtAgt", settlementMethod);
if (StringUtil.isNotEmpty(mtNextAgt)) { if (StringUtil.isNotEmpty(mtNextAgt)) {
mt72FullField += mtNextAgt; mt72List.add(mtNextAgt);
} }
//参数8 //参数8
String mtDbtrAgt = mx_to_mtBICNameAgent(bodyHdrParentElementName + ".CdtTrfTxInf.DbtrAgt", 210); String mtDbtrAgt = mx_to_mtBICNameAgent(bodyHdrParentElementName + ".CdtTrfTxInf.DbtrAgt", 210);
if (StringUtil.isNotEmpty(mtDbtrAgt)) { if (StringUtil.isNotEmpty(mtDbtrAgt)) {
mt72FullField += "/INS/" + mtDbtrAgt; mt72List.add("/INS/" + mtDbtrAgt);
} }
//参数9 //参数9
String mtPrvsInstgAgt = mx_to_mtBICNameAgent(bodyHdrParentElementName + ".CdtTrfTxInf.PrvsInstgAgt1", 210); String mtPrvsInstgAgt = mx_to_mtBICNameAgent(bodyHdrParentElementName + ".CdtTrfTxInf.PrvsInstgAgt1", 210);
...@@ -134,16 +135,21 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate { ...@@ -134,16 +135,21 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
mtPrvsInstgAgt = mx_to_mtBICNameAgent(bodyHdrParentElementName + ".CdtTrfTxInf.PrvsInstgAgt3", 210); mtPrvsInstgAgt = mx_to_mtBICNameAgent(bodyHdrParentElementName + ".CdtTrfTxInf.PrvsInstgAgt3", 210);
} }
if (StringUtil.isNotEmpty(mtPrvsInstgAgt)) { if (StringUtil.isNotEmpty(mtPrvsInstgAgt)) {
mt72FullField += "/INS/" + mtPrvsInstgAgt; mt72List.add("/INS/" + mtPrvsInstgAgt);
} }
//参数10 //参数10
String mtRemittanceInfo = subFunctionRemittanceInformation(bodyHdrParentElementName + ".RmtInf"); String mtRemittanceInfo = subFunctionRemittanceInformation(bodyHdrParentElementName + ".CdtTrfTxInf.RmtInf");
if (StringUtil.isNotEmpty(mtRemittanceInfo)) { if (StringUtil.isNotEmpty(mtRemittanceInfo)) {
mt72FullField += mtRemittanceInfo; mt72List.add(mtRemittanceInfo);
} }
if (StringUtil.isNotEmpty(mt72FullField)) { if (mt72List.size() > 0) {
List<String> list = StringUtil.outStringList(mt72FullField, 35, "//"); List<String> list = new ArrayList<>();
for (int i=0; i<mt72List.size(); i++) {
String mt72FullField = mt72List.get(i);
List<String> tmplist = StringUtil.outStringList(mt72FullField, 35, "//");
list.addAll(tmplist);
}
String value = ""; String value = "";
for (int i=0; i<list.size(); i++) { for (int i=0; i<list.size(); i++) {
if (i == 6) break; if (i == 6) break;
......
...@@ -7,6 +7,7 @@ import com.brilliance.swift.util.StringUtil; ...@@ -7,6 +7,7 @@ import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftBlock3; import com.prowidesoftware.swift.model.SwiftBlock3;
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 com.prowidesoftware.swift.model.field.Field119;
import java.util.List; import java.util.List;
...@@ -91,7 +92,8 @@ public class Field50AGenerate extends AbstractMx2MtTagsGenerate { ...@@ -91,7 +92,8 @@ public class Field50AGenerate extends AbstractMx2MtTagsGenerate {
} }
if (covFlag) { if (covFlag) {
SwiftBlock3 block3 = context.get(SwiftMessage.class).getBlock3(); SwiftBlock3 block3 = context.get(SwiftMessage.class).getBlock3();
block3.getTags().add(new Tag("119", "COV")); Field119 field119 = new Field119("COV");
block3.builder().setField119(field119);
} }
} }
} }
......
...@@ -8,6 +8,7 @@ import com.brilliance.swift.vo.common.SettlementMethodCode; ...@@ -8,6 +8,7 @@ import com.brilliance.swift.vo.common.SettlementMethodCode;
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.ArrayList;
import java.util.List; import java.util.List;
public class Field72Generate extends AbstractMx2MtTagsGenerate { public class Field72Generate extends AbstractMx2MtTagsGenerate {
...@@ -18,22 +19,22 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate { ...@@ -18,22 +19,22 @@ public class Field72Generate 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();
String mt72FullField = ""; List<String> mt72List = new ArrayList<>();
String mtIntrmyAgt = mx_to_mtAgent(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.IntrmyAgt2", 6); String mtIntrmyAgt = mx_to_mtAgent(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.IntrmyAgt2", 6);
if (StringUtil.isEmpty(mtIntrmyAgt)) { if (StringUtil.isEmpty(mtIntrmyAgt)) {
mtIntrmyAgt = mx_to_mtAgent(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.IntrmyAgt3", 6); mtIntrmyAgt = mx_to_mtAgent(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.IntrmyAgt3", 6);
} }
if (StringUtil.isNotEmpty(mtIntrmyAgt)) { if (StringUtil.isNotEmpty(mtIntrmyAgt)) {
mt72FullField += "/INTA/" + mtIntrmyAgt; mt72List.add("/INTA/" + mtIntrmyAgt);
} }
String mtCreditorAgt = subFunctionInstructionForCreditorAgentAndJP(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.InstrForCdtrAgt"); String mtCreditorAgt = subFunctionInstructionForCreditorAgentAndJP(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.InstrForCdtrAgt");
if (StringUtil.isNotEmpty(mtCreditorAgt)) { if (StringUtil.isNotEmpty(mtCreditorAgt)) {
mt72FullField += mtCreditorAgt; mt72List.add(mtCreditorAgt);
} }
String mtNextAgt = subFunctionInstructionForNextAgent(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.InstrForNxtAgt", SettlementMethodCode.COVE.value()); String mtNextAgt = subFunctionInstructionForNextAgent(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.InstrForNxtAgt", SettlementMethodCode.COVE.value());
if (StringUtil.isNotEmpty(mtNextAgt)) { if (StringUtil.isNotEmpty(mtNextAgt)) {
mt72FullField += mtNextAgt; mt72List.add(mtNextAgt);
} }
String mtPrvsInstgAgt = mx_to_mtBICNameAgent(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.PrvsInstgAgt1", 210); String mtPrvsInstgAgt = mx_to_mtBICNameAgent(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.PrvsInstgAgt1", 210);
if (StringUtil.isEmpty(mtPrvsInstgAgt)) { if (StringUtil.isEmpty(mtPrvsInstgAgt)) {
...@@ -43,10 +44,15 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate { ...@@ -43,10 +44,15 @@ public class Field72Generate extends AbstractMx2MtTagsGenerate {
mtPrvsInstgAgt = mx_to_mtBICNameAgent(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.PrvsInstgAgt3", 210); mtPrvsInstgAgt = mx_to_mtBICNameAgent(bodyHdrParentElementName + ".CdtTrfTxInf.UndrlygCstmrCdtTrf.PrvsInstgAgt3", 210);
} }
if (StringUtil.isNotEmpty(mtPrvsInstgAgt)) { if (StringUtil.isNotEmpty(mtPrvsInstgAgt)) {
mt72FullField += "/INS/" + mtPrvsInstgAgt; mt72List.add("/INS/" + mtPrvsInstgAgt);
} }
if (StringUtil.isNotEmpty(mt72FullField)) { if (mt72List.size() > 0) {
List<String> list = StringUtil.outStringList(mt72FullField, 35, "//"); List<String> list = new ArrayList<>();
for (int i=0; i<mt72List.size(); i++) {
String mt72FullField = mt72List.get(i);
List<String> tmplist = StringUtil.outStringList(mt72FullField, 35, "//");
list.addAll(tmplist);
}
String value = ""; String value = "";
for (int i=0; i<list.size(); i++) { for (int i=0; i<list.size(); i++) {
if (i == 6) break; if (i == 6) break;
......
...@@ -22,16 +22,16 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate { ...@@ -22,16 +22,16 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
String endToEndId = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.Ntry.NtryDtls.TxDtls.Refs.EndToEndId"); String endToEndId = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.Ntry.NtryDtls.TxDtls.Refs.EndToEndId");
String instructionId = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.Ntry.NtryDtls.TxDtls.Refs.InstrId"); String instructionId = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.Ntry.NtryDtls.TxDtls.Refs.InstrId");
String value = ""; String value = "";
if (StringUtil.isNotEmpty(endToEndId)) { if (StringUtil.isNotEmpty(instructionId)) {
value = endToEndId;
if (endToEndId.length() > 16) {
value = endToEndId.substring(0, 15) + "+";
}
} else if (StringUtil.isNotEmpty(instructionId)) {
value = instructionId; value = instructionId;
if (instructionId.length() > 16) { if (instructionId.length() > 16) {
value = instructionId.substring(0, 15) + "+"; value = instructionId.substring(0, 15) + "+";
} }
} else if (StringUtil.isNotEmpty(endToEndId)) {
value = endToEndId;
if (endToEndId.length() > 16) {
value = endToEndId.substring(0, 15) + "+";
}
} }
if (StringUtil.isNotEmpty(value)) { if (StringUtil.isNotEmpty(value)) {
tags.add(new Tag(name, value)); tags.add(new Tag(name, value));
......
...@@ -25,36 +25,68 @@ public class Field52aFor900Generate extends AbstractMx2MtTagsGenerate { ...@@ -25,36 +25,68 @@ public class Field52aFor900Generate extends AbstractMx2MtTagsGenerate {
if (!CreditDebitCode.DBIT.value().equals(cdtDbtInd)) { if (!CreditDebitCode.DBIT.value().equals(cdtDbtInd)) {
return; return;
} }
String agtPath = bodyHdrParentElementName + ".Ntfctn.Ntry.NtryDtls.TxDtls.RltdAgts.DbtrAgt";
String bicCode = mx_to_mtBICFI(agtPath);
String mtClearSystemId = mx_to_mtClearingIdentifier(agtPath);
String value = ""; String value = "";
String account = mx_to_mtAccount(bodyHdrParentElementName + ".Ntfctn.Ntry.NtryDtls.TxDtls.RltdPties.DbtrAcct");
String bicCode = mx_to_mtBICFI(bodyHdrParentElementName + ".Ntfctn.Ntry.NtryDtls.TxDtls.RltdPties.Dbtr.Agt");
if (StringUtil.isNotEmpty(bicCode)) { if (StringUtil.isNotEmpty(bicCode)) {
if (StringUtil.isNotEmpty(account)) { if (StringUtil.isNotEmpty(mtClearSystemId)) {
value = account + Mx2MtConstants.NEW_LINE + bicCode; value = mtClearSystemId + Mx2MtConstants.NEW_LINE + bicCode;
} else { } else {
value = bicCode; value = bicCode;
} }
tags.add(new Tag(name_A, value)); tags.add(new Tag(name_A, value));
} else { } else {
String name = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.Ntry.NtryDtls.TxDtls.RltdPties.Dbtr.Agt.FinInstnId.Nm"); String name = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.Ntry.NtryDtls.TxDtls.RltdAgts.DbtrAgt.FinInstnId.Nm");
String countryCode = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.Ntry.NtryDtls.TxDtls.RltdPties.Dbtr.Agt.FinInstnId.PstlAdr.Ctry"); String countryCode = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.Ntry.NtryDtls.TxDtls.RltdAgts.DbtrAgt.FinInstnId.PstlAdr.Ctry");
int addressLineCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Ntfctn.Ntry.NtryDtls.TxDtls.RltdPties.Dbtr.Agt.FinInstnId.PstlAdr.AdrLine"); int addressLineCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Ntfctn.Ntry.NtryDtls.TxDtls.RltdAgts.DbtrAgt.FinInstnId.PstlAdr.AdrLine");
String mtNameAddress = ""; String mtNameAddress = "";
if (addressLineCount > 0) { if (addressLineCount > 0) {
mtNameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(bodyHdrParentElementName+ ".Ntfctn.Ntry.NtryDtls.TxDtls.RltdPties.Dbtr.Agt.FinInstnId"); mtNameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(agtPath + ".FinInstnId");
} else if (StringUtil.isNotEmpty(countryCode)) { } else if (StringUtil.isNotEmpty(countryCode)) {
mtNameAddress = mx_to_mtFinancialInstitutionNameAndStructuredAddress(bodyHdrParentElementName+ ".Ntfctn.Ntry.NtryDtls.TxDtls.RltdPties.Dbtr.Agt.FinInstnId", false); mtNameAddress = mx_to_mtFinancialInstitutionNameAndStructuredAddress(agtPath + ".FinInstnId", false);
} else if (StringUtil.isNotEmpty(name)) { } else if (StringUtil.isNotEmpty(name)) {
mtNameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(bodyHdrParentElementName+ ".Ntfctn.Ntry.NtryDtls.TxDtls.RltdPties.Dbtr.Agt.FinInstnId"); mtNameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(agtPath + ".FinInstnId");
} }
if (StringUtil.isEmpty(mtNameAddress)) return;//如果name和地址不存在,返回。 if (StringUtil.isNotEmpty(mtNameAddress)) {
if (StringUtil.isNotEmpty(account)) { if (StringUtil.isNotEmpty(mtClearSystemId)) {
value = account + Mx2MtConstants.NEW_LINE + mtNameAddress; value = mtClearSystemId + Mx2MtConstants.NEW_LINE + mtNameAddress;
} else {
value = mtNameAddress;
}
tags.add(new Tag(name_D, value));
}
}
if (StringUtil.isEmpty(value)) {
String account = mx_to_mtAccount(bodyHdrParentElementName + ".Ntfctn.Ntry.NtryDtls.TxDtls.RltdPties.DbtrAcct");
bicCode = mx_to_mtBICFI(bodyHdrParentElementName + ".Ntfctn.Ntry.NtryDtls.TxDtls.RltdPties.Dbtr.Agt");
if (StringUtil.isNotEmpty(bicCode)) {
if (StringUtil.isNotEmpty(account)) {
value = account + Mx2MtConstants.NEW_LINE + bicCode;
} else {
value = bicCode;
}
tags.add(new Tag(name_A, value));
} else { } else {
value = mtNameAddress; String name = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.Ntry.NtryDtls.TxDtls.RltdPties.Dbtr.Agt.FinInstnId.Nm");
String countryCode = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.Ntry.NtryDtls.TxDtls.RltdPties.Dbtr.Agt.FinInstnId.PstlAdr.Ctry");
int addressLineCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Ntfctn.Ntry.NtryDtls.TxDtls.RltdPties.Dbtr.Agt.FinInstnId.PstlAdr.AdrLine");
String mtNameAddress = "";
if (addressLineCount > 0) {
mtNameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(bodyHdrParentElementName+ ".Ntfctn.Ntry.NtryDtls.TxDtls.RltdPties.Dbtr.Agt.FinInstnId");
} else if (StringUtil.isNotEmpty(countryCode)) {
mtNameAddress = mx_to_mtFinancialInstitutionNameAndStructuredAddress(bodyHdrParentElementName+ ".Ntfctn.Ntry.NtryDtls.TxDtls.RltdPties.Dbtr.Agt.FinInstnId", false);
} else if (StringUtil.isNotEmpty(name)) {
mtNameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(bodyHdrParentElementName+ ".Ntfctn.Ntry.NtryDtls.TxDtls.RltdPties.Dbtr.Agt.FinInstnId");
}
if (StringUtil.isEmpty(mtNameAddress)) return;//如果name和地址不存在,返回。
if (StringUtil.isNotEmpty(account)) {
value = account + Mx2MtConstants.NEW_LINE + mtNameAddress;
} else {
value = mtNameAddress;
}
tags.add(new Tag(name_D, value));
} }
tags.add(new Tag(name_D, value));
} }
} }
} }
package com.brilliance.swift.mx2mt.mt940950; package com.brilliance.swift.mx2mt.mt940950;
import com.brilliance.swift.constants.Mx2MtConstants; import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtCreator; import com.brilliance.swift.mx2mt.AbstractMx2MtCreator;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier; import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.mx2mt.Mx2MtTagsGenerate; import com.brilliance.swift.mx2mt.Mx2MtTagsGenerate;
...@@ -23,9 +24,14 @@ public class Mx2Mt940950Creator extends AbstractMx2MtCreator { ...@@ -23,9 +24,14 @@ public class Mx2Mt940950Creator extends AbstractMx2MtCreator {
context.set(Mx2MtContextIdentifier.GRPHDR_PARENT_ELEMENT_NAME, parentElementMaps.get("GrpHdr")); context.set(Mx2MtContextIdentifier.GRPHDR_PARENT_ELEMENT_NAME, parentElementMaps.get("GrpHdr"));
context.set(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, parentElementMaps.get("Stmt")); context.set(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, parentElementMaps.get("Stmt"));
} }
@Override @Override
public List<Mx2MtTagsGenerate> getGenerateTagList() { public void withBlock2() throws SwiftException {
//block2逻辑放在postProcess方法中
}
@Override
public List<Mx2MtTagsGenerate> getGenerateTagList() {
List<Mx2MtTagsGenerate> fieldsGenerateList = new ArrayList<>(); List<Mx2MtTagsGenerate> fieldsGenerateList = new ArrayList<>();
fieldsGenerateList.add(new Field20Generate()); fieldsGenerateList.add(new Field20Generate());
fieldsGenerateList.add(new Field21Generate()); fieldsGenerateList.add(new Field21Generate());
...@@ -41,19 +47,16 @@ public class Mx2Mt940950Creator extends AbstractMx2MtCreator { ...@@ -41,19 +47,16 @@ public class Mx2Mt940950Creator extends AbstractMx2MtCreator {
return fieldsGenerateList; return fieldsGenerateList;
} }
/** @Override
* 符合以下其中一个条件,则为940,否则为950报文 public void postProcess() throws SwiftException {
* (1)<Stmt><Ntry>[j]数组中,节点<AddtlNtryInf>有值 super.withBlock2();
* (2)<Stmt><Bal>[i]数组中,节点<Tp><CdOrPrtry><Cd>值为“FWAV” super.postProcess();
* (3)节点<Stmt><AddtlStmtInf>有值
* @return true:940, false:950
*/
public boolean getMtMsg() {
return true;
} }
@Override @Override
protected String getMtType() { protected String getMtType() {
if (getMtMsg()) { String mtType940Flag = (String) context.get(Mx2MtContextIdentifier.MT_TYPE_940_FLAG, true);
if (Mx2MtConstants.YES.equals(mtType940Flag)) {
return Mx2MtConstants.MT_TYPE_940; return Mx2MtConstants.MT_TYPE_940;
} else { } else {
return Mx2MtConstants.MT_TYPE_950; return Mx2MtConstants.MT_TYPE_950;
......
package com.brilliance.swift.mx2mt.mt940950.impl; package com.brilliance.swift.mx2mt.mt940950.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
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.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import java.util.List;
/** /**
* <GrpHdr><MsgId> * <GrpHdr><MsgId>
*/ */
public class Field20Generate extends AbstractMx2MtTagsGenerate { public class Field20Generate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException{ private static String name = "20";
public void tagGenerate() throws SwiftException{
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String identification = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Id");
if (StringUtil.isNotEmpty(identification)) {
if (identification.length() > 16) {
identification = identification.substring(0, 15) + "+";
}
String value = identification;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
}
tags.add(new Tag(name, value));
}
} }
} }
package com.brilliance.swift.mx2mt.mt940950.impl; package com.brilliance.swift.mx2mt.mt940950.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
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.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import java.util.List;
/** /**
* <Stmt><Acct><Id><IBAN> * <Stmt><Acct><Id><IBAN>
...@@ -9,8 +15,31 @@ import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate; ...@@ -9,8 +15,31 @@ import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
*/ */
public class Field25aGenerate extends AbstractMx2MtTagsGenerate { public class Field25aGenerate extends AbstractMx2MtTagsGenerate {
@Override private static String name = "25";
public void tagGenerate() throws SwiftException{
private static String name_P = "25P";
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String iban = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Acct.Id.IBAN");
String acctId = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Acct.Id.Othr.Id");
String account = StringUtil.isNotEmpty(iban) ? iban : acctId;
String bicCode = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Acct.Ownr.Id.OrgId.AnyBIC");
String value = "";
if (StringUtil.isNotEmpty(bicCode)) {
if (StringUtil.isNotEmpty(account)) {
value = account + Mx2MtConstants.NEW_LINE + bicCode;
} else {
value = bicCode;
}
tags.add(new Tag(name_P, value));
} else {
value = account;
if (StringUtil.isNotEmpty(value)) {
tags.add(new Tag(name, value));
}
}
} }
} }
...@@ -2,6 +2,11 @@ package com.brilliance.swift.mx2mt.mt940950.impl; ...@@ -2,6 +2,11 @@ package com.brilliance.swift.mx2mt.mt940950.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.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import java.util.List;
/** /**
* <GrpHdr><MsgPgntn><PgNb> * <GrpHdr><MsgPgntn><PgNb>
...@@ -9,9 +14,21 @@ import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate; ...@@ -9,9 +14,21 @@ import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
*/ */
public class Field28CGenerate extends AbstractMx2MtTagsGenerate { public class Field28CGenerate extends AbstractMx2MtTagsGenerate {
private static String name = "28C";
@Override @Override
public void tagGenerate() throws SwiftException{ public void tagGenerate() throws SwiftException{
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String value = "";
String elctrncSeqNbStr = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.ElctrncSeqNb");
String lglSeqNbStr = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.LglSeqNb");
String pageNumber = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.StmtPgntn.PgNb");
if (StringUtil.isNotEmpty(lglSeqNbStr) && lglSeqNbStr.length() <= 5) {
value = lglSeqNbStr + "/" + pageNumber;
} else {
value = elctrncSeqNbStr + "/" + pageNumber;
}
tags.add(new Tag(name, value));
} }
} }
...@@ -2,6 +2,19 @@ package com.brilliance.swift.mx2mt.mt940950.impl; ...@@ -2,6 +2,19 @@ package com.brilliance.swift.mx2mt.mt940950.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.util.DateUtil;
import com.brilliance.swift.util.NumberUtil;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.vo.common.BalanceTypeCode;
import com.brilliance.swift.vo.common.CdtDbtCode;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.math.BigDecimal;
import java.util.List;
/** /**
* <Stmt><Bal>[i]<Tp><CdOrPrtry><Cd> * <Stmt><Bal>[i]<Tp><CdOrPrtry><Cd>
...@@ -12,9 +25,58 @@ import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate; ...@@ -12,9 +25,58 @@ import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
*/ */
public class Field60Generate extends AbstractMx2MtTagsGenerate { public class Field60Generate extends AbstractMx2MtTagsGenerate {
private static String name_F = "60F";
private static String name_M = "60M";
@Override @Override
public void tagGenerate() throws SwiftException{ public void tagGenerate() throws SwiftException{
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Stmt.Bal");
int index = -1;
if (balanceTypeCount > 0) {
for (int i=0; i<balanceTypeCount; i++) {
String balanceType = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+i+").Tp.CdOrPrtry.Cd");
if (BalanceTypeCode.OPBD.value().equals(balanceType)) {
index = i;
break;
}
}
}
if (index > -1) {
try {
String crdr = "";
String cdtDbtInd = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+index+").CdtDbtInd");
if (CdtDbtCode.CRDT.value().equals(cdtDbtInd)) {
crdr = "C";
} else {//if (CdtDbtCode.DBIT.value().equals(cdtDbtInd)) {
crdr = "D";
}
String balanceDate = "";
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+index+").Dt.Dt");
if (StringUtil.isNotEmpty(dateStr)) {
XMLGregorianCalendar date = DatatypeFactory.newInstance().newXMLGregorianCalendar(dateStr);
balanceDate = DateUtil.format(date, "yyMMdd");
}
String balanceAmt = "";
String balanceCcy = "";
String amt = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+index+").Amt");
String ccy = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+index+").Amt@Ccy");
if (StringUtil.isNotEmpty(amt) && StringUtil.isNotEmpty(ccy)) {
balanceAmt = NumberUtil.formatAmt(new BigDecimal(amt), ccy);
balanceCcy = ccy;
}
String value = crdr + balanceDate + balanceCcy + balanceAmt;
String pageNumber = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.StmtPgntn.PgNb");
if (StringUtil.isNotEmpty(pageNumber) && Integer.parseInt(pageNumber) == 1) {
tags.add(new Tag(name_F, value));
} else {
tags.add(new Tag(name_M, value));
}
} catch (DatatypeConfigurationException e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
} }
} }
package com.brilliance.swift.mx2mt.mt940950.impl; package com.brilliance.swift.mx2mt.mt940950.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
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.DateUtil;
import com.brilliance.swift.util.NumberUtil;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.vo.common.CdtDbtCode;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.math.BigDecimal;
import java.util.List;
/** /**
* <Stmt><Ntry>[j]<ValDt><Dt> * <Stmt><Ntry>[j]<ValDt><Dt>
...@@ -17,8 +31,88 @@ import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate; ...@@ -17,8 +31,88 @@ import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
*/ */
public class Field61Generate extends AbstractMx2MtTagsGenerate { public class Field61Generate extends AbstractMx2MtTagsGenerate {
private static String name_61 = "61";
private static String name_86 = "86";
@Override @Override
public void tagGenerate() throws SwiftException{ public void tagGenerate() throws SwiftException{
try {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int entryCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Stmt.Ntry");
if (entryCount > 0) {
for (int i=0; i<entryCount; i++) {
String value = "";
String valueDateStr = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Ntry("+i+").ValDt.Dt");
if (StringUtil.isNotEmpty(valueDateStr)) {
XMLGregorianCalendar valueDate = DatatypeFactory.newInstance().newXMLGregorianCalendar(valueDateStr);
value += DateUtil.format(valueDate, "yyMMdd");
}
String bookDateStr = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Ntry("+i+").BookgDt.Dt");
if (StringUtil.isNotEmpty(bookDateStr)) {
XMLGregorianCalendar bookDate = DatatypeFactory.newInstance().newXMLGregorianCalendar(bookDateStr);
value += DateUtil.format(bookDate, "MMdd");
}
String reversalIndicator = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Ntry("+i+").RvslInd");
String creditDebitIndicator = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Ntry("+i+").CdtDbtInd");
if (StringUtil.isNotEmpty(reversalIndicator) && Boolean.valueOf(reversalIndicator)) {
if (CdtDbtCode.DBIT.value().equals(creditDebitIndicator)) {
value += "RC";
} else {
value += "RD";
}
} else {
if (CdtDbtCode.DBIT.value().equals(creditDebitIndicator)) {
value += "D";
} else {
value += "C";
}
}
String amt = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Ntry("+i+").Amt");
String ccy = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Ntry("+i+").Amt@Ccy");
if (StringUtil.isNotEmpty(amt) && StringUtil.isNotEmpty(ccy)) {
value += NumberUtil.formatAmt(new BigDecimal(amt), ccy);
}
value += "NTRF";
String endToEndId = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Ntry("+i+").NtryDtls.TxDtls.Refs.EndToEndId");
if (StringUtil.isNotEmpty(endToEndId)) {
if (endToEndId.length() > 16) {
endToEndId = endToEndId.substring(0, 15) + "+";
}
value += endToEndId;
} else {
value += Mx2MtConstants.MT_21_DEFAULT_VALUE;
}
String accountServicerReference = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Ntry("+i+").AcctSvcrRef");
if (StringUtil.isNotEmpty(accountServicerReference)) {
if (accountServicerReference.length() > 16) {
accountServicerReference = accountServicerReference.substring(0, 15) + "+";
}
value += "//" + accountServicerReference;
}
String additionalInformation = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Ntry("+i+").NtryDtls.TxDtls.AddtlTxInf");
if (StringUtil.isNotEmpty(additionalInformation)) {
if (additionalInformation.length() > 34) {
additionalInformation = additionalInformation.substring(0, 33) + "+";
}
value += Mx2MtConstants.NEW_LINE + additionalInformation;
}
tags.add(new Tag(name_61, value));
String additionalEntryInformation = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Ntry("+i+").AddtlNtryInf");
if (StringUtil.isNotEmpty(additionalEntryInformation)) {
if (additionalEntryInformation.length() > 390) {
additionalEntryInformation = additionalEntryInformation.substring(0, 389) + "+";
}
String value86 = StringUtil.getStringByEnter(additionalEntryInformation, 65, 6);
tags.add(new Tag(name_86, value86));
context.set(Mx2MtContextIdentifier.MT_TYPE_940_FLAG, Mx2MtConstants.YES);
}
}
}
} catch (DatatypeConfigurationException e) {
throw new SwiftException("ERROR", e.getMessage());
}
} }
} }
...@@ -2,6 +2,19 @@ package com.brilliance.swift.mx2mt.mt940950.impl; ...@@ -2,6 +2,19 @@ package com.brilliance.swift.mx2mt.mt940950.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.util.DateUtil;
import com.brilliance.swift.util.NumberUtil;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.vo.common.BalanceTypeCode;
import com.brilliance.swift.vo.common.CdtDbtCode;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.math.BigDecimal;
import java.util.List;
/** /**
* <Stmt><Bal>[i]<Tp><CdOrPrtry><Cd> * <Stmt><Bal>[i]<Tp><CdOrPrtry><Cd>
...@@ -12,8 +25,58 @@ import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate; ...@@ -12,8 +25,58 @@ import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
*/ */
public class Field62Generate extends AbstractMx2MtTagsGenerate { public class Field62Generate extends AbstractMx2MtTagsGenerate {
private static String name_F = "62F";
private static String name_M = "62M";
@Override @Override
public void tagGenerate() throws SwiftException{ public void tagGenerate() throws SwiftException{
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Stmt.Bal");
int index = -1;
if (balanceTypeCount > 0) {
for (int i=0; i<balanceTypeCount; i++) {
String balanceType = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+i+").Tp.CdOrPrtry.Cd");
if (BalanceTypeCode.CLBD.value().equals(balanceType)) {
index = i;
break;
}
}
}
if (index > -1) {
try {
String crdr = "";
String cdtDbtInd = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+index+").CdtDbtInd");
if (CdtDbtCode.CRDT.value().equals(cdtDbtInd)) {
crdr = "C";
} else {//if (CdtDbtCode.DBIT.value().equals(cdtDbtInd)) {
crdr = "D";
}
String balanceDate = "";
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+index+").Dt.Dt");
if (StringUtil.isNotEmpty(dateStr)) {
XMLGregorianCalendar date = DatatypeFactory.newInstance().newXMLGregorianCalendar(dateStr);
balanceDate = DateUtil.format(date, "yyMMdd");
}
String balanceAmt = "";
String balanceCcy = "";
String amt = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+index+").Amt");
String ccy = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+index+").Amt@Ccy");
if (StringUtil.isNotEmpty(amt) && StringUtil.isNotEmpty(ccy)) {
balanceAmt = NumberUtil.formatAmt(new BigDecimal(amt), ccy);
balanceCcy = ccy;
}
String value = crdr + balanceDate + balanceCcy + balanceAmt;
String lastPageIndicator = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.StmtPgntn.LastPgInd");
if (StringUtil.isNotEmpty(lastPageIndicator) && Boolean.TRUE.equals(Boolean.valueOf(lastPageIndicator))) {
tags.add(new Tag(name_F, value));
} else {
tags.add(new Tag(name_M, value));
}
} catch (DatatypeConfigurationException e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
} }
} }
...@@ -2,6 +2,19 @@ package com.brilliance.swift.mx2mt.mt940950.impl; ...@@ -2,6 +2,19 @@ package com.brilliance.swift.mx2mt.mt940950.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.util.DateUtil;
import com.brilliance.swift.util.NumberUtil;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.vo.common.BalanceTypeCode;
import com.brilliance.swift.vo.common.CdtDbtCode;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.math.BigDecimal;
import java.util.List;
/** /**
* <Stmt><Bal>[i]<Tp><CdOrPrtry><Cd> * <Stmt><Bal>[i]<Tp><CdOrPrtry><Cd>
...@@ -13,8 +26,51 @@ import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate; ...@@ -13,8 +26,51 @@ import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
*/ */
public class Field64Generate extends AbstractMx2MtTagsGenerate { public class Field64Generate extends AbstractMx2MtTagsGenerate {
private static String name = "64";
@Override @Override
public void tagGenerate() throws SwiftException{ public void tagGenerate() throws SwiftException{
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Stmt.Bal");
int index = -1;
if (balanceTypeCount > 0) {
for (int i=0; i<balanceTypeCount; i++) {
String balanceType = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+i+").Tp.CdOrPrtry.Cd");
if (BalanceTypeCode.CLAV.value().equals(balanceType)) {
index = i;
break;
}
}
}
if (index > -1) {
try {
String crdr = "";
String cdtDbtInd = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+index+").CdtDbtInd");
if (CdtDbtCode.CRDT.value().equals(cdtDbtInd)) {
crdr = "C";
} else {//if (CdtDbtCode.DBIT.value().equals(cdtDbtInd)) {
crdr = "D";
}
String balanceDate = "";
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+index+").Dt.Dt");
if (StringUtil.isNotEmpty(dateStr)) {
XMLGregorianCalendar date = DatatypeFactory.newInstance().newXMLGregorianCalendar(dateStr);
balanceDate = DateUtil.format(date, "yyMMdd");
}
String balanceAmt = "";
String balanceCcy = "";
String amt = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+index+").Amt");
String ccy = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+index+").Amt@Ccy");
if (StringUtil.isNotEmpty(amt) && StringUtil.isNotEmpty(ccy)) {
balanceAmt = NumberUtil.formatAmt(new BigDecimal(amt), ccy);
balanceCcy = ccy;
}
String value = crdr + balanceDate + balanceCcy + balanceAmt;
tags.add(new Tag(name, value));
} catch (DatatypeConfigurationException e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
} }
} }
package com.brilliance.swift.mx2mt.mt940950.impl; package com.brilliance.swift.mx2mt.mt940950.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
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.DateUtil;
import com.brilliance.swift.util.NumberUtil;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.vo.common.BalanceTypeCode;
import com.brilliance.swift.vo.common.CdtDbtCode;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.math.BigDecimal;
import java.util.List;
/** /**
* <Stmt><Bal>[i]<Tp><CdOrPrtry><Cd> *
* <Stmt><Bal>[i]<CdtDbtInd>
* <Stmt><Bal>[i]<Dt><Dt>
* <Stmt><Bal>[i]<Amt Ccy=“XXX”>
* LOOP BAL
* IF CLAV == <Bal><Tp><CdOrPrtry><Cd> means exist 65
*/ */
public class Field65Generate extends AbstractMx2MtTagsGenerate { public class Field65Generate extends AbstractMx2MtTagsGenerate {
private static String name = "65";
@Override @Override
public void tagGenerate() throws SwiftException{ public void tagGenerate() throws SwiftException{
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Stmt.Bal");
if (balanceTypeCount > 0) {
for (int i=0; i<balanceTypeCount; i++) {
String balanceType = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+i+").Tp.CdOrPrtry.Cd");
if (BalanceTypeCode.FWAV.value().equals(balanceType)) {
try {
String crdr = "";
String cdtDbtInd = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+i+").CdtDbtInd");
if (CdtDbtCode.CRDT.value().equals(cdtDbtInd)) {
crdr = "C";
} else {//if (CdtDbtCode.DBIT.value().equals(cdtDbtInd)) {
crdr = "D";
}
String balanceDate = "";
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+i+").Dt.Dt");
if (StringUtil.isNotEmpty(dateStr)) {
XMLGregorianCalendar date = DatatypeFactory.newInstance().newXMLGregorianCalendar(dateStr);
balanceDate = DateUtil.format(date, "yyMMdd");
}
String balanceAmt = "";
String balanceCcy = "";
String amt = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+i+").Amt");
String ccy = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Bal("+i+").Amt@Ccy");
if (StringUtil.isNotEmpty(amt) && StringUtil.isNotEmpty(ccy)) {
balanceAmt = NumberUtil.formatAmt(new BigDecimal(amt), ccy);
balanceCcy = ccy;
}
String value = crdr + balanceDate + balanceCcy + balanceAmt;
tags.add(new Tag(name, value));
context.set(Mx2MtContextIdentifier.MT_TYPE_940_FLAG, Mx2MtConstants.YES);
} catch (DatatypeConfigurationException e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
}
}
} }
} }
package com.brilliance.swift.mx2mt.mt940950.impl; package com.brilliance.swift.mx2mt.mt940950.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
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.Tag;
import java.util.List;
/** /**
*<Stmt><AddtlStmtInf> *<Stmt><AddtlStmtInf>
...@@ -9,10 +16,21 @@ import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate; ...@@ -9,10 +16,21 @@ import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
*/ */
public class Field86Generate extends AbstractMx2MtTagsGenerate { public class Field86Generate extends AbstractMx2MtTagsGenerate {
private static String name = "86";
@Override @Override
public void tagGenerate() throws SwiftException { public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String addtlStmtInf = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.AddtlStmtInf");
if (StringUtil.isNotEmpty(addtlStmtInf)) {
if (addtlStmtInf.length() > 390) {
addtlStmtInf = addtlStmtInf.substring(0, 389) + "+";
}
String value = StringUtil.getStringByEnter(addtlStmtInf, 65, 6);
tags.add(new Tag(name, value));
context.set(Mx2MtContextIdentifier.MT_TYPE_940_FLAG, Mx2MtConstants.YES);
}
} }
......
package com.brilliance.swift.vo.common;
public enum BalanceSubTypeCode {
ADJT("Adjustment"),
BCUR("BaseCurrency"),
BLCK("Blocked"),
BLKD("BlockedFunds"),
DLOD("DaylightOverdraft"),
EAST("EligibleAssets"),
FCOL("FirmCollateralization"),
FCOU("AmountsThatHaveBeenUsedToServeAsFirmCollateral"),
FORC("SecuritiesForecast"),
FUND("NetFunding"),
INTM("Intermediate"),
LCUR("LocalCurrency"),
LRLD("LimitRelated"),
NOTE("ReservedLiquidity"),
PDNG("SecuritiesPending"),
PIPO("PayInPayOut"),
PRAV("ProgressiveAverage"),
RESV("Reserve"),
SCOL("SelfCollateralization"),
SCOU("AmountsThatHaveBeenUsedToServeAsSelfCollateral"),
THRE("Threshold");
BalanceSubTypeCode(String s) {}
public String value() {
return name();
}
}
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8"?>
<RequestPayload> <!--
<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.02"> THE MESSAGE WILL WORK “AS IS” IN THE READINESS PORTAL. IT IS ESSENTIAL THAT USERS REMOVE THE ENVELOPE AND REPLACE IT WITH THEIR OWN TRANSPORT HEADER (FOR EXAMPLE FOR ALLIANCE ACCESS YOU WOULD USE THE XML V2 HEADERS).
<Fr> =========================================================================================================================================================================================
<FIId> Legal Disclaimer:
<FinInstnId> SWIFT © 2020. All rights reserved.
<BICFI>SHWHQWER123</BICFI> This publication contains SWIFT or third-party confidential information. Do not disclose this publication outside your organisation without SWIFT's prior written consent.
</FinInstnId> The use of this document is governed by the legal notices appearing at the end of this document. By using this document, you will be deemed to have accepted those legal notices.
</FIId> =========================================================================================================================================================================================
</Fr> Use case c.53.1.b Bank to Customer Statement produced by the Debtor Agent - Flow #6
<To> ===================================================================================
<FIId> Change Log
<FinInstnId> 2020-10-16 - Original version
<BICFI>BJWHS12X</BICFI> =============================
</FinInstnId> -->
</FIId> <Envelope xmlns="urn:swift:xsd:envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:swift:xsd:envelope ../../../../March21Schemas/Translator_envelope.xsd">
</To> <AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.02">
<BizMsgIdr>00010013800002001234</BizMsgIdr> <Fr>
<MsgDefIdr>camt.053.001.08</MsgDefIdr> <FIId>
<CreDt>2022-04-28T10:24:00.960+08:00</CreDt> <FinInstnId>
<Prty>NORM</Prty> <BICFI>BKAUATWW</BICFI>
</AppHdr> </FinInstnId>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.053.001.08"> </FIId>
<BkToCstmrStmt> </Fr>
<GrpHdr> <To>
<MsgId>00010013800002001234</MsgId> <FIId>
<CreDtTm>2022-04-28T10:24:00.960+08:00</CreDtTm> <FinInstnId>
<MsgPgntn> <BICFI>FEXMIE2D</BICFI>
<PgNb>178</PgNb> </FinInstnId>
<LastPgInd>false</LastPgInd> </FIId>
</MsgPgntn> </To>
<AddtlInf></AddtlInf> <BizMsgIdr>BKAU20200907-82</BizMsgIdr>
</GrpHdr> <MsgDefIdr>camt.053.001.08</MsgDefIdr>
<Stmt> <BizSvc>swift.cbprplus.02</BizSvc>
<ElctrncSeqNb>200</ElctrncSeqNb> <CreDt>2020-09-07T18:00:00+02:00</CreDt>
<Acct> </AppHdr>
<Id> <Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.053.001.08">
<Othr> <BkToCstmrStmt>
<Id>S15612345678012345</Id> <GrpHdr>
</Othr> <MsgId>BKAU20200907-82</MsgId>
</Id> <CreDtTm>2020-09-07T18:00:00+02:00</CreDtTm>
</Acct> <MsgRcpt>
<Bal> <Id>
<Tp> <OrgId>
<CdOrPrtry> <AnyBIC>FEXMIE2D</AnyBIC>
<Cd>ITBD</Cd> </OrgId>
</CdOrPrtry> </Id>
</Tp> </MsgRcpt>
<Amt Ccy="USD">120274.34</Amt> <AddtlInf>/EODY/</AddtlInf>
<CdtDbtInd>DBIT</CdtDbtInd> </GrpHdr>
<Dt> <Stmt>
<Dt>2022-03-30</Dt> <Id>20200111</Id>
</Dt> <StmtPgntn>
</Bal> <PgNb>1</PgNb>
<Bal> <LastPgInd>true</LastPgInd>
<Tp> </StmtPgntn>
<CdOrPrtry> <LglSeqNb>53214</LglSeqNb>
<Cd>ITBD</Cd> <Acct>
</CdOrPrtry> <Id>
</Tp> <Othr>
<Amt Ccy="USD">123456.29</Amt> <Id>48751258</Id>
<CdtDbtInd>DBIT</CdtDbtInd> </Othr>
<Dt> </Id>
<Dt>2022-03-30</Dt> <Ccy>GBP</Ccy>
</Dt> </Acct>
</Bal> <Bal>
<Ntry> <Tp>
<Amt Ccy="USD">393.17</Amt> <CdOrPrtry>
<CdtDbtInd>DBIT</CdtDbtInd> <Cd>OPBD</Cd>
<BookgDt> </CdOrPrtry>
<Dt>2022-03-30</Dt> </Tp>
</BookgDt> <Amt Ccy="GBP">100115.66</Amt>
<ValDt> <CdtDbtInd>CRDT</CdtDbtInd>
<Dt>2022-03-30</Dt> <Dt>
</ValDt> <Dt>2020-09-07</Dt>
<AcctSvcrRef>1309170100000390154395</AcctSvcrRef> </Dt>
<BkTxCd> </Bal>
<Prtry> <Bal>
<Cd>FCHK</Cd> <Tp>
</Prtry> <CdOrPrtry>
</BkTxCd> <Cd>CLBD</Cd>
<NtryDtls> </CdOrPrtry>
<TxDtls> </Tp>
<Refs> <Amt Ccy="GBP">226675.33</Amt>
<EndToEndId>S100000189-735</EndToEndId> <CdtDbtInd>CRDT</CdtDbtInd>
<UETR>8a562c67-ca16-48ba-b074-65581be6f001</UETR> <Dt>
</Refs> <Dt>2020-09-07</Dt>
<AddtlTxInf>PLACI LOVECNAMENSKIH WUHAN</AddtlTxInf> </Dt>
</TxDtls> </Bal>
</NtryDtls> <Ntry>
</Ntry> <NtryRef>0001</NtryRef>
<Ntry> <Amt Ccy="GBP">126559.67</Amt>
<Amt Ccy="USD">445</Amt> <CdtDbtInd>DBIT</CdtDbtInd>
<CdtDbtInd>DBIT</CdtDbtInd> <Sts>
<BookgDt> <Cd>BOOK</Cd>
<Dt>2022-03-30</Dt> </Sts>
</BookgDt> <BookgDt>
<ValDt> <Dt>2020-09-07</Dt>
<Dt>2022-03-30</Dt> </BookgDt>
</ValDt> <ValDt>
<AcctSvcrRef>1309170100000390154395</AcctSvcrRef> <Dt>2020-09-07</Dt>
<BkTxCd> </ValDt>
<Prtry> <AcctSvcrRef>BKAREF-12345</AcctSvcrRef>
<Cd>FCHK</Cd> <BkTxCd>
</Prtry> <Domn>
</BkTxCd> <Cd>PMNT</Cd>
<NtryDtls> <Fmly>
<TxDtls> <Cd>ICDT</Cd>
<Refs> <SubFmlyCd>XBCT</SubFmlyCd>
<EndToEndId>S100000189-735</EndToEndId> </Fmly>
<UETR>8a562c67-ca16-48ba-b074-65581be6f001</UETR> </Domn>
</Refs> </BkTxCd>
<AddtlTxInf>PLACI LOVECNAMENSKIH STORITEV</AddtlTxInf> <NtryDtls>
</TxDtls> <TxDtls>
</NtryDtls> <Refs>
</Ntry> <AcctSvcrRef>BKAREF-12345</AcctSvcrRef>
</Stmt> <EndToEndId>pacs008EndToEndId-001</EndToEndId>
</BkToCstmrStmt> <UETR>8a562c67-ca16-48ba-b074-65581be6f001</UETR>
</Document> </Refs>
</RequestPayload> <Amt Ccy="GBP">126559.67</Amt>
\ No newline at end of file <CdtDbtInd>DBIT</CdtDbtInd>
</TxDtls>
</NtryDtls>
</Ntry>
</Stmt>
</BkToCstmrStmt>
</Document>
</Envelope>
\ No newline at end of file
...@@ -8,7 +8,7 @@ SWIFT © 2020. All rights reserved. ...@@ -8,7 +8,7 @@ SWIFT © 2020. All rights reserved.
This publication contains SWIFT or third-party confidential information. Do not disclose this publication outside your organisation without SWIFT’s prior written consent. This publication contains SWIFT or third-party confidential information. Do not disclose this publication outside your organisation without SWIFT’s prior written consent.
The use of this document is governed by the legal notices appearing at the end of this document. By using this document, you will be deemed to have accepted those legal notices. The use of this document is governed by the legal notices appearing at the end of this document. By using this document, you will be deemed to have accepted those legal notices.
================================================================================================================================================================================= =================================================================================================================================================================================
Use Case c.54.1.1 Agent A Unicredit provides a debit notification to the debtor Flexo Merchant Services Use Case c.54.1.1 Agent D ABN Amro credits the account of the Creditor Aegon NV, providing a credit notification
======================================================================================================================== ========================================================================================================================
Change Log Change Log
2020-10-16 - Original version 2020-10-16 - Original version
...@@ -19,18 +19,18 @@ Change Log ...@@ -19,18 +19,18 @@ Change Log
<Fr> <Fr>
<FIId> <FIId>
<FinInstnId> <FinInstnId>
<BICFI>BKAUATWW</BICFI> <BICFI>ABNANL2A</BICFI>
</FinInstnId> </FinInstnId>
</FIId> </FIId>
</Fr> </Fr>
<To> <To>
<FIId> <FIId>
<FinInstnId> <FinInstnId>
<BICFI>FEXMIE2D</BICFI> <BICFI>AENVNL2G</BICFI>
</FinInstnId> </FinInstnId>
</FIId> </FIId>
</To> </To>
<BizMsgIdr>cmt054bizmsgidr-001</BizMsgIdr> <BizMsgIdr>cmt054bizmsgidr-002</BizMsgIdr>
<MsgDefIdr>camt.054.001.08</MsgDefIdr> <MsgDefIdr>camt.054.001.08</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc> <BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2020-09-08T10:00:47+01:00</CreDt> <CreDt>2020-09-08T10:00:47+01:00</CreDt>
...@@ -38,7 +38,7 @@ Change Log ...@@ -38,7 +38,7 @@ Change Log
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.054.001.08"> <Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.054.001.08">
<BkToCstmrDbtCdtNtfctn> <BkToCstmrDbtCdtNtfctn>
<GrpHdr> <GrpHdr>
<MsgId>cmt054bizmsgidr-001</MsgId> <MsgId>cmt054bizmsgidr-002</MsgId>
<CreDtTm>2020-09-08T10:00:47+01:00</CreDtTm> <CreDtTm>2020-09-08T10:00:47+01:00</CreDtTm>
</GrpHdr> </GrpHdr>
<Ntfctn> <Ntfctn>
...@@ -62,7 +62,7 @@ Change Log ...@@ -62,7 +62,7 @@ Change Log
<Domn> <Domn>
<Cd>PMNT</Cd> <Cd>PMNT</Cd>
<Fmly> <Fmly>
<Cd>ICDT</Cd> <Cd>RCDT</Cd>
<SubFmlyCd>XBCT</SubFmlyCd> <SubFmlyCd>XBCT</SubFmlyCd>
</Fmly> </Fmly>
</Domn> </Domn>
...@@ -70,54 +70,51 @@ Change Log ...@@ -70,54 +70,51 @@ Change Log
<NtryDtls> <NtryDtls>
<TxDtls> <TxDtls>
<Refs> <Refs>
<InstrId>cmt054bizmsgidr-001</InstrId> <InstrId>cmt054bizmsgidr-002</InstrId>
<EndToEndId>pacs008EndToEndId-001</EndToEndId> <EndToEndId>pacs008EndToEndId-001</EndToEndId>
<UETR>8a562c67-ca16-48ba-b074-65581be6f001</UETR> <UETR>8a562c67-ca16-48ba-b074-65581be6f001</UETR>
</Refs> </Refs>
<Amt Ccy="EUR">300000</Amt> <Amt Ccy="EUR">300000</Amt>
<CdtDbtInd>CRDT</CdtDbtInd> <CdtDbtInd>CRDT</CdtDbtInd>
<RmtInf>
<Ustrd>Inv: AEG-69874/958</Ustrd>
</RmtInf>
<RltdDts>
<IntrBkSttlmDt>2020-09-08</IntrBkSttlmDt>
</RltdDts>
<RltdPties> <RltdPties>
<Dbtr> <Dbtr>
<Pty> <Pty>
<Id> <Nm>Flexo Merchant</Nm>
<OrgId>
<AnyBIC>QWERASDF</AnyBIC>
</OrgId>
</Id>
</Pty> </Pty>
<Agt>
<FinInstnId>
<BICFI>CITIBHNK</BICFI>
</FinInstnId>
</Agt>
</Dbtr> </Dbtr>
<DbtrAcct> <Cdtr>
<Id> <Pty>
<Othr> <Nm>Aegon NV</Nm>
<Id>81939316</Id> </Pty>
</Othr> </Cdtr>
</Id>
</DbtrAcct>
</RltdPties> </RltdPties>
<RltdAgts> <RltdAgts>
<DbtrAgt> <DbtrAgt>
<FinInstnId> <FinInstnId>
<BICFI>BMRIIDAE</BICFI> <BICFI>BKAUATWW</BICFI>
</FinInstnId> </FinInstnId>
</DbtrAgt> </DbtrAgt>
<IntrmyAgt1> <CdtrAgt>
<FinInstnId> <FinInstnId>
<BICFI>BSIFVCBK</BICFI> <BICFI>ABNANL2A</BICFI>
</FinInstnId> </FinInstnId>
</IntrmyAgt1> </CdtrAgt>
</RltdAgts> </RltdAgts>
<AddtlTxInf>chengzhuoshen</AddtlTxInf> <LclInstrm>
<Cd>CTP</Cd>
</LclInstrm>
<Purp>
<Cd>COMC</Cd>
</Purp>
<RltdRmtInf>
<RmtId>ID-1236654</RmtId>
</RltdRmtInf>
<RmtInf>
<Ustrd>Inv: AEG-69874/958</Ustrd>
</RmtInf>
<RltdDts>
<IntrBkSttlmDt>2020-09-08</IntrBkSttlmDt>
</RltdDts>
</TxDtls> </TxDtls>
</NtryDtls> </NtryDtls>
</Ntry> </Ntry>
......
...@@ -8,7 +8,7 @@ SWIFT © 2020. All rights reserved. ...@@ -8,7 +8,7 @@ SWIFT © 2020. All rights reserved.
This publication contains SWIFT or third-party confidential information. Do not disclose this publication outside your organisation without SWIFT’s prior written consent. This publication contains SWIFT or third-party confidential information. Do not disclose this publication outside your organisation without SWIFT’s prior written consent.
The use of this document is governed by the legal notices appearing at the end of this document. By using this document, you will be deemed to have accepted those legal notices. The use of this document is governed by the legal notices appearing at the end of this document. By using this document, you will be deemed to have accepted those legal notices.
================================================================================================================================================================================= =================================================================================================================================================================================
Use Case c.54.1.1 Agent A Unicredit provides a debit notification to the debtor Flexo Merchant Services Use Case c.54.2.1 JP Morgan US provides JP Morgan UK with a debit confirmation
======================================================================================================================== ========================================================================================================================
Change Log Change Log
2020-10-16 - Original version 2020-10-16 - Original version
...@@ -19,41 +19,41 @@ Change Log ...@@ -19,41 +19,41 @@ Change Log
<Fr> <Fr>
<FIId> <FIId>
<FinInstnId> <FinInstnId>
<BICFI>BKAUATWW</BICFI> <BICFI>CHASUS33</BICFI>
</FinInstnId> </FinInstnId>
</FIId> </FIId>
</Fr> </Fr>
<To> <To>
<FIId> <FIId>
<FinInstnId> <FinInstnId>
<BICFI>FEXMIE2D</BICFI> <BICFI>CHASGB2L</BICFI>
</FinInstnId> </FinInstnId>
</FIId> </FIId>
</To> </To>
<BizMsgIdr>cmt054bizmsgidr-001</BizMsgIdr> <BizMsgIdr>cmt054bizmsgidr-001</BizMsgIdr>
<MsgDefIdr>camt.054.001.08</MsgDefIdr> <MsgDefIdr>camt.054.001.08</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc> <BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2020-09-08T10:00:47+01:00</CreDt> <CreDt>2021-02-23T10:30:47-04:00</CreDt>
</AppHdr> </AppHdr>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.054.001.08"> <Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.054.001.08">
<BkToCstmrDbtCdtNtfctn> <BkToCstmrDbtCdtNtfctn>
<GrpHdr> <GrpHdr>
<MsgId>cmt054bizmsgidr-001</MsgId> <MsgId>cmt054bizmsgidr-001</MsgId>
<CreDtTm>2020-09-08T10:00:47+01:00</CreDtTm> <CreDtTm>2021-02-23T10:30:47-04:00</CreDtTm>
</GrpHdr> </GrpHdr>
<Ntfctn> <Ntfctn>
<Id>cmt054NtfctnId-002</Id> <Id>cmt054NtfctnId-001</Id>
<Acct> <Acct>
<Id> <Id>
<Othr> <Othr>
<Id>SML4564887</Id> <Id>JPMUK987654</Id>
</Othr> </Othr>
</Id> </Id>
<Ccy>EUR</Ccy> <Ccy>USD</Ccy>
</Acct> </Acct>
<Ntry> <Ntry>
<NtryRef>cmt054NtryRef002</NtryRef> <NtryRef>cmt054NtryRef001</NtryRef>
<Amt Ccy="EUR">300000</Amt> <Amt Ccy="USD">26541879</Amt>
<CdtDbtInd>DBIT</CdtDbtInd> <CdtDbtInd>DBIT</CdtDbtInd>
<Sts> <Sts>
<Cd>STCD</Cd> <Cd>STCD</Cd>
...@@ -70,42 +70,31 @@ Change Log ...@@ -70,42 +70,31 @@ Change Log
<NtryDtls> <NtryDtls>
<TxDtls> <TxDtls>
<Refs> <Refs>
<InstrId>cmt054bizmsgidr-001</InstrId> <InstrId>pacs9bizmsgidr01</InstrId>
<EndToEndId>pacs008EndToEndId-001</EndToEndId> <EndToEndId>pacs9EndToEnd001</EndToEndId>
<UETR>8a562c67-ca16-48ba-b074-65581be6f001</UETR> <UETR>8a562c67-ca16-48ba-b074-65581be6f001</UETR>
</Refs> </Refs>
<Amt Ccy="EUR">300000</Amt> <Amt Ccy="USD">26541879</Amt>
<CdtDbtInd>DBIT</CdtDbtInd> <CdtDbtInd>DBIT</CdtDbtInd>
<RmtInf>
<Ustrd>Inv: AEG-69874/958</Ustrd>
</RmtInf>
<RltdDts>
<IntrBkSttlmDt>2020-09-08</IntrBkSttlmDt>
</RltdDts>
<RltdPties> <RltdPties>
<Dbtr> <Dbtr>
<Pty>
<Id>
<OrgId>
<AnyBIC>QWERASDF</AnyBIC>
</OrgId>
</Id>
</Pty>
<Agt> <Agt>
<FinInstnId> <FinInstnId>
<BICFI>CITIBHNK</BICFI> <BICFI>CHASGB2L</BICFI>
</FinInstnId> </FinInstnId>
</Agt> </Agt>
</Dbtr> </Dbtr>
<DbtrAcct> <Cdtr>
<Id> <Agt>
<Othr> <FinInstnId>
<Id>81939316</Id> <BICFI>BAUTUS31</BICFI>
</Othr> </FinInstnId>
</Id> </Agt>
</DbtrAcct> </Cdtr>
</RltdPties> </RltdPties>
<AddtlTxInf>chengzhuoshen</AddtlTxInf> <RltdDts>
<IntrBkSttlmDt>2021-02-23</IntrBkSttlmDt>
</RltdDts>
</TxDtls> </TxDtls>
</NtryDtls> </NtryDtls>
</Ntry> </Ntry>
......
...@@ -44,9 +44,6 @@ Change Log ...@@ -44,9 +44,6 @@ Change Log
</SttlmInf> </SttlmInf>
</GrpHdr> </GrpHdr>
<CdtTrfTxInf> <CdtTrfTxInf>
<SttlmTmIndctn>
<DbtDtTm>2007-02-22T08:55:00+01:00</DbtDtTm>
</SttlmTmIndctn>
<PmtId> <PmtId>
<InstrId>pacs8bizmsgidr01</InstrId> <InstrId>pacs8bizmsgidr01</InstrId>
<EndToEndId>pacs008EndToEndId-001</EndToEndId> <EndToEndId>pacs008EndToEndId-001</EndToEndId>
...@@ -91,6 +88,13 @@ Change Log ...@@ -91,6 +88,13 @@ Change Log
<Ctry>BG</Ctry> <Ctry>BG</Ctry>
</PstlAdr> </PstlAdr>
</Cdtr> </Cdtr>
<CdtrAcct>
<Id>
<Othr>
<Id>123456</Id>
</Othr>
</Id>
</CdtrAcct>
<RmtInf> <RmtInf>
<Ustrd>SWEEP 454-9663</Ustrd> <Ustrd>SWEEP 454-9663</Ustrd>
</RmtInf> </RmtInf>
......
...@@ -131,6 +131,7 @@ ...@@ -131,6 +131,7 @@
</FinInstnId> </FinInstnId>
</CdtrAgt> </CdtrAgt>
<PmtId> <PmtId>
<EndToEndId>pacs009EndToEndId-001</EndToEndId>
<UETR>8a562c67-ca16-48ba-b074-65581be6f001</UETR> <UETR>8a562c67-ca16-48ba-b074-65581be6f001</UETR>
</PmtId> </PmtId>
<IntrBkSttlmAmt Ccy="USD">120274.34</IntrBkSttlmAmt> <IntrBkSttlmAmt Ccy="USD">120274.34</IntrBkSttlmAmt>
......
package com.brilliance.mx2mt.mt900; package com.brilliance.mx2mt.mt900;
import com.prowidesoftware.swift.model.field.Field; import com.brilliance.swift.constants.Mx2MtConstants;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT900;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
/** /**
* @author zh * @author zh
...@@ -14,10 +13,25 @@ import java.util.List; ...@@ -14,10 +13,25 @@ import java.util.List;
*/ */
public class TestMT900obj { public class TestMT900obj {
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
AbstractMT mt900 = MT900.parse(new File("E:\\environment\\xinchenworkplace\\swiftMx2Mt\\swiftCore\\src\\main\\resources\\swiftTxt\\MT900.txt")); String key = "fitificstmrcdttrf.cdttrftxinf.rgltryrptg*.dtl*.inf*";
for (Field field : mt900.getFields()) { key = key.replace("*", "(\\([0-9]{1}\\)){0,1}");
List<String> components = field.getComponents(); System.out.println(key);
System.out.println(components.get(0));
Map<String, String> maps = new LinkedHashMap<>();
maps.put("fitificstmrcdttrf.cdttrftxinf.rgltryrptg.dtl.inf", "第一条数据");
maps.put("fitificstmrcdttrf.cdttrftxinf.rgltryrptg.dtl.inf(1)", "第二条数据");
maps.put("fitificstmrcdttrf.cdttrftxinf.rgltryrptg(0).dtl(0).inf(2)", "第三条数据");
maps.put("fitificstmrcdttrf.cdttrftxinf.rgltryrptg(0).dtl(1).inf(0)", "第四条数据");
maps.put("fitificstmrcdttrf.cdttrftxinf.rgltryrptg(1).dtl(1).inf(0)", "第五条数据");
maps.put("fitificstmrcdttrf.cdttrftxinf.datestr", "20220530");
String str = "";
Set<String> keys = maps.keySet();
for (String tmpkey : keys) {
if (tmpkey.matches(key)) {
str += maps.get(tmpkey) + Mx2MtConstants.NEW_LINE;
}
} }
System.out.println(str);
} }
} }
package com.brilliance.mx2mt.mt950; package com.brilliance.mx2mt.mt950;
import com.brilliance.swift.mx2mt.Mx2MtCreatorManager; import com.brilliance.swift.mx2mt.Mx2MtCreatorManager;
import org.apache.commons.io.FileUtils;
import java.io.File; import java.io.File;
public class TestMx2MtFor950 { public class TestMx2MtFor950 {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05300108_950.xml");
String xmlStr = FileUtils.readFileToString(file);
String mt910 = new Mx2MtCreatorManager().mx2Mt(xmlStr, null, null);
System.out.println(mt910);
} }
} }
package com.brilliance.mx2mtmap.mt103; package com.brilliance.mx2mtmap.mt103;
import com.brilliance.swift.SwiftTransfer; import com.brilliance.swift.SwiftTransfer;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import java.io.File; import java.io.File;
...@@ -13,7 +11,7 @@ public class Test { ...@@ -13,7 +11,7 @@ public class Test {
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
File file = new File("D:\\test\\MxPacs00800109.xml"); File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs00800109.xml");
String xmlStr = FileUtils.readFileToString(file); String xmlStr = FileUtils.readFileToString(file);
//String xmlStr = FileUtils.readFileToString(new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05400108_CREDIT.xml")); //String xmlStr = FileUtils.readFileToString(new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05400108_CREDIT.xml"));
//Map<String, Object> extraMap = new HashMap<>(); //Map<String, Object> extraMap = new HashMap<>();
...@@ -22,11 +20,10 @@ public class Test { ...@@ -22,11 +20,10 @@ public class Test {
//Map<String, String> maps = SwiftTransfer.mx2MtMap(xmlStr, null); //Map<String, String> maps = SwiftTransfer.mx2MtMap(xmlStr, null);
//maps.forEach((k, v) -> System.out.println(k + "=" + v)); //maps.forEach((k, v) -> System.out.println(k + "=" + v));
String gsonStr = SwiftTransfer.mx2Gson(xmlStr); //String gsonStr = SwiftTransfer.mx2Gson(xmlStr);
//System.out.println(gson); //System.out.println(gson);
//Map<String, String> maps = SwiftTransfer.mx2Map(xmlStr); Map<String, String> maps = SwiftTransfer.mx2MtMap(xmlStr, null);
//maps.forEach((k, v) -> System.out.println(k + "=" + v));
Map<String, Object> maps = new GsonBuilder().create().fromJson(gsonStr,new TypeToken<Map<String, String>>() {}.getType());
maps.forEach((k, v) -> System.out.println(k + "=" + v)); maps.forEach((k, v) -> System.out.println(k + "=" + v));
} }
} }
...@@ -11,7 +11,7 @@ import java.util.Map; ...@@ -11,7 +11,7 @@ import java.util.Map;
public class Test { public class Test {
private static void test202() throws IOException { private static void test202() throws IOException {
String xmlStr = FileUtils.readFileToString(new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs00800109.xml")); String xmlStr = FileUtils.readFileToString(new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs00900109.xml"));
Map<String, Object> extraMap = new HashMap<>(); Map<String, Object> extraMap = new HashMap<>();
extraMap.put("bnkBic", "BANKANC0XXX");//发报 extraMap.put("bnkBic", "BANKANC0XXX");//发报
//extraMap.put("bnkBic", "FOOBARC0");//收报 //extraMap.put("bnkBic", "FOOBARC0");//收报
...@@ -29,7 +29,7 @@ public class Test { ...@@ -29,7 +29,7 @@ public class Test {
} }
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
//test202(); test202();
test202Cov(); //test202Cov();
} }
} }
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