Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjjs-bd-common
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
s_guodong
gjjs-bd-common
Commits
b15e4155
Commit
b15e4155
authored
Aug 09, 2023
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取 codeTable和codeTableLable
parent
152843b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
25 deletions
+39
-25
Codetables.java
.../java/com/brilliance/mda/runtime/mda/util/Codetables.java
+30
-21
MdaUtils.java
...in/java/com/brilliance/mda/runtime/mda/util/MdaUtils.java
+9
-4
No files found.
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/util/Codetables.java
View file @
b15e4155
...
...
@@ -32,8 +32,19 @@ public class Codetables {
static
String
codeTableFilePath
=
"codeTable"
;
static
Map
<
String
,
List
<
CodetableItem
>>
staticCodeTableCache
=
new
ConcurrentHashMap
<>();
public
static
List
<
CodetableItem
>
getCodetable
(
String
codeName
)
{
return
null
;
public
static
String
getCodetableLabel
(
String
key
,
String
codetable
,
String
language
)
{
String
label
=
""
;
List
<
CodetableItem
>
codeTable
=
getCodeTable
(
codetable
,
language
);
if
(!
CollectionUtils
.
isEmpty
(
codeTable
))
{
for
(
CodetableItem
codetableItem
:
codeTable
)
{
if
(
key
.
equalsIgnoreCase
(
codetableItem
.
getValue
()))
{
label
=
codetableItem
.
getLabel
();
break
;
}
}
}
return
label
;
}
public
static
String
getCodetableLabelOfTd
(
String
key
,
String
codetable
,
String
language
)
{
...
...
@@ -90,32 +101,30 @@ public class Codetables {
}
return
keylst
;
}
// public static IStream getTblKeyList(String table, String language) {
// return getTblKeyList(table, language);
// }
public
static
List
<
CodetableItem
>
getCodeTable
(
String
codeName
,
String
lang
)
{
List
codetable
=
new
ArrayList
<>();
if
(
codeName
.
indexOf
(
":"
)
>
0
)
{
String
arr
[]
=
codeName
.
split
(
":"
);
Map
<
String
,
Object
>
fieldInfo
=
ModuleInfoManager
.
getModuleFieldInfo
(
arr
[
0
].
trim
().
toLowerCase
(),
arr
[
1
].
trim
().
toLowerCase
());
if
(
fieldInfo
==
null
)
return
codetable
;
codeName
=
(
String
)
fieldInfo
.
get
(
"codetable"
);
if
(
MdaUtils
.
isEmpty
(
codeName
))
return
codetable
;
}
else
{
//尝试从组件中加载
CodetableService
codetableService
=
MdaEnv
.
getBean
(
CodetableService
.
class
);
List
<
CodetableItem
>
dbCodeTable
=
codetableService
.
selectList
(
codeName
.
toUpperCase
(),
lang
);
if
(
dbCodeTable
!=
null
&&
!
dbCodeTable
.
isEmpty
())
return
dbCodeTable
;
}
//
if (codeName.indexOf(":") > 0) {
//
String arr[] = codeName.split(":");
//
Map<String, Object> fieldInfo = ModuleInfoManager.getModuleFieldInfo(arr[0].trim().toLowerCase(), arr[1].trim().toLowerCase());
//
if (fieldInfo == null)
//
return codetable;
//
codeName = (String) fieldInfo.get("codetable");
//
if (MdaUtils.isEmpty(codeName))
//
return codetable;
//
} else {
//
//尝试从组件中加载
//
CodetableService codetableService = MdaEnv.getBean(CodetableService.class);
//
List<CodetableItem> dbCodeTable = codetableService.selectList(codeName.toUpperCase(), lang);
//
if (dbCodeTable != null && !dbCodeTable.isEmpty())
//
return dbCodeTable;
//
}
String
fileName
=
codeTableFilePath
+
"/"
;
if
(
"
CN
"
.
equals
(
lang
))
{
if
(
"
zh
"
.
equals
(
lang
))
{
fileName
=
fileName
+
codeName
.
toLowerCase
()
+
"_zh_CN.ctl"
;
}
else
{
fileName
=
fileName
+
codeName
.
toLowerCase
()
+
"_en_US.ctl"
;
...
...
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/util/MdaUtils.java
View file @
b15e4155
...
...
@@ -908,7 +908,9 @@ public class MdaUtils {
}
public
static
List
<
CodetableItem
>
getCodetable
(
String
codeName
)
{
return
null
;
IContext
ctx
=
MdaEnv
.
getContext
();
Locale
locale
=
ctx
.
getLocale
();
return
Codetables
.
getCodeTable
(
codeName
,
locale
.
getLanguage
());
}
public
static
String
encryptPassword
(
String
srcPassword
)
{
...
...
@@ -925,8 +927,10 @@ public class MdaUtils {
}
}
public
static
String
getCodetableLabel
(
String
codetable
,
String
toString
)
{
return
null
;
public
static
String
getCodetableLabel
(
String
codetable
,
String
key
)
{
IContext
ctx
=
MdaEnv
.
getContext
();
Locale
locale
=
ctx
.
getLocale
();
return
Codetables
.
getCodetableLabel
(
key
,
codetable
,
locale
.
getLanguage
());
}
public
static
String
getPath
(
IBaseObject
baseObject
)
{
...
...
@@ -1608,7 +1612,8 @@ public class MdaUtils {
}
public
static
void
setEmptyImpl
(
Object
...
obj
){}
public
static
void
setEmptyImpl
(
Object
...
obj
)
{
}
}
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