Commit 2a7541da by zhanghou

解决空指针

parent 849f11eb
......@@ -110,9 +110,9 @@ public class Mx2MapPacs009Creator extends AbstractMx2MapCreator {
undrlyTxnMaps.put(getPropertyValue("txnRemark"), tag.getValue());
}
if (undrlygCstmrCdtTrfMaps.get("instdAmt") != null) {
BigDecimal amt = (BigDecimal) elementMaps.get("instdAmt");
if (elementMaps.get("instdAmtCcy") != null) {
undrlyTxnMaps.put(getPropertyValue("original.settlement.amt"), elementMaps.get("instdAmtCcy") + " " + amt.toPlainString());
BigDecimal amt = (BigDecimal) undrlygCstmrCdtTrfMaps.get("instdAmt");
if (undrlygCstmrCdtTrfMaps.get("instdAmtCcy") != null) {
undrlyTxnMaps.put(getPropertyValue("original.settlement.amt"), undrlygCstmrCdtTrfMaps.get("instdAmtCcy") + " " + amt.toPlainString());
} else {
undrlyTxnMaps.put(getPropertyValue("original.settlement.amt"), amt.toPlainString());
}
......
......@@ -137,6 +137,7 @@ Change Log
<InstrForNxtAgt>
<InstrInf>123456789</InstrInf>
</InstrForNxtAgt>
<InstdAmt Ccy="EUR">1111</InstdAmt>
</UndrlygCstmrCdtTrf>
</CdtTrfTxInf>
</FICdtTrf>
......
......@@ -19,7 +19,7 @@ public class Mx2ElementTest {
@Test
public void testMx2Map() throws IOException {
// File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/MxPacs00800108.xml"));
File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/Pacs00800108.xml"));
File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/MxPacs00900108_COV.xml"));
//File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/MxPacs00900108.xml"));
//File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/MxPacs00900108_COV.xml"));
//File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/MxCamt05300108_950.xml"));
......
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