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
e687a878
Commit
e687a878
authored
Oct 19, 2022
by
chengzhuoshen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修复pacs008001转103,70域,endtoendid转换问题
2.增加方法去掉50F/59F的Name Address前缀,保证新核心系统拿到了是原始值
parent
6f82518a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
11 deletions
+95
-11
SwiftTransfer.java
...ore/src/main/java/com/brilliance/swift/SwiftTransfer.java
+84
-0
Field70Generate.java
...om/brilliance/swift/mx2mt/mt103/impl/Field70Generate.java
+2
-1
MT103.txt
swiftCore/src/main/resources/swiftTxt/MT103.txt
+9
-10
No files found.
swiftCore/src/main/java/com/brilliance/swift/SwiftTransfer.java
View file @
e687a878
...
...
@@ -8,7 +8,14 @@ import com.brilliance.swift.mx2map.Mx2MapCreatorManager;
import
com.brilliance.swift.mx2mt.Mx2MtCreatorManager
;
import
com.brilliance.swift.util.*
;
import
com.brilliance.swift.vo.SwiftTranslationReport
;
import
com.prowidesoftware.swift.io.ConversionService
;
import
com.prowidesoftware.swift.io.IConversionService
;
import
com.prowidesoftware.swift.model.MxId
;
import
com.prowidesoftware.swift.model.SwiftBlock4
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.field.Field50F
;
import
com.prowidesoftware.swift.model.field.Field59F
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
com.prowidesoftware.swift.model.mx.AbstractMX
;
import
com.prowidesoftware.swift.model.mx.NamespaceReader
;
import
org.apache.commons.io.FileUtils
;
...
...
@@ -416,4 +423,81 @@ public class SwiftTransfer {
return
fetchFinFromMixMessage
(
mixFilePath
);
}
}
/**
* 特殊处理mt报文
* 50F 去掉 1/ 2/ 3/
* 59F 去掉 1/ 2/ 3/
* 保证给新核心系统的报文要素名称地址的正确性
*/
public
static
String
clearFin5059FPrefix
(
String
mtMsg
)
{
try
{
AbstractMT
abstractMT
=
AbstractMT
.
parse
(
mtMsg
);
if
(
abstractMT
==
null
||
abstractMT
.
getSwiftMessage
()
==
null
||
abstractMT
.
getSwiftMessage
().
getBlock4
()
==
null
)
{
return
mtMsg
;
}
SwiftBlock4
swiftBlock4
=
abstractMT
.
getSwiftMessage
().
getBlock4
();
Tag
tag
=
swiftBlock4
.
getTagByName
(
"50F"
);
if
(
tag
!=
null
)
{
Field50F
field50F
=
(
Field50F
)
tag
.
asField
();
String
value
=
field50F
.
getPartyIdentifier
();
if
(
StringUtil
.
isNotEmpty
(
field50F
.
getNameAndAddress1
()))
{
value
+=
Mx2MtConstants
.
NEW_LINE
+
field50F
.
getNameAndAddress1
();
}
if
(
StringUtil
.
isNotEmpty
(
field50F
.
getNameAndAddress2
()))
{
value
+=
Mx2MtConstants
.
NEW_LINE
+
field50F
.
getNameAndAddress2
();
}
if
(
StringUtil
.
isNotEmpty
(
field50F
.
getNameAndAddress3
()))
{
value
+=
Mx2MtConstants
.
NEW_LINE
+
field50F
.
getNameAndAddress3
();
}
if
(
StringUtil
.
isNotEmpty
(
field50F
.
getNameAndAddress4
()))
{
value
+=
Mx2MtConstants
.
NEW_LINE
+
field50F
.
getNameAndAddress4
();
}
tag
.
setValue
(
value
);
}
tag
=
swiftBlock4
.
getTagByName
(
"59F"
);
if
(
tag
!=
null
)
{
Field59F
field59F
=
(
Field59F
)
tag
.
asField
();
String
value
=
""
;
if
(
StringUtil
.
isNotEmpty
(
field59F
.
getComponent1
()))
{
value
+=
"/"
+
field59F
.
getComponent1
();
}
if
(
StringUtil
.
isNotEmpty
(
field59F
.
getNameAndAddress1
()))
{
if
(
StringUtil
.
isEmpty
(
value
))
{
value
+=
field59F
.
getNameAndAddress1
();
}
else
{
value
+=
Mx2MtConstants
.
NEW_LINE
+
field59F
.
getNameAndAddress1
();
}
}
if
(
StringUtil
.
isNotEmpty
(
field59F
.
getNameAndAddress2
()))
{
if
(
StringUtil
.
isEmpty
(
value
))
{
value
+=
field59F
.
getNameAndAddress2
();
}
else
{
value
+=
Mx2MtConstants
.
NEW_LINE
+
field59F
.
getNameAndAddress2
();
}
}
if
(
StringUtil
.
isNotEmpty
(
field59F
.
getNameAndAddress3
()))
{
if
(
StringUtil
.
isEmpty
(
value
))
{
value
+=
field59F
.
getNameAndAddress3
();
}
else
{
value
+=
Mx2MtConstants
.
NEW_LINE
+
field59F
.
getNameAndAddress3
();
}
}
if
(
StringUtil
.
isNotEmpty
(
field59F
.
getNameAndAddress4
()))
{
if
(
StringUtil
.
isEmpty
(
value
))
{
value
+=
field59F
.
getNameAndAddress4
();
}
else
{
value
+=
Mx2MtConstants
.
NEW_LINE
+
field59F
.
getNameAndAddress4
();
}
}
tag
.
setValue
(
value
);
}
IConversionService
srv
=
new
ConversionService
();
return
srv
.
getFIN
(
abstractMT
.
getSwiftMessage
());
}
catch
(
Exception
e
)
{
throw
new
SwiftException
(
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt103/impl/Field70Generate.java
View file @
e687a878
package
com
.
brilliance
.
swift
.
mx2mt
.
mt103
.
impl
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate
;
import
com.brilliance.swift.util.StringUtil
;
...
...
@@ -117,7 +118,7 @@ public class Field70Generate extends AbstractMx2MtTagsGenerate {
}
}
String
endToEndIdentification
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.PmtId.EndToEndId"
);
if
(
StringUtil
.
isNotEmpty
(
endToEndIdentification
))
{
if
(
StringUtil
.
isNotEmpty
(
endToEndIdentification
)
&&
!
Mx2MtConstants
.
MX_TO_MT_DEFAULT_VALUE
.
equals
(
endToEndIdentification
)
)
{
if
(
StringUtil
.
isEmpty
(
mt70FullString
))
{
int
remainLength
=
140
-
mt70FullString
.
length
()
-
5
;
if
(
remainLength
>
0
)
{
...
...
swiftCore/src/main/resources/swiftTxt/MT103.txt
View file @
e687a878
...
...
@@ -3,18 +3,17 @@
:23B:CRED
:32A:220906USD1000,
:33B:USD1000,
:50K:/36921469
10
beijingshifengtaiqu
beijingshikunlunzhongxin
beijingshi
:50F:/36921469
1/10
2/beijingshifengtaiqu
3/CN/beijingshikunlunzhongxin
:52A:CITIUS33XXX
:57A:PSBCCNBJXXX
:59:/FTT883320000031295
zhangxinyao
beijingshifengtaiqu
beijingshikunlunzhongxin
beijingshi
:59
F
:/FTT883320000031295
1/
zhangxinyao
2/
beijingshifengtaiqu
3/
beijingshikunlunzhongxin
3/
beijingshi
:70:/ROC/NOTPROVIDED///URI/.BUYING GOOD
S ADDL REMITTER INFO:CR 355255
:71A:SHA
...
...
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