Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-csf
Commits
bff9005e
Commit
bff9005e
authored
Jan 05, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
前端对接问题修复57
parent
c64fda5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
0 deletions
+68
-0
yd-csf-service/src/main/java/com/yd/csf/service/enums/CurrencyEnum.java
+68
-0
No files found.
yd-csf-service/src/main/java/com/yd/csf/service/enums/CurrencyEnum.java
0 → 100644
View file @
bff9005e
package
com
.
yd
.
csf
.
service
.
enums
;
import
org.apache.commons.lang3.ObjectUtils
;
/**
* 货币枚举
* <p>
* 美元
* 人民幣
* 港幣
* 澳元
* 加元
* 欧元
* 英鎊
* 新加坡元
*/
public
enum
CurrencyEnum
{
// 货币枚举
USD
(
"美元"
,
"USD"
),
CNY
(
"人民幣"
,
"CNY"
),
HKD
(
"港幣"
,
"HKD"
),
AUD
(
"澳元"
,
"AUD"
),
JPY
(
"日元"
,
"JPY"
),
CAD
(
"加元"
,
"CAD"
),
EUR
(
"欧元"
,
"EUR"
),
GBP
(
"英镑"
,
"GBP"
),
SGD
(
"新加坡元"
,
"SGD"
);
//字典项标签(名称)
private
String
itemLabel
;
//字典项值
private
String
itemValue
;
//构造函数
CurrencyEnum
(
String
itemLabel
,
String
itemValue
)
{
this
.
itemLabel
=
itemLabel
;
this
.
itemValue
=
itemValue
;
}
/**
* 根据 币种(去掉最后一个字) 获取枚举值
*
* @param itemLabel
* @return
*/
public
static
String
getEnumByItemLabel
(
String
itemLabel
)
{
if
(
ObjectUtils
.
isEmpty
(
itemLabel
))
{
return
null
;
}
// 币种名称去掉最后一个字
itemLabel
=
itemLabel
.
substring
(
0
,
itemLabel
.
length
()
-
1
);
for
(
CurrencyEnum
anEnum
:
CurrencyEnum
.
values
())
{
if
(
anEnum
.
itemLabel
.
startsWith
(
itemLabel
))
{
return
anEnum
.
getItemValue
();
}
}
return
null
;
}
public
String
getItemLabel
()
{
return
itemLabel
;
}
public
String
getItemValue
()
{
return
itemValue
;
}
}
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