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
dfd948cf
Commit
dfd948cf
authored
Jun 22, 2022
by
zhanghou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了n92,n96的getMtType方法
parent
3c5e89ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
75 deletions
+41
-75
Mx2Mtn92Creator.java
.../com/brilliance/swift/mx2mt/mt192292/Mx2Mtn92Creator.java
+14
-25
Mx2Mtn96Creator.java
.../com/brilliance/swift/mx2mt/mt196296/Mx2Mtn96Creator.java
+14
-49
Test.java
...ore/src/test/java/com/brilliance/mx2mtmap/mt202/Test.java
+13
-1
No files found.
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt192292/Mx2Mtn92Creator.java
View file @
dfd948cf
...
@@ -55,36 +55,25 @@ public class Mx2Mtn92Creator extends AbstractMx2MtCreator {
...
@@ -55,36 +55,25 @@ public class Mx2Mtn92Creator extends AbstractMx2MtCreator {
fieldsGenerateList
.
add
(
new
Field79Generate
());
fieldsGenerateList
.
add
(
new
Field79Generate
());
return
fieldsGenerateList
;
return
fieldsGenerateList
;
}
}
@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
);
String
bodyParentPath
=
(
String
)
context
.
get
(
Mx2MtContextIdentifier
.
BODY_PARENT_ELEMENT_NAME
,
true
);
String
bodyParentPath
=
(
String
)
context
.
get
(
Mx2MtContextIdentifier
.
BODY_PARENT_ELEMENT_NAME
,
true
);
String
mtType
=
getXmlNodeValue
(
bodyParentPath
,
document
,
"Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId"
);
String
orgMsgNameIdentification
=
getXmlNodeValue
(
bodyParentPath
,
document
,
"Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId"
);
String
msgType
=
""
;
String
mtType
=
Mx2MtConstants
.
MT_TYPE_292
;
if
(
StringUtil
.
isNotEmpty
(
mtType
)){
if
(
StringUtil
.
isNotEmpty
(
orgMsgNameIdentification
))
{
if
(
mtType
.
startsWith
(
"pacs.008"
)){
if
(
orgMsgNameIdentification
.
startsWith
(
"pacs.008"
)
msgType
=
"103"
;
||
orgMsgNameIdentification
.
startsWith
(
"pacs.003"
))
{
}
else
if
(
mtType
.
startsWith
(
"pacs.003"
)){
mtType
=
Mx2MtConstants
.
MT_TYPE_192
;
msgType
=
"104"
;
}
else
if
(
orgMsgNameIdentification
.
startsWith
(
"pacs.009"
)
}
else
if
(
mtType
.
startsWith
(
"pacs.009"
)){
||
orgMsgNameIdentification
.
startsWith
(
"pacs.010"
))
{
msgType
=
"202"
;
mtType
=
Mx2MtConstants
.
MT_TYPE_292
;
}
else
if
(
mtType
.
startsWith
(
"pacs.010"
)){
}
else
if
(
orgMsgNameIdentification
.
matches
(
"MT10[0-9]{1}"
))
{
msgType
=
"204"
;
mtType
=
Mx2MtConstants
.
MT_TYPE_192
;
}
else
if
(
mtType
.
matches
(
"/MT10[0-9]{1}/"
)){
}
else
if
(
orgMsgNameIdentification
.
matches
(
"MT20[0-9]{1}"
))
{
msgType
=
mtType
.
substring
(
2
);
mtType
=
Mx2MtConstants
.
MT_TYPE_292
;
}
else
if
(
mtType
.
matches
(
"/MT20[0-9]{1}/"
)){
msgType
=
mtType
.
substring
(
2
);
}
else
{
msgType
=
"202"
;
}
}
}
}
if
(
msgType
.
startsWith
(
"1"
))
{
return
mtType
;
return
Mx2MtConstants
.
MT_TYPE_192
;
}
else
if
(
msgType
.
startsWith
(
"2"
)){
return
Mx2MtConstants
.
MT_TYPE_292
;
}
else
{
return
"类型错误"
;
}
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt196296/Mx2Mtn96Creator.java
View file @
dfd948cf
...
@@ -56,60 +56,25 @@ public class Mx2Mtn96Creator extends AbstractMx2MtCreator {
...
@@ -56,60 +56,25 @@ public class Mx2Mtn96Creator extends AbstractMx2MtCreator {
return
fieldsGenerateList
;
return
fieldsGenerateList
;
}
}
public
String
getMtMsg
()
{
Document
document
=
(
Document
)
context
.
get
(
Mx2MtContextIdentifier
.
MX_XMl_DOCUMENT
,
true
);
String
bodyParentPath
=
(
String
)
context
.
get
(
Mx2MtContextIdentifier
.
BODY_PARENT_ELEMENT_NAME
,
true
);
String
mtType
=
getXmlNodeValue
(
bodyParentPath
,
document
,
"RsltnOfInvstgtn.CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId"
);
if
(
StringUtil
.
isNotEmpty
(
mtType
)){
if
(
"pacs.008"
.
equals
(
mtType
)){
return
"103"
;
}
else
if
(
"pacs.003"
.
equals
(
mtType
)){
return
"104"
;
}
else
if
(
"pacs.009"
.
equals
(
mtType
)){
return
"202"
;
}
else
if
(
"pacs.010"
.
equals
(
mtType
)){
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
"没有找到指定的类型"
;
}
}
@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
);
String
bodyParentPath
=
(
String
)
context
.
get
(
Mx2MtContextIdentifier
.
BODY_PARENT_ELEMENT_NAME
,
true
);
String
bodyParentPath
=
(
String
)
context
.
get
(
Mx2MtContextIdentifier
.
BODY_PARENT_ELEMENT_NAME
,
true
);
String
mtType
=
getXmlNodeValue
(
bodyParentPath
,
document
,
"CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId"
);
String
orgMsgNameIdentification
=
getXmlNodeValue
(
bodyParentPath
,
document
,
"CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId"
);
String
msgType
=
""
;
String
mtType
=
Mx2MtConstants
.
MT_TYPE_296
;
if
(
StringUtil
.
isNotEmpty
(
mtType
)){
if
(
StringUtil
.
isNotEmpty
(
orgMsgNameIdentification
))
{
if
(
mtType
.
startsWith
(
"pacs.008"
)){
if
(
orgMsgNameIdentification
.
startsWith
(
"pacs.008"
)
msgType
=
"103"
;
||
orgMsgNameIdentification
.
startsWith
(
"pacs.003"
))
{
}
else
if
(
mtType
.
startsWith
(
"pacs.003"
)){
mtType
=
Mx2MtConstants
.
MT_TYPE_196
;
msgType
=
"104"
;
}
else
if
(
orgMsgNameIdentification
.
startsWith
(
"pacs.009"
)
}
else
if
(
mtType
.
startsWith
(
"pacs.009"
)){
||
orgMsgNameIdentification
.
startsWith
(
"pacs.010"
))
{
msgType
=
"202"
;
mtType
=
Mx2MtConstants
.
MT_TYPE_296
;
}
else
if
(
mtType
.
startsWith
(
"pacs.010"
)){
}
else
if
(
orgMsgNameIdentification
.
matches
(
"MT10[0-9]{1}"
))
{
msgType
=
"204"
;
mtType
=
Mx2MtConstants
.
MT_TYPE_196
;
}
else
if
(
mtType
.
matches
(
"/MT10[0-9]{1}/"
)){
}
else
if
(
orgMsgNameIdentification
.
matches
(
"MT20[0-9]{1}"
))
{
msgType
=
mtType
.
substring
(
2
);
mtType
=
Mx2MtConstants
.
MT_TYPE_296
;
}
else
if
(
mtType
.
matches
(
"/MT20[0-9]{1}/"
)){
msgType
=
mtType
.
substring
(
2
);
}
else
{
msgType
=
"202"
;
}
}
}
}
if
(
msgType
.
startsWith
(
"1"
))
{
return
mtType
;
return
Mx2MtConstants
.
MT_TYPE_196
;
}
else
if
(
msgType
.
startsWith
(
"2"
)){
return
Mx2MtConstants
.
MT_TYPE_296
;
}
else
{
return
"类型错误"
;
}
}
}
}
}
swiftCore/src/test/java/com/brilliance/mx2mtmap/mt202/Test.java
View file @
dfd948cf
...
@@ -47,6 +47,16 @@ public class Test {
...
@@ -47,6 +47,16 @@ public class Test {
String
maps
=
SwiftTransfer
.
mx2Gson
(
xmlStr
);
String
maps
=
SwiftTransfer
.
mx2Gson
(
xmlStr
);
System
.
out
.
println
(
maps
);
System
.
out
.
println
(
maps
);
}
}
private
static
void
test942
()
throws
IOException
{
String
xmlStr
=
FileUtils
.
readFileToString
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MXcamt05200108_942.xml"
));
String
maps
=
SwiftTransfer
.
mx2Gson
(
xmlStr
);
System
.
out
.
println
(
maps
);
}
private
static
void
test210
()
throws
IOException
{
String
xmlStr
=
FileUtils
.
readFileToString
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05700106.xml"
));
String
maps
=
SwiftTransfer
.
mx2Gson
(
xmlStr
);
System
.
out
.
println
(
maps
);
}
public
static
void
main
(
String
[]
args
)
throws
IOException
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
//test202();
//test202();
...
@@ -54,7 +64,9 @@ public class Test {
...
@@ -54,7 +64,9 @@ public class Test {
//test196();
//test196();
//test910();
//test910();
//test940();
//test940();
test192
();
//test192();
//test942();
test210
();
}
}
}
}
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