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
4ee1acf9
Commit
4ee1acf9
authored
4 years ago
by
张亚辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基金详情
parent
95fa0f41
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
3 deletions
+62
-3
FeignClientForDiagnose.java
...com/tanpu/fund/feign/diagnose/FeignClientForDiagnose.java
+20
-0
FeignbackForDiagnose.java
...a/com/tanpu/fund/feign/diagnose/FeignbackForDiagnose.java
+29
-0
ProductServiceImpl.java
.../java/com/tanpu/fund/service/impl/ProductServiceImpl.java
+13
-3
No files found.
src/main/java/com/tanpu/fund/feign/diagnose/FeignClientForDiagnose.java
0 → 100644
View file @
4ee1acf9
package
com
.
tanpu
.
fund
.
feign
.
diagnose
;
import
com.tanpu.common.resp.CommonResp
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotEmpty
;
import
java.util.List
;
@FeignClient
(
value
=
"service-diagnose"
,
fallbackFactory
=
FeignbackForDiagnose
.
class
,
path
=
"/diagnose"
)
//@FeignClient(value = "service-diagnose", fallbackFactory = FeignbackForDiagnose.class, url = "http://127.0.0.1:8201/diagnose")
public
interface
FeignClientForDiagnose
{
@ApiOperation
(
"是否加入了自选"
)
@PostMapping
(
"/fund/collect"
)
CommonResp
<
List
<
String
>>
getFundCollectInfo
(
@Valid
@NotEmpty
(
message
=
"基金id不能为空"
)
@RequestBody
List
<
String
>
ids
);
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tanpu/fund/feign/diagnose/FeignbackForDiagnose.java
0 → 100644
View file @
4ee1acf9
package
com
.
tanpu
.
fund
.
feign
.
diagnose
;
import
com.alibaba.fastjson.JSON
;
import
com.tanpu.common.resp.CommonResp
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotEmpty
;
import
java.util.List
;
@Slf4j
@Component
public
class
FeignbackForDiagnose
implements
FallbackFactory
<
FeignClientForDiagnose
>
{
@Override
public
FeignClientForDiagnose
create
(
Throwable
throwable
)
{
return
new
FeignClientForDiagnose
()
{
@Override
public
CommonResp
<
List
<
String
>>
getFundCollectInfo
(
@Valid
@NotEmpty
(
message
=
"基金id不能为空"
)
List
<
String
>
ids
)
{
log
.
error
(
"请求信息"
,
throwable
);
log
.
error
(
"FeignClientForDiagnose.getFundCollectInfo 基金 收藏信息:{}"
,
JSON
.
toJSONString
(
ids
));
return
null
;
}
};
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
View file @
4ee1acf9
...
...
@@ -21,6 +21,7 @@ import com.tanpu.common.utils.BigDecimalUtil;
import
com.tanpu.fund.entity.generator.*
;
import
com.tanpu.fund.enums.FilterTypeEnum
;
import
com.tanpu.fund.enums.ProStrategyEnums
;
import
com.tanpu.fund.feign.diagnose.FeignClientForDiagnose
;
import
com.tanpu.fund.feign.user.FeignClientForFatools
;
import
com.tanpu.fund.mapper.generator.*
;
import
com.tanpu.fund.mapper.generator.custom.FundInfoCustomMapper
;
...
...
@@ -102,6 +103,9 @@ public class ProductServiceImpl implements ProductService, Constant {
@Resource
private
FeignClientForFatools
fatools
;
@Resource
private
FeignClientForDiagnose
feignClientForDiagnose
;
@Override
public
Page
<
ProductInfoVO
>
getProductList
(
ProductInfoReq
req
)
{
...
...
@@ -1547,14 +1551,17 @@ public class ProductServiceImpl implements ProductService, Constant {
infoExample
.
createCriteria
().
andIdIn
(
fundIdList
);
Map
<
String
,
String
>
fundMap
=
fundInfoMapper
.
selectByExample
(
infoExample
).
stream
().
collect
(
Collectors
.
toMap
(
FundInfo:
:
getId
,
FundInfo:
:
getFundShortName
));
List
<
String
>
checkFundIdList
=
feignClientForDiagnose
.
getFundCollectInfo
(
fundIdList
).
getAttributes
();
return
fundCounts
.
stream
().
map
(
item
->
FundSameResp
.
builder
()
.
fundId
(
item
.
getFundId
())
.
fundName
(
fundMap
.
get
(
item
.
getFundId
()))
.
ret1y
(
BigDecimalUtil
.
toString
(
item
.
getRet1y
(),
2
))
.
ret1y
(
multiply100
(
item
.
getRet1y
()))
.
isCheck
(
checkFundIdList
.
contains
(
item
.
getFundId
())
?
1
:
0
)
.
build
()).
collect
(
Collectors
.
toList
());
}
return
n
ull
;
return
n
ew
ArrayList
<>(
0
)
;
}
@Override
...
...
@@ -1576,10 +1583,13 @@ public class ProductServiceImpl implements ProductService, Constant {
fundCountMap
=
null
;
}
List
<
String
>
checkFundIdList
=
feignClientForDiagnose
.
getFundCollectInfo
(
fundIdList
).
getAttributes
();
importedFundInfoList
.
stream
().
map
(
item
->
{
FundSameResp
p
=
FundSameResp
.
builder
()
.
fundId
(
item
.
getId
())
.
fundName
(
item
.
getFundName
())
.
isCheck
(
checkFundIdList
.
contains
(
item
.
getId
())
?
1
:
0
)
.
build
();
if
(
fundCountMap
!=
null
&&
fundCountMap
.
containsKey
(
item
.
getId
()))
{
...
...
@@ -1589,7 +1599,7 @@ public class ProductServiceImpl implements ProductService, Constant {
return
p
;
}).
collect
(
Collectors
.
toList
());
return
n
ull
;
return
n
ew
ArrayList
<>(
0
)
;
}
private
ArrayList
<
TrackRecordVO
>
getPrivateFundTrackRecordVOS
(
IfaImportedFundCount
fundCount
)
{
...
...
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