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
ce33ee2c
Commit
ce33ee2c
authored
Aug 28, 2023
by
gechengyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复mt转mx时MxType、MtType以及转换结果为空的缺陷
parent
a773e328
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
AbstractMt2MxCreator.java
...java/com/brilliance/swift/mt2mx/AbstractMt2MxCreator.java
+22
-0
Mt2MxCreatorManager.java
.../java/com/brilliance/swift/mt2mx/Mt2MxCreatorManager.java
+3
-0
No files found.
swiftCore/src/main/java/com/brilliance/swift/mt2mx/AbstractMt2MxCreator.java
View file @
ce33ee2c
...
@@ -9,6 +9,8 @@ import com.brilliance.swift.util.SwiftTransferUtil;
...
@@ -9,6 +9,8 @@ import com.brilliance.swift.util.SwiftTransferUtil;
import
com.brilliance.swift.vo.SwiftTranslationErrorInfo
;
import
com.brilliance.swift.vo.SwiftTranslationErrorInfo
;
import
com.brilliance.swift.vo.SwiftTranslationReport
;
import
com.brilliance.swift.vo.SwiftTranslationReport
;
import
com.brilliance.swift.vo.common.MessagePriority
;
import
com.brilliance.swift.vo.common.MessagePriority
;
import
com.brilliance.swift.vo.common.TranslationResultCode
;
import
com.prowidesoftware.swift.model.MxId
;
import
com.prowidesoftware.swift.model.SwiftBlock5
;
import
com.prowidesoftware.swift.model.SwiftBlock5
;
import
com.prowidesoftware.swift.model.SwiftBlock5Field
;
import
com.prowidesoftware.swift.model.SwiftBlock5Field
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
...
@@ -88,6 +90,19 @@ public abstract class AbstractMt2MxCreator implements Mt2MxCreator{
...
@@ -88,6 +90,19 @@ public abstract class AbstractMt2MxCreator implements Mt2MxCreator{
}
}
}
}
public
void
setMxType
(
AbstractMX
abstractMX
,
SwiftTranslationReport
str
){
if
(
abstractMX
==
null
){
return
;
}
MxId
mxId
=
abstractMX
.
getMxId
();
if
(
mxId
!=
null
)
{
str
.
setMxType
(
mxId
.
getBusinessProcess
().
name
()
+
mxId
.
getFunctionality
()
+
mxId
.
getVariant
()
+
mxId
.
getVersion
());
}
}
@Override
@Override
public
void
postProcess
()
{
public
void
postProcess
()
{
String
swiftGsonStr
=
new
JSONObject
(
jsonMaps
).
toJSONString
();
String
swiftGsonStr
=
new
JSONObject
(
jsonMaps
).
toJSONString
();
...
@@ -95,6 +110,11 @@ public abstract class AbstractMt2MxCreator implements Mt2MxCreator{
...
@@ -95,6 +110,11 @@ public abstract class AbstractMt2MxCreator implements Mt2MxCreator{
String
xml
=
abstractMX
.
message
();
String
xml
=
abstractMX
.
message
();
SwiftTranslationReport
str
=
context
.
get
(
SwiftTranslationReport
.
class
);
SwiftTranslationReport
str
=
context
.
get
(
SwiftTranslationReport
.
class
);
str
.
setMessage
(
xml
);
str
.
setMessage
(
xml
);
//设置报文MX类型 modified by gechengyang 20230828
str
.
setTranslationResult
(
TranslationResultCode
.
TROK
.
value
());
MxId
mxId
=
abstractMX
.
getMxId
();
setMxType
(
abstractMX
,
str
);
// str.setMxType(((BusinessAppHdrV02) abstractMX.getAppHdr()).getMsgDefIdr());
try
{
try
{
String
outputFilePath
=
(
String
)
context
.
get
(
Mt2MxContextIdentifier
.
MT_TO_MX_OUTPUT_FILE_PATH
,
true
);
String
outputFilePath
=
(
String
)
context
.
get
(
Mt2MxContextIdentifier
.
MT_TO_MX_OUTPUT_FILE_PATH
,
true
);
if
(
StringUtil
.
isNotEmpty
(
outputFilePath
))
{
if
(
StringUtil
.
isNotEmpty
(
outputFilePath
))
{
...
@@ -107,6 +127,8 @@ public abstract class AbstractMt2MxCreator implements Mt2MxCreator{
...
@@ -107,6 +127,8 @@ public abstract class AbstractMt2MxCreator implements Mt2MxCreator{
stream
.
close
();
stream
.
close
();
}
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
str
.
setTranslationResult
(
TranslationResultCode
.
TRNK
.
value
());
str
.
setMessage
(
e
.
getMessage
());
throw
new
SwiftException
(
e
.
getMessage
());
throw
new
SwiftException
(
e
.
getMessage
());
}
}
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2mx/Mt2MxCreatorManager.java
View file @
ce33ee2c
...
@@ -50,6 +50,9 @@ public class Mt2MxCreatorManager {
...
@@ -50,6 +50,9 @@ public class Mt2MxCreatorManager {
}
}
creator
.
postProcess
();
creator
.
postProcess
();
SwiftTranslationReport
str
=
context
.
get
(
SwiftTranslationReport
.
class
);
SwiftTranslationReport
str
=
context
.
get
(
SwiftTranslationReport
.
class
);
if
(
abstractMT
!=
null
){
str
.
setMtType
(
abstractMT
.
getMessageType
());
}
return
str
;
return
str
;
}
}
...
...
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