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

优化总资产

parent 98e7850f
......@@ -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);
//计算仓位
......
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