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
c1eac3c7
Commit
c1eac3c7
authored
Oct 15, 2021
by
吴泽佳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基金行家 需求 提交27
parent
972d5b1c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
8 deletions
+79
-8
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
+68
-8
No files found.
src/main/java/com/tanpu/fund/api/ProductApi.java
View file @
c1eac3c7
...
...
@@ -94,6 +94,10 @@ public interface ProductApi {
@GetMapping
(
"/fund/record"
)
CommonResp
<
FundRecordVO
>
getFundRecordInfo
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"id"
)
String
id
);
@ApiOperation
(
"基金档案 - 交易须知"
)
@GetMapping
(
"/fund/notice"
)
CommonResp
<
FundNoticeVO
>
getFundNoticeInfo
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"id"
)
String
id
);
@ApiOperation
(
"基金公司"
)
@GetMapping
(
"/fund/company"
)
CommonResp
<
FundCompanyVO
>
getFundCompanyInfo
(
@ApiParam
(
"基金公司id"
)
@RequestParam
(
"id"
)
String
id
);
...
...
src/main/java/com/tanpu/fund/controller/ProductController.java
View file @
c1eac3c7
...
...
@@ -108,6 +108,11 @@ public class ProductController implements ProductApi {
return
CommonResp
.
success
(
this
.
productService
.
getFundRecord
(
id
));
}
@Override
public
CommonResp
<
FundNoticeVO
>
getFundNoticeInfo
(
String
id
)
{
return
CommonResp
.
success
(
this
.
productService
.
getFundNoticeInfo
(
id
));
}
@Override
public
CommonResp
<
FundCompanyVO
>
getFundCompanyInfo
(
String
id
)
{
return
CommonResp
.
success
(
this
.
productService
.
getFundCompany
(
id
));
...
...
src/main/java/com/tanpu/fund/service/ProductService.java
View file @
c1eac3c7
...
...
@@ -51,6 +51,8 @@ public interface ProductService {
FundRecordVO
getFundRecord
(
String
id
);
FundNoticeVO
getFundNoticeInfo
(
String
id
);
FundCompanyVO
getFundCompany
(
String
id
);
List
<
ProductInfoVO
>
getProductInfolist
(
ProductListReq
req
);
...
...
src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
View file @
c1eac3c7
...
...
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateField;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.poi.excel.ExcelReader
;
import
cn.hutool.poi.excel.ExcelUtil
;
import
com.github.pagehelper.page.PageMethod
;
...
...
@@ -46,9 +47,9 @@ import org.springframework.stereotype.Service;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.stream.Collectors
;
...
...
@@ -157,6 +158,8 @@ public class ProductServiceImpl implements ProductService, Constant {
}
FundInfo
fundInfo
=
infos
.
get
(
0
);
BeanUtils
.
copyProperties
(
fundInfo
,
vo
);
vo
.
setStrategy
(
String
.
valueOf
(
fundInfo
.
getStrategy
()));
vo
.
setSubstrategy
(
String
.
valueOf
(
fundInfo
.
getSubstrategy
()));
vo
.
setOpenDay
(
fundInfo
.
getOpenDay
());
vo
.
setProductName
(
fundInfo
.
getFundShortName
());
vo
.
setDesc
(
fundInfo
.
getDescInfo
());
...
...
@@ -194,6 +197,33 @@ public class ProductServiceImpl implements ProductService, Constant {
vo
.
setCumulativeProfit
(
BigDecimalUtil
.
toString
(
fundCount
.
getCumulativeNav
()));
vo
.
setRetYtd
(
multiply100
(
fundCount
.
getRetYtd
()));
vo
.
setRetIncep
(
multiply100
(
fundCount
.
getRetIncep
()));
vo
.
setSharperatioIncep
(
multiply100
(
fundCount
.
getSharperatioIncep
()));
vo
.
setMaxdrawdownIncep
(
multiply100
(
fundCount
.
getMaxdrawdownIncep
()));
vo
.
setRetIncepA
(
multiply100
(
fundCount
.
getRetIncepA
()));
if
(
ObjectUtil
.
isNotNull
(
fundInfo
.
getInceptionDate
()))
{
long
betweenMonth
=
DateUtil
.
betweenMonth
(
fundInfo
.
getInceptionDate
(),
new
Date
(),
false
);
BigDecimal
bigDecimal
=
new
BigDecimal
(
betweenMonth
);
BigDecimal
bigDecimal2
=
new
BigDecimal
(
12
);
BigDecimal
divide
=
bigDecimal
.
divide
(
bigDecimal2
,
1
,
RoundingMode
.
HALF_UP
);
vo
.
setInceptionDateYear
(
divide
.
toString
());
if
(
betweenMonth
<
1
)
{
vo
.
setMouth
(
"1个月"
);
vo
.
setRetOfMouth
(
""
);
}
else
if
(
betweenMonth
<
3
)
{
vo
.
setMouth
(
"1个月"
);
vo
.
setRetOfMouth
(
multiply100
(
fundCount
.
getRet1m
()));
}
else
if
(
betweenMonth
<
6
)
{
vo
.
setMouth
(
"3个月"
);
vo
.
setRetOfMouth
(
multiply100
(
fundCount
.
getRet3m
()));
}
else
if
(
betweenMonth
<
12
)
{
vo
.
setMouth
(
"6个月"
);
vo
.
setRetOfMouth
(
multiply100
(
fundCount
.
getRet6m
()));
}
else
{
vo
.
setMouth
(
"1年"
);
vo
.
setRetOfMouth
(
multiply100
(
fundCount
.
getRet1y
()));
}
}
}
// 基金公司信息
...
...
@@ -220,13 +250,17 @@ public class ProductServiceImpl implements ProductService, Constant {
//子策略名称
if
(
vo
.
getSubstrategy
()
!=
null
)
{
CommonResp
<
List
<
SysConstantResp
>>
listCommonResp
=
this
.
fatools
.
queryLabels
(
SysConstEnums
.
TAMPSUBSTRATEGY
.
getConstantGroup
());
if
(
listCommonResp
.
isSuccess
())
{
listCommonResp
.
getAttributes
().
stream
()
.
filter
(
item
->
StringUtils
.
equals
(
String
.
valueOf
(
vo
.
getSubstrategy
()),
item
.
getConstantCode
()))
.
findFirst
()
.
ifPresent
(
sysConstantResp
->
vo
.
setStrategyName
(
sysConstantResp
.
getConstantName
()));
vo
.
setSubstrategyName
(
ProductEnums
.
FundSubStrategyEnum
.
getBySubStrategy
(
Integer
.
valueOf
(
vo
.
getSubstrategy
())));
// CommonResp<List<SysConstantResp>> listCommonResp = this.fatools.queryLabels(SysConstEnums.TAMPSUBSTRATEGY.getConstantGroup());
// if (listCommonResp.isSuccess()) {
// listCommonResp.getAttributes().stream()
// .filter(item -> StringUtils.equals(String.valueOf(vo.getSubstrategy()), item.getConstantCode()))
// .findFirst()
// .ifPresent(sysConstantResp -> vo.setStrategyName(sysConstantResp.getConstantName()));
// }
}
if
(
vo
.
getStrategy
()
!=
null
)
{
vo
.
setStrategyName
(
ProductEnums
.
FundStrategyEnum
.
getByStrategy
(
Integer
.
valueOf
(
vo
.
getStrategy
())));
}
vo
.
setProductType
(
Constant
.
ONE_NUM
);
...
...
@@ -1028,6 +1062,32 @@ public class ProductServiceImpl implements ProductService, Constant {
return
vo
;
}
@Override
public
FundNoticeVO
getFundNoticeInfo
(
String
id
)
{
FundNoticeVO
fundNoticeVO
=
new
FundNoticeVO
();
FundInfo
fundInfo
=
this
.
fundInfoMapper
.
selectByPrimaryKey
(
id
);
fundNoticeVO
.
setOpenDay
(
fundInfo
.
getOpenDay
());
fundNoticeVO
.
setCloseDay
(
fundInfo
.
getOpenDay
());
FundRateMapping
fundRateMapping
=
this
.
fundRateMappingMapper
.
selectByPrimaryKey
(
id
);
if
(
fundRateMapping
!=
null
)
{
fundNoticeVO
.
setMinInvestmentShare
(
fundRateMapping
.
getMinInvestmentShare
());
fundNoticeVO
.
setSubsequentInvestmentShare
(
fundRateMapping
.
getSubsequentInvestmentShare
());
fundNoticeVO
.
setPurchaseRates
(
BigDecimalUtil
.
multiply100
(
fundRateMapping
.
getSubscriptionFee
()));
fundNoticeVO
.
setManagementRate
(
BigDecimalUtil
.
multiply100
(
fundRateMapping
.
getManagementfeeTrust
()));
fundNoticeVO
.
setRedemptionFee
(
fundRateMapping
.
getRedemptionFeeNote
());
fundNoticeVO
.
setPrecautiousLine
(
BigDecimalUtil
.
toString
(
fundRateMapping
.
getGuardLine
()));
fundNoticeVO
.
setStopLossLine
(
BigDecimalUtil
.
toString
(
fundRateMapping
.
getStopLossLine
()));
fundNoticeVO
.
setExPerformanceRewardMethod
(
fundRateMapping
.
getPerformanceFeeDeductionMethod
());
fundNoticeVO
.
setExPerformanceRewardDate
(
BigDecimalUtil
.
toString
(
fundRateMapping
.
getPerformanceFee
()));
}
fundNoticeVO
.
setLockupPeriodQuota
(
fundInfo
.
getLockupPeriod
());
return
fundNoticeVO
;
}
@Override
public
List
<
ProductInfoVO
>
getProductInfolist
(
ProductListReq
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