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
c7107fb7
Commit
c7107fb7
authored
Mar 18, 2021
by
zp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
私募排行
parent
78cc6a16
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
315 additions
and
3 deletions
+315
-3
.factorypath
.factorypath
+14
-2
ProductApi.java
src/main/java/com/tanpu/fund/api/ProductApi.java
+10
-0
ProductController.java
...ain/java/com/tanpu/fund/controller/ProductController.java
+12
-0
FeignForProduct.java
...in/java/com/tanpu/fund/feign/product/FeignForProduct.java
+20
-0
FeignbackForProduct.java
...ava/com/tanpu/fund/feign/product/FeignbackForProduct.java
+28
-0
ProductService.java
src/main/java/com/tanpu/fund/service/ProductService.java
+6
-0
ProductServiceImpl.java
.../java/com/tanpu/fund/service/impl/ProductServiceImpl.java
+225
-1
No files found.
.factorypath
View file @
c7107fb7
...
@@ -118,7 +118,6 @@
...
@@ -118,7 +118,6 @@
<factorypathentry kind="VARJAR" id="M2_REPO/io/reactivex/rxnetty/0.4.9/rxnetty-0.4.9.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/reactivex/rxnetty/0.4.9/rxnetty-0.4.9.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/netflix/ribbon/ribbon-core/2.3.0/ribbon-core-2.3.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/netflix/ribbon/ribbon-core/2.3.0/ribbon-core-2.3.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/netflix/ribbon/ribbon-httpclient/2.3.0/ribbon-httpclient-2.3.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/netflix/ribbon/ribbon-httpclient/2.3.0/ribbon-httpclient-2.3.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/sun/jersey/jersey-client/1.19.1/jersey-client-1.19.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/sun/jersey/jersey-client/1.19.1/jersey-client-1.19.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/sun/jersey/jersey-core/1.19.1/jersey-core-1.19.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/sun/jersey/jersey-core/1.19.1/jersey-core-1.19.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar" enabled="true" runInBatchMode="false"/>
...
@@ -188,8 +187,21 @@
...
@@ -188,8 +187,21 @@
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/curator/curator-recipes/2.10.0/curator-recipes-2.10.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/curator/curator-recipes/2.10.0/curator-recipes-2.10.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/codehaus/janino/janino/3.0.6/janino-3.0.6.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/codehaus/janino/janino/3.0.6/janino-3.0.6.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/codehaus/janino/commons-compiler/3.0.6/commons-compiler-3.0.6.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/codehaus/janino/commons-compiler/3.0.6/commons-compiler-3.0.6.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/commons/commons-collections4/4.0/commons-collections4-4.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/cn/hutool/hutool-all/5.3.9/hutool-all-5.3.9.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/cn/hutool/hutool-all/5.3.9/hutool-all-5.3.9.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/poi/poi-ooxml/4.1.2/poi-ooxml-4.1.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/poi/poi/4.1.2/poi-4.1.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/commons/commons-collections4/4.4/commons-collections4-4.4.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/zaxxer/SparseBitSet/1.2/SparseBitSet-1.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/poi/poi-ooxml-schemas/4.1.2/poi-ooxml-schemas-4.1.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/xmlbeans/xmlbeans/3.1.0/xmlbeans-3.1.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/commons/commons-compress/1.19/commons-compress-1.19.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/github/virtuald/curvesapi/1.06/curvesapi-1.06.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/commons-validator/commons-validator/1.7/commons-validator-1.7.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/commons-beanutils/commons-beanutils/1.9.4/commons-beanutils-1.9.4.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/commons-digester/commons-digester/2.1/commons-digester-2.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/commons-logging/commons-logging/1.2/commons-logging-1.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/projectlombok/lombok/1.18.8/lombok-1.18.8.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/projectlombok/lombok/1.18.8/lombok-1.18.8.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-starter-hystrix/1.3.5.RELEASE/spring-cloud-starter-hystrix-1.3.5.RELEASE.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-starter-hystrix/1.3.5.RELEASE/spring-cloud-starter-hystrix-1.3.5.RELEASE.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-netflix-core/2.1.2.RELEASE/spring-cloud-netflix-core-2.1.2.RELEASE.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/cloud/spring-cloud-netflix-core/2.1.2.RELEASE/spring-cloud-netflix-core-2.1.2.RELEASE.jar" enabled="true" runInBatchMode="false"/>
...
...
src/main/java/com/tanpu/fund/api/ProductApi.java
View file @
c7107fb7
...
@@ -3,6 +3,8 @@ package com.tanpu.fund.api;
...
@@ -3,6 +3,8 @@ package com.tanpu.fund.api;
import
com.tanpu.common.model.Page
;
import
com.tanpu.common.model.Page
;
import
com.tanpu.common.model.Pageable
;
import
com.tanpu.common.model.Pageable
;
import
com.tanpu.common.model.adm.req.IfaNetImportReq
;
import
com.tanpu.common.model.adm.req.IfaNetImportReq
;
import
com.tanpu.common.model.fund.req.FundRankReq
;
import
com.tanpu.common.model.fund.resq.FundRankResp
;
import
com.tanpu.common.model.privatefund.resp.FundNavMessage
;
import
com.tanpu.common.model.privatefund.resp.FundNavMessage
;
import
com.tanpu.common.model.product.req.NetReq
;
import
com.tanpu.common.model.product.req.NetReq
;
import
com.tanpu.common.model.product.req.ProductInfoReq
;
import
com.tanpu.common.model.product.req.ProductInfoReq
;
...
@@ -173,4 +175,12 @@ public interface ProductApi {
...
@@ -173,4 +175,12 @@ public interface ProductApi {
@ApiOperation
(
"理财师净值导入"
)
@ApiOperation
(
"理财师净值导入"
)
@PostMapping
(
"/ifa/net/import/check/save"
)
@PostMapping
(
"/ifa/net/import/check/save"
)
CommonResp
<
List
<
FundNavMessage
>>
importNetCheckSaveInfo
(
@RequestBody
@Valid
@NotEmpty
(
message
=
"请确定需要修改的信息"
)
IfaNetImportReq
req
);
CommonResp
<
List
<
FundNavMessage
>>
importNetCheckSaveInfo
(
@RequestBody
@Valid
@NotEmpty
(
message
=
"请确定需要修改的信息"
)
IfaNetImportReq
req
);
@ApiOperation
(
"私募排行"
)
@PostMapping
(
"/private/rank"
)
CommonResp
<
Page
<
FundRankResp
>>
getFundRankInfo
(
@RequestBody
FundRankReq
req
);
@ApiOperation
(
"私募排行统计"
)
@PostMapping
(
"/private/rank/count"
)
CommonResp
<
Long
>
getFundRankCountInfo
(
@RequestBody
FundRankReq
req
);
}
}
src/main/java/com/tanpu/fund/controller/ProductController.java
View file @
c7107fb7
...
@@ -4,6 +4,8 @@ import com.tanpu.common.auth.mapping.TanpuInterfaceLoginAuth;
...
@@ -4,6 +4,8 @@ import com.tanpu.common.auth.mapping.TanpuInterfaceLoginAuth;
import
com.tanpu.common.model.Page
;
import
com.tanpu.common.model.Page
;
import
com.tanpu.common.model.Pageable
;
import
com.tanpu.common.model.Pageable
;
import
com.tanpu.common.model.adm.req.IfaNetImportReq
;
import
com.tanpu.common.model.adm.req.IfaNetImportReq
;
import
com.tanpu.common.model.fund.req.FundRankReq
;
import
com.tanpu.common.model.fund.resq.FundRankResp
;
import
com.tanpu.common.model.privatefund.resp.FundNavMessage
;
import
com.tanpu.common.model.privatefund.resp.FundNavMessage
;
import
com.tanpu.common.model.product.req.NetReq
;
import
com.tanpu.common.model.product.req.NetReq
;
import
com.tanpu.common.model.product.req.ProductInfoReq
;
import
com.tanpu.common.model.product.req.ProductInfoReq
;
...
@@ -221,4 +223,14 @@ public class ProductController implements ProductApi {
...
@@ -221,4 +223,14 @@ public class ProductController implements ProductApi {
public
CommonResp
<
List
<
FundNavMessage
>>
importNetCheckSaveInfo
(
IfaNetImportReq
req
)
{
public
CommonResp
<
List
<
FundNavMessage
>>
importNetCheckSaveInfo
(
IfaNetImportReq
req
)
{
return
this
.
productService
.
importNetCheckSave
(
req
);
return
this
.
productService
.
importNetCheckSave
(
req
);
}
}
@Override
public
CommonResp
<
Page
<
FundRankResp
>>
getFundRankInfo
(
FundRankReq
req
)
{
return
null
;
}
@Override
public
CommonResp
<
Long
>
getFundRankCountInfo
(
FundRankReq
req
)
{
return
null
;
}
}
}
src/main/java/com/tanpu/fund/feign/product/FeignForProduct.java
0 → 100644
View file @
c7107fb7
package
com
.
tanpu
.
fund
.
feign
.
product
;
import
com.tanpu.common.model.tanpuroom.Type
;
import
com.tanpu.common.resp.CommonResp
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
//@FeignClient(value = "service-product", url = "http://127.0.0.1:8194/product")
@FeignClient
(
value
=
"service-product"
,
path
=
"/product"
)
public
interface
FeignForProduct
{
@ApiOperation
(
"获取私募产品列表(只返回产品名称)"
)
@GetMapping
(
"/get/fund/info/simple"
)
CommonResp
<
List
<
Type
>>
getSimpleFundList
(
@RequestParam
(
"list"
)
List
<
String
>
list
);
}
src/main/java/com/tanpu/fund/feign/product/FeignbackForProduct.java
0 → 100644
View file @
c7107fb7
package
com
.
tanpu
.
fund
.
feign
.
product
;
import
com.alibaba.fastjson.JSON
;
import
com.tanpu.common.model.tanpuroom.Type
;
import
com.tanpu.common.resp.CommonResp
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Slf4j
@Component
public
class
FeignbackForProduct
implements
FallbackFactory
<
FeignForProduct
>
{
@Override
public
FeignForProduct
create
(
Throwable
throwable
)
{
return
new
FeignForProduct
()
{
@Override
public
CommonResp
<
List
<
Type
>>
getSimpleFundList
(
List
<
String
>
list
)
{
log
.
error
(
"FeignClientForFund.getSimpleFundList 获取私募产品列表(只返回产品名称参数: {}"
,
JSON
.
toJSONString
(
list
));
log
.
error
(
"FeignClientForFund.getSimpleFundList 获取私募产品列表(只返回产品名称异常"
,
throwable
);
return
CommonResp
.
error
(
"基金信息查询异常"
);
}
};
}
}
src/main/java/com/tanpu/fund/service/ProductService.java
View file @
c7107fb7
...
@@ -3,6 +3,8 @@ package com.tanpu.fund.service;
...
@@ -3,6 +3,8 @@ package com.tanpu.fund.service;
import
com.tanpu.common.model.Page
;
import
com.tanpu.common.model.Page
;
import
com.tanpu.common.model.Pageable
;
import
com.tanpu.common.model.Pageable
;
import
com.tanpu.common.model.adm.req.IfaNetImportReq
;
import
com.tanpu.common.model.adm.req.IfaNetImportReq
;
import
com.tanpu.common.model.fund.req.FundRankReq
;
import
com.tanpu.common.model.fund.resq.FundRankResp
;
import
com.tanpu.common.model.privatefund.resp.FundNavMessage
;
import
com.tanpu.common.model.privatefund.resp.FundNavMessage
;
import
com.tanpu.common.model.product.req.ProductListReq
;
import
com.tanpu.common.model.product.req.ProductListReq
;
import
com.tanpu.common.model.product.resp.DynamicRetreatVO
;
import
com.tanpu.common.model.product.resp.DynamicRetreatVO
;
...
@@ -79,4 +81,8 @@ public interface ProductService {
...
@@ -79,4 +81,8 @@ public interface ProductService {
List
<
Type
>
getSimpleFundList
(
List
<
String
>
list
);
List
<
Type
>
getSimpleFundList
(
List
<
String
>
list
);
CommonResp
<
List
<
FundNavMessage
>>
importNetCheckSave
(
IfaNetImportReq
req
);
CommonResp
<
List
<
FundNavMessage
>>
importNetCheckSave
(
IfaNetImportReq
req
);
Page
<
FundRankResp
>
getFundRank
(
FundRankReq
req
);
Long
getFundRankCountInfo
(
FundRankReq
req
);
}
}
src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
View file @
c7107fb7
package
com
.
tanpu
.
fund
.
service
.
impl
;
package
com
.
tanpu
.
fund
.
service
.
impl
;
import
com.tanpu.common.model.product.resp.Net
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.NumberUtil
;
import
cn.hutool.core.util.NumberUtil
;
...
@@ -7,6 +9,7 @@ import cn.hutool.poi.excel.ExcelReader;
...
@@ -7,6 +9,7 @@ import cn.hutool.poi.excel.ExcelReader;
import
cn.hutool.poi.excel.ExcelUtil
;
import
cn.hutool.poi.excel.ExcelUtil
;
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.google.common.collect.Sets
;
import
com.tanpu.common.auth.UserInfoThreadLocalHolder
;
import
com.tanpu.common.auth.UserInfoThreadLocalHolder
;
import
com.tanpu.common.enums.BizEnums
;
import
com.tanpu.common.enums.BizEnums
;
import
com.tanpu.common.enums.Constant
;
import
com.tanpu.common.enums.Constant
;
...
@@ -15,6 +18,8 @@ import com.tanpu.common.enums.product.ProductEnums;
...
@@ -15,6 +18,8 @@ import com.tanpu.common.enums.product.ProductEnums;
import
com.tanpu.common.model.Page
;
import
com.tanpu.common.model.Page
;
import
com.tanpu.common.model.Pageable
;
import
com.tanpu.common.model.Pageable
;
import
com.tanpu.common.model.adm.req.IfaNetImportReq
;
import
com.tanpu.common.model.adm.req.IfaNetImportReq
;
import
com.tanpu.common.model.fund.req.FundRankReq
;
import
com.tanpu.common.model.fund.resq.FundRankResp
;
import
com.tanpu.common.model.privatefund.resp.FundNavMessage
;
import
com.tanpu.common.model.privatefund.resp.FundNavMessage
;
import
com.tanpu.common.model.product.FundInfoVO
;
import
com.tanpu.common.model.product.FundInfoVO
;
import
com.tanpu.common.model.product.req.NetReq
;
import
com.tanpu.common.model.product.req.NetReq
;
...
@@ -28,6 +33,7 @@ import com.tanpu.common.utils.BigDecimalUtil;
...
@@ -28,6 +33,7 @@ import com.tanpu.common.utils.BigDecimalUtil;
import
com.tanpu.fund.entity.generator.*
;
import
com.tanpu.fund.entity.generator.*
;
import
com.tanpu.fund.enums.FilterTypeEnum
;
import
com.tanpu.fund.enums.FilterTypeEnum
;
import
com.tanpu.fund.feign.diagnose.FeignClientForDiagnose
;
import
com.tanpu.fund.feign.diagnose.FeignClientForDiagnose
;
import
com.tanpu.fund.feign.product.FeignForProduct
;
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
;
...
@@ -115,6 +121,9 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -115,6 +121,9 @@ public class ProductServiceImpl implements ProductService, Constant {
@Resource
@Resource
private
FeignClientForDiagnose
feignClientForDiagnose
;
private
FeignClientForDiagnose
feignClientForDiagnose
;
@Resource
private
FeignForProduct
product
;
@Override
@Override
public
Page
<
ProductInfoVO
>
getProductList
(
ProductInfoReq
req
)
{
public
Page
<
ProductInfoVO
>
getProductList
(
ProductInfoReq
req
)
{
...
@@ -1690,7 +1699,222 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -1690,7 +1699,222 @@ public class ProductServiceImpl implements ProductService, Constant {
return
getListCommonResp
(
ifaNavMap
,
resultMessage
,
errorStatus
,
read
);
return
getListCommonResp
(
ifaNavMap
,
resultMessage
,
errorStatus
,
read
);
}
}
@NotNull
@Override
public
Page
<
FundRankResp
>
getFundRank
(
FundRankReq
req
)
{
FundCountExample
example
=
filterFundCountReq
(
req
);
Pageable
pageable
=
new
Pageable
(
req
.
getPageNumber
(),
req
.
getPageSize
());
com
.
github
.
pagehelper
.
Page
<
Object
>
objects
=
PageMethod
.
startPage
(
pageable
);
List
<
FundCount
>
fundCounts
=
this
.
fundCountMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isEmpty
(
fundCounts
))
{
return
new
Page
<>(
pageable
,
new
ArrayList
<>(
0
));
}
FundInfoExample
example1
=
new
FundInfoExample
();
List
<
String
>
ids
=
fundCounts
.
stream
()
.
map
(
FundCount:
:
getFundId
)
.
collect
(
Collectors
.
toList
());
example1
.
createCriteria
().
andIdIn
(
ids
);
Map
<
String
,
String
>
fundNameMap
=
this
.
fundInfoMapper
.
selectByExample
(
example1
)
.
stream
()
.
collect
(
Collectors
.
toMap
(
FundInfo:
:
getId
,
FundInfo:
:
getFundShortName
));
Set
<
String
>
fundSets
=
product
.
getSimpleFundList
(
ids
)
.
getAttributes
()
.
stream
()
.
map
(
Type:
:
getId
)
.
collect
(
Collectors
.
toSet
());
return
new
Page
<>(
pageable
,
objects
.
getTotal
(),
fundCounts
.
stream
()
.
map
(
ls
->
{
FundRankResp
resp
=
new
FundRankResp
();
String
fundId
=
ls
.
getFundId
();
resp
.
setProductName
(
Type
.
builder
().
id
(
fundId
).
value
(
fundNameMap
.
get
(
fundId
)).
build
());
boolean
productType
=
true
;
if
(
fundSets
.
contains
(
fundId
))
{
productType
=
false
;
}
resp
.
setProductType
(
Type
.
builder
().
id
(
productType
?
"1"
:
"2"
).
value
(
productType
?
"私募基金"
:
"探普白名单"
).
build
());
if
(
ls
.
getEndDate
()
!=
null
)
{
resp
.
setNet
(
Net
.
builder
().
netValue
(
BigDecimalUtil
.
toString
(
ls
.
getNetNav
(),
4
)).
netDate
(
ls
.
getEndDate
().
getTime
()).
build
());
}
if
(
req
.
getRank
()
==
null
)
{
resp
.
setRangeOfIncrease
(
BigDecimalUtil
.
multiply100
(
ls
.
getRet1y
()));
}
else
{
switch
(
req
.
getRank
())
{
case
"day"
:
resp
.
setRangeOfIncrease
(
BigDecimalUtil
.
multiply100
(
ls
.
getRet1day
()));
break
;
case
"week"
:
resp
.
setRangeOfIncrease
(
BigDecimalUtil
.
multiply100
(
ls
.
getRet1w
()));
break
;
case
"month"
:
resp
.
setRangeOfIncrease
(
BigDecimalUtil
.
multiply100
(
ls
.
getRet1m
()));
break
;
case
"season"
:
resp
.
setRangeOfIncrease
(
BigDecimalUtil
.
multiply100
(
ls
.
getRet3m
()));
break
;
case
"halfAYear"
:
resp
.
setRangeOfIncrease
(
BigDecimalUtil
.
multiply100
(
ls
.
getRet6m
()));
break
;
case
"year"
:
resp
.
setRangeOfIncrease
(
BigDecimalUtil
.
multiply100
(
ls
.
getRet1y
()));
break
;
case
"twoYear"
:
resp
.
setRangeOfIncrease
(
BigDecimalUtil
.
multiply100
(
ls
.
getRet2y
()));
break
;
case
"threeYear"
:
resp
.
setRangeOfIncrease
(
BigDecimalUtil
.
multiply100
(
ls
.
getRet3y
()));
break
;
case
"fiveYear"
:
resp
.
setRangeOfIncrease
(
BigDecimalUtil
.
multiply100
(
ls
.
getRet5y
()));
break
;
case
"retIncep"
:
resp
.
setRangeOfIncrease
(
BigDecimalUtil
.
multiply100
(
ls
.
getRetIncep
()));
break
;
}
}
return
resp
;
}).
collect
(
Collectors
.
toList
()));
}
private
FundCountExample
filterFundCountReq
(
FundRankReq
req
)
{
FundCountExample
example
=
new
FundCountExample
();
FundCountExample
.
Criteria
criteria
=
example
.
createCriteria
();
if
(
req
==
null
)
{
example
.
setOrderByClause
(
"ret_1y desc"
);
}
else
{
if
(
CollectionUtils
.
isNotEmpty
(
req
.
getStrategys
()))
{
criteria
.
andSubstrategyIn
(
req
.
getStrategys
()
.
stream
()
.
map
(
Integer:
:
valueOf
)
.
collect
(
Collectors
.
toList
()));
}
if
(
req
.
getRet1y
()
!=
null
)
{
criteria
.
andRet1yBm1Between
(
new
BigDecimal
(
req
.
getRet1y
().
getBegin
()),
new
BigDecimal
(
req
.
getRet1y
().
getEnd
()));
}
if
(
req
.
getMaxdrawdown1y
()
!=
null
)
{
criteria
.
andMaxdrawdown1yBetween
(
new
BigDecimal
(
req
.
getMaxdrawdown1y
().
getBegin
()),
new
BigDecimal
(
req
.
getMaxdrawdown1y
().
getEnd
()));
}
if
(
req
.
getStddev1y
()
!=
null
)
{
criteria
.
andStddev1yBetween
(
new
BigDecimal
(
req
.
getStddev1y
().
getBegin
()),
new
BigDecimal
(
req
.
getStddev1y
().
getEnd
()));
}
if
(
req
.
getSharperatio1y
()
!=
null
)
{
criteria
.
andSharperatio1yBetween
(
new
BigDecimal
(
req
.
getSharperatio1y
().
getBegin
()),
new
BigDecimal
(
req
.
getSharperatio1y
().
getEnd
()));
}
if
(
StringUtils
.
isNotEmpty
(
req
.
getRank
()))
{
String
sort
=
null
;
switch
(
req
.
getRank
())
{
case
"day"
:
sort
=
"ret_1day "
;
if
(
StringUtils
.
isNotEmpty
(
req
.
getRankSort
()))
{
sort
=
sort
+
req
.
getNetSort
();
}
else
{
sort
=
sort
+
"desc,"
;
}
break
;
case
"week"
:
sort
=
"ret_1w "
;
if
(
StringUtils
.
isNotEmpty
(
req
.
getRankSort
()))
{
sort
=
sort
+
req
.
getNetSort
();
}
else
{
sort
=
sort
+
"desc,"
;
}
break
;
case
"month"
:
sort
=
"ret_1m "
;
if
(
StringUtils
.
isNotEmpty
(
req
.
getRankSort
()))
{
sort
=
sort
+
req
.
getNetSort
();
}
else
{
sort
=
sort
+
"desc,"
;
}
break
;
case
"season"
:
sort
=
"ret_3m "
;
if
(
StringUtils
.
isNotEmpty
(
req
.
getRankSort
()))
{
sort
=
sort
+
req
.
getNetSort
();
}
else
{
sort
=
sort
+
"desc,"
;
}
break
;
case
"halfAYear"
:
sort
=
"ret_6m "
;
if
(
StringUtils
.
isNotEmpty
(
req
.
getRankSort
()))
{
sort
=
sort
+
req
.
getNetSort
();
}
else
{
sort
=
sort
+
"desc,"
;
}
break
;
case
"year"
:
sort
=
"ret_1y "
;
if
(
StringUtils
.
isNotEmpty
(
req
.
getRankSort
()))
{
sort
=
sort
+
req
.
getNetSort
();
}
else
{
sort
=
sort
+
"desc,"
;
}
break
;
case
"twoYear"
:
sort
=
"ret_2y "
;
if
(
StringUtils
.
isNotEmpty
(
req
.
getRankSort
()))
{
sort
=
sort
+
req
.
getNetSort
();
}
else
{
sort
=
sort
+
"desc,"
;
}
break
;
case
"threeYear"
:
sort
=
"ret_3y "
;
if
(
StringUtils
.
isNotEmpty
(
req
.
getRankSort
()))
{
sort
=
sort
+
req
.
getNetSort
();
}
else
{
sort
=
sort
+
"desc,"
;
}
break
;
case
"fiveYear"
:
sort
=
"ret_5y "
;
if
(
StringUtils
.
isNotEmpty
(
req
.
getRankSort
()))
{
sort
=
sort
+
req
.
getNetSort
();
}
else
{
sort
=
sort
+
"desc,"
;
}
break
;
case
"retIncep"
:
sort
=
"ret_incep "
;
if
(
StringUtils
.
isNotEmpty
(
req
.
getRankSort
()))
{
sort
=
sort
+
req
.
getNetSort
();
}
else
{
sort
=
sort
+
"desc,"
;
}
break
;
}
sort
=
sort
+
"net_nav "
;
if
(
StringUtils
.
isNotEmpty
(
req
.
getNetSort
()))
{
sort
=
sort
+
req
.
getNetSort
();
}
else
{
sort
=
sort
+
"desc"
;
}
example
.
setOrderByClause
(
sort
);
}
else
{
example
.
setOrderByClause
(
"ret_1y desc"
);
}
}
criteria
.
andDeleteTagEqualTo
(
0
);
return
example
;
}
@Override
public
Long
getFundRankCountInfo
(
FundRankReq
req
)
{
FundCountExample
example
=
filterFundCountReq
(
req
);
return
this
.
fundCountMapper
.
countByExample
(
example
);
}
private
CommonResp
<
List
<
FundNavMessage
>>
getListCommonResp
(
Map
<
Long
,
IfaImportedFundNav
>
ifaNavMap
,
private
CommonResp
<
List
<
FundNavMessage
>>
getListCommonResp
(
Map
<
Long
,
IfaImportedFundNav
>
ifaNavMap
,
List
<
FundNavMessage
>
resultMessage
,
List
<
FundNavMessage
>
resultMessage
,
AtomicBoolean
errorStatus
,
AtomicBoolean
errorStatus
,
...
...
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