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
88db936d
Commit
88db936d
authored
Feb 24, 2021
by
张亚辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基金详情
parent
e20f4ccd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
201 additions
and
29 deletions
+201
-29
ProductApi.java
src/main/java/com/tanpu/fund/api/ProductApi.java
+12
-0
ProductController.java
...ain/java/com/tanpu/fund/controller/ProductController.java
+18
-0
FeignClientForPublicfund.java
...tanpu/fund/feign/publicfund/FeignClientForPublicfund.java
+25
-0
FeignbackForPublicfund.java
...m/tanpu/fund/feign/publicfund/FeignbackForPublicfund.java
+35
-0
ProductCommonService.java
...ain/java/com/tanpu/fund/service/ProductCommonService.java
+3
-1
ProductService.java
src/main/java/com/tanpu/fund/service/ProductService.java
+2
-0
ProductCommonServiceImpl.java
...com/tanpu/fund/service/impl/ProductCommonServiceImpl.java
+11
-4
ProductServiceImpl.java
.../java/com/tanpu/fund/service/impl/ProductServiceImpl.java
+95
-24
No files found.
src/main/java/com/tanpu/fund/api/ProductApi.java
View file @
88db936d
...
...
@@ -65,6 +65,10 @@ public interface ProductApi {
@GetMapping
(
"/track/record"
)
CommonResp
<
List
<
TrackRecordVO
>>
getTrackRecordInfo
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"id"
)
String
id
);
@ApiOperation
(
"历史业绩 对比指数"
)
@GetMapping
(
"/track/recor/index"
)
CommonResp
<
List
<
TrackRecordVO
>>
getTrackRecordInfoIndex
(
@ApiParam
(
"对比指数ID"
)
@RequestParam
(
"indexId"
)
String
indexId
);
@ApiOperation
(
"历史净值"
)
@GetMapping
(
"/track/net"
)
CommonResp
<
Page
<
TrackNetVO
>>
getTrackNetListInfo
(
@ApiParam
(
"产品id"
)
@RequestParam
(
"id"
)
String
id
,
@ApiParam
(
"分页对象"
)
Pageable
page
);
...
...
@@ -124,4 +128,12 @@ public interface ProductApi {
@ApiOperation
(
value
=
"根据Id查询私有产品基本信息"
)
@PostMapping
(
value
=
"/privateFundInfo/simpleList"
,
produces
=
{
"application/json"
})
CommonResp
<
List
<
FundInfoSimpleListResp
>>
privateSimpleList
(
@RequestBody
List
<
String
>
idList
);
@ApiOperation
(
"对比指数"
)
@GetMapping
(
"/fund/indexes"
)
CommonResp
<
List
<
FundIndexBasicResp
>>
fundIndexes
();
@ApiOperation
(
"查询同类基金"
)
@GetMapping
(
"/query/samefund"
)
CommonResp
<
List
<
FundSameResp
>>
querySamefund
(
@RequestParam
(
"fundId"
)
String
fundId
);
}
src/main/java/com/tanpu/fund/controller/ProductController.java
View file @
88db936d
...
...
@@ -8,6 +8,7 @@ import com.tanpu.common.model.product.req.ProductListReq;
import
com.tanpu.common.model.product.resp.*
;
import
com.tanpu.common.resp.CommonResp
;
import
com.tanpu.fund.api.ProductApi
;
import
com.tanpu.fund.feign.publicfund.FeignClientForPublicfund
;
import
com.tanpu.fund.service.ProductService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -22,6 +23,8 @@ public class ProductController implements ProductApi {
@Resource
private
ProductService
productService
;
@Resource
private
FeignClientForPublicfund
feignClientForPublicfund
;
@Override
public
CommonResp
<
Page
<
ProductInfoVO
>>
getProductInfo
(
ProductInfoReq
req
)
{
...
...
@@ -68,6 +71,11 @@ public class ProductController implements ProductApi {
return
CommonResp
.
success
(
this
.
productService
.
getTrackRecord
(
id
));
}
@Override
public
CommonResp
<
List
<
TrackRecordVO
>>
getTrackRecordInfoIndex
(
String
indexId
)
{
return
feignClientForPublicfund
.
getTrackRecordInfoIndex
(
indexId
);
}
@Override
public
CommonResp
<
Page
<
TrackNetVO
>>
getTrackNetListInfo
(
String
id
,
Pageable
page
)
{
return
CommonResp
.
success
(
this
.
productService
.
getTrackNetList
(
id
,
page
));
...
...
@@ -156,4 +164,14 @@ public class ProductController implements ProductApi {
public
CommonResp
<
List
<
FundInfoSimpleListResp
>>
privateSimpleList
(
List
<
String
>
idList
)
{
return
CommonResp
.
success
(
productService
.
getPrivateSimpleList
(
idList
));
}
@Override
public
CommonResp
<
List
<
FundIndexBasicResp
>>
fundIndexes
()
{
return
feignClientForPublicfund
.
fundIndexes
();
}
@Override
public
CommonResp
<
List
<
FundSameResp
>>
querySamefund
(
String
fundId
)
{
return
CommonResp
.
success
(
this
.
productService
.
querySamefund
(
fundId
));
}
}
src/main/java/com/tanpu/fund/feign/publicfund/FeignClientForPublicfund.java
0 → 100644
View file @
88db936d
package
com
.
tanpu
.
fund
.
feign
.
publicfund
;
import
com.tanpu.common.model.product.resp.FundIndexBasicResp
;
import
com.tanpu.common.model.product.resp.TrackRecordVO
;
import
com.tanpu.common.resp.CommonResp
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
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-public-fund"
,
fallbackFactory
=
FeignbackForPublicfund
.
class
,
path
=
"/fundpublic"
)
public
interface
FeignClientForPublicfund
{
@ApiOperation
(
"对比指数"
)
@GetMapping
(
"/fund/indexes"
)
CommonResp
<
List
<
FundIndexBasicResp
>>
fundIndexes
();
@ApiOperation
(
"历史业绩 对比指数"
)
@GetMapping
(
"/track/recor/index"
)
CommonResp
<
List
<
TrackRecordVO
>>
getTrackRecordInfoIndex
(
@ApiParam
(
"对比指数ID"
)
@RequestParam
(
"indexId"
)
String
indexId
);
}
src/main/java/com/tanpu/fund/feign/publicfund/FeignbackForPublicfund.java
0 → 100644
View file @
88db936d
package
com
.
tanpu
.
fund
.
feign
.
publicfund
;
import
com.tanpu.common.model.product.resp.FundIndexBasicResp
;
import
com.tanpu.common.model.product.resp.TrackRecordVO
;
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
FeignbackForPublicfund
implements
FallbackFactory
<
FeignClientForPublicfund
>
{
@Override
public
FeignClientForPublicfund
create
(
Throwable
throwable
)
{
return
new
FeignClientForPublicfund
()
{
@Override
public
CommonResp
<
List
<
FundIndexBasicResp
>>
fundIndexes
()
{
log
.
error
(
"请求信息"
,
throwable
);
log
.
error
(
"FeignClientForPublicfund.fundIndexes 查询指数失败"
);
return
null
;
}
@Override
public
CommonResp
<
List
<
TrackRecordVO
>>
getTrackRecordInfoIndex
(
String
indexId
)
{
log
.
error
(
"请求信息"
,
throwable
);
log
.
error
(
"FeignClientForPublicfund.getTrackRecordInfoIndex 历史业绩 对比指数:{}"
,
indexId
);
return
null
;
}
};
}
}
src/main/java/com/tanpu/fund/service/ProductCommonService.java
View file @
88db936d
...
...
@@ -4,6 +4,8 @@ import com.tanpu.fund.entity.generator.FundCompanyInfo;
import
com.tanpu.fund.entity.generator.FundCount
;
import
com.tanpu.fund.entity.generator.FundPersonnelInfo
;
import
java.util.List
;
/**
* @author: zyh
*/
...
...
@@ -13,5 +15,5 @@ public interface ProductCommonService {
FundCompanyInfo
getFundCompanyInfo
(
String
companyId
);
FundPersonnelInfo
getFundManager
(
String
fundId
);
List
<
FundPersonnelInfo
>
getFundManager
(
String
fundId
);
}
src/main/java/com/tanpu/fund/service/ProductService.java
View file @
88db936d
...
...
@@ -64,4 +64,6 @@ public interface ProductService {
List
<
FundInfoSimpleListResp
>
getSimpleList
(
List
<
String
>
idList
);
List
<
FundInfoSimpleListResp
>
getPrivateSimpleList
(
List
<
String
>
idList
);
List
<
FundSameResp
>
querySamefund
(
String
fundId
);
}
src/main/java/com/tanpu/fund/service/impl/ProductCommonServiceImpl.java
View file @
88db936d
...
...
@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @author: zyh
...
...
@@ -59,7 +60,7 @@ public class ProductCommonServiceImpl implements ProductCommonService {
}
@Override
public
FundPersonnelInfo
getFundManager
(
String
fundId
)
{
public
List
<
FundPersonnelInfo
>
getFundManager
(
String
fundId
)
{
if
(
StringUtils
.
isEmpty
(
fundId
))
{
return
null
;
}
...
...
@@ -67,9 +68,15 @@ public class ProductCommonServiceImpl implements ProductCommonService {
FundManagerMappingExample
example
=
new
FundManagerMappingExample
();
example
.
createCriteria
().
andFundIdEqualTo
(
fundId
);
List
<
FundManagerMapping
>
fundManagerMappings
=
fundManagerMappingMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isNotEmpty
(
fundManagerMappings
)
&&
StringUtils
.
isNotEmpty
(
fundManagerMappings
.
get
(
0
).
getFundManagerId
()))
{
return
fundPersonnelInfoMapper
.
selectByPrimaryKey
(
fundManagerMappings
.
get
(
0
).
getFundManagerId
());
if
(
CollectionUtils
.
isNotEmpty
(
fundManagerMappings
))
{
List
<
String
>
list
=
fundManagerMappings
.
stream
().
filter
(
item
->
StringUtils
.
isNotEmpty
(
item
.
getFundManagerId
()))
.
map
(
FundManagerMapping:
:
getFundManagerId
).
collect
(
Collectors
.
toList
());
FundPersonnelInfoExample
fundPersonnelInfoExample
=
new
FundPersonnelInfoExample
();
fundPersonnelInfoExample
.
createCriteria
().
andPersonnelIdIn
(
list
);
return
fundPersonnelInfoMapper
.
selectByExample
(
fundPersonnelInfoExample
);
}
return
null
;
}
...
...
src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
View file @
88db936d
This diff is collapsed.
Click to expand it.
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