Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
swiftMtMx
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
isc-v3.1-tmp
swiftMtMx
Commits
4d7ce604
Commit
4d7ce604
authored
Jun 29, 2022
by
chengzhuoshen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加Mx转Mt转换详细报告
parent
ba761df6
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
340 additions
and
69 deletions
+340
-69
SwiftTransfer.java
...ore/src/main/java/com/brilliance/swift/SwiftTransfer.java
+17
-1
ERROR.java
...e/src/main/java/com/brilliance/swift/constants/ERROR.java
+149
-0
AbstractMx2MtCreator.java
...java/com/brilliance/swift/mx2mt/AbstractMx2MtCreator.java
+5
-1
Mx2MtContextIdentifier.java
...va/com/brilliance/swift/mx2mt/Mx2MtContextIdentifier.java
+0
-2
Mx2MtCreatorManager.java
.../java/com/brilliance/swift/mx2mt/Mx2MtCreatorManager.java
+4
-3
Field20Generate.java
...om/brilliance/swift/mx2mt/mt103/impl/Field20Generate.java
+12
-0
MessageUtil.java
.../src/main/java/com/brilliance/swift/util/MessageUtil.java
+1
-1
SwiftTransferUtil.java
...ain/java/com/brilliance/swift/util/SwiftTransferUtil.java
+43
-22
SwiftTranslationErrorInfo.java
...va/com/brilliance/swift/vo/SwiftTranslationErrorInfo.java
+21
-1
SwiftTranslationReport.java
.../java/com/brilliance/swift/vo/SwiftTranslationReport.java
+35
-0
ErrorCodeList.xlsx
swiftCore/src/main/resources/ErrorCodeList.xlsx
+0
-0
MxPacs00800108.xml
swiftCore/src/main/resources/swiftXml/MxPacs00800108.xml
+1
-1
TestMx2MtFor103.java
...test/java/com/brilliance/mx2mt/mt103/TestMx2MtFor103.java
+19
-3
Test.java
...e/src/test/java/com/brilliance/mx2mt/mt103/retn/Test.java
+2
-2
TestMx2MtFor192.java
...test/java/com/brilliance/mx2mt/mt192/TestMx2MtFor192.java
+2
-2
TestMx2MtFor196.java
...test/java/com/brilliance/mx2mt/mt196/TestMx2MtFor196.java
+2
-2
TestMx2MtFor202.java
...test/java/com/brilliance/mx2mt/mt202/TestMx2MtFor202.java
+2
-2
TestMx2MtFor202COV.java
...t/java/com/brilliance/mx2mt/mt202/TestMx2MtFor202COV.java
+2
-2
Test.java
...e/src/test/java/com/brilliance/mx2mt/mt202/retn/Test.java
+2
-2
TestMx2MtFor210.java
...test/java/com/brilliance/mx2mt/mt210/TestMx2MtFor210.java
+2
-2
TestMx2MtFor292.java
...test/java/com/brilliance/mx2mt/mt292/TestMx2MtFor292.java
+2
-2
TestMx2MtFor900.java
...test/java/com/brilliance/mx2mt/mt900/TestMx2MtFor900.java
+2
-2
TestMx2MtFor910.java
...test/java/com/brilliance/mx2mt/mt910/TestMx2MtFor910.java
+2
-2
Test.java
swiftCore/src/test/java/com/brilliance/mx2mt/mt920/Test.java
+2
-2
TestMx2MtFor941.java
...test/java/com/brilliance/mx2mt/mt941/TestMx2MtFor941.java
+2
-2
TestMx2MtFor296.java
...ava/com/brilliance/mx2mt/mt941/mt296/TestMx2MtFor296.java
+2
-2
TestMx2MtFor942.java
...test/java/com/brilliance/mx2mt/mt942/TestMx2MtFor942.java
+2
-2
TestMx2MtFor950.java
...test/java/com/brilliance/mx2mt/mt950/TestMx2MtFor950.java
+2
-3
Test.java
swiftCore/src/test/java/com/brilliance/mx2mt/mtn99/Test.java
+3
-3
No files found.
swiftCore/src/main/java/com/brilliance/swift/SwiftTransfer.java
View file @
4d7ce604
...
...
@@ -9,6 +9,7 @@ import com.brilliance.swift.util.StringUtil;
import
com.brilliance.swift.util.SwiftTransferUtil
;
import
com.brilliance.swift.util.XmlUtil
;
import
com.brilliance.swift.vo.SwiftDto
;
import
com.brilliance.swift.vo.SwiftTranslationReport
;
import
com.prowidesoftware.swift.model.MxId
;
import
com.prowidesoftware.swift.model.mx.AbstractMX
;
import
com.prowidesoftware.swift.model.mx.NamespaceReader
;
...
...
@@ -40,6 +41,21 @@ public class SwiftTransfer {
}
public
static
String
mx2Mt
(
String
xmlStr
,
String
outPutFilePath
,
Map
<
String
,
Object
>
extraMap
)
throws
SwiftException
{
SwiftTranslationReport
str
=
new
Mx2MtCreatorManager
().
mx2Mt
(
xmlStr
,
outPutFilePath
,
extraMap
);
return
str
.
getMessage
();
}
public
static
SwiftTranslationReport
mx2MtPlus
(
File
file
,
String
outPutFilePath
,
Map
<
String
,
Object
>
extraMap
)
throws
SwiftException
{
try
{
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
return
mx2MtPlus
(
xmlStr
,
outPutFilePath
,
extraMap
);
}
catch
(
IOException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
public
static
SwiftTranslationReport
mx2MtPlus
(
String
xmlStr
,
String
outPutFilePath
,
Map
<
String
,
Object
>
extraMap
)
throws
SwiftException
{
return
new
Mx2MtCreatorManager
().
mx2Mt
(
xmlStr
,
outPutFilePath
,
extraMap
);
}
...
...
@@ -71,7 +87,7 @@ public class SwiftTransfer {
*/
public
static
Map
<
String
,
String
>
mx2MtMap
(
String
xmlStr
,
Map
<
String
,
Object
>
extraMap
)
throws
SwiftException
{
try
{
String
mtStr
=
new
Mx2MtCreatorManager
().
mx2Mt
(
xmlStr
,
null
,
extraMap
);
String
mtStr
=
mx2Mt
(
xmlStr
,
null
,
extraMap
);
Map
<
String
,
String
>
maps
=
MessageReader
.
getSwfMsgInfoViaMsg
(
mtStr
);
AbstractMX
abstractMx
=
AbstractMX
.
parse
(
xmlStr
);
if
(
abstractMx
!=
null
)
{
...
...
swiftCore/src/main/java/com/brilliance/swift/constants/ERROR.java
View file @
4d7ce604
...
...
@@ -8,4 +8,153 @@ public class ERROR {
public
static
String
ERROR_0003
=
"ERROR_0003"
;
public
static
String
ERROR_0003_DESC
=
"swift log config error"
;
public
static
final
String
T20001
=
"T20001"
;
public
static
final
String
T20002
=
"T20002"
;
public
static
final
String
T20003
=
"T20003"
;
public
static
final
String
T20004
=
"T20004"
;
public
static
final
String
T20005
=
"T20005"
;
public
static
final
String
T20006
=
"T20006"
;
public
static
final
String
T20007
=
"T20007"
;
public
static
final
String
T20008
=
"T20008"
;
public
static
final
String
T20009
=
"T20009"
;
public
static
final
String
T20010
=
"T20010"
;
public
static
final
String
T20011
=
"T20011"
;
public
static
final
String
T20012
=
"T20012"
;
public
static
final
String
T20013
=
"T20013"
;
public
static
final
String
T20014
=
"T20014"
;
public
static
final
String
T20015
=
"T20015"
;
public
static
final
String
T20016
=
"T20016"
;
public
static
final
String
T20017
=
"T20017"
;
public
static
final
String
T20018
=
"T20018"
;
public
static
final
String
T20019
=
"T20019"
;
public
static
final
String
T20020
=
"T20020"
;
public
static
final
String
T20021
=
"T20021"
;
public
static
final
String
T20022
=
"T20022"
;
public
static
final
String
T20023
=
"T20023"
;
public
static
final
String
T20024
=
"T20024"
;
public
static
final
String
T20025
=
"T20025"
;
public
static
final
String
T20026
=
"T20026"
;
public
static
final
String
T20027
=
"T20027"
;
public
static
final
String
T20028
=
"T20028"
;
public
static
final
String
T20029
=
"T20029"
;
public
static
final
String
T20030
=
"T20030"
;
public
static
final
String
T20031
=
"T20031"
;
public
static
final
String
T20032
=
"T20032"
;
public
static
final
String
T20033
=
"T20033"
;
public
static
final
String
T20034
=
"T20034"
;
public
static
final
String
T20035
=
"T20035"
;
public
static
final
String
T20036
=
"T20036"
;
public
static
final
String
T20037
=
"T20037"
;
public
static
final
String
T20038
=
"T20038"
;
public
static
final
String
T20039
=
"T20039"
;
public
static
final
String
T20040
=
"T20040"
;
public
static
final
String
T20041
=
"T20041"
;
public
static
final
String
T20042
=
"T20042"
;
public
static
final
String
T20043
=
"T20043"
;
public
static
final
String
T20044
=
"T20044"
;
public
static
final
String
T20045
=
"T20045"
;
public
static
final
String
T20046
=
"T20046"
;
public
static
final
String
T20047
=
"T20047"
;
public
static
final
String
T20048
=
"T20048"
;
public
static
final
String
T20049
=
"T20049"
;
public
static
final
String
T20050
=
"T20050"
;
public
static
final
String
T20051
=
"T20051"
;
public
static
final
String
T20052
=
"T20052"
;
public
static
final
String
T20053
=
"T20053"
;
public
static
final
String
T20054
=
"T20054"
;
public
static
final
String
T20055
=
"T20055"
;
public
static
final
String
T20056
=
"T20056"
;
public
static
final
String
T20057
=
"T20057"
;
public
static
final
String
T20058
=
"T20058"
;
public
static
final
String
T20059
=
"T20059"
;
public
static
final
String
T20060
=
"T20060"
;
public
static
final
String
T20061
=
"T20061"
;
public
static
final
String
T20062
=
"T20062"
;
public
static
final
String
T20063
=
"T20063"
;
public
static
final
String
T20064
=
"T20064"
;
public
static
final
String
T20065
=
"T20065"
;
public
static
final
String
T20066
=
"T20066"
;
public
static
final
String
T20067
=
"T20067"
;
public
static
final
String
T20068
=
"T20068"
;
public
static
final
String
T20069
=
"T20069"
;
public
static
final
String
T20070
=
"T20070"
;
public
static
final
String
T20071
=
"T20071"
;
public
static
final
String
T20072
=
"T20072"
;
public
static
final
String
T20073
=
"T20073"
;
public
static
final
String
T20074
=
"T20074"
;
public
static
final
String
T20075
=
"T20075"
;
public
static
final
String
T20076
=
"T20076"
;
public
static
final
String
T20077
=
"T20077"
;
public
static
final
String
T20078
=
"T20078"
;
public
static
final
String
T20079
=
"T20079"
;
public
static
final
String
T20080
=
"T20080"
;
public
static
final
String
T20081
=
"T20081"
;
public
static
final
String
T20082
=
"T20082"
;
public
static
final
String
T20083
=
"T20083"
;
public
static
final
String
T20084
=
"T20084"
;
public
static
final
String
T20085
=
"T20085"
;
public
static
final
String
T20086
=
"T20086"
;
public
static
final
String
T20087
=
"T20087"
;
public
static
final
String
T20088
=
"T20088"
;
public
static
final
String
T20089
=
"T20089"
;
public
static
final
String
T20090
=
"T20090"
;
public
static
final
String
T20091
=
"T20091"
;
public
static
final
String
T20092
=
"T20092"
;
public
static
final
String
T20093
=
"T20093"
;
public
static
final
String
T20094
=
"T20094"
;
public
static
final
String
T20095
=
"T20095"
;
public
static
final
String
T20096
=
"T20096"
;
public
static
final
String
T20097
=
"T20097"
;
public
static
final
String
T20098
=
"T20098"
;
public
static
final
String
T20099
=
"T20099"
;
public
static
final
String
T20100
=
"T20100"
;
public
static
final
String
T20101
=
"T20101"
;
public
static
final
String
T20102
=
"T20102"
;
public
static
final
String
T20103
=
"T20103"
;
public
static
final
String
T20104
=
"T20104"
;
public
static
final
String
T20105
=
"T20105"
;
public
static
final
String
T20106
=
"T20106"
;
public
static
final
String
T20107
=
"T20107"
;
public
static
final
String
T20108
=
"T20108"
;
public
static
final
String
T20109
=
"T20109"
;
public
static
final
String
T20110
=
"T20110"
;
public
static
final
String
T20111
=
"T20111"
;
public
static
final
String
T20112
=
"T20112"
;
public
static
final
String
T20113
=
"T20113"
;
public
static
final
String
T20114
=
"T20114"
;
public
static
final
String
T20115
=
"T20115"
;
public
static
final
String
T20116
=
"T20116"
;
public
static
final
String
T20117
=
"T20117"
;
public
static
final
String
T20118
=
"T20118"
;
public
static
final
String
T20119
=
"T20119"
;
public
static
final
String
T20120
=
"T20120"
;
public
static
final
String
T20121
=
"T20121"
;
public
static
final
String
T20122
=
"T20122"
;
public
static
final
String
T20123
=
"T20123"
;
public
static
final
String
T20124
=
"T20124"
;
public
static
final
String
T20125
=
"T20125"
;
public
static
final
String
T20126
=
"T20126"
;
public
static
final
String
T20127
=
"T20127"
;
public
static
final
String
T20180
=
"T20180"
;
public
static
final
String
T20181
=
"T20181"
;
public
static
final
String
T20130
=
"T20130"
;
public
static
final
String
T20131
=
"T20131"
;
public
static
final
String
T20197
=
"T20197"
;
public
static
final
String
T20200
=
"T20200"
;
public
static
final
String
T20202
=
"T20202"
;
public
static
final
String
T20217
=
"T20217"
;
public
static
final
String
T20224
=
"T20224"
;
public
static
final
String
T20225
=
"T20225"
;
public
static
final
String
T20227
=
"T20227"
;
public
static
final
String
T15004
=
"T15004"
;
public
static
final
String
T15005
=
"T15005"
;
public
static
final
String
T22000
=
"T22000"
;
public
static
final
String
T22001
=
"T22001"
;
public
static
final
String
T22002
=
"T22002"
;
public
static
final
String
T22003
=
"T22003"
;
public
static
final
String
T22004
=
"T22004"
;
public
static
final
String
T22005
=
"T22005"
;
public
static
final
String
T22006
=
"T22006"
;
public
static
final
String
T0000T
=
"T0000T"
;
public
static
final
String
T0000R
=
"T0000R"
;
}
swiftCore/src/main/java/com/brilliance/swift/mx2mt/AbstractMx2MtCreator.java
View file @
4d7ce604
...
...
@@ -5,6 +5,7 @@ import com.brilliance.swift.exception.SwiftException;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.util.XmlUtil
;
import
com.brilliance.swift.vo.SwiftTranslationReport
;
import
com.brilliance.swift.vo.common.MessagePriority
;
import
com.prowidesoftware.swift.io.ConversionService
;
import
com.prowidesoftware.swift.io.IConversionService
;
...
...
@@ -84,6 +85,8 @@ public abstract class AbstractMx2MtCreator implements Mx2MtCreator {
public
void
preProcess
()
throws
SwiftException
{
SwiftMessage
swiftMessage
=
new
SwiftMessage
();
context
.
set
(
swiftMessage
);
SwiftTranslationReport
str
=
new
SwiftTranslationReport
();
context
.
set
(
str
);
}
@Override
...
...
@@ -239,7 +242,8 @@ public abstract class AbstractMx2MtCreator implements Mx2MtCreator {
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
IConversionService
srv
=
new
ConversionService
();
String
mtStr
=
srv
.
getFIN
(
swiftMessage
);
context
.
set
(
Mx2MtContextIdentifier
.
MT_TXT
,
mtStr
);
SwiftTranslationReport
str
=
context
.
get
(
SwiftTranslationReport
.
class
);
str
.
setMessage
(
mtStr
);
String
outputFilePath
=
(
String
)
context
.
get
(
Mx2MtContextIdentifier
.
MX_TO_MT_OUTPUT_FILE_PATH
,
true
);
if
(
StringUtil
.
isNotEmpty
(
outputFilePath
))
{
write
(
swiftMessage
,
new
File
(
outputFilePath
));
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/Mx2MtContextIdentifier.java
View file @
4d7ce604
...
...
@@ -6,8 +6,6 @@ public class Mx2MtContextIdentifier {
public
static
final
String
MX_OBJ
=
"mx.obj"
;
public
static
final
String
MT_TXT
=
"mt.txt"
;
public
static
final
String
MX_TO_MT_OUTPUT_FILE_PATH
=
"mx.to.mt.output.filepath"
;
public
static
final
String
APPHDR_PARENT_ELEMENT_NAME
=
"apphdr.parent.element.name"
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/Mx2MtCreatorManager.java
View file @
4d7ce604
...
...
@@ -17,6 +17,7 @@ import com.brilliance.swift.mx2mt.mt941942.Mx2Mt941942Creator;
import
com.brilliance.swift.mx2mt.mtn99.Mx2MtN99Creator
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.util.XmlUtil
;
import
com.brilliance.swift.vo.SwiftTranslationReport
;
import
com.prowidesoftware.swift.model.mx.AbstractMX
;
import
org.dom4j.Document
;
import
org.dom4j.DocumentException
;
...
...
@@ -26,7 +27,7 @@ import java.util.Map;
public
class
Mx2MtCreatorManager
{
public
S
tring
mx2Mt
(
String
xml
,
String
fileOutputPath
,
Map
<
String
,
Object
>
extraMap
)
throws
SwiftException
{
public
S
wiftTranslationReport
mx2Mt
(
String
xml
,
String
fileOutputPath
,
Map
<
String
,
Object
>
extraMap
)
throws
SwiftException
{
try
{
AbstractMX
abstractMX
=
AbstractMX
.
parse
(
xml
);
String
messageType
=
(
abstractMX
.
getMxId
().
getBusinessProcess
().
name
()
...
...
@@ -64,8 +65,8 @@ public class Mx2MtCreatorManager {
creator
.
withBlock4
();
creator
.
withBlock5
();
creator
.
postProcess
();
S
tring
xmlStr
=
(
String
)
context
.
get
(
Mx2MtContextIdentifier
.
MT_TXT
);
return
xmlS
tr
;
S
wiftTranslationReport
str
=
context
.
get
(
SwiftTranslationReport
.
class
);
return
s
tr
;
}
catch
(
DocumentException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt103/impl/Field20Generate.java
View file @
4d7ce604
package
com
.
brilliance
.
swift
.
mx2mt
.
mt103
.
impl
;
import
com.brilliance.swift.constants.ERROR
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.util.SwiftTransferUtil
;
import
com.brilliance.swift.vo.SwiftTranslationErrorInfo
;
import
com.brilliance.swift.vo.SwiftTranslationReport
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
...
...
@@ -29,6 +33,14 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
messageId
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.BizMsgIdr"
);
}
if
(
StringUtil
.
isNotEmpty
(
messageId
))
{
if
(
messageId
.
length
()
>
16
)
{
SwiftTranslationReport
str
=
context
.
get
(
SwiftTranslationReport
.
class
);
SwiftTranslationErrorInfo
errorInfo
=
SwiftTransferUtil
.
getSwiftTranslationErrorInfoByErrorCode
(
ERROR
.
T0000T
);
errorInfo
.
setLocation
(
"MT103/BLOCK4/:20:"
);
errorInfo
.
setOriginalValue
(
messageId
);
str
.
addErrorInfo
(
errorInfo
);
messageId
=
messageId
.
substring
(
0
,
15
)
+
"+"
;
}
tags
.
add
(
new
Tag
(
name
,
messageId
));
}
...
...
swiftCore/src/main/java/com/brilliance/swift/util/MessageUtil.java
View file @
4d7ce604
...
...
@@ -8,7 +8,7 @@ import java.util.Properties;
public
class
MessageUtil
{
p
rivate
static
Properties
properties
=
null
;
p
ublic
static
Properties
properties
=
null
;
public
static
String
getPropertyValue
(
String
localCode
,
String
key
)
{
try
{
...
...
swiftCore/src/main/java/com/brilliance/swift/util/SwiftTransferUtil.java
View file @
4d7ce604
...
...
@@ -4,7 +4,7 @@ import cn.hutool.poi.excel.ExcelReader;
import
cn.hutool.poi.excel.ExcelUtil
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.vo.MxMtReasonCodeInfo
;
import
com.brilliance.swift.vo.SwiftTrans
fer
ErrorInfo
;
import
com.brilliance.swift.vo.SwiftTrans
lation
ErrorInfo
;
import
com.brilliance.swift.vo.common.*
;
import
org.xml.sax.SAXException
;
...
...
@@ -26,7 +26,10 @@ import java.util.*;
public
class
SwiftTransferUtil
{
private
static
Properties
properties
=
null
;
public
static
Properties
properties
=
null
;
public
static
List
<
SwiftTranslationErrorInfo
>
stErrorInfos
=
null
;
public
static
XMLGregorianCalendar
getXMLGregorianCalendarNow
()
{
GregorianCalendar
gregorianCalendar
=
new
GregorianCalendar
();
...
...
@@ -733,30 +736,48 @@ public class SwiftTransferUtil {
* 根据ErrorCodeList.xlsx文件返回
* List<SwiftTransferErrorInfo>
*/
public
static
List
<
SwiftTransferErrorInfo
>
getMx2MtErrorCodes
()
{
List
<
SwiftTransferErrorInfo
>
list
=
new
ArrayList
<>();
InputStream
resourceAsStream
=
SwiftTransferUtil
.
class
.
getResourceAsStream
(
"/ErrorCodeList.xlsx"
);
ExcelReader
reader
=
ExcelUtil
.
getReader
(
resourceAsStream
,
"CBPR+"
);
List
<
Map
<
String
,
Object
>>
content
=
reader
.
readAll
();
if
(
content
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
content
.
size
();
i
++)
{
Map
<
String
,
Object
>
contentMaps
=
content
.
get
(
i
);
String
errorCode
=
(
String
)
contentMaps
.
get
(
"ErrorCode"
);
String
description
=
(
String
)
contentMaps
.
get
(
"Description"
);
String
errorType
=
(
String
)
contentMaps
.
get
(
"ErrorType"
);
if
(
StringUtil
.
isNotEmpty
(
errorCode
)
&&
StringUtil
.
isNotEmpty
(
description
))
{
SwiftTransferErrorInfo
stErrorInfo
=
new
SwiftTransferErrorInfo
();
if
(
errorCode
.
indexOf
(
"("
)
>
-
1
)
{
errorCode
=
errorCode
.
substring
(
0
,
errorCode
.
indexOf
(
"("
));
public
static
SwiftTranslationErrorInfo
getSwiftTranslationErrorInfoByErrorCode
(
String
key
)
{
if
(
stErrorInfos
==
null
)
{
stErrorInfos
=
new
ArrayList
<>();
InputStream
resourceAsStream
=
SwiftTransferUtil
.
class
.
getResourceAsStream
(
"/ErrorCodeList.xlsx"
);
ExcelReader
reader
=
ExcelUtil
.
getReader
(
resourceAsStream
,
"CBPR+"
);
List
<
Map
<
String
,
Object
>>
content
=
reader
.
readAll
();
if
(
content
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
content
.
size
();
i
++)
{
Map
<
String
,
Object
>
contentMaps
=
content
.
get
(
i
);
String
errorCode
=
(
String
)
contentMaps
.
get
(
"ErrorCode"
);
String
description
=
(
String
)
contentMaps
.
get
(
"Description"
);
String
errorType
=
(
String
)
contentMaps
.
get
(
"ErrorType"
);
if
(
StringUtil
.
isNotEmpty
(
errorCode
)
&&
StringUtil
.
isNotEmpty
(
description
))
{
SwiftTranslationErrorInfo
stErrorInfo
=
new
SwiftTranslationErrorInfo
();
if
(
errorCode
.
indexOf
(
"("
)
>
-
1
)
{
errorCode
=
errorCode
.
substring
(
0
,
errorCode
.
indexOf
(
"("
));
}
stErrorInfo
.
setErrorCode
(
errorCode
.
trim
());
stErrorInfo
.
setDescription
(
description
.
trim
());
stErrorInfo
.
setErrorType
(
errorType
.
trim
());
stErrorInfos
.
add
(
stErrorInfo
);
}
stErrorInfo
.
setErrorCode
(
errorCode
.
trim
());
stErrorInfo
.
setDescription
(
description
.
trim
());
stErrorInfo
.
setErrorType
(
errorType
.
trim
());
list
.
add
(
stErrorInfo
);
}
}
}
return
list
;
SwiftTranslationErrorInfo
errorInfo
=
null
;
if
(
stErrorInfos
!=
null
&&
stErrorInfos
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
stErrorInfos
.
size
();
i
++)
{
SwiftTranslationErrorInfo
tmpErrorInfo
=
stErrorInfos
.
get
(
i
);
if
(
key
.
equalsIgnoreCase
(
tmpErrorInfo
.
getErrorCode
()))
{
errorInfo
=
tmpErrorInfo
;
break
;
}
}
}
if
(
errorInfo
==
null
)
{
//在errorcode list里面找不到,生成默认值
errorInfo
=
new
SwiftTranslationErrorInfo
();
errorInfo
.
setErrorCode
(
key
);
errorInfo
.
setDescription
(
key
);
errorInfo
.
setErrorType
(
"WARNING"
);
}
return
errorInfo
;
}
public
static
boolean
isAccount
(
String
account
)
{
...
...
swiftCore/src/main/java/com/brilliance/swift/vo/SwiftTrans
fer
ErrorInfo.java
→
swiftCore/src/main/java/com/brilliance/swift/vo/SwiftTrans
lation
ErrorInfo.java
View file @
4d7ce604
package
com
.
brilliance
.
swift
.
vo
;
public
class
SwiftTransferErrorInfo
{
public
class
SwiftTranslationErrorInfo
{
private
String
location
;
private
String
errorCode
;
...
...
@@ -8,6 +10,8 @@ public class SwiftTransferErrorInfo {
private
String
errorType
;
private
String
originalValue
;
public
String
getErrorCode
()
{
return
errorCode
;
}
...
...
@@ -31,4 +35,20 @@ public class SwiftTransferErrorInfo {
public
void
setErrorType
(
String
errorType
)
{
this
.
errorType
=
errorType
;
}
public
String
getLocation
()
{
return
location
;
}
public
void
setLocation
(
String
location
)
{
this
.
location
=
location
;
}
public
String
getOriginalValue
()
{
return
originalValue
;
}
public
void
setOriginalValue
(
String
originalValue
)
{
this
.
originalValue
=
originalValue
;
}
}
swiftCore/src/main/java/com/brilliance/swift/vo/SwiftTranslationReport.java
0 → 100644
View file @
4d7ce604
package
com
.
brilliance
.
swift
.
vo
;
import
java.util.ArrayList
;
import
java.util.List
;
/*
* 报文转换报告
* 1.转换过程中涉及的报文错误警告信息
* 2.目标报文
*/
public
class
SwiftTranslationReport
{
private
List
<
SwiftTranslationErrorInfo
>
errorInfos
;
private
String
message
;
public
List
<
SwiftTranslationErrorInfo
>
getErrorInfos
()
{
if
(
errorInfos
==
null
)
{
errorInfos
=
new
ArrayList
<>();
}
return
errorInfos
;
}
public
void
addErrorInfo
(
SwiftTranslationErrorInfo
errorInfo
)
{
getErrorInfos
().
add
(
errorInfo
);
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
}
swiftCore/src/main/resources/ErrorCodeList.xlsx
View file @
4d7ce604
No preview for this file type
swiftCore/src/main/resources/swiftXml/MxPacs00800108.xml
View file @
4d7ce604
...
...
@@ -45,7 +45,7 @@ Change Log
</GrpHdr>
<CdtTrfTxInf>
<PmtId>
<InstrId>
pacs8bizmsgidr01
</InstrId>
<InstrId>
pacs8bizmsgidr01
qwerssee
</InstrId>
<EndToEndId>
pacs008EndToEndId-001
</EndToEndId>
<UETR>
8a562c67-ca16-48ba-b074-65581be6f001
</UETR>
</PmtId>
...
...
swiftCore/src/test/java/com/brilliance/mx2mt/mt103/TestMx2MtFor103.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mt103
;
import
com.brilliance.swift.mx2mt.Mx2MtCreatorManager
;
import
com.brilliance.swift.SwiftTransfer
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.vo.SwiftTranslationErrorInfo
;
import
com.brilliance.swift.vo.SwiftTranslationReport
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
import
java.util.List
;
public
class
TestMx2MtFor103
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs00800108.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt103
=
new
Mx2MtCreatorManager
().
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt103
);
SwiftTranslationReport
str
=
SwiftTransfer
.
mx2MtPlus
(
xmlStr
,
null
,
null
);
if
(
str
!=
null
)
{
List
<
SwiftTranslationErrorInfo
>
errorInfos
=
str
.
getErrorInfos
();
if
(
errorInfos
!=
null
&&
errorInfos
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
errorInfos
.
size
();
i
++)
{
SwiftTranslationErrorInfo
errorInfo
=
errorInfos
.
get
(
i
);
String
location
=
errorInfo
.
getLocation
();
String
errorType
=
errorInfo
.
getErrorType
();
String
description
=
errorInfo
.
getDescription
();
System
.
out
.
println
(
location
+
Mx2MtConstants
.
NEW_LINE
+
"-"
+
errorType
+
":"
+
description
);
}
}
System
.
out
.
println
(
str
.
getMessage
());
}
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mt103/retn/Test.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mt103
.
retn
;
import
com.brilliance.swift.
mx2mt.Mx2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -10,7 +10,7 @@ public class Test {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs004001_Pacs008.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt103Retn
=
new
Mx2MtCreatorManager
()
.
mx2Mt
(
xmlStr
,
null
,
null
);
String
mt103Retn
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt103Retn
);
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mt192/TestMx2MtFor192.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mt192
;
import
com.brilliance.swift.
mx2mt.Mx2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -9,7 +9,7 @@ public class TestMx2MtFor192 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\Mxcamt05600108_192.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt192
=
new
Mx2MtCreatorManager
()
.
mx2Mt
(
xmlStr
,
null
,
null
);
String
mt192
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt192
);
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mt196/TestMx2MtFor196.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mt196
;
import
com.brilliance.swift.
mx2mt.Mx2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -9,7 +9,7 @@ public class TestMx2MtFor196 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\Mxcamt02900108_196.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt196
=
new
Mx2MtCreatorManager
()
.
mx2Mt
(
xmlStr
,
null
,
null
);
String
mt196
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt196
);
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mt202/TestMx2MtFor202.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mt202
;
import
com.brilliance.swift.
mx2mt.Mx2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -9,7 +9,7 @@ public class TestMx2MtFor202 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs00900108.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt202
=
new
Mx2MtCreatorManager
()
.
mx2Mt
(
xmlStr
,
null
,
null
);
String
mt202
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt202
);
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mt202/TestMx2MtFor202COV.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mt202
;
import
com.brilliance.swift.
mx2mt.Mx2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -9,7 +9,7 @@ public class TestMx2MtFor202COV {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs00900108_COV.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt202
=
new
Mx2MtCreatorManager
()
.
mx2Mt
(
xmlStr
,
null
,
null
);
String
mt202
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt202
);
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mt202/retn/Test.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mt202
.
retn
;
import
com.brilliance.swift.
mx2mt.Mx2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -9,7 +9,7 @@ public class Test {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs004001_Pacs009.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt202Retn
=
new
Mx2MtCreatorManager
()
.
mx2Mt
(
xmlStr
,
null
,
null
);
String
mt202Retn
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt202Retn
);
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mt210/TestMx2MtFor210.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mt210
;
import
com.brilliance.swift.
mx2mt.Mx2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -9,7 +9,7 @@ public class TestMx2MtFor210 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05700106.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt210
=
new
Mx2MtCreatorManager
()
.
mx2Mt
(
xmlStr
,
null
,
null
);
String
mt210
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt210
);
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mt292/TestMx2MtFor292.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mt292
;
import
com.brilliance.swift.
mx2mt.Mx2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -9,7 +9,7 @@ public class TestMx2MtFor292 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\Mxcamt05600108_292.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt292
=
new
Mx2MtCreatorManager
()
.
mx2Mt
(
xmlStr
,
null
,
null
);
String
mt292
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt292
);
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mt900/TestMx2MtFor900.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mt900
;
import
com.brilliance.swift.
mx2mt.Mx2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -10,7 +10,7 @@ public class TestMx2MtFor900 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05400108_DEBIT.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt900
=
new
Mx2MtCreatorManager
()
.
mx2Mt
(
xmlStr
,
null
,
null
);
String
mt900
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt900
);
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mt910/TestMx2MtFor910.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mt910
;
import
com.brilliance.swift.
mx2mt.Mx2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -10,7 +10,7 @@ public class TestMx2MtFor910 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05400108_CREDIT.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt910
=
new
Mx2MtCreatorManager
()
.
mx2Mt
(
xmlStr
,
null
,
null
);
String
mt910
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt910
);
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mt920/Test.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mt920
;
import
com.brilliance.swift.
mx2mt.Mx2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -11,7 +11,7 @@ public class Test {
public
static
void
main
(
String
[]
args
)
throws
IOException
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt06000105.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt920
=
new
Mx2MtCreatorManager
()
.
mx2Mt
(
xmlStr
,
null
,
null
);
String
mt920
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt920
);
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mt941/TestMx2MtFor941.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mt941
;
import
com.brilliance.swift.
mx2mt.Mx2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -9,7 +9,7 @@ public class TestMx2MtFor941 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MXcamt05200108_941.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt941
=
new
Mx2MtCreatorManager
()
.
mx2Mt
(
xmlStr
,
null
,
null
);
String
mt941
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt941
);
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mt941/mt296/TestMx2MtFor296.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mt941
.
mt296
;
import
com.brilliance.swift.
mx2mt.Mx2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -9,7 +9,7 @@ public class TestMx2MtFor296 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\Mxcamt02900108_296.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt296
=
new
Mx2MtCreatorManager
()
.
mx2Mt
(
xmlStr
,
null
,
null
);
String
mt296
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt296
);
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mt942/TestMx2MtFor942.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mt942
;
import
com.brilliance.swift.
mx2mt.Mx2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -9,7 +9,7 @@ public class TestMx2MtFor942 {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MXcamt05200108_942.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt942
=
new
Mx2MtCreatorManager
()
.
mx2Mt
(
xmlStr
,
null
,
null
);
String
mt942
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt942
);
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mt950/TestMx2MtFor950.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mt950
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.mx2mt.Mx2MtCreatorManager
;
import
com.brilliance.swift.SwiftTransfer
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -11,7 +10,7 @@ public class TestMx2MtFor950 {
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
);
String
mt910
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt910
);
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mtn99/Test.java
View file @
4d7ce604
package
com
.
brilliance
.
mx2mt
.
mtn99
;
import
com.brilliance.swift.
mx2mt.Mx2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -10,14 +10,14 @@ public class Test {
public
static
void
test199
()
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs00200110_Pacs008.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt103Retn
=
new
Mx2MtCreatorManager
()
.
mx2Mt
(
xmlStr
,
null
,
null
);
String
mt103Retn
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt103Retn
);
}
public
static
void
test299
()
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs00200110_Pacs009.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
mt103Retn
=
new
Mx2MtCreatorManager
()
.
mx2Mt
(
xmlStr
,
null
,
null
);
String
mt103Retn
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
System
.
out
.
println
(
mt103Retn
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment