Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-api-boot-master
Commits
f4f5c988
Commit
f4f5c988
authored
Mar 22, 2025
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充新汇率业务的货币符号代码冗余值
parent
aaee2a12
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
6 deletions
+28
-6
20250222-currency-rate.sql
sql/v2.2财务/20250222-currency-rate.sql
+10
-2
CurrencyRateDO.java
...odule/ecw/dal/dataobject/currencyRate/CurrencyRateDO.java
+5
-0
CurrencyRateServiceImpl.java
...ule/ecw/service/currencyRate/CurrencyRateServiceImpl.java
+7
-4
CurrencyRateCreateReqVO.java
...o/module/ecw/vo/currencyRate/CurrencyRateCreateReqVO.java
+6
-0
No files found.
sql/v2.2财务/20250222-currency-rate.sql
View file @
f4f5c988
...
@@ -61,4 +61,12 @@ VALUES
...
@@ -61,4 +61,12 @@ VALUES
(
'货币汇率删除'
,
'ecw:currency:rate:delete'
,
3
,
3
,
@
parent
,
''
,
''
,
''
,
0
,
'115'
,
'2023-07-09 16:02:32'
,
'115'
,
'2023-07-12 22:33:09'
,
b
'0'
,
b
'0'
,
'delete'
,
b
'0'
,
NULL
),
(
'货币汇率删除'
,
'ecw:currency:rate:delete'
,
3
,
3
,
@
parent
,
''
,
''
,
''
,
0
,
'115'
,
'2023-07-09 16:02:32'
,
'115'
,
'2023-07-12 22:33:09'
,
b
'0'
,
b
'0'
,
'delete'
,
b
'0'
,
NULL
),
(
'货币汇率日志'
,
'ecw:currency:rate:history'
,
3
,
4
,
@
parent
,
''
,
''
,
''
,
0
,
'115'
,
'2023-07-09 16:02:32'
,
'115'
,
'2023-07-12 22:33:09'
,
b
'0'
,
b
'0'
,
'history'
,
b
'0'
,
NULL
);
(
'货币汇率日志'
,
'ecw:currency:rate:history'
,
3
,
4
,
@
parent
,
''
,
''
,
''
,
0
,
'115'
,
'2023-07-09 16:02:32'
,
'115'
,
'2023-07-12 22:33:09'
,
b
'0'
,
b
'0'
,
'history'
,
b
'0'
,
NULL
);
COMMIT
;
COMMIT
;
\ No newline at end of file
ALTER
TABLE
`ecw_currency_rate`
ADD
COLUMN
`source_currency_code`
varchar
(
255
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NOT
NULL
COMMENT
'原币种代码'
AFTER
`source_id`
;
ALTER
TABLE
`ecw_currency_rate`
ADD
COLUMN
`target_currency_code`
varchar
(
255
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NOT
NULL
COMMENT
'目标种代码'
AFTER
`target_id`
;
update
`ecw_currency_rate`
r
left
join
`ecw_currency`
c1
on
r
.
source_id
=
c1
.
id
left
join
`ecw_currency`
c2
on
r
.
target_id
=
c2
.
id
set
r
.
`source_currency_code`
=
c1
.
fuhao
,
r
.
`target_currency_code`
=
c2
.
fuhao
\ No newline at end of file
yudao-module-ecw/yudao-module-ecw-impl/src/main/java/cn/iocoder/yudao/module/ecw/dal/dataobject/currencyRate/CurrencyRateDO.java
View file @
f4f5c988
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -41,11 +42,15 @@ public class CurrencyRateDO extends BaseDO {
...
@@ -41,11 +42,15 @@ public class CurrencyRateDO extends BaseDO {
*/
*/
private
Long
sourceId
;
private
Long
sourceId
;
@ApiModelProperty
(
value
=
"原币种代码"
,
required
=
true
)
private
String
sourceCurrencyCode
;
/**
/**
* 支付币种
* 支付币种
*/
*/
private
Long
targetId
;
private
Long
targetId
;
@ApiModelProperty
(
value
=
"目标种代码"
,
required
=
true
)
private
String
targetCurrencyCode
;
/**
/**
* 原币种金额
* 原币种金额
*/
*/
...
...
yudao-module-ecw/yudao-module-ecw-impl/src/main/java/cn/iocoder/yudao/module/ecw/service/currencyRate/CurrencyRateServiceImpl.java
View file @
f4f5c988
...
@@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
...
@@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import
cn.iocoder.yudao.framework.security.core.LoginUser
;
import
cn.iocoder.yudao.framework.security.core.LoginUser
;
import
cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.yudao.module.ecw.convert.currencyRate.CurrencyRateConvert
;
import
cn.iocoder.yudao.module.ecw.convert.currencyRate.CurrencyRateConvert
;
import
cn.iocoder.yudao.module.ecw.dal.dataobject.currency.CurrencyDO
;
import
cn.iocoder.yudao.module.ecw.dal.dataobject.currencyRate.CurrencyRateDO
;
import
cn.iocoder.yudao.module.ecw.dal.dataobject.currencyRate.CurrencyRateDO
;
import
cn.iocoder.yudao.module.ecw.dal.dataobject.currencyRate.CurrencyRateLogDO
;
import
cn.iocoder.yudao.module.ecw.dal.dataobject.currencyRate.CurrencyRateLogDO
;
import
cn.iocoder.yudao.module.ecw.dal.mysql.currencyRate.CurrencyRateLogMapper
;
import
cn.iocoder.yudao.module.ecw.dal.mysql.currencyRate.CurrencyRateLogMapper
;
...
@@ -44,9 +45,11 @@ public class CurrencyRateServiceImpl implements CurrencyRateService {
...
@@ -44,9 +45,11 @@ public class CurrencyRateServiceImpl implements CurrencyRateService {
private
CurrencyRateLogMapper
logMapper
;
private
CurrencyRateLogMapper
logMapper
;
// 检查指定币种是否存在
// 检查指定币种是否存在
private
void
currency
(
long
id
)
{
private
String
currency
(
long
id
)
{
Optional
.
ofNullable
(
currencyService
.
getCurrency
((
int
)
id
))
CurrencyDO
currencyDO
=
currencyService
.
getCurrency
((
int
)
id
);
Optional
.
ofNullable
(
currencyDO
)
.
orElseThrow
(()
->
exception
(
CURRENCY_NOT_EXISTS
));
.
orElseThrow
(()
->
exception
(
CURRENCY_NOT_EXISTS
));
return
currencyDO
.
getFuhao
();
}
}
@Override
@Override
...
@@ -61,8 +64,8 @@ public class CurrencyRateServiceImpl implements CurrencyRateService {
...
@@ -61,8 +64,8 @@ public class CurrencyRateServiceImpl implements CurrencyRateService {
rate
(
req
.
getSourceAmount
(),
req
.
getTargetAmount
());
// check rate
rate
(
req
.
getSourceAmount
(),
req
.
getTargetAmount
());
// check rate
// check if currencies exist
// check if currencies exist
currency
(
sourceId
);
req
.
setSourceCurrencyCode
(
currency
(
sourceId
)
);
currency
(
targetId
);
req
.
setTargetCurrencyCode
(
currency
(
targetId
)
);
if
(
find
(
sourceId
,
targetId
)
!=
null
)
{
if
(
find
(
sourceId
,
targetId
)
!=
null
)
{
throw
exception
(
CURRENCY_RATE_EXISTS
);
throw
exception
(
CURRENCY_RATE_EXISTS
);
...
...
yudao-module-ecw/yudao-module-ecw-impl/src/main/java/cn/iocoder/yudao/module/ecw/vo/currencyRate/CurrencyRateCreateReqVO.java
View file @
f4f5c988
...
@@ -20,10 +20,16 @@ public class CurrencyRateCreateReqVO {
...
@@ -20,10 +20,16 @@ public class CurrencyRateCreateReqVO {
@NotNull
(
message
=
"原币种不能为空"
)
@NotNull
(
message
=
"原币种不能为空"
)
private
Long
sourceId
;
private
Long
sourceId
;
@ApiModelProperty
(
value
=
"原币种代码"
,
required
=
true
)
private
String
sourceCurrencyCode
;
@ApiModelProperty
(
value
=
"支付币种"
,
required
=
true
)
@ApiModelProperty
(
value
=
"支付币种"
,
required
=
true
)
@NotNull
(
message
=
"支付币种不能为空"
)
@NotNull
(
message
=
"支付币种不能为空"
)
private
Long
targetId
;
private
Long
targetId
;
@ApiModelProperty
(
value
=
"目标种代码"
,
required
=
true
)
private
String
targetCurrencyCode
;
@ApiModelProperty
(
value
=
"原币种金额"
,
required
=
true
)
@ApiModelProperty
(
value
=
"原币种金额"
,
required
=
true
)
@NotNull
(
message
=
"原币种不能为空"
)
@NotNull
(
message
=
"原币种不能为空"
)
@Min
(
0
)
@Min
(
0
)
...
...
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