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
3b51a6e4
Commit
3b51a6e4
authored
Mar 21, 2023
by
zhanghou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加判断pacs00900108是不是adv的方法
parent
8f0e7250
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
SwiftTransfer.java
...ore/src/main/java/com/brilliance/swift/SwiftTransfer.java
+6
-0
MxPacs00900108_COV.xml
swiftCore/src/main/resources/swiftXml/MxPacs00900108_COV.xml
+1
-1
Mx2MtTest.java
swiftCore/src/test/java/com/brilliance/Mx2MtTest.java
+1
-1
No files found.
swiftCore/src/main/java/com/brilliance/swift/SwiftTransfer.java
View file @
3b51a6e4
...
...
@@ -11,6 +11,8 @@ import com.brilliance.swift.util.*;
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.AppHdr
;
import
com.prowidesoftware.swift.model.mx.BusinessAppHdrV02
;
import
com.prowidesoftware.swift.model.mx.NamespaceReader
;
import
org.apache.commons.io.FileUtils
;
import
org.dom4j.Document
;
...
...
@@ -129,10 +131,14 @@ public class SwiftTransfer {
SwiftTranslationReport
str
=
mx2MtPlus
(
xmlStr
,
null
,
extraMap
);
Map
<
String
,
String
>
maps
=
MxMessageReader
.
getSwfMsgInfoViaMsg
(
str
);
AbstractMX
abstractMx
=
AbstractMX
.
parse
(
xmlStr
);
String
serviceName
=
abstractMx
.
getAppHdr
().
serviceName
();
if
(
abstractMx
!=
null
)
{
String
messageType
=
abstractMx
.
getMxId
().
id
();
maps
.
put
(
"xty"
,
messageType
);
//ISO20022类型
if
(
messageType
.
startsWith
(
"pacs.008.001"
)
||
messageType
.
startsWith
(
"pacs.009.001"
))
{
if
(
messageType
.
startsWith
(
"pacs.009.001"
)&&
StringUtil
.
isNotEmpty
(
serviceName
)&&
serviceName
.
contains
(
"adv"
)){
maps
.
put
(
"mty"
,
"202ADV"
);
}
Document
document
=
DocumentHelper
.
parseText
(
xmlStr
);
Map
<
String
,
String
>
parentElementMaps
=
XmlUtil
.
getParentElementMaps
(
document
);
String
bodyParentElementName
=
parentElementMaps
.
get
(
"CdtTrfTxInf"
);
...
...
swiftCore/src/main/resources/swiftXml/MxPacs00900108_COV.xml
View file @
3b51a6e4
...
...
@@ -30,7 +30,7 @@ Change Log
</To>
<BizMsgIdr>
pacs9bizmsgidr02
</BizMsgIdr>
<MsgDefIdr>
pacs.009.001.08
</MsgDefIdr>
<BizSvc>
swift.cbprplus.
co
v.02
</BizSvc>
<BizSvc>
swift.cbprplus.
ad
v.02
</BizSvc>
<CreDt>
2021-05-17T10:23:41.00+01:00
</CreDt>
</AppHdr>
<Document
xmlns=
"urn:iso:std:iso:20022:tech:xsd:pacs.009.001.08"
>
...
...
swiftCore/src/test/java/com/brilliance/Mx2MtTest.java
View file @
3b51a6e4
...
...
@@ -268,7 +268,7 @@ public class Mx2MtTest {
@Test
public
void
testMx2MtMap
()
throws
IOException
{
File
file
=
FileUtils
.
toFile
(
Mx2MtTest
.
class
.
getResource
(
"/swiftXml/MxPacs00
4001_Pacs008
.xml"
));
File
file
=
FileUtils
.
toFile
(
Mx2MtTest
.
class
.
getResource
(
"/swiftXml/MxPacs00
900108_COV
.xml"
));
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
Map
<
String
,
String
>
maps
=
SwiftTransfer
.
mx2MtMap
(
xmlStr
,
null
);
for
(
String
key
:
maps
.
keySet
())
{
...
...
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