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
4bc264b8
Commit
4bc264b8
authored
Mar 04, 2021
by
张亚辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组合基金查询
parent
a51e21f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
ProductServiceImpl.java
.../java/com/tanpu/fund/service/impl/ProductServiceImpl.java
+12
-8
application-dev.properties
src/main/resources/application-dev.properties
+3
-3
No files found.
src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
View file @
4bc264b8
...
@@ -1010,12 +1010,12 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -1010,12 +1010,12 @@ public class ProductServiceImpl implements ProductService, Constant {
// 策略集合
// 策略集合
List
<
FundCount
>
fundCounts
=
this
.
fundCountMapper
.
selectByExample
(
reqFilterResult
(
req
));
List
<
FundCount
>
fundCounts
=
this
.
fundCountMapper
.
selectByExample
(
reqFilterResult
(
req
));
List
<
String
>
list
=
fundCounts
.
stream
().
map
(
FundCount:
:
getFundId
).
collect
(
Collectors
.
toList
());
//
List<String> list = fundCounts.stream().map(FundCount::getFundId).collect(Collectors.toList());
List
<
ProductInfoVO
>
vos
=
new
ArrayList
<>();
List
<
ProductInfoVO
>
vos
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
if
(
CollectionUtils
.
isNotEmpty
(
req
.
getFundIds
()
))
{
vos
=
getProductInfoVOS
(
fundCounts
,
list
,
1
);
vos
=
getProductInfoVOS
(
fundCounts
,
req
.
getFundIds
()
,
1
);
}
}
return
vos
;
return
vos
;
...
@@ -1155,9 +1155,11 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -1155,9 +1155,11 @@ public class ProductServiceImpl implements ProductService, Constant {
private
List
<
ProductInfoVO
>
getProductInfoVOS
(
List
<
FundCount
>
fundCounts
,
List
<
String
>
list
,
Integer
productType
)
{
private
List
<
ProductInfoVO
>
getProductInfoVOS
(
List
<
FundCount
>
fundCounts
,
List
<
String
>
list
,
Integer
productType
)
{
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"
);
List
<
FundInfo
>
fundInfos
=
this
.
fundInfoMapper
.
selectByExample
(
example
);
List
<
FundInfo
>
fundInfos
=
this
.
fundInfoMapper
.
selectByExample
(
example
);
Map
<
String
,
FundInfo
>
fundInfoMap
=
fundInfos
.
stream
().
collect
(
Collectors
.
toMap
(
FundInfo:
:
getId
,
f
->
f
));
// Map<String, FundInfo> fundInfoMap = fundInfos.stream().collect(Collectors.toMap(FundInfo::getId, f -> f));
Map
<
String
,
FundCount
>
fundCountMap
=
fundCounts
.
stream
().
collect
(
Collectors
.
toMap
(
FundCount:
:
getFundId
,
f
->
f
));
// 指数indexId
// 指数indexId
/*List<String> ls = fundInfos.stream().filter(f -> StringUtils.isNotEmpty(f.getPrimaryBenchmarkId()))
/*List<String> ls = fundInfos.stream().filter(f -> StringUtils.isNotEmpty(f.getPrimaryBenchmarkId()))
...
@@ -1171,7 +1173,7 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -1171,7 +1173,7 @@ public class ProductServiceImpl implements ProductService, Constant {
// 查询研报信息是否有研报
// 查询研报信息是否有研报
// Map<String, Object> fundInfoReport = getFundReport(Lists.newArrayList(fundInfoMap.keySet()));
// Map<String, Object> fundInfoReport = getFundReport(Lists.newArrayList(fundInfoMap.keySet()));
return
fund
Counts
.
stream
().
map
(
p
->
getProductInfoVO
(
fundInfo
Map
,
rateMappingMap
,
p
,
null
,
productType
))
return
fund
Infos
.
stream
().
map
(
p
->
getProductInfoVO
(
fundCount
Map
,
rateMappingMap
,
p
,
null
,
productType
))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
...
@@ -1180,11 +1182,13 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -1180,11 +1182,13 @@ public class ProductServiceImpl implements ProductService, Constant {
// return fundInfoCustomMapper.getFundInfoReport(ids);
// return fundInfoCustomMapper.getFundInfoReport(ids);
// }
// }
private
ProductInfoVO
getProductInfoVO
(
Map
<
String
,
FundInfo
>
fund
Info
Map
,
Map
<
String
,
FundRateMapping
>
rateMappingMap
,
private
ProductInfoVO
getProductInfoVO
(
Map
<
String
,
FundInfo
>
fund
Count
Map
,
Map
<
String
,
FundRateMapping
>
rateMappingMap
,
Fund
Count
fundCount
,
Fund
Info
fundInfo
,
Set
<
String
>
fundInfoReports
,
Integer
productType
)
{
Set
<
String
>
fundInfoReports
,
Integer
productType
)
{
ProductInfoVO
vo
=
new
ProductInfoVO
();
ProductInfoVO
vo
=
new
ProductInfoVO
();
BeanUtils
.
copyProperties
(
fundCount
,
vo
);
if
(
fundCountMap
.
containsKey
(
fundInfo
.
getId
()))
{
BeanUtils
.
copyProperties
(
fundCount
,
vo
);
}
vo
.
setProductType
(
productType
);
vo
.
setProductType
(
productType
);
vo
.
setRet1m
(
multiply100
(
fundCount
.
getRet1m
()));
vo
.
setRet1m
(
multiply100
(
fundCount
.
getRet1m
()));
vo
.
setRet1y
(
multiply100
(
fundCount
.
getRet1y
()));
vo
.
setRet1y
(
multiply100
(
fundCount
.
getRet1y
()));
...
...
src/main/resources/application-dev.properties
View file @
4bc264b8
...
@@ -10,9 +10,9 @@ management.endpoints.web.base-path = /myhealth
...
@@ -10,9 +10,9 @@ management.endpoints.web.base-path = /myhealth
management.endpoint.health.enabled
=
true
management.endpoint.health.enabled
=
true
management.endpoint.health.show-details
=
always
management.endpoint.health.show-details
=
always
spring.datasource.url
=
jdbc:mysql://
47.101.189.151:31931
/tamp_fund?autoReconnect=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false
spring.datasource.url
=
jdbc:mysql://
tamper.mysql.polardb.rds.aliyuncs.com:3306
/tamp_fund?autoReconnect=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false
spring.datasource.username
=
dev
spring.datasource.username
=
tamp
spring.datasource.password
=
q
imeng123
spring.datasource.password
=
@
imeng123
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
company.oss.prefix
=
https://tamp-pro.oss-cn-shanghai.aliyuncs.com/
company.oss.prefix
=
https://tamp-pro.oss-cn-shanghai.aliyuncs.com/
...
...
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