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
7411a32a
Commit
7411a32a
authored
Jul 08, 2022
by
zhanghou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成mt192292,mt196296中文的报文要素展示
parent
87416a0f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
Mx2MapCamt029Creator.java
...brilliance/swift/mx2map/camt029/Mx2MapCamt029Creator.java
+75
-0
No files found.
swiftCore/src/main/java/com/brilliance/swift/mx2map/camt029/Mx2MapCamt029Creator.java
0 → 100644
View file @
7411a32a
package
com
.
brilliance
.
swift
.
mx2map
.
camt029
;
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.util.XmlUtil
;
import
com.brilliance.swift.vo.common.BalanceTypeCode
;
import
com.brilliance.swift.vo.common.CdtDbtCode
;
import
org.dom4j.Document
;
import
org.dom4j.DocumentException
;
import
org.dom4j.DocumentHelper
;
import
javax.xml.datatype.XMLGregorianCalendar
;
import
java.util.Map
;
public
class
Mx2MapCamt029Creator
extends
AbstractMx2MapCreator
{
@Override
public
Map
<
String
,
String
>
mx2Map
()
throws
SwiftException
{
try
{
Document
document
=
DocumentHelper
.
parseText
(
xmlStr
);
Map
<
String
,
String
>
parentElementMaps
=
XmlUtil
.
getParentElementMaps
(
document
);
String
appHdrParentElementName
=
parentElementMaps
.
get
(
"AppHdr"
);
String
grpHdrParentElementName
=
parentElementMaps
.
get
(
"GrpHdr"
);
String
bodyParentElementName
=
parentElementMaps
.
get
(
"CxlDtls"
);
String
sendBic
=
abstractMX
.
getAppHdr
().
from
();
maps
.
put
(
getPropertyValue
(
"app.header.sendBic"
),
sendBic
);
String
receiverBic
=
abstractMX
.
getAppHdr
().
to
();
maps
.
put
(
getPropertyValue
(
"app.header.receiverBic"
),
receiverBic
);
String
uetr
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.OrgnlUETR"
);
if
(
StringUtil
.
isNotEmpty
(
uetr
)){
maps
.
put
(
getPropertyValue
(
"uetr"
),
uetr
);
}
String
msgDefId
=
abstractMX
.
getAppHdr
().
messageName
();
maps
.
put
(
getPropertyValue
(
"app.header.msgDefId"
),
msgDefId
);
String
bizSvc
=
abstractMX
.
getAppHdr
().
serviceName
();
maps
.
put
(
getPropertyValue
(
"app.header.bizSvc"
),
bizSvc
);
XMLGregorianCalendar
creDt
=
abstractMX
.
getAppHdr
().
creationDate
();
maps
.
put
(
getPropertyValue
(
"app.header.creDt"
),
creDt
.
toXMLFormat
());
String
cxlStsId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.CxlStsId"
);
if
(
StringUtil
.
isNotEmpty
(
cxlStsId
)){
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"message.id"
),
cxlStsId
);
}
String
caseId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.RslvdCase.Id"
);
if
(
StringUtil
.
isNotEmpty
(
caseId
)){
maps
.
put
(
getPropertyValue
(
"endToEnd.id"
),
caseId
);
}
String
nameId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId"
);
String
dateStr
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlCreDtTm"
);
if
(
StringUtil
.
isNotEmpty
(
nameId
)){
maps
.
put
(
getPropertyValue
(
"originalGroupInformation.orgnlMsgId"
),
nameId
);
}
if
(
StringUtil
.
isNotEmpty
(
dateStr
)){
maps
.
put
(
getPropertyValue
(
"originalGroupInformation.orgnlCreDtTm"
),
dateStr
);
}
String
reason
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.CxlStsRsnInf.Rsn.Cd"
);
if
(
StringUtil
.
isNotEmpty
(
reason
)){
maps
.
put
(
getPropertyValue
(
"cancellationDetails.transactionInformationAndStatus.cancellationStatusReasonInformation.reason.cd"
),
reason
);
}
int
count
=
XmlUtil
.
getChildrenCount
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.CxlStsRsnInf.AddtlInf"
,
null
);
String
information
=
""
;
if
(
count
>
0
){
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
information
=
information
+
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.CxlStsRsnInf.AddtlInf("
+
i
+
")"
);
}
}
if
(
StringUtil
.
isNotEmpty
(
information
)){
maps
.
put
(
getPropertyValue
(
"cancellationDetails.transactionInformationAndStatus.cancellationStatusReasonInformation.addtlInf"
),
information
);
}
}
catch
(
DocumentException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
return
maps
;
}
}
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