Commit 75e82c8d authored by 刘长帅's avatar 刘长帅

优化总资产

parent 98e7850f
...@@ -18,6 +18,7 @@ import com.zfxftech.telmarket.common.pojo.dao.*; ...@@ -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.asset.*;
import com.zfxftech.telmarket.common.pojo.dao.permission.UsAdmin; 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.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.account.DataAuthorityDto;
import com.zfxftech.telmarket.common.pojo.dto.remind.StockPositionTask; import com.zfxftech.telmarket.common.pojo.dto.remind.StockPositionTask;
import com.zfxftech.telmarket.common.pojo.message.bo.TradingStrategyBO; import com.zfxftech.telmarket.common.pojo.message.bo.TradingStrategyBO;
...@@ -1367,11 +1368,17 @@ public class AssetStockPositionServiceImpl extends ServiceImpl<AssetStockPositio ...@@ -1367,11 +1368,17 @@ public class AssetStockPositionServiceImpl extends ServiceImpl<AssetStockPositio
public AssetMarketDetailsVO createMarketDetailsVOTask( List<AssetStockPosition> stockPositions, BigDecimal funding, AssetAccountProductRelation accountProductRelation) { public AssetMarketDetailsVO createMarketDetailsVOTask( List<AssetStockPosition> stockPositions, BigDecimal funding, AssetAccountProductRelation accountProductRelation) {
AssetMarketDetailsVO marketDetailsVO = new AssetMarketDetailsVO(); AssetMarketDetailsVO marketDetailsVO = new AssetMarketDetailsVO();
List<String> codes = stockPositions.stream().map(AssetStockPosition::getCode).collect(Collectors.toList());
//批量获取股票当前价格 BigDecimal stocksTotalPrice = new BigDecimal("0");
Map<String, Quote> codeAndPriceMapping = stockCodeService.batchQueryStockPrice(codes); if(!ObjectUtils.isEmpty(stockPositions)){
//计算股票总市值(当前) List<String> codes = stockPositions.stream().map(AssetStockPosition::getCode).collect(Collectors.toList());
BigDecimal stocksTotalPrice = assetFinanceCalculateService.calculateTotalAssets(stockPositions, codeAndPriceMapping); //批量获取股票当前价格
Map<String, Quote> codeAndPriceMapping = stockCodeService.batchQueryStockPrice(codes);
//计算股票总市值(当前)
stocksTotalPrice = assetFinanceCalculateService.calculateTotalAssets(stockPositions, codeAndPriceMapping);
}
//计算总值 //计算总值
BigDecimal totalPrice = BigDecimalUtil.add(funding, stocksTotalPrice); BigDecimal totalPrice = BigDecimalUtil.add(funding, stocksTotalPrice);
//计算仓位 //计算仓位
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment