Commit 35f07c41 authored by liucx's avatar liucx

日志输出

parent f3815b4b
...@@ -141,26 +141,27 @@ public class AssetStockPriceTask implements ApplicationRunner { ...@@ -141,26 +141,27 @@ public class AssetStockPriceTask implements ApplicationRunner {
//资管 //资管
public void AccountProductRelationTask(AssetAccountProductRelation accountProductRelation) { public void AccountProductRelationTask(AssetAccountProductRelation accountProductRelation) {
Date startTime = new Date();
try { try {
String type = SIMULATED.getCode(); String type = SIMULATED.getCode();
OptionalUtil.checkNull(accountProductRelation, "当前用户产品关系不存在"); OptionalUtil.checkNull(accountProductRelation, "当前用户产品关系不存在");
//查询客户信息 //查询客户信息
Long marketId = accountProductRelation.getSimulatedMarketId(); Long marketId = accountProductRelation.getSimulatedMarketId();
//查询持仓信息 //查询持仓信息
BigDecimal funding = null; BigDecimal funding = accountProductRelation.getSimulatedFunding();
//获取可用资金 //获取可用资金
if (REAL.getCode().equals(type)) { log.info("耗时1" + DateUtil.calculateTimeGapSecond(startTime, new Date()) + "秒");
return;
}
if (SIMULATED.getCode().equals(type)) {
funding = accountProductRelation.getSimulatedFunding();
}
AssetAccountProductRelation productRelation = new AssetAccountProductRelation();
productRelation.setId(accountProductRelation.getId());
//获取所有买入过的股票 //获取所有买入过的股票
List<AssetStockPosition> stockPositions = stockPositionService.queryStockPositions(marketId); List<AssetStockPosition> stockPositions = stockPositionService.queryStockPositions(marketId);
log.info("耗时2" + DateUtil.calculateTimeGapSecond(startTime, new Date()) + "秒");
//汇总数据 //汇总数据
AssetMarketDetailsVO marketDetailsVO = stockPositionService.createMarketDetailsVOTask(stockPositions, funding, accountProductRelation); AssetMarketDetailsVO marketDetailsVO = stockPositionService.createMarketDetailsVOTask(stockPositions, funding, accountProductRelation);
log.info("耗时3" + DateUtil.calculateTimeGapSecond(startTime, new Date()) + "秒");
AssetAccountProductRelation productRelation = new AssetAccountProductRelation();
productRelation.setId(accountProductRelation.getId());
//示范盈亏比例 //示范盈亏比例
productRelation.setSimulatedTotalProfit(new BigDecimal(marketDetailsVO.getTotalProfitRate())); productRelation.setSimulatedTotalProfit(new BigDecimal(marketDetailsVO.getTotalProfitRate()));
//示范盘总资产 //示范盘总资产
......
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