Commit f71ed19e by chengzhuoshen

修改940 950模板,filed改成field

parent 1265fddd
...@@ -2,6 +2,7 @@ package com.prowidesoftware.brilliance.mx2mt; ...@@ -2,6 +2,7 @@ package com.prowidesoftware.brilliance.mx2mt;
import com.prowidesoftware.brilliance.exception.SwiftException; import com.prowidesoftware.brilliance.exception.SwiftException;
import com.prowidesoftware.brilliance.mx2mt.mt900910.Mx2Mt900910Creator; import com.prowidesoftware.brilliance.mx2mt.mt900910.Mx2Mt900910Creator;
import com.prowidesoftware.brilliance.mx2mt.mt940950.Mx2Mt950Creator;
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.slf4j.Logger; import org.slf4j.Logger;
...@@ -94,9 +95,9 @@ public class Mx2MtCreateManager { ...@@ -94,9 +95,9 @@ public class Mx2MtCreateManager {
public AbstractMx2MtCreator getMx2MtCreator(String msgType) throws SwiftException { public AbstractMx2MtCreator getMx2MtCreator(String msgType) throws SwiftException {
/*if ("pacs00800102".equals(msgType)) { /*if ("pacs00800102".equals(msgType)) {
return new Mx2Mt103Creator(); return new Mx2Mt103Creator();
} else if ("camt05300102".equals(msgType)) { } else */if ("camt05300102".equals(msgType)) {
return new Mx2Mt950Creator(); return new Mx2Mt950Creator();
} else*/ if ("camt05400102".equals(msgType)) { } else if ("camt05400102".equals(msgType)) {
return new Mx2Mt900910Creator(); return new Mx2Mt900910Creator();
} else { } else {
throw new SwiftException("Invalid message type"); throw new SwiftException("Invalid message type");
......
...@@ -49,7 +49,7 @@ public class Field60Generate extends AbstractMx2MtFieldsGenerate{ ...@@ -49,7 +49,7 @@ public class Field60Generate extends AbstractMx2MtFieldsGenerate{
} else { } else {
throw new SwiftException("ERROR", "cannot find filed60Option."); throw new SwiftException("ERROR", "cannot find filed60Option.");
} }
map.put("filed60Option", filed60Option); map.put("field60Option", filed60Option);
} }
if (bal != null) { if (bal != null) {
String crdr = ""; String crdr = "";
...@@ -72,7 +72,7 @@ public class Field60Generate extends AbstractMx2MtFieldsGenerate{ ...@@ -72,7 +72,7 @@ public class Field60Generate extends AbstractMx2MtFieldsGenerate{
BigDecimal amt = ccyAndAmt.getValue(); BigDecimal amt = ccyAndAmt.getValue();
amtStr = NumberUtil.formatAmt(amt, ccy); amtStr = NumberUtil.formatAmt(amt, ccy);
} }
map.put("filed60", crdr+dateStr+ccy+amtStr); map.put("field60", crdr+dateStr+ccy+amtStr);
} }
} }
} }
......
...@@ -119,7 +119,7 @@ public class Field61ListGenerate extends AbstractMx2MtFieldsGenerate{ ...@@ -119,7 +119,7 @@ public class Field61ListGenerate extends AbstractMx2MtFieldsGenerate{
} }
if (filed61List.size() > 0) { if (filed61List.size() > 0) {
filed61List.forEach(field61 -> logger.info(":61:"+field61)); filed61List.forEach(field61 -> logger.info(":61:"+field61));
map.put("filed61List", filed61List); map.put("field61List", filed61List);
} }
} }
} }
......
...@@ -49,7 +49,7 @@ public class Field62Generate extends AbstractMx2MtFieldsGenerate{ ...@@ -49,7 +49,7 @@ public class Field62Generate extends AbstractMx2MtFieldsGenerate{
} else { } else {
throw new SwiftException("ERROR", "cannot find filed62Option."); throw new SwiftException("ERROR", "cannot find filed62Option.");
} }
map.put("filed62Option", filed62Option); map.put("field62Option", filed62Option);
} }
if (bal != null) { if (bal != null) {
String crdr = ""; String crdr = "";
...@@ -72,7 +72,7 @@ public class Field62Generate extends AbstractMx2MtFieldsGenerate{ ...@@ -72,7 +72,7 @@ public class Field62Generate extends AbstractMx2MtFieldsGenerate{
BigDecimal amt = ccyAndAmt.getValue(); BigDecimal amt = ccyAndAmt.getValue();
amtStr = NumberUtil.formatAmt(amt, ccy); amtStr = NumberUtil.formatAmt(amt, ccy);
} }
map.put("filed62", crdr+dateStr+ccy+amtStr); map.put("field62", crdr+dateStr+ccy+amtStr);
} }
} }
......
...@@ -72,7 +72,7 @@ public class Field64Generate extends AbstractMx2MtFieldsGenerate{ ...@@ -72,7 +72,7 @@ public class Field64Generate extends AbstractMx2MtFieldsGenerate{
amtStr = NumberUtil.formatAmt(amt, ccy); amtStr = NumberUtil.formatAmt(amt, ccy);
} }
String filed64 = crdr+dateStr+ccy+amtStr; String filed64 = crdr+dateStr+ccy+amtStr;
map.put("filed64", filed64); map.put("field64", filed64);
} }
} }
} catch(Exception e) { } catch(Exception e) {
......
...@@ -5,23 +5,23 @@ ...@@ -5,23 +5,23 @@
#end #end
:25a:$vm.field25a :25a:$vm.field25a
:28C:$vm.field28C :28C:$vm.field28C
#if($vm.filed60Option=='F') #if($vm.field60Option=='F')
:60F:$vm.filed60 :60F:$vm.field60
#elseif($vm.filed60Option=='M') #elseif($vm.field60Option=='M')
:60M:$vm.filed60 :60M:$vm.field60
#end #end
#if(!$null.isNull($vm.filed61List) && $vm.filed61List.size()!=0) #if(!$null.isNull($vm.field61List) && $vm.field61List.size()!=0)
#foreach($field61 in $vm.filed61List) #foreach($field61 in $vm.field61List)
:61:$field61 :61:$field61
#end #end
#end #end
#if($vm.filed62Option=='F') #if($vm.field62Option=='F')
:62F:$vm.filed62 :62F:$vm.field62
#elseif($vm.filed62Option=='M') #elseif($vm.field62Option=='M')
:62M:$vm.filed62 :62M:$vm.field62
#end #end
#if(!$null.isNull($vm.filed64) && $vm.filed64.length()>0) #if(!$null.isNull($vm.field64) && $vm.field64.length()>0)
:64:$vm.filed64 :64:$vm.field64
#end #end
#if(!$null.isNull($vm.field65) && $vm.field65.length()>0) #if(!$null.isNull($vm.field65) && $vm.field65.length()>0)
:65:$vm.field65 :65:$vm.field65
......
...@@ -2,22 +2,22 @@ ...@@ -2,22 +2,22 @@
:20:$vm.field20 :20:$vm.field20
:25:$vm.field25a :25:$vm.field25a
:28C:$vm.field28C :28C:$vm.field28C
#if($vm.filed60Option=="F") #if($vm.field60Option=="F")
:60F:$vm.filed60 :60F:$vm.field60
#elseif($vm.filed60Option=="M") #elseif($vm.field60Option=="M")
:60M:$vm.filed60 :60M:$vm.field60
#end #end
#if(!$null.isNull($vm.filed61List) && $vm.filed61List.size()!=0) #if(!$null.isNull($vm.field61List) && $vm.field61List.size()!=0)
#foreach($field61 in $vm.filed61List) #foreach($field61 in $vm.field61List)
:61:$field61 :61:$field61
#end #end
#end #end
#if($vm.filed62Option=="F") #if($vm.field62Option=="F")
:62F:$vm.filed62 :62F:$vm.field62
#elseif($vm.filed62Option=="M") #elseif($vm.field62Option=="M")
:62M:$vm.filed62 :62M:$vm.field62
#end #end
#if(!$null.isNull($vm.filed64) && $vm.filed64.length() > 0) #if(!$null.isNull($vm.field64) && $vm.field64.length() > 0)
:64:$vm.filed64 :64:$vm.field64
#end #end
-}{5:{MAC:6342F3D2}{CHK:C412E5AF7797}{DLM:}} -}{5:{MAC:6342F3D2}{CHK:C412E5AF7797}{DLM:}}
...@@ -9,7 +9,7 @@ public class TestMx2MtFor900 { ...@@ -9,7 +9,7 @@ public class TestMx2MtFor900 {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
Mx2MtCreateManager mx2MtCreateManager = new Mx2MtCreateManager(); Mx2MtCreateManager mx2MtCreateManager = new Mx2MtCreateManager();
String mt900 = mx2MtCreateManager.mx2mt( String mt900 = mx2MtCreateManager.mx2mt(
new File(System.getProperty("user.dir")+"\\swift-core\\src\\main\\resources\\swiftXml\\MxCamt05400102_DEBIT.xml"), new File(System.getProperty("user.dir")+"\\src\\main\\resources\\swiftXml\\MxCamt05400102_DEBIT.xml"),
"D:/test/MT900.txt"); "D:/test/MT900.txt");
System.out.println(mt900); System.out.println(mt900);
} }
......
...@@ -9,7 +9,7 @@ public class TestMx2MtFor950 { ...@@ -9,7 +9,7 @@ public class TestMx2MtFor950 {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
Mx2MtCreateManager mx2MtCreateManager = new Mx2MtCreateManager(); Mx2MtCreateManager mx2MtCreateManager = new Mx2MtCreateManager();
String mt950 = mx2MtCreateManager.mx2mt( String mt950 = mx2MtCreateManager.mx2mt(
new File(System.getProperty("user.dir")+"\\swift-core\\src\\main\\resources\\swiftXml\\MxCamt05300102_950.xml"), new File(System.getProperty("user.dir")+"\\src\\main\\resources\\swiftXml\\MxCamt05300102_950.xml"),
"D:/test/MT950.txt"); "D:/test/MT950.txt");
System.out.println(mt950); System.out.println(mt950);
} }
......
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