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
adafc165
Commit
adafc165
authored
Oct 12, 2022
by
chengzhuoshen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改MX报文53域展示逻辑
parent
6d83f025
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
28 deletions
+72
-28
AbstractMx2MapCreator.java
...va/com/brilliance/swift/mx2map/AbstractMx2MapCreator.java
+36
-0
Mx2MapPacs008Creator.java
...brilliance/swift/mx2map/pacs008/Mx2MapPacs008Creator.java
+25
-21
Mx2MapPacs009Creator.java
...brilliance/swift/mx2map/pacs009/Mx2MapPacs009Creator.java
+11
-7
No files found.
swiftCore/src/main/java/com/brilliance/swift/mx2map/AbstractMx2MapCreator.java
View file @
adafc165
...
...
@@ -5,6 +5,10 @@ import com.brilliance.swift.constants.Mx2MtConstants;
import
com.brilliance.swift.util.MessageUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.common.CdtDbtCode
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.field.Field53A
;
import
com.prowidesoftware.swift.model.field.Field53B
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
...
...
@@ -182,4 +186,36 @@ public abstract class AbstractMx2MapCreator implements Mx2MapCreator{
}
return
null
;
}
/**
* 53域 特殊处理
* @param targetMaps
* @param abstractMT
*/
protected
void
buildInstgRmbrsmntAgtInfo
(
Map
<
String
,
Object
>
targetMaps
,
AbstractMT
abstractMT
)
{
Tag
tag
=
abstractMT
.
getSwiftMessage
().
getBlock4
().
getTagByName
(
"53A"
);
if
(
tag
!=
null
)
{
Map
<
String
,
Object
>
newMaps
=
new
LinkedHashMap
<>();
targetMaps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"instgRmbrsmntAgtInfo"
),
newMaps
);
Field53A
field53A
=
(
Field53A
)
tag
.
asField
();
String
bicCode
=
field53A
.
getBIC
();
if
(
StringUtil
.
isNotEmpty
(
bicCode
))
{
newMaps
.
put
(
getPropertyValue
(
"bicfi"
),
bicCode
);
}
String
account
=
field53A
.
getComponent2
();
if
(
StringUtil
.
isNotEmpty
(
account
))
{
newMaps
.
put
(
getPropertyValue
(
"acctId"
),
account
);
}
}
tag
=
abstractMT
.
getSwiftMessage
().
getBlock4
().
getTagByName
(
"53B"
);
if
(
tag
!=
null
)
{
Map
<
String
,
Object
>
newMaps
=
new
LinkedHashMap
<>();
targetMaps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"instgRmbrsmntAgtInfo"
),
newMaps
);
Field53B
field53B
=
(
Field53B
)
tag
.
asField
();
String
account
=
field53B
.
getComponent2
();
if
(
StringUtil
.
isNotEmpty
(
account
))
{
newMaps
.
put
(
getPropertyValue
(
"acctId"
),
account
);
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/mx2map/pacs008/Mx2MapPacs008Creator.java
View file @
adafc165
...
...
@@ -4,7 +4,7 @@ import com.brilliance.swift.SwiftTransfer;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mx2map.AbstractMx2MapCreator
;
import
com.brilliance.swift.
util.StringUtil
;
import
com.brilliance.swift.
vo.common.SettlementMethodCode
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
...
...
@@ -80,7 +80,19 @@ public class Mx2MapPacs008Creator extends AbstractMx2MapCreator {
}
buildPartyInfo
(
maps
,
"dbtr"
,
elementMaps
);
buildAgentInfo
(
maps
,
"dbtrAgt"
,
elementMaps
);
buildAgentInfo
(
maps
,
"instgRmbrsmntAgt"
,
elementMaps
);
AbstractMT
abstractMT
=
null
;
try
{
String
mtMessage
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
abstractMT
=
AbstractMT
.
parse
(
mtMessage
);
}
catch
(
IOException
e
)
{
throw
new
SwiftException
(
e
.
getMessage
());
}
if
(
SettlementMethodCode
.
INGA
.
value
().
equals
(
elementMaps
.
get
(
"sttlmMtd"
))
||
SettlementMethodCode
.
INDA
.
value
().
equals
(
elementMaps
.
get
(
"sttlmMtd"
)))
{
buildInstgRmbrsmntAgtInfo
(
maps
,
abstractMT
);
}
else
{
buildAgentInfo
(
maps
,
"instgRmbrsmntAgt"
,
elementMaps
);
}
buildAgentInfo
(
maps
,
"instdRmbrsmntAgt"
,
elementMaps
);
buildAgentInfo
(
maps
,
"thrdRmbrsmntAgt"
,
elementMaps
);
buildAgentInfo
(
maps
,
"intrmyAgt1"
,
elementMaps
);
...
...
@@ -101,25 +113,17 @@ public class Mx2MapPacs008Creator extends AbstractMx2MapCreator {
}
}
}
try
{
String
mtMessage
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
if
(
StringUtil
.
isNotEmpty
(
mtMessage
))
{
AbstractMT
abstractMT
=
AbstractMT
.
parse
(
mtMessage
);
Tag
tag
=
abstractMT
.
getSwiftMessage
().
getBlock4
().
getTagByName
(
"70"
);
if
(
tag
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"remittanceInformation"
),
tag
.
getValue
());
}
tag
=
abstractMT
.
getSwiftMessage
().
getBlock4
().
getTagByName
(
"72"
);
if
(
tag
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"txnRemark"
),
tag
.
getValue
());
}
tag
=
abstractMT
.
getSwiftMessage
().
getBlock4
().
getTagByName
(
"77B"
);
if
(
tag
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"regulatoryReporting"
),
tag
.
getValue
());
}
}
}
catch
(
IOException
e
)
{
throw
new
SwiftException
(
e
.
getMessage
());
Tag
tag
=
abstractMT
.
getSwiftMessage
().
getBlock4
().
getTagByName
(
"70"
);
if
(
tag
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"remittanceInformation"
),
tag
.
getValue
());
}
tag
=
abstractMT
.
getSwiftMessage
().
getBlock4
().
getTagByName
(
"72"
);
if
(
tag
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"txnRemark"
),
tag
.
getValue
());
}
tag
=
abstractMT
.
getSwiftMessage
().
getBlock4
().
getTagByName
(
"77B"
);
if
(
tag
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"regulatoryReporting"
),
tag
.
getValue
());
}
return
maps
;
}
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2map/pacs009/Mx2MapPacs009Creator.java
View file @
adafc165
...
...
@@ -5,15 +5,14 @@ import com.brilliance.swift.constants.Mx2MtConstants;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mx2map.AbstractMx2MapCreator
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.common.SettlementMethodCode
;
import
com.prowidesoftware.swift.model.SwiftTagListBlock
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
Mx2MapPacs009Creator
extends
AbstractMx2MapCreator
{
...
...
@@ -69,11 +68,6 @@ public class Mx2MapPacs009Creator extends AbstractMx2MapCreator {
}
}
buildAgentInfo
(
maps
,
"dbtr"
,
elementMaps
,
"dbtrAgtInfo"
);
buildAgentInfo
(
maps
,
"instgRmbrsmntAgt"
,
elementMaps
);
buildAgentInfo
(
maps
,
"instdRmbrsmntAgt"
,
elementMaps
);
buildAgentInfo
(
maps
,
"intrmyAgt1"
,
elementMaps
);
buildAgentInfo
(
maps
,
"cdtrAgt"
,
elementMaps
,
"cdtrAgtAcctInfo"
);
buildAgentInfo
(
maps
,
"cdtr"
,
elementMaps
,
"cdtrAgtInfo"
);
AbstractMT
abstractMT
=
null
;
try
{
String
mtMessage
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
...
...
@@ -83,6 +77,16 @@ public class Mx2MapPacs009Creator extends AbstractMx2MapCreator {
}
catch
(
IOException
e
)
{
throw
new
SwiftException
(
e
.
getMessage
());
}
if
(
SettlementMethodCode
.
INGA
.
value
().
equals
(
elementMaps
.
get
(
"sttlmMtd"
))
||
SettlementMethodCode
.
INDA
.
value
().
equals
(
elementMaps
.
get
(
"sttlmMtd"
)))
{
buildInstgRmbrsmntAgtInfo
(
maps
,
abstractMT
);
}
else
{
buildAgentInfo
(
maps
,
"instgRmbrsmntAgt"
,
elementMaps
);
}
buildAgentInfo
(
maps
,
"instdRmbrsmntAgt"
,
elementMaps
);
buildAgentInfo
(
maps
,
"intrmyAgt1"
,
elementMaps
);
buildAgentInfo
(
maps
,
"cdtrAgt"
,
elementMaps
,
"cdtrAgtAcctInfo"
);
buildAgentInfo
(
maps
,
"cdtr"
,
elementMaps
,
"cdtrAgtInfo"
);
Tag
tag
=
getTagByName
(
abstractMT
,
"72"
,
"A"
);
if
(
tag
!=
null
)
{
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"txnRemark"
),
tag
.
getValue
());
...
...
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