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
bc69c3b6
Commit
bc69c3b6
authored
Jun 09, 2023
by
zhanghou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成对测试报文bic的处理
parent
2ffa4c81
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
2 deletions
+30
-2
encodings.xml
.idea/encodings.xml
+7
-0
AbstractMx2MtCreator.java
...java/com/brilliance/swift/mx2mt/AbstractMx2MtCreator.java
+10
-2
Mx2MtContextIdentifier.java
...va/com/brilliance/swift/mx2mt/Mx2MtContextIdentifier.java
+2
-0
Mx2MtCreatorManager.java
.../java/com/brilliance/swift/mx2mt/Mx2MtCreatorManager.java
+11
-0
No files found.
.idea/encodings.xml
0 → 100644
View file @
bc69c3b6
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"Encoding"
>
<file
url=
"PROJECT"
charset=
"UTF-8"
/>
</component>
</project>
\ No newline at end of file
swiftCore/src/main/java/com/brilliance/swift/mx2mt/AbstractMx2MtCreator.java
View file @
bc69c3b6
...
...
@@ -360,12 +360,20 @@ public abstract class AbstractMx2MtCreator implements Mx2MtCreator {
if
(
StringUtil
.
isEmpty
(
senderBic
))
{
senderBic
=
getXmlNodeValue
(
appHdrParentPath
,
document
,
"AppHdr.Fr.FIId.FinInstnId.BICFI"
);
}
context
.
set
(
Mx2MtContextIdentifier
.
MX_SENDER_BIC
,
senderBic
);
String
receiverBic
=
(
String
)
context
.
get
(
Mx2MtConstants
.
RECEIVERS_ADDRESS
,
true
);
if
(
StringUtil
.
isEmpty
(
receiverBic
))
{
receiverBic
=
getXmlNodeValue
(
appHdrParentPath
,
document
,
"AppHdr.To.FIId.FinInstnId.BICFI"
);
}
String
service
=
(
String
)
context
.
get
(
Mx2MtContextIdentifier
.
MX_TO_MT_SERVICE
);
if
(!
StringUtil
.
isEmpty
(
service
)&&!
"swift.finplus"
.
equals
(
service
)){
StringBuilder
replaceSenderBic
=
new
StringBuilder
(
senderBic
);
replaceSenderBic
.
replace
(
7
,
8
,
"0"
);
StringBuilder
replaceReceiverBic
=
new
StringBuilder
(
senderBic
);
replaceReceiverBic
.
replace
(
7
,
8
,
"0"
);
senderBic
=
replaceSenderBic
.
toString
();
receiverBic
=
replaceReceiverBic
.
toString
();
}
context
.
set
(
Mx2MtContextIdentifier
.
MX_SENDER_BIC
,
senderBic
);
context
.
set
(
Mx2MtContextIdentifier
.
MX_RECEIVER_BIC
,
receiverBic
);
String
applicationMode
=
(
String
)
context
.
get
(
Mx2MtConstants
.
APPLICATION_MODE
,
true
);
if
(
"O"
.
equalsIgnoreCase
(
applicationMode
))
{
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/Mx2MtContextIdentifier.java
View file @
bc69c3b6
...
...
@@ -28,4 +28,6 @@ public class Mx2MtContextIdentifier {
public
static
final
String
MX_TO_MT_LISTENER_CLASS
=
"mx.to.mt.listener.class"
;
public
static
final
String
MX_TO_MT_SERVICE
=
"mx.to.mt.service"
;
}
swiftCore/src/main/java/com/brilliance/swift/mx2mt/Mx2MtCreatorManager.java
View file @
bc69c3b6
package
com
.
brilliance
.
swift
.
mx2mt
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.context.Context
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mx2mt.mt103.Mx2Mt103Creator
;
import
com.brilliance.swift.mx2mt.mt103Retn.Mx2Mt103RetnCreator
;
...
...
@@ -41,6 +42,8 @@ public class Mx2MtCreatorManager {
//+ abstractMX.getMxId().getVersion())
.
trim
();
Mx2MtContext
context
=
new
Mx2MtContext
();
String
service
=
getServiceMessage
(
xml
);
context
.
set
(
Mx2MtContextIdentifier
.
MX_TO_MT_SERVICE
,
service
);
Document
document
=
DocumentHelper
.
parseText
(
xml
);
context
.
set
(
Mx2MtContextIdentifier
.
MX_TO_MT_LISTENER_CLASS
,
new
Mx2MtListener
());
//注册监听器
context
.
set
(
Mx2MtContextIdentifier
.
MX_XMl_DOCUMENT
,
document
);
...
...
@@ -77,6 +80,14 @@ public class Mx2MtCreatorManager {
throw
new
SwiftException
(
e
.
getMessage
());
}
}
public
String
getServiceMessage
(
String
xml
){
if
(
xml
.
contains
(
"Saa:Service"
)){
int
beginIndex
=
xml
.
indexOf
(
"<Saa:Service>"
);
int
endIndex
=
xml
.
indexOf
(
"</Saa:Service>"
);
return
xml
.
substring
(
beginIndex
+
"<Saa:Service>"
.
length
(),
endIndex
);
}
return
null
;
}
public
AbstractMx2MtCreator
getCreator
(
String
messageType
)
{
if
(
"pacs008001"
.
equals
(
messageType
))
{
...
...
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