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
98e670b3
Commit
98e670b3
authored
Sep 20, 2022
by
chengzhuoshen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复转换代码bug-2
parent
90ea8c07
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
101 additions
and
74 deletions
+101
-74
SwiftTransfer.java
...ore/src/main/java/com/brilliance/swift/SwiftTransfer.java
+8
-0
Field61Generate.java
...brilliance/swift/mx2mt/mt940950/impl/Field61Generate.java
+5
-4
Field61Generate.java
...brilliance/swift/mx2mt/mt941942/impl/Field61Generate.java
+2
-2
MT103.txt
swiftCore/src/main/resources/swiftTxt/MT103.txt
+6
-5
MT950.txt
swiftCore/src/main/resources/swiftTxt/MT950.txt
+8
-10
MxCamt05300108_950.xml
swiftCore/src/main/resources/swiftXml/MxCamt05300108_950.xml
+1
-1
MxPacs00800108.xml
swiftCore/src/main/resources/swiftXml/MxPacs00800108.xml
+65
-51
Mt2MxTest.java
swiftCore/src/test/java/com/brilliance/Mt2MxTest.java
+5
-0
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 @
98e670b3
...
...
@@ -148,6 +148,14 @@ public class SwiftTransfer {
if
(
StringUtil
.
isNotEmpty
(
endToEndId
))
{
maps
.
put
(
"endToEndId"
,
endToEndId
);
}
}
else
if
(
messageType
.
startsWith
(
"pacs.004.001"
))
{
Document
document
=
DocumentHelper
.
parseText
(
xmlStr
);
Map
<
String
,
String
>
parentElementMaps
=
XmlUtil
.
getParentElementMaps
(
document
);
String
bodyParentElementName
=
parentElementMaps
.
get
(
"TxInf"
);
String
endToEndId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".TxInf.OrgnlEndToEndId"
);
if
(
StringUtil
.
isNotEmpty
(
endToEndId
))
{
maps
.
put
(
"endToEndId"
,
endToEndId
);
}
}
}
return
maps
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt940950/impl/Field61Generate.java
View file @
98e670b3
...
...
@@ -112,10 +112,11 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
value
+=
Mx2MtConstants
.
MT_21_DEFAULT_VALUE
;
}
}
//MX转MT mapping文档中不翻译以下信息
/*
String accountServicerReference = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Ntry("+i+").AcctSvcrRef");
//MX转MT mapping文档中不翻译以下信息
,PSBC版本需要此逻辑完成MT103 MX950对账关联勾销
String
accountServicerReference
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Stmt.Ntry("
+
i
+
").AcctSvcrRef"
);
if
(
StringUtil
.
isNotEmpty
(
accountServicerReference
))
{
if
(
accountServicerReference
.
length
()
>
16
)
{
buildSTErrorInfo
(
12
,
"Block4/:61:"
,
accountServicerReference
);
accountServicerReference
=
accountServicerReference
.
substring
(
0
,
15
)
+
"+"
;
}
value
+=
"//"
+
accountServicerReference
;
...
...
@@ -123,11 +124,11 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
String
additionalInformation
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Stmt.Ntry("
+
i
+
").NtryDtls.TxDtls.AddtlTxInf"
);
if
(
StringUtil
.
isNotEmpty
(
additionalInformation
))
{
if
(
additionalInformation
.
length
()
>
34
)
{
buildSTErrorInfo(12, "Block4/
61
", additionalInformation);
buildSTErrorInfo
(
12
,
"Block4/
:61:
"
,
additionalInformation
);
additionalInformation
=
additionalInformation
.
substring
(
0
,
33
)
+
"+"
;
}
value
+=
Mx2MtConstants
.
NEW_LINE
+
additionalInformation
;
}
*/
}
value
=
mx_to_mtStartingLineCharacter
(
value
,
"Block4/61"
);
tags
.
add
(
new
Tag
(
name_61
,
value
));
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt941942/impl/Field61Generate.java
View file @
98e670b3
...
...
@@ -103,7 +103,7 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
value
+=
Mx2MtConstants
.
MT_21_DEFAULT_VALUE
;
}
//MX转MT mapping文档中不翻译以下信息
/*
String accountServicerReference = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Ntry("+i+").AcctSvcrRef");
String
accountServicerReference
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.Ntry("
+
i
+
").AcctSvcrRef"
);
if
(
StringUtil
.
isNotEmpty
(
accountServicerReference
))
{
if
(
accountServicerReference
.
length
()
>
16
)
{
buildSTErrorInfo
(
12
,
"BLOCK4/:61:"
,
accountServicerReference
);
...
...
@@ -118,7 +118,7 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
additionalInformation
=
additionalInformation
.
substring
(
0
,
33
)
+
"+"
;
}
value
+=
Mx2MtConstants
.
NEW_LINE
+
additionalInformation
;
}
*/
}
tags
.
add
(
new
Tag
(
name_61
,
value
));
//MX转MT mapping文档中不翻译以下信息
/*String additionalEntryInformation = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Ntry("+i+").AddtlNtryInf");
...
...
swiftCore/src/main/resources/swiftTxt/MT103.txt
View file @
98e670b3
{1:F01PSBCCNBJ
AXXX1103110461}{2:O1030825201018CITIUS33AXXX71512921532010182025N}{3:{108:PM22082600000100
}{111:001}{121:6bd1dbad-21cf-4334-8dd5-64e92c270124}}{4:
{1:F01PSBCCNBJ
XXXX0000000000}{2:O1031010220915CITIUS33XXXX00000000002209201350N}{3:{119:STP
}{111:001}{121:6bd1dbad-21cf-4334-8dd5-64e92c270124}}{4:
:20:PM220914MX103001
:23B:CRED
:32A:220906USD1000,
...
...
@@ -8,14 +8,14 @@
beijingshifengtaiqu
beijingshikunlunzhongxin
beijingshi
:5
3A:PSBCCNBJ
XXX
:5
4A:CITIUS33
XXX
:5
2A:CITIUS33
XXX
:5
7A:PSBCCNBJ
XXX
:59:/FTT883320000031295
zhangxinyao
beijingshifengtaiqu
beijingshikunlunzhongxin
beijingshi
:70:
.BUYING GOODS
ADDL REMITTER INFO:CR 355255
:70:
/ROC/NOTPROVIDED///URI/.BUYING GOOD
S
ADDL REMITTER INFO:CR 355255
:71A:SHA
-}
\ No newline at end of file
swiftCore/src/main/resources/swiftTxt/MT950.txt
View file @
98e670b3
{1:F01BJWHS12XAXXX3202321018}{2:O9501024220428SHWHQWERA12308503578012205051522N}{3:{108:2205051522260719}{121:8a562c67-ca16-48ba-b074-65581be6f001}}{4:
:20:00010013800002001234
:25:S15612345678012345
:28C:178/200
:60M:D220330USD377583,30
:61:220330220330DUSD4371,FCHKS100000189-735//1309170100000390154395
PLACI LOVECNAMENSKIH WUHAN
:61:220330220430DUSD445,FCHKS100000189-735//1309170100000390154395
PLACI LOVECNAMENSKIH STORITEV
:62M:D220330USD3372767,30
{1:F01PSBCCNBJXXXX3202321018}{2:O9501024220428CITIUS33AXXX08503578012205051522N}{3:{108:2205051522260719}{121:6bd1dbad-21cf-4334-8dd5-64e92c270124}}{4:
:20:MX2MX95009200001
:25:36921469
:28C:00006/00001
:60F:C220906USD2008000,
:61:2209070907CUSD1500,NTRF20220920ENDID001
:62F:C220907USD2009500,
-}
\ No newline at end of file
swiftCore/src/main/resources/swiftXml/MxCamt05300108_950.xml
View file @
98e670b3
...
...
@@ -89,7 +89,7 @@
<TxDtls>
<Refs>
<AcctSvcrRef>
HSBCREF-125646
</AcctSvcrRef>
<
EndToEndId>
pacs008EndToEndId-001
</EndToEndId
>
<
!--<EndToEndId>pacs008EndToEndId-001</EndToEndId>--
>
<UETR>
02713bdc-7257-4205-aebc-c3cd0a84d9c5
</UETR>
</Refs>
<Amt
Ccy=
"EUR"
>
65124.23
</Amt>
...
...
swiftCore/src/main/resources/swiftXml/MxPacs00800108.xml
View file @
98e670b3
<Request>
<?xml version="1.0" encoding="UTF-8" ?>
<RequestPayload>
<AppHdr
xmlns=
"urn:iso:std:iso:20022:tech:xsd:head.001.001.02"
>
<Fr>
<FIId>
<FinInstnId>
<BICFI>
AABBGB2
X
</BICFI>
<BICFI>
CITIUS33XX
X
</BICFI>
</FinInstnId>
</FIId>
</Fr>
<To>
<FIId>
<FinInstnId>
<BICFI>
AABBIE2
X
</BICFI>
<BICFI>
PSBCCNBJXX
X
</BICFI>
</FinInstnId>
</FIId>
</To>
<BizMsgIdr>
Buzmsgidtfr/020322/
001
</BizMsgIdr>
<MsgDefIdr>
Msgidtfr/020322/001
</MsgDefIdr>
<BizMsgIdr>
PM220914MX103
001
</BizMsgIdr>
<MsgDefIdr>
pacs.008.001.08
</MsgDefIdr>
<BizSvc>
swift.cbprplus.02
</BizSvc>
<CreDt>
2022-03-03T08:22:08+01:00
</CreDt>
<CreDt>
2022-09-15T10:10:28.966+08:00
</CreDt>
<PssblDplct>
false
</PssblDplct>
<Prty>
NORM
</Prty>
</AppHdr>
<Document
xmlns=
"urn:iso:std:iso:20022:tech:xsd:pacs.008.001.08"
>
<FIToFICstmrCdtTrf>
<GrpHdr>
<MsgId>
Msgidetfcn/02/03/2022/
001
</MsgId>
<CreDtTm>
2022-0
3-02T09:24:16+01
:00
</CreDtTm>
<MsgId>
PM220914MX103
001
</MsgId>
<CreDtTm>
2022-0
9-15T10:10:28.966+08
:00
</CreDtTm>
<NbOfTxs>
1
</NbOfTxs>
<SttlmInf>
<SttlmMtd>
INDA
</SttlmMtd>
<SttlmMtd>
COVE
</SttlmMtd>
<InstgRmbrsmntAgt>
<FinInstnId>
<BICFI>
PSBCCNBJXXX
</BICFI>
</FinInstnId>
</InstgRmbrsmntAgt>
<InstdRmbrsmntAgt>
<FinInstnId>
<BICFI>
CITIUS33XXX
</BICFI>
</FinInstnId>
</InstdRmbrsmntAgt>
</SttlmInf>
</GrpHdr>
<CdtTrfTxInf>
<PmtId>
<InstrId>
Instrid-001
</InstrId>
<EndToEndId>
e2eid/02/03/2022/001
</EndToEndId>
<UETR>
5ddd156b-ba52-4d7d-a7ea-197cf311dc19
</UETR>
<ClrSysRef>
ddd
</ClrSysRef>
<InstrId>
PM220914MX103001
</InstrId>
<EndToEndId>
NOTPROVIDED
</EndToEndId>
<UETR>
6bd1dbad-21cf-4334-8dd5-64e92c270124
</UETR>
</PmtId>
<IntrBkSttlmAmt
Ccy=
"EUR"
>
100.
</IntrBkSttlmAmt>
<IntrBkSttlmDt>
2022-03-04+01:00
</IntrBkSttlmDt>
<InstdAmt
Ccy=
"EUR"
>
110.
</InstdAmt>
<ChrgBr>
DEBT
</ChrgBr>
<ChrgsInf>
<Amt
Ccy=
"EUR"
>
99999999999999.
</Amt>
<Agt>
<FinInstnId>
PSBCCNBJ
</FinInstnId>
</Agt>
</ChrgsInf>
<ChrgsInf>
<Amt
Ccy=
"EUR"
>
99999999999999.
</Amt>
<Agt>
<FinInstnId>
PSBCCNBJ
</FinInstnId>
</Agt>
</ChrgsInf>
<PmtTpInf>
<SvcLvl>
<Cd>
G001
</Cd>
</SvcLvl>
</PmtTpInf>
<IntrBkSttlmAmt
Ccy=
"USD"
>
1000
</IntrBkSttlmAmt>
<IntrBkSttlmDt>
2022-09-06
</IntrBkSttlmDt>
<InstdAmt
Ccy=
"USD"
>
1000
</InstdAmt>
<ChrgBr>
SHAR
</ChrgBr>
<InstgAgt>
<FinInstnId>
<BICFI>
AABBGB2
X
</BICFI>
<BICFI>
CITIUS33XX
X
</BICFI>
</FinInstnId>
</InstgAgt>
<InstdAgt>
<FinInstnId>
<BICFI>
AABBIE2X
</BICFI>
<LEI>
123456789
</LEI>
<BICFI>
PSBCCNBJXXX
</BICFI>
</FinInstnId>
</InstdAgt>
<Dbtr>
<Nm>
Mr. Debtor
</Nm>
<Nm>
10
</Nm>
<PstlAdr>
<StrtNm>
EAST 45TH ST
</StrtNm>
<BldgNb>
25
</BldgNb>
<PstCd>
834009
</PstCd>
<TwnNm>
Manhattan
</TwnNm>
<Ctry>
US
</Ctry>
<AdrLine>
beijingshifengtaiqu
</AdrLine>
<AdrLine>
beijingshikunlunzhongxin
</AdrLine>
<AdrLine>
beijingshi
</AdrLine>
</PstlAdr>
</Dbtr>
<DbtrAcct>
<Id>
<Othr>
<Id>
36921469
</Id>
</Othr>
</Id>
</DbtrAcct>
<DbtrAgt>
<FinInstnId>
<BICFI>
AABBGB2
X
</BICFI>
<BICFI>
CITIUS33XX
X
</BICFI>
</FinInstnId>
</DbtrAgt>
<CdtrAgt>
<FinInstnId>
<BICFI>
AABBGB2
X
</BICFI>
<BICFI>
PSBCCNBJXX
X
</BICFI>
</FinInstnId>
</CdtrAgt>
<Cdtr>
<Nm>
Mr. Creditor
</Nm>
<Nm>
zhangxinyao
</Nm>
<PstlAdr>
<StrtNm>
Cable Walk
</StrtNm>
<BldgNb>
89
</BldgNb>
<PstCd>
SE120
</PstCd>
<TwnNm>
California
</TwnNm>
<Ctry>
US
</Ctry>
<AdrLine>
beijingshifengtaiqu
</AdrLine>
<AdrLine>
beijingshikunlunzhongxin
</AdrLine>
<AdrLine>
beijingshi
</AdrLine>
</PstlAdr>
</Cdtr>
<RgltryRptg>
<DbtCdtRptgInd>
CRED
</DbtCdtRptgInd>
</RgltryRptg>
<CdtrAcct>
<Id>
<Othr>
<Id>
FTT883320000031295
</Id>
</Othr>
</Id>
</CdtrAcct>
<RmtInf>
<Ustrd>
.BUYING GOODS ADDL REMITTER INFO:CR 355255
</Ustrd>
</RmtInf>
</CdtTrfTxInf>
</FIToFICstmrCdtTrf>
</Document>
</Request>
\ No newline at end of file
</RequestPayload>
\ No newline at end of file
swiftCore/src/test/java/com/brilliance/Mt2MxTest.java
View file @
98e670b3
...
...
@@ -50,4 +50,9 @@ public class Mt2MxTest {
public
void
testPacs008001
()
{
test
(
"/swiftTxt/MT103.txt"
,
null
);
}
@Test
public
void
testCamt053001
()
{
test
(
"/swiftTxt/MT950.txt"
,
null
);
}
}
swiftCore/src/test/java/com/brilliance/Mx2MtTest.java
View file @
98e670b3
...
...
@@ -263,7 +263,7 @@ public class Mx2MtTest {
@Test
public
void
testMx2MtMap
()
throws
IOException
{
File
file
=
FileUtils
.
toFile
(
Mx2MtTest
.
class
.
getResource
(
"/swiftXml/Mx
Camt05400108_CREDIT
.xml"
));
File
file
=
FileUtils
.
toFile
(
Mx2MtTest
.
class
.
getResource
(
"/swiftXml/Mx
Pacs004001_Pacs008
.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