Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tamp_fund
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周鹏
tamp_fund
Commits
e66ec272
Commit
e66ec272
authored
Feb 05, 2021
by
张亚辉
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of 47.100.44.39:zhoupeng/tamp_fund into dev
parents
89141ee9
bc4ec500
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
0 deletions
+49
-0
ProductApi.java
src/main/java/com/tanpu/fund/api/ProductApi.java
+4
-0
ProductController.java
...ain/java/com/tanpu/fund/controller/ProductController.java
+5
-0
ProductService.java
src/main/java/com/tanpu/fund/service/ProductService.java
+2
-0
ProductServiceImpl.java
.../java/com/tanpu/fund/service/impl/ProductServiceImpl.java
+38
-0
No files found.
src/main/java/com/tanpu/fund/api/ProductApi.java
View file @
e66ec272
...
...
@@ -38,6 +38,10 @@ public interface ProductApi {
@GetMapping
(
"/product/detail"
)
CommonResp
<
ProductInfoVO
>
getProductDetailInfo
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"id"
)
String
id
);
@ApiOperation
(
"获取产品详情"
)
@GetMapping
(
"/product/list"
)
CommonResp
<
List
<
ProductInfoVO
>>
getProductList
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"ids"
)
List
<
String
>
ids
);
@ApiOperation
(
"单位净值"
)
@GetMapping
(
"/unit/net"
)
CommonResp
<
UnitNetVO
>
getUnitNetInfo
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"id"
)
String
id
,
@ApiParam
(
"对比基金id"
)
@RequestParam
(
value
=
"ratioId"
,
required
=
false
)
String
ratioId
,
...
...
src/main/java/com/tanpu/fund/controller/ProductController.java
View file @
e66ec272
...
...
@@ -38,6 +38,11 @@ public class ProductController implements ProductApi {
return
CommonResp
.
success
(
this
.
productService
.
getProductDetail
(
id
));
}
@Override
public
CommonResp
<
List
<
ProductInfoVO
>>
getProductList
(
List
<
String
>
ids
)
{
return
CommonResp
.
success
(
this
.
productService
.
getProductList
(
ids
));
}
@Override
public
CommonResp
<
UnitNetVO
>
getUnitNetInfo
(
String
id
,
String
ratioId
,
String
type
)
{
return
CommonResp
.
success
(
this
.
productService
.
getUnitNet
(
id
,
ratioId
,
type
));
...
...
src/main/java/com/tanpu/fund/service/ProductService.java
View file @
e66ec272
...
...
@@ -20,6 +20,8 @@ public interface ProductService {
ProductInfoVO
getProductDetail
(
String
id
);
List
<
ProductInfoVO
>
getProductList
(
List
<
String
>
ids
);
Page
<
ProductInfoVO
>
getNotTanpuProduct
(
ProductInfoReq
req
);
UnitNetVO
getUnitNet
(
String
id
,
String
ratioId
,
String
type
);
...
...
src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
View file @
e66ec272
...
...
@@ -168,6 +168,44 @@ public class ProductServiceImpl implements ProductService, Constant {
return
vo
;
}
@Override
public
List
<
ProductInfoVO
>
getProductList
(
List
<
String
>
ids
)
{
List
<
ProductInfoVO
>
vos
=
new
ArrayList
<>();
FundInfoExample
example
=
new
FundInfoExample
();
example
.
createCriteria
().
andIdIn
(
ids
).
andDeleteTagEqualTo
(
ZERO_NUM
);
List
<
FundInfo
>
infos
=
this
.
fundInfoMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isEmpty
(
infos
))
{
return
new
ArrayList
<>(
0
);
}
FundCountExample
example1
=
new
FundCountExample
();
example1
.
createCriteria
().
andFundIdIn
(
ids
);
List
<
FundCount
>
fundCounts
=
this
.
fundCountMapper
.
selectByExample
(
example1
);
Map
<
String
,
FundCount
>
fundCountMap
=
fundCounts
.
stream
().
collect
(
Collectors
.
toMap
(
FundCount:
:
getFundId
,
s
->
s
,
(
oldValue
,
newValue
)
->
newValue
));
infos
.
forEach
(
info
->
{
ProductInfoVO
vo
=
new
ProductInfoVO
();
if
(
fundCountMap
.
containsKey
(
info
.
getId
()))
{
FundCount
fundCount
=
fundCounts
.
get
(
0
);
vo
.
setRet1m
(
multiply100
(
fundCount
.
getRet1m
()));
}
BeanUtils
.
copyProperties
(
info
,
vo
);
vo
.
setProductName
(
info
.
getFundShortName
());
vo
.
setDesc
(
info
.
getDescInfo
());
// 最新净值
vo
.
setNet
(
getNewNet
(
info
.
getId
()));
vos
.
add
(
vo
);
});
return
vos
;
}
@Override
public
Page
<
ProductInfoVO
>
getNotTanpuProduct
(
ProductInfoReq
req
)
{
...
...
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