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
961ca0f0
Commit
961ca0f0
authored
Jun 29, 2022
by
zhanghou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mt192292,mt196296,mt942的异常警告的定义
parent
3e32e0af
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
143 additions
and
69 deletions
+143
-69
AbstractMx2MtTagsGenerate.java
...com/brilliance/swift/mx2mt/AbstractMx2MtTagsGenerate.java
+0
-33
Mx2Mtn92Creator.java
.../com/brilliance/swift/mx2mt/mt192292/Mx2Mtn92Creator.java
+10
-1
Field11SGenerate.java
...rilliance/swift/mx2mt/mt192292/impl/Field11SGenerate.java
+6
-2
Mx2Mtn96Creator.java
.../com/brilliance/swift/mx2mt/mt196296/Mx2Mtn96Creator.java
+11
-2
Field11RGenerate.java
...rilliance/swift/mx2mt/mt196296/impl/Field11RGenerate.java
+34
-1
Field20Generate.java
...brilliance/swift/mx2mt/mt196296/impl/Field20Generate.java
+3
-1
Field21Generate.java
...brilliance/swift/mx2mt/mt196296/impl/Field21Generate.java
+3
-1
Mx2Mt941942Creator.java
...m/brilliance/swift/mx2mt/mt941942/Mx2Mt941942Creator.java
+5
-2
Field20Generate.java
...brilliance/swift/mx2mt/mt941942/impl/Field20Generate.java
+3
-1
Field28CGenerate.java
...rilliance/swift/mx2mt/mt941942/impl/Field28CGenerate.java
+5
-0
Field60FGenerate.java
...rilliance/swift/mx2mt/mt941942/impl/Field60FGenerate.java
+2
-2
Field61Generate.java
...brilliance/swift/mx2mt/mt941942/impl/Field61Generate.java
+29
-5
Field62FGenerate.java
...rilliance/swift/mx2mt/mt941942/impl/Field62FGenerate.java
+2
-2
Field64Generate.java
...brilliance/swift/mx2mt/mt941942/impl/Field64Generate.java
+2
-2
Field65Generate.java
...brilliance/swift/mx2mt/mt941942/impl/Field65Generate.java
+2
-2
Field90CGenerate.java
...rilliance/swift/mx2mt/mt941942/impl/Field90CGenerate.java
+13
-6
Field90DGenerate.java
...rilliance/swift/mx2mt/mt941942/impl/Field90DGenerate.java
+13
-6
No files found.
swiftCore/src/main/java/com/brilliance/swift/mx2mt/AbstractMx2MtTagsGenerate.java
View file @
961ca0f0
...
@@ -1324,39 +1324,6 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
...
@@ -1324,39 +1324,6 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
}
}
/**
/**
* 判断xml节点的值如果值包含"pacs.008"则该字段赋值为"103",
* 包含"pacs.003"则赋值为"104",包含"MT10[0-9]{1}",
* 则根据正则表达式,截取3位为"10X",(X的取值为0-9),
* 值包含"pasc.009",赋值为"202",值包含"pasc.010"则赋值为"204",
* 包含"MT20[0-9]{1}",则根据正则表达式,截取3位为"20X",(X的取值为0-9),
* 最后如果上述条件均不满足则直接赋值为"202"。1类型的交给192处理,2类型的交给292处理
* 这是11s域的第一部分。
* @param mtType
* @return
*/
protected
String
getMtMsg
(
String
mtType
)
{
if
(
StringUtil
.
isNotEmpty
(
mtType
)){
if
(
mtType
.
startsWith
(
"pacs.008"
)){
return
"103"
;
}
else
if
(
mtType
.
startsWith
(
"pacs.003"
)){
return
"104"
;
}
else
if
(
mtType
.
startsWith
(
"pacs.009"
)){
return
"202"
;
}
else
if
(
mtType
.
startsWith
(
"pacs.010"
)){
return
"204"
;
}
else
if
(
mtType
.
matches
(
"MT10[0-9]{1}"
)){
return
mtType
.
substring
(
2
);
}
else
if
(
mtType
.
matches
(
"MT20[0-9]{1}"
)){
return
mtType
.
substring
(
2
);
}
else
{
return
"202"
;
}
}
else
{
return
"没有找到指定的类型"
;
}
}
/**
*MX_To_MT79CANC(MXOriginalUETR,MXCancellationReasonInformation)
*MX_To_MT79CANC(MXOriginalUETR,MXCancellationReasonInformation)
* 参数一:MXOriginalUETR对应的xml节点
* 参数一:MXOriginalUETR对应的xml节点
* FIToFIPmtCxlReq/Undrlyg/TxInf/OrgnlUETR
* FIToFIPmtCxlReq/Undrlyg/TxInf/OrgnlUETR
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt192292/Mx2Mtn92Creator.java
View file @
961ca0f0
...
@@ -56,6 +56,15 @@ public class Mx2Mtn92Creator extends AbstractMx2MtCreator {
...
@@ -56,6 +56,15 @@ public class Mx2Mtn92Creator extends AbstractMx2MtCreator {
fieldsGenerateList
.
add
(
new
Field79Generate
());
fieldsGenerateList
.
add
(
new
Field79Generate
());
return
fieldsGenerateList
;
return
fieldsGenerateList
;
}
}
/**
* 判断xml节点的值如果值包含"pacs.008"则该字段赋值为"103",
* 包含"pacs.003"则赋值为"104",包含"MT10[0-9]{1}",
* 则根据正则表达式,截取3位为"10X",(X的取值为0-9),
* 值包含"pasc.009",赋值为"202",值包含"pasc.010"则赋值为"204",
* 包含"MT20[0-9]{1}",则根据正则表达式,截取3位为"20X",(X的取值为0-9),
* 最后如果上述条件均不满足则直接赋值为"202"。1类型的交给192处理,2类型的交给292处理
* @return
*/
@Override
@Override
protected
String
getMtType
()
{
protected
String
getMtType
()
{
Document
document
=
(
Document
)
context
.
get
(
Mx2MtContextIdentifier
.
MX_XMl_DOCUMENT
,
true
);
Document
document
=
(
Document
)
context
.
get
(
Mx2MtContextIdentifier
.
MX_XMl_DOCUMENT
,
true
);
...
@@ -74,7 +83,7 @@ public class Mx2Mtn92Creator extends AbstractMx2MtCreator {
...
@@ -74,7 +83,7 @@ public class Mx2Mtn92Creator extends AbstractMx2MtCreator {
}
else
if
(
orgMsgNameIdentification
.
matches
(
"MT20[0-9]{1}"
))
{
}
else
if
(
orgMsgNameIdentification
.
matches
(
"MT20[0-9]{1}"
))
{
mtType
=
Mx2MtConstants
.
MT_TYPE_292
;
mtType
=
Mx2MtConstants
.
MT_TYPE_292
;
}
else
{
}
else
{
buildSTErrorInfo
(
ERROR
.
T20092
,
null
,
null
);
buildSTErrorInfo
(
ERROR
.
T20092
,
""
,
bodyParentPath
+
"Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId"
);
}
}
}
}
return
mtType
;
return
mtType
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt192292/impl/Field11SGenerate.java
View file @
961ca0f0
...
@@ -25,7 +25,6 @@ public class Field11SGenerate extends AbstractMx2MtTagsGenerate {
...
@@ -25,7 +25,6 @@ public class Field11SGenerate extends AbstractMx2MtTagsGenerate {
String
mtType
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId"
);
String
mtType
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId"
);
String
dateStr
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Undrlyg.TxInf.OrgnlGrpInf.OrgnlCreDtTm"
);
String
dateStr
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Undrlyg.TxInf.OrgnlGrpInf.OrgnlCreDtTm"
);
if
(
StringUtil
.
isNotEmpty
(
mtType
))
{
if
(
StringUtil
.
isNotEmpty
(
mtType
))
{
orgnlMsgNmId
=
getMtMsg
(
mtType
);
if
(
StringUtil
.
isNotEmpty
(
mtType
)){
if
(
StringUtil
.
isNotEmpty
(
mtType
)){
if
(
mtType
.
startsWith
(
"pacs.008"
)){
if
(
mtType
.
startsWith
(
"pacs.008"
)){
orgnlMsgNmId
=
"103"
;
orgnlMsgNmId
=
"103"
;
...
@@ -41,12 +40,17 @@ public class Field11SGenerate extends AbstractMx2MtTagsGenerate {
...
@@ -41,12 +40,17 @@ public class Field11SGenerate extends AbstractMx2MtTagsGenerate {
orgnlMsgNmId
=
mtType
.
substring
(
2
);
orgnlMsgNmId
=
mtType
.
substring
(
2
);
}
else
{
}
else
{
orgnlMsgNmId
=
"202"
;
orgnlMsgNmId
=
"202"
;
buildSTErrorInfo
(
ERROR
.
T20083
,
null
,
null
);
buildSTErrorInfo
(
ERROR
.
T20083
,
""
,
""
);
}
}
}
}
}
}
if
(
StringUtil
.
isNotEmpty
(
dateStr
)){
if
(
StringUtil
.
isNotEmpty
(
dateStr
)){
if
(
dateStr
.
length
()>
0
){
date
=
mXToMTDate
(
dateStr
);
date
=
mXToMTDate
(
dateStr
);
}
else
{
date
=
mXToMTDate
(
"993112"
);
}
}
}
tags
.
add
(
new
Tag
(
name
,
orgnlMsgNmId
+
Mx2MtConstants
.
NEW_LINE
+
date
));
tags
.
add
(
new
Tag
(
name
,
orgnlMsgNmId
+
Mx2MtConstants
.
NEW_LINE
+
date
));
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt196296/Mx2Mtn96Creator.java
View file @
961ca0f0
package
com
.
brilliance
.
swift
.
mx2mt
.
mt196296
;
package
com
.
brilliance
.
swift
.
mx2mt
.
mt196296
;
import
com.brilliance.swift.constants.ERROR
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mx2mt.AbstractMx2MtCreator
;
import
com.brilliance.swift.mx2mt.AbstractMx2MtCreator
;
...
@@ -55,7 +56,15 @@ public class Mx2Mtn96Creator extends AbstractMx2MtCreator {
...
@@ -55,7 +56,15 @@ public class Mx2Mtn96Creator extends AbstractMx2MtCreator {
fieldsGenerateList
.
add
(
new
Field11RGenerate
());
fieldsGenerateList
.
add
(
new
Field11RGenerate
());
return
fieldsGenerateList
;
return
fieldsGenerateList
;
}
}
/**
* 判断xml节点的值如果值包含"pacs.008"则该字段赋值为"103",
* 包含"pacs.003"则赋值为"104",包含"MT10[0-9]{1}",
* 则根据正则表达式,截取3位为"10X",(X的取值为0-9),
* 值包含"pasc.009",赋值为"202",值包含"pasc.010"则赋值为"204",
* 包含"MT20[0-9]{1}",则根据正则表达式,截取3位为"20X",(X的取值为0-9),
* 最后如果上述条件均不满足则直接赋值为"202"。1类型的交给192处理,2类型的交给292处理
* @return
*/
@Override
@Override
protected
String
getMtType
()
{
protected
String
getMtType
()
{
Document
document
=
(
Document
)
context
.
get
(
Mx2MtContextIdentifier
.
MX_XMl_DOCUMENT
,
true
);
Document
document
=
(
Document
)
context
.
get
(
Mx2MtContextIdentifier
.
MX_XMl_DOCUMENT
,
true
);
...
@@ -74,7 +83,7 @@ public class Mx2Mtn96Creator extends AbstractMx2MtCreator {
...
@@ -74,7 +83,7 @@ public class Mx2Mtn96Creator extends AbstractMx2MtCreator {
}
else
if
(
orgMsgNameIdentification
.
matches
(
"MT20[0-9]{1}"
))
{
}
else
if
(
orgMsgNameIdentification
.
matches
(
"MT20[0-9]{1}"
))
{
mtType
=
Mx2MtConstants
.
MT_TYPE_296
;
mtType
=
Mx2MtConstants
.
MT_TYPE_296
;
}
else
{
}
else
{
//TODO,填入location:(mt196|mt296)/block3/:11R:,errorcode:T20083
buildSTErrorInfo
(
ERROR
.
T20092
,
""
,
bodyParentPath
+
"CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId"
);
}
}
}
}
return
mtType
;
return
mtType
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt196296/impl/Field11RGenerate.java
View file @
961ca0f0
package
com
.
brilliance
.
swift
.
mx2mt
.
mt196296
.
impl
;
package
com
.
brilliance
.
swift
.
mx2mt
.
mt196296
.
impl
;
import
com.brilliance.swift.constants.ERROR
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
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
;
...
@@ -22,14 +23,46 @@ public class Field11RGenerate extends AbstractMx2MtTagsGenerate {
...
@@ -22,14 +23,46 @@ public class Field11RGenerate extends AbstractMx2MtTagsGenerate {
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
String
orgnlMsgNmId
=
""
;
String
orgnlMsgNmId
=
""
;
String
date
=
""
;
String
date
=
""
;
boolean
boolean1
=
false
;
boolean
boolean2
=
false
;
String
mtType
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId"
);
String
mtType
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId"
);
String
dateStr
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlCreDtTm"
);
String
dateStr
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlCreDtTm"
);
if
(
StringUtil
.
isNotEmpty
(
mtType
))
{
if
(
StringUtil
.
isNotEmpty
(
mtType
))
{
orgnlMsgNmId
=
getMtMsg
(
mtType
);
if
(
StringUtil
.
isNotEmpty
(
mtType
)){
if
(
mtType
.
startsWith
(
"pacs.008"
)){
orgnlMsgNmId
=
"103"
;
}
else
if
(
mtType
.
startsWith
(
"pacs.003"
)){
orgnlMsgNmId
=
"104"
;
}
else
if
(
mtType
.
startsWith
(
"pacs.009"
)){
orgnlMsgNmId
=
"202"
;
}
else
if
(
mtType
.
startsWith
(
"pacs.010"
)){
orgnlMsgNmId
=
"204"
;
}
else
if
(
mtType
.
matches
(
"MT10[0-9]{1}"
)){
orgnlMsgNmId
=
mtType
.
substring
(
2
);
}
else
if
(
mtType
.
matches
(
"MT20[0-9]{1}"
)){
orgnlMsgNmId
=
mtType
.
substring
(
2
);
}
else
{
orgnlMsgNmId
=
"202"
;
boolean1
=
true
;
}
}
}
}
if
(
StringUtil
.
isNotEmpty
(
dateStr
)){
if
(
StringUtil
.
isNotEmpty
(
dateStr
)){
if
(
dateStr
.
length
()>
0
){
date
=
mXToMTDate
(
dateStr
);
date
=
mXToMTDate
(
dateStr
);
}
else
{
date
=
mXToMTDate
(
"993112"
);
boolean2
=
true
;
}
}
}
if
(
boolean1
&&
boolean2
){
}
else
{
tags
.
add
(
new
Tag
(
name
,
orgnlMsgNmId
+
Mx2MtConstants
.
NEW_LINE
+
date
));
tags
.
add
(
new
Tag
(
name
,
orgnlMsgNmId
+
Mx2MtConstants
.
NEW_LINE
+
date
));
if
(
boolean1
){
buildSTErrorInfo
(
ERROR
.
T20083
,
""
,
""
);
}
}
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt196296/impl/Field20Generate.java
View file @
961ca0f0
package
com
.
brilliance
.
swift
.
mx2mt
.
mt196296
.
impl
;
package
com
.
brilliance
.
swift
.
mx2mt
.
mt196296
.
impl
;
import
com.brilliance.swift.constants.ERROR
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
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
;
...
@@ -23,12 +24,13 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
...
@@ -23,12 +24,13 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
String
messageId
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CxlDtls.TxInfAndSts.CxlStsId"
);
String
messageId
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CxlDtls.TxInfAndSts.CxlStsId"
);
if
(
StringUtil
.
isNotEmpty
(
messageId
))
{
if
(
StringUtil
.
isNotEmpty
(
messageId
))
{
if
(
messageId
.
length
()
>
16
)
{
if
(
messageId
.
length
()
>
16
)
{
buildSTErrorInfo
(
ERROR
.
T0000T
,
"BLOCK4/:20:"
,
messageId
);
messageId
=
messageId
.
substring
(
0
,
15
)
+
"+"
;
messageId
=
messageId
.
substring
(
0
,
15
)
+
"+"
;
}
}
String
value
=
messageId
;
String
value
=
messageId
;
if
(
value
.
startsWith
(
"/"
)
||
value
.
endsWith
(
"/"
)
||
value
.
contains
(
"//"
))
{
if
(
value
.
startsWith
(
"/"
)
||
value
.
endsWith
(
"/"
)
||
value
.
contains
(
"//"
))
{
value
=
Mx2MtConstants
.
MX_TO_MT_DEFAULT_VALUE
;
value
=
Mx2MtConstants
.
MX_TO_MT_DEFAULT_VALUE
;
//TODO,填入location:(mt196|mt296)/block3/:20:,errorcode:T20090
buildSTErrorInfo
(
ERROR
.
T20090
,
"BLOCK4/:20:"
,
messageId
);
}
}
tags
.
add
(
new
Tag
(
name
,
value
));
tags
.
add
(
new
Tag
(
name
,
value
));
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt196296/impl/Field21Generate.java
View file @
961ca0f0
package
com
.
brilliance
.
swift
.
mx2mt
.
mt196296
.
impl
;
package
com
.
brilliance
.
swift
.
mx2mt
.
mt196296
.
impl
;
import
com.brilliance.swift.constants.ERROR
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
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
;
...
@@ -23,12 +24,13 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
...
@@ -23,12 +24,13 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
String
orgnlInstrId
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CxlDtls.TxInfAndSts.RslvdCase.Id"
);
String
orgnlInstrId
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CxlDtls.TxInfAndSts.RslvdCase.Id"
);
if
(
StringUtil
.
isNotEmpty
(
orgnlInstrId
))
{
if
(
StringUtil
.
isNotEmpty
(
orgnlInstrId
))
{
if
(
orgnlInstrId
.
length
()
>
16
)
{
if
(
orgnlInstrId
.
length
()
>
16
)
{
buildSTErrorInfo
(
ERROR
.
T0000T
,
"BLOCK4/:21:"
,
orgnlInstrId
);
orgnlInstrId
=
orgnlInstrId
.
substring
(
0
,
15
)
+
"+"
;
orgnlInstrId
=
orgnlInstrId
.
substring
(
0
,
15
)
+
"+"
;
}
}
String
value
=
orgnlInstrId
;
String
value
=
orgnlInstrId
;
if
(
value
.
startsWith
(
"/"
)
||
value
.
endsWith
(
"/"
)
||
value
.
contains
(
"//"
))
{
if
(
value
.
startsWith
(
"/"
)
||
value
.
endsWith
(
"/"
)
||
value
.
contains
(
"//"
))
{
value
=
Mx2MtConstants
.
MX_TO_MT_DEFAULT_VALUE
;
value
=
Mx2MtConstants
.
MX_TO_MT_DEFAULT_VALUE
;
//TODO,填入location:(mt196|mt296)/block3/:21:,errorcode:T20091
buildSTErrorInfo
(
ERROR
.
T20091
,
"BLOCK4/:21:"
,
orgnlInstrId
);
}
}
tags
.
add
(
new
Tag
(
name
,
value
));
tags
.
add
(
new
Tag
(
name
,
value
));
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt941942/Mx2Mt941942Creator.java
View file @
961ca0f0
package
com
.
brilliance
.
swift
.
mx2mt
.
mt941942
;
package
com
.
brilliance
.
swift
.
mx2mt
.
mt941942
;
import
com.brilliance.swift.constants.ERROR
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
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.mt941942.impl.*
;
import
com.brilliance.swift.mx2mt.mt941942.impl.*
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.util.XmlUtil
;
import
com.brilliance.swift.util.XmlUtil
;
import
org.dom4j.Document
;
import
org.dom4j.Document
;
...
@@ -46,13 +48,14 @@ public class Mx2Mt941942Creator extends AbstractMx2MtCreator {
...
@@ -46,13 +48,14 @@ public class Mx2Mt941942Creator extends AbstractMx2MtCreator {
@Override
@Override
protected
String
getMtType
()
{
protected
String
getMtType
()
{
Document
document
=
(
Document
)
context
.
get
(
Mx2MtContextIdentifier
.
MX_XMl_DOCUMENT
);
/*
Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT);
String bodyParentPath = (String)context.get(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, true);
String bodyParentPath = (String)context.get(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, true);
int balanceTypeCount = getXmlNodeCounts(bodyParentPath, document, "Rpt.Bal");
int balanceTypeCount = getXmlNodeCounts(bodyParentPath, document, "Rpt.Bal");
if(balanceTypeCount>0){
if(balanceTypeCount>0){
return Mx2MtConstants.MT_TYPE_941;
return Mx2MtConstants.MT_TYPE_941;
}else {
}else {
return Mx2MtConstants.MT_TYPE_942;
return Mx2MtConstants.MT_TYPE_942;
}
}*/
return
Mx2MtConstants
.
MT_TYPE_942
;
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt941942/impl/Field20Generate.java
View file @
961ca0f0
package
com
.
brilliance
.
swift
.
mx2mt
.
mt941942
.
impl
;
package
com
.
brilliance
.
swift
.
mx2mt
.
mt941942
.
impl
;
import
com.brilliance.swift.constants.ERROR
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
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
;
...
@@ -23,12 +24,13 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
...
@@ -23,12 +24,13 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
String
messageId
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.Id"
);
String
messageId
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.Id"
);
if
(
StringUtil
.
isNotEmpty
(
messageId
))
{
if
(
StringUtil
.
isNotEmpty
(
messageId
))
{
if
(
messageId
.
length
()
>
16
)
{
if
(
messageId
.
length
()
>
16
)
{
buildSTErrorInfo
(
ERROR
.
T0000T
,
"BLOCK4/:20:"
,
messageId
);
messageId
=
messageId
.
substring
(
0
,
15
)
+
"+"
;
messageId
=
messageId
.
substring
(
0
,
15
)
+
"+"
;
}
}
String
value
=
messageId
;
String
value
=
messageId
;
if
(
value
.
startsWith
(
"/"
)
||
value
.
endsWith
(
"/"
)
||
value
.
contains
(
"//"
))
{
if
(
value
.
startsWith
(
"/"
)
||
value
.
endsWith
(
"/"
)
||
value
.
contains
(
"//"
))
{
value
=
Mx2MtConstants
.
MX_TO_MT_DEFAULT_VALUE
;
value
=
Mx2MtConstants
.
MX_TO_MT_DEFAULT_VALUE
;
//TODO,填入location:mt942/block3/:20:,errorcode:T20115
buildSTErrorInfo
(
ERROR
.
T20115
,
"BLOCK4/:20:"
,
messageId
);
}
}
tags
.
add
(
new
Tag
(
name
,
value
));
tags
.
add
(
new
Tag
(
name
,
value
));
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt941942/impl/Field28CGenerate.java
View file @
961ca0f0
package
com
.
brilliance
.
swift
.
mx2mt
.
mt941942
.
impl
;
package
com
.
brilliance
.
swift
.
mx2mt
.
mt941942
.
impl
;
import
com.brilliance.swift.constants.ERROR
;
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
;
...
@@ -23,6 +24,10 @@ public class Field28CGenerate extends AbstractMx2MtTagsGenerate {
...
@@ -23,6 +24,10 @@ public class Field28CGenerate extends AbstractMx2MtTagsGenerate {
String
mt
=
""
;
String
mt
=
""
;
if
(
StringUtil
.
isEmpty
(
leSeNum
)||
leSeNum
.
length
()>
5
){
if
(
StringUtil
.
isEmpty
(
leSeNum
)||
leSeNum
.
length
()>
5
){
mt
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.ElctrncSeqNb"
);
mt
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.ElctrncSeqNb"
);
if
(
StringUtil
.
isEmpty
(
mt
)||
mt
.
length
()>
5
){
buildSTErrorInfo
(
ERROR
.
T20103
,
"BLOCK4/:28:"
,
bodyHdrParentElementName
+
"Rpt.ElctrncSeqNb"
);
return
;
}
}
else
{
}
else
{
String
pageNum
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.RptPgntn.PgNb"
);
String
pageNum
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.RptPgntn.PgNb"
);
mt
=
leSeNum
+
"/"
+
pageNum
;
mt
=
leSeNum
+
"/"
+
pageNum
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt941942/impl/Field60FGenerate.java
View file @
961ca0f0
...
@@ -25,7 +25,7 @@ public class Field60FGenerate extends AbstractMx2MtTagsGenerate {
...
@@ -25,7 +25,7 @@ public class Field60FGenerate extends AbstractMx2MtTagsGenerate {
@Override
@Override
public
void
tagGenerate
()
throws
SwiftException
{
public
void
tagGenerate
()
throws
SwiftException
{
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
/*
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
int index = -1;
int index = -1;
...
@@ -66,6 +66,6 @@ public class Field60FGenerate extends AbstractMx2MtTagsGenerate {
...
@@ -66,6 +66,6 @@ public class Field60FGenerate extends AbstractMx2MtTagsGenerate {
} catch (DatatypeConfigurationException e) {
} catch (DatatypeConfigurationException e) {
throw new SwiftException("ERROR", e.getMessage());
throw new SwiftException("ERROR", e.getMessage());
}
}
}
}
*/
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt941942/impl/Field61Generate.java
View file @
961ca0f0
package
com
.
brilliance
.
swift
.
mx2mt
.
mt941942
.
impl
;
package
com
.
brilliance
.
swift
.
mx2mt
.
mt941942
.
impl
;
import
com.brilliance.swift.constants.ERROR
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
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.mx2mt.Mx2MtContextIdentifier
;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.util.NumberUtil
;
import
com.brilliance.swift.util.NumberUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.util.StringUtil
;
...
@@ -30,11 +32,22 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
...
@@ -30,11 +32,22 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
try
{
try
{
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
int
balanceTypeCount
=
getXmlNodeCounts
(
bodyHdrParentElementName
,
document
,
"Rpt.Bal"
);
/*
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
if(balanceTypeCount>0){
if(balanceTypeCount>0){
return;
return;
}
}
*/
int
entryCount
=
getXmlNodeCounts
(
bodyHdrParentElementName
,
document
,
"Rpt.Ntry"
);
int
entryCount
=
getXmlNodeCounts
(
bodyHdrParentElementName
,
document
,
"Rpt.Ntry"
);
if
(
entryCount
>
189
){
buildSTErrorInfo
(
ERROR
.
T20110
,
"BLOCK4/:61:"
,
bodyHdrParentElementName
+
"Rpt.Ntry"
);
return
;
}
String
sumc
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.TxsSummry.TtlCdtNtries.Sum"
);
String
sumd
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.TxsSummry.TtlDbtNtries.Sum"
);
if
(
entryCount
<
0
||
StringUtil
.
isEmpty
(
sumc
)&&
StringUtil
.
isEmpty
(
sumd
)){
buildSTErrorInfo
(
ERROR
.
T20114
,
"BLOCK4/:61:"
,
""
);
return
;
}
String
ccy2
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.Acct.Ccy"
);
if
(
entryCount
>
0
)
{
if
(
entryCount
>
0
)
{
for
(
int
i
=
0
;
i
<
entryCount
;
i
++)
{
for
(
int
i
=
0
;
i
<
entryCount
;
i
++)
{
String
value
=
""
;
String
value
=
""
;
...
@@ -75,10 +88,21 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
...
@@ -75,10 +88,21 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
String
amt
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.Ntry("
+
i
+
").Amt"
);
String
amt
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.Ntry("
+
i
+
").Amt"
);
String
ccy
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.Ntry("
+
i
+
").Amt@Ccy"
);
String
ccy
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.Ntry("
+
i
+
").Amt@Ccy"
);
if
(
StringUtil
.
isNotEmpty
(
amt
)
&&
StringUtil
.
isNotEmpty
(
ccy
))
{
if
(
StringUtil
.
isNotEmpty
(
amt
)
&&
StringUtil
.
isNotEmpty
(
ccy
))
{
value
+=
NumberUtil
.
formatAmt
(
new
BigDecimal
(
amt
),
ccy
);
String
amount
=
NumberUtil
.
formatAmt
(
new
BigDecimal
(
amt
),
ccy
);
if
(
amount
.
length
()>
15
){
buildSTErrorInfo
(
ERROR
.
T20113
,
"BLOCK4/:61:"
,
amt
);
return
;
}
value
+=
amount
;
}
if
(
StringUtil
.
isNotEmpty
(
ccy
)&&
StringUtil
.
isNotEmpty
(
ccy2
)){
if
(
ccy
.
equals
(
ccy2
)){
buildSTErrorInfo
(
ERROR
.
T20116
,
"BLOCK4/:61:"
,
ccy
);
return
;
}
}
}
if
(
amt
.
length
()>
1
5
){
if
(
amt
.
length
()>
1
4
){
//TODO,填入location:mt942/block3/:61:,errorcode:T20113
buildSTErrorInfo
(
ERROR
.
T20113
,
"BLOCK4/:61:"
,
bodyHdrParentElementName
+
"Rpt.Ntry("
+
i
+
").Amt"
);
return
;
return
;
}
}
value
+=
"NTRF"
;
value
+=
"NTRF"
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt941942/impl/Field62FGenerate.java
View file @
961ca0f0
...
@@ -25,7 +25,7 @@ public class Field62FGenerate extends AbstractMx2MtTagsGenerate {
...
@@ -25,7 +25,7 @@ public class Field62FGenerate extends AbstractMx2MtTagsGenerate {
@Override
@Override
public
void
tagGenerate
()
throws
SwiftException
{
public
void
tagGenerate
()
throws
SwiftException
{
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
/*
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
int index = -1;
int index = -1;
...
@@ -66,6 +66,6 @@ public class Field62FGenerate extends AbstractMx2MtTagsGenerate {
...
@@ -66,6 +66,6 @@ public class Field62FGenerate extends AbstractMx2MtTagsGenerate {
} catch (DatatypeConfigurationException e) {
} catch (DatatypeConfigurationException e) {
throw new SwiftException("ERROR", e.getMessage());
throw new SwiftException("ERROR", e.getMessage());
}
}
}
}
*/
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt941942/impl/Field64Generate.java
View file @
961ca0f0
...
@@ -25,7 +25,7 @@ public class Field64Generate extends AbstractMx2MtTagsGenerate {
...
@@ -25,7 +25,7 @@ public class Field64Generate extends AbstractMx2MtTagsGenerate {
@Override
@Override
public
void
tagGenerate
()
throws
SwiftException
{
public
void
tagGenerate
()
throws
SwiftException
{
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
/*
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
int index = -1;
int index = -1;
...
@@ -66,6 +66,6 @@ public class Field64Generate extends AbstractMx2MtTagsGenerate {
...
@@ -66,6 +66,6 @@ public class Field64Generate extends AbstractMx2MtTagsGenerate {
} catch (DatatypeConfigurationException e) {
} catch (DatatypeConfigurationException e) {
throw new SwiftException("ERROR", e.getMessage());
throw new SwiftException("ERROR", e.getMessage());
}
}
}
}
*/
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt941942/impl/Field65Generate.java
View file @
961ca0f0
...
@@ -27,7 +27,7 @@ public class Field65Generate extends AbstractMx2MtTagsGenerate {
...
@@ -27,7 +27,7 @@ public class Field65Generate extends AbstractMx2MtTagsGenerate {
@Override
@Override
public
void
tagGenerate
()
throws
SwiftException
{
public
void
tagGenerate
()
throws
SwiftException
{
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
/*
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
if (balanceTypeCount > 0) {
if (balanceTypeCount > 0) {
...
@@ -64,6 +64,6 @@ public class Field65Generate extends AbstractMx2MtTagsGenerate {
...
@@ -64,6 +64,6 @@ public class Field65Generate extends AbstractMx2MtTagsGenerate {
}
}
}
}
}
}
}
}
*/
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt941942/impl/Field90CGenerate.java
View file @
961ca0f0
package
com
.
brilliance
.
swift
.
mx2mt
.
mt941942
.
impl
;
package
com
.
brilliance
.
swift
.
mx2mt
.
mt941942
.
impl
;
import
com.brilliance.swift.constants.ERROR
;
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.NumberUtil
;
import
com.brilliance.swift.util.NumberUtil
;
...
@@ -21,20 +22,26 @@ public class Field90CGenerate extends AbstractMx2MtTagsGenerate {
...
@@ -21,20 +22,26 @@ public class Field90CGenerate extends AbstractMx2MtTagsGenerate {
public
void
tagGenerate
()
throws
SwiftException
{
public
void
tagGenerate
()
throws
SwiftException
{
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
String
sum
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.TxsSummry.TtlCdtNtries.Sum"
);
String
sum
c
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.TxsSummry.TtlCdtNtries.Sum"
);
String
nbOfNtries
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.TxsSummry.TtlCdtNtries.NbOfNtries"
);
String
nbOfNtries
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.TxsSummry.TtlCdtNtries.NbOfNtries"
);
if
(
StringUtil
.
isNotEmpty
(
sum
)&&
StringUtil
.
isNotEmpty
(
nbOfNtries
))
{
int
entryCount
=
getXmlNodeCounts
(
bodyHdrParentElementName
,
document
,
"Rpt.Ntry"
);
String
sumd
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.TxsSummry.TtlDbtNtries.Sum"
);
if
(
entryCount
<
0
||
StringUtil
.
isEmpty
(
sumc
)&&
StringUtil
.
isEmpty
(
sumd
)){
buildSTErrorInfo
(
ERROR
.
T20114
,
"BLOCK4/:90C:"
,
bodyHdrParentElementName
+
"Rpt.TxsSummry.TtlCdtNtries.Sum"
);
return
;
}
if
(
StringUtil
.
isNotEmpty
(
sumc
)&&
StringUtil
.
isNotEmpty
(
nbOfNtries
))
{
String
currency
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.Acct.Ccy"
);
String
currency
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.Acct.Ccy"
);
String
amt
=
NumberUtil
.
formatAmt
(
new
BigDecimal
(
sum
),
currency
);
String
amt
=
NumberUtil
.
formatAmt
(
new
BigDecimal
(
sum
c
),
currency
);
if
(
amt
.
length
()>
15
){
if
(
amt
.
length
()>
15
){
//TODO,填入location:mt942/block3/:90C:,errorcode:T20120
buildSTErrorInfo
(
ERROR
.
T20120
,
"BLOCK4/:90C:"
,
amt
);
}
else
if
(
nbOfNtries
.
length
()>
5
){
}
else
if
(
nbOfNtries
.
length
()>
5
){
//TODO,填入location:mt942/block3/:90C:,errorcode:T20119
buildSTErrorInfo
(
ERROR
.
T20119
,
"BLOCK4/:90C:"
,
nbOfNtries
);
}
else
{
}
else
{
tags
.
add
(
new
Tag
(
name
,
nbOfNtries
+
currency
+
amt
));
tags
.
add
(
new
Tag
(
name
,
nbOfNtries
+
currency
+
amt
));
}
}
}
else
{
}
else
{
//TODO,填入location:mt942/block3/:90C:,errorcode:T20122
buildSTErrorInfo
(
ERROR
.
T20122
,
"BLOCK4/:90D:"
,
""
);
}
}
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt941942/impl/Field90DGenerate.java
View file @
961ca0f0
package
com
.
brilliance
.
swift
.
mx2mt
.
mt941942
.
impl
;
package
com
.
brilliance
.
swift
.
mx2mt
.
mt941942
.
impl
;
import
com.brilliance.swift.constants.ERROR
;
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.NumberUtil
;
import
com.brilliance.swift.util.NumberUtil
;
...
@@ -21,20 +22,26 @@ public class Field90DGenerate extends AbstractMx2MtTagsGenerate {
...
@@ -21,20 +22,26 @@ public class Field90DGenerate extends AbstractMx2MtTagsGenerate {
public
void
tagGenerate
()
throws
SwiftException
{
public
void
tagGenerate
()
throws
SwiftException
{
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
String
sum
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.TxsSummry.TtlDbtNtries.Sum"
);
String
sumc
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.TxsSummry.TtlCdtNtries.Sum"
);
String
sumd
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.TxsSummry.TtlDbtNtries.Sum"
);
String
nbOfNtries
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.TxsSummry.TtlDbtNtries.NbOfNtries"
);
String
nbOfNtries
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.TxsSummry.TtlDbtNtries.NbOfNtries"
);
if
(
StringUtil
.
isNotEmpty
(
sum
)&&
StringUtil
.
isNotEmpty
(
nbOfNtries
))
{
int
entryCount
=
getXmlNodeCounts
(
bodyHdrParentElementName
,
document
,
"Rpt.Ntry"
);
if
(
entryCount
<
0
||
StringUtil
.
isEmpty
(
sumc
)&&
StringUtil
.
isEmpty
(
sumd
)){
buildSTErrorInfo
(
ERROR
.
T20114
,
"BLOCK4/:90D:"
,
bodyHdrParentElementName
+
"Rpt.TxsSummry.TtlDbtNtries.Sum"
);
return
;
}
if
(
StringUtil
.
isNotEmpty
(
sumd
)&&
StringUtil
.
isNotEmpty
(
nbOfNtries
))
{
String
currency
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.Acct.Ccy"
);
String
currency
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Rpt.Acct.Ccy"
);
String
amt
=
NumberUtil
.
formatAmt
(
new
BigDecimal
(
sum
),
currency
);
String
amt
=
NumberUtil
.
formatAmt
(
new
BigDecimal
(
sum
d
),
currency
);
if
(
amt
.
length
()>
15
){
if
(
amt
.
length
()>
15
){
//TODO,填入location:mt942/block3/:90D:,errorcode:T20120
buildSTErrorInfo
(
ERROR
.
T20120
,
"BLOCK4/:90D:"
,
amt
);
}
else
if
(
nbOfNtries
.
length
()>
5
){
}
else
if
(
nbOfNtries
.
length
()>
5
){
//TODO,填入location:mt942/block3/:90D:,errorcode:T20119
buildSTErrorInfo
(
ERROR
.
T20119
,
"BLOCK4/:90D:"
,
nbOfNtries
);
}
else
{
}
else
{
tags
.
add
(
new
Tag
(
name
,
nbOfNtries
+
currency
+
amt
));
tags
.
add
(
new
Tag
(
name
,
nbOfNtries
+
currency
+
amt
));
}
}
}
else
{
}
else
{
//TODO,填入location:mt942/block3/:90D:,errorcode:T20121
buildSTErrorInfo
(
ERROR
.
T20121
,
"BLOCK4/:90D:"
,
""
);
}
}
}
}
}
}
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