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
1d459cdc
Commit
1d459cdc
authored
Mar 13, 2021
by
zp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init-config
parent
2c67fc51
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
27 deletions
+17
-27
.gitignore
.gitignore
+1
-1
ProductServiceImpl.java
.../java/com/tanpu/fund/service/impl/ProductServiceImpl.java
+16
-26
No files found.
.gitignore
View file @
1d459cdc
...
@@ -76,7 +76,7 @@ target
...
@@ -76,7 +76,7 @@ target
.classpath
.classpath
.factorypath
.factorypath
.project
.project
.settings
.settings
/
.vscode/
.vscode/
src/main/java/pm/Generator.java
src/main/java/pm/Generator.java
...
...
src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
View file @
1d459cdc
...
@@ -31,10 +31,8 @@ import com.tanpu.fund.feign.diagnose.FeignClientForDiagnose;
...
@@ -31,10 +31,8 @@ import com.tanpu.fund.feign.diagnose.FeignClientForDiagnose;
import
com.tanpu.fund.feign.user.FeignClientForFatools
;
import
com.tanpu.fund.feign.user.FeignClientForFatools
;
import
com.tanpu.fund.mapper.generator.*
;
import
com.tanpu.fund.mapper.generator.*
;
import
com.tanpu.fund.mapper.generator.custom.FundInfoCustomMapper
;
import
com.tanpu.fund.mapper.generator.custom.FundInfoCustomMapper
;
import
com.tanpu.fund.service.ProductCommonService
;
import
com.tanpu.fund.service.ProductService
;
import
com.tanpu.fund.service.ProductService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.list.TreeList
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.validator.routines.BigDecimalValidator
;
import
org.apache.commons.validator.routines.BigDecimalValidator
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.NotNull
;
...
@@ -111,9 +109,6 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -111,9 +109,6 @@ public class ProductServiceImpl implements ProductService, Constant {
@Resource
@Resource
private
IfaImportedFundNavMapper
ifaImportedFundNavMapper
;
private
IfaImportedFundNavMapper
ifaImportedFundNavMapper
;
@Resource
private
ProductCommonService
productCommonService
;
@Resource
@Resource
private
FeignClientForFatools
fatools
;
private
FeignClientForFatools
fatools
;
...
@@ -133,7 +128,7 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -133,7 +128,7 @@ public class ProductServiceImpl implements ProductService, Constant {
List
<
ProductInfoVO
>
vos
=
new
ArrayList
<>();
List
<
ProductInfoVO
>
vos
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
vos
=
getProductInfoVOS
(
fundCounts
,
list
,
1
);
vos
=
getProductInfoVOS
(
fundCounts
,
list
);
}
}
return
new
Page
<>(
req
.
getPage
(),
page
.
getTotal
(),
vos
);
return
new
Page
<>(
req
.
getPage
(),
page
.
getTotal
(),
vos
);
...
@@ -158,7 +153,6 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -158,7 +153,6 @@ public class ProductServiceImpl implements ProductService, Constant {
vo
.
setProductName
(
fundInfo
.
getFundShortName
());
vo
.
setProductName
(
fundInfo
.
getFundShortName
());
vo
.
setDesc
(
fundInfo
.
getDescInfo
());
vo
.
setDesc
(
fundInfo
.
getDescInfo
());
List
<
String
>
ls
=
Lists
.
newArrayList
(
fundInfo
.
getPrimaryBenchmarkId
());
/*// 产品编码
/*// 产品编码
Map<String, List<IndexesProfile>> indexIdMap = getIndexIdMap(ls);
Map<String, List<IndexesProfile>> indexIdMap = getIndexIdMap(ls);
getProductCode(indexIdMap, vo, fundInfo);*/
getProductCode(indexIdMap, vo, fundInfo);*/
...
@@ -220,10 +214,10 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -220,10 +214,10 @@ public class ProductServiceImpl implements ProductService, Constant {
if
(
vo
.
getSubstrategy
()
!=
null
)
{
if
(
vo
.
getSubstrategy
()
!=
null
)
{
CommonResp
<
List
<
SysConstantResp
>>
listCommonResp
=
this
.
fatools
.
queryLabels
(
SysConstEnums
.
TAMPSUBSTRATEGY
.
getConstantGroup
());
CommonResp
<
List
<
SysConstantResp
>>
listCommonResp
=
this
.
fatools
.
queryLabels
(
SysConstEnums
.
TAMPSUBSTRATEGY
.
getConstantGroup
());
if
(
listCommonResp
.
isSuccess
())
{
if
(
listCommonResp
.
isSuccess
())
{
SysConstantResp
sysConstantResp
=
listCommonResp
.
getAttributes
().
stream
().
filter
(
item
->
StringUtils
.
equals
(
String
.
valueOf
(
vo
.
getSubstrategy
()),
item
.
getConstantCode
())).
findFirst
().
orElse
(
null
);
listCommonResp
.
getAttributes
().
stream
()
if
(
sysConstantResp
!=
null
)
{
.
filter
(
item
->
StringUtils
.
equals
(
String
.
valueOf
(
vo
.
getSubstrategy
()),
item
.
getConstantCode
()))
vo
.
setStrategyName
(
sysConstantResp
.
getConstantName
());
.
findFirst
()
}
.
ifPresent
(
sysConstantResp
->
vo
.
setStrategyName
(
sysConstantResp
.
getConstantName
()));
}
}
}
}
...
@@ -793,7 +787,7 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -793,7 +787,7 @@ public class ProductServiceImpl implements ProductService, Constant {
if
(
i
<
fundNavs
.
size
()
-
1
)
{
if
(
i
<
fundNavs
.
size
()
-
1
)
{
FundNav
pre
=
fundNavs
.
get
(
i
+
1
);
FundNav
pre
=
fundNavs
.
get
(
i
+
1
);
if
(
pre
.
getNav
().
compareTo
(
BigDecimal
.
ZERO
)
==
1
)
{
if
(
pre
.
getNav
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
BigDecimal
dailyIncrease
=
f
.
getNav
().
subtract
(
pre
.
getNav
()).
divide
(
pre
.
getNav
(),
4
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
dailyIncrease
=
f
.
getNav
().
subtract
(
pre
.
getNav
()).
divide
(
pre
.
getNav
(),
4
,
BigDecimal
.
ROUND_HALF_UP
);
vo
.
setDailyIncrease
(
BigDecimalUtil
.
multiply100
(
dailyIncrease
));
vo
.
setDailyIncrease
(
BigDecimalUtil
.
multiply100
(
dailyIncrease
));
}
}
...
@@ -1030,7 +1024,7 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -1030,7 +1024,7 @@ public class ProductServiceImpl implements ProductService, Constant {
List
<
ProductInfoVO
>
vos
=
new
ArrayList
<>();
List
<
ProductInfoVO
>
vos
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
req
.
getFundIds
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
req
.
getFundIds
()))
{
vos
=
getProductInfoVOS
(
fundCounts
,
req
.
getFundIds
()
,
1
);
vos
=
getProductInfoVOS
(
fundCounts
,
req
.
getFundIds
());
}
}
return
vos
;
return
vos
;
...
@@ -1167,7 +1161,7 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -1167,7 +1161,7 @@ public class ProductServiceImpl implements ProductService, Constant {
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}
}
private
List
<
ProductInfoVO
>
getProductInfoVOS
(
List
<
FundCount
>
fundCounts
,
List
<
String
>
list
,
Integer
productType
)
{
private
List
<
ProductInfoVO
>
getProductInfoVOS
(
List
<
FundCount
>
fundCounts
,
List
<
String
>
list
)
{
FundInfoExample
example
=
new
FundInfoExample
();
FundInfoExample
example
=
new
FundInfoExample
();
example
.
createCriteria
().
andIdIn
(
list
).
andDeleteTagEqualTo
(
ZERO_NUM
);
example
.
createCriteria
().
andIdIn
(
list
).
andDeleteTagEqualTo
(
ZERO_NUM
);
example
.
setOrderByClause
(
"create_time desc"
);
example
.
setOrderByClause
(
"create_time desc"
);
...
@@ -1199,7 +1193,7 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -1199,7 +1193,7 @@ public class ProductServiceImpl implements ProductService, Constant {
}
}
}
}
return
fundInfos
.
stream
().
map
(
p
->
getProductInfoVO
(
fundCountMap
,
rateMappingMap
,
p
,
null
,
productType
,
fundNavMap
))
return
fundInfos
.
stream
().
map
(
p
->
getProductInfoVO
(
fundCountMap
,
rateMappingMap
,
p
,
fundNavMap
))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
...
@@ -1210,7 +1204,7 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -1210,7 +1204,7 @@ public class ProductServiceImpl implements ProductService, Constant {
private
ProductInfoVO
getProductInfoVO
(
Map
<
String
,
FundCount
>
fundCountMap
,
Map
<
String
,
FundRateMapping
>
rateMappingMap
,
private
ProductInfoVO
getProductInfoVO
(
Map
<
String
,
FundCount
>
fundCountMap
,
Map
<
String
,
FundRateMapping
>
rateMappingMap
,
FundInfo
fundInfo
,
FundInfo
fundInfo
,
Set
<
String
>
fundInfoReports
,
Integer
productType
,
Map
<
String
,
FundNav
>
fundNavMap
)
{
Map
<
String
,
FundNav
>
fundNavMap
)
{
ProductInfoVO
vo
=
new
ProductInfoVO
();
ProductInfoVO
vo
=
new
ProductInfoVO
();
if
(
fundCountMap
.
containsKey
(
fundInfo
.
getId
()))
{
if
(
fundCountMap
.
containsKey
(
fundInfo
.
getId
()))
{
FundCount
fundCount
=
fundCountMap
.
get
(
fundInfo
.
getId
());
FundCount
fundCount
=
fundCountMap
.
get
(
fundInfo
.
getId
());
...
@@ -1221,7 +1215,7 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -1221,7 +1215,7 @@ public class ProductServiceImpl implements ProductService, Constant {
vo
.
setRetIncep
(
multiply100
(
fundCount
.
getRetIncep
()));
vo
.
setRetIncep
(
multiply100
(
fundCount
.
getRetIncep
()));
vo
.
setCumulativeProfit
(
BigDecimalUtil
.
toString
(
fundCount
.
getCumulativeNav
()));
vo
.
setCumulativeProfit
(
BigDecimalUtil
.
toString
(
fundCount
.
getCumulativeNav
()));
}
}
vo
.
setProductType
(
productType
);
vo
.
setProductType
(
1
);
String
fundId
=
fundInfo
.
getId
();
String
fundId
=
fundInfo
.
getId
();
vo
.
setFundId
(
fundId
);
vo
.
setFundId
(
fundId
);
...
@@ -1235,11 +1229,7 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -1235,11 +1229,7 @@ public class ProductServiceImpl implements ProductService, Constant {
// 风险等级
// 风险等级
vo
.
setRiskLevel
(
fundInfo
.
getRiskLevel
());
vo
.
setRiskLevel
(
fundInfo
.
getRiskLevel
());
if
(
fundInfoReports
!=
null
&&
fundInfoReports
.
contains
(
fundId
))
{
vo
.
setIsReport
(
0
);
vo
.
setIsReport
(
1
);
}
else
{
vo
.
setIsReport
(
0
);
}
vo
.
setIsAppoint
(
fundInfo
.
getType
());
vo
.
setIsAppoint
(
fundInfo
.
getType
());
// 最新净值
// 最新净值
...
@@ -1434,10 +1424,10 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -1434,10 +1424,10 @@ public class ProductServiceImpl implements ProductService, Constant {
if
(
detailResp
.
getSubstrategy
()
!=
null
)
{
if
(
detailResp
.
getSubstrategy
()
!=
null
)
{
CommonResp
<
List
<
SysConstantResp
>>
listCommonResp
=
this
.
fatools
.
queryLabels
(
SysConstEnums
.
TAMPSUBSTRATEGY
.
getConstantGroup
());
CommonResp
<
List
<
SysConstantResp
>>
listCommonResp
=
this
.
fatools
.
queryLabels
(
SysConstEnums
.
TAMPSUBSTRATEGY
.
getConstantGroup
());
if
(
listCommonResp
.
isSuccess
())
{
if
(
listCommonResp
.
isSuccess
())
{
SysConstantResp
sysConstantResp
=
listCommonResp
.
getAttributes
().
stream
().
filter
(
item
->
StringUtils
.
equals
(
String
.
valueOf
(
detailResp
.
getSubstrategy
()),
item
.
getConstantCode
())).
findFirst
().
orElse
(
null
);
listCommonResp
.
getAttributes
().
stream
()
if
(
sysConstantResp
!=
null
)
{
.
filter
(
item
->
StringUtils
.
equals
(
String
.
valueOf
(
detailResp
.
getSubstrategy
()),
item
.
getConstantCode
())).
detailResp
.
setStrategyName
(
sysConstantResp
.
getConstantName
());
findFirst
()
}
.
ifPresent
(
sysConstantResp
->
detailResp
.
setStrategyName
(
sysConstantResp
.
getConstantName
()));
}
}
}
}
...
...
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