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
a8b0fd68
Commit
a8b0fd68
authored
Mar 22, 2025
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提供全部可用货币汇率信息查询接口
parent
f4f5c988
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
2 deletions
+30
-2
20250222-currency-rate.sql
sql/v2.2财务/20250222-currency-rate.sql
+2
-2
CurrencyRateController.java
...controller/admin/currencyRate/CurrencyRateController.java
+9
-0
CurrencyRateMapper.java
...module/ecw/dal/mysql/currencyRate/CurrencyRateMapper.java
+9
-0
CurrencyRateService.java
.../module/ecw/service/currencyRate/CurrencyRateService.java
+4
-0
CurrencyRateServiceImpl.java
...ule/ecw/service/currencyRate/CurrencyRateServiceImpl.java
+6
-0
No files found.
sql/v2.2财务/20250222-currency-rate.sql
View file @
a8b0fd68
...
@@ -69,4 +69,4 @@ ALTER TABLE `ecw_currency_rate` ADD COLUMN `target_currency_code` varchar(255) C
...
@@ -69,4 +69,4 @@ ALTER TABLE `ecw_currency_rate` ADD COLUMN `target_currency_code` varchar(255) C
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
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
set
r
.
`source_currency_code`
=
c1
.
fuhao
,
r
.
`target_currency_code`
=
c2
.
fuhao
;
\ No newline at end of file
\ No newline at end of file
yudao-module-ecw/yudao-module-ecw-impl/src/main/java/cn/iocoder/yudao/module/ecw/controller/admin/currencyRate/CurrencyRateController.java
View file @
a8b0fd68
...
@@ -26,6 +26,8 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -26,6 +26,8 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
java.util.List
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
@Validated
@Validated
...
@@ -69,6 +71,13 @@ public class CurrencyRateController {
...
@@ -69,6 +71,13 @@ public class CurrencyRateController {
return
success
(
service
.
query
(
param
));
return
success
(
service
.
query
(
param
));
}
}
@GetMapping
(
"/all/available"
)
@ApiOperation
(
"获取全部的未过期的可用汇率信息列表"
)
public
CommonResult
<
List
<
CurrencyRateDO
>>
allAvailable
(
@Valid
CurrencyRateQueryParamVO
param
)
{
return
success
(
service
.
allAvailable
());
}
@GetMapping
(
"/get"
)
@GetMapping
(
"/get"
)
@ApiOperation
(
"根据币种获取汇率信息"
)
@ApiOperation
(
"根据币种获取汇率信息"
)
@PreAuthorize
(
"@ss.hasPermission('ecw:currency:rate:query')"
)
@PreAuthorize
(
"@ss.hasPermission('ecw:currency:rate:query')"
)
...
...
yudao-module-ecw/yudao-module-ecw-impl/src/main/java/cn/iocoder/yudao/module/ecw/dal/mysql/currencyRate/CurrencyRateMapper.java
View file @
a8b0fd68
...
@@ -34,4 +34,13 @@ public interface CurrencyRateMapper extends AbstractMapper<CurrencyRateDO> {
...
@@ -34,4 +34,13 @@ public interface CurrencyRateMapper extends AbstractMapper<CurrencyRateDO> {
.
orderByDesc
(
Arrays
.
asList
(
CurrencyRateDO:
:
getUpdateTime
,
CurrencyRateDO:
:
getExpiration
));
.
orderByDesc
(
Arrays
.
asList
(
CurrencyRateDO:
:
getUpdateTime
,
CurrencyRateDO:
:
getExpiration
));
return
selectPage
(
param
,
wrapper
);
return
selectPage
(
param
,
wrapper
);
}
}
default
List
<
CurrencyRateDO
>
allAvailable
()
{
Date
now
=
new
Date
();
LambdaQueryWrapper
<
CurrencyRateDO
>
wrapper
=
Wrappers
.
lambdaQuery
(
CurrencyRateDO
.
class
)
.
gt
(
CurrencyRateDO:
:
getExpiration
,
now
)
.
orderByDesc
(
CurrencyRateDO:
:
getId
);
return
selectList
(
wrapper
);
}
}
}
yudao-module-ecw/yudao-module-ecw-impl/src/main/java/cn/iocoder/yudao/module/ecw/service/currencyRate/CurrencyRateService.java
View file @
a8b0fd68
...
@@ -172,4 +172,8 @@ public interface CurrencyRateService {
...
@@ -172,4 +172,8 @@ public interface CurrencyRateService {
* @return 分页结果
* @return 分页结果
*/
*/
PageResult
<
CurrencyRateLogDO
>
history
(
long
id
,
PageParam
param
);
PageResult
<
CurrencyRateLogDO
>
history
(
long
id
,
PageParam
param
);
List
<
CurrencyRateDO
>
allAvailable
();
}
}
yudao-module-ecw/yudao-module-ecw-impl/src/main/java/cn/iocoder/yudao/module/ecw/service/currencyRate/CurrencyRateServiceImpl.java
View file @
a8b0fd68
...
@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
...
@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Optional
;
...
@@ -152,4 +153,9 @@ public class CurrencyRateServiceImpl implements CurrencyRateService {
...
@@ -152,4 +153,9 @@ public class CurrencyRateServiceImpl implements CurrencyRateService {
.
orderByDesc
(
CurrencyRateLogDO:
:
getCreateTime
);
.
orderByDesc
(
CurrencyRateLogDO:
:
getCreateTime
);
return
logMapper
.
selectPage
(
param
,
wrapper
);
return
logMapper
.
selectPage
(
param
,
wrapper
);
}
}
@Override
public
List
<
CurrencyRateDO
>
allAvailable
()
{
return
mapper
.
allAvailable
();
}
}
}
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