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
8f9dedf7
Commit
8f9dedf7
authored
Jun 29, 2022
by
chengzhuoshen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
封装报文转换详细报告方法
parent
9abf0089
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
5 deletions
+40
-5
AbstractMx2MtCreator.java
...java/com/brilliance/swift/mx2mt/AbstractMx2MtCreator.java
+19
-0
AbstractMx2MtTagsGenerate.java
...com/brilliance/swift/mx2mt/AbstractMx2MtTagsGenerate.java
+20
-0
Field20Generate.java
...om/brilliance/swift/mx2mt/mt103/impl/Field20Generate.java
+1
-5
No files found.
swiftCore/src/main/java/com/brilliance/swift/mx2mt/AbstractMx2MtCreator.java
View file @
8f9dedf7
...
...
@@ -4,7 +4,9 @@ import com.brilliance.swift.constants.Mx2MtConstants;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.util.SwiftTransferUtil
;
import
com.brilliance.swift.util.XmlUtil
;
import
com.brilliance.swift.vo.SwiftTranslationErrorInfo
;
import
com.brilliance.swift.vo.SwiftTranslationReport
;
import
com.brilliance.swift.vo.common.MessagePriority
;
import
com.prowidesoftware.swift.io.ConversionService
;
...
...
@@ -34,6 +36,23 @@ public abstract class AbstractMx2MtCreator implements Mx2MtCreator {
this
.
context
=
context
;
}
/**
* 封装报文转换详细报告
* @param errorCode
* @param location
* @param originalValue
* @return
*/
protected
void
buildSTErrorInfo
(
String
errorCode
,
String
location
,
String
originalValue
)
{
SwiftTranslationReport
str
=
context
.
get
(
SwiftTranslationReport
.
class
);
SwiftTranslationErrorInfo
errorInfo
=
SwiftTransferUtil
.
getSwiftTranslationErrorInfoByErrorCode
(
errorCode
);
errorInfo
.
setLocation
(
location
);
errorInfo
.
setOriginalValue
(
originalValue
);
str
.
addErrorInfo
(
errorInfo
);
if
(
"FAILURE"
.
equalsIgnoreCase
(
errorInfo
.
getErrorType
()))
{
throw
new
SwiftException
(
location
+
Mx2MtConstants
.
NEW_LINE
+
"-"
+
errorInfo
.
getErrorType
()
+
":"
+
errorInfo
.
getDescription
());
}
}
protected
String
getRandomNumber
(
int
length
)
{
/*String randomNumber = "";
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/AbstractMx2MtTagsGenerate.java
View file @
8f9dedf7
...
...
@@ -4,6 +4,8 @@ import com.brilliance.swift.constants.Mx2MtConstants;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.util.*
;
import
com.brilliance.swift.vo.MxMtReasonCodeInfo
;
import
com.brilliance.swift.vo.SwiftTranslationErrorInfo
;
import
com.brilliance.swift.vo.SwiftTranslationReport
;
import
com.brilliance.swift.vo.common.*
;
import
org.dom4j.Document
;
...
...
@@ -54,6 +56,24 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
return
XmlUtil
.
getChildrenCount
(
document
,
path
,
null
);
}
/**
* 封装报文转换详细报告
* @param errorCode
* @param location
* @param originalValue
* @return
*/
protected
void
buildSTErrorInfo
(
String
errorCode
,
String
location
,
String
originalValue
)
{
SwiftTranslationReport
str
=
context
.
get
(
SwiftTranslationReport
.
class
);
SwiftTranslationErrorInfo
errorInfo
=
SwiftTransferUtil
.
getSwiftTranslationErrorInfoByErrorCode
(
errorCode
);
errorInfo
.
setLocation
(
location
);
errorInfo
.
setOriginalValue
(
originalValue
);
str
.
addErrorInfo
(
errorInfo
);
if
(
"FAILURE"
.
equalsIgnoreCase
(
errorInfo
.
getErrorType
()))
{
throw
new
SwiftException
(
location
+
Mx2MtConstants
.
NEW_LINE
+
"-"
+
errorInfo
.
getErrorType
()
+
":"
+
errorInfo
.
getDescription
());
}
}
//转换函数方法区开始
/**
* MX InstructionForCreditorAgent转23域
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt103/impl/Field20Generate.java
View file @
8f9dedf7
...
...
@@ -34,11 +34,7 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
}
if
(
StringUtil
.
isNotEmpty
(
messageId
))
{
if
(
messageId
.
length
()
>
16
)
{
SwiftTranslationReport
str
=
context
.
get
(
SwiftTranslationReport
.
class
);
SwiftTranslationErrorInfo
errorInfo
=
SwiftTransferUtil
.
getSwiftTranslationErrorInfoByErrorCode
(
ERROR
.
T0000T
);
errorInfo
.
setLocation
(
"MT103/BLOCK4/:20:"
);
errorInfo
.
setOriginalValue
(
messageId
);
str
.
addErrorInfo
(
errorInfo
);
buildSTErrorInfo
(
ERROR
.
T0000T
,
"MT103/BLOCK4/:20:"
,
messageId
);
messageId
=
messageId
.
substring
(
0
,
15
)
+
"+"
;
}
tags
.
add
(
new
Tag
(
name
,
messageId
));
...
...
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