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
376f6c7a
Commit
376f6c7a
authored
Aug 09, 2022
by
chengzhuoshen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.ERRORTYPE=FAILURE,不抛异常
2.MessageReader重写成MxMessageReader,支持邮储国际支付前置
parent
50bdc828
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
493 additions
and
58 deletions
+493
-58
pom.xml
pom.xml
+0
-17
pom.xml
swiftCore/pom.xml
+17
-1
SwiftTransfer.java
...ore/src/main/java/com/brilliance/swift/SwiftTransfer.java
+3
-2
AbstractMx2MtCreator.java
...java/com/brilliance/swift/mx2mt/AbstractMx2MtCreator.java
+2
-2
AbstractMx2MtTagsGenerate.java
...com/brilliance/swift/mx2mt/AbstractMx2MtTagsGenerate.java
+2
-2
Field28CGenerate.java
...rilliance/swift/mx2mt/mt940950/impl/Field28CGenerate.java
+1
-1
MxMessageReader.java
.../main/java/com/brilliance/swift/util/MxMessageReader.java
+461
-0
MxPacs00800108.xml
swiftCore/src/main/resources/swiftXml/MxPacs00800108.xml
+5
-31
camt05400108_910.xml
swiftCore/src/main/resources/swiftXml/camt05400108_910.xml
+2
-2
No files found.
pom.xml
View file @
376f6c7a
...
...
@@ -55,16 +55,6 @@
<version>
1.9
</version>
</dependency>
<dependency>
<groupId>
com.brilliance.swift
</groupId>
<artifactId>
eibs-container
</artifactId>
<version>
3.5.0
</version>
</dependency>
<dependency>
<groupId>
com.brilliance.swift
</groupId>
<artifactId>
eibs-ext
</artifactId>
<version>
1.0.0
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.83
</version>
...
...
@@ -80,11 +70,5 @@
<artifactId>
poi-ooxml
</artifactId>
<version>
4.1.2
</version>
</dependency>
<!-- SwiftTransfer.mx2MtMap() MessageReader依赖的jar包 -->
<dependency>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
<version>
1.2
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
swiftCore/pom.xml
View file @
376f6c7a
...
...
@@ -23,5 +23,21 @@
<version>
1.0.0
</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-jar-plugin
</artifactId>
<version>
2.4
</version>
<configuration>
<excludes>
<exclude>
**/template/**
</exclude>
<exclude>
**/swiftJson/**
</exclude>
<exclude>
**/swiftTxt/**
</exclude>
<exclude>
**/swiftXml/**
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
swiftCore/src/main/java/com/brilliance/swift/SwiftTransfer.java
View file @
376f6c7a
...
...
@@ -5,6 +5,7 @@ import com.brilliance.swift.mt2mx.Mt2MxCreatorManager;
import
com.brilliance.swift.mx2element.Mx2ElementCreatorManager
;
import
com.brilliance.swift.mx2map.Mx2MapCreatorManager
;
import
com.brilliance.swift.mx2mt.Mx2MtCreatorManager
;
import
com.brilliance.swift.util.MxMessageReader
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.util.SwiftTransferUtil
;
import
com.brilliance.swift.util.XmlUtil
;
...
...
@@ -98,8 +99,8 @@ public class SwiftTransfer {
*/
public
static
Map
<
String
,
String
>
mx2MtMap
(
String
xmlStr
,
Map
<
String
,
Object
>
extraMap
)
throws
SwiftException
{
try
{
S
tring
mtStr
=
mx2Mt
(
xmlStr
,
null
,
extraMap
);
Map
<
String
,
String
>
maps
=
M
essageReader
.
getSwfMsgInfoViaMsg
(
mtS
tr
);
S
wiftTranslationReport
str
=
mx2MtPlus
(
xmlStr
,
null
,
extraMap
);
Map
<
String
,
String
>
maps
=
M
xMessageReader
.
getSwfMsgInfoViaMsg
(
s
tr
);
AbstractMX
abstractMx
=
AbstractMX
.
parse
(
xmlStr
);
if
(
abstractMx
!=
null
)
{
String
messageType
=
abstractMx
.
getMxId
().
id
();
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/AbstractMx2MtCreator.java
View file @
376f6c7a
...
...
@@ -65,9 +65,9 @@ public abstract class AbstractMx2MtCreator implements Mx2MtCreator {
}
if
(!
existFlag
)
{
str
.
addErrorInfo
(
errorInfo
);
if
(
"FAILURE"
.
equalsIgnoreCase
(
errorInfo
.
getErrorType
()))
{
/*
if ("FAILURE".equalsIgnoreCase(errorInfo.getErrorType())) {
throw new SwiftException(location + Mx2MtConstants.NEW_LINE + "-" + errorInfo.getErrorType() + ":" + errorInfo.getDescription());
}
}
*/
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/AbstractMx2MtTagsGenerate.java
View file @
376f6c7a
...
...
@@ -82,9 +82,9 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
}
if
(!
existFlag
)
{
str
.
addErrorInfo
(
errorInfo
);
if
(
"FAILURE"
.
equalsIgnoreCase
(
errorInfo
.
getErrorType
()))
{
/*
if ("FAILURE".equalsIgnoreCase(errorInfo.getErrorType())) {
throw new SwiftException(location + Mx2MtConstants.NEW_LINE + "-" + errorInfo.getErrorType() + ":" + errorInfo.getDescription());
}
}
*/
}
}
/**
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt940950/impl/Field28CGenerate.java
View file @
376f6c7a
...
...
@@ -24,7 +24,7 @@ public class Field28CGenerate extends AbstractMx2MtTagsGenerate {
String
elctrncSeqNbStr
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Stmt.ElctrncSeqNb"
);
String
lglSeqNbStr
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Stmt.LglSeqNb"
);
String
pageNumber
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Stmt.StmtPgntn.PgNb"
);
if
(
StringUtil
.
isNotEmpty
(
lglSeqNbStr
)
&&
lglSeqNbStr
.
length
()
<=
5
)
{
if
(
StringUtil
.
isNotEmpty
(
lglSeqNbStr
))
{
value
=
lglSeqNbStr
+
"/"
+
pageNumber
;
}
else
{
value
=
elctrncSeqNbStr
+
"/"
+
pageNumber
;
...
...
swiftCore/src/main/java/com/brilliance/swift/util/MxMessageReader.java
0 → 100644
View file @
376f6c7a
package
com
.
brilliance
.
swift
.
util
;
import
com.brilliance.swift.constants.ERROR
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.vo.SwiftTranslationErrorInfo
;
import
com.brilliance.swift.vo.SwiftTranslationReport
;
import
com.prowidesoftware.swift.model.*
;
import
com.prowidesoftware.swift.model.field.*
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
MxMessageReader
{
/**
* 对照着 MessageRead.getSwfMsgInfoViaMsg
* 重写一遍关于MX报文的解析,供邮储国际支付前置使用
* @param str
* @return
*/
public
static
Map
<
String
,
String
>
getSwfMsgInfoViaMsg
(
SwiftTranslationReport
str
)
{
try
{
String
mtStr
=
str
.
getMessage
();
List
<
SwiftTranslationErrorInfo
>
errorInfos
=
str
.
getErrorInfos
();
if
(
StringUtil
.
isEmpty
(
mtStr
))
{
return
null
;
}
Map
<
String
,
String
>
infMap
=
new
HashMap
();
AbstractMT
abstractMT
=
AbstractMT
.
parse
(
mtStr
);
SwiftBlock5
swiftBlock5
=
abstractMT
.
getSwiftMessage
().
getBlock5
();
if
(
swiftBlock5
!=
null
&&
swiftBlock5
.
getTags
().
size
()
>
0
)
{
List
<
Tag
>
tags
=
swiftBlock5
.
getTags
();
String
trl
=
""
;
for
(
Tag
tag:
tags
)
{
trl
+=
"{"
;
if
(
StringUtil
.
isNotEmpty
(
tag
.
getName
()))
{
trl
+=
tag
.
getName
();
}
trl
+=
":"
;
if
(
StringUtil
.
isNotEmpty
(
tag
.
getValue
()))
{
trl
+=
tag
.
getValue
();
}
trl
+=
"}"
;
}
infMap
.
put
(
"trl"
,
trl
);
}
String
ioFlag
=
""
;
SwiftBlock2
block2
=
abstractMT
.
getSwiftMessage
().
getBlock2
();
if
(
block2
!=
null
)
{
if
(
block2
instanceof
SwiftBlock2Output
)
{
ioFlag
=
"O"
;
infMap
.
put
(
"direct"
,
ioFlag
);
//收到报文
SwiftBlock2Output
swiftBlock2Output
=
(
SwiftBlock2Output
)
block2
;
infMap
.
put
(
"sndbic"
,
abstractMT
.
getSender
());
String
mir
=
""
;
if
(
StringUtil
.
isNotEmpty
(
swiftBlock2Output
.
getMIRDate
()))
{
mir
+=
swiftBlock2Output
.
getMIRDate
()
+
" "
;
}
if
(
StringUtil
.
isNotEmpty
(
swiftBlock2Output
.
getMIRLogicalTerminal
()))
{
mir
+=
swiftBlock2Output
.
getMIRLogicalTerminal
();
}
if
(
StringUtil
.
isNotEmpty
(
swiftBlock2Output
.
getMIRSessionNumber
()))
{
mir
+=
swiftBlock2Output
.
getMIRSessionNumber
();
}
if
(
StringUtil
.
isNotEmpty
(
swiftBlock2Output
.
getMIRSequenceNumber
()))
{
mir
+=
swiftBlock2Output
.
getMIRSequenceNumber
();
}
infMap
.
put
(
"mir"
,
mir
);
infMap
.
put
(
"prt"
,
swiftBlock2Output
.
getMessagePriority
());
}
else
if
(
block2
instanceof
SwiftBlock2Input
)
{
ioFlag
=
"I"
;
infMap
.
put
(
"direct"
,
ioFlag
);
//发出报文
SwiftBlock2Input
swiftBlock2Input
=
(
SwiftBlock2Input
)
block2
;
infMap
.
put
(
"rcvbic"
,
abstractMT
.
getReceiver
());
infMap
.
put
(
"prt"
,
swiftBlock2Input
.
getMessagePriority
());
infMap
.
put
(
"tns"
,
swiftBlock2Input
.
getDeliveryMonitoring
());
infMap
.
put
(
"dyt"
,
swiftBlock2Input
.
getObsolescencePeriod
());
}
}
SwiftBlock1
swiftBlock1
=
abstractMT
.
getSwiftMessage
().
getBlock1
();
if
(
swiftBlock1
!=
null
)
{
String
mor
=
""
;
if
(
"O"
.
equals
(
ioFlag
))
{
infMap
.
put
(
"rcvbic"
,
abstractMT
.
getReceiver
());
SwiftBlock2Output
swiftBlock2Output
=
(
SwiftBlock2Output
)
block2
;
if
(
StringUtil
.
isNotEmpty
(
swiftBlock2Output
.
getMIRDate
()))
{
mor
+=
swiftBlock2Output
.
getMIRDate
()
+
" "
;
}
if
(
StringUtil
.
isNotEmpty
(
swiftBlock1
.
getLogicalTerminal
()))
{
mor
+=
swiftBlock1
.
getLogicalTerminal
();
}
if
(
StringUtil
.
isNotEmpty
(
swiftBlock1
.
getSessionNumber
()))
{
mor
+=
swiftBlock1
.
getSessionNumber
();
}
if
(
StringUtil
.
isNotEmpty
(
swiftBlock1
.
getSequenceNumber
()))
{
mor
+=
swiftBlock1
.
getSequenceNumber
();
}
infMap
.
put
(
"mor"
,
mor
);
}
else
if
(
"I"
.
equals
(
ioFlag
))
{
infMap
.
put
(
"sndbic"
,
abstractMT
.
getSender
());
}
}
String
msgType
=
abstractMT
.
getMessageType
();
if
(
abstractMT
.
getSwiftMessage
().
isCOV
())
{
msgType
+=
"COV"
;
}
infMap
.
put
(
"mty"
,
msgType
);
SwiftBlock3
swiftBlock3
=
abstractMT
.
getSwiftMessage
().
getBlock3
();
if
(
swiftBlock3
!=
null
)
{
Tag
tag
=
swiftBlock3
.
getTagByName
(
"108"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"sndnum"
,
tag
.
getValue
());
}
tag
=
swiftBlock3
.
getTagByName
(
"111"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"gpiFlg"
,
"GPI"
);
infMap
.
put
(
"gpiVal"
,
tag
.
getValue
());
}
tag
=
swiftBlock3
.
getTagByName
(
"121"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"UETR"
,
tag
.
getValue
());
}
}
infMap
.
put
(
"std"
,
"MT"
);
//处理BLOCK4
SwiftBlock4
swiftBlock4
=
abstractMT
.
getSwiftMessage
().
getBlock4
();
if
(
swiftBlock4
!=
null
)
{
Tag
tag
=
swiftBlock4
.
getTagByName
(
"20"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"ref"
,
tag
.
getValue
());
if
(
errorInfos
!=
null
&&
errorInfos
.
size
()
>
0
)
{
for
(
SwiftTranslationErrorInfo
errorInfo
:
errorInfos
)
{
if
(
ERROR
.
T0000T
.
equals
(
errorInfo
.
getErrorCode
())
&&
"Block4/:20:"
.
equals
(
errorInfo
.
getLocation
())
&&
StringUtil
.
isNotEmpty
(
errorInfo
.
getOriginalValue
()))
{
infMap
.
put
(
"ref"
,
errorInfo
.
getOriginalValue
());
}
}
}
}
tag
=
swiftBlock4
.
getTagByName
(
"21"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"tscref"
,
tag
.
getValue
());
if
(
errorInfos
!=
null
&&
errorInfos
.
size
()
>
0
)
{
for
(
SwiftTranslationErrorInfo
errorInfo
:
errorInfos
)
{
if
(
ERROR
.
T0000T
.
equals
(
errorInfo
.
getErrorCode
())
&&
"Block4/:21:"
.
equals
(
errorInfo
.
getLocation
())
&&
StringUtil
.
isNotEmpty
(
errorInfo
.
getOriginalValue
()))
{
infMap
.
put
(
"tscref"
,
errorInfo
.
getOriginalValue
());
}
}
}
}
if
(
"910"
.
equals
(
msgType
))
{
tag
=
swiftBlock4
.
getTagByName
(
"50A"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"f50"
,
tag
.
getValue
());
}
tag
=
swiftBlock4
.
getTagByName
(
"50F"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"f50"
,
tag
.
getValue
());
}
tag
=
swiftBlock4
.
getTagByName
(
"50K"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"f50"
,
tag
.
getValue
());
}
tag
=
swiftBlock4
.
getTagByName
(
"52A"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"f52"
,
tag
.
getValue
());
}
tag
=
swiftBlock4
.
getTagByName
(
"52D"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"f52"
,
tag
.
getValue
());
}
tag
=
swiftBlock4
.
getTagByName
(
"72"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"f72"
,
tag
.
getValue
());
}
}
tag
=
swiftBlock4
.
getTagByName
(
"32A"
);
if
(
tag
!=
null
)
{
Field32A
field32A
=
(
Field32A
)
tag
.
asField
();
infMap
.
put
(
"vludat"
,
field32A
.
getDate
());
infMap
.
put
(
"amt"
,
field32A
.
getAmount
().
replace
(
","
,
"."
));
infMap
.
put
(
"cur"
,
field32A
.
getCurrency
());
}
tag
=
swiftBlock4
.
getTagByName
(
"32B"
);
if
(
tag
!=
null
)
{
Field32B
field32B
=
(
Field32B
)
tag
.
asField
();
infMap
.
put
(
"itdamt"
,
field32B
.
getAmount
().
replace
(
","
,
"."
));
infMap
.
put
(
"itdcur"
,
field32B
.
getCurrency
());
}
tag
=
swiftBlock4
.
getTagByName
(
"30"
);
if
(
tag
!=
null
)
{
Field30
field30
=
(
Field30
)
tag
.
asField
();
infMap
.
put
(
"itdvludat"
,
field30
.
getDate
());
}
tag
=
swiftBlock4
.
getTagByName
(
"62F"
);
//940/950对账单
if
(
tag
!=
null
)
{
Field62F
field62F
=
(
Field62F
)
tag
.
asField
();
infMap
.
put
(
"vludat"
,
field62F
.
getDate
());
infMap
.
put
(
"amt"
,
field62F
.
getAmount
().
replace
(
","
,
"."
));
infMap
.
put
(
"cur"
,
field62F
.
getCurrency
());
}
tag
=
swiftBlock4
.
getTagByName
(
"62M"
);
//940/950对账单
if
(
tag
!=
null
)
{
Field62M
field62M
=
(
Field62M
)
tag
.
asField
();
infMap
.
put
(
"vludat"
,
field62M
.
getDate
());
infMap
.
put
(
"amt"
,
field62M
.
getAmount
().
replace
(
","
,
"."
));
infMap
.
put
(
"cur"
,
field62M
.
getCurrency
());
}
tag
=
swiftBlock4
.
getTagByName
(
"25"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"act"
,
tag
.
getValue
());
}
tag
=
swiftBlock4
.
getTagByName
(
"25P"
);
if
(
tag
!=
null
)
{
Field25P
field25P
=
(
Field25P
)
tag
.
asField
();
infMap
.
put
(
"act"
,
field25P
.
getAccount
());
}
if
(
"O"
.
equals
(
ioFlag
))
{
tag
=
swiftBlock4
.
getTagByName
(
"54A"
);
if
(
tag
!=
null
)
{
Field54A
field54A
=
(
Field54A
)
tag
.
asField
();
infMap
.
put
(
"actbic"
,
field54A
.
getBIC
());
}
tag
=
swiftBlock4
.
getTagByName
(
"53A"
);
if
(
tag
!=
null
)
{
Field53A
field53A
=
(
Field53A
)
tag
.
asField
();
infMap
.
put
(
"t53bic"
,
field53A
.
getBIC
());
}
}
else
if
(
"I"
.
equals
(
ioFlag
))
{
tag
=
swiftBlock4
.
getTagByName
(
"53A"
);
if
(
tag
!=
null
)
{
Field53A
field53A
=
(
Field53A
)
tag
.
asField
();
infMap
.
put
(
"actbic"
,
field53A
.
getBIC
());
}
}
tag
=
swiftBlock4
.
getTagByName
(
"50A"
);
if
(
tag
!=
null
)
{
Field50A
field50A
=
(
Field50A
)
tag
.
asField
();
if
(!
"910"
.
equals
(
msgType
)
&&
StringUtil
.
isNotEmpty
(
field50A
.
getAccount
()))
{
infMap
.
put
(
"act"
,
field50A
.
getAccount
());
}
}
tag
=
swiftBlock4
.
getTagByName
(
"50K"
);
if
(
tag
!=
null
)
{
Field50K
field50K
=
(
Field50K
)
tag
.
asField
();
if
(!
"910"
.
equals
(
msgType
)
&&
StringUtil
.
isNotEmpty
(
field50K
.
getAccount
()))
{
infMap
.
put
(
"act"
,
field50K
.
getAccount
());
}
infMap
.
put
(
"ordnamadr"
,
field50K
.
getNameAndAddress
());
}
tag
=
swiftBlock4
.
getTagByName
(
"50F"
);
if
(
tag
!=
null
)
{
Field50F
field50F
=
(
Field50F
)
tag
.
asField
();
if
(!
"910"
.
equals
(
msgType
)
&&
StringUtil
.
isNotEmpty
(
field50F
.
getPartyIdentifier
()))
{
infMap
.
put
(
"act"
,
field50F
.
getPartyIdentifier
().
startsWith
(
"/"
)?
field50F
.
getPartyIdentifier
().
substring
(
1
):
field50F
.
getPartyIdentifier
());
}
String
nameAddress
=
""
;
List
<
String
>
lines
=
field50F
.
getLines
();
for
(
int
i
=
0
;
i
<
lines
.
size
();
i
++)
{
if
(
i
==
0
)
{
continue
;
}
if
(
i
==
lines
.
size
()-
1
)
{
nameAddress
+=
lines
.
get
(
i
);
}
else
{
nameAddress
+=
lines
.
get
(
i
)
+
Mx2MtConstants
.
NEW_LINE
;
}
}
infMap
.
put
(
"ordnamadr"
,
nameAddress
);
}
//如果是202cov,需要取cov里面的57A bicCode
boolean
isCov
=
abstractMT
.
getSwiftMessage
().
isCOV
();
if
(
isCov
)
{
SwiftTagListBlock
swiftTagListBlock
=
abstractMT
.
getSequence
(
"B"
);
if
(
swiftTagListBlock
!=
null
)
{
tag
=
swiftTagListBlock
.
getTagByName
(
"57A"
);
}
}
else
{
tag
=
swiftBlock4
.
getTagByName
(
"57A"
);
}
if
(
tag
!=
null
)
{
Field57A
field57A
=
(
Field57A
)
tag
.
asField
();
infMap
.
put
(
"corbic"
,
field57A
.
getBIC
());
}
tag
=
swiftBlock4
.
getTagByName
(
"59"
);
if
(
tag
!=
null
)
{
Field59
field59
=
(
Field59
)
tag
.
asField
();
if
(!
"910"
.
equals
(
msgType
)
&&
StringUtil
.
isNotEmpty
(
field59
.
getAccount
()))
{
infMap
.
put
(
"act"
,
field59
.
getAccount
());
infMap
.
put
(
"benact"
,
field59
.
getAccount
());
}
infMap
.
put
(
"bennamadr"
,
field59
.
getNameAndAddress
(
Mx2MtConstants
.
NEW_LINE
));
}
tag
=
swiftBlock4
.
getTagByName
(
"59A"
);
if
(
tag
!=
null
)
{
Field59A
field59A
=
(
Field59A
)
tag
.
asField
();
if
(!
"910"
.
equals
(
msgType
)
&&
StringUtil
.
isNotEmpty
(
field59A
.
getAccount
()))
{
infMap
.
put
(
"act"
,
field59A
.
getAccount
());
infMap
.
put
(
"benact"
,
field59A
.
getAccount
());
}
infMap
.
put
(
"bennamadr"
,
field59A
.
getBIC
());
}
tag
=
swiftBlock4
.
getTagByName
(
"59F"
);
if
(
tag
!=
null
)
{
Field59F
field59F
=
(
Field59F
)
tag
.
asField
();
if
(!
"910"
.
equals
(
msgType
)
&&
StringUtil
.
isNotEmpty
(
field59F
.
getAccount
()))
{
infMap
.
put
(
"act"
,
field59F
.
getAccount
());
infMap
.
put
(
"benact"
,
field59F
.
getAccount
());
}
String
nameAddress
=
""
;
List
<
String
>
lines
=
field59F
.
getLines
();
for
(
int
i
=
0
;
i
<
lines
.
size
();
i
++)
{
if
(
i
==
0
&&
StringUtil
.
isNotEmpty
(
field59F
.
getAccount
()))
{
continue
;
}
if
(
i
==
lines
.
size
()-
1
)
{
nameAddress
+=
lines
.
get
(
i
);
}
else
{
nameAddress
+=
lines
.
get
(
i
)
+
Mx2MtConstants
.
NEW_LINE
;
}
}
if
(
StringUtil
.
isNotEmpty
(
nameAddress
))
{
infMap
.
put
(
"bennamadr"
,
nameAddress
);
}
}
tag
=
swiftBlock4
.
getTagByName
(
"71A"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"dtlchg"
,
tag
.
getValue
());
}
Tag
[]
tags
=
swiftBlock4
.
getTagsByName
(
"71F"
);
if
(
tags
!=
null
&&
tags
.
length
>
0
)
{
String
msg71F
=
""
;
for
(
int
i
=
0
;
i
<
tags
.
length
;
i
++)
{
Tag
tmpTag
=
tags
[
i
];
if
(
i
==
0
)
{
msg71F
+=
tmpTag
.
getValue
().
replace
(
","
,
"."
);
}
else
{
msg71F
+=
";"
+
tmpTag
.
getValue
().
replace
(
","
,
"."
);
}
}
if
(
StringUtil
.
isNotEmpty
(
msg71F
))
{
infMap
.
put
(
"71Fmsg"
,
msg71F
);
}
}
tag
=
swiftBlock4
.
getTagByName
(
"22C"
);
if
(
tag
!=
null
)
{
Field22C
field22C
=
(
Field22C
)
tag
.
asField
();
infMap
.
put
(
"comref"
,
field22C
.
getValue
());
}
tag
=
swiftBlock4
.
getTagByName
(
"33B"
);
if
(
tag
!=
null
)
{
Field33B
field33B
=
(
Field33B
)
tag
.
asField
();
infMap
.
put
(
"sellamt"
,
field33B
.
getAmount
().
replace
(
","
,
"."
));
infMap
.
put
(
"sellcur"
,
field33B
.
getCurrency
());
}
tag
=
swiftBlock4
.
getTagByName
(
"17R"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"BorL"
,
tag
.
getValue
());
}
tag
=
swiftBlock4
.
getTagByName
(
"34E"
);
if
(
tag
!=
null
)
{
Field34E
field34E
=
(
Field34E
)
tag
.
asField
();
infMap
.
put
(
"interest"
,
field34E
.
getAmount
().
replace
(
","
,
"."
));
}
tag
=
swiftBlock4
.
getTagByName
(
"30V"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"m3xValDate"
,
tag
.
getValue
());
}
tag
=
swiftBlock4
.
getTagByName
(
"32B"
);
if
(
tag
!=
null
)
{
Field32B
field32B
=
(
Field32B
)
tag
.
asField
();
infMap
.
put
(
"buyamt"
,
field32B
.
getAmount
().
replace
(
","
,
"."
));
infMap
.
put
(
"buycur"
,
field32B
.
getCurrency
());
}
tag
=
swiftBlock4
.
getTagByName
(
"79"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"addinfo"
,
tag
.
getValue
());
}
tag
=
swiftBlock4
.
getTagByName
(
"76"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"info76"
,
tag
.
getValue
());
}
if
(
"950"
.
equals
(
msgType
))
{
tag
=
swiftBlock4
.
getTagByName
(
"28C"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"bilnum"
,
tag
.
getValue
());
}
tag
=
swiftBlock4
.
getTagByName
(
"60F"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"begamtf"
,
tag
.
getValue
());
}
tag
=
swiftBlock4
.
getTagByName
(
"60M"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"begamtm"
,
tag
.
getValue
());
}
tag
=
swiftBlock4
.
getTagByName
(
"62F"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"endamtf"
,
tag
.
getValue
());
}
tag
=
swiftBlock4
.
getTagByName
(
"62M"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"endamtm"
,
tag
.
getValue
());
}
tag
=
swiftBlock4
.
getTagByName
(
"64"
);
if
(
tag
!=
null
)
{
infMap
.
put
(
"valamt"
,
tag
.
getValue
());
}
}
}
boolean
failureFlag
=
false
;
String
errorDsp
=
""
;
if
(
errorInfos
!=
null
&&
errorInfos
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
errorInfos
.
size
();
i
++)
{
SwiftTranslationErrorInfo
errorInfo
=
errorInfos
.
get
(
i
);
if
(
"FAILURE"
.
equalsIgnoreCase
(
errorInfo
.
getErrorType
()))
{
failureFlag
=
true
;
}
if
(
i
==
(
errorInfos
.
size
()-
1
))
{
errorDsp
+=
errorInfo
.
getErrorType
()
+
"-"
+
errorInfo
.
getErrorCode
()
+
":"
+
errorInfo
.
getDescription
();
if
(
StringUtil
.
isNotEmpty
(
errorInfo
.
getLocation
()))
{
errorDsp
+=
";Occur in the "
+
errorInfo
.
getLocation
();
}
if
(
StringUtil
.
isNotEmpty
(
errorInfo
.
getOriginalValue
()))
{
errorDsp
+=
";Original Value is "
+
errorInfo
.
getOriginalValue
();
}
}
else
{
errorDsp
+=
errorInfo
.
getErrorType
()
+
"-"
+
errorInfo
.
getErrorCode
()
+
":"
+
errorInfo
.
getDescription
();
if
(
StringUtil
.
isNotEmpty
(
errorInfo
.
getLocation
()))
{
errorDsp
+=
";Occur in the "
+
errorInfo
.
getLocation
();
}
if
(
StringUtil
.
isNotEmpty
(
errorInfo
.
getOriginalValue
()))
{
errorDsp
+=
";Original Value is "
+
errorInfo
.
getOriginalValue
();
}
errorDsp
+=
Mx2MtConstants
.
NEW_LINE
;
}
}
}
if
(
failureFlag
)
{
infMap
.
put
(
"errorCode"
,
"E"
);
//
}
else
{
infMap
.
put
(
"errorCode"
,
"S"
);
//
}
infMap
.
put
(
"errorDsp"
,
errorDsp
);
return
infMap
;
}
catch
(
IOException
e
)
{
throw
new
SwiftException
(
e
.
getMessage
());
}
}
}
swiftCore/src/main/resources/swiftXml/MxPacs00800108.xml
View file @
376f6c7a
...
...
@@ -32,6 +32,7 @@ Change Log
<MsgDefIdr>
pacs.008.001.08
</MsgDefIdr>
<BizSvc>
swift.cbprplus.02
</BizSvc>
<CreDt>
2021-04-09T09:00:00+01:00
</CreDt>
<PssblDplct>
true
</PssblDplct>
</AppHdr>
<Document
xmlns=
"urn:iso:std:iso:20022:tech:xsd:pacs.008.001.08"
>
<FIToFICstmrCdtTrf>
...
...
@@ -69,10 +70,6 @@ Change Log
</PmtTpInf>
<IntrBkSttlmAmt
Ccy=
"EUR"
>
15000000
</IntrBkSttlmAmt>
<IntrBkSttlmDt>
2021-04-09
</IntrBkSttlmDt>
<SttlmTmIndctn>
<DbtDtTm>
2022-06-10
</DbtDtTm>
<CdtDtTm>
2022-06-11
</CdtDtTm>
</SttlmTmIndctn>
<SttlmTmReq>
<CLSTm>
09:00:00+01:00
</CLSTm>
<TillTm>
09:00:00+02:00
</TillTm>
...
...
@@ -81,12 +78,9 @@ Change Log
</SttlmTmReq>
<InstdAmt
Ccy=
"EUR"
>
15000000
</InstdAmt>
<XchgRate>
1
</XchgRate>
<ChrgBr>
DEBT
</ChrgBr>
<ChrgBr>
SHAR
</ChrgBr>
<ChrgsInf>
<Amt
Ccy=
"USD"
>
12.0
</Amt>
</ChrgsInf>
<ChrgsInf>
<Amt
Ccy=
"EUR"
>
123
</Amt>
<Amt
Ccy=
"EUR"
>
123222222222222678.02
</Amt>
<Agt>
<FinInstnId>
<BICFI>
PSBCCNBJ
</BICFI>
...
...
@@ -118,10 +112,10 @@ Change Log
<PstlAdr>
<StrtNm>
High Street
</StrtNm>
<TwnNm>
Epping
</TwnNm>
<Ctry>
GB
</Ctry>
<TwnLctnNm>
zhangsan
</TwnLctnNm>
<DstrctNm>
lisi
</DstrctNm>
<CtrySubDvsn>
wangwu
</CtrySubDvsn>
<Ctry>
GB
</Ctry>
<AdrLine>
123
</AdrLine>
<AdrLine>
456
</AdrLine>
<AdrLine>
789
</AdrLine>
...
...
@@ -137,26 +131,6 @@ Change Log
</PstlAdr>
</FinInstnId>
</DbtrAgt>
<PrvsInstgAgt1>
<FinInstnId>
<Nm>
BIGGER COMPANY
</Nm>
<PstlAdr>
<TwnLctnNm>
zhangsan
</TwnLctnNm>
<DstrctNm>
lisi
</DstrctNm>
<CtrySubDvsn>
wangwu
</CtrySubDvsn>
</PstlAdr>
</FinInstnId>
</PrvsInstgAgt1>
<IntrmyAgt1>
<FinInstnId>
<BICFI>
QWERCNXX
</BICFI>
<PstlAdr>
<TwnLctnNm>
zhangsan
</TwnLctnNm>
<DstrctNm>
lisi
</DstrctNm>
<CtrySubDvsn>
wangwu
</CtrySubDvsn>
</PstlAdr>
</FinInstnId>
</IntrmyAgt1>
<CdtrAgt>
<FinInstnId>
<BICFI>
KREDBEBB
</BICFI>
...
...
@@ -172,10 +146,10 @@ Change Log
<PstlAdr>
<StrtNm>
Rue Saint Exupery
</StrtNm>
<TwnNm>
17/13 4460 GRACE-HOLLOGNE
</TwnNm>
<Ctry>
BG
</Ctry>
<TwnLctnNm>
zhangsan
</TwnLctnNm>
<DstrctNm>
lisi
</DstrctNm>
<CtrySubDvsn>
wangwu
</CtrySubDvsn>
<Ctry>
BG
</Ctry>
</PstlAdr>
</Cdtr>
<InstrForCdtrAgt>
...
...
swiftCore/src/main/resources/swiftXml/camt05400108_910.xml
View file @
376f6c7a
...
...
@@ -25,11 +25,11 @@
<Document
xmlns=
"urn:iso:std:iso:20022:tech:xsd:camt.054.001.08"
>
<BkToCstmrDbtCdtNtfctn>
<GrpHdr>
<MsgId>
FRDA000003421606
</MsgId>
<MsgId>
FRDA000003421606
ddd
</MsgId>
<CreDtTm>
2022-07-22T10:43:20.604+08:00
</CreDtTm>
</GrpHdr>
<Ntfctn>
<Id>
FRDA000003421606
</Id>
<Id>
FRDA000003421606
ddd
</Id>
<Acct>
<Id>
<Othr>
...
...
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