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
89141ee9
Commit
89141ee9
authored
Feb 05, 2021
by
张亚辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
私有基金
parent
176a1ed9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
148 additions
and
0 deletions
+148
-0
ProductApi.java
src/main/java/com/tanpu/fund/api/ProductApi.java
+8
-0
PrivateFundDetailResp.java
.../com/tanpu/fund/api/model/resp/PrivateFundDetailResp.java
+28
-0
PrivateHistoryprofitResp.java
...m/tanpu/fund/api/model/resp/PrivateHistoryprofitResp.java
+37
-0
ProductController.java
...ain/java/com/tanpu/fund/controller/ProductController.java
+10
-0
ProductService.java
src/main/java/com/tanpu/fund/service/ProductService.java
+3
-0
ProductServiceImpl.java
.../java/com/tanpu/fund/service/impl/ProductServiceImpl.java
+62
-0
No files found.
src/main/java/com/tanpu/fund/api/ProductApi.java
View file @
89141ee9
...
@@ -94,4 +94,12 @@ public interface ProductApi {
...
@@ -94,4 +94,12 @@ public interface ProductApi {
@ApiOperation
(
"动态回撤"
)
@ApiOperation
(
"动态回撤"
)
@GetMapping
(
"/dynamic/retreat"
)
@GetMapping
(
"/dynamic/retreat"
)
CommonResp
<
DynamicRetreatVO
>
getDynamicRetreatInfo
(
@RequestParam
(
"id"
)
String
id
);
CommonResp
<
DynamicRetreatVO
>
getDynamicRetreatInfo
(
@RequestParam
(
"id"
)
String
id
);
@ApiOperation
(
"私有基金详情"
)
@GetMapping
(
"/privatefund/detail"
)
CommonResp
<
PrivateFundDetailResp
>
getPrivateDetail
(
@RequestParam
(
"id"
)
String
id
);
@ApiOperation
(
"私有基金历史业绩"
)
@GetMapping
(
"/privatefund/historyprofit"
)
CommonResp
<
PrivateHistoryprofitResp
>
getHistoryprofit
(
@RequestParam
(
"id"
)
String
id
);
}
}
src/main/java/com/tanpu/fund/api/model/resp/PrivateFundDetailResp.java
0 → 100644
View file @
89141ee9
package
com
.
tanpu
.
fund
.
api
.
model
.
resp
;
import
com.tanpu.common.model.product.resp.Net
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author: zyh
* @date: 2021-02-05 5:23 下午
* @description:
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
PrivateFundDetailResp
{
@ApiModelProperty
(
"基金ID"
)
private
String
fundId
;
@ApiModelProperty
(
"基金名称"
)
private
String
fundName
;
@ApiModelProperty
(
"近一年收益"
)
private
String
near1YearProfit
;
@ApiModelProperty
(
"最新净值"
)
private
Net
net
;
}
src/main/java/com/tanpu/fund/api/model/resp/PrivateHistoryprofitResp.java
0 → 100644
View file @
89141ee9
package
com
.
tanpu
.
fund
.
api
.
model
.
resp
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author: zyh
* @date: 2021-02-05 5:46 下午
* @description:
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
PrivateHistoryprofitResp
{
@ApiModelProperty
(
"基金ID"
)
private
String
fundId
;
@ApiModelProperty
(
"近三月收益"
)
private
String
ret3m
;
@ApiModelProperty
(
"近半年收益"
)
private
String
ret6m
;
@ApiModelProperty
(
"近一年收益"
)
private
String
ret1y
;
@ApiModelProperty
(
"近两年收益"
)
private
String
ret2y
;
@ApiModelProperty
(
"近三年收益"
)
private
String
ret3y
;
@ApiModelProperty
(
"近四年收益"
)
private
String
ret4y
;
@ApiModelProperty
(
"近五年收益"
)
private
String
ret5y
;
@ApiModelProperty
(
"成立以来收益"
)
private
String
retIncep
;
}
src/main/java/com/tanpu/fund/controller/ProductController.java
View file @
89141ee9
...
@@ -104,4 +104,14 @@ public class ProductController implements ProductApi {
...
@@ -104,4 +104,14 @@ public class ProductController implements ProductApi {
public
CommonResp
<
DynamicRetreatVO
>
getDynamicRetreatInfo
(
String
id
)
{
public
CommonResp
<
DynamicRetreatVO
>
getDynamicRetreatInfo
(
String
id
)
{
return
CommonResp
.
success
(
this
.
productService
.
getDynamicRetreat
(
id
));
return
CommonResp
.
success
(
this
.
productService
.
getDynamicRetreat
(
id
));
}
}
@Override
public
CommonResp
<
PrivateFundDetailResp
>
getPrivateDetail
(
String
id
)
{
return
CommonResp
.
success
(
this
.
productService
.
getPrivateDetail
(
id
));
}
@Override
public
CommonResp
<
PrivateHistoryprofitResp
>
getHistoryprofit
(
String
id
)
{
return
CommonResp
.
success
(
this
.
productService
.
getHistoryprofit
(
id
));
}
}
}
src/main/java/com/tanpu/fund/service/ProductService.java
View file @
89141ee9
...
@@ -48,4 +48,7 @@ public interface ProductService {
...
@@ -48,4 +48,7 @@ public interface ProductService {
DynamicRetreatVO
getDynamicRetreat
(
String
id
);
DynamicRetreatVO
getDynamicRetreat
(
String
id
);
PrivateFundDetailResp
getPrivateDetail
(
String
id
);
PrivateHistoryprofitResp
getHistoryprofit
(
String
id
);
}
}
src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
View file @
89141ee9
...
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DatePattern;
...
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DatePattern;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.github.pagehelper.page.PageMethod
;
import
com.github.pagehelper.page.PageMethod
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.tanpu.common.enums.BizEnums
;
import
com.tanpu.common.enums.Constant
;
import
com.tanpu.common.enums.Constant
;
import
com.tanpu.common.model.Page
;
import
com.tanpu.common.model.Page
;
import
com.tanpu.common.model.Pageable
;
import
com.tanpu.common.model.Pageable
;
...
@@ -84,6 +85,11 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -84,6 +85,11 @@ public class ProductServiceImpl implements ProductService, Constant {
@Resource
@Resource
private
FundDistributionMapper
fundDistributionMapper
;
private
FundDistributionMapper
fundDistributionMapper
;
@Resource
private
IfaImportedFundInfoMapper
ifaImportedFundInfoMapper
;
@Resource
private
IfaImportedFundNavMapper
ifaImportedFundNavMapper
;
@Override
@Override
public
Page
<
ProductInfoVO
>
getProductList
(
ProductInfoReq
req
)
{
public
Page
<
ProductInfoVO
>
getProductList
(
ProductInfoReq
req
)
{
...
@@ -1247,4 +1253,60 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -1247,4 +1253,60 @@ public class ProductServiceImpl implements ProductService, Constant {
return
vo
;
return
vo
;
}
}
@Override
public
PrivateFundDetailResp
getPrivateDetail
(
String
id
)
{
IfaImportedFundInfo
fundInfo
=
ifaImportedFundInfoMapper
.
selectByPrimaryKey
(
id
);
//查询收益率
FundCountExample
example
=
new
FundCountExample
();
example
.
createCriteria
().
andFundIdEqualTo
(
id
).
andDeleteTagEqualTo
(
BizEnums
.
DeleteTag
.
tag_init
);
List
<
FundCount
>
fundCountList
=
fundCountMapper
.
selectByExample
(
example
);
//查询净值
PageMethod
.
startPage
(
1
,
1
);
IfaImportedFundNavExample
navExample
=
new
IfaImportedFundNavExample
();
navExample
.
createCriteria
().
andFundIdEqualTo
(
id
).
andDeleteTagEqualTo
(
BizEnums
.
DeleteTag
.
tag_init
);
navExample
.
setOrderByClause
(
"price_date desc"
);
List
<
IfaImportedFundNav
>
navList
=
ifaImportedFundNavMapper
.
selectByExample
(
navExample
);
PrivateFundDetailResp
detailResp
=
PrivateFundDetailResp
.
builder
()
.
fundId
(
fundInfo
.
getId
())
.
fundName
(
fundInfo
.
getFundName
())
.
build
();
if
(
CollectionUtils
.
isNotEmpty
(
fundCountList
))
{
detailResp
.
setNear1YearProfit
(
BigDecimalUtil
.
toString
(
fundCountList
.
get
(
0
).
getRet1y
(),
2
));
}
if
(
CollectionUtils
.
isNotEmpty
(
navList
))
{
detailResp
.
setNet
(
Net
.
builder
().
netDate
(
navList
.
get
(
0
).
getPriceDate
().
getTime
())
.
netValue
(
BigDecimalUtil
.
toString
(
navList
.
get
(
0
).
getNav
())).
build
());
}
return
detailResp
;
}
@Override
public
PrivateHistoryprofitResp
getHistoryprofit
(
String
id
)
{
FundCountExample
example
=
new
FundCountExample
();
example
.
createCriteria
().
andFundIdEqualTo
(
id
).
andDeleteTagEqualTo
(
BizEnums
.
DeleteTag
.
tag_init
);
List
<
FundCount
>
fundCountList
=
fundCountMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isNotEmpty
(
fundCountList
))
{
FundCount
fundCount
=
fundCountList
.
get
(
0
);
return
PrivateHistoryprofitResp
.
builder
()
.
fundId
(
fundCount
.
getFundId
())
.
ret3m
(
BigDecimalUtil
.
toString
(
fundCount
.
getRet3m
(),
2
))
.
ret6m
(
BigDecimalUtil
.
toString
(
fundCount
.
getRet6m
(),
2
))
.
ret1y
(
BigDecimalUtil
.
toString
(
fundCount
.
getRet1y
(),
2
))
.
ret2y
(
BigDecimalUtil
.
toString
(
fundCount
.
getRet2y
(),
2
))
.
ret3y
(
BigDecimalUtil
.
toString
(
fundCount
.
getRet3y
(),
2
))
.
ret4y
(
BigDecimalUtil
.
toString
(
fundCount
.
getRet4y
(),
2
))
.
ret5y
(
BigDecimalUtil
.
toString
(
fundCount
.
getRet5y
(),
2
))
.
retIncep
(
BigDecimalUtil
.
toString
(
fundCount
.
getRetIncep
(),
2
))
.
build
();
}
return
null
;
}
}
}
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