Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
stockPriceTack
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘长帅
stockPriceTack
Commits
75e82c8d
Commit
75e82c8d
authored
Apr 18, 2024
by
刘长帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化总资产
parent
98e7850f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
AssetStockPositionServiceImpl.java
...ce/impl/business/asset/AssetStockPositionServiceImpl.java
+12
-5
No files found.
src/main/java/com/zfxftech/telmarket/service/impl/business/asset/AssetStockPositionServiceImpl.java
View file @
75e82c8d
...
...
@@ -18,6 +18,7 @@ import com.zfxftech.telmarket.common.pojo.dao.*;
import
com.zfxftech.telmarket.common.pojo.dao.asset.*
;
import
com.zfxftech.telmarket.common.pojo.dao.permission.UsAdmin
;
import
com.zfxftech.telmarket.common.pojo.dao.permission.UsTeamUser
;
import
com.zfxftech.telmarket.common.pojo.dao.survey.SurveyStockPosition
;
import
com.zfxftech.telmarket.common.pojo.dto.account.DataAuthorityDto
;
import
com.zfxftech.telmarket.common.pojo.dto.remind.StockPositionTask
;
import
com.zfxftech.telmarket.common.pojo.message.bo.TradingStrategyBO
;
...
...
@@ -1367,11 +1368,17 @@ public class AssetStockPositionServiceImpl extends ServiceImpl<AssetStockPositio
public
AssetMarketDetailsVO
createMarketDetailsVOTask
(
List
<
AssetStockPosition
>
stockPositions
,
BigDecimal
funding
,
AssetAccountProductRelation
accountProductRelation
)
{
AssetMarketDetailsVO
marketDetailsVO
=
new
AssetMarketDetailsVO
();
List
<
String
>
codes
=
stockPositions
.
stream
().
map
(
AssetStockPosition:
:
getCode
).
collect
(
Collectors
.
toList
());
//批量获取股票当前价格
Map
<
String
,
Quote
>
codeAndPriceMapping
=
stockCodeService
.
batchQueryStockPrice
(
codes
);
//计算股票总市值(当前)
BigDecimal
stocksTotalPrice
=
assetFinanceCalculateService
.
calculateTotalAssets
(
stockPositions
,
codeAndPriceMapping
);
BigDecimal
stocksTotalPrice
=
new
BigDecimal
(
"0"
);
if
(!
ObjectUtils
.
isEmpty
(
stockPositions
)){
List
<
String
>
codes
=
stockPositions
.
stream
().
map
(
AssetStockPosition:
:
getCode
).
collect
(
Collectors
.
toList
());
//批量获取股票当前价格
Map
<
String
,
Quote
>
codeAndPriceMapping
=
stockCodeService
.
batchQueryStockPrice
(
codes
);
//计算股票总市值(当前)
stocksTotalPrice
=
assetFinanceCalculateService
.
calculateTotalAssets
(
stockPositions
,
codeAndPriceMapping
);
}
//计算总值
BigDecimal
totalPrice
=
BigDecimalUtil
.
add
(
funding
,
stocksTotalPrice
);
//计算仓位
...
...
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