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
de0287c5
Commit
de0287c5
authored
Jul 14, 2022
by
chengzhuoshen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加mx报文转要素的功能
parent
2c15fa67
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
1 deletions
+31
-1
SwiftTransfer.java
...ore/src/main/java/com/brilliance/swift/SwiftTransfer.java
+10
-0
MessageUtil.java
.../src/main/java/com/brilliance/swift/util/MessageUtil.java
+1
-1
MxPacs00800108.xml
swiftCore/src/main/resources/swiftXml/MxPacs00800108.xml
+3
-0
Test.java
swiftCore/src/test/java/com/brilliance/mx2element/Test.java
+17
-0
No files found.
swiftCore/src/main/java/com/brilliance/swift/SwiftTransfer.java
View file @
de0287c5
...
...
@@ -2,6 +2,7 @@ package com.brilliance.swift;
import
com.brilliance.swift.exception.SwiftException
;
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.StringUtil
;
...
...
@@ -207,4 +208,13 @@ public class SwiftTransfer {
}
return
true
;
}
/**
* MX 报文转json要素
* @param xmlStr
* @return
*/
public
static
String
mx2Element
(
String
xmlStr
)
{
return
new
Mx2ElementCreatorManager
().
mx2Element
(
xmlStr
);
}
}
swiftCore/src/main/java/com/brilliance/swift/util/MessageUtil.java
View file @
de0287c5
...
...
@@ -17,7 +17,7 @@ public class MessageUtil {
if
(
"US"
.
equals
(
localCode
))
{
fileName
=
"/Messages_US.properties"
;
}
InputStream
resourceAsStream
=
SwiftTransfer
Util
.
class
.
getResourceAsStream
(
fileName
);
InputStream
resourceAsStream
=
Message
Util
.
class
.
getResourceAsStream
(
fileName
);
properties
=
new
Properties
();
properties
.
load
(
resourceAsStream
);
}
...
...
swiftCore/src/main/resources/swiftXml/MxPacs00800108.xml
View file @
de0287c5
...
...
@@ -68,6 +68,9 @@ Change Log
<StrtNm>
High Street
</StrtNm>
<TwnNm>
Epping
</TwnNm>
<Ctry>
GB
</Ctry>
<AdrLine>
123
</AdrLine>
<AdrLine>
456
</AdrLine>
<AdrLine>
789
</AdrLine>
</PstlAdr>
</Dbtr>
<DbtrAgt>
...
...
swiftCore/src/test/java/com/brilliance/mx2element/Test.java
0 → 100644
View file @
de0287c5
package
com
.
brilliance
.
mx2element
;
import
com.brilliance.swift.SwiftTransfer
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
import
java.io.IOException
;
public
class
Test
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
File
file
=
new
File
(
"d:/test/MxPacs00800108.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
jsonStr
=
SwiftTransfer
.
mx2Element
(
xmlStr
);
System
.
out
.
println
(
jsonStr
);
}
}
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