Commit 376f6c7a by chengzhuoshen

1.ERRORTYPE=FAILURE,不抛异常

2.MessageReader重写成MxMessageReader,支持邮储国际支付前置
parent 50bdc828
......@@ -55,16 +55,6 @@
<version>1.9</version>
</dependency>
<dependency>
<groupId>com.brilliance.swift</groupId>
<artifactId>eibs-container</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>com.brilliance.swift</groupId>
<artifactId>eibs-ext</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.83</version>
......@@ -80,11 +70,5 @@
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
<!-- SwiftTransfer.mx2MtMap() MessageReader依赖的jar包 -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -23,5 +23,21 @@
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<excludes>
<exclude>**/template/**</exclude>
<exclude>**/swiftJson/**</exclude>
<exclude>**/swiftTxt/**</exclude>
<exclude>**/swiftXml/**</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
......@@ -5,6 +5,7 @@ import com.brilliance.swift.mt2mx.Mt2MxCreatorManager;
import com.brilliance.swift.mx2element.Mx2ElementCreatorManager;
import com.brilliance.swift.mx2map.Mx2MapCreatorManager;
import com.brilliance.swift.mx2mt.Mx2MtCreatorManager;
import com.brilliance.swift.util.MxMessageReader;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.util.SwiftTransferUtil;
import com.brilliance.swift.util.XmlUtil;
......@@ -98,8 +99,8 @@ public class SwiftTransfer {
*/
public static Map<String, String> mx2MtMap(String xmlStr, Map<String, Object> extraMap) throws SwiftException {
try {
String mtStr = mx2Mt(xmlStr, null, extraMap);
Map<String, String> maps = MessageReader.getSwfMsgInfoViaMsg(mtStr);
SwiftTranslationReport str = mx2MtPlus(xmlStr, null, extraMap);
Map<String, String> maps = MxMessageReader.getSwfMsgInfoViaMsg(str);
AbstractMX abstractMx = AbstractMX.parse(xmlStr);
if (abstractMx != null) {
String messageType = abstractMx.getMxId().id();
......
......@@ -65,9 +65,9 @@ public abstract class AbstractMx2MtCreator implements Mx2MtCreator {
}
if (!existFlag) {
str.addErrorInfo(errorInfo);
if ("FAILURE".equalsIgnoreCase(errorInfo.getErrorType())) {
/*if ("FAILURE".equalsIgnoreCase(errorInfo.getErrorType())) {
throw new SwiftException(location + Mx2MtConstants.NEW_LINE + "-" + errorInfo.getErrorType() + ":" + errorInfo.getDescription());
}
}*/
}
}
......
......@@ -82,9 +82,9 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
}
if (!existFlag) {
str.addErrorInfo(errorInfo);
if ("FAILURE".equalsIgnoreCase(errorInfo.getErrorType())) {
/*if ("FAILURE".equalsIgnoreCase(errorInfo.getErrorType())) {
throw new SwiftException(location + Mx2MtConstants.NEW_LINE + "-" + errorInfo.getErrorType() + ":" + errorInfo.getDescription());
}
}*/
}
}
/**
......
......@@ -24,7 +24,7 @@ public class Field28CGenerate extends AbstractMx2MtTagsGenerate {
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) {
if (StringUtil.isNotEmpty(lglSeqNbStr)) {
value = lglSeqNbStr + "/" + pageNumber;
} else {
value = elctrncSeqNbStr + "/" + pageNumber;
......
......@@ -32,6 +32,7 @@ Change Log
<MsgDefIdr>pacs.008.001.08</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2021-04-09T09:00:00+01:00</CreDt>
<PssblDplct>true</PssblDplct>
</AppHdr>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pacs.008.001.08">
<FIToFICstmrCdtTrf>
......@@ -69,10 +70,6 @@ Change Log
</PmtTpInf>
<IntrBkSttlmAmt Ccy="EUR">15000000</IntrBkSttlmAmt>
<IntrBkSttlmDt>2021-04-09</IntrBkSttlmDt>
<SttlmTmIndctn>
<DbtDtTm>2022-06-10</DbtDtTm>
<CdtDtTm>2022-06-11</CdtDtTm>
</SttlmTmIndctn>
<SttlmTmReq>
<CLSTm>09:00:00+01:00</CLSTm>
<TillTm>09:00:00+02:00</TillTm>
......@@ -81,12 +78,9 @@ Change Log
</SttlmTmReq>
<InstdAmt Ccy="EUR">15000000</InstdAmt>
<XchgRate>1</XchgRate>
<ChrgBr>DEBT</ChrgBr>
<ChrgBr>SHAR</ChrgBr>
<ChrgsInf>
<Amt Ccy="USD">12.0</Amt>
</ChrgsInf>
<ChrgsInf>
<Amt Ccy="EUR">123</Amt>
<Amt Ccy="EUR">123222222222222678.02</Amt>
<Agt>
<FinInstnId>
<BICFI>PSBCCNBJ</BICFI>
......@@ -118,10 +112,10 @@ Change Log
<PstlAdr>
<StrtNm>High Street</StrtNm>
<TwnNm>Epping</TwnNm>
<Ctry>GB</Ctry>
<TwnLctnNm>zhangsan</TwnLctnNm>
<DstrctNm>lisi</DstrctNm>
<CtrySubDvsn>wangwu</CtrySubDvsn>
<Ctry>GB</Ctry>
<AdrLine>123</AdrLine>
<AdrLine>456</AdrLine>
<AdrLine>789</AdrLine>
......@@ -137,26 +131,6 @@ Change Log
</PstlAdr>
</FinInstnId>
</DbtrAgt>
<PrvsInstgAgt1>
<FinInstnId>
<Nm>BIGGER COMPANY</Nm>
<PstlAdr>
<TwnLctnNm>zhangsan</TwnLctnNm>
<DstrctNm>lisi</DstrctNm>
<CtrySubDvsn>wangwu</CtrySubDvsn>
</PstlAdr>
</FinInstnId>
</PrvsInstgAgt1>
<IntrmyAgt1>
<FinInstnId>
<BICFI>QWERCNXX</BICFI>
<PstlAdr>
<TwnLctnNm>zhangsan</TwnLctnNm>
<DstrctNm>lisi</DstrctNm>
<CtrySubDvsn>wangwu</CtrySubDvsn>
</PstlAdr>
</FinInstnId>
</IntrmyAgt1>
<CdtrAgt>
<FinInstnId>
<BICFI>KREDBEBB</BICFI>
......@@ -172,10 +146,10 @@ Change Log
<PstlAdr>
<StrtNm>Rue Saint Exupery</StrtNm>
<TwnNm> 17/13 4460 GRACE-HOLLOGNE</TwnNm>
<Ctry>BG</Ctry>
<TwnLctnNm>zhangsan</TwnLctnNm>
<DstrctNm>lisi</DstrctNm>
<CtrySubDvsn>wangwu</CtrySubDvsn>
<Ctry>BG</Ctry>
</PstlAdr>
</Cdtr>
<InstrForCdtrAgt>
......
......@@ -25,11 +25,11 @@
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.054.001.08">
<BkToCstmrDbtCdtNtfctn>
<GrpHdr>
<MsgId>FRDA000003421606</MsgId>
<MsgId>FRDA000003421606ddd</MsgId>
<CreDtTm>2022-07-22T10:43:20.604+08:00</CreDtTm>
</GrpHdr>
<Ntfctn>
<Id>FRDA000003421606</Id>
<Id>FRDA000003421606ddd</Id>
<Acct>
<Id>
<Othr>
......
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