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
a9b1bffa
Commit
a9b1bffa
authored
Aug 22, 2024
by
gechengyang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/ncbgjzf' into ncbgjzf
parents
9365da64
1be338cb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
14 deletions
+34
-14
Element2MxForSSTF.java
...va/com/brilliance/swift/element2mx/Element2MxForSSTF.java
+18
-8
Mx2ElementForSSTF.java
...va/com/brilliance/swift/mx2element/Mx2ElementForSSTF.java
+14
-6
env.yml
swiftCore/src/main/resources/ini/env.yml
+2
-0
No files found.
swiftCore/src/main/java/com/brilliance/swift/element2mx/Element2MxForSSTF.java
View file @
a9b1bffa
...
...
@@ -65,7 +65,7 @@ public class Element2MxForSSTF {
TEMPLATE_DIR
=
System
.
getProperty
(
"java.io.tmpdir"
);
}
getEnvMap
();
readEnvCfg
();
}
...
...
@@ -187,8 +187,8 @@ public class Element2MxForSSTF {
Map
<
String
,
Object
>
elementMap
=
new
HashMap
<>();
//读取数组字段配置
Map
<
String
,
String
>
atrbutMap
=
getEnv
Maps
(
CHN
+
"/saa/body/"
+
messageType
.
substring
(
0
,
10
)+
"/atrbut"
);
Map
<
String
,
String
>
fldtypMap
=
getEnv
Maps
(
CHN
+
"/saa/body/"
+
messageType
.
substring
(
0
,
10
)+
"/fldtyp"
);
Map
<
String
,
String
>
atrbutMap
=
getEnv
(
CHN
+
"/saa/body/"
+
messageType
.
substring
(
0
,
10
)+
"/atrbut"
);
Map
<
String
,
String
>
fldtypMap
=
getEnv
(
CHN
+
"/saa/body/"
+
messageType
.
substring
(
0
,
10
)+
"/fldtyp"
);
logger
.
info
(
"atrbut(ini)---->"
);
atrbutMap
.
forEach
((
k
,
v
)->{
logger
.
info
(
" "
+
k
+
"-->"
+
v
.
toString
());
...
...
@@ -287,7 +287,7 @@ public class Element2MxForSSTF {
elementMap
.
put
(
"uetr"
,
uuid
);
}
Map
<
String
,
String
>
envIni
=
getEnv
Maps
(
CHN
+
"/saa/body"
);
Map
<
String
,
String
>
envIni
=
getEnv
(
CHN
+
"/saa/body"
);
if
(
StrUtil
.
isNotEmpty
(
envIni
.
getOrDefault
(
"frBic"
,
""
))){
elementMap
.
put
(
"frBic"
,
envIni
.
get
(
"frBic"
));
}
...
...
@@ -310,7 +310,7 @@ public class Element2MxForSSTF {
saaMap
.
put
(
"MessageIdentifier"
,
msgDefIdr
);
String
frBic
=
elementMap
.
getOrDefault
(
"frBic"
,
""
).
toString
();
Map
<
String
,
String
>
envIni
=
getEnv
Maps
(
CHN
+
"/saa/header"
);
Map
<
String
,
String
>
envIni
=
getEnv
(
CHN
+
"/saa/header"
);
if
(
StrUtil
.
isNotEmpty
(
envIni
.
getOrDefault
(
"frBic"
,
""
))){
frBic
=
envIni
.
get
(
"frBic"
);
}
...
...
@@ -344,7 +344,7 @@ public class Element2MxForSSTF {
*/
private
static
Map
<
String
,
String
>
getEnv
Maps
(
String
path
)
{
private
static
Map
<
String
,
String
>
getEnv
(
String
path
)
{
try
{
Map
<
String
,
Object
>
tmpMap
=
MapUtil
.
getsMap
(
ENV_MAP
,
path
);
Map
<
String
,
String
>
secMap
=
new
HashMap
<>();
...
...
@@ -353,10 +353,18 @@ public class Element2MxForSSTF {
}
catch
(
Exception
e
)
{
return
new
HashMap
<>();
}
}
private
static
String
getEnvs
(
String
path
)
{
try
{
String
tmpS
=
MapUtil
.
gets
(
ENV_MAP
,
path
);
return
tmpS
;
}
catch
(
Exception
e
)
{
return
""
;
}
}
private
static
void
getEnvMap
()
{
private
static
void
readEnvCfg
()
{
if
(
CHN
==
null
)
{
Yaml
yaml
=
new
Yaml
();
Map
<
String
,
Object
>
yamlMap
=
new
HashMap
<>();
...
...
@@ -384,7 +392,9 @@ public class Element2MxForSSTF {
String
uniqueNumber
=
UUID
.
randomUUID
().
toString
().
substring
(
0
,
8
);
// 取UUID的前8个字符
// 构建文件名
String
fileName
=
uniqueNumber
+
".xml"
;
String
fileExtension
=
getEnvs
(
CHN
+
"/saa/extension"
);
fileExtension
=
StringUtil
.
isNotEmpty
(
fileExtension
)?
fileExtension:
"xml"
;
String
fileName
=
uniqueNumber
+
"."
+
fileExtension
;
// 定义文件路径(这里使用相对路径,你可以根据需要更改为绝对路径)
String
filePath
=
TEMPLATE_DIR
+
File
.
separator
+
fileName
;
FileUtil
.
writeString
(
xmlStr
,
filePath
,
StandardCharsets
.
UTF_8
);
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2element/Mx2ElementForSSTF.java
View file @
a9b1bffa
...
...
@@ -55,7 +55,7 @@ public class Mx2ElementForSSTF {
TEMPLATE_DIR
=
System
.
getProperty
(
"java.io.tmpdir"
);
}
getEnvMap
();
readEnvCfg
();
}
public
static
Map
<
String
,
Object
>
mx2MtWithFile
(
String
xmlFileNm
)
{
...
...
@@ -152,9 +152,9 @@ public class Mx2ElementForSSTF {
String
line
=
""
;
//读取数组字段配置ini
Map
<
String
,
String
>
atrbutMap
=
getEnv
Maps
(
CHN
+
"/saa/body/"
+
messageType
.
substring
(
0
,
10
)+
"/atrbut"
);
Map
<
String
,
String
>
fldtypMap
=
getEnv
Maps
(
CHN
+
"/saa/body/"
+
messageType
.
substring
(
0
,
10
)+
"/fldtyp"
);
Map
<
String
,
String
>
xmltagMap
=
getEnv
Maps
(
CHN
+
"/saa/body/"
+
messageType
.
substring
(
0
,
10
)+
"/xmltag"
);
Map
<
String
,
String
>
atrbutMap
=
getEnv
(
CHN
+
"/saa/body/"
+
messageType
.
substring
(
0
,
10
)+
"/atrbut"
);
Map
<
String
,
String
>
fldtypMap
=
getEnv
(
CHN
+
"/saa/body/"
+
messageType
.
substring
(
0
,
10
)+
"/fldtyp"
);
Map
<
String
,
String
>
xmltagMap
=
getEnv
(
CHN
+
"/saa/body/"
+
messageType
.
substring
(
0
,
10
)+
"/xmltag"
);
String
key
=
""
;
Object
obj
=
null
;
...
...
@@ -237,7 +237,7 @@ public class Mx2ElementForSSTF {
}
private
static
Map
<
String
,
String
>
getEnv
Maps
(
String
path
)
{
private
static
Map
<
String
,
String
>
getEnv
(
String
path
)
{
try
{
Map
<
String
,
Object
>
tmpMap
=
MapUtil
.
getsMap
(
ENV_MAP
,
path
);
Map
<
String
,
String
>
secMap
=
new
HashMap
<>();
...
...
@@ -246,10 +246,18 @@ public class Mx2ElementForSSTF {
}
catch
(
Exception
e
)
{
return
new
HashMap
<>();
}
}
private
static
String
getEnvs
(
String
path
)
{
try
{
String
tmpS
=
MapUtil
.
gets
(
ENV_MAP
,
path
);
return
tmpS
;
}
catch
(
Exception
e
)
{
return
""
;
}
}
private
static
void
getEnvMap
()
{
private
static
void
readEnvCfg
()
{
if
(
CHN
==
null
)
{
Yaml
yaml
=
new
Yaml
();
Map
<
String
,
Object
>
yamlMap
=
new
HashMap
<>();
...
...
swiftCore/src/main/resources/ini/env.yml
View file @
a9b1bffa
...
...
@@ -184,3 +184,4 @@ sstf:
invcee
:
Invcee
undrlRmtInfStrdTaxRmt
:
TaxRmt
undrlRmtInfStrdGrnshmtRmt
:
GrnshmtRmt
extension
:
mx
\ No newline at end of file
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