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
a81d2957
Commit
a81d2957
authored
Aug 21, 2024
by
gechengyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加pacs010转mt204 seqA Field20和Field19相关代码
parent
686bf764
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
16 deletions
+49
-16
Mx2Mt204Creator.java
...ava/com/brilliance/swift/mx2mt/mt204/Mx2Mt204Creator.java
+4
-4
SeqAField19Generate.java
...rilliance/swift/mx2mt/mt204/impl/SeqAField19Generate.java
+32
-0
SeqAField20Generate.java
...rilliance/swift/mx2mt/mt204/impl/SeqAField20Generate.java
+8
-7
pacs.010.xml
swiftCore/src/main/resources/swiftXml/pacs.010.xml
+2
-2
Mx2MtTest.java
swiftCore/src/test/java/com/brilliance/Mx2MtTest.java
+3
-3
No files found.
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt204/Mx2Mt204Creator.java
View file @
a81d2957
...
@@ -4,8 +4,8 @@ import com.brilliance.swift.constants.Mx2MtConstants;
...
@@ -4,8 +4,8 @@ import com.brilliance.swift.constants.Mx2MtConstants;
import
com.brilliance.swift.mx2mt.AbstractMx2MtCreator
;
import
com.brilliance.swift.mx2mt.AbstractMx2MtCreator
;
import
com.brilliance.swift.mx2mt.Mx2MtContextIdentifier
;
import
com.brilliance.swift.mx2mt.Mx2MtContextIdentifier
;
import
com.brilliance.swift.mx2mt.Mx2MtTagsGenerate
;
import
com.brilliance.swift.mx2mt.Mx2MtTagsGenerate
;
import
com.brilliance.swift.mx2mt.mt
103.impl.*
;
import
com.brilliance.swift.mx2mt.mt
204.impl.SeqAField19Generate
;
import
com.brilliance.swift.mx2mt.mt204.impl.Field20Generate
;
import
com.brilliance.swift.mx2mt.mt204.impl.
SeqA
Field20Generate
;
import
com.brilliance.swift.util.XmlUtil
;
import
com.brilliance.swift.util.XmlUtil
;
import
org.dom4j.Document
;
import
org.dom4j.Document
;
...
@@ -29,8 +29,8 @@ public class Mx2Mt204Creator extends AbstractMx2MtCreator {
...
@@ -29,8 +29,8 @@ public class Mx2Mt204Creator extends AbstractMx2MtCreator {
@Override
@Override
public
List
<
Mx2MtTagsGenerate
>
getGenerateTagList
()
{
public
List
<
Mx2MtTagsGenerate
>
getGenerateTagList
()
{
List
<
Mx2MtTagsGenerate
>
fieldsGenerateList
=
new
ArrayList
<>();
List
<
Mx2MtTagsGenerate
>
fieldsGenerateList
=
new
ArrayList
<>();
fieldsGenerateList
.
add
(
new
Field20Generate
());
fieldsGenerateList
.
add
(
new
SeqA
Field20Generate
());
fieldsGenerateList
.
add
(
new
SeqAField19Generate
());
return
fieldsGenerateList
;
return
fieldsGenerateList
;
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt204/impl/SeqAField19Generate.java
0 → 100644
View file @
a81d2957
package
com
.
brilliance
.
swift
.
mx2mt
.
mt204
.
impl
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate
;
import
com.brilliance.swift.util.NumberUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.math.BigDecimal
;
import
java.util.List
;
public
class
SeqAField19Generate
extends
AbstractMx2MtTagsGenerate
{
private
static
final
String
NAME
=
"19"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
String
intrBkSttlmAmt
=
""
;
String
settleAmount
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtInstr.DrctDbtTxInf.IntrBkSttlmAmt"
);
String
settleCcy
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtInstr.DrctDbtTxInf.IntrBkSttlmAmt@Ccy"
);
if
(
StringUtil
.
isNotEmpty
(
settleAmount
)
&&
StringUtil
.
isNotEmpty
(
settleCcy
))
{
intrBkSttlmAmt
=
NumberUtil
.
formatAmt
(
new
BigDecimal
(
settleAmount
),
settleCcy
);
}
if
(
StringUtil
.
isNotEmpty
(
intrBkSttlmAmt
))
{
tags
.
add
(
new
Tag
(
NAME
,
intrBkSttlmAmt
));
}
}
}
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt204/impl/Field20Generate.java
→
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt204/impl/
SeqA
Field20Generate.java
View file @
a81d2957
package
com
.
brilliance
.
swift
.
mx2mt
.
mt204
.
impl
;
package
com
.
brilliance
.
swift
.
mx2mt
.
mt204
.
impl
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate
;
import
com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.SwiftTagListBlock
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
java.util.List
;
import
java.util.List
;
public
class
Field20Generate
extends
AbstractMx2MtTagsGenerate
{
public
class
SeqA
Field20Generate
extends
AbstractMx2MtTagsGenerate
{
private
static
final
String
NAME
=
"20"
;
private
static
final
String
NAME
=
"20"
;
@Override
@Override
public
void
tagGenerate
()
throws
SwiftException
{
public
void
tagGenerate
()
throws
SwiftException
{
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
// AbstractMT abstractMT = context.get(AbstractMT.class);
//SwiftTagListBlock blockA=new SwiftTagListBlock();
//swiftMessage.getBlock4().append(blockA);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
String
messageId
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtInstr.CdtId"
);
String
orgMessageId
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtInstr.CdtId"
);
String
messageId
=
orgMessageId
;
if
(
StringUtil
.
isNotEmpty
(
messageId
))
{
if
(
StringUtil
.
isNotEmpty
(
messageId
))
{
if
(
messageId
.
matches
(
"(/.*)|(.*/)|(.*//.*)"
)){
messageId
=
Mx2MtConstants
.
MX_TO_MT_DEFAULT_VALUE
;
buildSTErrorInfo
(
42
,
"Block4/:20"
,
orgMessageId
);
}
if
(
messageId
.
length
()
>
16
)
{
if
(
messageId
.
length
()
>
16
)
{
buildSTErrorInfo
(
13
,
"Block4/:20:"
,
messageId
);
buildSTErrorInfo
(
13
,
"Block4/:20:"
,
messageId
);
messageId
=
messageId
.
substring
(
0
,
15
)
+
"+"
;
messageId
=
messageId
.
substring
(
0
,
15
)
+
"+"
;
...
...
swiftCore/src/main/resources/swiftXml/pacs.010.xml
View file @
a81d2957
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
<NbOfTxs>
1
</NbOfTxs>
<NbOfTxs>
1
</NbOfTxs>
</GrpHdr>
</GrpHdr>
<CdtInstr>
<CdtInstr>
<CdtId>
202302081511492
9
</CdtId>
<CdtId>
202302081511492
1
</CdtId>
<InstgAgt>
<InstgAgt>
<FinInstnId>
<FinInstnId>
<BICFI>
HSBCHKHHUSI
</BICFI>
<BICFI>
HSBCHKHHUSI
</BICFI>
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
<Prtry>
SI Direct Debit or Credit
</Prtry>
<Prtry>
SI Direct Debit or Credit
</Prtry>
</CtgyPurp>
</CtgyPurp>
</PmtTpInf>
</PmtTpInf>
<IntrBkSttlmAmt
Ccy=
"USD"
>
1000
</IntrBkSttlmAmt>
<IntrBkSttlmAmt
Ccy=
"USD"
>
1000
.78
</IntrBkSttlmAmt>
<IntrBkSttlmDt>
2023-02-08
</IntrBkSttlmDt>
<IntrBkSttlmDt>
2023-02-08
</IntrBkSttlmDt>
<Dbtr>
<Dbtr>
<FinInstnId>
<FinInstnId>
...
...
swiftCore/src/test/java/com/brilliance/Mx2MtTest.java
View file @
a81d2957
...
@@ -195,15 +195,15 @@ public class Mx2MtTest {
...
@@ -195,15 +195,15 @@ public class Mx2MtTest {
@Test
@Test
//Invalid message type
//Invalid message type
public
void
test204
()
{
public
void
test204
()
{
//
test("/swiftXml/pacs.010.xml",null);
test
(
"/swiftXml/pacs.010.xml"
,
null
);
MT204
mt204
=
new
MT204
();
/*
MT204 mt204=new MT204();
MT204.SequenceA sequenceA=MT204.SequenceA.newInstance(new Tag("20","SA123"),new Tag("19","123"),new Tag("30","240820"));
MT204.SequenceA sequenceA=MT204.SequenceA.newInstance(new Tag("20","SA123"),new Tag("19","123"),new Tag("30","240820"));
mt204.append(sequenceA);
mt204.append(sequenceA);
MT204.SequenceB sequenceB=MT204.SequenceB.newInstance(new Tag("20","SB123"),new Tag("53A","PSBCCNBJXXX"));
MT204.SequenceB sequenceB=MT204.SequenceB.newInstance(new Tag("20","SB123"),new Tag("53A","PSBCCNBJXXX"));
mt204.append(sequenceB);
mt204.append(sequenceB);
System
.
out
.
println
(
mt204
.
message
());
System.out.println(mt204.message());
*/
}
}
...
...
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